… | |
… | |
44 | (*result) = malloc(sizeof(**result)); |
44 | (*result) = malloc(sizeof(**result)); |
45 | |
45 | |
46 | psiconv_progress(lev+2,off+len,"Going to read UID1 to UID3"); |
46 | psiconv_progress(lev+2,off+len,"Going to read UID1 to UID3"); |
47 | (*result)->uid1 = psiconv_read_u32(buf,lev+2,off+len); |
47 | (*result)->uid1 = psiconv_read_u32(buf,lev+2,off+len); |
48 | psiconv_debug(lev+2,off+len,"UID1: %08x",(*result)->uid1); |
48 | psiconv_debug(lev+2,off+len,"UID1: %08x",(*result)->uid1); |
|
|
49 | if ((*result)->uid1 == PSICONV_ID_CLIPART) { |
|
|
50 | /* That's all folks... */ |
|
|
51 | (*result)->file = psiconv_clipart_file; |
|
|
52 | (*result)->uid2 = 0; |
|
|
53 | (*result)->uid3 = 0; |
|
|
54 | (*result)->checksum = 0; |
|
|
55 | len += 4; |
|
|
56 | psiconv_debug(lev+2,off+len,"File is a Clipart file"); |
|
|
57 | goto DONE; |
|
|
58 | } |
49 | if ((*result)->uid1 != PSICONV_ID_PSION5) { |
59 | if ((*result)->uid1 != PSICONV_ID_PSION5) { |
50 | psiconv_warn(lev+2,off+len,"UID1 has unknown value. This is probably " |
60 | psiconv_warn(lev+2,off+len,"UID1 has unknown value. This is probably " |
51 | "not a (parsable) Psion 5 file"); |
61 | "not a (parsable) Psion 5 file"); |
52 | res = -1; |
62 | res = -1; |
53 | } |
63 | } |
… | |
… | |
66 | (*result)->file = psiconv_word_file; |
76 | (*result)->file = psiconv_word_file; |
67 | psiconv_debug(lev+2,off+len,"File is a Word file"); |
77 | psiconv_debug(lev+2,off+len,"File is a Word file"); |
68 | } else if ((*result)->uid3 == PSICONV_ID_TEXTED) { |
78 | } else if ((*result)->uid3 == PSICONV_ID_TEXTED) { |
69 | (*result)->file = psiconv_texted_file; |
79 | (*result)->file = psiconv_texted_file; |
70 | psiconv_debug(lev+2,off+len,"File is a TextEd file"); |
80 | psiconv_debug(lev+2,off+len,"File is a TextEd file"); |
|
|
81 | } else if ((*result)->uid3 == PSICONV_ID_SKETCH) { |
|
|
82 | (*result)->file = psiconv_sketch_file; |
|
|
83 | psiconv_debug(lev+2,off+len,"File is a Sketch file"); |
71 | } |
84 | } |
72 | } else if ((*result)->uid2 == PSICONV_ID_MBM_FILE) { |
85 | } else if ((*result)->uid2 == PSICONV_ID_MBM_FILE) { |
73 | (*result)->file = psiconv_mbm_file; |
86 | (*result)->file = psiconv_mbm_file; |
74 | if ((*result)->uid3 != 0x00) |
87 | if ((*result)->uid3 != 0x00) |
75 | psiconv_warn(lev+2,off+len,"UID3 set in MBM file?!?"); |
88 | psiconv_warn(lev+2,off+len,"UID3 set in MBM file?!?"); |
76 | psiconv_debug(lev+2,off+len,"File is a MBM file"); |
89 | psiconv_debug(lev+2,off+len,"File is a MBM file"); |
… | |
… | |
92 | psiconv_checkuid((*result)->uid1,(*result)->uid2, |
105 | psiconv_checkuid((*result)->uid1,(*result)->uid2, |
93 | (*result)->uid3),temp); |
106 | (*result)->uid3),temp); |
94 | res = -1; |
107 | res = -1; |
95 | } |
108 | } |
96 | len += 4; |
109 | len += 4; |
97 | |
110 | |
|
|
111 | DONE: |
98 | if (length) |
112 | if (length) |
99 | *length = len; |
113 | *length = len; |
100 | |
114 | |
101 | psiconv_progress(lev+1,off+len-1, |
115 | psiconv_progress(lev+1,off+len-1, |
102 | "End of Header Section (total length: %08x)",len); |
116 | "End of Header Section (total length: %08x)",len); |
… | |
… | |
144 | |
158 | |
145 | if (length) |
159 | if (length) |
146 | *length = len; |
160 | *length = len; |
147 | |
161 | |
148 | psiconv_progress(lev+1,off+len-1,"End of section table section " |
162 | psiconv_progress(lev+1,off+len-1,"End of section table section " |
149 | "(total length: %08x", len); |
163 | "(total length: %08x)", len); |
150 | |
164 | |
151 | return res; |
165 | return res; |
152 | } |
166 | } |
153 | |
167 | |
154 | int psiconv_parse_application_id_section(const psiconv_buffer buf, int lev, |
168 | int psiconv_parse_application_id_section(const psiconv_buffer buf, int lev, |