--- psiconv/trunk/lib/psiconv/parse_routines.h 1999/10/11 16:15:14 12 +++ psiconv/trunk/lib/psiconv/parse_routines.h 2001/01/30 23:57:28 101 @@ -1,6 +1,6 @@ /* parse_routines.h - Part of psiconv, a PSION 5 file formats converter - Copyright (c) 1999 Frodo Looijaard + Copyright (c) 1999, 2000 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 @@ -20,59 +20,49 @@ #ifndef PSICONV_PARSE_ROUTINES_H #define PSICONV_PARSE_ROUTINES_H -#include "data.h" -#include "parse.h" +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ -/* *************** - * parse_aux.c * - *************** */ - -/* These functions print error, warning, progress and debug information to - stderr */ -extern void psiconv_fatal(int level, psiconv_u32 off, const char *format,...); -extern void psiconv_warn(int level, psiconv_u32 off, const char *format,...); -extern void psiconv_progress(int level, psiconv_u32 off, - const char *format,...); -extern void psiconv_debug(int level, psiconv_u32 off, const char *format,...); - -/* This function returns a copy of a string, that contains no ASCII codes - that are not printable. You should free this string yourself when you are - done with it. */ -extern char *psiconv_make_printable(const char *s); - -/* ************** - * checkuid.c * - ************** */ - -extern psiconv_u32 psiconv_checkuid(psiconv_u32 uid1, - psiconv_u32 uid2,psiconv_u32 uid3); /* ****************** * parse_simple.c * ****************** */ extern psiconv_u8 psiconv_read_u8(const psiconv_buffer buf,int lev, - psiconv_u32 off); + psiconv_u32 off, int *status); extern psiconv_u16 psiconv_read_u16(const psiconv_buffer buf,int lev, - psiconv_u32 off); + psiconv_u32 off, int *status); extern psiconv_u32 psiconv_read_u32(const psiconv_buffer buf,int lev, - psiconv_u32 off); + psiconv_u32 off, int *status); extern psiconv_S_t psiconv_read_S(const psiconv_buffer buf, int lev, - psiconv_u32 off, int *length); + psiconv_u32 off, int *length, int *status); extern psiconv_X_t psiconv_read_X(const psiconv_buffer buf, int lev, - psiconv_u32 off, int *length); + psiconv_u32 off, int *length, int *status); extern psiconv_length_t psiconv_read_length(const psiconv_buffer buf, int lev, - psiconv_u32 off, int *length); + psiconv_u32 off, int *length, + int *status); extern psiconv_size_t psiconv_read_size (const psiconv_buffer buf, int lev, - psiconv_u32 off, int *length); + psiconv_u32 off, int *length, + int *status); extern psiconv_string_t psiconv_read_string(const psiconv_buffer buf,int lev, - psiconv_u32 off,int *length); + psiconv_u32 off,int *length, + int *status); extern int psiconv_parse_bool(const psiconv_buffer buf, int lev, psiconv_u32 off, int *length, psiconv_bool_t *result); +extern psiconv_float_t psiconv_read_float(const psiconv_buffer buf, int lev, + psiconv_u32 off, int *length, int *status); + + /* ****************** * parse_layout.c * @@ -98,6 +88,12 @@ psiconv_u32 off, int *length, psiconv_tab *result); +/* Note: the next two are special, because they modify an existing + layout structure! If it exits due to an unexpected error, part + of the structure may be modified, but it is still safe to call + psiconv_free_{paragraph,character}_layout_list on it (and that + is the only safe thing to do!) */ + extern int psiconv_parse_paragraph_layout_list(const psiconv_buffer buf, int lev, psiconv_u32 off, int *length, psiconv_paragraph_layout result); @@ -141,16 +137,16 @@ psiconv_text_and_layout *result); extern int psiconv_parse_styled_layout_section(const psiconv_buffer buf, - int lev,psiconv_u32 off, - int *length, - psiconv_text_and_layout result, - psiconv_word_styles_section styles); + int lev,psiconv_u32 off, + int *length, + psiconv_text_and_layout result, + const psiconv_word_styles_section styles); extern int psiconv_parse_styleless_layout_section(const psiconv_buffer buf, - int lev,psiconv_u32 off, - int *length, - psiconv_text_and_layout result, - psiconv_character_layout base_char, - psiconv_paragraph_layout base_para); + int lev,psiconv_u32 off, + int *length, + psiconv_text_and_layout result, + const psiconv_character_layout base_char, + const psiconv_paragraph_layout base_para); /* ****************** @@ -178,16 +174,47 @@ /* ***************** + * parse_sheet.c * + ***************** */ + +extern int psiconv_parse_sheet_status_section(const psiconv_buffer buf, int lev, + psiconv_u32 off, int *length, + psiconv_sheet_status_section *result); + +extern int psiconv_parse_sheet_formula_table(const psiconv_buffer buf, int lev, + psiconv_u32 off, int *length, + psiconv_formula_list *result); + +extern int psiconv_parse_formula(const psiconv_buffer buf, int lev, + psiconv_u32 off, int *length, + psiconv_formula *result); + +extern int psiconv_parse_sheet_workbook_section(const psiconv_buffer buf, + int lev, + psiconv_u32 off, int *length, + psiconv_sheet_workbook_section *result); + + +/* ***************** * parse_image.c * ***************** */ extern int psiconv_parse_paint_data_section(const psiconv_buffer buf,int lev, - psiconv_u32 off, int *length, + psiconv_u32 off, int *length, + int isclipart, psiconv_paint_data_section *result); -extern int psiconv_parse_mbm_jumptable_section(const psiconv_buffer buf,int lev, +extern int psiconv_parse_jumptable_section(const psiconv_buffer buf,int lev, psiconv_u32 off, int *length, - psiconv_mbm_jumptable_section *result); + psiconv_jumptable_section *result); +extern int psiconv_parse_sketch_section(const psiconv_buffer buf, int lev, + psiconv_u32 off, int *length, int is_object, + psiconv_sketch_section *result); +extern int psiconv_parse_clipart_section(const psiconv_buffer buf, int lev, + psiconv_u32 off, int *length, + psiconv_clipart_section *result); + + @@ -204,4 +231,16 @@ extern int psiconv_parse_mbm_file(const psiconv_buffer buf,int lev, psiconv_u32 off, psiconv_mbm_f *result); +extern int psiconv_parse_sketch_file(const psiconv_buffer buf,int lev, + psiconv_u32 off, psiconv_sketch_f *result); + +extern int psiconv_parse_clipart_file(const psiconv_buffer buf,int lev, + psiconv_u32 off, psiconv_clipart_f *result); +extern int psiconv_parse_sheet_file(const psiconv_buffer buf,int lev, + psiconv_u32 off, psiconv_sheet_f *result); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + #endif /* PSICONV_PARSE_ROUTINES_H */