YAZ
4.2.57
Main Page
Data Structures
Files
File List
Globals
src
cqlstdio.c
Go to the documentation of this file.
1
/* This file is part of the YAZ toolkit.
2
* Copyright (C) 1995-2013 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
15
static
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
25
static
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
34
int
cql_parser_stdio
(
CQL_parser
cp, FILE *f)
35
{
36
return
cql_parser_stream
(cp,
getbyte_stream
,
ungetbyte_stream
, f);
37
}
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
Generated on Wed May 15 2013 14:55:30 for YAZ by
1.8.1.2