/[public]/psiconv/trunk/lib/psiconv/generate_driver.c
ViewVC logotype

Diff of /psiconv/trunk/lib/psiconv/generate_driver.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 74 Revision 75
26#include "generate_routines.h" 26#include "generate_routines.h"
27 27
28 28
29int psiconv_write(psiconv_buffer *buf,const psiconv_file value) 29int psiconv_write(psiconv_buffer *buf,const psiconv_file value)
30{ 30{
31 int allocated = 0;
32 int res; 31 int res;
33 32
34 if (!value) { 33 if (!value) {
35 psiconv_warn(0,0,"Can't parse to an empty buffer!"); 34 psiconv_warn(0,0,"Can't parse to an empty buffer!");
36 return -PSICONV_E_OTHER; 35 return -PSICONV_E_OTHER;
37 } 36 }
38 if (!*buf) {
39 if (!(*buf = psiconv_new_buffer())) 37 if (!(*buf = psiconv_new_buffer()))
40 return -PSICONV_E_NOMEM; 38 return -PSICONV_E_NOMEM;
41 allocated = 1;
42 }
43 39
44#if 0 40#if 0
45 if (value->type == psiconv_word_file) { 41 if (value->type == psiconv_word_file) {
46 if ((res =psiconv_write_word_file(*buf,(psiconv_word_f) (value->file)))) 42 if ((res =psiconv_write_word_file(*buf,(psiconv_word_f) (value->file))))
47 goto ERROR; 43 goto ERROR;
71 goto ERROR; 67 goto ERROR;
72 } 68 }
73 return -PSICONV_E_OK; 69 return -PSICONV_E_OK;
74 70
75ERROR: 71ERROR:
76 if (allocated)
77 psiconv_free_buffer(*buf); 72 psiconv_free_buffer(*buf);
78 return res; 73 return res;
79} 74}
80 75
81int psiconv_write_texted_file(psiconv_buffer buf,psiconv_texted_f value) 76int psiconv_write_texted_file(psiconv_buffer buf,psiconv_texted_f value)
82{ 77{

Legend:
Removed from v.74  
changed lines
  Added in v.75

frodo@frodo.looijaard.name
ViewVC Help
Powered by ViewVC 1.1.26