Refactor for string based queruType (SRU 2.0)
[yaz-moved-to-github.git] / include / yaz / srw.h
index 2fa1c1e..9dfc82b 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2012 Index Data.
+ * Copyright (C) 1995-2013 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:
@@ -66,15 +66,8 @@ typedef struct {
 
 typedef struct {
 
-#define Z_SRW_query_type_cql  1
-#define Z_SRW_query_type_xcql 2
-#define Z_SRW_query_type_pqf  3
-    int query_type;
-    union {
-        char *cql;
-        char *xcql;
-        char *pqf;
-    } query;
+    char *queryType;
+    char *query;
 
 #define Z_SRW_sort_type_none 1
 #define Z_SRW_sort_type_sort 2
@@ -127,12 +120,8 @@ typedef struct {
 } Z_SRW_explainResponse;
 
 typedef struct {
-    int query_type;
-    union {
-        char *cql;
-        char *xcql;
-        char *pqf;
-    } scanClause;
+    char *queryType;
+    char *scanClause;
     Odr_int *responsePosition;
     Odr_int *maximumTerms;
     char *stylesheet;
@@ -336,6 +325,7 @@ void yaz_encode_sru_extra(Z_SRW_PDU *sr, ODR odr, const char *extra_args);
 #define YAZ_XMLNS_DIAG_v1_1 "http://www.loc.gov/zing/srw/diagnostic/"
 #define YAZ_XMLNS_UPDATE_v0_9 "http://www.loc.gov/zing/srw/update/"
 #define YAZ_XMLNS_SRU_v2_response "http://docs.oasis-open.org/ns/search-ws/sru*esponse"
+#define YAZ_XMLNS_SRU_v1_response "http://www.loc.gov/*"
 
 YAZ_EXPORT
 int yaz_srw_check_content_type(Z_HTTP_Response *hres);