--- psiconv/trunk/lib/psiconv/generate_driver.c 2004/02/25 20:56:43 230 +++ psiconv/trunk/lib/psiconv/generate_driver.c 2004/02/25 20:57:10 231 @@ -110,8 +110,9 @@ psiconv_progress(config,lev,0,"Writing texted file"); if (!value) { - psiconv_error(config,0,0,"Null TextEd file"); - return -PSICONV_E_GENERATE; + psiconv_error(config,lev,0,"Null TextEd file"); + res = -PSICONV_E_GENERATE; + goto ERROR1; } if (!(section_table = psiconv_list_new(sizeof(*entry)))) { @@ -186,6 +187,10 @@ ERROR2: psiconv_list_free(section_table); ERROR1: + if (res) + psiconv_error(config,lev,0,"Writing of texted file failed"); + else + psiconv_progress(config,lev,0,"End of texted file"); return res; } @@ -199,8 +204,9 @@ psiconv_progress(config,lev,0,"Writing word file"); if (!value) { - psiconv_error(config,0,0,"Null Word file"); - return -PSICONV_E_GENERATE; + psiconv_error(config,lev,0,"Null Word file"); + res = -PSICONV_E_GENERATE; + goto ERROR1; } if (!(section_table = psiconv_list_new(sizeof(*entry)))) { @@ -283,6 +289,10 @@ ERROR2: psiconv_list_free(section_table); ERROR1: + if (res) + psiconv_error(config,lev,0,"Writing of word file failed"); + else + psiconv_progress(config,lev,0,"End of word file"); return res; } @@ -296,8 +306,9 @@ psiconv_progress(config,lev,0,"Writing sketch file"); if (!value) { - psiconv_error(config,0,0,"Null Sketch file"); - return -PSICONV_E_GENERATE; + psiconv_error(config,lev,0,"Null Sketch file"); + res = -PSICONV_E_GENERATE; + goto ERROR1; } if (!(section_table = psiconv_list_new(sizeof(*entry)))) { @@ -342,6 +353,10 @@ ERROR2: psiconv_list_free(section_table); ERROR1: + if (res) + psiconv_error(config,lev,0,"Writing of sketch file failed"); + else + psiconv_progress(config,lev,0,"End of sketch file"); return res; } @@ -355,8 +370,9 @@ psiconv_progress(config,lev,0,"Writing mbm file"); if (!value) { - psiconv_error(config,0,0,"Null MBM file"); - return -PSICONV_E_GENERATE; + psiconv_error(config,lev,0,"Null MBM file"); + res = -PSICONV_E_GENERATE; + goto ERROR1; } if (!(jumptable = psiconv_list_new(sizeof(*entry)))) { @@ -370,7 +386,7 @@ for (i = 0; i < psiconv_list_length(value->sections); i++) { if (!(section = psiconv_list_get(value->sections,i))) { - psiconv_error(config,0,0,"Massive memory corruption"); + psiconv_error(config,lev,0,"Massive memory corruption"); res = -PSICONV_E_NOMEM; goto ERROR2; } @@ -391,6 +407,10 @@ ERROR2: psiconv_list_free(jumptable); ERROR1: + if (res) + psiconv_error(config,lev,0,"Writing of mbm file failed"); + else + psiconv_progress(config,lev,0,"End of mbm file"); return res; } @@ -406,8 +426,9 @@ psiconv_progress(config,lev,0,"Writing clipart file"); if (!value) { - psiconv_error(config,0,0,"Null Clipart file"); - return -PSICONV_E_GENERATE; + psiconv_error(config,lev,0,"Null Clipart file"); + res = -PSICONV_E_GENERATE; + goto ERROR1; } if (!(jumptable = psiconv_list_new(sizeof(*entry)))) { @@ -425,7 +446,7 @@ for (i = 0; i < psiconv_list_length(value->sections); i++) { if (!(section = psiconv_list_get(value->sections,i))) { - psiconv_error(config,0,0,"Massive memory corruption"); + psiconv_error(config,lev,0,"Massive memory corruption"); res = -PSICONV_E_NOMEM; goto ERROR3; } @@ -449,5 +470,9 @@ ERROR2: psiconv_list_free(jumptable); ERROR1: + if (res) + psiconv_error(config,lev,0,"Writing of clipart file failed"); + else + psiconv_progress(config,lev,0,"End of clipart file"); return res; }