/[public]/psiconv/trunk/lib/psiconv/parse_routines.h
ViewVC logotype

Diff of /psiconv/trunk/lib/psiconv/parse_routines.h

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

Revision 55 Revision 173
1/* 1/*
2 parse_routines.h - Part of psiconv, a PSION 5 file formats converter 2 parse_routines.h - Part of psiconv, a PSION 5 file formats converter
3 Copyright (c) 1999 Frodo Looijaard <frodol@dds.nl> 3 Copyright (c) 1999, 2000 Frodo Looijaard <frodol@dds.nl>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
18*/ 18*/
19 19
20#ifndef PSICONV_PARSE_ROUTINES_H 20#ifndef PSICONV_PARSE_ROUTINES_H
21#define PSICONV_PARSE_ROUTINES_H 21#define PSICONV_PARSE_ROUTINES_H
22 22
23#include "data.h" 23#include <psiconv/configuration.h>
24#include "parse.h" 24#include <psiconv/general.h>
25#include <psiconv/data.h>
26#include <psiconv/buffer.h>
27#include <psiconv/common.h>
28#include <psiconv/parse.h>
25 29
26#ifdef __cplusplus 30#ifdef __cplusplus
27extern "C" { 31extern "C" {
28#endif /* __cplusplus */ 32#endif /* __cplusplus */
29 33
30 34
31/* ***************
32 * parse_aux.c *
33 *************** */
34
35/* These functions print error, warning, progress and debug information to
36 stderr */
37extern void psiconv_fatal(int level, psiconv_u32 off, const char *format,...);
38extern void psiconv_warn(int level, psiconv_u32 off, const char *format,...);
39extern void psiconv_progress(int level, psiconv_u32 off,
40 const char *format,...);
41extern void psiconv_debug(int level, psiconv_u32 off, const char *format,...);
42
43/* This function returns a copy of a string, that contains no ASCII codes
44 that are not printable. You should free this string yourself when you are
45 done with it. */
46extern char *psiconv_make_printable(const char *s);
47
48/* **************
49 * checkuid.c *
50 ************** */
51
52extern psiconv_u32 psiconv_checkuid(psiconv_u32 uid1,
53 psiconv_u32 uid2,psiconv_u32 uid3);
54
55/* ****************** 35/* ******************
56 * parse_simple.c * 36 * parse_simple.c *
57 ****************** */ 37 ****************** */
58 38
59extern psiconv_u8 psiconv_read_u8(const psiconv_buffer buf,int lev, 39extern psiconv_u8 psiconv_read_u8(const psiconv_config config,
60 psiconv_u32 off);
61extern psiconv_u16 psiconv_read_u16(const psiconv_buffer buf,int lev,
62 psiconv_u32 off); 40 const psiconv_buffer buf,int lev,
63extern psiconv_u32 psiconv_read_u32(const psiconv_buffer buf,int lev,
64 psiconv_u32 off);
65
66extern psiconv_S_t psiconv_read_S(const psiconv_buffer buf, int lev,
67 psiconv_u32 off, int *length); 41 psiconv_u32 off, int *status);
68extern psiconv_X_t psiconv_read_X(const psiconv_buffer buf, int lev, 42extern psiconv_u16 psiconv_read_u16(const psiconv_config config,
43 const psiconv_buffer buf,int lev,
44 psiconv_u32 off, int *status);
45extern psiconv_u32 psiconv_read_u32(const psiconv_config config,
46 const psiconv_buffer buf,int lev,
47 psiconv_u32 off, int *status);
48extern psiconv_s32 psiconv_read_sint(const psiconv_config config,
49 const psiconv_buffer buf,int lev,
50 psiconv_u32 off, int *length, int *status);
51
52extern psiconv_S_t psiconv_read_S(const psiconv_config config,
53 const psiconv_buffer buf, int lev,
69 psiconv_u32 off, int *length); 54 psiconv_u32 off, int *length, int *status);
55extern psiconv_X_t psiconv_read_X(const psiconv_config config,
56 const psiconv_buffer buf, int lev,
57 psiconv_u32 off, int *length, int *status);
70extern psiconv_length_t psiconv_read_length(const psiconv_buffer buf, int lev, 58extern psiconv_length_t psiconv_read_length(const psiconv_config config,
59 const psiconv_buffer buf, int lev,
71 psiconv_u32 off, int *length); 60 psiconv_u32 off, int *length,
61 int *status);
72extern psiconv_size_t psiconv_read_size (const psiconv_buffer buf, int lev, 62extern psiconv_size_t psiconv_read_size (const psiconv_config config,
63 const psiconv_buffer buf, int lev,
73 psiconv_u32 off, int *length); 64 psiconv_u32 off, int *length,
65 int *status);
74extern psiconv_string_t psiconv_read_string(const psiconv_buffer buf,int lev, 66extern psiconv_string_t psiconv_read_string(const psiconv_config config,
67 const psiconv_buffer buf,int lev,
75 psiconv_u32 off,int *length); 68 psiconv_u32 off,int *length,
69 int *status);
70extern psiconv_string_t psiconv_read_short_string(const psiconv_config config,
71 const psiconv_buffer buf,
72 int lev,psiconv_u32 off,
73 int *length,int *status);
76 74
77extern int psiconv_parse_bool(const psiconv_buffer buf, int lev, 75extern int psiconv_parse_bool(const psiconv_config config,
76 const psiconv_buffer buf, int lev,
78 psiconv_u32 off, int *length, 77 psiconv_u32 off, int *length,
79 psiconv_bool_t *result); 78 psiconv_bool_t *result);
79
80extern psiconv_float_t psiconv_read_float(const psiconv_config config,
81 const psiconv_buffer buf, int lev,
82 psiconv_u32 off, int *length, int *status);
83
80 84
81 85
82/* ****************** 86/* ******************
83 * parse_layout.c * 87 * parse_layout.c *
84 ****************** */ 88 ****************** */
85 89
86extern int psiconv_parse_color(const psiconv_buffer buf, int lev, 90extern int psiconv_parse_color(const psiconv_config config,
91 const psiconv_buffer buf, int lev,
87 psiconv_u32 off, int *length, 92 psiconv_u32 off, int *length,
88 psiconv_color *result); 93 psiconv_color *result);
89 94
90extern int psiconv_parse_font(const psiconv_buffer buf, int lev, 95extern int psiconv_parse_font(const psiconv_config config,
96 const psiconv_buffer buf, int lev,
91 psiconv_u32 off, int *length, 97 psiconv_u32 off, int *length,
92 psiconv_font *result); 98 psiconv_font *result);
93 99
94extern int psiconv_parse_border(const psiconv_buffer buf,int lev, 100extern int psiconv_parse_border(const psiconv_config config,
101 const psiconv_buffer buf,int lev,
95 psiconv_u32 off, int *length, 102 psiconv_u32 off, int *length,
96 psiconv_border *result); 103 psiconv_border *result);
97 104
98extern int psiconv_parse_bullet(const psiconv_buffer buf,int lev, 105extern int psiconv_parse_bullet(const psiconv_config config,
106 const psiconv_buffer buf,int lev,
99 psiconv_u32 off, int *length, 107 psiconv_u32 off, int *length,
100 psiconv_bullet *result); 108 psiconv_bullet *result);
101 109
102extern int psiconv_parse_tab(const psiconv_buffer buf, int lev, 110extern int psiconv_parse_tab(const psiconv_config config,
111 const psiconv_buffer buf, int lev,
103 psiconv_u32 off, int *length, 112 psiconv_u32 off, int *length,
104 psiconv_tab *result); 113 psiconv_tab *result);
105 114
115/* Note: the next two are special, because they modify an existing
116 layout structure! If it exits due to an unexpected error, part
117 of the structure may be modified, but it is still safe to call
118 psiconv_free_{paragraph,character}_layout_list on it (and that
119 is the only safe thing to do!) */
120
106extern int psiconv_parse_paragraph_layout_list(const psiconv_buffer buf, 121extern int psiconv_parse_paragraph_layout_list(const psiconv_config config,
122 const psiconv_buffer buf,
107 int lev, psiconv_u32 off, int *length, 123 int lev, psiconv_u32 off, int *length,
108 psiconv_paragraph_layout result); 124 psiconv_paragraph_layout result);
109 125
110extern int psiconv_parse_character_layout_list(const psiconv_buffer buf, 126extern int psiconv_parse_character_layout_list(const psiconv_config config,
127 const psiconv_buffer buf,
111 int lev, psiconv_u32 off, int *length, 128 int lev, psiconv_u32 off, int *length,
112 psiconv_character_layout result); 129 psiconv_character_layout result);
113 130
114 131
115/* **************** 132/* ****************
116 * parse_page.c * 133 * parse_page.c *
117 **************** */ 134 **************** */
118 135
119extern int psiconv_parse_page_header(const psiconv_buffer buf,int lev, 136extern int psiconv_parse_page_header(const psiconv_config config,
137 const psiconv_buffer buf,int lev,
120 psiconv_u32 off, int *length, 138 psiconv_u32 off, int *length,
121 psiconv_page_header *result); 139 psiconv_page_header *result);
122 140
123extern int psiconv_parse_page_layout_section(const psiconv_buffer buf,int lev, 141extern int psiconv_parse_page_layout_section(const psiconv_config config,
142 const psiconv_buffer buf,int lev,
124 psiconv_u32 off, int *length, 143 psiconv_u32 off, int *length,
125 psiconv_page_layout_section *result); 144 psiconv_page_layout_section *result);
126 145
127/* ****************** 146/* ******************
128 * parse_common.c * 147 * parse_common.c *
129 ****************** */ 148 ****************** */
130 149
131extern int psiconv_parse_header_section(const psiconv_buffer buf,int lev, 150extern int psiconv_parse_header_section(const psiconv_config config,
151 const psiconv_buffer buf,int lev,
132 psiconv_u32 off, int *length, 152 psiconv_u32 off, int *length,
133 psiconv_header_section *result); 153 psiconv_header_section *result);
134 154
135extern int psiconv_parse_section_table_section(const psiconv_buffer buf, 155extern int psiconv_parse_section_table_section(const psiconv_config config,
156 const psiconv_buffer buf,
136 int lev, psiconv_u32 off, 157 int lev, psiconv_u32 off,
137 int *length, 158 int *length,
138 psiconv_section_table_section *result); 159 psiconv_section_table_section *result);
139 160
140extern int psiconv_parse_application_id_section(const psiconv_buffer buf, 161extern int psiconv_parse_application_id_section(const psiconv_config config,
162 const psiconv_buffer buf,
141 int lev, psiconv_u32 off, int *length, 163 int lev, psiconv_u32 off, int *length,
142 psiconv_application_id_section *result); 164 psiconv_application_id_section *result);
143 165
144extern int psiconv_parse_text_section(const psiconv_buffer buf,int lev, 166extern int psiconv_parse_text_section(const psiconv_config config,
167 const psiconv_buffer buf,int lev,
145 psiconv_u32 off, int *length, 168 psiconv_u32 off, int *length,
146 psiconv_text_and_layout *result); 169 psiconv_text_and_layout *result);
147 170
148extern int psiconv_parse_styled_layout_section(const psiconv_buffer buf, 171extern int psiconv_parse_styled_layout_section(const psiconv_config config,
172 const psiconv_buffer buf,
149 int lev,psiconv_u32 off, 173 int lev,psiconv_u32 off,
150 int *length, 174 int *length,
151 psiconv_text_and_layout result, 175 psiconv_text_and_layout result,
152 psiconv_word_styles_section styles); 176 const psiconv_word_styles_section styles);
177
153extern int psiconv_parse_styleless_layout_section(const psiconv_buffer buf, 178extern int psiconv_parse_styleless_layout_section(const psiconv_config config,
179 const psiconv_buffer buf,
154 int lev,psiconv_u32 off, 180 int lev,psiconv_u32 off,
155 int *length, 181 int *length,
156 psiconv_text_and_layout result, 182 psiconv_text_and_layout result,
157 psiconv_character_layout base_char, 183 const psiconv_character_layout base_char,
158 psiconv_paragraph_layout base_para); 184 const psiconv_paragraph_layout base_para);
185
186extern int psiconv_parse_embedded_object_section
187 (const psiconv_config config,
188 const psiconv_buffer buf, int lev,
189 psiconv_u32 off, int *length,
190 psiconv_embedded_object_section *result);
191
192extern int psiconv_parse_object_display_section(const psiconv_config config,
193 const psiconv_buffer buf,
194 int lev,
195 psiconv_u32 off, int *length,
196 psiconv_object_display_section *result);
197
198extern int psiconv_parse_object_icon_section(const psiconv_config config,
199 const psiconv_buffer buf,int lev,
200 psiconv_u32 off, int *length,
201 psiconv_object_icon_section *result);
202
203
204
159 205
160 206
161/* ****************** 207/* ******************
162 * parse_texted.c * 208 * parse_texted.c *
163 ****************** */ 209 ****************** */
164 210
165extern int psiconv_parse_texted_section(const psiconv_buffer buf,int lev, 211extern int psiconv_parse_texted_section(const psiconv_config config,
212 const psiconv_buffer buf,int lev,
166 psiconv_u32 off, int *length, 213 psiconv_u32 off, int *length,
167 psiconv_texted_section *result, 214 psiconv_texted_section *result,
168 psiconv_character_layout base_char, 215 psiconv_character_layout base_char,
169 psiconv_paragraph_layout base_para); 216 psiconv_paragraph_layout base_para);
170 217
171 218
172/* **************** 219/* ****************
173 * parse_word.c * 220 * parse_word.c *
174 **************** */ 221 **************** */
175 222
176extern int psiconv_parse_word_status_section(const psiconv_buffer buf, int lev, 223extern int psiconv_parse_word_status_section(const psiconv_config config,
224 const psiconv_buffer buf, int lev,
177 psiconv_u32 off, int *length, 225 psiconv_u32 off, int *length,
178 psiconv_word_status_section *result); 226 psiconv_word_status_section *result);
179 227
180extern int psiconv_parse_word_styles_section(const psiconv_buffer buf, int lev, 228extern int psiconv_parse_word_styles_section(const psiconv_config config,
229 const psiconv_buffer buf, int lev,
181 psiconv_u32 off, int *length, 230 psiconv_u32 off, int *length,
182 psiconv_word_styles_section *result); 231 psiconv_word_styles_section *result);
232
233
234/* *****************
235 * parse_sheet.c *
236 ***************** */
237
238extern int psiconv_parse_sheet_status_section(const psiconv_config config,
239 const psiconv_buffer buf, int lev,
240 psiconv_u32 off, int *length,
241 psiconv_sheet_status_section *result);
242
243extern int psiconv_parse_sheet_formula_list(const psiconv_config config,
244 const psiconv_buffer buf, int lev,
245 psiconv_u32 off, int *length,
246 psiconv_formula_list *result);
247
248extern int psiconv_parse_formula(const psiconv_config config,
249 const psiconv_buffer buf, int lev,
250 psiconv_u32 off, int *length,
251 psiconv_formula *result);
252
253extern int psiconv_parse_sheet_workbook_section(const psiconv_config config,
254 const psiconv_buffer buf,
255 int lev,
256 psiconv_u32 off, int *length,
257 psiconv_sheet_workbook_section *result);
258extern int psiconv_parse_sheet_cell(const psiconv_config config,
259 const psiconv_buffer buf, int lev,
260 psiconv_u32 off, int *length,
261 psiconv_sheet_cell *result,
262 const psiconv_sheet_cell_layout default_layout,
263 const psiconv_sheet_line_list row_default_layouts,
264 const psiconv_sheet_line_list col_default_layouts);
265
266extern int psiconv_parse_sheet_cell_list(const psiconv_config config,
267 const psiconv_buffer buf, int lev,
268 psiconv_u32 off, int *length,
269 psiconv_sheet_cell_list *result,
270 const psiconv_sheet_cell_layout default_layout,
271 const psiconv_sheet_line_list row_default_layouts,
272 const psiconv_sheet_line_list col_default_layouts);
273
274extern int psiconv_parse_sheet_worksheet_list(const psiconv_config config,
275 const psiconv_buffer buf,
276 int lev,
277 psiconv_u32 off, int *length,
278 psiconv_sheet_worksheet_list *result);
279
280extern int psiconv_parse_sheet_worksheet(const psiconv_config config,
281 const psiconv_buffer buf, int lev,
282 psiconv_u32 off, int *length,
283 psiconv_sheet_worksheet *result);
284
285extern int psiconv_parse_sheet_numberformat(const psiconv_config config,
286 const psiconv_buffer buf, int lev,
287 psiconv_u32 off, int *length,
288 psiconv_sheet_numberformat result);
289
290extern int psiconv_parse_sheet_cell_layout(const psiconv_config config,
291 const psiconv_buffer buf, int lev,
292 psiconv_u32 off, int *length,
293 psiconv_sheet_cell_layout result);
294
295extern int psiconv_parse_sheet_line(const psiconv_config config,
296 const psiconv_buffer buf, int lev,
297 psiconv_u32 off, int *length,
298 psiconv_sheet_line *result,
299 const psiconv_sheet_cell_layout default_layout);
300
301extern int psiconv_parse_sheet_line_list(const psiconv_config config,
302 const psiconv_buffer buf, int lev,
303 psiconv_u32 off, int *length,
304 psiconv_sheet_line_list *result,
305 const psiconv_sheet_cell_layout default_layout);
306
307extern int psiconv_parse_sheet_name_section(const psiconv_config config,
308 const psiconv_buffer buf, int lev,
309 psiconv_u32 off, int *length,
310 psiconv_sheet_name_section *result);
311
312extern int psiconv_parse_sheet_info_section(const psiconv_config config,
313 const psiconv_buffer buf, int lev,
314 psiconv_u32 off, int *length,
315 psiconv_sheet_info_section *result);
316
317extern int psiconv_parse_sheet_variable(const psiconv_config config,
318 const psiconv_buffer buf, int lev,
319 psiconv_u32 off, int *length,
320 psiconv_sheet_variable *result);
321
322extern int psiconv_parse_sheet_variable_list(const psiconv_config config,
323 const psiconv_buffer buf, int lev,
324 psiconv_u32 off, int *length,
325 psiconv_sheet_variable_list *result);
326
327extern int psiconv_parse_sheet_grid_section(const psiconv_config config,
328 const psiconv_buffer buf, int lev,
329 psiconv_u32 off, int *length,
330 psiconv_sheet_grid_section *result);
331
332extern int psiconv_parse_sheet_grid_size_list(const psiconv_config config,
333 const psiconv_buffer buf, int lev,
334 psiconv_u32 off, int *length,
335 psiconv_sheet_grid_size_list *result);
336
337extern int psiconv_parse_sheet_grid_size(const psiconv_config config,
338 const psiconv_buffer buf, int lev,
339 psiconv_u32 off, int *length,
340 psiconv_sheet_grid_size *result);
341
342extern int psiconv_parse_sheet_grid_break_list(const psiconv_config config,
343 const psiconv_buffer buf,
344 int lev, psiconv_u32 off, int *length,
345 psiconv_sheet_grid_break_list *result);
346
347
183 348
184 349
185/* ***************** 350/* *****************
186 * parse_image.c * 351 * parse_image.c *
187 ***************** */ 352 ***************** */
188 353
189extern int psiconv_parse_paint_data_section(const psiconv_buffer buf,int lev, 354extern int psiconv_parse_paint_data_section(const psiconv_config config,
355 const psiconv_buffer buf,int lev,
190 psiconv_u32 off, int *length, 356 psiconv_u32 off, int *length,
191 int isclipart, 357 int isclipart,
192 psiconv_paint_data_section *result); 358 psiconv_paint_data_section *result);
193 359
194extern int psiconv_parse_jumptable_section(const psiconv_buffer buf,int lev, 360extern int psiconv_parse_jumptable_section(const psiconv_config config,
361 const psiconv_buffer buf,int lev,
195 psiconv_u32 off, int *length, 362 psiconv_u32 off, int *length,
196 psiconv_jumptable_section *result); 363 psiconv_jumptable_section *result);
364
197extern int psiconv_parse_sketch_section(const psiconv_buffer buf, int lev, 365extern int psiconv_parse_sketch_section(const psiconv_config config,
366 const psiconv_buffer buf, int lev,
198 psiconv_u32 off, int *length, int is_object, 367 psiconv_u32 off, int *length,
199 psiconv_sketch_section *result); 368 psiconv_sketch_section *result);
369
200extern int psiconv_parse_clipart_section(const psiconv_buffer buf, int lev, 370extern int psiconv_parse_clipart_section(const psiconv_config config,
371 const psiconv_buffer buf, int lev,
201 psiconv_u32 off, int *length, 372 psiconv_u32 off, int *length,
202 psiconv_clipart_section *result); 373 psiconv_clipart_section *result);
203 374
204 375
205 376
207 378
208/* **************** 379/* ****************
209 * parse_driver.c * 380 * parse_driver.c *
210 **************** */ 381 **************** */
211 382
212extern int psiconv_parse_texted_file(const psiconv_buffer buf,int lev, 383extern int psiconv_parse_texted_file(const psiconv_config config,
384 const psiconv_buffer buf,int lev,
213 psiconv_u32 off, psiconv_texted_f *result); 385 psiconv_u32 off, psiconv_texted_f *result);
214 386
215extern int psiconv_parse_word_file(const psiconv_buffer buf,int lev, 387extern int psiconv_parse_word_file(const psiconv_config config,
388 const psiconv_buffer buf,int lev,
216 psiconv_u32 off, psiconv_word_f *result); 389 psiconv_u32 off, psiconv_word_f *result);
217 390
218extern int psiconv_parse_mbm_file(const psiconv_buffer buf,int lev, 391extern int psiconv_parse_mbm_file(const psiconv_config config,
392 const psiconv_buffer buf,int lev,
219 psiconv_u32 off, psiconv_mbm_f *result); 393 psiconv_u32 off, psiconv_mbm_f *result);
220 394
221extern int psiconv_parse_sketch_file(const psiconv_buffer buf,int lev, 395extern int psiconv_parse_sketch_file(const psiconv_config config,
396 const psiconv_buffer buf,int lev,
222 psiconv_u32 off, psiconv_sketch_f *result); 397 psiconv_u32 off, psiconv_sketch_f *result);
223 398
224extern int psiconv_parse_clipart_file(const psiconv_buffer buf,int lev, 399extern int psiconv_parse_clipart_file(const psiconv_config config,
400 const psiconv_buffer buf,int lev,
225 psiconv_u32 off, psiconv_clipart_f *result); 401 psiconv_u32 off, psiconv_clipart_f *result);
402extern int psiconv_parse_sheet_file(const psiconv_config config,
403 const psiconv_buffer buf,int lev,
404 psiconv_u32 off, psiconv_sheet_f *result);
405
226#ifdef __cplusplus 406#ifdef __cplusplus
227} 407}
228#endif /* __cplusplus */ 408#endif /* __cplusplus */
229 409
230#endif /* PSICONV_PARSE_ROUTINES_H */ 410#endif /* PSICONV_PARSE_ROUTINES_H */

Legend:
Removed from v.55  
changed lines
  Added in v.173

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