1 | /* |
1 | /* |
2 | parse_texted.c - Part of psiconv, a PSION 5 file formats converter |
2 | parse_texted.c - Part of psiconv, a PSION 5 file formats converter |
3 | Copyright (c) 1999, 2000 Frodo Looijaard <frodol@dds.nl> |
3 | Copyright (c) 1999-2005 Frodo Looijaard <frodo@frodo.looijaard.name> |
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. |
… | |
… | |
51 | psiconv_progress(config,lev+2,off+len,"Going to read section id"); |
51 | psiconv_progress(config,lev+2,off+len,"Going to read section id"); |
52 | temp = psiconv_read_u32(config,buf,lev+2,off+len,&res); |
52 | temp = psiconv_read_u32(config,buf,lev+2,off+len,&res); |
53 | if (res) |
53 | if (res) |
54 | goto ERROR2; |
54 | goto ERROR2; |
55 | if (temp != PSICONV_ID_TEXTED_BODY) { |
55 | if (temp != PSICONV_ID_TEXTED_BODY) { |
56 | psiconv_warn(config,lev+2,off+len, |
56 | psiconv_error(config,lev+2,off+len, |
57 | "Page header section body id not found"); |
57 | "Page header section body id not found"); |
58 | psiconv_debug(config,lev+2,off+len, |
58 | psiconv_debug(config,lev+2,off+len, |
59 | "Page body id: read %08x, expected %08x",temp, |
59 | "Page body id: read %08x, expected %08x",temp, |
60 | PSICONV_ID_TEXTED); |
60 | PSICONV_ID_TEXTED); |
61 | res = -PSICONV_E_PARSE; |
61 | res = -PSICONV_E_PARSE; |
… | |
… | |
132 | ERROR3: |
132 | ERROR3: |
133 | psiconv_free_text_and_layout((*result)->paragraphs); |
133 | psiconv_free_text_and_layout((*result)->paragraphs); |
134 | ERROR2: |
134 | ERROR2: |
135 | free (*result); |
135 | free (*result); |
136 | ERROR1: |
136 | ERROR1: |
137 | psiconv_warn(config,lev+1,off,"Reading of TextEd Section failed"); |
137 | psiconv_error(config,lev+1,off,"Reading of TextEd Section failed"); |
138 | if (length) |
138 | if (length) |
139 | *length = 0; |
139 | *length = 0; |
140 | if (!res) |
140 | if (!res) |
141 | return -PSICONV_E_NOMEM; |
141 | return -PSICONV_E_NOMEM; |
142 | else |
142 | else |