Changed include/yaz/diagbib1.h and added include/yaz/diagsrw.h with
[yaz-moved-to-github.git] / include / yaz / srw.h
index 26f9819..2f6b505 100644 (file)
@@ -1,8 +1,12 @@
 /*
- * Copyright (c) 2002-2004, Index Data.
+ * Copyright (C) 1995-2005, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: srw.h,v 1.13 2004-01-07 21:02:42 adam Exp $
+ * $Id: srw.h,v 1.21 2005-04-22 08:27:57 adam Exp $
+ */
+/**
+ * \file srw.h
+ * \brief Header for SRW/SRU
  */
 
 #ifndef YAZ_SRW_H
@@ -10,6 +14,7 @@
 
 #include <yaz/soap.h>
 #include <yaz/zgdu.h>
+#include <yaz/diagsrw.h>
 
 YAZ_BEGIN_CDECL
 
@@ -24,8 +29,9 @@ typedef struct {
 } Z_SRW_record;
 
 typedef struct {
-    int  *code;
+    char *uri;
     char *details;
+    char *message;
 } Z_SRW_diagnostic;
     
 typedef struct {
@@ -85,7 +91,12 @@ typedef struct {
 } Z_SRW_explainResponse;
     
 typedef struct {
-    char *scanClause;
+    int query_type;
+    union {
+        char *cql;
+        char *xcql;
+        char *pqf;
+    } scanClause;
     int *responsePosition;
     int *maximumTerms;
     char *stylesheet;
@@ -96,6 +107,7 @@ typedef struct {
     char *value;
     int *numberOfRecords;
     char *displayTerm;
+    char *whereInList;
 } Z_SRW_scanTerm;
 
 typedef struct {
@@ -130,8 +142,6 @@ YAZ_EXPORT int yaz_srw_codec(ODR o, void * pptr,
                              void *client_data, const char *ns);
 YAZ_EXPORT Z_SRW_PDU *yaz_srw_get(ODR o, int which);
 
-YAZ_EXPORT const char *yaz_diag_srw_str (int code);
-
 YAZ_EXPORT int yaz_diag_bib1_to_srw (int bib1_code);
 
 YAZ_EXPORT int yaz_diag_srw_to_bib1(int srw_code);
@@ -142,7 +152,16 @@ YAZ_EXPORT void yaz_uri_val_int(const char *path, const char *name,
 YAZ_EXPORT int yaz_srw_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
                              Z_SOAP **soap_package, ODR decode, char **charset);
 YAZ_EXPORT int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
-                             Z_SOAP **soap_package, ODR decode, char **charset);
+                             Z_SOAP **soap_package, ODR decode, 
+                             char **charset,
+                             Z_SRW_diagnostic **, int *num_diagnostic);
+
+YAZ_EXPORT void yaz_add_srw_diagnostic(ODR o, Z_SRW_diagnostic **d,
+                                      int *num, int code,
+                                      const char *addinfo);
+    
+YAZ_EXPORT void yaz_mk_std_diagnostic(ODR o, Z_SRW_diagnostic *d, 
+                                     int code, const char *details);
 YAZ_END_CDECL
 
 #endif