--- psiconv/trunk/lib/psiconv/parse_layout.c 2004/01/04 22:07:02 182 +++ psiconv/trunk/lib/psiconv/parse_layout.c 2004/02/22 22:24:39 217 @@ -1,6 +1,6 @@ /* parse_layout.c - Part of psiconv, a PSION 5 file formats converter - Copyright (c) 1999, 2000 Frodo Looijaard + Copyright (c) 1999-2004 Frodo Looijaard This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -64,7 +64,7 @@ ERROR2: free(*result); ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Color failed"); + psiconv_error(config,lev+1,off,"Reading of Color failed"); if (length) *length = 0; if (res == 0) @@ -82,23 +82,27 @@ int res = 0; char *str_copy; int len=0; - int leng; + int fontlen; psiconv_progress(config,lev+1,off,"Going to parse font"); if (!(*result = malloc(sizeof(**result)))) goto ERROR1; - (*result)->name = psiconv_read_short_string(config,buf,lev+2,off+len, - &leng,&res); + fontlen = psiconv_read_u8(config,buf,lev+2,off,&res); if (res) goto ERROR2; - len += leng; + len = 1; + + (*result)->name = psiconv_read_charlist(config,buf,lev+2,off, fontlen-1,&res); + if (res) + goto ERROR2; + len += fontlen - 1; (*result)->screenfont = psiconv_read_u8(config,buf,lev+2,off+len,&res); if (res) goto ERROR3; - if (!(str_copy = psiconv_make_printable((*result)->name))) + if (!(str_copy = psiconv_make_printable(config,(*result)->name))) goto ERROR3; psiconv_debug(config,lev+2,off+len, @@ -119,7 +123,7 @@ ERROR2: free (*result); ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Font failed"); + psiconv_error(config,lev+1,off,"Reading of Font failed"); if (length) *length = 0; if (!res) @@ -214,7 +218,7 @@ ERROR2: free (result); ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Border failed"); + psiconv_error(config,lev+1,off,"Reading of Border failed"); if (length) *length = 0; if (!res) @@ -251,11 +255,12 @@ len +=leng; psiconv_progress(config,lev+2,off+len,"Going to read bullet character"); - (*result)->character = psiconv_read_u8(config,buf,lev+2,off+len,&res); + (*result)->character = psiconv_unicode_read_char(config,buf,lev+2, + off+len,&leng,&res); if (res) goto ERROR2; psiconv_debug(config,lev+2,off+len,"Character: %02x",(*result)->character); - len ++; + len += leng; psiconv_progress(config,lev+2,off+len,"Going to read indent on/off"); if ((res = psiconv_parse_bool(config,buf,lev+2,off+len,&leng,&(*result)->indent))) @@ -291,7 +296,7 @@ ERROR2: free (result); ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Bullet failed"); + psiconv_error(config,lev+1,off,"Reading of Bullet failed"); if (length) *length = 0; if (!res) @@ -347,7 +352,7 @@ ERROR2: free (result); ERROR1: - psiconv_warn(config,lev+1,off,"Reading of Tab failed"); + psiconv_error(config,lev+1,off,"Reading of Tab failed"); if (length) *length = 0; if (!res) @@ -602,8 +607,8 @@ } if (len - 4 != list_length) { - psiconv_warn(config,lev+2,off+len, - "Read past end of paragraph layout codes list. I probably lost track" + psiconv_error(config,lev+2,off+len, + "Read past end of paragraph layout codes list. I probably lost track " "somewhere!"); psiconv_debug(config,lev+2,off+len,"Read %d characters instead of %d", len-4,list_length); @@ -621,7 +626,7 @@ return 0; ERROR1: - psiconv_warn(config,lev+1,off,"Reading of paragraph_layout_list failed"); + psiconv_error(config,lev+1,off,"Reading of paragraph_layout_list failed"); if (length) *length = 0; if (!res) @@ -771,8 +776,8 @@ } if (len - 4 != list_length) { - psiconv_warn(config,lev+2,off+len, - "Read past end of character layout codes list. I probably lost track" + psiconv_error(config,lev+2,off+len, + "Read past end of character layout codes list. I probably lost track " "somewhere!"); psiconv_debug(config,lev+2,off+len,"Read %d characters instead of %d", len-4,list_length); @@ -790,7 +795,7 @@ return res; ERROR1: - psiconv_warn(config,lev+1,off,"Reading of character_layout_list failed"); + psiconv_error(config,lev+1,off,"Reading of character_layout_list failed"); if (length) *length = 0; if (!res)