Use the error context API in espeak_ng_CompileDictionary.

This commit is contained in:
Reece H. Dunn
2016-01-04 11:28:18 +00:00
parent 9d860cb180
commit a3f0795fb7
5 changed files with 30 additions and 12 deletions
+9 -3
View File
@@ -596,17 +596,23 @@ int main(int argc, char **argv)
}
if (flag_compile) {
espeak_ng_ERROR_CONTEXT context = NULL;
#if defined(PLATFORM_DOS) || defined(PLATFORM_WINDOWS)
char path_dsource[sizeof(path_home)+20];
strcpy(path_dsource, path_home);
path_dsource[strlen(path_home)-11] = 0; // remove "espeak-data" from the end
strcat(path_dsource, "dictsource\\");
espeak_ng_STATUS status = espeak_ng_CompileDictionary(path_dsource, dictionary_name, NULL, flag_compile & 0x1);
espeak_ng_STATUS status = espeak_ng_CompileDictionary(path_dsource, dictionary_name, NULL, flag_compile & 0x1, &context);
#else
espeak_ng_STATUS status = espeak_ng_CompileDictionary(NULL, dictionary_name, NULL, flag_compile & 0x1);
espeak_ng_STATUS status = espeak_ng_CompileDictionary(NULL, dictionary_name, NULL, flag_compile & 0x1, &context);
#endif
return (status == ENS_OK) ? EXIT_SUCCESS : EXIT_FAILURE;
if (status != ENS_OK) {
espeak_ng_PrintStatusCodeMessage(status, stderr, context);
espeak_ng_ClearErrorContext(&context);
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
SetParameter(espeakRATE, speed, 0);