|
|
|
|
|
|
|
|
USHORT *prog_out_max; |
|
|
USHORT *prog_out_max; |
|
|
USHORT prog_buf[MAX_PROG_BUF+20]; |
|
|
USHORT prog_buf[MAX_PROG_BUF+20]; |
|
|
|
|
|
|
|
|
static void ReadPhondataManifest() |
|
|
|
|
|
|
|
|
static espeak_ng_STATUS ReadPhondataManifest(espeak_ng_ERROR_CONTEXT *context) |
|
|
{ |
|
|
{ |
|
|
// Read the phondata-manifest file |
|
|
// Read the phondata-manifest file |
|
|
FILE *f; |
|
|
FILE *f; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sprintf(buf, "%s%c%s", path_home, PATHSEP, "phondata-manifest"); |
|
|
sprintf(buf, "%s%c%s", path_home, PATHSEP, "phondata-manifest"); |
|
|
if ((f = fopen(buf, "r")) == NULL) |
|
|
if ((f = fopen(buf, "r")) == NULL) |
|
|
return; |
|
|
|
|
|
|
|
|
return create_file_error_context(context, errno, buf); |
|
|
|
|
|
|
|
|
while (fgets(buf, sizeof(buf), f) != NULL) |
|
|
while (fgets(buf, sizeof(buf), f) != NULL) |
|
|
n_lines++; |
|
|
n_lines++; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((manifest = (NAMETAB *)realloc(manifest, n_lines * sizeof(NAMETAB))) == NULL) { |
|
|
if ((manifest = (NAMETAB *)realloc(manifest, n_lines * sizeof(NAMETAB))) == NULL) { |
|
|
fclose(f); |
|
|
fclose(f); |
|
|
return; |
|
|
|
|
|
|
|
|
return ENOMEM; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
n_manifest = 0; |
|
|
n_manifest = 0; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
fclose(f); |
|
|
fclose(f); |
|
|
|
|
|
|
|
|
|
|
|
return ENS_OK; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static const char *KeyToMnem(keywtab_t *ktab, int type, int value) |
|
|
static const char *KeyToMnem(keywtab_t *ktab, int type, int value) |
|
|
|
|
|
|
|
|
if (f_errors != stderr && f_errors != stdout) |
|
|
if (f_errors != stderr && f_errors != stdout) |
|
|
fclose(f_errors); |
|
|
fclose(f_errors); |
|
|
|
|
|
|
|
|
ReadPhondataManifest(); |
|
|
|
|
|
|
|
|
espeak_ng_STATUS status = ReadPhondataManifest(context); |
|
|
|
|
|
if (status != ENS_OK) |
|
|
|
|
|
return status; |
|
|
|
|
|
|
|
|
return error_count > 0 ? ENS_COMPILE_ERROR : ENS_OK; |
|
|
return error_count > 0 ? ENS_COMPILE_ERROR : ENS_OK; |
|
|
} |
|
|
} |
|
|
|
|
|
|