Make cql_transform_rpn2cql_{stream,wrbuf} thread-safe
[yaz-moved-to-github.git] / include / yaz / cql.h
index a389ac4..f5b6ea9 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2013 Index Data.
+ * Copyright (C) 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:
@@ -96,6 +96,16 @@ int cql_parser_stream(CQL_parser cp,
 YAZ_EXPORT
 int cql_parser_stdio(CQL_parser cp, FILE *f);
 
+/** \brief configures strict mode
+    \param cp CQL parser
+    \param mode 1=enable strict mode, 0=disable strict mode
+
+    This function is similar to cql_parser_string but reads from
+    stdio FILE handle instead.
+*/
+YAZ_EXPORT
+void cql_parser_strict(CQL_parser cp, int mode);
+
 /** \brief Node type: search term */
 #define CQL_NODE_ST 1
 /** \brief Node type: boolean */
@@ -338,6 +348,22 @@ int cql_transform(cql_transform_t ct,
                   void (*pr)(const char *buf, void *client_data),
                   void *client_data);
 
+/** \brief tranforms PQF given a CQL tree
+    \param ct CQL transform handle
+    \param cn CQL node tree
+    \param addinfo additional information (if error)
+    \param pr print function
+    \param client_data data to be passed to pr
+    \retval 0 success
+    \retval != 0 error code
+
+    The result is written to a user-defined stream.
+*/
+int cql_transform_cql2rpn(cql_transform_t ct, struct cql_node *cn,
+                          char **addinfo,
+                          void (*pr)(const char *buf, void *client_data),
+                          void *client_data);
+
 /** \brief transforms PQF given a CQL tree (from FILE)
     \param ct CQL transform handle
     \param cn CQL tree