1 /* $Id: cqlstring.c,v 1.4 2005-01-15 19:47:11 adam Exp $
2 Copyright (C) 1995-2005, Index Data ApS
5 This file is part of the YAZ toolkit.
7 See the file LICENSE for details.
12 * \brief Implements query stream reader that reads from a C string.
22 static int getbuf(void *vp)
24 struct cql_buf_info *bi = (struct cql_buf_info *) vp;
25 if (bi->str[bi->off] == 0)
27 return bi->str[bi->off++];
30 static void ungetbuf(int b, void *vp)
32 struct cql_buf_info *bi = (struct cql_buf_info *) vp;
37 int cql_parser_string(CQL_parser cp, const char *str)
39 struct cql_buf_info b;
44 return cql_parser_stream(cp, getbuf, ungetbuf, &b);