{
printf ("Class %s not found - append all\n", classname);
eina_strbuf_append_char(header, '\n');
- eo1_header_generate(classname, header);
+ if (!eo1_header_generate(classname, header)) return EINA_FALSE;
return EINA_TRUE;
}
{
printf ("Appending eo function %s\n", funcname);
eo1_enum_append(classname, funcname, str_subid);
- eo1_fundef_generate(classname, (Eolian_Function)data, UNRESOLVED, str_funcdef);
+ if (!eo1_fundef_generate(classname, (Eolian_Function)data, UNRESOLVED, str_funcdef)) return EINA_FALSE;
}
}
if (prop_read)
{
printf ("Appending eo function %s\n", tmpstr);
eo1_enum_append(classname, tmpstr, str_subid);
- eo1_fundef_generate(classname, (Eolian_Function)data, GET, str_funcdef);
+ if (!eo1_fundef_generate(classname, (Eolian_Function)data, GET, str_funcdef)) return EINA_FALSE;
}
}
if (prop_write)
{
printf ("Appending eo function %s\n", tmpstr);
eo1_enum_append(classname, tmpstr, str_subid);
- eo1_fundef_generate(classname, (Eolian_Function)data, SET, str_funcdef);
+ if (!eo1_fundef_generate(classname, (Eolian_Function)data, SET, str_funcdef)) return EINA_FALSE;
}
}
}
Eina_Strbuf *tmpbuf = eina_strbuf_new();
Eina_Strbuf *str_bodyf = eina_strbuf_new();
- eo1_source_beginning_generate(classname, buf);
+ if (!eo1_source_beginning_generate(classname, buf)) return EINA_FALSE;
//Properties
Eolian_Function fn;
if (prop_read)
{
- eo1_bind_func_generate(classname, fn, GET, str_bodyf);
+ if (!eo1_bind_func_generate(classname, fn, GET, str_bodyf)) return EINA_FALSE;
if (legacy) _eapi_func_generate(classname, fn, GET, str_bodyf);
}
if (prop_write)
{
- eo1_bind_func_generate(classname, fn, SET, str_bodyf);
+ if (!eo1_bind_func_generate(classname, fn, SET, str_bodyf)) return EINA_FALSE;
if (legacy) _eapi_func_generate(classname, fn, SET, str_bodyf);
}
}
//Methods
EINA_LIST_FOREACH(eolian_class_functions_list_get(classname, METHOD_FUNC), itr, fn)
{
- eo1_bind_func_generate(classname, fn, UNRESOLVED, str_bodyf);
+ if (!eo1_bind_func_generate(classname, fn, UNRESOLVED, str_bodyf)) return EINA_FALSE;
if (legacy) _eapi_func_generate(classname, fn, UNRESOLVED, str_bodyf);
}
eina_strbuf_append(buf, eina_strbuf_string_get(str_bodyf));
- eo1_source_end_generate(classname, buf);
+ if (!eo1_source_end_generate(classname, buf)) return EINA_FALSE;
eina_strbuf_free(tmpbuf);
eina_strbuf_free(str_bodyf);
Eina_File *fn = eina_file_open(filename, EINA_FALSE);
if (!fn)
{
- printf ("Cant open file \"%s\" for updating.\n", filename);
+ ERR ("Cant open file \"%s\" for updating.", filename);
goto end;
}
eina_strbuf_append(hfile, (char*)eina_file_map_all(fn, EINA_FILE_SEQUENTIAL));
eina_file_close(fn);
- legacy_header_append(classname, eo_version, hfile);
+ if (!legacy_header_append(classname, eo_version, hfile))
+ {
+ ERR("Failed to generate header for %s", classname);
+ goto end;
+ }
}
else
{
- eo1_header_generate(classname, hfile);
+ if (!eo1_header_generate(classname, hfile))
+ {
+ ERR("Failed to generate header for %s", classname);
+ goto end;
+ }
}
const char *htext = eina_strbuf_string_get(hfile);
FILE* fd = fopen(filename, "w");
if (!fd)
{
- printf ("Couldn't open file %s for writing\n", filename);
+ ERR ("Couldn't open file %s for writing", filename);
goto end;
}
if (htext) fputs(htext, fd);
Eina_Bool ret = EINA_FALSE;
Eina_Strbuf *cfile = eina_strbuf_new();
- legacy_source_generate(classname, legacy_support, eo_version, cfile);
+ if (!legacy_source_generate(classname, legacy_support, eo_version, cfile))
+ {
+ ERR("Failed to generate source for %s", classname);
+ goto end;
+ }
FILE* fd = fopen(filename, (append) ? "a" : "w");
if (!fd)
{
- printf ("Couldnt open file %s for writing\n", filename);
+ ERR("Couldnt open file %s for writing", filename);
goto end;
}
const char *ctext = eina_strbuf_string_get(cfile);
Eina_File *fn = eina_file_open(filename, EINA_FALSE);
if (!fn)
{
- printf ("Cant open file \"%s\" for updating.\n", filename);
+ ERR ("Cant open file \"%s\" for updating.", filename);
goto end;
}
eina_strbuf_append(lfile, (char*)eina_file_map_all(fn, EINA_FILE_SEQUENTIAL));
eina_file_close(fn);
- legacy_header_append(classname, eo_version, lfile);
+ if (!legacy_header_append(classname, eo_version, lfile))
+ {
+ ERR("Failed to generate header for %s", classname);
+ goto end;
+ }
}
else
{
- legacy_header_generate(classname, eo_version, lfile);
+ if (!eo1_header_generate(classname, lfile))
+ {
+ ERR("Failed to generate header for %s", classname);
+ goto end;
+ }
}
FILE* fd = fopen(filename, "w");
if (!fd)
{
- printf ("Couldnt open file %s for writing\n", filename);
+ ERR ("Couldnt open file %s for writing", filename);
goto end;
}
const char *ltext = eina_strbuf_string_get(lfile);
Eina_Strbuf *hfile = eina_strbuf_new();
+ if (!eo1_header_generate(classname, hfile))
+ {
+ ERR("Failed to generate header for %s", classname);
+ goto end;
+ }
+ if (!legacy_header_generate(classname, eo_version, hfile))
+ {
+ ERR("Failed to generate header for %s", classname);
+ goto end;
+ }
+
+ const char *htext = eina_strbuf_string_get(hfile);
FILE* fd = fopen(filename, "w");
if (!fd)
{
- printf ("Couldnt open file %s for writing\n", filename);
+ ERR ("Couldnt open file %s for writing", filename);
goto end;
}
- eo1_header_generate(classname, hfile);
- legacy_header_generate(classname, eo_version, hfile);
- const char *htext = eina_strbuf_string_get(hfile);
if (htext) fputs(htext, fd);
fclose(fd);
if (!files4gen)
{
- printf("No input files specified.\nTerminating.\n");
+ ERR("No input files specified.\nTerminating.\n");
goto end;
}
{
if (!eolian_eo_file_parse(filename))
{
- printf("Error during parsing file %s\n", filename);
+ ERR("Error during parsing file %s\n", filename);
goto end;
}
}
{
if (!eolian_eo_file_parse(filename))
{
- printf("Error during parsing file %s\n", filename);
+ ERR("Error during parsing file %s\n", filename);
goto end;
}
}
if (!eo_version)
{
- printf("No eo version specified (use --eo1 or --eo2). Aborting eo generation.\n");
+ ERR("No eo version specified (use --eo1 or --eo2). Aborting eo generation.\n");
goto end;
}
case H_GEN: case H_EO_APP:
{
INF("%s header file %s\n", (gen_opt == H_EO_APP) ? "Appending" : "Generating", output_filename);
- _generate_h_file(output_filename, classname, gen_opt == H_EO_APP);
+ ret = (_generate_h_file(output_filename, classname, gen_opt == H_EO_APP)?0:1);
break;
}
case H_LEG_APP:
{
INF("Appending legacy file %s\n", output_filename);
- _generate_legacy_header_file(output_filename, classname, EINA_TRUE);
+ ret = _generate_legacy_header_file(output_filename, classname, EINA_TRUE)?0:1;
break;
}
case H_LEG_EO_GEN:
{
INF("Generating eo and legacy header file %s\n", output_filename);
- _generate_eo_and_legacy_h_file(output_filename, classname);
+ ret = _generate_eo_and_legacy_h_file(output_filename, classname)?0:1;
break;
}
case C_GEN:
{
INF("Generating source file %s\n", output_filename);
- _generate_c_file(output_filename, classname, EINA_FALSE);
+ ret = _generate_c_file(output_filename, classname, EINA_FALSE)?0:1;
break;
}
default:
- free(output_filename);
- printf("Bad generation option\n");
- goto end;
+ ERR("Bad generation option\n");
+ break;
}
free(output_filename);
}
+ else ret = 0;
- ret = 0;
end:
EINA_LIST_FREE(included_files, filename)
free((char *)filename);