--- psiconv/trunk/lib/psiconv/parse.h 1999/10/27 13:09:40 18 +++ psiconv/trunk/lib/psiconv/parse.h 2000/12/25 22:25:33 79 @@ -1,6 +1,6 @@ /* parse.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 @@ -17,24 +17,38 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* Declarations only needed for the parser */ +/* Declarations only needed for the parser. If you want to parse, just + include this. */ #ifndef PSICONV_PARSE_H #define PSICONV_PARSE_H -#include "data.h" -typedef psiconv_list psiconv_buffer; /* of u8 */ +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ extern psiconv_file_type_t psiconv_file_type(psiconv_buffer buf, int *length, psiconv_header_section *result); -extern int psiconv_parse(const psiconv_buffer buf,psiconv_file *result); -extern int psiconv_verbosity; +/* Parses a Psion file. If its return-value is non-zero, something has + gone horribly wrong (badly corrupted file, or out of memory, usually), + and *result is undefined and unallocated; in normal cases, memory is + allocated to it and it is up to you to free it (using psiconv_free_file; + this is valid even if (*result)->file equals NULL). + Note that (*result)->file may be NULL if this file type is unknown + or unsupported! */ +extern int psiconv_parse(const psiconv_buffer buf,psiconv_file *result); -#define PSICONV_VERB_DEBUG 4 -#define PSICONV_VERB_PROGRESS 3 -#define PSICONV_VERB_WARN 2 -#define PSICONV_VERB_SILENT 1 +#ifdef __cplusplus +} +#endif /* __cplusplus */ #endif /* def PSICONV_PARSE_H */