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