X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=include%2Fyaz%2Fcql.h;h=64c1266ffe9f9b55bb9a1d33026ca62ba21f5a6a;hp=817e04b3e324bf669f587d6199acefabd073fb6c;hb=b0be69c0a676f1702f12b2ea17cd73f9ebb08ea2;hpb=2cf1b669768e41118f6937dd0afab37c8ed586a8 diff --git a/include/yaz/cql.h b/include/yaz/cql.h index 817e04b..64c1266 100644 --- a/include/yaz/cql.h +++ b/include/yaz/cql.h @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2011 Index Data. + * Copyright (C) 1995-2012 Index Data. * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -260,6 +260,17 @@ int cql_to_ccl(struct cql_node *cn, YAZ_EXPORT void cql_to_ccl_stdio(struct cql_node *cn, FILE *f); +/** \brief converts CQL tree to CCL and writes result to buffer + \param cn CQL node (tree) + \param out buffer + \param max size of buffer (max chars to write) + \retval 0 OK + \retval -1 conversion error + \retval -2 buffer too small (truncated) + */ +YAZ_EXPORT +int cql_to_ccl_buf(struct cql_node *cn, char *out, int max); + /** \brief stream handle for file (used by cql_to_xml_stdio) */ YAZ_EXPORT void cql_fputs(const char *buf, void *client_data);