YAZ 5.35.1
cqlstdio.c
Go to the documentation of this file.
1/* This file is part of the YAZ toolkit.
2 * Copyright (C) Index Data
3 * See the file LICENSE for details.
4 */
9#if HAVE_CONFIG_H
10#include <config.h>
11#endif
12
13#include <yaz/cql.h>
14
15static int getbyte_stream(void *client_data)
16{
17 FILE *f = (FILE*) client_data;
18
19 int c = fgetc(f);
20 if (c == EOF)
21 return 0;
22 return c;
23}
24
25static void ungetbyte_stream(int c, void *client_data)
26{
27 FILE *f = (FILE*) client_data;
28
29 if (c == 0)
30 c = EOF;
31 ungetc(c, f);
32}
33
38
39
40/*
41 * Local variables:
42 * c-basic-offset: 4
43 * c-file-style: "Stroustrup"
44 * indent-tabs-mode: nil
45 * End:
46 * vim: shiftwidth=4 tabstop=8 expandtab
47 */
48
int cql_parser_stream(CQL_parser cp, int(*getbyte)(void *client_data), void(*ungetbyte)(int b, void *client_data), void *client_data)
parses CQL query (query stream)
Definition cql.c:1864
Header with public definitions about CQL.
static int getbyte_stream(void *client_data)
Definition cqlstdio.c:15
static void ungetbyte_stream(int c, void *client_data)
Definition cqlstdio.c:25
int cql_parser_stdio(CQL_parser cp, FILE *f)
parses CQL query (from FILE)
Definition cqlstdio.c:34