… | |
… | |
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 | goto DONE; |
|
|
57 | } |
49 | if ((*result)->uid1 != PSICONV_ID_PSION5) { |
58 | if ((*result)->uid1 != PSICONV_ID_PSION5) { |
50 | psiconv_warn(lev+2,off+len,"UID1 has unknown value. This is probably " |
59 | psiconv_warn(lev+2,off+len,"UID1 has unknown value. This is probably " |
51 | "not a (parsable) Psion 5 file"); |
60 | "not a (parsable) Psion 5 file"); |
52 | res = -1; |
61 | res = -1; |
53 | } |
62 | } |
… | |
… | |
95 | psiconv_checkuid((*result)->uid1,(*result)->uid2, |
104 | psiconv_checkuid((*result)->uid1,(*result)->uid2, |
96 | (*result)->uid3),temp); |
105 | (*result)->uid3),temp); |
97 | res = -1; |
106 | res = -1; |
98 | } |
107 | } |
99 | len += 4; |
108 | len += 4; |
100 | |
109 | |
|
|
110 | DONE: |
101 | if (length) |
111 | if (length) |
102 | *length = len; |
112 | *length = len; |
103 | |
113 | |
104 | psiconv_progress(lev+1,off+len-1, |
114 | psiconv_progress(lev+1,off+len-1, |
105 | "End of Header Section (total length: %08x)",len); |
115 | "End of Header Section (total length: %08x)",len); |
… | |
… | |
147 | |
157 | |
148 | if (length) |
158 | if (length) |
149 | *length = len; |
159 | *length = len; |
150 | |
160 | |
151 | psiconv_progress(lev+1,off+len-1,"End of section table section " |
161 | psiconv_progress(lev+1,off+len-1,"End of section table section " |
152 | "(total length: %08x", len); |
162 | "(total length: %08x)", len); |
153 | |
163 | |
154 | return res; |
164 | return res; |
155 | } |
165 | } |
156 | |
166 | |
157 | int psiconv_parse_application_id_section(const psiconv_buffer buf, int lev, |
167 | int psiconv_parse_application_id_section(const psiconv_buffer buf, int lev, |