1 /* $Id: cqlstring.c,v 1.5 2005-06-25 15:46:03 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);
50 * indent-tabs-mode: nil
52 * vim: shiftwidth=4 tabstop=8 expandtab