[7bb8184] | 1 | /* datain.h |
---|
| 2 | * Header file for code that... |
---|
| 3 | * Reads in survey files, dealing with special characters, keywords & data |
---|
| 4 | * Copyright (C) 1994-2002,2005,2010 Olly Betts |
---|
| 5 | * |
---|
| 6 | * This program is free software; you can redistribute it and/or modify |
---|
| 7 | * it under the terms of the GNU General Public License as published by |
---|
| 8 | * the Free Software Foundation; either version 2 of the License, or |
---|
| 9 | * (at your option) any later version. |
---|
| 10 | * |
---|
| 11 | * This program is distributed in the hope that it will be useful, |
---|
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 14 | * GNU General Public License for more details. |
---|
| 15 | * |
---|
| 16 | * You should have received a copy of the GNU General Public License |
---|
| 17 | * along with this program; if not, write to the Free Software |
---|
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
| 19 | */ |
---|
| 20 | |
---|
| 21 | #ifdef HAVE_SETJMP_H |
---|
| 22 | # include <setjmp.h> |
---|
| 23 | #endif |
---|
| 24 | |
---|
| 25 | #include <stdio.h> /* for FILE */ |
---|
| 26 | |
---|
| 27 | typedef struct parse { |
---|
| 28 | FILE *fh; |
---|
| 29 | const char *filename; |
---|
| 30 | unsigned int line; |
---|
| 31 | bool reported_where; |
---|
| 32 | struct parse *parent; |
---|
| 33 | #ifdef HAVE_SETJMP_H |
---|
| 34 | jmp_buf jbSkipLine; |
---|
| 35 | #endif |
---|
| 36 | } parse; |
---|
| 37 | |
---|
| 38 | extern int ch; |
---|
| 39 | extern parse file; |
---|
| 40 | extern bool f_export_ok; |
---|
| 41 | |
---|
| 42 | #define nextch() (ch = GETC(file.fh)) |
---|
| 43 | |
---|
| 44 | typedef struct { |
---|
| 45 | long offset; |
---|
| 46 | int ch; |
---|
| 47 | } filepos; |
---|
| 48 | |
---|
| 49 | void get_pos(filepos *fp); |
---|
| 50 | void set_pos(const filepos *fp); |
---|
| 51 | |
---|
| 52 | void skipblanks(void); |
---|
| 53 | |
---|
| 54 | /* reads complete data file */ |
---|
| 55 | void data_file(const char *pth, const char *fnm); |
---|
| 56 | |
---|
| 57 | void skipline(void); |
---|
| 58 | |
---|
| 59 | void compile_warning(int en, ...); |
---|
| 60 | void compile_error(int en, ...); |
---|
| 61 | void compile_error_skip(int en, ...); |
---|
| 62 | |
---|
| 63 | void compile_error_token(int en); |
---|