6 #include "carma/szaarrayutils/freelist.h"
10 typedef struct InputStream InputStream;
14 typedef struct InputSource InputSource;
28 #define INPUT_READ_FN(fn) int (fn)(InputSource *source)
38 #define INPUT_DEL_FN(fn) void *(fn)(void *data)
49 #define INPUT_CLR_FN(fn) int (fn)(InputSource *source)
61 #define INPUT_ERR_FN(fn) int (fn)(InputSource *source)
65 enum {INPUT_WORKLEN=10240};
69 enum {INPUT_ERR_LEN=81};
74 INPUT_READ_FN(*read_fn);
75 INPUT_CLR_FN(*clr_fn);
76 INPUT_ERR_FN(*err_fn);
77 INPUT_DEL_FN(*del_fn);
92 char work[INPUT_WORKLEN];
99 InputStream *new_InputStream(
void);
106 InputStream *del_InputStream(InputStream *stream);
115 int open_InputStream(InputStream *stream,
void *data,
116 INPUT_READ_FN(*read_fn), INPUT_CLR_FN(*clr_fn),
117 INPUT_ERR_FN(*err_fn), INPUT_DEL_FN(*del_fn));
123 void close_InputStream(InputStream *stream);
129 int open_FileInputStream(InputStream *stream,
char *dir,
char *name);
130 int open_StringInputStream(InputStream *stream,
int copy,
char *
string);
131 int open_StdioInputStream(InputStream *stream,
int do_close, FILE *fp);
138 int reset_InputStream(InputStream *stream);
146 int read_InputStream(InputStream *stream,
int tell);
151 int input_skip_to_eol(InputStream *stream,
int tell);
152 int input_skip_past_eol(InputStream *stream,
int tell);
153 int input_skip_space(InputStream *stream,
int tell,
int advance);
154 int input_skip_white(InputStream *stream,
int tell,
int advance);
163 int input_keyword(InputStream *stream,
int tell,
int fold);
164 int inputEnumKeyword(InputStream *stream,
int tell,
int fold);
165 int input_regexp_keyword(InputStream *stream,
int tell,
int fold);
166 int input_board_regexp_keyword(InputStream *stream,
int tell,
int fold);
173 int input_quoted_string(InputStream *stream,
int tell);
180 #define IS_LITERAL_FN(fn) int (fn)(int c)
193 int input_literal(InputStream *stream,
int tell,
char *opn,
char *cls,
194 IS_LITERAL_FN(*is_literal),
char *nl_escapes);
202 int input_word(InputStream *stream,
int tell,
int fold);
210 int input_long(InputStream *stream,
int tell,
int anybase,
long *lval);
218 int input_ulong(InputStream *stream,
int tell,
int anybase,
unsigned long *ulval);
223 int input_double(InputStream *stream,
int tell,
double *dval);
237 int input_number(InputStream *stream,
int tell,
int sign_ok, Number *number);
246 int input_sexagesimal(InputStream *stream,
int tell,
double *result);
251 int input_date(InputStream *stream,
int tell,
int *year,
int *month,
int *day);
263 int input_time(InputStream *stream,
int tell,
int *hour,
int *min,
double *sec);
282 int input_date_and_time(InputStream *stream,
int tell,
int nospace,
int *year,
283 int *month,
int *day,
int *hour,
int *min,
double *sec);
294 int input_interval(InputStream *stream,
int tell,
double *interval);
332 #define CHECK_FORMAT __attribute__ ((format (printf, 3, 4)))
343 int input_error(InputStream *stream,
int tell,
const char *fmt, ...) CHECK_FORMAT;
345 void input_verror(InputStream *stream,
const char *fmt, va_list args);
347 IS_LITERAL_FN(isHostName);