source: git/src/datain.h @ 870439d

RELEASE/1.0
Last change on this file since 870439d was 870439d, checked in by Olly Betts <olly@…>, 13 years ago

Backport change from 1.2.0:
src/: Use GETC() and PUTC() everywhere.

git-svn-id: file:///home/survex-svn/survex/branches/1.0@3709 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

  • Property mode set to 100644
File size: 1.6 KB
RevLine 
[b0d908e]1/* datain.h
[d1b1380]2 * Header file for code that...
3 * Reads in survey files, dealing with special characters, keywords & data
[f6d18aef]4 * Copyright (C) 1994-2002,2005 Olly Betts
[846746e]5 *
[89231c4]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.
[846746e]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
[89231c4]13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
[846746e]15 *
[89231c4]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
[1b71c05]18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
[d1b1380]19 */
20
[7d5f3c0]21#ifdef HAVE_SETJMP_H
[647407d]22# include <setjmp.h>
[d1b1380]23#endif
24
[a420b49]25#include <stdio.h> /* for FILE */
26
27typedef struct parse {
[58cc1fb]28   FILE *fh;
[a63fb408]29   const char *filename;
[a420b49]30   unsigned int line;
[b0d908e]31   bool reported_where;
[421b7d2]32   struct parse *parent;
[7d5f3c0]33#ifdef HAVE_SETJMP_H
[58cc1fb]34   jmp_buf jbSkipLine;
[d1b1380]35#endif
36} parse;
[58cc1fb]37
38extern int ch;
[d1b1380]39extern parse file;
[932f7e9]40extern bool f_export_ok;
[d1b1380]41
[870439d]42#define nextch() (ch = GETC(file.fh))
[c80bd34]43
44typedef struct {
45   long offset;
46   int ch;
47} filepos;
48
49void get_pos(filepos *fp);
50void set_pos(const filepos *fp);
[d1b1380]51
[a9f5117]52void skipblanks(void);
[d1b1380]53
[3a54fd29]54/* reads complete data file */
[a9f5117]55void data_file(const char *pth, const char *fnm);
[3a54fd29]56
[a9f5117]57void skipline(void);
[d1b1380]58
[a420b49]59void compile_warning(int en, ...);
60void compile_error(int en, ...);
[fa42426]61void compile_error_skip(int en, ...);
[39fba51]62
63void compile_error_token(int en);
Note: See TracBrowser for help on using the repository browser.