1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2008 Index Data
3 * See the file LICENSE for details.
8 * \brief Implements query stream reader that reads from a C string.
18 static int getbuf(void *vp)
20 struct cql_buf_info *bi = (struct cql_buf_info *) vp;
21 if (bi->str[bi->off] == 0)
23 return bi->str[bi->off++];
26 static void ungetbuf(int b, void *vp)
28 struct cql_buf_info *bi = (struct cql_buf_info *) vp;
33 int cql_parser_string(CQL_parser cp, const char *str)
35 struct cql_buf_info b;
40 return cql_parser_stream(cp, getbuf, ungetbuf, &b);
46 * indent-tabs-mode: nil
48 * vim: shiftwidth=4 tabstop=8 expandtab