--- psiconv/trunk/lib/psiconv/parse_common.c 1999/10/03 21:10:47 2 +++ psiconv/trunk/lib/psiconv/parse_common.c 1999/12/04 00:40:10 43 @@ -18,6 +18,7 @@ */ #include "config.h" +#include "compat.h" #include #include @@ -45,6 +46,16 @@ psiconv_progress(lev+2,off+len,"Going to read UID1 to UID3"); (*result)->uid1 = psiconv_read_u32(buf,lev+2,off+len); psiconv_debug(lev+2,off+len,"UID1: %08x",(*result)->uid1); + if ((*result)->uid1 == PSICONV_ID_CLIPART) { + /* That's all folks... */ + (*result)->file = psiconv_clipart_file; + (*result)->uid2 = 0; + (*result)->uid3 = 0; + (*result)->checksum = 0; + len += 4; + psiconv_debug(lev+2,off+len,"File is a Clipart file"); + goto DONE; + } if ((*result)->uid1 != PSICONV_ID_PSION5) { psiconv_warn(lev+2,off+len,"UID1 has unknown value. This is probably " "not a (parsable) Psion 5 file"); @@ -67,8 +78,16 @@ } else if ((*result)->uid3 == PSICONV_ID_TEXTED) { (*result)->file = psiconv_texted_file; psiconv_debug(lev+2,off+len,"File is a TextEd file"); - } - } + } else if ((*result)->uid3 == PSICONV_ID_SKETCH) { + (*result)->file = psiconv_sketch_file; + psiconv_debug(lev+2,off+len,"File is a Sketch file"); + } + } else if ((*result)->uid2 == PSICONV_ID_MBM_FILE) { + (*result)->file = psiconv_mbm_file; + if ((*result)->uid3 != 0x00) + psiconv_warn(lev+2,off+len,"UID3 set in MBM file?!?"); + psiconv_debug(lev+2,off+len,"File is a MBM file"); + } } if ((*result)->file == psiconv_unknown_file) { psiconv_warn(lev+2,off+len,"Unknown file type"); @@ -88,13 +107,8 @@ res = -1; } len += 4; - - psiconv_progress(lev+2,off+len,"Going to read Section Table Section offset"); - (*result)->section_table_offset = psiconv_read_u32(buf,lev+2,off+len); - psiconv_debug(lev+2,off+len,"Section Table Section starts at offset %08x", - (*result)->section_table_offset) ; - len += 4; +DONE: if (length) *length = len; @@ -146,7 +160,7 @@ *length = len; psiconv_progress(lev+1,off+len-1,"End of section table section " - "(total length: %08x", len); + "(total length: %08x)", len); return res; }