mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-12-01 14:30:37 +00:00
code cleanup: Add new source file common.h for misc functions.
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
#include <espeak-ng/encoding.h>
|
||||
|
||||
#include "speech.h"
|
||||
#include "common.h" // for GetFileLength
|
||||
#include "dictionary.h" // for GetTranslatedPhonemeString, strncpy0
|
||||
#include "espeak_command.h" // for delete_espeak_command, SetParameter
|
||||
#include "event.h" // for event_declare, event_clear_all, eve...
|
||||
@@ -302,18 +303,6 @@ ESPEAK_NG_API espeak_ng_STATUS espeak_ng_InitializeOutput(espeak_ng_OUTPUT_MODE
|
||||
return ENS_OK;
|
||||
}
|
||||
|
||||
int GetFileLength(const char *filename)
|
||||
{
|
||||
struct stat statbuf;
|
||||
|
||||
if (stat(filename, &statbuf) != 0)
|
||||
return -errno;
|
||||
|
||||
if (S_ISDIR(statbuf.st_mode))
|
||||
return -EISDIR;
|
||||
|
||||
return statbuf.st_size;
|
||||
}
|
||||
|
||||
ESPEAK_NG_API void espeak_ng_InitializePath(const char *path)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user