Refactor record render to separate source
[yaz-moved-to-github.git] / include / yaz / cql.h
index 458d630..8da61d0 100644 (file)
@@ -1,5 +1,5 @@
-/*
- * Copyright (c) 1995-2007, Index Data
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2010 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:
@@ -24,7 +24,6 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-/* $Id: cql.h,v 1.19 2007-11-14 21:03:59 adam Exp $ */
 
 /** \file cql.h
     \brief Header with public definitions about CQL.
@@ -121,6 +120,8 @@ struct cql_node {
             char *relation_uri;
             /** relation modifiers */
             struct cql_node *modifiers;
+            /** term list */
+            struct cql_node *extra_terms;
         } st;
         /** which == CQL_NODE_BOOL */
         struct {
@@ -226,6 +227,12 @@ void cql_fputs(const char *buf, void *client_data);
 */
 typedef struct cql_transform_t_ *cql_transform_t;
 
+/** \brief creates a CQL transform handle
+    \returns transform handle or NULL for failure
+*/
+YAZ_EXPORT
+cql_transform_t cql_transform_create(void);
+
 /** \brief creates a CQL transform handle from am opened file handle
     \param f file where transformation spec is read
     \returns transform handle or NULL for failure
@@ -243,6 +250,19 @@ cql_transform_t cql_transform_open_FILE (FILE *f);
 YAZ_EXPORT
 cql_transform_t cql_transform_open_fname(const char *fname);
 
+
+/** \brief defines CQL transform pattern
+    \param ct CQL transform handle
+    \param pattern pattern string
+    \param value pattern value
+    \returns 0 for succes; -1 for failure
+*/
+YAZ_EXPORT
+int cql_transform_define_pattern(cql_transform_t ct, const char *pattern,
+                                 const char *value);
+    
+
+
 /** \brief destroys a CQL transform handle
     \param ct CQL transform handle
  */
@@ -299,6 +319,14 @@ int cql_transform_buf(cql_transform_t ct,
 YAZ_EXPORT
 int cql_transform_error(cql_transform_t ct, const char **addinfo);
 
+/** \brief sets error and addinfo for transform
+    \param ct CQL transform handle
+    \param error error code
+    \param addinfo additional info
+ */
+YAZ_EXPORT
+void cql_transform_set_error(cql_transform_t ct, int error, const char *addinfo);
+
 /** \brief returns the CQL message corresponding to a given error code.
     \param code error code
     \returns text message
@@ -340,6 +368,7 @@ YAZ_END_CDECL
 /*
  * Local variables:
  * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
  * indent-tabs-mode: nil
  * End:
  * vim: shiftwidth=4 tabstop=8 expandtab