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

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

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

Revision 184 Revision 217
1/* 1/*
2 generate_common.c - Part of psiconv, a PSION 5 file formats converter 2 generate_common.c - Part of psiconv, a PSION 5 file formats converter
3 Copyright (c) 2000 Frodo Looijaard <frodol@dds.nl> 3 Copyright (c) 2000-2004 Frodo Looijaard <frodol@dds.nl>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
113 psiconv_error(config,0,psiconv_buffer_length(buf),"Massive memory corruption"); 113 psiconv_error(config,0,psiconv_buffer_length(buf),"Massive memory corruption");
114 res = -PSICONV_E_NOMEM; 114 res = -PSICONV_E_NOMEM;
115 goto ERROR; 115 goto ERROR;
116 } 116 }
117 for (j = 0; j < psiconv_unicode_strlen(paragraph->text); j++) 117 for (j = 0; j < psiconv_unicode_strlen(paragraph->text); j++)
118 if ((res = psiconv_write_u8(config,extra_buf,lev+1, 118 if ((res = psiconv_unicode_write_char(config,extra_buf,lev+1,
119 psiconv_unicode_to_char(config,paragraph->text[j])))) 119 paragraph->text[j])))
120 goto ERROR; 120 goto ERROR;
121 psiconv_write_u8(config,extra_buf,lev+1,0x06); 121 psiconv_unicode_write_char(config,extra_buf,lev+1,0x06);
122 } 122 }
123 if ((res = psiconv_write_X(config,buf,lev+1,psiconv_buffer_length(extra_buf)))) 123 if ((res = psiconv_write_X(config,buf,lev+1,psiconv_buffer_length(extra_buf))))
124 goto ERROR; 124 goto ERROR;
125 res = psiconv_buffer_concat(buf,extra_buf); 125 res = psiconv_buffer_concat(buf,extra_buf);
126 } else 126 } else
417 goto ERROR3; 417 goto ERROR3;
418 if (!(styles_section->normal->paragraph = 418 if (!(styles_section->normal->paragraph =
419 psiconv_clone_paragraph_layout(base_para))) 419 psiconv_clone_paragraph_layout(base_para)))
420 goto ERROR4; 420 goto ERROR4;
421 styles_section->normal->hotkey = 0; 421 styles_section->normal->hotkey = 0;
422 if ((res = psiconv_unicode_from_chars(config,"", 422 if (!(styles_section->normal->name = psiconv_unicode_empty_string()))
423 &styles_section->normal->name)))
424 goto ERROR5; 423 goto ERROR5;
425 if (!(styles_section->styles = psiconv_list_new(sizeof( 424 if (!(styles_section->styles = psiconv_list_new(sizeof(
426 struct psiconv_word_style_s)))) 425 struct psiconv_word_style_s))))
427 goto ERROR6; 426 goto ERROR6;
428 427
523 522
524 if ((res = psiconv_buffer_resolve(extra_buf))) 523 if ((res = psiconv_buffer_resolve(extra_buf)))
525 goto ERROR2; 524 goto ERROR2;
526 if ((res = psiconv_buffer_concat(buf,extra_buf))) 525 if ((res = psiconv_buffer_concat(buf,extra_buf)))
527 goto ERROR2; 526 goto ERROR2;
527 psiconv_buffer_free(extra_buf);
528 528
529 return 0; 529 return 0;
530 530
531ERROR2: 531ERROR2:
532 psiconv_buffer_free(extra_buf); 532 psiconv_buffer_free(extra_buf);

Legend:
Removed from v.184  
changed lines
  Added in v.217

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