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

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

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

Revision 70 Revision 142
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18*/ 18*/
19 19
20#include "config.h" 20#include "config.h"
21#include "compat.h"
22
21#include <stdlib.h> 23#include <stdlib.h>
24
22#include "parse_routines.h" 25#include "parse_routines.h"
26#include "error.h"
27
28#ifdef DMALLOC
29#include <dmalloc.h>
30#endif
23 31
24int psiconv_parse_word_status_section(const psiconv_buffer buf, int lev, 32int psiconv_parse_word_status_section(const psiconv_buffer buf, int lev,
25 psiconv_u32 off, int *length, 33 psiconv_u32 off, int *length,
26 psiconv_word_status_section *result) 34 psiconv_word_status_section *result)
27{ 35{
133 psiconv_debug(lev+2,off+len,"Cursor position: %08x", 141 psiconv_debug(lev+2,off+len,"Cursor position: %08x",
134 (*result)->cursor_position); 142 (*result)->cursor_position);
135 len += 0x04; 143 len += 0x04;
136 144
137 psiconv_progress(lev+2,off+len,"Going to read display size"); 145 psiconv_progress(lev+2,off+len,"Going to read display size");
138 (*result)->cursor_position = psiconv_read_u32(buf,lev+2,off + len,&res); 146 (*result)->display_size = psiconv_read_u32(buf,lev+2,off + len,&res);
139 if (res) 147 if (res)
140 goto ERROR2; 148 goto ERROR2;
141 psiconv_debug(lev+2,off+len,"Display size: %08x", 149 psiconv_debug(lev+2,off+len,"Display size: %08x",
142 (*result)->cursor_position); 150 (*result)->display_size);
143 len += 0x04; 151 len += 0x04;
144 152
145 if (length) 153 if (length)
146 *length = len; 154 *length = len;
147 155
319 style->paragraph))) 327 style->paragraph)))
320 goto ERROR8; 328 goto ERROR8;
321 len += leng; 329 len += leng;
322 } 330 }
323 331
332 psiconv_progress(lev+2,off+len,"Reading trailing bytes");
333 for (i = 0; i < psiconv_list_length((*result)->styles); i++) {
334 temp = psiconv_read_u8(buf,lev+3,off+len,&res);
335 if (res)
336 goto ERROR4;
337 if (temp != 0xff) {
338 psiconv_warn(lev+3,off+len,"Unknown trailing style byte");
339 psiconv_debug(lev+3,off+len,"Trailing byte: %02x expected, read %02x",
340 0xff,temp);
341 } else
342 psiconv_debug(lev+3,off+len,"Read trailing byte 0xff");
343 len++;
344 }
345
324 if (length) 346 if (length)
325 *length = len; 347 *length = len;
326 348
327 psiconv_progress(lev,off+len-1, 349 psiconv_progress(lev,off+len-1,
328 "End of word styles section (total length: %08x)", len); 350 "End of word styles section (total length: %08x)", len);

Legend:
Removed from v.70  
changed lines
  Added in v.142

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