Reformat: delete trailing whitespace
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 19 Sep 2012 13:33:09 +0000 (15:33 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 19 Sep 2012 13:33:53 +0000 (15:33 +0200)
228 files changed:
client/admin.c
client/client.c
client/tabcomplete.c
client/tabcomplete.h
include/yaz/backend.h
include/yaz/base64.h
include/yaz/ccl.h
include/yaz/ccl_xml.h
include/yaz/charneg.h
include/yaz/comstack.h
include/yaz/cql.h
include/yaz/daemon.h
include/yaz/dirent.h
include/yaz/errno.h
include/yaz/file_glob.h
include/yaz/icu.h
include/yaz/icu_I18N.h
include/yaz/ill.h
include/yaz/json.h
include/yaz/log.h
include/yaz/logrpn.h
include/yaz/marcdisp.h
include/yaz/mutex.h
include/yaz/nmem.h
include/yaz/odr.h
include/yaz/oid_db.h
include/yaz/options.h
include/yaz/poll.h
include/yaz/pquery.h
include/yaz/proto.h
include/yaz/readconf.h
include/yaz/record_conv.h
include/yaz/retrieval.h
include/yaz/rpn2cql.h
include/yaz/sc.h
include/yaz/snprintf.h
include/yaz/soap.h
include/yaz/solr.h
include/yaz/sortspec.h
include/yaz/srw.h
include/yaz/test.h
include/yaz/timing.h
include/yaz/tpath.h
include/yaz/url.h
include/yaz/wrbuf.h
include/yaz/xmalloc.h
include/yaz/xml_include.h
include/yaz/yaz-iconv.h
include/yaz/yaz-util.h
include/yaz/yconfig.h
include/yaz/zoom.h
src/advancegreek.c
src/atoin.c
src/base64.c
src/ber_any.c
src/ber_bit.c
src/ber_bool.c
src/ber_int.c
src/ber_len.c
src/ber_null.c
src/ber_oct.c
src/ber_oid.c
src/ber_tag.c
src/ccl_stop_words.c
src/cclerrms.c
src/cclfind.c
src/cclp.h
src/cclptree.c
src/cclqfile.c
src/cclqual.c
src/cclstr.c
src/ccltoken.c
src/cclxmlconfig.c
src/charneg.c
src/comstack.c
src/cql2ccl.c
src/cqlstring.c
src/cqltransform.c
src/cqlutil.c
src/daemon.c
src/diag_map.c
src/dirent.c
src/elementset.c
src/eventl.h
src/facet.c
src/file_glob.c
src/grs1disp.c
src/http.c
src/iconv_decode_danmarc.c
src/iconv_decode_iso5426.c
src/iconv_decode_marc8.c
src/iconv_encode_iso_8859_1.c
src/iconv_encode_marc8.c
src/iconv_encode_wchar.c
src/icu_casemap.c
src/icu_chain.c
src/icu_sortkey.c
src/icu_tokenizer.c
src/icu_transform.c
src/icu_utf16.c
src/icu_utf8.c
src/ill-get.c
src/initopt.c
src/iso5428.c
src/json.c
src/log.c
src/logrpn.c
src/marc_read_iso2709.c
src/marc_read_line.c
src/marc_read_xml.c
src/marcdisp.c
src/match_glob.c
src/mutex.c
src/nmem.c
src/odr.c
src/odr_bit.c
src/odr_oct.c
src/odr_seq.c
src/odr_use.c
src/odr_util.c
src/oid_db.c
src/oid_util.c
src/opacdisp.c
src/options.c
src/otherinfo.c
src/poll.c
src/pquery.c
src/prt-ext.c
src/querytowrbuf.c
src/readconf.c
src/record_conv.c
src/record_render.c
src/retrieval.c
src/rpn2cql.c
src/rpn2solr.c
src/sc.c
src/seshigh.c
src/session.h
src/siconv.c
src/soap.c
src/solr.c
src/solrtransform.c
src/sortspec.c
src/spipe.c
src/srw.c
src/srwutil.c
src/statserv.c
src/stemmer.c
src/tcpdchk.c
src/tcpip.c
src/test.c
src/timing.c
src/tokenizer.c
src/tpath.c
src/ucs4.c
src/unix.c
src/uri.c
src/url.c
src/utf8.c
src/wrbuf.c
src/xcqlutil.c
src/xmalloc.c
src/xml_include.c
src/xmlerror.c
src/xmlquery.c
src/zget.c
src/zoom-c.c
src/zoom-opt.c
src/zoom-p.h
src/zoom-query.c
src/zoom-record-cache.c
src/zoom-socket.c
src/zoom-sru.c
src/zoom-z3950.c
test/test_ccl.c
test/test_comstack.c
test/test_cql2ccl.c
test/test_embed_record.c
test/test_file_glob.c
test/test_iconv.c
test/test_icu.c
test/test_json.c
test/test_libstemmer.c
test/test_log.c
test/test_log_thread.c
test/test_mutex.c
test/test_nmem.c
test/test_odr.c
test/test_options.c
test/test_pquery.c
test/test_query_charset.c
test/test_record_conv.c
test/test_retrieval.c
test/test_rpn2cql.c
test/test_rpn2solr.c
test/test_shared_ptr.c
test/test_soap1.c
test/test_soap2.c
test/test_solr.c
test/test_timing.c
test/test_wrbuf.c
test/test_xmlquery.c
util/benchmark.c
util/cclsh.c
util/cql2pqf.c
util/cql2xcql.c
util/marcdump.c
util/srwtst.c
util/yaz-icu.c
util/yaz-illclient.c
util/yaz-record-conv.c
util/yaz-xmlquery.c
util/yaziconv.c
zoom/zoom-benchmark.c
zoom/zoom-ka.c
zoom/zoomsh.c
zoom/zoomtst1.c
zoom/zoomtst10.c
zoom/zoomtst11.c
zoom/zoomtst2.c
zoom/zoomtst3.c
zoom/zoomtst4.c
zoom/zoomtst5.c
zoom/zoomtst7.c
zoom/zoomtst8.c
zoom/zoomtst9.c
ztest/dummy-opac.c
ztest/ztest.c

index b80591f..faaa227 100644 (file)
@@ -43,7 +43,7 @@ static int sendAdminES(int type, char* param1)
 {
     ODR out = getODROutputStream();
     char *dbname = odr_strdup (out, databaseNames[0]);
-    
+
     /* Type: 1=reindex, 2=truncate, 3=delete, 4=create, 5=import, 6=refresh, 7=commit */
     Z_APDU *apdu = zget_APDU(out, Z_APDU_extendedServicesRequest );
     Z_ExtendedServicesRequest *req = apdu->u.extendedServicesRequest;
@@ -71,11 +71,11 @@ static int sendAdminES(int type, char* param1)
     r->u.adminService->which = Z_Admin_esRequest;
     r->u.adminService->u.esRequest = (Z_AdminEsRequest *)
         odr_malloc(out, sizeof(*r->u.adminService->u.esRequest));
-    
+
     toKeep = r->u.adminService->u.esRequest->toKeep =
-        (Z_ESAdminOriginPartToKeep *) 
+        (Z_ESAdminOriginPartToKeep *)
         odr_malloc(out, sizeof(*r->u.adminService->u.esRequest->toKeep));
-    
+
     toKeep->which=type;
     toKeep->databaseName = dbname;
     switch ( type )
@@ -83,7 +83,7 @@ static int sendAdminES(int type, char* param1)
     case Z_ESAdminOriginPartToKeep_reIndex:
         toKeep->u.reIndex=odr_nullval();
         break;
-        
+
     case Z_ESAdminOriginPartToKeep_truncate:
         toKeep->u.truncate=odr_nullval();
         break;
@@ -115,15 +115,15 @@ static int sendAdminES(int type, char* param1)
         /* Unknown admin service */
         break;
     }
-    
+
     notToKeep = r->u.adminService->u.esRequest->notToKeep =
         (Z_ESAdminOriginPartNotToKeep *)
         odr_malloc(out, sizeof(*r->u.adminService->u.esRequest->notToKeep));
     notToKeep->which=Z_ESAdminOriginPartNotToKeep_recordsWillFollow;
     notToKeep->u.recordsWillFollow=odr_nullval();
-    
+
     send_apdu(apdu);
-    
+
     return 0;
 }
 
@@ -136,7 +136,7 @@ int cmd_adm_reindex(const char *arg)
 }
 
 /* cmd_adm_truncate
-   Truncate the specified database, removing all records and index entries, but leaving 
+   Truncate the specified database, removing all records and index entries, but leaving
    the database & it's explain information intact ready for new records */
 int cmd_adm_truncate(const char *arg)
 {
@@ -198,13 +198,13 @@ int cmd_adm_import(const char *arg)
     dir = opendir(dir_str);
     if (!dir)
         return 0;
-    
+
     sendAdminES(Z_ESAdminOriginPartToKeep_import, type_str);
-    
+
     printf ("sent es request\n");
     if ((cp=strrchr(dir_str, '/')) && cp[1] == 0)
         sep="";
-        
+
     while ((ent = readdir(dir)))
     {
         if (fnmatch (pattern_str, ent->d_name, 0) == 0)
@@ -212,7 +212,7 @@ int cmd_adm_import(const char *arg)
             char fname[1024];
             struct stat status;
             FILE *inf;
-                
+
             sprintf (fname, "%s%s%s", dir_str, sep, ent->d_name);
             stat (fname, &status);
 
@@ -236,7 +236,7 @@ int cmd_adm_import(const char *arg)
                 rec->u.intermediateFragment->which =
                     Z_FragmentSyntax_notExternallyTagged;
                 rec->u.intermediateFragment->u.notExternallyTagged = oct;
-                
+
                 oct->len = oct->size = status.st_size;
                 oct->buf = (unsigned char *) odr_malloc (out, oct->size);
                 if (fread(oct->buf, 1, oct->size, inf) != (size_t) oct->size)
@@ -247,7 +247,7 @@ int cmd_adm_import(const char *arg)
                 {
                     printf("Close failed for file %s\n", fname);
                 }
-                
+
                 segment->segmentRecords[segment->num_segmentRecords++] = rec;
 
                 if (segment->num_segmentRecords == chunk)
@@ -255,7 +255,7 @@ int cmd_adm_import(const char *arg)
                     send_apdu (apdu);
                     apdu = 0;
                 }
-            }   
+            }
         }
     }
     if (apdu)
@@ -274,7 +274,7 @@ int cmd_adm_import(const char *arg)
 #endif
 
 
-/* "Freshen" the specified database, by checking metadata records against the sources from which they were 
+/* "Freshen" the specified database, by checking metadata records against the sources from which they were
    generated, and creating a new record if the source has been touched since the last extraction */
 int cmd_adm_refresh(const char *arg)
 {
@@ -286,7 +286,7 @@ int cmd_adm_refresh(const char *arg)
     return 0;
 }
 
-/* cmd_adm_commit 
+/* cmd_adm_commit
    Make imported records a permenant & visible to the live system */
 int cmd_adm_commit(const char *arg)
 {
index d5ef64c..549678c 100644 (file)
@@ -1529,7 +1529,7 @@ static int send_Z3950_searchRequest(const char *arg)
             printf("CCL ERROR: %s\n", ccl_err_msg(error));
             return 0;
         }
-    } 
+    }
     else if (myQueryType == QueryType_CQL2RPN)
     {
         /* ### All this code should be wrapped in a utility function */
@@ -3020,7 +3020,7 @@ static int parse_show_args(const char *arg_c, char *setstring,
         sprintf(setstring, "%d", setnumber);
     else
         *setstring = '\0';
-    
+
     token_len = check_token(arg_c, "format");
     if (token_len)
     {
@@ -3285,10 +3285,10 @@ static int cmd_cancel(const char *arg)
             apdu->u.triggerResourceControlRequest;
         bool_t rfalse = 0;
         char command[16];
-        
+
         *command = '\0';
         sscanf(arg, "%15s", command);
-        
+
         if (only_z3950())
             return 0;
         if (session_initResponse &&
@@ -3301,7 +3301,7 @@ static int cmd_cancel(const char *arg)
         *req->requestedAction = Z_TriggerResourceControlRequest_cancel;
         req->resultSetWanted = &rfalse;
         req->referenceId = set_refid(out);
-        
+
         send_apdu(apdu);
         printf("Sent cancel request\n");
         if (!strcmp(command, "wait"))
@@ -3611,7 +3611,7 @@ static int cmd_scan_common(const char *set, const char *arg)
         scan_query = last_scan_query;
         scan_term = last_scan_line;
     }
-    else 
+    else
     {
         strcpy(last_scan_query, arg);
         scan_query = arg;
@@ -4085,7 +4085,7 @@ static int cmd_set_auto_reconnect(const char* arg)
         printf("Error use on or off\n");
         return 1;
     }
-    
+
     if (auto_reconnect)
         printf("Set auto reconnect enabled.\n");
     else
@@ -4278,7 +4278,7 @@ static void initialize(const char *rc_file)
         fprintf(stderr, "failed to allocate ODR streams\n");
         exit(1);
     }
-    
+
     strcpy(scan_position, "1");
 
     setvbuf(stdout, 0, _IONBF, 0);
@@ -4952,7 +4952,7 @@ static int cmd_wait_response(const char *arg)
 {
     int i;
     int wait_for = atoi(arg);
-    if (wait_for < 1) 
+    if (wait_for < 1)
         wait_for = 1;
 
     for (i = 0 ; i < wait_for; ++i )
index 14ab01e..e0d332d 100644 (file)
 
 /* ***************************************************************************
  *
- * generic completer 
- * 
+ * generic completer
+ *
  * ***************************************************************************/
 
 char *complete_from_list(const char** completions,
                          const char *text, int state)
-{       
+{
 #if HAVE_READLINE_READLINE_H
     static int idx;
-    
-    if (!completions) 
+
+    if (!completions)
         return NULL;
-    if (state==0) 
+    if (state==0)
         idx = 0;
     for(; completions[idx]; ++ idx) {
         if(!
@@ -35,9 +35,9 @@ char *complete_from_list(const char** completions,
            _strnicmp
 #else
            strncasecmp
-#endif              
+#endif
            (completions[idx],text,strlen(text))) {
-            ++idx; /* skip this entry on the next run */ 
+            ++idx; /* skip this entry on the next run */
             return (char*)strdup(completions[idx-1]);
         };
     };
@@ -47,11 +47,11 @@ char *complete_from_list(const char** completions,
 
 
 /* ***************************************************************************
- * 
+ *
  * code for getting a list of valid strings from the oid subsystem
- * 
+ *
  * ***************************************************************************/
-   
+
 
 typedef struct {
     int oclass;
@@ -62,30 +62,30 @@ typedef struct {
 
 /*!
   This is the call back function given to oid_trav... it updates the list
-  of pointers into the oid owned data 
+  of pointers into the oid owned data
 */
 
 void oid_loader(const Odr_oid *oid,
                 oid_class oclass, const char *name, void* data_)
 {
     oid_callback_t* data=(oid_callback_t*) data_;
-    
+
     if ((oclass == CLASS_GENERAL) || (oclass == data->oclass))
     {
-        if (data->index==data->max) 
+        if (data->index==data->max)
         {
             data->values=(const char**)
                 realloc(data->values,((data->max+1)*2)*sizeof(char*));
             data->max=(data->max+1)*2 - 1;
         }
         data->values[data->index] = name;
-        ++data->index;          
+        ++data->index;
     }
 }
 
 const char** build_list_for_oclass(oid_class oclass)
-{ 
-    oid_callback_t data;        
+{
+    oid_callback_t data;
     data.values = (const char **) calloc(10,sizeof(char*));
     data.index = 0;
     data.max = 9;
@@ -94,43 +94,43 @@ const char** build_list_for_oclass(oid_class oclass)
     yaz_oid_trav(yaz_oid_std(), oid_loader, &data);
 
     data.values[data.index]=0;
-    return data.values;    
+    return data.values;
 }
 
 /* ***************************************************************************
- * 
- * the completer functions 
- * 
+ *
+ * the completer functions
+ *
  * ***************************************************************************/
 
 char* complete_querytype(const char *text, int state)
 {
     static const char* querytypes[] = {"ccl2rpn","prefix","cclrpn","ccl","cql", "cql2rpn", 0};
-    return complete_from_list(querytypes,text,state);  
+    return complete_from_list(querytypes,text,state);
 }
 
 char* complete_auto_reconnect(const char *text, int state)
 {
     static const char* querytypes[] = {"on","off",0};
-    return complete_from_list(querytypes,text,state);  
+    return complete_from_list(querytypes,text,state);
 }
 
 
 char* complete_format(const char* text, int state)
 {
     const char** list = build_list_for_oclass(CLASS_RECSYN);
-    char* res=complete_from_list(list,text,state);  
-    
-    free(list); 
+    char* res=complete_from_list(list,text,state);
+
+    free(list);
     return res;
 }
 
 char* complete_schema(const char* text, int state)
 {
     const char** list = build_list_for_oclass(CLASS_SCHEMA);
-    char* res = complete_from_list(list,text,state);  
-    
-    free(list); 
+    char* res = complete_from_list(list,text,state);
+
+    free(list);
     return res;
 }
 
@@ -138,9 +138,9 @@ char* complete_schema(const char* text, int state)
 char* complete_attributeset(const char* text, int state)
 {
     const char** list = build_list_for_oclass(CLASS_ATTSET);
-    char* res = complete_from_list(list,text,state);  
-    
-    free(list); 
+    char* res = complete_from_list(list,text,state);
+
+    free(list);
     return res;
 }
 
index 77bdc17..a5efc3e 100644 (file)
@@ -25,7 +25,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/* 
+/*
    This file contains the compleaters for the different commands.
 */
 
index 319b91d..5abccd8 100644 (file)
@@ -25,7 +25,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/** 
+/**
  * \file backend.h
  * \brief Header for GFS
  *
@@ -42,7 +42,7 @@
 #include <yaz/oid_db.h>
 
 YAZ_BEGIN_CDECL
-    
+
 typedef struct association *bend_association;
 
 /** \brief Information for Z39.50/SRU search handler
@@ -184,7 +184,7 @@ typedef struct bend_delete_rr {
     int delete_status;    /**< status for the whole operation */
     int *statuses;    /**< status each set - indexed as setnames */
     ODR stream;
-    ODR print; 
+    ODR print;
 } bend_delete_rr;
 
 /** \brief Information for Z39.50 sort handler */
@@ -208,7 +208,7 @@ typedef struct bend_esrequest_rr
 {
     int ItemNo;
     Z_ExtendedServicesRequest *esr;
-    
+
     ODR stream;                /* encoding stream */
     ODR decode;                /* decoding stream */
     ODR print;                 /* printing stream */
@@ -243,40 +243,40 @@ typedef struct {
 
 This includes both request
 information (to be read) and response information which should be
-set by the bend_init handler 
+set by the bend_init handler
 */
 typedef struct bend_initrequest
 {
     /** \brief user/name/password to be read */
-    Z_IdAuthentication *auth; 
+    Z_IdAuthentication *auth;
     /** \brief encoding stream (for results) */
     ODR stream;
     /** \brief printing stream */
     ODR print;
     /** \brief decoding stream (use stream for results) */
-    ODR decode; 
+    ODR decode;
     /** \brief reference ID */
     Z_ReferenceId *referenceId;
     /** \brief peer address of client */
-    char *peer_name;           
-    
-    /** \brief character set and language negotiation 
+    char *peer_name;
 
-    see include/yaz/z-charneg.h 
+    /** \brief character set and language negotiation
+
+    see include/yaz/z-charneg.h
     */
     Z_CharSetandLanguageNegotiation *charneg_request;
 
     /** \brief character negotiation response */
     Z_External *charneg_response;
 
-    /** \brief character set (encoding) for query terms 
-        
+    /** \brief character set (encoding) for query terms
+
     This is NULL by default. It should be set to the native character
     set that the backend assumes for query terms */
-    char *query_charset;      
+    char *query_charset;
+
+    /** \brief whehter query_charset also applies to recors
 
-    /** \brief whehter query_charset also applies to recors 
-    
     Is 0 (No) by default. Set to 1 (yes) if records is in the same
     character set as queries. If in doubt, use 0 (No).
     */
@@ -330,7 +330,7 @@ typedef struct statserv_options_block
     char apdufile[ODR_MAXNAME+1]; /**< file for pretty-printed PDUs */
     char logfile[ODR_MAXNAME+1];  /**< file for diagnostic output */
     char default_listen[1024];    /**< 0 == no default listen */
-    enum oid_proto default_proto; /**< PROTO_SR or PROTO_Z3950 */ 
+    enum oid_proto default_proto; /**< PROTO_SR or PROTO_Z3950 */
     int idle_timeout;             /**< how many minutes to wait before closing */
     int maxrecordsize;            /**< maximum value for negotiation */
     char configname[ODR_MAXNAME+1]; /**< given to the backend in bend_init */
index d18c76d..6644720 100644 (file)
@@ -34,7 +34,7 @@
 #define YAZ_BASE64_H
 
 #include <yaz/yconfig.h>
+
 YAZ_BEGIN_CDECL
 
 /** \brief encodes Base64 string
index c271764..88deaed 100644 (file)
@@ -77,7 +77,7 @@
 #include <yaz/wrbuf.h>
 
 YAZ_BEGIN_CDECL
-    
+
 #define CCL_ERR_OK                0
 #define CCL_ERR_TERM_EXPECTED     1
 #define CCL_ERR_RP_EXPECTED       2
@@ -93,7 +93,7 @@ YAZ_BEGIN_CDECL
 #define CCL_ERR_TRUNC_NOT_RIGHT  12
 #define CCL_ERR_TRUNC_NOT_EMBED  13
 #define CCL_ERR_TRUNC_NOT_SINGLE 14
-    
+
 /** \brief attribute node (type, value) pair as used in RPN */
 struct ccl_rpn_attr {
     /** \brief next attribute */
@@ -147,10 +147,10 @@ typedef struct ccl_qualifiers *CCL_bibset;
 
 /** \brief CCL parser */
 typedef struct ccl_parser *CCL_parser;
-    
+
 /**
    \brief parse CCL find string using CCL profile return RPN tree
-   
+
    Parses a CCL Find command in a simple C string. Returns CCL parse
    tree node describing RPN if parsing is successful. If parsing is
    unsuccesful, NULL is returned and error and pos is set accordingly.
@@ -162,7 +162,7 @@ struct ccl_rpn_node *ccl_find_str(CCL_bibset bibset,
 
 /**
    \brief parse CCL find string with parser and return RPN tree
-   
+
    Parses a CCL Find command in a simple C string. Returns CCL parse
    tree node describing RPN if parsing is successful. If parsing is
    unsuccesful, NULL is returned and error and pos is set accordingly.
@@ -329,11 +329,11 @@ int ccl_stop_words_info(ccl_stop_words_t csw, int idx,
                              3  key
                              4  year
                              5  date (normalized)
-                             6  word list 
+                             6  word list
                            100  date (un-normalized)
                            101  name (normalized)
                            102  name (un-normalized)
-   truncation (5)                            
+   truncation (5)
    completeness (6)
 */
 
index 38e0351..256b0c3 100644 (file)
@@ -44,7 +44,7 @@ YAZ_BEGIN_CDECL
     \param addinfo has error message if configuration could not be parsed
     \retval 0 OK
     \retval -1 errors. Inspect addinfo for error message
-    
+
     Configuration example:
     \verbatim
 <cclmap defaultattrset="bib-1">
index c79d260..48a1f29 100644 (file)
@@ -25,7 +25,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/** 
+/**
  * \file charneg.h
  * \brief Header for Z39.50 Charset negotiation utilities
  *
@@ -45,7 +45,7 @@ YAZ_BEGIN_CDECL
  * client and server parts. At that moment the (*) is based on
  * Z_PrivateCharacterSet_externallySpecified method.
  *
- */  
+ */
 
 /*
  * Get (*) record from request
@@ -60,7 +60,7 @@ YAZ_EXPORT
 int yaz_del_charneg_record(Z_OtherInformation **p);
 
 /*
- * Client's part. 
+ * Client's part.
  */
 YAZ_EXPORT
 Z_External *yaz_set_proposal_charneg(ODR odr,
@@ -84,7 +84,7 @@ void yaz_get_response_charneg(NMEM mem,
 /*
  * Server's part
  */
+
 YAZ_EXPORT
 Z_External *yaz_set_response_charneg(ODR odr,
                                      const char *charset, const char *lang,
index f7d70d8..61980e9 100644 (file)
@@ -25,7 +25,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/** 
+/**
  * \file comstack.h
  * \brief Header for COMSTACK
  */
@@ -113,14 +113,14 @@ struct comstack
 #define cs_want_read(handle) ((handle)->io_pending & CS_WANT_READ)
 #define cs_want_write(handle) ((handle)->io_pending & CS_WANT_WRITE)
 #define cs_set_blocking(handle,blocking) ((handle)->f_set_blocking(handle, blocking))
-                                          
+
 #define CS_WANT_READ 1
 #define CS_WANT_WRITE 2
 
 YAZ_EXPORT int cs_look (COMSTACK);
 YAZ_EXPORT const char *cs_strerror(COMSTACK h);
 YAZ_EXPORT const char *cs_errmsg(int n);
-YAZ_EXPORT COMSTACK cs_create_host(const char *type_and_host, 
+YAZ_EXPORT COMSTACK cs_create_host(const char *type_and_host,
                                    int blocking, void **vp);
 
 YAZ_EXPORT COMSTACK cs_create_host_proxy(const char *vhost,
@@ -141,7 +141,7 @@ YAZ_EXPORT void cs_print_session_info(COMSTACK cs);
 /*
  * error management.
  */
-                                          
+
 #define CSNONE     0
 #define CSYSERR    1
 #define CSOUTSTATE 2
index 64c1266..f74a095 100644 (file)
@@ -41,10 +41,10 @@ typedef struct cql_parser *CQL_parser;
 
 /** \brief creates a CQL parser.
     \returns CCL parser
-    
+
     Returns CQL parser or NULL if parser could not be created.
  */
-YAZ_EXPORT 
+YAZ_EXPORT
 CQL_parser cql_parser_create(void);
 
 /** \brief destroys a CQL parser.
@@ -52,7 +52,7 @@ CQL_parser cql_parser_create(void);
 
     This function does nothing if NULL if received.
  */
-YAZ_EXPORT 
+YAZ_EXPORT
 void cql_parser_destroy(CQL_parser cp);
 
 /** \brief parses a CQL query (string)
@@ -61,7 +61,7 @@ void cql_parser_destroy(CQL_parser cp);
     \retval 0 success
     \retval !=0 failure
  */
-YAZ_EXPORT 
+YAZ_EXPORT
 int cql_parser_string(CQL_parser cp, const char *str);
 
 /** \brief parses CQL query (query stream)
@@ -71,14 +71,14 @@ int cql_parser_string(CQL_parser cp, const char *str);
     \param client_data data to be passed to stream functions
     \retval 0 success
     \retval !=0 failure
-    
+
     This function is similar to cql_parser_string but takes a
     functions to read each query character from a stream.
-    
+
     The functions pointers getbytes, ungetbyte are similar to
     that known from stdios getc, ungetc.
 */
-YAZ_EXPORT 
+YAZ_EXPORT
 int cql_parser_stream(CQL_parser cp,
                       int (*getbyte)(void *client_data),
                       void (*ungetbyte)(int b, void *client_data),
@@ -89,8 +89,8 @@ int cql_parser_stream(CQL_parser cp,
     \param f file where query is read from
     \retval 0 success
     \retval !=0 failure
-    
-    This function is similar to cql_parser_string but reads from 
+
+    This function is similar to cql_parser_string but reads from
     stdio FILE handle instead.
 */
 YAZ_EXPORT
@@ -132,7 +132,7 @@ struct cql_node {
             char *value;
             /** left operand */
             struct cql_node *left;
-            /** right operand */ 
+            /** right operand */
             struct cql_node *right;
             /** modifiers (NULL for no list) */
             struct cql_node *modifiers;
@@ -224,7 +224,7 @@ struct cql_node *cql_parser_sort_result(CQL_parser cp);
     \param client_data data to be passed to pr function
  */
 YAZ_EXPORT
-void cql_to_xml(struct cql_node *cn, 
+void cql_to_xml(struct cql_node *cn,
                 void (*pr)(const char *buf, void *client_data),
                 void *client_data);
 /** \brief converts CQL tree to XCQL and writes to file
@@ -249,7 +249,7 @@ int cql_to_xml_buf(struct cql_node *cn, char *out, int max);
     \param client_data data to be passed to pr function
  */
 YAZ_EXPORT
-int cql_to_ccl(struct cql_node *cn, 
+int cql_to_ccl(struct cql_node *cn,
                void (*pr)(const char *buf, void *client_data),
                void *client_data);
 
@@ -313,7 +313,7 @@ cql_transform_t cql_transform_open_fname(const char *fname);
 YAZ_EXPORT
 int cql_transform_define_pattern(cql_transform_t ct, const char *pattern,
                                  const char *value);
-    
+
 
 
 /** \brief destroys a CQL transform handle
@@ -418,7 +418,7 @@ int cql_strncmp(const char *s1, const char *s2, size_t n);
     \param cn CQL tree
     \param pr print function
     \param client_data data to be passed to pr function
-    
+
     This will take CQL_NODE_SORT entries and conver them to
 
     path,schema,ascending,caseSensitive,missingValue
@@ -445,7 +445,7 @@ int cql_sortby_to_sortkeys(struct cql_node *cn,
                            void (*pr)(const char *buf, void *client_data),
                            void *client_data);
 
-/** \brief converts CQL sortby to sortkeys .. 
+/** \brief converts CQL sortby to sortkeys ..
     \param cn CQL tree
     \param out result buffer
     \param max size of buffer (allocated)
index b5ed96b..38b8754 100644 (file)
@@ -59,7 +59,7 @@ YAZ_BEGIN_CDECL
 
     Flag YAZ_DAEMON_DEBUG: Puts the service in debug mode (no fork at all).
 
-    Flag YAZ_DAEMON_KEEPALIVE: Repeatedly calls work handler if it makes a 
+    Flag YAZ_DAEMON_KEEPALIVE: Repeatedly calls work handler if it makes a
     "fatal" error.
 */
 YAZ_EXPORT
index b2c4084..1bcef0d 100644 (file)
@@ -25,7 +25,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/** \file 
+/** \file
     \brief wrapper for dirent.h or our own for Windows
 */
 
index 0d205a0..e7fac0c 100644 (file)
@@ -36,8 +36,8 @@
 
 YAZ_BEGIN_CDECL
 
-/** \brief returns errno 
-    \returns errno value 
+/** \brief returns errno
+    \returns errno value
 */
 YAZ_EXPORT int yaz_errno(void);
 
index 6d2d21a..0ba70d6 100644 (file)
@@ -25,7 +25,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/** \file 
+/** \file
     \brief File globbing (ala POSIX glob, but simpler)
 */
 
@@ -52,7 +52,7 @@ int yaz_file_glob(const char *pattern, yaz_glob_res_t *res);
 
 /** \brief release glob result
     \param res pointer to glob result
-    
+
     A value of *res == NULL is allowed. If *res != NULL, then
     *res is set to NULL
     */
index 8912df7..7f396f2 100644 (file)
@@ -64,7 +64,7 @@ YAZ_EXPORT yaz_icu_chain_t icu_chain_xml_config(const xmlNode *xml_node,
     \retval 1 success
 */
 YAZ_EXPORT int icu_chain_assign_cstr(yaz_icu_chain_t chain,
-                                     const char * src8cstr, 
+                                     const char * src8cstr,
                                      UErrorCode *status);
 
 /** \brief returns one token (if any)
@@ -122,7 +122,7 @@ yaz_icu_iter_t icu_iter_create(struct icu_chain *chain);
 /** \brief starts iteration over string
     \param iter ICU tokenizer iterator
     \param src8cstr input string (0-terminated)
-    
+
     Call icu_iter_next to iterate over each token.
 */
 YAZ_EXPORT
index 2b56903..743d096 100644 (file)
@@ -118,7 +118,7 @@ int icu_utf16_casemap(struct icu_buf_utf16 * dest16,
                       UErrorCode *status);
 
 void icu_sortkey8_from_utf16(UCollator *coll,
-                             struct icu_buf_utf8 * dest8, 
+                             struct icu_buf_utf8 * dest8,
                              struct icu_buf_utf16 * src16,
                              UErrorCode * status);
 
@@ -129,11 +129,11 @@ struct icu_tokenizer * icu_tokenizer_create(const char *locale, char action,
 struct icu_tokenizer *icu_tokenizer_clone(struct icu_tokenizer *old);
 void icu_tokenizer_destroy(struct icu_tokenizer * tokenizer);
 
-int icu_tokenizer_attach(struct icu_tokenizer * tokenizer, 
+int icu_tokenizer_attach(struct icu_tokenizer * tokenizer,
                          struct icu_buf_utf16 * src16, UErrorCode *status);
 
-int32_t icu_tokenizer_next_token(struct icu_tokenizer * tokenizer, 
-                                 struct icu_buf_utf16 * tkn16, 
+int32_t icu_tokenizer_next_token(struct icu_tokenizer * tokenizer,
+                                 struct icu_buf_utf16 * tkn16,
                                  UErrorCode *status);
 
 int32_t icu_tokenizer_token_count(struct icu_tokenizer * tokenizer);
index 8cfe483..be623fd 100644 (file)
@@ -43,7 +43,7 @@ struct ill_get_ctl {
     void *clientData;
     const char *(*f)(void *clientData, const char *element);
 };
-    
+
 YAZ_EXPORT ILL_ItemRequest *ill_get_ItemRequest (
     struct ill_get_ctl *gs, const char *name, const char *sub);
 
index c30f10c..d9f62bd 100644 (file)
@@ -53,8 +53,8 @@ enum json_node_type {
 struct json_node {
     enum json_node_type type;
     union {
-        char *string; 
-        double number; 
+        char *string;
+        double number;
         struct json_node *link[2];
     } u;
 };
@@ -86,7 +86,7 @@ struct json_node *json_parser_parse(json_parser_t p, const char *json_str);
 
 /** \brief returns parser error
     \param p JSON parser handle
-    \returns parse error msg 
+    \returns parse error msg
 
     This function should be called if json_parser_parse returns NULL .
 */
index cee998a..0a9f2fd 100644 (file)
@@ -51,13 +51,13 @@ YAZ_BEGIN_CDECL
 /** \brief log level: append thread Id */
 #define YLOG_TID    0x00000020
 /** \brief log level: application */
-#define YLOG_APP    0x00000040 
+#define YLOG_APP    0x00000040
 /** \brief log level: malloc debug */
 #define YLOG_MALLOC 0x00000080
 /** \brief log level: do not output date and time */
 #define YLOG_NOTIME 0x00000100
 /** \brief log level: application 2 */
-#define YLOG_APP2   0x00000200 
+#define YLOG_APP2   0x00000200
 /** \brief log level: application 3 */
 #define YLOG_APP3   0x00000400
 /** \brief log level: flush */
@@ -101,7 +101,7 @@ YAZ_EXPORT void yaz_log_init_file(const char *fname);
 */
 YAZ_EXPORT void yaz_log_init_level(int level);
 
-/** \brief sets log message prefix 
+/** \brief sets log message prefix
     \param prefix log message prefix
 */
 YAZ_EXPORT void yaz_log_init_prefix(const char *prefix);
@@ -121,7 +121,7 @@ YAZ_EXPORT void yaz_log_init_prefix2(const char *prefix);
 */
 YAZ_EXPORT void yaz_log_time_format(const char *fmt);
 
-/** \brief sets limit in bytes for size for log file 
+/** \brief sets limit in bytes for size for log file
     \param mx size in bytes
 
     Sets the max size for a log file. Zero means no limit.
@@ -132,7 +132,7 @@ YAZ_EXPORT void yaz_log_init_max_size(int mx);
 /** \brief Writes log message
     \param level log level mask
     \param fmt format string ala printf
-    
+
     Writes an entry in the log. Defaults to stderr if not initialized or
     to a file with yaz_log_init_file(). The level must match the level set
     via yaz_log_init_level(), optionally defined via yaz_log_mask_str().
@@ -146,12 +146,12 @@ YAZ_EXPORT void yaz_log(int level, const char *fmt, ...)
 /** \brief converts log level string to log level (integer)
     \param str log level string
     \return log level mask
-    
+
     yaz_log_mask_str() converts a comma-separated list of log levels to a
     bit mask. Starts from default level, and adds bits as specified,
     unless 'none' is specified, which clears the list. If a name matches
     the name of a YLOG_BIT above, that one is set. Otherwise a new value is
-    picked, and given to that name, to be found with yaz_log_module_level() 
+    picked, and given to that name, to be found with yaz_log_module_level()
 */
 YAZ_EXPORT int yaz_log_mask_str(const char *str);
 
@@ -186,7 +186,7 @@ YAZ_EXPORT FILE *yaz_log_file(void);
 /** \brief sets custom log handler
     \param func custom log handler
     \param info custom pointer to be passed to func handler
-    
+
     Allows log output to be captured to something else.. The
     func parameter takes a log level, a message + custom pointer
 */
index 8ec26ea..a62f40b 100644 (file)
@@ -43,7 +43,7 @@ YAZ_EXPORT void log_rpn_query(Z_RPNQuery *rpn);
 YAZ_EXPORT void log_rpn_query_level(int loglevel, Z_RPNQuery *rpn);
 
 YAZ_EXPORT void log_scan_term(Z_AttributesPlusTerm *zapt, const Odr_oid *ast);
-YAZ_EXPORT void log_scan_term_level(int loglevel, 
+YAZ_EXPORT void log_scan_term_level(int loglevel,
                                     Z_AttributesPlusTerm *zapt,
                                     const Odr_oid *ast);
 YAZ_EXPORT void yaz_log_zquery(Z_Query *q);
index 437fc0a..e2f9e21 100644 (file)
@@ -52,7 +52,7 @@ YAZ_EXPORT yaz_marc_t yaz_marc_create(void);
 /** \brief destroy yaz_marc_t handle */
 YAZ_EXPORT void yaz_marc_destroy(yaz_marc_t mt);
 
-/** \brief set XML mode YAZ_MARC_LINE, YAZ_MARCXML, YAZ_MARC_ISO2709 .. 
+/** \brief set XML mode YAZ_MARC_LINE, YAZ_MARCXML, YAZ_MARC_ISO2709 ..
     \param mt MARC handle
     \param xmlmode mode.
 
@@ -83,9 +83,9 @@ YAZ_EXPORT void yaz_marc_iconv(yaz_marc_t mt, yaz_iconv_t cd);
 /** \brief supply iconv handle for character set conversion */
 YAZ_EXPORT yaz_iconv_t yaz_marc_get_iconv(yaz_marc_t mt);
 
-/** \brief set debug level 
+/** \brief set debug level
     \param mt handle
-    \param level level, where 0=lowest, 1 more debug, 2 even more 
+    \param level level, where 0=lowest, 1 more debug, 2 even more
 */
 YAZ_EXPORT void yaz_marc_debug(yaz_marc_t mt, int level);
 
@@ -97,7 +97,7 @@ YAZ_EXPORT void yaz_marc_debug(yaz_marc_t mt, int level);
     \param rsize size of result (memory "owned" by yaz_marc_mt handle)
 
     Decodes MARC in buf of size bsize.
-    On success, result in *result with size *rsize. 
+    On success, result in *result with size *rsize.
     Returns -1 on error, or size of input record (>0) if OK
 */
 YAZ_EXPORT int yaz_marc_decode_buf(yaz_marc_t mt, const char *buf, int bsize,
@@ -170,16 +170,16 @@ YAZ_EXPORT int yaz_marc_read_iso2709(yaz_marc_t mt,
     Parses MARC line record from stream
     Returns > 0 for OK (same as length), -1=ERROR
 */
-YAZ_EXPORT 
+YAZ_EXPORT
 int yaz_marc_read_line(yaz_marc_t mt,
                        int (*getbyte)(void *client_data),
                        void (*ungetbyte)(int b, void *client_data),
                        void *client_data);
 
 #if YAZ_HAVE_XML2
-/** \brief parses MARCXML/MarcXchange/TurboMARC record from xmlNode pointer 
+/** \brief parses MARCXML/MarcXchange/TurboMARC record from xmlNode pointer
     \param mt handle
-    \param ptr is a pointer to root xml node 
+    \param ptr is a pointer to root xml node
     \retval 0 OK
     \retval -1 ERROR
 */
@@ -239,8 +239,8 @@ YAZ_EXPORT int yaz_marc_write_iso2709(yaz_marc_t mt, WRBUF wrbuf);
     \retval -1 ERROR
 
     This function calls yaz_marc_write_iso2709, yaz_marc_write_marcxml,
-    etc.. depending on mode given by yaz_marc_xml. 
-*/  
+    etc.. depending on mode given by yaz_marc_xml.
+*/
 YAZ_EXPORT int yaz_marc_write_mode(yaz_marc_t mt, WRBUF wrbuf);
 
 #if YAZ_HAVE_XML2
@@ -252,10 +252,10 @@ YAZ_EXPORT int yaz_marc_write_mode(yaz_marc_t mt, WRBUF wrbuf);
     \param type MarcXchange format (NULL for none)
     \retval 0 Creation successful and *root_ptr is "record" node
     \retval -1 ERROR
-*/  
+*/
 YAZ_EXPORT
 int yaz_marc_write_xml(yaz_marc_t mt, xmlNode **root_ptr,
-                       const char *ns, 
+                       const char *ns,
                        const char *format,
                        const char *type);
 #endif
@@ -265,12 +265,12 @@ int yaz_marc_write_xml(yaz_marc_t mt, xmlNode **root_ptr,
     \param leader_spec
     \retval 0 OK
     \retval -1 ERROR
-    
+
     Spec takes form pos=val,pos=val,...
     where value is either a number (decimal char value) or a
     string in 'a', e.g. 9='a'
-    
-*/  
+
+*/
 YAZ_EXPORT int yaz_marc_leader_spec(yaz_marc_t mt, const char *leader_spec);
 
 
@@ -281,7 +281,7 @@ YAZ_EXPORT int yaz_marc_leader_spec(yaz_marc_t mt, const char *leader_spec);
     \param identifier_length identifier length (returned value)
     \param base_address base address (returned value)
     \param length_data_entry length of data entry (returned value)
-    \param length_starting length of starting 
+    \param length_starting length of starting
     \param length_implementation length of implementation defined data
 */
 YAZ_EXPORT
@@ -297,14 +297,14 @@ void yaz_marc_set_leader(yaz_marc_t mt, const char *leader,
 /** \brief adds MARC comment string
     \param mt handle
     \param comment comment to be added)
-*/  
+*/
 YAZ_EXPORT
 void yaz_marc_add_comment(yaz_marc_t mt, char *comment);
 
 /** \brief adds MARC annotation - printf interface
     \param mt handle
     \param fmt printf format string
-*/  
+*/
 YAZ_EXPORT
 void yaz_marc_cprintf(yaz_marc_t mt, const char *fmt, ...);
 
@@ -312,7 +312,7 @@ void yaz_marc_cprintf(yaz_marc_t mt, const char *fmt, ...);
     \param mt handle
     \param code_data code data buffer
     \param code_data_len length of code data
-*/  
+*/
 YAZ_EXPORT
 void yaz_marc_add_subfield(yaz_marc_t mt,
                            const char *code_data, size_t code_data_len);
@@ -323,7 +323,7 @@ void yaz_marc_add_subfield(yaz_marc_t mt,
     \param tag (e.g. "001"
     \param data value for this tag
     \param data_len length of data
-*/  
+*/
 YAZ_EXPORT
 void yaz_marc_add_controlfield(yaz_marc_t mt, const char *tag,
                                const char *data, size_t data_len);
@@ -334,7 +334,7 @@ void yaz_marc_add_controlfield(yaz_marc_t mt, const char *tag,
     \param mt handle
     \param ptr_tag value of tag (TEXT xmlNode)
     \param ptr_data value of data (TEXT xmlNode)
-*/  
+*/
 YAZ_EXPORT
 void yaz_marc_add_controlfield_xml(yaz_marc_t mt, const xmlNode *ptr_tag,
                                    const xmlNode *ptr_data);
@@ -343,7 +343,7 @@ void yaz_marc_add_controlfield_xml(yaz_marc_t mt, const xmlNode *ptr_tag,
     \param mt handle
     \param tag string tag
     \param ptr_data value of data (TEXT xmlNode)
-*/  
+*/
 YAZ_EXPORT
 void yaz_marc_add_controlfield_xml2(yaz_marc_t mt, char *tag,
                                     const xmlNode *ptr_data);
@@ -354,7 +354,7 @@ void yaz_marc_add_controlfield_xml2(yaz_marc_t mt, char *tag,
     \param tag value of tag as string
     \param indicator indicator string
     \param indicator_len length of indicator string
-*/  
+*/
 YAZ_EXPORT
 void yaz_marc_add_datafield(yaz_marc_t mt, const char *tag,
                             const char *indicator, size_t indicator_len);
@@ -365,7 +365,7 @@ void yaz_marc_add_datafield(yaz_marc_t mt, const char *tag,
     \param ptr_tag value of tag (TEXT xmlNode)
     \param indicator indicator string
     \param indicator_len length of indicator string
-*/  
+*/
 YAZ_EXPORT
 void yaz_marc_add_datafield_xml(yaz_marc_t mt, const xmlNode *ptr_tag,
                                 const char *indicator, size_t indicator_len);
@@ -374,7 +374,7 @@ void yaz_marc_add_datafield_xml(yaz_marc_t mt, const xmlNode *ptr_tag,
     \param mt handle
     \param tag_value string value (pointer copied verbatim, not strdupped)
     \param indicators indicator string ; pointer copied verbatim; not strdupped
-*/  
+*/
 YAZ_EXPORT
 void yaz_marc_add_datafield_xml2(yaz_marc_t mt, char *tag_value,
                                  char *indicators);
@@ -384,19 +384,19 @@ void yaz_marc_add_datafield_xml2(yaz_marc_t mt, char *tag_value,
 /** \brief returns memory for MARC handle
     \param mt handle
     \retval NMEM handle for MARC system
-*/  
+*/
 YAZ_EXPORT
 NMEM yaz_marc_get_nmem(yaz_marc_t mt);
 
 /** \brief clears memory and MARC record
     \param mt handle
-*/  
+*/
 YAZ_EXPORT
 void yaz_marc_reset(yaz_marc_t mt);
 
 /** \brief gets debug level for MARC system
     \param mt handle
-*/  
+*/
 YAZ_EXPORT
 int yaz_marc_get_debug(yaz_marc_t mt);
 
@@ -404,14 +404,14 @@ int yaz_marc_get_debug(yaz_marc_t mt);
     \param arg string
     \retval -1 unknown format (bad arg)
     \retval >= 0 OK (one of YAZ_MARC - values)
-*/  
+*/
 YAZ_EXPORT
 int yaz_marc_decode_formatstr(const char *arg);
 
-/** \brief Enables or disables writing of MARC XML records using Libxml2 
+/** \brief Enables or disables writing of MARC XML records using Libxml2
     \param mt handle
     \param enable 0=disable, 1=enable
-*/  
+*/
 YAZ_EXPORT
 void yaz_marc_write_using_libxml2(yaz_marc_t mt, int enable);
 
@@ -419,7 +419,7 @@ void yaz_marc_write_using_libxml2(yaz_marc_t mt, int enable);
     \param mt handle
     \param r OPAC record
     \param wrbuf WRBUF for resulting display string
-    
+
     This function uses iconv_handle of yaz_marc_t for character set
     conversion of both OPAC + ISO2709 part.
     \*/
@@ -443,12 +443,12 @@ YAZ_EXPORT void yaz_opac_decode_wrbuf2(yaz_marc_t mt, Z_OPACRecord *r,
     \param wr WRBUF for output
     \retval 0 OK
     \retval -1 ERROR
-*/  
+*/
 YAZ_EXPORT int yaz_marc_write_trailer(yaz_marc_t mt, WRBUF wr);
 
 /** \brief enables record collection output
     \param mt handle
-*/  
+*/
 YAZ_EXPORT void yaz_marc_enable_collection(yaz_marc_t mt);
 
 YAZ_END_CDECL
index 04aae8e..d3674cb 100644 (file)
@@ -46,7 +46,7 @@ typedef struct yaz_cond *YAZ_COND;
 
 /** \brief create MUTEX
     \param mutexp is pointer to MUTEX handle (*mutexp must be NULL)
-    
+
     It is important that *mutexp is NULL. If not, yaz_mutex_create will
     not modify the handle (assumes it is already created!)
  */
@@ -89,7 +89,7 @@ void yaz_mutex_set_name(YAZ_MUTEX mutex, int log_level, const char *name);
 
 /** \brief creates condition variable
     \param p reference to condition handle
-    
+
     Upon successful completion *p holds the condition handle; *p = 0
     on error.
 */
@@ -97,7 +97,7 @@ YAZ_EXPORT void yaz_cond_create(YAZ_COND *p);
 
 /** \brief destroys condition variable
     \param p reference to condition handle
-    
+
     Upon completion *p holds 0.
 */
 YAZ_EXPORT
index 5c65ce2..076b092 100644 (file)
@@ -70,7 +70,7 @@ typedef int nmem_int_t;
 /** \brief BER/utility boolean */
 typedef int nmem_bool_t;
 
-/** \brief releases memory associaged with an NMEM handle 
+/** \brief releases memory associaged with an NMEM handle
     \param n NMEM handle
 */
 YAZ_EXPORT void nmem_reset(NMEM n);
@@ -80,7 +80,7 @@ YAZ_EXPORT void nmem_reset(NMEM n);
  */
 YAZ_EXPORT size_t nmem_total(NMEM n);
 
-/** \brief allocates string on NMEM handle (similar strdup) 
+/** \brief allocates string on NMEM handle (similar strdup)
     \param mem HNEM handle
     \param src string
     \returns duplicated string
@@ -103,7 +103,7 @@ YAZ_EXPORT char *nmem_strdupn(NMEM mem, const char *src, size_t n);
 
 /** \brief allocates sub strings out of string using certain delimitors
     \param nmem NMEM handle
-    \param delim delimitor chars (splits on each char in there) 
+    \param delim delimitor chars (splits on each char in there)
     \param dstr string to be split
     \param darray result string array for each sub string
     \param num number of result strings
@@ -114,7 +114,7 @@ YAZ_EXPORT void nmem_strsplit(NMEM nmem, const char *delim,
 
 /** \brief allocates sub strings out of string using certain delimitors
     \param nmem NMEM handle
-    \param delim delimitor chars (splits on each char in there) 
+    \param delim delimitor chars (splits on each char in there)
     \param dstr string to be split
     \param darray result string array for each sub string
     \param num number of result strings
@@ -137,7 +137,7 @@ YAZ_EXPORT void nmem_strsplit_blank(NMEM nmem, const char *dstr,
 
 /** \brief allocates sub strings out of string using certain delimitors
     \param nmem NMEM handle
-    \param delim delimitor chars (splits on each char in there) 
+    \param delim delimitor chars (splits on each char in there)
     \param dstr string to be split
     \param darray result string array for each sub string
     \param num number of result strings
@@ -151,7 +151,7 @@ YAZ_EXPORT void nmem_strsplit_escape(NMEM nmem, const char *delim,
 
 /** \brief allocates sub strings out of string using certain delimitors
     \param nmem NMEM handle
-    \param delim delimitor chars (splits on each char in there) 
+    \param delim delimitor chars (splits on each char in there)
     \param dstr string to be split
     \param darray result string array for each sub string
     \param num number of result strings
@@ -184,7 +184,7 @@ YAZ_EXPORT nmem_bool_t *nmem_booldup(NMEM nmem, nmem_bool_t v);
  */
 YAZ_EXPORT void nmem_transfer(NMEM dst, NMEM src);
 
-/** \brief returns new NMEM handle 
+/** \brief returns new NMEM handle
     \returns NMEM handle
  */
 YAZ_EXPORT NMEM nmem_create(void);
index 32cb334..a532522 100644 (file)
@@ -312,7 +312,7 @@ typedef struct Odr_external
     union
     {
         Odr_any  *single_ASN1_type;
-        Odr_oct  *octet_aligned; 
+        Odr_oct  *octet_aligned;
         Odr_bitmask *arbitrary;      /* we aren't really equipped for this*/
     } u;
 } Odr_external;
@@ -329,7 +329,7 @@ YAZ_EXPORT int odr_generalizedtime(ODR o, char **p, int opt,
 YAZ_EXPORT int odr_set_charset(ODR o, const char *to, const char *from);
 
 YAZ_EXPORT void odr_set_stream(ODR o,  void *handle,
-                               void (*stream_write)(ODR o, 
+                               void (*stream_write)(ODR o,
                                                     void *handle,
                                                     int type,
                                                     const char *buf,
index 54f4881..53efe20 100644 (file)
@@ -62,9 +62,9 @@ typedef enum oid_class
     CLASS_GENERAL,
     CLASS_NEGOT
 } oid_class;
-    
 
-/** \brief returns standard OID database 
+
+/** \brief returns standard OID database
     \retval OID database handle
 */
 YAZ_EXPORT
@@ -72,7 +72,7 @@ yaz_oid_db_t yaz_oid_std(void);
 
 /** \brief maps named OID string to raw OID by database lookup
     \param oid_db OID database
-    \param oclass class of string (enum oid_class) 
+    \param oclass class of string (enum oid_class)
     \param name OID name
     \returns raw OID or NULL if name is unknown (bad)
 
@@ -87,7 +87,7 @@ const Odr_oid *yaz_string_to_oid(yaz_oid_db_t oid_db,
 
 /** \brief creates NMEM malloc'ed OID from string
     \param oid_db OID database
-    \param oclass class of string (enum oid_class) 
+    \param oclass class of string (enum oid_class)
     \param name OID name
     \param nmem memory for returned OID
     \returns raw OID or NULL if name is unknown (bad)
@@ -98,7 +98,7 @@ Odr_oid *yaz_string_to_oid_nmem(yaz_oid_db_t oid_db,
 
 /** \brief creates ODR malloc'ed OID from string
     \param oid_db OID database
-    \param oclass class of string (enum oid_class) 
+    \param oclass class of string (enum oid_class)
     \param name OID name
     \param odr memory for returned OID
     \returns raw OID or NULL if name is unknown (bad)
@@ -122,7 +122,7 @@ const char *yaz_oid_to_string(yaz_oid_db_t oid_db,
     \param oid raw OID
     \param oclass holds OID class if found (output parameter)
     \param buf string buffer for result (must be of size OID_STR_MAX)
-    \returns OID string (named or dot notatition) 
+    \returns OID string (named or dot notatition)
 */
 YAZ_EXPORT
 const char *yaz_oid_to_string_buf(const Odr_oid *oid,
index 79c229e..b98ef1e 100644 (file)
@@ -46,10 +46,10 @@ YAZ_BEGIN_CDECL
     \retval -1 unknown option (error). arg is name of unknown option
     \retval -2 no more options (end of options)
     \retval c option char
-    
+
     This function is called repeatedly for each option. Both single
     char options (-x) as well as GNU long options are supported (--long).
-    The description is a sequence specs where each spec is if the form: 
+    The description is a sequence specs where each spec is if the form:
     [a-zA-Z0-9]({[a-zA-Z0-9]*})+:? . For example: h{help}f{filename}{fname}:
 
     The first char is what is returned when met (single char option char).
@@ -67,7 +67,7 @@ YAZ_EXPORT int options(const char *desc, char **argv, int argc, char **arg);
 YAZ_END_CDECL
 
 #endif
-        
+
 /*
  * Local variables:
  * c-basic-offset: 4
index 326723d..b6a162e 100644 (file)
@@ -58,7 +58,7 @@ struct yaz_poll_fd {
     void *client_data;
 };
 
-/** \brief poll wrapper for poll or select 
+/** \brief poll wrapper for poll or select
     \param fds array of sockets to be polled
     \param num_fds size of fds array (number of sockets)
     \param sec number of seconds to wait (-1 for no timeout)
index 13cd4d0..0dd6cd1 100644 (file)
@@ -60,7 +60,7 @@ YAZ_EXPORT void yaz_pqf_destroy(YAZ_PQF_Parser p);
 
 YAZ_EXPORT int yaz_pqf_error(YAZ_PQF_Parser p, const char **msg, size_t *off);
 
-YAZ_EXPORT    
+YAZ_EXPORT
 Z_Term *z_Term_create(ODR o, int term_type, const char *buf, size_t len);
 
 
index c56a517..e63f2e9 100644 (file)
@@ -88,14 +88,14 @@ YAZ_BEGIN_CDECL
 #define Z_RES_INTERIM Z_SearchResponse_interim
 #define Z_RES_NONE    Z_SearchResponse_none
 
-#define Z_SortStatus_success Z_SortResponse_success 
+#define Z_SortStatus_success Z_SortResponse_success
 #define Z_SortStatus_partial_1 Z_SortResponse_partial_1
 #define Z_SortStatus_failure Z_SortResponse_failure
 
-#define Z_SortRelation_ascending            Z_SortKeySpec_ascending 
+#define Z_SortRelation_ascending            Z_SortKeySpec_ascending
 #define Z_SortRelation_descending           Z_SortKeySpec_descending
 #define Z_SortRelation_ascendingByFreq      Z_SortKeySpec_ascendingByFrequency
-#define Z_SortRelation_descendingByFreq     Z_SortKeySpec_descendingByfrequency 
+#define Z_SortRelation_descendingByFreq     Z_SortKeySpec_descendingByfrequency
 
 #define Z_SortCase_caseSensitive            Z_SortKeySpec_caseSensitive
 #define Z_SortCase_caseInsensitive          Z_SortKeySpec_caseInsensitive
index feb1df6..079b87b 100644 (file)
 #include <yaz/yconfig.h>
 
 YAZ_BEGIN_CDECL
-    
+
 YAZ_EXPORT int readconf(char *name, void *rprivate,
                         int (*fun)(char *name, void *rprivate,
                                    int argc, char *argv[]));
 
 YAZ_EXPORT int readconf_line(FILE *f, int *lineno,
                              char *line, int len, char *argv[], int num);
-    
+
 YAZ_END_CDECL
 
 #endif
index a9bdebe..686faa9 100644 (file)
@@ -78,7 +78,7 @@ struct yaz_record_conv_type {
     \retval -1 failure
 
     On failure, use yaz_record_conv_get_error to get error string.
-    
+
     \verbatim
     <backend syntax='xml'>
       <xslt stylesheet="dc2marcxml.xsl"/>
@@ -144,7 +144,7 @@ int yaz_record_conv_opac_record(yaz_record_conv_t p,
 /** returns error string (for last error)
     \param p record conversion handle
     \return error string
-*/    
+*/
 YAZ_EXPORT
 const char *yaz_record_conv_get_error(yaz_record_conv_t p);
 
@@ -152,14 +152,14 @@ const char *yaz_record_conv_get_error(yaz_record_conv_t p);
 /** set path for opening stylesheets etc.
     \param p record conversion handle
     \param path file path (UNIX style with : / Windows with ;)
-*/    
+*/
 YAZ_EXPORT
 void yaz_record_conv_set_path(yaz_record_conv_t p, const char *path);
 
 /** adds a type to our conversion handler
     \param p record conversion handle
     \param type info
-*/    
+*/
 
 YAZ_END_CDECL
 
index f71f32f..a75ee06 100644 (file)
@@ -62,7 +62,7 @@ YAZ_EXPORT void yaz_retrieval_destroy(yaz_retrieval_t p);
     \retval -1 failure
 
     On failure, call yaz_retrieval_get_error to get error string.
-    
+
     For retrieval:
     \verbatim
      <retrievalinfo>
@@ -130,7 +130,7 @@ int yaz_retrieval_request(yaz_retrieval_t p,
 /** returns error string (for last error)
     \param p record conversion handle
     \return error string
-*/    
+*/
 YAZ_EXPORT
 const char *yaz_retrieval_get_error(yaz_retrieval_t p);
 
@@ -138,7 +138,7 @@ const char *yaz_retrieval_get_error(yaz_retrieval_t p);
 /** set path for opening stylesheets etc.
     \param p record conversion handle
     \param path file path (UNIX style with : / Windows with ;)
-*/    
+*/
 YAZ_EXPORT
 void yaz_retrieval_set_path(yaz_retrieval_t p, const char *path);
 
index 12befc8..252963c 100644 (file)
@@ -71,7 +71,7 @@ int cql_transform_rpn2cql_wrbuf(cql_transform_t ct,
     \returns pattern value or NULL if not found
  */
 YAZ_EXPORT
-const char *cql_lookup_reverse(cql_transform_t ct, 
+const char *cql_lookup_reverse(cql_transform_t ct,
                                const char *category,
                                Z_AttributeList *attributes);
 
index 4567b62..2724a12 100644 (file)
@@ -27,7 +27,7 @@
 
 /** \file sc.h
     \brief Header for Windows Service Control utility
-   
+
     This is a simple wrapper for the Windows Service Control system. It
     also operates on Unix in which case the user supplied main function
     (sc_main) is is called immediately. See sc_test.c for an example.
@@ -73,7 +73,7 @@ YAZ_EXPORT void yaz_sc_running(yaz_sc_t s);
 
 /** \brief frees service control handle
     \param s service control handle
-*/    
+*/
 YAZ_EXPORT void yaz_sc_destroy(yaz_sc_t *s);
 
 YAZ_END_CDECL
index 443d706..69a849a 100644 (file)
@@ -42,7 +42,7 @@ YAZ_BEGIN_CDECL
 YAZ_EXPORT void yaz_snprintf(char *buf, size_t size, const char *fmt, ...);
 YAZ_EXPORT void yaz_vsnprintf(char *buf, size_t size, const char *fmt,
                               va_list ap);
-    
+
 YAZ_END_CDECL
 
 #endif
index 654d587..6dd5ba2 100644 (file)
@@ -70,14 +70,14 @@ typedef struct {
     Z_SOAP_fun f;
 } Z_SOAP_Handler;
 
-YAZ_EXPORT int z_soap_codec(ODR o, Z_SOAP **pp, 
+YAZ_EXPORT int z_soap_codec(ODR o, Z_SOAP **pp,
                             char **content_buf, int *content_len,
                             Z_SOAP_Handler *handlers);
-YAZ_EXPORT int z_soap_codec_enc(ODR o, Z_SOAP **pp, 
+YAZ_EXPORT int z_soap_codec_enc(ODR o, Z_SOAP **pp,
                                 char **content_buf, int *content_len,
                                 Z_SOAP_Handler *handlers,
                                 const char *encoding);
-YAZ_EXPORT int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp, 
+YAZ_EXPORT int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp,
                                     char **content_buf, int *content_len,
                                     Z_SOAP_Handler *handlers,
                                     const char *encoding,
index 02ed989..869a1cf 100644 (file)
@@ -41,10 +41,10 @@ typedef struct solr_parser *SOLR_parser;
 
 /** \brief creates a SOLR parser.
     \returns CCL parser
-    
+
     Returns SOLR parser or NULL if parser could not be created.
  */
-YAZ_EXPORT 
+YAZ_EXPORT
 SOLR_parser solr_parser_create(void);
 
 /** \brief destroys a SOLR parser.
@@ -52,7 +52,7 @@ SOLR_parser solr_parser_create(void);
 
     This function does nothing if NULL if received.
  */
-YAZ_EXPORT 
+YAZ_EXPORT
 void solr_parser_destroy(SOLR_parser cp);
 
 /** \brief parses a SOLR query (string)
@@ -61,7 +61,7 @@ void solr_parser_destroy(SOLR_parser cp);
     \retval 0 success
     \retval !=0 failure
  */
-YAZ_EXPORT 
+YAZ_EXPORT
 int solr_parser_string(SOLR_parser cp, const char *str);
 
 /** \brief parses SOLR query (query stream)
@@ -71,14 +71,14 @@ int solr_parser_string(SOLR_parser cp, const char *str);
     \param client_data data to be passed to stream functions
     \retval 0 success
     \retval !=0 failure
-    
+
     This function is similar to solr_parser_string but takes a
     functions to read each query character from a stream.
-    
+
     The functions pointers getbytes, ungetbyte are similar to
     that known from stdios getc, ungetc.
 */
-YAZ_EXPORT 
+YAZ_EXPORT
 int solr_parser_stream(SOLR_parser cp,
                       int (*getbyte)(void *client_data),
                       void (*ungetbyte)(int b, void *client_data),
@@ -89,7 +89,7 @@ int solr_parser_stream(SOLR_parser cp,
     \param f file where query is read from
     \retval 0 success
     \retval !=0 failure
-    
+
     This function is similar to solr_parser_string but reads from
     stdio FILE handle instead.
 */
@@ -129,7 +129,7 @@ struct solr_node {
             char *value;
             /** left operand */
             struct solr_node *left;
-            /** right operand */ 
+            /** right operand */
             struct solr_node *right;
             /** modifiers (NULL for no list) */
             struct solr_node *modifiers;
@@ -260,7 +260,7 @@ solr_transform_t solr_transform_open_fname(const char *fname);
 YAZ_EXPORT
 int solr_transform_define_pattern(solr_transform_t ct, const char *pattern,
                                  const char *value);
-    
+
 
 
 /** \brief destroys a SOLR transform handle
index 9f83246..96e3ca3 100644 (file)
@@ -42,9 +42,9 @@ YAZ_BEGIN_CDECL
     \param odr memory for result
     \param arg sort spec string
     \returns Z39.50 SortKeySpecList or NULL on error
-    
+
     The sort spec list is of the form:
-    (field flags)+ 
+    (field flags)+
     where field is either a string or one or more attribute pairs
     key=value (there must be no blanks in either field of flags).
     flags is a character list:
@@ -54,7 +54,7 @@ YAZ_BEGIN_CDECL
     sS     : respectcase / case-sensitive
     !      : abort of key is omitted in result
     =value : missing value
-    
+
     Examples:
 
       title a
index 8a67ca0..2fa1c1e 100644 (file)
@@ -63,7 +63,7 @@ typedef struct {
     char *details;
     char *message;
 } Z_SRW_diagnostic;
-    
+
 typedef struct {
 
 #define Z_SRW_query_type_cql  1
@@ -100,7 +100,7 @@ typedef struct {
     Odr_int *numberOfRecords;
     char * resultSetId;
     Odr_int *resultSetIdleTime;
-    
+
     Z_SRW_record *records;
     int num_records;
 
@@ -125,7 +125,7 @@ typedef struct {
     int num_diagnostics;
     Z_SRW_extra_record *extra_record;
 } Z_SRW_explainResponse;
-    
+
 typedef struct {
     int query_type;
     union {
@@ -272,7 +272,7 @@ 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, 
+                              Z_SOAP **soap_package, ODR decode,
                               char **charset,
                               Z_SRW_diagnostic **, int *num_diagnostic);
 
@@ -290,12 +290,12 @@ YAZ_EXPORT int yaz_solr_decode_response(ODR o, Z_HTTP_Response *hres,
 YAZ_EXPORT void yaz_add_srw_diagnostic(ODR o, Z_SRW_diagnostic **d,
                                        int *num, int code,
                                        const char *addinfo);
-    
+
 YAZ_EXPORT void yaz_add_sru_update_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, 
+YAZ_EXPORT void yaz_mk_std_diagnostic(ODR o, Z_SRW_diagnostic *d,
                                       int code, const char *details);
 
 YAZ_EXPORT void yaz_add_srw_diagnostic_uri(ODR o, Z_SRW_diagnostic **d,
@@ -303,7 +303,7 @@ YAZ_EXPORT void yaz_add_srw_diagnostic_uri(ODR o, Z_SRW_diagnostic **d,
                                            const char *message,
                                            const char *details);
 
-YAZ_EXPORT void yaz_mk_srw_diagnostic(ODR o, Z_SRW_diagnostic *d, 
+YAZ_EXPORT void yaz_mk_srw_diagnostic(ODR o, Z_SRW_diagnostic *d,
                                       const char *uri, const char *message,
                                       const char *details);
 
@@ -360,7 +360,7 @@ char *yaz_encode_sru_dbpath_odr(ODR out, const char *db);
 /** \brief encode SRU database for HTTP path
     \param dst destination buffer (should be at least strlen(db) +2 in size)
     \param db source database
-   
+
     The resulting database (dst) includes a leading /
 */
 YAZ_EXPORT
index 9149550..6fd20d6 100644 (file)
@@ -52,10 +52,10 @@ int yaz_test_get_verbosity(void);
   } \
 }
 
-/** \brief a test we know will fail at this time. 
+/** \brief a test we know will fail at this time.
  *
  * Later, when the bug is fixed, this test will suddenly pass,
- * which will be reported as an error, to remind you to go and fix 
+ * which will be reported as an error, to remind you to go and fix
  * your tests.
  */
 
index 66d82a7..1039e37 100644 (file)
@@ -51,7 +51,7 @@ typedef struct yaz_timing *yaz_timing_t;
     do_work();
     yaz_timing_stop(my);
 
-    printf("real=%g user=%g sys=%g\n", 
+    printf("real=%g user=%g sys=%g\n",
        yaz_timing_get_real(my),
        yaz_timing_get_user(my),
        yaz_timing_get_sys(my));
@@ -71,7 +71,7 @@ void yaz_timing_start(yaz_timing_t t);
 
 /** \brief stop timer
     \param t timing handle
-    
+
     Use yaz_timing_get_real, yaz_timing_get_user and yaz_timing_get_sys
     to fetch timing results.
 */
index be05a62..f45eb60 100644 (file)
@@ -50,7 +50,7 @@ YAZ_EXPORT int yaz_is_abspath(const char *path);
     \param comp upon pointer to component (if component is found)
     \retval 0 no component found (and no more componennts)
     \retval >0 length of component (length of *comp)
-    
+
     A filepath has components separted by colon. For example
     /usr/lib/modules:c:/my:/:lib
     which has these components
@@ -59,7 +59,7 @@ YAZ_EXPORT int yaz_is_abspath(const char *path);
 YAZ_EXPORT size_t yaz_filepath_comp(const char **path_p, const char **comp);
 
 
-/** \brief resolve file on path 
+/** \brief resolve file on path
     \param fname "short" filename (without path)
     \param path the path (dir1:dir2,..) - ala Unix
     \param base can be added to relative paths (NULL for no append)
@@ -72,7 +72,7 @@ YAZ_EXPORT char *yaz_filepath_resolve(const char *fname, const char *path,
                                       const char *base, char *fullpath);
 
 
-/** \brief opens first file in path in path 
+/** \brief opens first file in path in path
     \param fname "short" filename (without path)
     \param mode mode as in fopen(3)
     \param path the path (dir1:dir2,..) - ala Unix
@@ -82,7 +82,7 @@ YAZ_EXPORT char *yaz_filepath_resolve(const char *fname, const char *path,
 YAZ_EXPORT FILE *yaz_fopen(const char *path, const char *fname,
                            const char *mode, const char *base);
 
-/** \brief opens first file in path in path 
+/** \brief opens first file in path in path
     \param fname "short" filename (without path)
     \param mode mode as in fopen(3)
     \param path the path (dir1:dir2,..) - ala Unix
index e165366..899a580 100644 (file)
@@ -47,7 +47,7 @@ YAZ_EXPORT yaz_url_t yaz_url_create(void);
 
 /** \brief destroys a URL fetcher
     \param p handle
-    
+
     Note: OK to pass NULL as p
 */
 YAZ_EXPORT void yaz_url_destroy(yaz_url_t p);
index eebb015..eca8663 100644 (file)
@@ -53,7 +53,7 @@ YAZ_EXPORT WRBUF wrbuf_alloc(void);
 
 /** \brief destroy WRBUF and its buffer
     \param b WRBUF
+
     For YAZ 4.0.2 WRBUF b may be NULL.
  */
 YAZ_EXPORT void wrbuf_destroy(WRBUF b);
@@ -109,7 +109,7 @@ YAZ_EXPORT void wrbuf_xmlputs(WRBUF b, const char *cp);
     \param from character "from"
     \param to charcter "to"
 */
-YAZ_EXPORT void wrbuf_puts_replace_char(WRBUF b, const char *buf, 
+YAZ_EXPORT void wrbuf_puts_replace_char(WRBUF b, const char *buf,
                                         const char from, const char to);
 
 /** \brief writes C-string to WRBUF and escape non-ASCII characters
@@ -194,7 +194,7 @@ YAZ_EXPORT void wrbuf_iconv_putchar(WRBUF b, yaz_iconv_t cd, int ch);
 /** \brief iconv reset(flush) to WRBUF
     \param b
     \param cd iconv handle
-    
+
     This function calls iconv(cd, 0, 0, ..) to make it
     flush any remaining content.
 */
@@ -211,7 +211,7 @@ YAZ_EXPORT void wrbuf_chop_right(WRBUF b);
  */
 YAZ_EXPORT void wrbuf_cut_right(WRBUF b, size_t no_to_remove);
 
-/** \brief grow WRBUF larger 
+/** \brief grow WRBUF larger
     \param b WRBUF
     \param minsize make WRBUF at least this size
 
index a1a0b24..ba19c1f 100644 (file)
@@ -57,7 +57,7 @@ YAZ_BEGIN_CDECL
 #define xstrndup(s, n) xstrndup_f(s, n, __FILE__, __LINE__)
 /** \brief utility macro which calls malloc_trav_f */
 #define xmalloc_trav(s) xmalloc_trav_f(s, __FILE__, __LINE__)
-    
+
 /** \brief realloc
     \param o buffer to be reallocated
     \param size size of buffer to be allocated
index c229f91..43461b3 100644 (file)
@@ -25,7 +25,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/** \file 
+/** \file
     \brief XML Include (not to be confused with W3C XInclude)
 */
 
index 08b0976..e74ede4 100644 (file)
@@ -70,7 +70,7 @@ YAZ_EXPORT unsigned long yaz_read_UTF8_char(unsigned char *inp,
                                             size_t *no_read,
                                             int *error);
 
-/** \brief encodes UTF-8 sequence 
+/** \brief encodes UTF-8 sequence
     \param x the UNICODE value
     \param outbuf output buffer pointer, updated if conversion is successful
     \param outbytesleft length of buffer, updated if conversino is successful
index 819f53a..4fb196c 100644 (file)
@@ -37,7 +37,7 @@
 #include <yaz/yaz-version.h>
 #include <yaz/xmalloc.h>
 
-#include <yaz/log.h>  
+#include <yaz/log.h>
 
 #include <yaz/tpath.h>
 #include <yaz/options.h>
@@ -59,7 +59,7 @@
 
     The following sections is just a summary of the most important
     header files and where they belong.
-    
+
     \section utilities Utilies
     Logging (syslog-like) utility \ref log.h .
 
     Z39.50 sort: \ref sortspec.h .
 
     \section ber BER handling
-    
+
     BER utilities (ODR): \ref odr.h .
 
     \section z3950 Z39.50
 
     Z39.50 common header: \ref proto.h .
-    
+
     Z39.50 core codecs: \ref z-core.h.
 
     Z39.50 related formats:
-    \ref z-accdes1.h ,  \ref z-core.h ,   
+    \ref z-accdes1.h ,  \ref z-core.h ,
     \ref z-estask.h , \ref z-oclcui.h , \ref z-sum.h
-    \ref z-accform1.h , \ref z-date.h , 
+    \ref z-accform1.h , \ref z-date.h ,
     \ref z-exp.h ,    \ref z-opac.h ,   \ref z-sutrs.h
-    \ref z-acckrb1.h ,  \ref z-diag1.h , 
+    \ref z-acckrb1.h ,  \ref z-diag1.h ,
     \ref z-grs.h ,    \ref z-rrf1.h ,   \ref z-uifr1.h
     \ref z-charneg.h ,  \ref z-espec1.h
     \ref z-mterm2.h , \ref z-rrf2.h ,   \ref z-univ.h .
 
     Z39.50 extended services:
-    \ref zes-admin.h , \ref zes-exps.h , \ref zes-pquery.h , 
+    \ref zes-admin.h , \ref zes-exps.h , \ref zes-pquery.h ,
     \ref zes-pset.h , \ref zes-update.h ,
-    \ref zes-expi.h , \ref zes-order.h ,  \ref zes-psched.h , 
+    \ref zes-expi.h , \ref zes-order.h ,  \ref zes-psched.h ,
     \ref zes-update0.h .
 
     Z39.50 diagnostics: \ref diagbib1.h .
     Z39.50 externals: \ref prt-ext.h .
 
     \section GDU Generic Data Unit (HTTP and BER)
-    
+
     Definitions for GDU and HTTP: \ref zgdu.h .
 
     \section SRU SRU
     SRU/SRW definitions: \ref srw.h .
 
     SRW diagnostics: \ref diagsrw.h .
-    
+
     \section ILL ILL
 
     Common header: \ref ill.h .
     Codecs: \ref ill-core.h
 
     \section ZOOM ZOOM
-    
+
     Common header: \ref zoom.h .
 
     \section GFS Generic Frontend Server (GFS)
-    
+
     Header: \ref backend.h .
 
 */
 #endif
-    
+
 /*
  * Local variables:
  * c-basic-offset: 4
index 9483c80..a79b4a4 100644 (file)
@@ -39,7 +39,7 @@
 #  define YAZ_IMPORT __declspec(dllimport)
 # else
 #  define YAZ_EXPORT
-#  define YAZ_IMPORT 
+#  define YAZ_IMPORT
 # endif
 #endif
 
@@ -53,8 +53,8 @@
 #define YAZ_BEGIN_CDECL extern "C" {
 #define YAZ_END_CDECL }
 #else
-#define YAZ_BEGIN_CDECL 
-#define YAZ_END_CDECL 
+#define YAZ_BEGIN_CDECL
+#define YAZ_END_CDECL
 #endif
 
 #endif
index baa2246..ac10540 100644 (file)
@@ -251,7 +251,7 @@ ZOOM_record_clone(ZOOM_record srec);
 ZOOM_API(int)
     ZOOM_record_error(ZOOM_record rec, const char **msg,
                       const char **addinfo, const char **diagset);
-    
+
 /* ----------------------------------------------------------- */
 /* facets */
 
@@ -287,7 +287,7 @@ ZOOM_query_cql2rpn(ZOOM_query s, const char *str, ZOOM_connection conn);
 /* CCL translated client-side into RPN: `conn' is optional for diagnostics */
 ZOOM_API(int)
 ZOOM_query_ccl2rpn(ZOOM_query s, const char *query_str,
-                   const char *config, 
+                   const char *config,
                    int *ccl_error, const char **error_string, int *error_pos);
 /* PQF */
 ZOOM_API(int)
@@ -391,7 +391,7 @@ ZOOM_options_getl(ZOOM_options opt, const char *name, int *lenp);
 
 ZOOM_API(void)
 ZOOM_options_set(ZOOM_options opt, const char *name, const char *v);
-    
+
 ZOOM_API(void)
 ZOOM_options_setl(ZOOM_options opt, const char *name, const char *value,
                   int len);
@@ -420,7 +420,7 @@ ZOOM_options_set_int(ZOOM_options opt, const char *name, int value);
     \param cs connection array
     \retval 0 no event was fired
     \retval >0 event was fired for connection at (retval-1)
-    
+
     blocking poll for events on a number of connections. Returns positive
     integer if event occurred ; zero if none occurred and no more
     events are pending. The positive integer specifies the
@@ -461,7 +461,7 @@ ZOOM_event_nonblock(int no, ZOOM_connection *cs);
     \retval 0 no event was processed
     \retval 1 event was processed for connection
 
-    This function attemps to deal with outstandings events in 
+    This function attemps to deal with outstandings events in
     a non-blocking fashion. If no event was processed (return value of 0),
     then the system should attempt to deal with sockets in blocking mode
     using socket select/poll which means calling the following functions:
@@ -499,7 +499,7 @@ ZOOM_API(int)
 ZOOM_connection_get_socket(ZOOM_connection c);
 
 
-/** \brief get socket mask for connection 
+/** \brief get socket mask for connection
     \param c connection
     \returns mask for connection (possibly 0)
 
index ea29153..6f3bf04 100644 (file)
@@ -46,7 +46,7 @@ static unsigned long read_advancegreek(yaz_iconv_t cd, yaz_iconv_decoder_t d,
         inp++;
         --inbytesleft;
         (*no_read)++;
-    }    
+    }
     if (inbytesleft == 0)
     {
         yaz_iconv_set_errno(cd, YAZ_ICONV_EINVAL); /* incomplete input */
@@ -55,217 +55,217 @@ static unsigned long read_advancegreek(yaz_iconv_t cd, yaz_iconv_decoder_t d,
     }
     switch (*inp) {
     case 0x81:
-        if (shift) 
-            if (tonos) 
+        if (shift)
+            if (tonos)
                 x = 0x0386;
-            else 
+            else
                 x = 0x0391;
-        else 
-            if (tonos) 
+        else
+            if (tonos)
                 x = 0x03ac;
-            else 
+            else
                 x = 0x03b1;
         break;
     case 0x82:
-        if (shift) 
+        if (shift)
             x = 0x0392;
-        else 
+        else
             x = 0x03b2;
-        
+
         break;
     case 0x83:
-        if (shift) 
+        if (shift)
             x = 0x0393;
-        else 
+        else
             x = 0x03b3;
         break;
     case 0x84:
-        if (shift) 
+        if (shift)
             x = 0x0394;
-        else 
+        else
             x = 0x03b4;
         break;
     case 0x85:
-        if (shift) 
-            if (tonos) 
+        if (shift)
+            if (tonos)
                 x = 0x0388;
-            else 
+            else
                 x = 0x0395;
-        else 
-            if (tonos) 
+        else
+            if (tonos)
                 x = 0x03ad;
-            else 
+            else
                 x = 0x03b5;
         break;
     case 0x86:
-        if (shift) 
+        if (shift)
             x = 0x0396;
-        else 
+        else
             x = 0x03b6;
         break;
     case 0x87:
-        if (shift) 
-            if (tonos) 
+        if (shift)
+            if (tonos)
                 x = 0x0389;
-            else 
+            else
                 x = 0x0397;
-        else 
-            if (tonos) 
+        else
+            if (tonos)
                 x = 0x03ae;
-            else 
+            else
                 x = 0x03b7;
         break;
     case 0x88:
-        if (shift) 
+        if (shift)
             x = 0x0398;
-        else 
+        else
             x = 0x03b8;
         break;
     case 0x89:
-        if (shift) 
-            if (tonos) 
+        if (shift)
+            if (tonos)
                 x = 0x038a;
-            else 
-                if (dialitika) 
+            else
+                if (dialitika)
                     x = 0x03aa;
-                else 
+                else
                     x = 0x0399;
-        else 
-            if (tonos) 
-                if (dialitika) 
+        else
+            if (tonos)
+                if (dialitika)
                     x = 0x0390;
-                else 
+                else
                     x = 0x03af;
-        
-            else 
-                if (dialitika) 
+
+            else
+                if (dialitika)
                     x = 0x03ca;
-                else 
+                else
                     x = 0x03b9;
         break;
     case 0x8a:
-        if (shift) 
+        if (shift)
             x = 0x039a;
-        else 
+        else
             x = 0x03ba;
-        
+
         break;
     case 0x8b:
-        if (shift) 
+        if (shift)
             x = 0x039b;
-        else 
+        else
             x = 0x03bb;
         break;
     case 0x8c:
-        if (shift) 
+        if (shift)
             x = 0x039c;
-        else 
+        else
             x = 0x03bc;
-        
+
         break;
     case 0x8d:
-        if (shift) 
+        if (shift)
             x = 0x039d;
-        else 
+        else
             x = 0x03bd;
         break;
     case 0x8e:
-        if (shift) 
+        if (shift)
             x = 0x039e;
-        else 
+        else
             x = 0x03be;
         break;
     case 0x8f:
-        if (shift) 
-            if (tonos) 
+        if (shift)
+            if (tonos)
                 x = 0x038c;
-            else 
+            else
                 x = 0x039f;
-        else 
-            if (tonos) 
+        else
+            if (tonos)
                 x = 0x03cc;
-            else 
+            else
                 x = 0x03bf;
         break;
     case 0x90:
-        if (shift) 
+        if (shift)
             x = 0x03a0;
-        else 
+        else
             x = 0x03c0;
         break;
     case 0x91:
-        if (shift) 
+        if (shift)
             x = 0x03a1;
-        else 
+        else
             x = 0x03c1;
         break;
     case 0x92:
         x = 0x03c2;
         break;
     case 0x93:
-        if (shift) 
+        if (shift)
             x = 0x03a3;
-        else 
+        else
             x = 0x03c3;
         break;
     case 0x94:
-        if (shift) 
+        if (shift)
             x = 0x03a4;
-        else 
+        else
             x = 0x03c4;
         break;
     case 0x95:
-        if (shift) 
-            if (tonos) 
+        if (shift)
+            if (tonos)
                 x = 0x038e;
-            else 
-                if (dialitika) 
+            else
+                if (dialitika)
                     x = 0x03ab;
-                else 
+                else
                     x = 0x03a5;
-        else 
-            if (tonos) 
-                if (dialitika) 
+        else
+            if (tonos)
+                if (dialitika)
                     x = 0x03b0;
-                else 
+                else
                     x = 0x03cd;
-        
-            else 
-                if (dialitika) 
+
+            else
+                if (dialitika)
                     x = 0x03cb;
-                else 
+                else
                     x = 0x03c5;
         break;
     case 0x96:
-        if (shift) 
+        if (shift)
             x = 0x03a6;
-        else 
+        else
             x = 0x03c6;
         break;
     case 0x97:
-        if (shift) 
+        if (shift)
             x = 0x03a7;
-        else 
+        else
             x = 0x03c7;
         break;
     case 0x98:
-        if (shift) 
+        if (shift)
             x = 0x03a8;
-        else 
+        else
             x = 0x03c8;
-        
+
         break;
-        
+
     case 0x99:
-        if (shift) 
-            if (tonos) 
+        if (shift)
+            if (tonos)
                 x = 0x038f;
-            else 
+            else
                 x = 0x03a9;
-        else 
-            if (tonos) 
+        else
+            if (tonos)
                 x = 0x03ce;
-            else 
+            else
                 x = 0x03c9;
         break;
     default:
@@ -273,7 +273,7 @@ static unsigned long read_advancegreek(yaz_iconv_t cd, yaz_iconv_decoder_t d,
         break;
     }
     (*no_read)++;
-    
+
     return x;
 }
 
index 9ae0d4f..77d638c 100644 (file)
@@ -3,7 +3,7 @@
  * See the file LICENSE for details.
  */
 
-/** 
+/**
  * \file atoin.c
  * \brief Implements atoi_n function.
  */
index 2e44ff6..e268c82 100644 (file)
@@ -86,7 +86,7 @@ int yaz_base64decode(const char *in, char *out)
     while (len >= 4)
     {
        char i0, i1, i2, i3;
-        
+
        i0 = next_char(&in, &len);
         if (i0 < 0)
             return -1;
index 905b0c4..939fb74 100644 (file)
@@ -3,7 +3,7 @@
  * See the file LICENSE for details.
  */
 
-/** 
+/**
  * \file ber_any.c
  * \brief Implements BER ANY encoding and decoding.
  *
@@ -21,7 +21,7 @@
 int ber_any(ODR o, Odr_any **p)
 {
     int res;
-    
+
     switch (o->direction)
     {
     case ODR_DECODE:
@@ -49,7 +49,7 @@ int completeBER_n(const unsigned char *buf, int len, int level)
 {
     int res, ll, zclass, tag, cons;
     const unsigned char *b = buf;
-    
+
     if (level > 1000)
     {
 #if BER_ANY_DEBUG
@@ -74,7 +74,7 @@ int completeBER_n(const unsigned char *buf, int len, int level)
 #endif
         return -1;  /* error */
     }
-    if (res == -1)  
+    if (res == -1)
     {
 #if BER_ANY_DEBUG
         yaz_log(YLOG_LOG, "<<<<<<<<< return2 lev=%d res=%d", level, res);
index e959add..774d370 100644 (file)
@@ -3,7 +3,7 @@
  * See the file LICENSE for details.
  */
 
-/** 
+/**
  * \file ber_bit.c
  * \brief Implements BER BITSTRING encoding and decoding.
  *
@@ -75,7 +75,7 @@ int ber_bitstring(ODR o, Odr_bitmask *p, int cons)
         return 1;
     case ODR_PRINT:
         return 1;
-    default: 
+    default:
         odr_seterror(o, OOTHER, 8);
         return 0;
     }
index c334935..ff2a583 100644 (file)
@@ -3,7 +3,7 @@
  * See the file LICENSE for details.
  */
 
-/** 
+/**
  * \file ber_bool.c
  * \brief Implements BER BOOLEAN encoding and decoding
  *
index d642aff..8eac32e 100644 (file)
@@ -3,7 +3,7 @@
  * See the file LICENSE for details.
  */
 
-/** 
+/**
  * \file ber_int.c
  * \brief Implements BER INTEGER encoding and decoding.
  *
@@ -95,7 +95,7 @@ int ber_decinteger(const unsigned char *buf, Odr_int *val, int max)
     if ((res = ber_declen(b, &len, max)) < 0)
         return -1;
     if (len+res > max || len < 0) /* out of bounds or indefinite encoding */
-        return -1;  
+        return -1;
     if (len > (int) sizeof(uval))  /* let's be reasonable, here */
         return -1;
     b += res;
index 4a1463b..200ef27 100644 (file)
@@ -3,7 +3,7 @@
  * See the file LICENSE for details.
  */
 
-/** 
+/**
  * \file ber_len.c
  * \brief Implements BER length octet encoding and decoding
  *
@@ -81,8 +81,8 @@ int ber_enclen(ODR o, int len, int lenlen, int exact)
 
 /**
  * ber_declen:
- * Decode BER length octets. Returns 
- *  > 0  : number of bytes read 
+ * Decode BER length octets. Returns
+ *  > 0  : number of bytes read
  *   -1  : not enough room to read bytes within max bytes
  *   -2  : other error
  *
@@ -109,7 +109,7 @@ int ber_declen(const unsigned char *buf, int *len, int max)
     }
     if (*b == 0XFF)     /* reserved value */
         return -2;
-    /* indefinite long form */ 
+    /* indefinite long form */
     n = *b & 0X7F;
     if (n >= max)
         return -1;
index e20e5e0..078b80f 100644 (file)
@@ -3,7 +3,7 @@
  * See the file LICENSE for details.
  */
 
-/** 
+/**
  * \file ber_null.c
  * \brief Implements ber_null
  *
@@ -16,7 +16,7 @@
 
 #include "odr-priv.h"
 
-/** 
+/**
  * ber_null: BER-en/decoder for NULL type.
  */
 int ber_null(ODR o)
index 5cb74dd..e7e2d99 100644 (file)
@@ -3,7 +3,7 @@
  * See the file LICENSE for details.
  */
 
-/** 
+/**
  * \file ber_oct.c
  * \brief Implements ber_octetstring
  *
index ce5d370..1231968 100644 (file)
@@ -3,7 +3,7 @@
  * See the file LICENSE for details.
  */
 
-/** 
+/**
  * \file ber_oid.c
  * \brief Implements BER OID encoding and decoding
  *
@@ -102,7 +102,7 @@ int ber_oidc(ODR o, Odr_oid *p, int max_oid_size)
             n = 0;
             if (pos == 1)
                 id = p[0]*40 + p[1];
-            else 
+            else
                 id = p[pos];
             do
             {
@@ -128,7 +128,7 @@ int ber_oidc(ODR o, Odr_oid *p, int max_oid_size)
         }
         odr_seek(o, ODR_S_END, 0);
         return 1;
-    default: 
+    default:
         odr_seterror(o, OOTHER, 22);
         return 0;
     }
index 2fe0478..61585eb 100644 (file)
@@ -3,7 +3,7 @@
  * See the file LICENSE for details.
  */
 
-/** 
+/**
  * \file ber_tag.c
  * \brief Implements BER tags encoding and decoding
  *
@@ -157,7 +157,7 @@ int ber_enctag(ODR o, int zclass, int tag, int constructed)
     }
 }
 
-/** 
+/**
  * \brief Decodes BER identifier octets.
  *
  * Returns number of bytes read or -1 for error.
index a7e121b..9084ffe 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2012 Index Data
  * See the file LICENSE for details.
  */
-/** 
+/**
  * \file ccl_stop_words.c
  * \brief Removes stop words from terms in RPN tree
  */
@@ -26,7 +26,7 @@ struct ccl_stop_words {
     NMEM nmem; /* memory for removed items */
     struct ccl_stop_info *removed_items;
 };
-    
+
 static void append_removed_item(ccl_stop_words_t csw,
                                 const char *qname,
                                 const char *t, size_t len)
@@ -46,7 +46,7 @@ static void append_removed_item(ccl_stop_words_t csw,
 
     while (*csip)
         csip = &(*csip)->next;
-    
+
     *csip = csi;
 }
 
@@ -163,11 +163,11 @@ int ccl_stop_words_tree(ccl_stop_words_t csw,
                         CCL_bibset bibset, struct ccl_rpn_node **t)
 {
     struct ccl_rpn_node *r;
-    
+
     /* remove list items */
     nmem_reset(csw->nmem);
     csw->removed_items = 0;
-    
+
     r = ccl_remove_stop_r(csw, bibset, *t);
     *t = r;
     if (csw->removed_items)
index 7e0ac37..53a1937 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2012 Index Data
  * See the file LICENSE for details.
  */
-/** 
+/**
  * \file cclerrms.c
  * \brief Implements CCL error code to error string map.
  *
@@ -35,7 +35,7 @@ static char *err_msg_array[] = {
 
 const char *ccl_err_msg(int ccl_errno)
 {
-    if (ccl_errno >= 0 && 
+    if (ccl_errno >= 0 &&
         ccl_errno < sizeof(err_msg_array)/sizeof(*err_msg_array))
         return err_msg_array[ccl_errno];
     else
index 12dca79..9997af0 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2012 Index Data
  * See the file LICENSE for details.
  */
-/** 
+/**
  * \file cclfind.c
  * \brief Implements parsing of a CCL FIND query.
  *
@@ -61,7 +61,7 @@ static int qual_val_type(ccl_qualifier_t *qa, int type, int value,
 
 /**
  * strxcat: concatenate strings.
- * n:      Null-terminated Destination string 
+ * n:      Null-terminated Destination string
  * src:    Source string to be appended (not null-terminated)
  * len:    Length of source string.
  */
@@ -171,7 +171,7 @@ static struct ccl_rpn_attr *add_attr_node(struct ccl_rpn_node *p,
                                            const char *set, int type)
 {
     struct ccl_rpn_attr *n;
-    
+
     n = (struct ccl_rpn_attr *)xmalloc(sizeof(*n));
     ccl_assert(n);
     if (set)
@@ -181,7 +181,7 @@ static struct ccl_rpn_attr *add_attr_node(struct ccl_rpn_node *p,
     n->type = type;
     n->next = p->u.t.attr_list;
     p->u.t.attr_list = n;
-    
+
     return n;
 }
 
@@ -313,14 +313,14 @@ static int append_term(CCL_parser cclp, const char *src_str, size_t src_len,
                 *z3958_trunc = 2;
                 strcat(dst_term, "\\");
             }
-            strxcat(dst_term, src_str + j, 1);                    
+            strxcat(dst_term, src_str + j, 1);
         }
     }
     return 0;
 }
 
 /**
- * search_term: Parse CCL search term. 
+ * search_term: Parse CCL search term.
  * cclp:   CCL Parser
  * qa:     Qualifier attributes already applied.
  * term_list: tokens we accept as terms in context
@@ -373,7 +373,7 @@ static struct ccl_rpn_node *search_term_x(CCL_parser cclp,
         size_t max = 200;
         if (and_list || or_list || !multi)
             max = 1;
-        
+
         /* ignore commas when dealing with and-lists .. */
         if (and_list && lookahead && lookahead->kind == CCL_TOK_COMMA)
         {
@@ -402,7 +402,7 @@ static struct ccl_rpn_node *search_term_x(CCL_parser cclp,
 
         if (len == 0)
             break;      /* no more terms . stop . */
-                
+
         /* create the term node, but wait a moment before adding the term */
         p = ccl_rpn_node_create(CCL_RPN_TERM);
         p->u.t.attr_list = NULL;
@@ -418,7 +418,7 @@ static struct ccl_rpn_node *search_term_x(CCL_parser cclp,
         for (i=0; qa && qa[i]; i++)
         {
             struct ccl_rpn_attr *attr;
-            
+
             for (attr = ccl_qual_get_attr(qa[i]); attr; attr = attr->next)
                 switch(attr->kind)
                 {
@@ -464,7 +464,7 @@ static struct ccl_rpn_node *search_term_x(CCL_parser cclp,
         }
         attset = 0;
         if (structure_value == -1 && (
-                auto_group || 
+                auto_group ||
                 qual_val_type(qa, CCL_BIB1_STR, CCL_BIB1_STR_WP, &attset))
             )
         {
@@ -613,7 +613,7 @@ static struct ccl_rpn_node *search_terms2(CCL_parser cclp,
         static int list[] = {
             CCL_TOK_TERM, CCL_TOK_COMMA,CCL_TOK_EQ,
             CCL_TOK_REL, CCL_TOK_SET, -1};
-        
+
         return search_term_x(cclp, qa, list, 1);
     }
 }
@@ -664,7 +664,7 @@ struct ccl_rpn_node *qualifiers_order(CCL_parser cclp,
                 if (cclp->look_token->name[i] == '-')
                     break;
             }
-            
+
             if (cclp->look_token->len > 1 && i == 0)
             {   /*  -xx*/
                 struct ccl_token *ntoken = ccl_token_add(cclp->look_token);
@@ -706,7 +706,7 @@ struct ccl_rpn_node *qualifiers_order(CCL_parser cclp,
                      cclp->look_token->next->kind == CCL_TOK_TERM &&
                      cclp->look_token->next->len > 1 &&
                      cclp->look_token->next->name[0] == '-')
-                     
+
             {   /* xx -yy */
                 /* we _know_ that xx does not have - in it */
                 struct ccl_token *ntoken = ccl_token_add(cclp->look_token);
@@ -716,11 +716,11 @@ struct ccl_rpn_node *qualifiers_order(CCL_parser cclp,
                 ntoken->len = 1;
 
                 (ntoken->next->name)++;        /* adjust yy */
-                (ntoken->next->len)--; 
+                (ntoken->next->len)--;
             }
         }
     }
-        
+
     if (rel == 3 &&
         KIND == CCL_TOK_TERM &&
         cclp->look_token->next && cclp->look_token->next->len == 1 &&
@@ -733,7 +733,7 @@ struct ccl_rpn_node *qualifiers_order(CCL_parser cclp,
         if (KIND == CCL_TOK_TERM)  /* = term - term  ? */
         {
             struct ccl_rpn_node *p2;
-            
+
             if (!(p2 = search_term(cclp, ap)))
             {
                 ccl_rpn_delete(p1);
@@ -777,7 +777,7 @@ static
 struct ccl_rpn_node *qualifier_relation(CCL_parser cclp, ccl_qualifier_t *ap)
 {
     char *attset;
-    
+
     if (qual_val_type(ap, CCL_BIB1_REL, CCL_BIB1_REL_ORDER, &attset)
         || qual_val_type(ap, CCL_BIB1_REL, CCL_BIB1_REL_PORDER, &attset))
         return qualifiers_order(cclp, ap, attset);
@@ -793,13 +793,13 @@ struct ccl_rpn_node *qualifier_relation(CCL_parser cclp, ccl_qualifier_t *ap)
 }
 
 /**
- * qualifier_list: Parse CCL qualifiers and search terms. 
+ * qualifier_list: Parse CCL qualifiers and search terms.
  * cclp:   CCL Parser
  * la:     Token pointer to RELATION token.
  * qa:     Qualifier attributes already applied.
  * return: pointer to node(s); NULL on error.
  */
-static struct ccl_rpn_node *qualifier_list(CCL_parser cclp, 
+static struct ccl_rpn_node *qualifier_list(CCL_parser cclp,
                                            struct ccl_token *la,
                                            ccl_qualifier_t *qa)
 {
@@ -849,7 +849,7 @@ static struct ccl_rpn_node *qualifier_list(CCL_parser cclp,
             {
                 struct ccl_rpn_node *node_sub;
                 cclp->look_token = la;
-                
+
                 node_sub = qualifier_relation(cclp, ap);
                 if (!node_sub)
                 {
@@ -859,7 +859,7 @@ static struct ccl_rpn_node *qualifier_list(CCL_parser cclp,
                 }
                 if (node)
                 {
-                    struct ccl_rpn_node *node_this = 
+                    struct ccl_rpn_node *node_this =
                         ccl_rpn_node_create(CCL_RPN_OR);
                     node_this->u.p[0] = node;
                     node_this->u.p[1] = node_sub;
@@ -912,17 +912,17 @@ static struct ccl_rpn_node *qualifier_list(CCL_parser cclp,
             if (qa)
             {
                 ccl_qualifier_t *qa0 = qa;
-                
+
                 while (*qa0)
                     ap[i++] = *qa0++;
             }
             ap[i] = NULL;
-            
+
             if (!found)
                 break;
-            
+
             cclp->look_token = lookahead;
-            
+
             node_sub = qualifier_relation(cclp, ap);
             if (!node_sub)
             {
@@ -931,7 +931,7 @@ static struct ccl_rpn_node *qualifier_list(CCL_parser cclp,
             }
             if (node)
             {
-                struct ccl_rpn_node *node_this = 
+                struct ccl_rpn_node *node_this =
                     ccl_rpn_node_create(CCL_RPN_OR);
                 node_this->u.p[0] = node;
                 node_this->u.p[1] = node_sub;
@@ -1073,7 +1073,7 @@ static struct ccl_rpn_node *search_elements(CCL_parser cclp,
             }
             if (node)
             {
-                struct ccl_rpn_node *node_this = 
+                struct ccl_rpn_node *node_this =
                     ccl_rpn_node_create(CCL_RPN_OR);
                 node_this->u.p[0] = node;
                 node_this->u.p[1] = node_sub;
@@ -1161,7 +1161,7 @@ struct ccl_rpn_node *ccl_parser_find_str(CCL_parser cclp, const char *str)
     return p;
 }
 
-struct ccl_rpn_node *ccl_parser_find_token(CCL_parser cclp, 
+struct ccl_rpn_node *ccl_parser_find_token(CCL_parser cclp,
                                            struct ccl_token *list)
 {
     struct ccl_rpn_node *p;
index f4c57ad..5bba1a6 100644 (file)
@@ -25,9 +25,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/** 
- * \file cclp.h 
- * \brief CCL header with private definitions 
+/**
+ * \file cclp.h
+ * \brief CCL header with private definitions
  */
 #include <yaz/ccl.h>
 
@@ -61,14 +61,14 @@ struct ccl_token {
 struct ccl_parser {
     /** current lookahead token */
     struct ccl_token *look_token;
-    
+
     /** holds error code if error occur */
     int error_code;
     /** start of CCL string buffer */
     const char *start_pos;
     /** if error occurs, this holds position (starting from 0). */
     const char *error_pos;
-    
+
     /** current bibset */
     CCL_bibset bibset;
 
@@ -91,7 +91,7 @@ struct ccl_parser {
 YAZ_EXPORT
 struct ccl_token *ccl_parser_tokenize (CCL_parser cclp, const char *command);
 
-/** 
+/**
  * Deletes token list
  */
 YAZ_EXPORT
@@ -110,7 +110,7 @@ struct ccl_rpn_node *ccl_parser_find_token(CCL_parser cclp,
 
 
 YAZ_EXPORT
-ccl_qualifier_t ccl_qual_search(CCL_parser cclp, const char *name, 
+ccl_qualifier_t ccl_qual_search(CCL_parser cclp, const char *name,
                                 size_t name_len, int seq);
 
 YAZ_EXPORT
index 41997c4..0803655 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2012 Index Data
  * See the file LICENSE for details.
  */
-/** 
+/**
  * \file cclptree.c
  * \brief Implements CCL parse tree printing
  *
@@ -43,13 +43,13 @@ static void ccl_pquery_complex(WRBUF w, struct ccl_rpn_node *p, int indent)
             const char *cp = p->u.p[2]->u.t.term;
             /* exlusion distance ordered relation which-code unit-code */
             if (*cp == '!')
-            {   
+            {
                 /* word order specified */
                 if (yaz_isdigit(cp[1]))
                     wrbuf_printf(w, "@prox 0 %s 1 2 k 2", cp+1);
                 else
                     wrbuf_printf(w, "@prox 0 1 1 2 k 2");
-            } 
+            }
             else if (*cp == '%')
             {
                 /* word order not specified */
@@ -142,7 +142,7 @@ void ccl_pr_tree(struct ccl_rpn_node *rpn, FILE *fd_out)
     WRBUF w = wrbuf_alloc();
 
     ccl_pquery_indent(w, rpn, 0);
-    
+
     fputs(wrbuf_cstr(w), fd_out);
     wrbuf_destroy(w);
 }
index 024b84d..3d64a72 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2012 Index Data
  * See the file LICENSE for details.
  */
-/** 
+/**
  * \file cclqfile.c
  * \brief Implements parsing of CCL qualifier specs in files
  */
@@ -40,7 +40,7 @@ int ccl_qual_field2(CCL_bibset bibset, const char *cp, const char *qual_name,
 
     yaz_tok_cfg_destroy(yt);
     *addinfo = 0;
-    
+
     t = yaz_tok_move(tp);
     while (t == YAZ_TOK_STRING)
     {
@@ -109,7 +109,7 @@ int ccl_qual_field2(CCL_bibset bibset, const char *cp, const char *qual_name,
                 goto out;
             }
             value_str = yaz_tok_parse_string(tp);
-            
+
             if (sscanf(type_str, "%d", &type) == 1)
                 ;
             else if (strlen(type_str) != 1)
@@ -132,7 +132,7 @@ int ccl_qual_field2(CCL_bibset bibset, const char *cp, const char *qual_name,
                         value = CCL_BIB1_REL_ORDER;
                     else if (!ccl_stricmp (value_str, "r"))
                         value = CCL_BIB1_REL_PORDER;
-                    break;                
+                    break;
                 case 'p':
                 case 'P':
                     type = CCL_BIB1_POS;
@@ -148,7 +148,7 @@ int ccl_qual_field2(CCL_bibset bibset, const char *cp, const char *qual_name,
                         value = CCL_BIB1_STR_OR_LIST;
                     if (!ccl_stricmp (value_str, "ag"))
                         value = CCL_BIB1_STR_AUTO_GROUP;
-                    break;                
+                    break;
                 case 't':
                 case 'T':
                     type = CCL_BIB1_TRU;
@@ -164,7 +164,7 @@ int ccl_qual_field2(CCL_bibset bibset, const char *cp, const char *qual_name,
                         value = CCL_BIB1_TRU_CAN_REGEX;
                     else if (!ccl_stricmp (value_str, "z"))
                         value = CCL_BIB1_TRU_CAN_Z3958;
-                    break;                
+                    break;
                 case 'c':
                 case 'C':
                     type = CCL_BIB1_COM;
@@ -272,7 +272,7 @@ void ccl_qual_line(CCL_bibset bibset, char *line)
     int  no_scan = 0;
     char qual_name[128];
     char *cp1, *cp = line;
-    
+
     if (*cp == '#')
         return;        /* ignore lines starting with # */
     if (sscanf (cp, "%100s%n", qual_name, &no_scan) < 1)
@@ -292,8 +292,8 @@ void ccl_qual_line(CCL_bibset bibset, char *line)
  * Each line format is:
  *  <name> <t>=<v> <t>=<v> ....
  *  Where <name> is name of qualifier;
- *  <t>=<v> is a attribute definition pair where <t> is one of: 
- *     u(use), r(relation), p(position), t(truncation), c(completeness) 
+ *  <t>=<v> is a attribute definition pair where <t> is one of:
+ *     u(use), r(relation), p(position), t(truncation), c(completeness)
  *     or plain integer.
  *  <v> is an integer or special pseudo-value.
  */
index 73b103b..c80438a 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2012 Index Data
  * See the file LICENSE for details.
  */
-/** 
+/**
  * \file cclqual.c
  * \brief Implements CCL qualifier utilities
  */
@@ -85,28 +85,28 @@ void ccl_qual_add_special(CCL_bibset bibset, const char *n, const char *cp)
     yaz_tok_cfg_t yt = yaz_tok_cfg_create();
     int t;
     size_t i = 0;
-    
+
     yaz_tok_parse_t tp = yaz_tok_parse_buf(yt, cp);
-    
+
     yaz_tok_cfg_destroy(yt);
-    
+
     t = yaz_tok_move(tp);
     while (t == YAZ_TOK_STRING)
     {
         if (i >= no-1)
             vlist = (char **) xrealloc(vlist, (no = no * 2) * sizeof(*vlist));
         vlist[i++] = xstrdup(yaz_tok_parse_string(tp));
-        t = yaz_tok_move(tp); 
+        t = yaz_tok_move(tp);
     }
     vlist[i] = 0;
     ccl_qual_add_special_ar(bibset, n, (const char **) vlist);
-    
+
     yaz_tok_parse_destroy(tp);
 }
 
 
 /** \brief adds specifies qualifier aliases
-    
+
     \param b bibset
     \param n qualifier name
     \param names list of qualifier aliases
@@ -124,7 +124,7 @@ void ccl_qual_add_combi(CCL_bibset b, const char *n, const char **names)
     q->attr_list = 0;
     q->next = b->list;
     b->list = q;
-    
+
     for (i = 0; names[i]; i++)
         ;
     q->no_sub = i;
@@ -135,7 +135,7 @@ void ccl_qual_add_combi(CCL_bibset b, const char *n, const char **names)
 }
 
 /** \brief adds specifies attributes for qualifier
-    
+
     \param b bibset
     \param name qualifier name
     \param no number of attribute type+value pairs
@@ -160,10 +160,10 @@ void ccl_qual_add_set(CCL_bibset b, const char *name, int no,
     {
         q = (struct ccl_qualifier *)xmalloc(sizeof(*q));
         ccl_assert(q);
-        
+
         q->next = b->list;
         b->list = q;
-        
+
         q->name = xstrdup(name);
         q->attr_list = 0;
 
@@ -206,14 +206,14 @@ CCL_bibset ccl_qual_mk(void)
 {
     CCL_bibset b = (CCL_bibset)xmalloc(sizeof(*b));
     ccl_assert(b);
-    b->list = NULL;     
+    b->list = NULL;
     b->special = NULL;
     return b;
 }
 
 /** \brief destroys Bibset
     \param b pointer to Bibset
-    
+
     *b will be set to NULL.
  */
 void ccl_qual_rm(CCL_bibset *b)
@@ -273,7 +273,7 @@ CCL_bibset ccl_qual_dup(CCL_bibset b)
         (*qp)->next = 0;
         (*qp)->attr_list = 0;
         (*qp)->name = xstrdup(q->name);
-        
+
         attrp = &(*qp)->attr_list;
         for (attr = q->attr_list; attr; attr = attr->next)
         {
@@ -300,7 +300,7 @@ CCL_bibset ccl_qual_dup(CCL_bibset b)
             for (i = 0; i < q->no_sub; i++)
             {
                 struct ccl_qualifier *q1, *q2;
-                
+
                 /* sweep though original and match up the corresponding ent */
                 q2 = n->list;
                 for (q1 = b->list; q1 && q2; q1 = q1->next, q2 = q2->next)
@@ -330,7 +330,7 @@ CCL_bibset ccl_qual_dup(CCL_bibset b)
     return n;
 }
 
-ccl_qualifier_t ccl_qual_search(CCL_parser cclp, const char *name, 
+ccl_qualifier_t ccl_qual_search(CCL_parser cclp, const char *name,
                                 size_t name_len, int seq)
 {
     struct ccl_qualifier *q = 0;
@@ -413,7 +413,7 @@ int ccl_search_stop(CCL_bibset bibset, const char *qname,
     {
         int i;
         for (i = 0; slist[i]; i++)
-            if (src_len == strlen(slist[i]) 
+            if (src_len == strlen(slist[i])
                 && ccl_memicmp(slist[i], src_str, src_len) == 0)
                 return 1;
     }
index 77a6d74..d3cbc6c 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2012 Index Data
  * See the file LICENSE for details.
  */
-/** 
+/**
  * \file cclstr.c
  * \brief Implements CCL string compare utilities
  */
index a68b8b8..86bf18f 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2012 Index Data
  * See the file LICENSE for details.
  */
-/** 
+/**
  * \file ccltoken.c
  * \brief Implements CCL lexical analyzer (scanner)
  */
@@ -126,7 +126,7 @@ struct ccl_token *ccl_parser_tokenize(CCL_parser cclp, const char *command)
         default:
             --cp;
             --last->len;
-            
+
             last->kind = CCL_TOK_TERM;
             last->name = (const char *) cp;
             while (*cp && !strchr("(),%!><= \t\n\r", *cp))
@@ -150,7 +150,7 @@ struct ccl_token *ccl_parser_tokenize(CCL_parser cclp, const char *command)
                         else if (*cp == '"')
                             break;
                     }
-                } 
+                }
                 if (!*cp)
                     break;
                 cp++;
@@ -161,23 +161,23 @@ struct ccl_token *ccl_parser_tokenize(CCL_parser cclp, const char *command)
                 aliases = cclp->ccl_token_and;
             if (token_cmp(cclp, aliases, last))
                 last->kind = CCL_TOK_AND;
-            
+
             aliases = ccl_qual_search_special(cclp->bibset, "or");
             if (!aliases)
                 aliases = cclp->ccl_token_or;
             if (token_cmp(cclp, aliases, last))
                 last->kind = CCL_TOK_OR;
-            
+
             aliases = ccl_qual_search_special(cclp->bibset, "not");
             if (!aliases)
                 aliases = cclp->ccl_token_not;
             if (token_cmp(cclp, aliases, last))
                 last->kind = CCL_TOK_NOT;
-            
+
             aliases = ccl_qual_search_special(cclp->bibset, "set");
             if (!aliases)
                 aliases = cclp->ccl_token_set;
-            
+
             if (token_cmp(cclp, aliases, last))
                 last->kind = CCL_TOK_SET;
         }
@@ -202,7 +202,7 @@ struct ccl_token *ccl_token_add(struct ccl_token *at)
     n->ws_prefix_len = 0;
     return n;
 }
-    
+
 /*
  * ccl_token_del: delete CCL tokens
  */
@@ -210,7 +210,7 @@ void ccl_token_del(struct ccl_token *list)
 {
     struct ccl_token *list1;
 
-    while (list) 
+    while (list)
     {
         list1 = list->next;
         xfree(list);
index 242953b..7ad2652 100644 (file)
@@ -91,7 +91,7 @@ static int ccl_xml_config_attr(const char *default_set,
 }
 
 static int ccl_xml_config_qual(CCL_bibset bibset, const char *default_set,
-                               WRBUF wrbuf, 
+                               WRBUF wrbuf,
                                const xmlNode *ptr,
                                const char **addinfo)
 {
@@ -181,7 +181,7 @@ int ccl_xml_config_directive(CCL_bibset bibset, const xmlNode *ptr,
 
 int ccl_xml_config(CCL_bibset bibset, const xmlNode *ptr, const char **addinfo)
 {
-    if (ptr && ptr->type == XML_ELEMENT_NODE && 
+    if (ptr && ptr->type == XML_ELEMENT_NODE &&
         !xmlStrcmp(ptr->name, BAD_CAST "cclmap"))
     {
         const xmlNode *c_ptr;
index 37d4157..e40e667 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2012 Index Data
  * See the file LICENSE for details.
  */
-/** 
+/**
  * \file charneg.c
  * \brief Implements Z39.50 Charset negotiation utilities
  *
@@ -23,14 +23,14 @@ static Z_External* z_ext_record2(ODR o, const char *buf)
 {
     Z_External *p;
     int len = strlen(buf);
-    
+
     if (!(p = (Z_External *)odr_malloc(o, sizeof(*p))))
         return 0;
     p->descriptor = 0;
     p->indirect_reference = 0;
-    
+
     p->direct_reference = odr_oiddup(o, yaz_oid_negot_charset_id);
-    
+
     p->which = Z_External_octet;
     if (!(p->u.octet_aligned = (Odr_oct *)odr_malloc(o, sizeof(Odr_oct))))
         return 0;
@@ -38,7 +38,7 @@ static Z_External* z_ext_record2(ODR o, const char *buf)
         return 0;
     p->u.octet_aligned->len = p->u.octet_aligned->size = len;
     memcpy(p->u.octet_aligned->buf, buf, len);
-        
+
     return p;
 }
 
@@ -99,10 +99,10 @@ static Z_OriginProposal_0 *z_get_OriginProposal_0(ODR o, const char *charset)
             (Z_PrivateCharacterSet *)odr_malloc(o, sizeof(*pc));
 
         memset(pc, 0, sizeof(*pc));
-        
+
         p0->which = Z_OriginProposal_0_private;
         p0->u.zprivate = pc;
-        
+
         pc->which = Z_PrivateCharacterSet_externallySpecified;
         pc->u.externallySpecified = z_ext_record2(o, charset);
     }
@@ -112,10 +112,10 @@ static Z_OriginProposal_0 *z_get_OriginProposal_0(ODR o, const char *charset)
 static Z_OriginProposal *z_get_OriginProposal(
     ODR o, const char **charsets, int num_charsets,
     const char **langs, int num_langs, int selected)
-{       
+{
     int i;
     Z_OriginProposal *p = (Z_OriginProposal *) odr_malloc(o, sizeof(*p));
-                
+
     memset(p, 0, sizeof(*p));
 
     p->recordsInSelectedCharSets = (bool_t *)odr_malloc(o, sizeof(bool_t));
@@ -124,7 +124,7 @@ static Z_OriginProposal *z_get_OriginProposal(
     if (charsets && num_charsets)
     {
         p->num_proposedCharSets = num_charsets;
-        p->proposedCharSets = 
+        p->proposedCharSets =
             (Z_OriginProposal_0**)
             odr_malloc(o, num_charsets*sizeof(Z_OriginProposal_0*));
 
@@ -135,7 +135,7 @@ static Z_OriginProposal *z_get_OriginProposal(
     if (langs && num_langs)
     {
         p->num_proposedlanguages = num_langs;
-        p->proposedlanguages = 
+        p->proposedlanguages =
             (char **) odr_malloc(o, num_langs*sizeof(char *));
 
         for (i = 0; i < num_langs; i++)
@@ -149,9 +149,9 @@ static Z_CharSetandLanguageNegotiation *z_get_CharSetandLanguageNegotiation(
 {
     Z_CharSetandLanguageNegotiation *p =
         (Z_CharSetandLanguageNegotiation *) odr_malloc(o, sizeof(*p));
-    
+
     memset(p, 0, sizeof(*p));
-        
+
     return p;
 }
 
@@ -162,9 +162,9 @@ Z_External *yaz_set_proposal_charneg(ODR o,
                                      int selected)
 {
     Z_External *p = (Z_External *)odr_malloc(o, sizeof(*p));
-        
+
     p->descriptor = 0;
-    p->indirect_reference = 0;  
+    p->indirect_reference = 0;
 
     p->direct_reference = odr_oiddup(o, yaz_oid_negot_charset_3);
 
@@ -188,18 +188,18 @@ Z_External *yaz_set_proposal_charneg_list(ODR o,
     char **langs_addresses = 0;
     int charsets_count = 0;
     int langs_count = 0;
-    
+
     if (charset_list)
         nmem_strsplit(odr_getmem(o), delim, charset_list,
                       &charsets_addresses, &charsets_count);
     if (lang_list)
         nmem_strsplit(odr_getmem(o), delim, lang_list,
-                      &langs_addresses, &langs_count);    
+                      &langs_addresses, &langs_count);
     return yaz_set_proposal_charneg(o,
                                     (const char **) charsets_addresses,
                                     charsets_count,
                                     (const char **) langs_addresses,
-                                    langs_count, 
+                                    langs_count,
                                     selected);
 }
 
@@ -207,7 +207,7 @@ Z_External *yaz_set_proposal_charneg_list(ODR o,
 /* used by yaz_set_response_charneg */
 static Z_TargetResponse *z_get_TargetResponse(ODR o, const char *charset,
                                               const char *lang, int selected)
-{       
+{
     Z_TargetResponse *p = (Z_TargetResponse *) odr_malloc(o, sizeof(*p));
     int form = get_form(charset);
 
@@ -227,19 +227,19 @@ static Z_TargetResponse *z_get_TargetResponse(ODR o, const char *charset,
     {
         Z_PrivateCharacterSet *pc =
             (Z_PrivateCharacterSet *)odr_malloc(o, sizeof(*pc));
-        
+
         memset(pc, 0, sizeof(*pc));
-        
+
         p->which = Z_TargetResponse_private;
         p->u.zprivate = pc;
-        
+
         pc->which = Z_PrivateCharacterSet_externallySpecified;
         pc->u.externallySpecified =
             z_ext_record2(o, charset);
     }
     p->recordsInSelectedCharSets = (bool_t *)odr_malloc(o, sizeof(bool_t));
     *p->recordsInSelectedCharSets = (selected) ? 1 : 0;
-    
+
     p->selectedLanguage = lang ? (char *) odr_strdup(o, lang) : 0;
     return p;
 }
@@ -249,9 +249,9 @@ Z_External *yaz_set_response_charneg(ODR o, const char *charset,
                                      const char *lang, int selected)
 {
     Z_External *p = (Z_External *)odr_malloc(o, sizeof(*p));
-        
+
     p->descriptor = 0;
-    p->indirect_reference = 0;  
+    p->indirect_reference = 0;
 
     p->direct_reference = odr_oiddup(o, yaz_oid_negot_charset_3);
 
@@ -267,10 +267,10 @@ Z_External *yaz_set_response_charneg(ODR o, const char *charset,
 Z_CharSetandLanguageNegotiation *yaz_get_charneg_record(Z_OtherInformation *p)
 {
     int i;
-        
+
     if (!p)
         return 0;
-        
+
     for (i = 0; i < p->num_elements; i++)
     {
         Z_External *pext;
@@ -291,10 +291,10 @@ Z_CharSetandLanguageNegotiation *yaz_get_charneg_record(Z_OtherInformation *p)
 int yaz_del_charneg_record(Z_OtherInformation **p)
 {
     int i;
-        
+
     if (!*p)
         return 0;
-        
+
     for (i = 0; i < (*p)->num_elements; i++)
     {
         Z_External *pext;
@@ -327,20 +327,20 @@ void yaz_get_proposal_charneg(NMEM mem, Z_CharSetandLanguageNegotiation *p,
 {
     int i;
     Z_OriginProposal *pro = p->u.proposal;
-    
+
     if (num_charsets && charsets)
     {
         if (pro->num_proposedCharSets)
         {
             *num_charsets = pro->num_proposedCharSets;
-            
+
             (*charsets) = (char **)
                 nmem_malloc(mem, pro->num_proposedCharSets * sizeof(char *));
-            
-            for (i = 0; i < pro->num_proposedCharSets; i++) 
+
+            for (i = 0; i < pro->num_proposedCharSets; i++)
             {
                 (*charsets)[i] = 0;
-                
+
                 if (pro->proposedCharSets[i]->which ==
                     Z_OriginProposal_0_private &&
                     pro->proposedCharSets[i]->u.zprivate->which ==
@@ -348,13 +348,13 @@ void yaz_get_proposal_charneg(NMEM mem, Z_CharSetandLanguageNegotiation *p,
                 {
                     Z_External *pext =
                         pro->proposedCharSets[i]->u.zprivate->u.externallySpecified;
-                    
+
                     if (pext->which == Z_External_octet)
                     {
                         (*charsets)[i] = (char *)
                             nmem_malloc(mem, (1+pext->u.octet_aligned->len) *
                                         sizeof(char));
-                        
+
                         memcpy((*charsets)[i], pext->u.octet_aligned->buf,
                                pext->u.octet_aligned->len);
                         (*charsets)[i][pext->u.octet_aligned->len] = 0;
@@ -369,23 +369,23 @@ void yaz_get_proposal_charneg(NMEM mem, Z_CharSetandLanguageNegotiation *p,
         else
             *num_charsets = 0;
     }
-    
+
     if (langs && num_langs)
     {
         if (pro->num_proposedlanguages)
         {
             *num_langs = pro->num_proposedlanguages;
-            
+
             (*langs) = (char **)
                 nmem_malloc(mem, pro->num_proposedlanguages * sizeof(char *));
-            
+
             for (i = 0; i < pro->num_proposedlanguages; i++)
                 (*langs)[i] = nmem_strdup(mem, pro->proposedlanguages[i]);
         }
         else
             *num_langs = 0;
     }
-    
+
     if (pro->recordsInSelectedCharSets && selected)
         *selected = *pro->recordsInSelectedCharSets;
 }
@@ -395,12 +395,12 @@ void yaz_get_response_charneg(NMEM mem, Z_CharSetandLanguageNegotiation *p,
                               char **charset, char **lang, int *selected)
 {
     Z_TargetResponse *res = p->u.response;
-        
+
     if (charset && res->which == Z_TargetResponse_private &&
         res->u.zprivate->which == Z_PrivateCharacterSet_externallySpecified)
     {
         Z_External *pext = res->u.zprivate->u.externallySpecified;
-        
+
         if (pext->which == Z_External_octet)
         {
             *charset = (char *)
@@ -408,7 +408,7 @@ void yaz_get_response_charneg(NMEM mem, Z_CharSetandLanguageNegotiation *p,
             memcpy(*charset, pext->u.octet_aligned->buf,
                    pext->u.octet_aligned->len);
             (*charset)[pext->u.octet_aligned->len] = 0;
-        }       
+        }
     }
     if (charset && res->which == Z_TargetResponse_iso10646)
         *charset = set_form(res->u.iso10646->encodingLevel);
index 17c6a41..cf1d4b6 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2012 Index Data
  * See the file LICENSE for details.
  */
-/** 
+/**
  * \file comstack.c
  * \brief Implements Generic COMSTACK functions
  */
@@ -66,7 +66,7 @@ const char *cs_strerror(COMSTACK h)
 
 void cs_get_host_args(const char *type_and_host, const char **args)
 {
-    
+
     *args = "";
     if (*type_and_host && strncmp(type_and_host, "unix:", 5))
     {
@@ -188,7 +188,7 @@ COMSTACK cs_create_host_proxy(const char *vhost, int blocking, void **vp,
         {
             cs_close (cs);
             cs = 0;
-        }    
+        }
     }
     xfree(connect_host);
     return cs;
@@ -244,13 +244,13 @@ static int cs_read_chunk(const char *buf, int i, int len)
 #endif
                 return 0;
             } else if (yaz_isdigit(buf[i]))
-                chunk_len = chunk_len * 16 + 
+                chunk_len = chunk_len * 16 +
                     (buf[i++] - '0');
             else if (yaz_isupper(buf[i]))
-                chunk_len = chunk_len * 16 + 
+                chunk_len = chunk_len * 16 +
                     (buf[i++] - ('A'-10));
             else if (yaz_islower(buf[i]))
-                chunk_len = chunk_len * 16 + 
+                chunk_len = chunk_len * 16 +
                     (buf[i++] - ('a'-10));
             else
                 break;
@@ -258,7 +258,7 @@ static int cs_read_chunk(const char *buf, int i, int len)
             break;
         if (chunk_len < 0)
             return i;
-        
+
         while (1)
         {
             if (i >= len -1)
@@ -270,7 +270,7 @@ static int cs_read_chunk(const char *buf, int i, int len)
         /* got CRLF */
 #if CHUNK_DEBUG
         printf ("chunk_len=%d\n", chunk_len);
-#endif                      
+#endif
         i += chunk_len;
         if (i >= len-2)
             return 0;
@@ -306,7 +306,7 @@ static int cs_complete_http(const char *buf, int len, int head_only)
     /* if dealing with HTTP responses - then default
        content length is unlimited (socket close) */
     if (!head_only && !memcmp(buf, "HTTP/", 5))
-        content_len = -1; 
+        content_len = -1;
 
 #if 0
     printf("len = %d\n", len);
@@ -337,7 +337,7 @@ static int cs_complete_http(const char *buf, int len, int head_only)
                 }
                 break;
             }
-            else if (i < len - 20 && 
+            else if (i < len - 20 &&
                      !strncasecmp((const char *) buf+i, "Transfer-Encoding:", 18))
             {
                 i+=18;
index 43672e6..6a69c8e 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <yaz/cql.h>
 
-static int cql_to_ccl_r(struct cql_node *cn, 
+static int cql_to_ccl_r(struct cql_node *cn,
                         void (*pr)(const char *buf, void *client_data),
                         void *client_data);
 
@@ -29,7 +29,7 @@ static void pr_term(const char **cpp, int stop_at_space,
     for (cp = *cpp; *cp; cp++)
     {
         char x[4];
-        
+
         if (*cp == '\\' && cp[1])
         {
             if (!quote_mode)
@@ -83,7 +83,7 @@ static void pr_term(const char **cpp, int stop_at_space,
     *cpp = cp;
 }
 
-static int node(struct cql_node *cn, 
+static int node(struct cql_node *cn,
                 void (*pr)(const char *buf, void *client_data),
                 void *client_data)
 {
@@ -159,7 +159,7 @@ static int node(struct cql_node *cn,
 }
 
 
-static int bool(struct cql_node *cn, 
+static int bool(struct cql_node *cn,
                 void (*pr)(const char *buf, void *client_data),
                 void *client_data)
 {
@@ -170,7 +170,7 @@ static int bool(struct cql_node *cn,
     r = cql_to_ccl_r(cn->u.boolean.left, pr, client_data);
     if (r)
         return r;
-    
+
     pr(") ", client_data);
 
     if (strcmp(value, "prox"))
@@ -227,7 +227,7 @@ static int bool(struct cql_node *cn,
     return r;
 }
 
-static int cql_to_ccl_r(struct cql_node *cn, 
+static int cql_to_ccl_r(struct cql_node *cn,
                         void (*pr)(const char *buf, void *client_data),
                         void *client_data)
 {
@@ -246,7 +246,7 @@ static int cql_to_ccl_r(struct cql_node *cn,
     return -1;
 }
 
-int cql_to_ccl(struct cql_node *cn, 
+int cql_to_ccl(struct cql_node *cn,
                void (*pr)(const char *buf, void *client_data),
                void *client_data)
 {
index 545e8d6..9d4c9b5 100644 (file)
@@ -38,7 +38,7 @@ int cql_parser_string(CQL_parser cp, const char *str)
 
     b.str = str;
     b.off = 0;
-    
+
     return cql_parser_stream(cp, getbuf, ungetbuf, &b);
 }
 
index aea8bdc..ef93ca8 100644 (file)
@@ -71,7 +71,7 @@ static int cql_transform_parse_tok_line(cql_transform_t ct,
     int ret = 0; /* 0=OK, != 0 FAIL */
     int t;
     t = yaz_tok_move(tp);
-    
+
     while (t == YAZ_TOK_STRING && ae_num < 20)
     {
         WRBUF type_str = wrbuf_alloc();
@@ -79,7 +79,7 @@ static int cql_transform_parse_tok_line(cql_transform_t ct,
         Z_AttributeElement *elem = 0;
         const char *value_str = 0;
         /* attset type=value  OR  type=value */
-        
+
         elem = (Z_AttributeElement *) nmem_malloc(ct->nmem, sizeof(*elem));
         elem->attributeSet = 0;
         ae[ae_num] = elem;
@@ -90,19 +90,19 @@ static int cql_transform_parse_tok_line(cql_transform_t ct,
         {
             wrbuf_destroy(type_str);
             if (set_str)
-                wrbuf_destroy(set_str);                
+                wrbuf_destroy(set_str);
             break;
         }
-        if (t == YAZ_TOK_STRING)  
-        {  
+        if (t == YAZ_TOK_STRING)
+        {
             wrbuf_puts(ct->w, " ");
             wrbuf_puts(ct->w, yaz_tok_parse_string(tp));
             set_str = type_str;
-            
+
             elem->attributeSet =
                 yaz_string_to_oid_nmem(yaz_oid_std(), CLASS_ATTSET,
                                        wrbuf_cstr(set_str), ct->nmem);
-            
+
             type_str = wrbuf_alloc();
             wrbuf_puts(type_str, yaz_tok_parse_string(tp));
             t = yaz_tok_move(tp);
@@ -113,7 +113,7 @@ static int cql_transform_parse_tok_line(cql_transform_t ct,
         {
             wrbuf_destroy(type_str);
             if (set_str)
-                wrbuf_destroy(set_str);                
+                wrbuf_destroy(set_str);
             yaz_log(YLOG_WARN, "Expected numeric attribute type");
             ret = -1;
             break;
@@ -121,8 +121,8 @@ static int cql_transform_parse_tok_line(cql_transform_t ct,
 
         wrbuf_destroy(type_str);
         if (set_str)
-            wrbuf_destroy(set_str);                
-        
+            wrbuf_destroy(set_str);
+
         if (t != '=')
         {
             yaz_log(YLOG_WARN, "Expected = after after attribute type");
@@ -182,7 +182,7 @@ static int cql_transform_parse_tok_line(cql_transform_t ct,
             (*pp)->attr_list.attributes = (Z_AttributeElement **)
                 nmem_malloc(ct->nmem,
                             ae_num * sizeof(Z_AttributeElement *));
-            memcpy((*pp)->attr_list.attributes, ae, 
+            memcpy((*pp)->attr_list.attributes, ae,
                    ae_num * sizeof(Z_AttributeElement *));
         }
         (*pp)->next = 0;
@@ -210,7 +210,7 @@ int cql_transform_define_pattern(cql_transform_t ct, const char *pattern,
     yaz_tok_parse_destroy(tp);
     return r;
 }
-    
+
 cql_transform_t cql_transform_open_FILE(FILE *f)
 {
     cql_transform_t ct = cql_transform_create();
@@ -309,7 +309,7 @@ static int compare_attr(Z_AttributeElement *a, Z_AttributeElement *b)
 
     z_AttributeElement(odr_a, &a, 0, 0);
     z_AttributeElement(odr_b, &b, 0, 0);
-    
+
     buf_a = odr_getbuf(odr_a, &len_a, 0);
     buf_b = odr_getbuf(odr_b, &len_b, 0);
 
@@ -320,7 +320,7 @@ static int compare_attr(Z_AttributeElement *a, Z_AttributeElement *b)
     return ret;
 }
 
-const char *cql_lookup_reverse(cql_transform_t ct, 
+const char *cql_lookup_reverse(cql_transform_t ct,
                                const char *category,
                                Z_AttributeList *attributes)
 {
@@ -348,7 +348,7 @@ const char *cql_lookup_reverse(cql_transform_t ct,
                 }
                 if (j == attributes->num_attributes)
                     break; /* i was not found at all.. try next pattern */
-                    
+
             }
             if (i == e->attr_list.num_attributes)
                 return e->pattern + clen;
@@ -356,7 +356,7 @@ const char *cql_lookup_reverse(cql_transform_t ct,
     }
     return 0;
 }
-                                      
+
 static const char *cql_lookup_property(cql_transform_t ct,
                                        const char *pat1, const char *pat2,
                                        const char *pat3)
@@ -374,7 +374,7 @@ static const char *cql_lookup_property(cql_transform_t ct,
         sprintf(pattern, "%.39s", pat1);
     else
         return 0;
-    
+
     for (e = ct->entry; e; e = e->next)
     {
         if (!cql_strcmp(e->pattern, pattern))
@@ -392,11 +392,11 @@ int cql_pr_attr_uri(cql_transform_t ct, const char *category,
     const char *res = 0;
     const char *eval = val ? val : default_val;
     const char *prefix = 0;
-    
+
     if (uri)
     {
         struct cql_prop_entry *e;
-        
+
         for (e = ct->entry; e; e = e->next)
             if (!memcmp(e->pattern, "set.", 4) && e->value &&
                 !strcmp(e->value, uri))
@@ -519,19 +519,19 @@ static int cql_pr_prox(cql_transform_t ct, struct cql_node *mods,
                 proxrel = 5;
             else if (!strcmp(relation, "<"))
                 proxrel = 1;
-            else if (!strcmp(relation, ">=")) 
+            else if (!strcmp(relation, ">="))
                 proxrel = 4;
             else if (!strcmp(relation, "<="))
                 proxrel = 2;
             else if (!strcmp(relation, "<>"))
                 proxrel = 6;
-            else 
+            else
             {
                 ct->error = YAZ_SRW_UNSUPP_PROX_RELATION;
                 ct->addinfo = xstrdup(relation);
                 return 0;
             }
-        } 
+        }
         else if (!strcmp(name, "ordered"))
             ordered = 1;
         else if (!strcmp(name, "unordered"))
@@ -546,14 +546,14 @@ static int cql_pr_prox(cql_transform_t ct, struct cql_node *mods,
                 unit = 4;
             else if (!strcmp(term, "element"))
                 unit = 8;
-            else 
+            else
             {
                 ct->error = YAZ_SRW_UNSUPP_PROX_UNIT;
                 ct->addinfo = xstrdup(term);
                 return 0;
             }
-        } 
-        else 
+        }
+        else
         {
             ct->error = YAZ_SRW_UNSUPP_BOOLEAN_MODIFIER;
             ct->addinfo = xstrdup(name);
@@ -668,9 +668,9 @@ static void emit_term(cql_transform_t ct,
          * there's no mapping for it, that's fine: we just use a
          * general pattern-matching attribute.
          */
-        if (first_wc == term && second_wc == term + length-1 
-            && *first_wc == '*' && *second_wc == '*' 
-            && cql_pr_attr(ct, "truncation", "both", 0, pr, client_data, 0)) 
+        if (first_wc == term && second_wc == term + length-1
+            && *first_wc == '*' && *second_wc == '*'
+            && cql_pr_attr(ct, "truncation", "both", 0, pr, client_data, 0))
         {
             term++;
             length -= 2;
@@ -684,7 +684,7 @@ static void emit_term(cql_transform_t ct,
         }
         else if (first_wc == term + length-1 && second_wc == 0
                  && *first_wc == '*'
-                 && cql_pr_attr(ct, "truncation", "right", 0, 
+                 && cql_pr_attr(ct, "truncation", "right", 0,
                                 pr, client_data, 0))
         {
             length--;
@@ -782,7 +782,7 @@ static void emit_terms(cql_transform_t ct,
             (*pr)("@", client_data);
             (*pr)(op, client_data);
             (*pr)(" ", client_data);
-        }            
+        }
         emit_term(ct, cn, ne->u.st.term, strlen(ne->u.st.term),
                   pr, client_data);
     }
@@ -871,11 +871,11 @@ void cql_transform_r(cql_transform_t ct,
         (*pr)(cn->u.boolean.value, client_data);
         (*pr)(" ", client_data);
         mods = cn->u.boolean.modifiers;
-        if (!strcmp(cn->u.boolean.value, "prox")) 
+        if (!strcmp(cn->u.boolean.value, "prox"))
         {
             if (!cql_pr_prox(ct, mods, pr, client_data))
                 return;
-        } 
+        }
         else if (mods)
         {
             /* Boolean modifiers other than on proximity not supported */
index f3de006..5285a0f 100644 (file)
@@ -34,7 +34,7 @@ struct cql_node *cql_node_dup(NMEM nmem, struct cql_node *cp)
                             cp->u.st.relation,
                             cp->u.st.term);
         cn->u.st.modifiers = cql_node_dup(nmem, cp->u.st.modifiers);
-        cn->u.st.index_uri = cp->u.st.index_uri ? 
+        cn->u.st.index_uri = cp->u.st.index_uri ?
             nmem_strdup(nmem, cp->u.st.index_uri) : 0;
         cn->u.st.relation_uri = cp->u.st.relation_uri ?
             nmem_strdup(nmem, cp->u.st.relation_uri) : 0;
@@ -116,7 +116,7 @@ struct cql_node *cql_apply_prefix(NMEM nmem,
         if (!n->u.st.index_uri && n->u.st.index)
         {   /* not yet resolved.. */
             const char *cp = strchr(n->u.st.index, '.');
-            if (prefix && cp && 
+            if (prefix && cp &&
                 strlen(prefix) == (size_t) (cp - n->u.st.index) &&
                 !cql_strncmp(n->u.st.index, prefix, strlen(prefix)))
             {
index 16f5357..1bfc6e0 100644 (file)
@@ -89,7 +89,7 @@ static void keepalive(void (*work)(void *data), void *data)
     void (*old_sigterm)(int);
     void (*old_sigusr1)(int);
     void (*old_sigusr2)(int);
-    
+
     keepalive_pid = getpid();
 
     /* keep signals in their original state and make sure that some signals
@@ -115,25 +115,25 @@ static void keepalive(void (*work)(void *data), void *data)
             signal(SIGTERM, old_sigterm);/* restore */
             signal(SIGUSR1, old_sigusr1);/* restore */
             signal(SIGUSR2, old_sigusr2);/* restore */
-            
+
             work(data);
             exit(0);
         }
-        
+
         /* enable signalling in kill_child_handler */
         child_pid = p;
-        
+
         p1 = wait(&status);
-        
+
         /* disable signalling in kill_child_handler */
         child_pid = 0;
-        
+
         if (p1 != p)
         {
             yaz_log(YLOG_FATAL, "p1=%d != p=%d", p1, p);
             exit(1);
         }
-        
+
         if (WIFSIGNALED(status))
         {
             /*  keep the child alive in case of errors, but _log_ */
@@ -151,7 +151,7 @@ static void keepalive(void (*work)(void *data), void *data)
                 yaz_log(YLOG_WARN, "Received SIGSEGV from child %ld", (long) p);
                 cont = 1;
                 break;
-            case SIGBUS:        
+            case SIGBUS:
                 yaz_log(YLOG_WARN, "Received SIGBUS from child %ld", (long) p);
                 cont = 1;
                 break;
@@ -254,7 +254,7 @@ int yaz_daemon(const char *progname,
         }
         switch (fork())
         {
-        case 0: 
+        case 0:
             break;
         case -1:
             return 1;
@@ -279,7 +279,7 @@ int yaz_daemon(const char *progname,
         close(hand[0]);
         if (setsid() < 0)
             return 1;
-        
+
         close(0);
         close(1);
         close(2);
index 89b0c74..8922885 100644 (file)
@@ -40,7 +40,7 @@ static int bib1_srw_map[] = {
     17, 70,
     18, 50,
     19, 55,
-    20, 56, 
+    20, 56,
     21, 52,
     22, 50,
     23, 3,
@@ -59,7 +59,7 @@ static int bib1_srw_map[] = {
     102, 3,
     103, 3,
     104, 3,
-    105, 3, 
+    105, 3,
     106, 66,
     107, 11,
     108, 10,
@@ -69,7 +69,7 @@ static int bib1_srw_map[] = {
     108, 26,
     108, 27,
     108, 45,
-        
+
     109, 235,
     110, 37,
     111, 1,
@@ -91,7 +91,7 @@ static int bib1_srw_map[] = {
     123, 18,
     124, 24,
     125, 36,
-    126, 36, 
+    126, 36,
     127, 36,
     128, 51,
     129, 39,
@@ -135,7 +135,7 @@ static int bib1_srw_map[] = {
     233, 1, /* bad map */
     234, 1, /* bad map */
     235, 235,
-    236, 236, 
+    236, 236,
     237, 82,
     238, 67,
     239, 66,
@@ -154,7 +154,7 @@ static int bib1_srw_map[] = {
     1005, 1, /* bad map */
     1006, 1, /* bad map */
     1007, 100,
-    1008, 1, 
+    1008, 1,
     1009, 1,
     1010, 3,
     1011, 3,
index 3b69285..67397cf 100644 (file)
@@ -3,7 +3,7 @@
  * See the file LICENSE for details.
  */
 
-/** \file 
+/** \file
     \brief Implement opendir/readdir/closedir on Windows
 */
 
@@ -40,7 +40,7 @@ DIR *opendir(const char *name)
     dd->handle = FindFirstFile(fullName, &dd->find_data);
     return dd;
 }
-                                                          
+
 struct dirent *readdir(DIR *dd)
 {
     if (dd->handle == INVALID_HANDLE_VALUE)
index c50cb5e..901f276 100644 (file)
@@ -33,7 +33,7 @@ void yaz_set_esn(Z_RecordComposition **comp_p, const char *esn, NMEM nmem)
 {
     Z_RecordComposition *comp = (Z_RecordComposition *)
         nmem_malloc(nmem, sizeof(*comp));
-    
+
     comp->which = Z_RecordComp_simple;
     comp->u.simple = (Z_ElementSetNames *)
         nmem_malloc(nmem, sizeof(*comp->u.simple));
index 01278b1..5a5740f 100644 (file)
@@ -56,7 +56,7 @@ int force_event;
     int destroyed;
     time_t last_event;
     time_t max_idle;
-    
+
     struct iochan *next;
     int chan_id; /* listening port (0 if none ) */
 } *IOCHAN;
index d0f17f6..223be7e 100644 (file)
@@ -3,7 +3,7 @@
  * See the file LICENSE for details.
  */
 
-/** 
+/**
  * \file facet.c
  * \brief Facet utilities
  */
index b087cf0..8560504 100644 (file)
@@ -3,7 +3,7 @@
  * See the file LICENSE for details.
  */
 
-/** \file 
+/** \file
     \brief File globbing (ala POSIX glob, but simpler)
 */
 #if HAVE_CONFIG_H
@@ -48,7 +48,7 @@ static void glob_r(yaz_glob_res_t res, const char *pattern, size_t off,
             is_pattern = 1;
         i++;
     }
-    
+
     if (!is_pattern && pattern[i]) /* no pattern and directory part */
     {
         i++; /* skip dir sep */
index c53bcc1..f3965c3 100644 (file)
@@ -84,9 +84,9 @@ static void display_grs1(WRBUF w, Z_GenericRecord *r, int level)
             {
                 char oid_name_str[OID_STR_MAX];
                 oid_class oclass;
-                const char *oid_name 
+                const char *oid_name
                     = yaz_oid_to_string_buf(ip, &oclass, oid_name_str);
-            
+
                 if (oid_name)
                     wrbuf_printf(w, "OID: %s\n", oid_name);
             }
@@ -103,7 +103,7 @@ static void display_grs1(WRBUF w, Z_GenericRecord *r, int level)
         {
             printf ("External\n");
             /* we cannot print externals here. Srry */
-        } 
+        }
         else
             wrbuf_printf(w, "? type = %d\n",t->content->which);
         if (t->appliedVariant)
index 6539f7a..375f122 100644 (file)
@@ -21,7 +21,7 @@
 #define strncasecmp _strnicmp
 #define strcasecmp _stricmp
 #endif
+
 static int decode_headers_content(ODR o, int off, Z_HTTP_Header **headers,
                                   char **content_buf, int *content_len)
 {
@@ -59,11 +59,11 @@ static int decode_headers_content(ODR o, int off, Z_HTTP_Header **headers,
             i++;
         for (po = i; i < o->size-1 && !strchr("\r\n", o->buf[i]); i++)
             ;
-        
+
         (*headers)->value = (char*) odr_malloc(o, i - po + 1);
         memcpy ((*headers)->value, o->buf + po, i - po);
         (*headers)->value[i - po] = '\0';
-        
+
         if (!strcasecmp((*headers)->name, "Transfer-Encoding")
             &&
             !strcasecmp((*headers)->value, "chunked"))
@@ -83,23 +83,23 @@ static int decode_headers_content(ODR o, int off, Z_HTTP_Header **headers,
     if (chunked)
     {
         int off = 0;
-        
+
         /* we know buffer will be smaller than o->size - i*/
-        *content_buf = (char*) odr_malloc(o, o->size - i);  
-        
+        *content_buf = (char*) odr_malloc(o, o->size - i);
+
         while (1)
         {
             /* chunk length .. */
             int chunk_len = 0;
             for (; i  < o->size-2; i++)
                 if (yaz_isdigit(o->buf[i]))
-                    chunk_len = chunk_len * 16 + 
+                    chunk_len = chunk_len * 16 +
                         (o->buf[i] - '0');
                 else if (yaz_isupper(o->buf[i]))
-                    chunk_len = chunk_len * 16 + 
+                    chunk_len = chunk_len * 16 +
                         (o->buf[i] - ('A'-10));
                 else if (yaz_islower(o->buf[i]))
-                    chunk_len = chunk_len * 16 + 
+                    chunk_len = chunk_len * 16 +
                         (o->buf[i] - ('a'-10));
                 else
                     break;
@@ -142,7 +142,7 @@ static int decode_headers_content(ODR o, int off, Z_HTTP_Header **headers,
             *content_buf = 0;
             *content_len = 0;
         }
-        else 
+        else
         {
             *content_len = o->size - i;
             *content_buf = (char*) odr_malloc(o, *content_len + 1);
@@ -277,11 +277,11 @@ Z_GDU *z_get_HTTP_Request_uri(ODR odr, const char *uri, const char *args,
         cp0 = cp0+3;
     else
         cp0 = uri;
-    
+
     cp1 = strchr(cp0, '/');
     if (!cp1)
         cp1 = cp0+strlen(cp0);
-    
+
     if (cp0 && cp1)
     {
         char *h = (char*) odr_malloc(odr, cp1 - cp0 + 1);
@@ -328,7 +328,7 @@ Z_GDU *z_get_HTTP_Response(ODR o, int code)
     if (code != 200)
     {
         hres->content_buf = (char*) odr_malloc(o, 400);
-        sprintf(hres->content_buf, 
+        sprintf(hres->content_buf,
                 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\""
                 " \"http://www.w3.org/TR/html4/strict.dtd\">\n"
                 "<HTML>\n"
@@ -336,7 +336,7 @@ Z_GDU *z_get_HTTP_Response(ODR o, int code)
                 "  <TITLE>YAZ " YAZ_VERSION "</TITLE>\n"
                 " </HEAD>\n"
                 " <BODY>\n"
-                "  <P><A HREF=\"http://www.indexdata.com/yaz/\">YAZ</A> " 
+                "  <P><A HREF=\"http://www.indexdata.com/yaz/\">YAZ</A> "
                 YAZ_VERSION "</P>\n"
                 "  <P>Error: %d</P>\n"
                 "  <P>Description: %.50s</P>\n"
@@ -369,11 +369,11 @@ int yaz_decode_http_response(ODR o, Z_HTTP_Response **hr_p)
 {
     int i, po;
     Z_HTTP_Response *hr = (Z_HTTP_Response *) odr_malloc(o, sizeof(*hr));
-    
+
     *hr_p = hr;
     hr->content_buf = 0;
     hr->content_len = 0;
-    
+
     po = i = 5;
     while (i < o->size-2 && !strchr(" \r\n", o->buf[i]))
         i++;
@@ -396,16 +396,16 @@ int yaz_decode_http_response(ODR o, Z_HTTP_Response **hr_p)
     while (i < o->size-1 && o->buf[i] != '\n')
         i++;
     return decode_headers_content(o, i, &hr->headers,
-                                  &hr->content_buf, &hr->content_len);            
+                                  &hr->content_buf, &hr->content_len);
 }
 
 int yaz_decode_http_request(ODR o, Z_HTTP_Request **hr_p)
 {
     int i, po;
     Z_HTTP_Request *hr = (Z_HTTP_Request *) odr_malloc(o, sizeof(*hr));
-    
+
     *hr_p = hr;
-    
+
     /* method .. */
     for (i = 0; o->buf[i] != ' '; i++)
         if (i >= o->size-5 || i > 30)
@@ -481,7 +481,7 @@ int yaz_encode_http_response(ODR o, Z_HTTP_Response *hr)
     }
     odr_write(o, (unsigned char *) "\r\n", 2);
     if (hr->content_buf)
-        odr_write(o, (unsigned char *) 
+        odr_write(o, (unsigned char *)
                   hr->content_buf,
                   hr->content_len);
     if (o->direction == ODR_PRINT)
index 0926dae..e53075b 100644 (file)
@@ -24,7 +24,7 @@ struct decoder_data {
     unsigned long x_back;
 };
 
-static unsigned long read_danmarc(yaz_iconv_t cd, 
+static unsigned long read_danmarc(yaz_iconv_t cd,
                                   yaz_iconv_decoder_t d,
                                   unsigned char *inp,
                                   size_t inbytesleft, size_t *no_read)
@@ -105,7 +105,7 @@ void destroy_danmarc(yaz_iconv_decoder_t d)
 
 yaz_iconv_decoder_t yaz_danmarc_decoder(const char *fromcode,
                                         yaz_iconv_decoder_t d)
-    
+
 {
     if (!yaz_matchstr(fromcode, "danmarc"))
     {
index 97f1bb1..b61d274 100644 (file)
@@ -66,7 +66,7 @@ static unsigned long read_iso5426(yaz_iconv_t cd, yaz_iconv_decoder_t d,
         *no_read = data->comb_no_read[data->comb_offset];
         x = data->comb_x[data->comb_offset];
 
-        /* special case for double-diacritic combining characters, 
+        /* special case for double-diacritic combining characters,
            INVERTED BREVE and DOUBLE TILDE.
            We'll increment the no_read counter by 1, since we want to skip over
            the processing of the closing ligature character
index 8d47760..c20c3e9 100644 (file)
@@ -62,7 +62,7 @@ static unsigned long read_marc8(yaz_iconv_t cd, yaz_iconv_decoder_t d,
         *no_read = data->comb_no_read[data->comb_offset];
         x = data->comb_x[data->comb_offset];
 
-        /* special case for double-diacritic combining characters, 
+        /* special case for double-diacritic combining characters,
            INVERTED BREVE and DOUBLE TILDE.
            We'll increment the no_read counter by 1, since we want to skip over
            the processing of the closing ligature character
index 04ba331..82cb9f4 100644 (file)
@@ -93,7 +93,7 @@ static struct {
     { 'y', 0x0301, 0xfd}, /* LATIN SMALL LETTER Y WITH ACUTE */
     /* omitted:    0xfe      LATIN SMALL LETTER THORN */
     { 'y', 0x0308, 0xff}, /* LATIN SMALL LETTER Y WITH DIAERESIS */
-    
+
     { 0, 0, 0}
 };
 
@@ -158,7 +158,7 @@ static size_t write_iso_8859_1(yaz_iconv_t cd, yaz_iconv_encoder_t e,
             yaz_iconv_set_errno(cd, YAZ_ICONV_E2BIG);
             return (size_t)(-1);
         }
-        if (!latin1_comb[i].x1) 
+        if (!latin1_comb[i].x1)
         {   /* not found. Just write compose_char */
             *outp++ = (unsigned char) w->compose_char;
             (*outbytesleft)--;
@@ -223,7 +223,7 @@ void destroy_iso_8859_1(yaz_iconv_encoder_t e)
 
 yaz_iconv_encoder_t yaz_iso_8859_1_encoder(const char *tocode,
                                            yaz_iconv_encoder_t e)
-    
+
 {
     if (!yaz_matchstr(tocode, "iso88591"))
     {
@@ -239,7 +239,7 @@ yaz_iconv_encoder_t yaz_iso_8859_1_encoder(const char *tocode,
     return 0;
 }
 
-static unsigned long read_ISO8859_1(yaz_iconv_t cd, 
+static unsigned long read_ISO8859_1(yaz_iconv_t cd,
                                     yaz_iconv_decoder_t d,
                                     unsigned char *inp,
                                     size_t inbytesleft, size_t *no_read)
@@ -251,7 +251,7 @@ static unsigned long read_ISO8859_1(yaz_iconv_t cd,
 
 yaz_iconv_decoder_t yaz_iso_8859_1_decoder(const char *fromcode,
                                            yaz_iconv_decoder_t d)
-    
+
 {
     if (!yaz_matchstr(fromcode, "iso88591"))
     {
index 7db2348..f29ccbf 100644 (file)
@@ -58,7 +58,7 @@ static void init_marc8(yaz_iconv_encoder_t w)
     data->write_marc8_g1 = 0;
 }
 
-static size_t yaz_write_marc8_page_chr(yaz_iconv_t cd, 
+static size_t yaz_write_marc8_page_chr(yaz_iconv_t cd,
                                        struct encoder_data *w,
                                        char **outbuf, size_t *outbytesleft,
                                        const char *page_chr);
@@ -84,7 +84,7 @@ static unsigned long lookup_marc8(yaz_iconv_t cd,
         size_t inbytesleft, no_read_sub = 0;
         unsigned long x;
 
-        *utf8_outbuf = '\0';        
+        *utf8_outbuf = '\0';
         inp = (unsigned char *) utf8_buf;
         inbytesleft = strlen(utf8_buf);
 
@@ -210,7 +210,7 @@ static size_t flush_combos(yaz_iconv_t cd,
     {
         *(*outbuf)++ = w->write_marc8_second_half_char;
         (*outbytesleft)--;
-    }        
+    }
 
     w->write_marc8_last = 0;
     w->write_marc8_ncr = 0;
@@ -219,7 +219,7 @@ static size_t flush_combos(yaz_iconv_t cd,
     return 0;
 }
 
-static size_t yaz_write_marc8_page_chr(yaz_iconv_t cd, 
+static size_t yaz_write_marc8_page_chr(yaz_iconv_t cd,
                                        struct encoder_data *w,
                                        char **outbuf, size_t *outbytesleft,
                                        const char *page_chr)
@@ -234,17 +234,17 @@ static size_t yaz_write_marc8_page_chr(yaz_iconv_t cd,
     {
         size_t plen = 0;
         const char *page_out = page_chr;
-        
+
         if (*outbytesleft < 8)
         {
             yaz_iconv_set_errno(cd, YAZ_ICONV_E2BIG);
-            
+
             return (size_t) (-1);
         }
 
         if (*old_page_chr)
         {
-            if (!strcmp(*old_page_chr, ESC "p") 
+            if (!strcmp(*old_page_chr, ESC "p")
                 || !strcmp(*old_page_chr, ESC "g")
                 || !strcmp(*old_page_chr, ESC "b"))
             {
@@ -290,7 +290,7 @@ static size_t yaz_write_marc8_2(yaz_iconv_t cd, struct encoder_data *w,
             y = '|';
         else
         {
-            y = x; 
+            y = x;
             enable_ncr = 1;
         }
     }
@@ -356,7 +356,7 @@ static size_t yaz_write_marc8_generic(yaz_iconv_t cd, struct encoder_data *w,
         int ncr = w->write_marc8_ncr;
         const char *lpage = w->write_marc8_lpage;
         size_t r;
-        
+
         r = yaz_write_marc8_2(cd, w, x1,
                               outbuf, outbytesleft, loss_mode);
         if (r)
@@ -408,7 +408,7 @@ static void destroy_marc8(yaz_iconv_encoder_t e)
 
 yaz_iconv_encoder_t yaz_marc8_encoder(const char *tocode,
                                       yaz_iconv_encoder_t e)
-    
+
 {
     if (!yaz_matchstr(tocode, "MARC8"))
         e->write_handle = write_marc8_normal;
index 7145055..70dae3d 100644 (file)
@@ -52,7 +52,7 @@ static size_t write_wchar_t(yaz_iconv_t cd, yaz_iconv_encoder_t en,
 
 yaz_iconv_encoder_t yaz_wchar_encoder(const char *tocode,
                                      yaz_iconv_encoder_t e)
-    
+
 {
 #if HAVE_WCHAR_H
     if (!yaz_matchstr(tocode, "wchar_t"))
@@ -70,7 +70,7 @@ static unsigned long read_wchar_t(yaz_iconv_t cd, yaz_iconv_decoder_t d,
                                   size_t inbytesleft, size_t *no_read)
 {
     unsigned long x = 0;
-    
+
     if (inbytesleft < sizeof(wchar_t))
     {
         yaz_iconv_set_errno(cd, YAZ_ICONV_EINVAL); /* incomplete input */
@@ -89,7 +89,7 @@ static unsigned long read_wchar_t(yaz_iconv_t cd, yaz_iconv_decoder_t d,
 
 yaz_iconv_decoder_t yaz_wchar_decoder(const char *fromcode,
                                      yaz_iconv_decoder_t d)
-    
+
 {
 #if HAVE_WCHAR_H
     if (!yaz_matchstr(fromcode, "wchar_t"))
index bd714f1..1aa941b 100644 (file)
@@ -31,21 +31,21 @@ struct icu_casemap
 };
 
 struct icu_casemap * icu_casemap_create(char action, UErrorCode *status)
-{    
+{
     struct icu_casemap * casemap
         = (struct icu_casemap *) xmalloc(sizeof(struct icu_casemap));
     casemap->action = action;
 
     switch (casemap->action)
     {
-    case 'l':   
-    case 'L':   
-    case 'u':   
-    case 'U':   
-    case 't':  
-    case 'T':  
-    case 'f':  
-    case 'F':  
+    case 'l':
+    case 'L':
+    case 'u':
+    case 'U':
+    case 't':
+    case 'T':
+    case 'f':
+    case 'F':
         break;
     default:
         icu_casemap_destroy(casemap);
@@ -75,7 +75,7 @@ int icu_casemap_casemap(struct icu_casemap * casemap,
 {
     if (!casemap)
         return 0;
-    
+
     return icu_utf16_casemap(dest16, src16, locale,
                              casemap->action, status);
 }
@@ -88,25 +88,25 @@ static uint32_t icu_utf16_sub(struct icu_buf_utf16 * dest16,
 {
     switch (action)
     {
-    case 'l':    
-    case 'L':    
+    case 'l':
+    case 'L':
         return u_strToLower(dest16->utf16, dest16->utf16_cap,
-                            src16->utf16, src16->utf16_len, 
+                            src16->utf16, src16->utf16_len,
                             locale, status);
-    case 'u':    
-    case 'U':    
+    case 'u':
+    case 'U':
         return u_strToUpper(dest16->utf16, dest16->utf16_cap,
-                            src16->utf16, src16->utf16_len, 
+                            src16->utf16, src16->utf16_len,
                             locale, status);
         break;
-    case 't':    
-    case 'T':    
+    case 't':
+    case 'T':
         return u_strToTitle(dest16->utf16, dest16->utf16_cap,
                             src16->utf16, src16->utf16_len,
                             0, locale, status);
         break;
-    case 'f':    
-    case 'F':    
+    case 'f':
+    case 'F':
         return u_strFoldCase(dest16->utf16, dest16->utf16_cap,
                              src16->utf16, src16->utf16_len,
                              U_FOLD_CASE_DEFAULT, status);
@@ -133,7 +133,7 @@ int icu_utf16_casemap(struct icu_buf_utf16 * dest16,
         dest16->utf16_len = 0;
         return U_ZERO_ERROR;
     }
-    
+
     dest16_len = icu_utf16_sub(dest16, src16, locale, action, status);
 
     /* check for buffer overflow, resize and retry */
@@ -154,7 +154,7 @@ int icu_utf16_casemap(struct icu_buf_utf16 * dest16,
             dest16->utf16[0] = (UChar) 0;
         dest16->utf16_len = 0;
     }
-  
+
     return *status;
 }
 
index bf614d0..195b15a 100644 (file)
@@ -47,7 +47,7 @@ struct icu_chain_step
     union {
        struct icu_casemap   *casemap;
        struct icu_transform *transform;
-       struct icu_tokenizer *tokenizer;  
+       struct icu_tokenizer *tokenizer;
         yaz_stemmer_p         stemmer;
     } u;
     struct icu_chain_step *previous;
@@ -60,7 +60,7 @@ struct icu_chain
     int sort;
 
     UCollator *coll;
-    
+
     /* linked list of chain steps */
     struct icu_chain_step *csteps;
 };
@@ -70,7 +70,7 @@ int icu_check_status(UErrorCode status)
     if (U_FAILURE(status))
     {
         yaz_log(YLOG_WARN, "ICU: %d %s\n", status, u_errorName(status));
-        return 0;   
+        return 0;
     }
     return 1;
 }
@@ -80,7 +80,7 @@ static struct icu_chain_step *icu_chain_insert_step(
     const uint8_t *rule, UErrorCode *status)
 {
     struct icu_chain_step *step = 0;
-    
+
     if (!chain || !type || !rule)
         return 0;
 
@@ -101,7 +101,7 @@ static struct icu_chain_step *icu_chain_insert_step(
                                                  0, status);
         break;
     case ICU_chain_step_type_tokenize:
-        step->u.tokenizer = icu_tokenizer_create(chain->locale, 
+        step->u.tokenizer = icu_tokenizer_create(chain->locale,
                                                  (char) rule[0], status);
         break;
     case ICU_chain_step_type_transliterate:
@@ -161,7 +161,7 @@ struct icu_chain_step *icu_chain_step_clone(struct icu_chain_step *old)
     {
         *sp = (struct icu_chain_step *) xmalloc(sizeof(**sp));
         (*sp)->type = old->type;
-        
+
         switch ((*sp)->type)
         {
         case ICU_chain_step_type_display:
@@ -223,7 +223,7 @@ void icu_chain_destroy(struct icu_chain *chain)
     }
 }
 
-struct icu_chain *icu_chain_xml_config(const xmlNode *xml_node, 
+struct icu_chain *icu_chain_xml_config(const xmlNode *xml_node,
                                        int sort,
                                        UErrorCode *status)
 {
@@ -231,12 +231,12 @@ struct icu_chain *icu_chain_xml_config(const xmlNode *xml_node,
     int no_errors = 0;
     struct icu_chain *chain = 0;
     NMEM nmem = 0;
-   
+
     *status = U_ZERO_ERROR;
 
     if (xml_node && xml_node->type == XML_ELEMENT_NODE)
     {
-        xmlChar *xml_locale = xmlGetProp((xmlNode *) xml_node, 
+        xmlChar *xml_locale = xmlGetProp((xmlNode *) xml_node,
                                          (xmlChar *) "locale");
         if (xml_locale)
         {
@@ -275,21 +275,21 @@ struct icu_chain *icu_chain_xml_config(const xmlNode *xml_node,
         }
         if (!rule && node->children)
             rule = nmem_text_node_cdata(node->children, nmem);
-        
+
         if (!strcmp((const char *) node->name, "casemap"))
-            step = icu_chain_insert_step(chain, ICU_chain_step_type_casemap, 
+            step = icu_chain_insert_step(chain, ICU_chain_step_type_casemap,
                                          (const uint8_t *) rule, status);
         else if (!strcmp((const char *) node->name, "transform"))
-            step = icu_chain_insert_step(chain, ICU_chain_step_type_transform, 
+            step = icu_chain_insert_step(chain, ICU_chain_step_type_transform,
                                          (const uint8_t *) rule, status);
         else if (!strcmp((const char *) node->name, "transliterate"))
-            step = icu_chain_insert_step(chain, ICU_chain_step_type_transliterate, 
+            step = icu_chain_insert_step(chain, ICU_chain_step_type_transliterate,
                                          (const uint8_t *) rule, status);
         else if (!strcmp((const char *) node->name, "tokenize"))
-            step = icu_chain_insert_step(chain, ICU_chain_step_type_tokenize, 
+            step = icu_chain_insert_step(chain, ICU_chain_step_type_tokenize,
                                          (const uint8_t *) rule, status);
         else if (!strcmp((const char *) node->name, "display"))
-            step = icu_chain_insert_step(chain, ICU_chain_step_type_display, 
+            step = icu_chain_insert_step(chain, ICU_chain_step_type_display,
                                          (const uint8_t *) "", status);
         else if (!strcmp((const char *) node->name, "stemming"))
             step = icu_chain_insert_step(chain, YAZ_chain_step_type_stemming,
@@ -298,7 +298,7 @@ struct icu_chain *icu_chain_xml_config(const xmlNode *xml_node,
         {
             yaz_log(YLOG_WARN, "Element %s is deprecated. "
                     "Use transform instead", node->name);
-            step = icu_chain_insert_step(chain, ICU_chain_step_type_transform, 
+            step = icu_chain_insert_step(chain, ICU_chain_step_type_transform,
                                          (const uint8_t *) rule, status);
         }
         else if (!strcmp((const char *) node->name, "index")
@@ -369,7 +369,7 @@ struct icu_buf_utf16 *icu_iter_invoke(yaz_icu_iter_t iter,
     else
     {
         struct icu_buf_utf16 *dst = icu_iter_invoke(iter, step->previous, src);
-        
+
         switch (step->type)
         {
         case ICU_chain_step_type_casemap:
@@ -480,14 +480,14 @@ int icu_iter_next(yaz_icu_iter_t iter)
                                      iter->steps : iter->chain->csteps,
                                      iter->input);
         iter->input = 0;
-        
+
         if (!iter->last)
             return 0;
 
         iter->token_count++;
 
         if (iter->chain->sort)
-        {        
+        {
             icu_sortkey8_from_utf16(iter->chain->coll,
                                     iter->sort8, iter->last,
                                     &iter->status);
@@ -510,16 +510,16 @@ const char *icu_iter_get_sortkey(yaz_icu_iter_t iter)
 }
 
 const char *icu_iter_get_display(yaz_icu_iter_t iter)
-{ 
-    return icu_buf_utf8_to_cstr(iter->display);   
+{
+    return icu_buf_utf8_to_cstr(iter->display);
 }
 
 int icu_iter_get_token_number(yaz_icu_iter_t iter)
-{ 
+{
     return iter->token_count;
 }
 
-int icu_chain_assign_cstr(struct icu_chain *chain, const char *src8cstr, 
+int icu_chain_assign_cstr(struct icu_chain *chain, const char *src8cstr,
                           UErrorCode *status)
 {
     if (chain->iter)
index 32ee134..9af6e52 100644 (file)
 #include <unicode/uchar.h>    /* char names           */
 
 void icu_sortkey8_from_utf16(UCollator *coll,
-                             struct icu_buf_utf8 * dest8, 
+                             struct icu_buf_utf8 * dest8,
                              struct icu_buf_utf16 * src16,
                              UErrorCode * status)
-{ 
+{
     int32_t sortkey_len = 0;
     /* we'll fake a capacity of one less, because it turns out
        that ucol_getSortKey writes ONE character too much */
     int32_t cap = dest8->utf8_cap ? dest8->utf8_cap - 1 : 0;
-    
+
     sortkey_len = ucol_getSortKey(coll, src16->utf16, src16->utf16_len,
                                   dest8->utf8, cap);
 
@@ -50,7 +50,7 @@ void icu_sortkey8_from_utf16(UCollator *coll,
     if (U_SUCCESS(*status)
         && sortkey_len > 0)
         dest8->utf8_len = sortkey_len;
-    else 
+    else
         icu_buf_utf8_clear(dest8);
 }
 
index 954ebc6..0697029 100644 (file)
@@ -38,8 +38,8 @@ struct icu_tokenizer
     int32_t token_end;
 /*
   keep always invariant
-  0 <= token_start 
-  <= token_end 
+  0 <= token_start
+  <= token_end
   <= buf16->utf16_len
   and invariant
   0 <= token_id <= token_count
@@ -83,7 +83,7 @@ struct icu_tokenizer *icu_tokenizer_create(const char *locale, char action,
 
     icu_tokenizer_reset(tokenizer, action);
     switch (tokenizer->action)
-    {    
+    {
     case 'l':
     case 'L':
         tokenizer->bi = ubrk_open(UBRK_LINE, locale, 0, 0, status);
@@ -109,7 +109,7 @@ struct icu_tokenizer *icu_tokenizer_create(const char *locale, char action,
         return 0;
         break;
     }
-    
+
     /* ICU error stuff is a very  funny business */
     if (U_SUCCESS(*status))
         return tokenizer;
@@ -130,8 +130,8 @@ void icu_tokenizer_destroy(struct icu_tokenizer * tokenizer)
     }
 }
 
-int icu_tokenizer_attach(struct icu_tokenizer * tokenizer, 
-                         struct icu_buf_utf16 * src16, 
+int icu_tokenizer_attach(struct icu_tokenizer * tokenizer,
+                         struct icu_buf_utf16 * src16,
                          UErrorCode *status)
 {
     if (!tokenizer || !tokenizer->bi || !src16)
@@ -146,15 +146,15 @@ int icu_tokenizer_attach(struct icu_tokenizer * tokenizer,
 
     ubrk_setText(tokenizer->bi,
                  tokenizer->buf16->utf16, tokenizer->buf16->utf16_len, status);
-     
+
     if (U_FAILURE(*status))
         return 0;
 
     return 1;
 }
 
-int32_t icu_tokenizer_next_token(struct icu_tokenizer * tokenizer, 
-                                 struct icu_buf_utf16 * tkn16, 
+int32_t icu_tokenizer_next_token(struct icu_tokenizer * tokenizer,
+                                 struct icu_buf_utf16 * tkn16,
                                  UErrorCode *status)
 {
     int32_t tkn_start = 0;
@@ -166,8 +166,8 @@ int32_t icu_tokenizer_next_token(struct icu_tokenizer * tokenizer,
         return 0;
     /*
     never change tokenizer->buf16 and keep always invariant
-    0 <= tokenizer->token_start 
-       <= tokenizer->token_end 
+    0 <= tokenizer->token_start
+       <= tokenizer->token_end
        <= tokenizer->buf16->utf16_len
     returns length of token
     */
@@ -186,8 +186,8 @@ int32_t icu_tokenizer_next_token(struct icu_tokenizer * tokenizer,
 
     /* copy out if everything is well */
     if (U_FAILURE(*status))
-        return 0;        
-    
+        return 0;
+
     /* everything OK, now update internal state */
     tkn_len = tkn_end - tkn_start;
 
@@ -197,10 +197,10 @@ int32_t icu_tokenizer_next_token(struct icu_tokenizer * tokenizer,
         tokenizer->token_id++;
     }
     else
-        tokenizer->token_id = 0;    
+        tokenizer->token_id = 0;
 
     tokenizer->token_start = tkn_start;
-    tokenizer->token_end = tkn_end;    
+    tokenizer->token_end = tkn_end;
 
     /* copying into token buffer if it exists */
     if (tkn16)
@@ -208,7 +208,7 @@ int32_t icu_tokenizer_next_token(struct icu_tokenizer * tokenizer,
         if (tkn16->utf16_cap < tkn_len)
             icu_buf_utf16_resize(tkn16, (size_t) tkn_len * 2);
 
-        u_strncpy(tkn16->utf16, &(tokenizer->buf16->utf16)[tkn_start], 
+        u_strncpy(tkn16->utf16, &(tokenizer->buf16->utf16)[tkn_start],
                   tkn_len);
 
         tkn16->utf16_len = tkn_len;
index 164edd6..034392c 100644 (file)
@@ -47,7 +47,7 @@ struct icu_transform *icu_transform_clone(struct icu_transform *old)
 }
 
 struct icu_transform * icu_transform_create(const char *id, char action,
-                                            const char *rules, 
+                                            const char *rules,
                                             UErrorCode *status)
 {
     struct icu_buf_utf16 *id16 = icu_buf_utf16_create(0);
@@ -70,10 +70,10 @@ struct icu_transform * icu_transform_create(const char *id, char action,
     case 'f':
     case 'F':
         transform->trans
-            = utrans_openU(id16->utf16, 
+            = utrans_openU(id16->utf16,
                            id16->utf16_len,
                            UTRANS_FORWARD,
-                           rules16->utf16, 
+                           rules16->utf16,
                            rules16->utf16_len,
                            &transform->parse_error, status);
         break;
@@ -83,7 +83,7 @@ struct icu_transform * icu_transform_create(const char *id, char action,
             = utrans_openU(id16->utf16,
                            id16->utf16_len,
                            UTRANS_REVERSE ,
-                           rules16->utf16, 
+                           rules16->utf16,
                            rules16->utf16_len,
                            &transform->parse_error, status);
         break;
@@ -93,7 +93,7 @@ struct icu_transform * icu_transform_create(const char *id, char action,
     }
     icu_buf_utf16_destroy(rules16);
     icu_buf_utf16_destroy(id16);
-    
+
     if (U_SUCCESS(*status))
         return transform;
 
@@ -117,7 +117,7 @@ int icu_transform_trans(struct icu_transform * transform,
                         const struct icu_buf_utf16 * src16,
                         UErrorCode *status)
 {
-    if (!transform || !transform->trans 
+    if (!transform || !transform->trans
         || !src16  || !dest16)
         return 0;
 
@@ -130,14 +130,14 @@ int icu_transform_trans(struct icu_transform * transform,
     if (!icu_buf_utf16_copy(dest16, src16))
         return 0;
 
-    utrans_transUChars(transform->trans, 
+    utrans_transUChars(transform->trans,
                        dest16->utf16, &(dest16->utf16_len),
                        dest16->utf16_cap,
                        0, &(dest16->utf16_len), status);
 
     if (U_FAILURE(*status))
         icu_buf_utf16_clear(dest16);
-    
+
     return dest16->utf16_len;
 }
 
index 9274974..0b3e3b9 100644 (file)
@@ -28,7 +28,7 @@
 
 struct icu_buf_utf16 * icu_buf_utf16_create(size_t capacity)
 {
-    struct icu_buf_utf16 * buf16 
+    struct icu_buf_utf16 * buf16
         = (struct icu_buf_utf16 *) xmalloc(sizeof(struct icu_buf_utf16));
 
     buf16->utf16 = 0;
@@ -60,18 +60,18 @@ struct icu_buf_utf16 * icu_buf_utf16_resize(struct icu_buf_utf16 * buf16,
 {
     if (!buf16)
         return 0;
-    
+
     if (capacity > 0)
     {
         if (0 == buf16->utf16)
             buf16->utf16 = (UChar *) xmalloc(sizeof(UChar) * capacity);
         else
-            buf16->utf16 
+            buf16->utf16
                 = (UChar *) xrealloc(buf16->utf16, sizeof(UChar) * capacity);
 
         icu_buf_utf16_clear(buf16);
         buf16->utf16_cap = capacity;
-    } 
+    }
     else
     {
         xfree(buf16->utf16);
index c4685d5..a6fcda8 100644 (file)
@@ -28,7 +28,7 @@
 
 struct icu_buf_utf8 *icu_buf_utf8_create(size_t capacity)
 {
-    struct icu_buf_utf8 * buf8 
+    struct icu_buf_utf8 * buf8
         = (struct icu_buf_utf8 *) xmalloc(sizeof(struct icu_buf_utf8));
 
     buf8->utf8 = 0;
@@ -66,19 +66,19 @@ struct icu_buf_utf8 * icu_buf_utf8_resize(struct icu_buf_utf8 * buf8,
         if (0 == buf8->utf8)
             buf8->utf8 = (uint8_t *) xmalloc(sizeof(uint8_t) * capacity);
         else
-            buf8->utf8 
+            buf8->utf8
                 = (uint8_t *) xrealloc(buf8->utf8, sizeof(uint8_t) * capacity);
-        
+
         buf8->utf8_cap = capacity;
-    } 
+    }
     else
-    { 
+    {
         xfree(buf8->utf8);
         buf8->utf8 = 0;
         buf8->utf8_len = 0;
         buf8->utf8_cap = 0;
     }
-    
+
     return buf8;
 }
 
@@ -111,11 +111,11 @@ UErrorCode icu_utf16_from_utf8_cstr(struct icu_buf_utf16 * dest16,
 
     *status = U_ZERO_ERROR;
     src8cstr_len = strlen(src8cstr);
-  
+
     u_strFromUTF8(dest16->utf16, dest16->utf16_cap,
                   &utf16_len,
                   src8cstr, src8cstr_len, status);
-  
+
     /* check for buffer overflow, resize and retry */
     if (*status == U_BUFFER_OVERFLOW_ERROR)
     {
@@ -128,9 +128,9 @@ UErrorCode icu_utf16_from_utf8_cstr(struct icu_buf_utf16 * dest16,
 
     if (U_SUCCESS(*status) && utf16_len <= dest16->utf16_cap)
         dest16->utf16_len = utf16_len;
-    else 
+    else
         icu_buf_utf16_clear(dest16);
-  
+
     return *status;
 }
 
@@ -139,11 +139,11 @@ UErrorCode icu_utf16_to_utf8(struct icu_buf_utf8 *dest8,
                              UErrorCode * status)
 {
     int32_t utf8_len = 0;
-  
+
     u_strToUTF8((char *) dest8->utf8, dest8->utf8_cap,
                 &utf8_len,
                 src16->utf16, src16->utf16_len, status);
-  
+
     /* check for buffer overflow, resize and retry */
     if (*status == U_BUFFER_OVERFLOW_ERROR)
     {
@@ -156,9 +156,9 @@ UErrorCode icu_utf16_to_utf8(struct icu_buf_utf8 *dest8,
 
     if (U_SUCCESS(*status) && utf8_len <= dest8->utf8_cap)
         dest8->utf8_len = utf8_len;
-    else 
+    else
         icu_buf_utf8_clear(dest8);
-  
+
     return *status;
 }
 
index b823595..c0ecf25 100644 (file)
@@ -20,13 +20,13 @@ bool_t *ill_get_bool(struct ill_get_ctl *gc, const char *name,
     char element[128];
     const char *v;
     bool_t *r = (bool_t *) odr_malloc(o, sizeof(*r));
-    
+
     strcpy(element, name);
     if (sub)
     {
         strcat(element, ",");
         strcat(element, sub);
-    }    
+    }
 
     v = (gc->f)(gc->clientData, element);
     if (v)
@@ -43,13 +43,13 @@ Odr_int *ill_get_int(struct ill_get_ctl *gc, const char *name,
     ODR o = gc->odr;
     char element[128];
     const char *v;
-    
+
     strcpy(element, name);
     if (sub)
     {
         strcat(element, ",");
         strcat(element, sub);
-    }    
+    }
     v = (gc->f)(gc->clientData, element);
     if (v)
         val = atoi(v);
@@ -138,7 +138,7 @@ ILL_Person_Or_Institution_Symbol *ill_get_Person_Or_Insitution_Symbol(
     ODR o = gc->odr;
     ILL_Person_Or_Institution_Symbol *p =
         (ILL_Person_Or_Institution_Symbol *) odr_malloc(o, sizeof(*p));
-    
+
     strcpy(element, name);
     if (sub)
     {
@@ -163,7 +163,7 @@ static ILL_Name_Of_Person_Or_Institution *ill_get_Name_Of_Person_Or_Institution(
     ODR o = gc->odr;
     ILL_Name_Of_Person_Or_Institution *p =
         (ILL_Name_Of_Person_Or_Institution *) odr_malloc(o, sizeof(*p));
-    
+
     strcpy(element, name);
     if (sub)
     {
@@ -181,14 +181,14 @@ static ILL_Name_Of_Person_Or_Institution *ill_get_Name_Of_Person_Or_Institution(
         return p;
     return 0;
 }
-    
+
 ILL_System_Id *ill_get_System_Id(struct ill_get_ctl *gc,
                                  const char *name, const char *sub)
 {
     ODR o = gc->odr;
     char element[128];
     ILL_System_Id *p;
-    
+
     strcpy(element, name);
     if (sub)
     {
@@ -209,13 +209,13 @@ ILL_Transaction_Id *ill_get_Transaction_Id(struct ill_get_ctl *gc,
     ODR o = gc->odr;
     ILL_Transaction_Id *r = (ILL_Transaction_Id *) odr_malloc(o, sizeof(*r));
     char element[128];
-    
+
     strcpy(element, name);
     if (sub)
     {
         strcat(element, ",");
         strcat(element, sub);
-    }    
+    }
     r->initial_requester_id =
         ill_get_System_Id(gc, element, "initial-requester-id");
     r->transaction_group_qualifier =
@@ -235,7 +235,7 @@ ILL_Service_Date_this *ill_get_Service_Date_this(
     ILL_Service_Date_this *r =
         (ILL_Service_Date_this *) odr_malloc(o, sizeof(*r));
     char element[128];
-    
+
     strcpy(element, name);
     if (sub)
     {
@@ -254,7 +254,7 @@ ILL_Service_Date_original *ill_get_Service_Date_original(
     ILL_Service_Date_original *r =
         (ILL_Service_Date_original *) odr_malloc(o, sizeof(*r));
     char element[128];
-    
+
     strcpy(element, name);
     if (sub)
     {
@@ -275,13 +275,13 @@ ILL_Service_Date_Time *ill_get_Service_Date_Time(
     ILL_Service_Date_Time *r =
         (ILL_Service_Date_Time *) odr_malloc(o, sizeof(*r));
     char element[128];
-    
+
     strcpy(element, name);
     if (sub)
     {
         strcat(element, ",");
         strcat(element, sub);
-    }    
+    }
     r->date_time_of_this_service = ill_get_Service_Date_this(
         gc, element, "this");
     r->date_time_of_original_service = ill_get_Service_Date_original(
@@ -296,7 +296,7 @@ ILL_Requester_Optional_Messages_Type *ill_get_Requester_Optional_Messages_Type(
     ILL_Requester_Optional_Messages_Type *r =
         (ILL_Requester_Optional_Messages_Type *) odr_malloc(o, sizeof(*r));
     char element[128];
-    
+
     strcpy(element, name);
     if (sub)
     {
@@ -313,12 +313,12 @@ ILL_Requester_Optional_Messages_Type *ill_get_Requester_Optional_Messages_Type(
 }
 
 ILL_Item_Id *ill_get_Item_Id(
-    struct ill_get_ctl *gc, const char *name, const char *sub)   
+    struct ill_get_ctl *gc, const char *name, const char *sub)
 {
     ODR o = gc->odr;
     ILL_Item_Id *r = (ILL_Item_Id *) odr_malloc(o, sizeof(*r));
     char element[128];
-    
+
     strcpy(element, name);
     if (sub)
     {
@@ -353,7 +353,7 @@ ILL_Item_Id *ill_get_Item_Id(
     r->system_no = 0;
     r->additional_no_letters =
         ill_get_ILL_String(gc, element, "additional-no-letters");
-    r->verification_reference_source = 
+    r->verification_reference_source =
         ill_get_ILL_String(gc, element, "verification-reference-source");
     return r;
 }
@@ -393,7 +393,7 @@ ILL_Postal_Address *ill_get_Postal_Address(
         strcat(element, ",");
         strcat(element, sub);
     }
-    r->name_of_person_or_institution = 
+    r->name_of_person_or_institution =
         ill_get_Name_Of_Person_Or_Institution(
             gc, element, "name-of-person-or-institution");
     r->extended_postal_delivery_address =
@@ -417,7 +417,7 @@ ILL_System_Address *ill_get_System_Address(
     ILL_System_Address *r =
         (ILL_System_Address *) odr_malloc(o, sizeof(*r));
     char element[128];
-    
+
     strcpy(element, name);
     if (sub)
     {
@@ -438,7 +438,7 @@ ILL_Delivery_Address *ill_get_Delivery_Address(
     ILL_Delivery_Address *r =
         (ILL_Delivery_Address *) odr_malloc(o, sizeof(*r));
     char element[128];
-    
+
     strcpy(element, name);
     if (sub)
     {
@@ -458,7 +458,7 @@ ILL_Search_Type *ill_get_Search_Type(
     ODR o = gc->odr;
     ILL_Search_Type *r = (ILL_Search_Type *) odr_malloc(o, sizeof(*r));
     char element[128];
-    
+
     strcpy(element, name);
     if (sub)
     {
@@ -470,7 +470,7 @@ ILL_Search_Type *ill_get_Search_Type(
                                                "need-before-date", 0);
     r->expiry_date = ill_get_ILL_ISO_Date(gc, element, "expiry-date", 0);
     r->expiry_flag = ill_get_enumerated(gc, element, "expiry-flag", 3);
-                                         
+
     return r;
 }
 
@@ -480,7 +480,7 @@ ILL_Request *ill_get_ILLRequest(
     ODR o = gc->odr;
     ILL_Request *r = (ILL_Request *) odr_malloc(o, sizeof(*r));
     char element[128];
-    
+
     strcpy(element, name);
     if (sub)
     {
@@ -488,9 +488,9 @@ ILL_Request *ill_get_ILLRequest(
         strcat(element, sub);
     }
     r->protocol_version_num =
-        ill_get_enumerated(gc, element, "protocol-version-num", 
+        ill_get_enumerated(gc, element, "protocol-version-num",
                            ILL_Request_version_2);
-    
+
     r->transaction_id = ill_get_Transaction_Id(gc, element, "transaction-id");
     r->service_date_time =
         ill_get_Service_Date_Time(gc, element, "service-date-time");
@@ -522,10 +522,10 @@ ILL_Request *ill_get_ILLRequest(
     r->supply_medium_info_type = 0;
 
     r->place_on_hold = ill_get_enumerated(
-        gc, element, "place-on-hold", 
+        gc, element, "place-on-hold",
         ILL_Place_On_Hold_Type_according_to_responder_policy);
     r->client_id = ill_get_Client_Id(gc, element, "client-id");
-                           
+
     r->item_id = ill_get_Item_Id(gc, element, "item-id");
     r->supplemental_item_description = 0;
     r->cost_info_type = 0;
@@ -547,7 +547,7 @@ ILL_ItemRequest *ill_get_ItemRequest(
     ODR o = gc->odr;
     ILL_ItemRequest *r = (ILL_ItemRequest *)odr_malloc(o, sizeof(*r));
     char element[128];
-    
+
     strcpy(element, name);
     if (sub)
     {
@@ -555,9 +555,9 @@ ILL_ItemRequest *ill_get_ItemRequest(
         strcat(element, sub);
     }
     r->protocol_version_num =
-        ill_get_enumerated(gc, element, "protocol-version-num", 
+        ill_get_enumerated(gc, element, "protocol-version-num",
                            ILL_Request_version_2);
-    
+
     r->transaction_id = ill_get_Transaction_Id(gc, element, "transaction-id");
     r->service_date_time =
         ill_get_Service_Date_Time(gc, element, "service-date-time");
@@ -589,10 +589,10 @@ ILL_ItemRequest *ill_get_ItemRequest(
     r->supply_medium_info_type = 0;
 
     r->place_on_hold = ill_get_enumerated(
-        gc, element, "place-on-hold", 
+        gc, element, "place-on-hold",
         ILL_Place_On_Hold_Type_according_to_responder_policy);
     r->client_id = ill_get_Client_Id(gc, element, "client-id");
-                           
+
     r->item_id = ill_get_Item_Id(gc, element, "item-id");
     r->supplemental_item_description = 0;
     r->cost_info_type = 0;
@@ -614,7 +614,7 @@ ILL_Cancel *ill_get_Cancel(
     ODR o = gc->odr;
     ILL_Cancel *r = (ILL_Cancel *)odr_malloc(o, sizeof(*r));
     char element[128];
-    
+
     strcpy(element, name);
     if (sub)
     {
@@ -622,9 +622,9 @@ ILL_Cancel *ill_get_Cancel(
         strcat(element, sub);
     }
     r->protocol_version_num =
-        ill_get_enumerated(gc, element, "protocol-version-num", 
+        ill_get_enumerated(gc, element, "protocol-version-num",
                            ILL_Request_version_2);
-    
+
     r->transaction_id = ill_get_Transaction_Id(gc, element, "transaction-id");
     r->service_date_time =
         ill_get_Service_Date_Time(gc, element, "service-date-time");
index 85922de..b40f99f 100644 (file)
@@ -45,7 +45,7 @@ static struct {
 int yaz_init_opt_encode(Z_Options *opt, const char *opt_str, int *error_pos)
 {
     const char *cp = opt_str;
-    
+
     ODR_MASK_ZERO(opt);
     while (*cp)
     {
index c282558..7786bf1 100644 (file)
@@ -41,7 +41,7 @@ static unsigned long read_iso_5428_1984(yaz_iconv_t cd, yaz_iconv_decoder_t d,
         inp++;
         --inbytesleft;
         (*no_read)++;
-    }    
+    }
     if (inbytesleft == 0)
     {
         yaz_iconv_set_errno(cd, YAZ_ICONV_EINVAL); /* incomplete input */
@@ -50,15 +50,15 @@ static unsigned long read_iso_5428_1984(yaz_iconv_t cd, yaz_iconv_decoder_t d,
     }
     switch (*inp) {
     case 0xe1: /*  alpha small */
-            if (tonos) 
+            if (tonos)
                 x = 0x03ac;
-            else 
+            else
                 x = 0x03b1;
             break;
     case 0xc1: /*  alpha capital */
-            if (tonos) 
+            if (tonos)
                 x = 0x0386;
-            else 
+            else
                 x = 0x0391;
             break;
 
@@ -83,15 +83,15 @@ static unsigned long read_iso_5428_1984(yaz_iconv_t cd, yaz_iconv_decoder_t d,
             x = 0x0394;
             break;
     case 0xe6: /*  epsilon small */
-            if (tonos) 
+            if (tonos)
                 x = 0x03ad;
-            else 
+            else
                 x = 0x03b5;
             break;
     case 0xc6: /*  epsilon capital */
-            if (tonos) 
+            if (tonos)
                 x = 0x0388;
-            else 
+            else
                 x = 0x0395;
             break;
     case 0xe9: /*  Zeta small */
@@ -101,15 +101,15 @@ static unsigned long read_iso_5428_1984(yaz_iconv_t cd, yaz_iconv_decoder_t d,
             x = 0x0396;
             break;
     case 0xea: /*  Eta small */
-            if (tonos) 
+            if (tonos)
                 x = 0x03ae;
-            else 
+            else
                 x = 0x03b7;
             break;
     case 0xca: /*  Eta capital */
-            if (tonos) 
+            if (tonos)
                 x = 0x0389;
-            else 
+            else
                 x = 0x0397;
             break;
     case 0xeb: /*  Theta small */
@@ -119,24 +119,24 @@ static unsigned long read_iso_5428_1984(yaz_iconv_t cd, yaz_iconv_decoder_t d,
             x = 0x0398;
             break;
     case 0xec: /*  Iota small */
-            if (tonos) 
-                if (dialitika) 
+            if (tonos)
+                if (dialitika)
                     x = 0x0390;
-                else 
+                else
                     x = 0x03af;
-            else 
-                if (dialitika) 
+            else
+                if (dialitika)
                     x = 0x03ca;
-                else 
+                else
                     x = 0x03b9;
             break;
     case 0xcc: /*  Iota capital */
-            if (tonos) 
+            if (tonos)
                 x = 0x038a;
-            else 
-                if (dialitika) 
+            else
+                if (dialitika)
                     x = 0x03aa;
-                else 
+                else
                     x = 0x0399;
             break;
     case 0xed: /*  Kappa small */
@@ -170,15 +170,15 @@ static unsigned long read_iso_5428_1984(yaz_iconv_t cd, yaz_iconv_decoder_t d,
             x = 0x039e;
             break;
     case 0xf2: /*  Omicron small */
-            if (tonos) 
+            if (tonos)
                 x = 0x03cc;
-            else 
+            else
                 x = 0x03bf;
             break;
     case 0xd2: /*  Omicron capital */
-            if (tonos) 
+            if (tonos)
                 x = 0x038c;
-            else 
+            else
                 x = 0x039f;
             break;
     case 0xf3: /*  Pi small */
@@ -209,24 +209,24 @@ static unsigned long read_iso_5428_1984(yaz_iconv_t cd, yaz_iconv_decoder_t d,
             x = 0x03a4;
             break;
     case 0xf9: /*  Upsilon small */
-            if (tonos) 
-                if (dialitika) 
+            if (tonos)
+                if (dialitika)
                     x = 0x03b0;
-                else 
+                else
                     x = 0x03cd;
-            else 
-                if (dialitika) 
+            else
+                if (dialitika)
                     x = 0x03cb;
-                else 
+                else
                     x = 0x03c5;
             break;
     case 0xd9: /*  Upsilon capital */
-            if (tonos) 
+            if (tonos)
                 x = 0x038e;
-            else 
-                if (dialitika) 
+            else
+                if (dialitika)
                     x = 0x03ab;
-                else 
+                else
                     x = 0x03a5;
             break;
     case 0xfa: /*  Phi small */
@@ -248,15 +248,15 @@ static unsigned long read_iso_5428_1984(yaz_iconv_t cd, yaz_iconv_decoder_t d,
             x = 0x03a8;
             break;
     case 0xfd: /*  Omega small */
-            if (tonos) 
+            if (tonos)
                 x = 0x03ce;
-            else 
+            else
                 x = 0x03c9;
             break;
     case 0xdd: /*  Omega capital */
-            if (tonos) 
+            if (tonos)
                 x = 0x038f;
-            else 
+            else
                 x = 0x03a9;
             break;
     default:
@@ -264,7 +264,7 @@ static unsigned long read_iso_5428_1984(yaz_iconv_t cd, yaz_iconv_decoder_t d,
         break;
     }
     (*no_read)++;
-    
+
     return x;
 }
 
index d3cee68..4055749 100644 (file)
@@ -36,7 +36,7 @@ struct json_parser_s {
 json_parser_t json_parser_create(void)
 {
     json_parser_t p = (json_parser_t) xmalloc(sizeof(*p));
-    
+
     p->buf = 0;
     p->cp = 0;
     p->err_msg = 0;
@@ -198,7 +198,7 @@ static struct json_node *json_parse_string(json_parser_t p)
     }
     n = json_new_node(p, json_node_string);
     dst = n->u.string = (char *) xmalloc(l + 1);
-    
+
     cp = p->cp;
     while (*cp && *cp != '"')
     {
@@ -302,7 +302,7 @@ static struct json_node *json_parse_elements(json_parser_t p)
         }
         m2 = json_new_node(p, json_node_list);
         m2->u.link[0] = n2;
-        
+
         m1->u.link[1] = m2;
         m1 = m2;
     }
@@ -377,7 +377,7 @@ static struct json_node *json_parse_members(json_parser_t p)
         }
         m2 = json_new_node(p, json_node_list);
         m2->u.link[0] = n2;
-        
+
         m1->u.link[1] = m2;
         m1 = m2;
     }
@@ -493,8 +493,8 @@ static void wrbuf_json_write(WRBUF b, const char *cp, size_t sz)
         {   /* leave encoding as raw UTF-8 */
             wrbuf_putc(b, cp[i]);
         }
-    }       
-        
+    }
+
 }
 
 void wrbuf_json_puts(WRBUF b, const char *str)
@@ -525,7 +525,7 @@ static void json_write_wrbuf_r(struct json_node *node, WRBUF result, int indent)
         wrbuf_puts(result, "{");
         if (indent >= 0)
         {
-            wrbuf_puts(result, "\n"); 
+            wrbuf_puts(result, "\n");
             json_indent(result, sub_indent);
         }
         if (node->u.link[0])
@@ -623,7 +623,7 @@ static struct json_node **json_get_objectp(struct json_node *n,
 struct json_node *json_get_object(struct json_node *n, const char *name)
 {
     struct json_node **np = json_get_objectp(n, name);
-    
+
     if (np)
         return *np;
     return 0;
@@ -632,7 +632,7 @@ struct json_node *json_get_object(struct json_node *n, const char *name)
 struct json_node *json_detach_object(struct json_node *n, const char *name)
 {
     struct json_node **np = json_get_objectp(n, name);
-    
+
     if (np)
     {
         struct json_node *n = *np;
index 673418b..dec6a2a 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -87,15 +87,15 @@ static struct {
     { YLOG_TID,    "tid"  },
     { YLOG_APP,    "app"   },
     { YLOG_NOTIME, "notime" },
-    { YLOG_APP2,   "app2" }, 
+    { YLOG_APP2,   "app2" },
     { YLOG_APP3,   "app3" },
     { YLOG_ALL,    "all"  },
     { YLOG_FLUSH,  "flush" },
-    { YLOG_LOGLVL, "loglevel" }, 
+    { YLOG_LOGLVL, "loglevel" },
     { 0,           "none" },
     { 0, NULL }
     /* the rest will be filled in if the user defines dynamic modules*/
-};  
+};
 
 static unsigned int next_log_bit = YLOG_LAST_BIT<<1; /* first dynamic bit */
 
@@ -152,7 +152,7 @@ void yaz_log_init_file(const char *fname)
     else
     {
         yaz_log_info.type = use_none;  /* NULL name; use no file at all */
-        yaz_log_info.l_fname[0] = '\0'; 
+        yaz_log_info.l_fname[0] = '\0';
     }
     yaz_log_reopen();
 }
@@ -202,7 +202,7 @@ void yaz_log_init_level(int level)
     {
         l_level = level;
         yaz_log_reopen(); /* make sure we set buffering right */
-    } 
+    }
     else
         l_level = level;
 
@@ -366,7 +366,7 @@ static void yaz_strftime(char *dst, size_t sz,
 {
     strftime(dst, sz, fmt, tm);
 }
-                            
+
 static void yaz_log_to_file(int level, const char *log_message)
 {
     FILE *file;
@@ -384,8 +384,8 @@ static void yaz_log_to_file(int level, const char *log_message)
 #else
     tm = localtime(&ti);
 #endif
-    
-    yaz_log_open_check(tm, 0, "a");  
+
+    yaz_log_open_check(tm, 0, "a");
     file = yaz_log_file(); /* file may change in yaz_log_open_check */
 
     if (file)
@@ -394,15 +394,15 @@ static void yaz_log_to_file(int level, const char *log_message)
         char tid[TID_LEN];
         char flags[1024];
         int i;
-        
+
         *flags = '\0';
         for (i = 0; level && mask_names[i].name; i++)
             if ( mask_names[i].mask & level)
             {
-                if (*mask_names[i].name && mask_names[i].mask && 
+                if (*mask_names[i].name && mask_names[i].mask &&
                     mask_names[i].mask != YLOG_ALL)
                 {
-                    if (strlen(flags) + strlen(mask_names[i].name) 
+                    if (strlen(flags) + strlen(mask_names[i].name)
                                              <   sizeof(flags) - 4)
                     {
                         strcat(flags, "[");
@@ -412,7 +412,7 @@ static void yaz_log_to_file(int level, const char *log_message)
                     level &= ~mask_names[i].mask;
                 }
             }
-       
+
         tbuf[0] = '\0';
         if (!(l_level & YLOG_NOTIME))
         {
@@ -479,15 +479,15 @@ void yaz_log(int level, const char *fmt, ...)
 
 void yaz_log_time_format(const char *fmt)
 {
-    if ( !fmt || !*fmt) 
+    if ( !fmt || !*fmt)
     { /* no format, default to new */
         l_actual_format = l_new_default_format;
-        return; 
+        return;
     }
     if (0==strcmp(fmt, "old"))
     { /* force the old format */
         l_actual_format = l_old_default_format;
-        return; 
+        return;
     }
     /* else use custom format */
     strncpy(l_custom_format, fmt, TIMEFORMAT_LEN-1);
@@ -501,7 +501,7 @@ static char *clean_name(const char *name, size_t len, char *namebuf, size_t bufl
     char *p = namebuf;
     char *start = namebuf;
     if (buflen <= len)
-        len = buflen-1; 
+        len = buflen-1;
     strncpy(namebuf, name, len);
     namebuf[len] = '\0';
     while ((p = strchr(start, '/')))
@@ -540,16 +540,16 @@ int yaz_log_module_level(const char *name)
     char clean[255];
     char *n = clean_name(name, strlen(name), clean, sizeof(clean));
     internal_log_init();
-    
+
     for (i = 0; mask_names[i].name; i++)
         if (0==strcmp(n, mask_names[i].name))
         {
             yaz_log(YLOG_LOGLVL, "returning log bit 0x%x for '%s' %s",
-                    mask_names[i].mask, n, 
+                    mask_names[i].mask, n,
                     strcmp(n,name) ? name : "");
             return mask_names[i].mask;
         }
-    yaz_log(YLOG_LOGLVL, "returning NO log bit for '%s' %s", n, 
+    yaz_log(YLOG_LOGLVL, "returning NO log bit for '%s' %s", n,
             strcmp(n, name) ? name : "" );
     return 0;
 }
@@ -579,7 +579,7 @@ int yaz_log_mask_str_x(const char *str, int level)
         {
             level = atoi(str);
         }
-        else 
+        else
         {
             char clean[509];
             char *n = clean_name(str, (size_t) (p - str), clean, sizeof(clean));
index 4e92e05..185abf1 100644 (file)
@@ -187,7 +187,7 @@ static void zlog_attributes(Z_AttributesPlusTerm *t, int depth,
     int of, i;
     char str[80];
     int num_attributes = t->attributes->num_attributes;
-    
+
     for (of = 0; of < num_attributes; of++)
     {
         char attset_name_buf[OID_STR_MAX];
@@ -201,7 +201,7 @@ static void zlog_attributes(Z_AttributesPlusTerm *t, int depth,
         }
         if (!attset_name)
             attset_name = "";
-        switch (element->which) 
+        switch (element->which)
         {
         case Z_AttributeValue_numeric:
             attrStr(*element->attributeType,
@@ -270,7 +270,7 @@ char *yaz_prox_unit_name(Z_ProximityOperator *op)
     }
 }
 
-static void zlog_structure(Z_RPNStructure *zs, int depth, 
+static void zlog_structure(Z_RPNStructure *zs, int depth,
                            const Odr_oid *ast, int loglevel)
 {
     if (zs->which == Z_RPNStructure_complex)
@@ -288,7 +288,7 @@ static void zlog_structure(Z_RPNStructure *zs, int depth,
                      " order=%s "
                      "rel=%s unit=%s",
                      depth, "", op->u.prox->exclusion ?
-                     (*op->u.prox->exclusion ? "T" : "F") : "N", 
+                     (*op->u.prox->exclusion ? "T" : "F") : "N",
                      *op->u.prox->distance,
                      *op->u.prox->ordered ? "T" : "F",
                      relToStr(*op->u.prox->relationType),
@@ -300,7 +300,7 @@ static void zlog_structure(Z_RPNStructure *zs, int depth,
         }
         zlog_structure(zs->u.complex->s1, depth+2, ast, loglevel);
         zlog_structure(zs->u.complex->s2, depth+2, ast, loglevel);
-    } 
+    }
     else if (zs->which == Z_RPNStructure_simple)
     {
         if (zs->u.simple->which == Z_Operand_APT)
@@ -353,13 +353,13 @@ void log_rpn_query(Z_RPNQuery *rpn)
     log_rpn_query_level(YLOG_LOG, rpn);
 }
 
-void log_scan_term_level(int loglevel, 
+void log_scan_term_level(int loglevel,
                          Z_AttributesPlusTerm *zapt, const Odr_oid *ast)
 {
     int depth = 0;
     if (!loglevel)
         return;
-    if (zapt->term->which == Z_Term_general) 
+    if (zapt->term->which == Z_Term_general)
     {
         yaz_log(loglevel, "%*.0s term '%.*s' (general)", depth, "",
                  zapt->term->u.general->len, zapt->term->u.general->buf);
@@ -377,7 +377,7 @@ void log_scan_term(Z_AttributesPlusTerm *zapt, const Odr_oid *ast)
 void yaz_log_zquery_level(int loglevel, Z_Query *q)
 {
     if (!loglevel)
-        return; 
+        return;
     switch (q->which)
     {
     case Z_Query_type_1: case Z_Query_type_101:
index 193fc5c..00fedbb 100644 (file)
@@ -95,7 +95,7 @@ int yaz_marc_read_iso2709(yaz_marc_t mt, const char *buf, int bsize)
         {
             WRBUF hex = wrbuf_alloc();
             /* Not all digits, so stop directory scan */
-            wrbuf_write_escaped(hex, buf + entry_p, 
+            wrbuf_write_escaped(hex, buf + entry_p,
                                 length_data_entry + length_starting + 3);
             yaz_marc_cprintf(mt, "Directory offset %d: Bad value for data"
                              " length and/or length starting (%s)", entry_p,
@@ -135,7 +135,7 @@ int yaz_marc_read_iso2709(yaz_marc_t mt, const char *buf, int bsize)
 
         if (data_length <= 0 || data_offset < 0)
             break;
-        
+
         if (yaz_marc_get_debug(mt))
         {
             yaz_marc_cprintf(mt, "Tag: %s. Directory offset %d: data-length %d,"
@@ -148,7 +148,7 @@ int yaz_marc_read_iso2709(yaz_marc_t mt, const char *buf, int bsize)
                              entry_p0, end_offset, record_length);
             break;
         }
-        
+
         if (memcmp (tag, "00", 2))
             identifier_flag = 1;  /* if not 00X assume subfields */
         else if (indicator_length < 4 && indicator_length > 0)
@@ -200,7 +200,7 @@ int yaz_marc_read_iso2709(yaz_marc_t mt, const char *buf, int bsize)
         {
             /* controlfield */
             int i0 = i;
-            while (i < end_offset && 
+            while (i < end_offset &&
                 buf[i] != ISO2709_RS && buf[i] != ISO2709_FS)
                 i++;
             yaz_marc_add_controlfield(mt, tag, buf+i0, i-i0);
index 8dcf9c6..ff5f38e 100644 (file)
@@ -91,7 +91,7 @@ static int yaz_marc_line_gets(int (*getbyte)(void *client_data),
     return 1;
 }
 
-    
+
 int yaz_marc_read_line(yaz_marc_t mt,
                        int (*getbyte)(void *client_data),
                        void (*ungetbyte)(int b, void *client_data),
@@ -195,7 +195,7 @@ int yaz_marc_read_line(yaz_marc_t mt,
                 {
                     const char *next;
                     size_t len;
-                    
+
                     assert(cp[0] == marker_ch);
                     cp++;
                     next = cp;
index 2f6baff..e121aa0 100644 (file)
@@ -59,7 +59,7 @@ int yaz_marc_read_xml_subfields(yaz_marc_t mt, const xmlNode *ptr)
                 }
                 if (ptr_code->type == XML_TEXT_NODE)
                 {
-                    ctrl_data_len = 
+                    ctrl_data_len =
                         strlen((const char *)ptr_code->content);
                 }
                 else
@@ -276,7 +276,7 @@ static int yaz_marc_read_xml_fields(yaz_marc_t mt, const xmlNode *ptr)
                 /* note that indstr[0] is unused so we use indstr[1..] */
                 yaz_marc_add_datafield_xml(mt, ptr_tag,
                                            indstr+1, strlen(indstr+1));
-                
+
                 if (yaz_marc_read_xml_subfields(mt, ptr->children))
                     return -1;
             }
@@ -365,7 +365,7 @@ int yaz_marc_read_xml(yaz_marc_t mt, const xmlNode *ptr)
 {
     int format = 0;
     yaz_marc_reset(mt);
-    
+
     for(; ptr; ptr = ptr->next)
         if (ptr->type == XML_ELEMENT_NODE)
         {
@@ -396,7 +396,7 @@ int yaz_marc_read_xml(yaz_marc_t mt, const xmlNode *ptr)
     ptr = ptr->children;
     if (yaz_marc_read_xml_leader(mt, &ptr))
         return -1;
-    
+
     switch (format)
     {
     case YAZ_MARC_MARCXML:
index da48198..a64bbd6 100644 (file)
@@ -36,10 +36,10 @@ enum yaz_collection_state {
     collection_first,
     collection_second
 };
-   
+
 /** \brief node types for yaz_marc_node */
 enum YAZ_MARC_NODE_TYPE
-{ 
+{
     YAZ_MARC_DATAFIELD,
     YAZ_MARC_CONTROLFIELD,
     YAZ_MARC_COMMENT,
@@ -141,7 +141,7 @@ static int marc_exec_leader(const char *leader_spec, char *leader,
                             size_t size);
 #if YAZ_HAVE_XML2
 static int yaz_marc_write_xml_turbo_xml(yaz_marc_t mt, xmlNode **root_ptr,
-                                        const char *ns, 
+                                        const char *ns,
                                         const char *format,
                                         const char *type);
 #endif
@@ -245,7 +245,7 @@ void yaz_marc_add_datafield(yaz_marc_t mt, const char *tag,
 }
 
 /** \brief adds a attribute value to the element name if it is plain chars
-    
+
     If not, and if the attribute name is not null, it will append a
     attribute element with the value if attribute name is null it will
     return a non-zero value meaning it couldnt handle the value.
@@ -347,7 +347,7 @@ static void check_ascii(yaz_marc_t mt, char *leader, int offset,
 {
     if (leader[offset] < ' ' || leader[offset] > 127)
     {
-        yaz_marc_cprintf(mt, 
+        yaz_marc_cprintf(mt,
                          "Leader character at offset %d is non-ASCII. "
                          "Setting value to '%c'", offset, ch_default);
         leader[offset] = ch_default;
@@ -373,7 +373,7 @@ void yaz_marc_set_leader(yaz_marc_t mt, const char *leader_c,
     check_ascii(mt, leader, 9, '#');
     if (!atoi_n_check(leader+10, 1, indicator_length))
     {
-        yaz_marc_cprintf(mt, 
+        yaz_marc_cprintf(mt,
                          "Indicator length at offset 10 should hold a digit."
                          " Assuming 2");
         leader[10] = '2';
@@ -381,7 +381,7 @@ void yaz_marc_set_leader(yaz_marc_t mt, const char *leader_c,
     }
     if (!atoi_n_check(leader+11, 1, identifier_length))
     {
-        yaz_marc_cprintf(mt, 
+        yaz_marc_cprintf(mt,
                          "Identifier length at offset 11 should hold a digit."
                          " Assuming 2");
         leader[11] = '2';
@@ -389,7 +389,7 @@ void yaz_marc_set_leader(yaz_marc_t mt, const char *leader_c,
     }
     if (!atoi_n_check(leader+12, 5, base_address))
     {
-        yaz_marc_cprintf(mt, 
+        yaz_marc_cprintf(mt,
                          "Base address at offsets 12..16 should hold a number."
                          " Assuming 0");
         *base_address = 0;
@@ -399,7 +399,7 @@ void yaz_marc_set_leader(yaz_marc_t mt, const char *leader_c,
     check_ascii(mt, leader, 19, '#');
     if (!atoi_n_check(leader+20, 1, length_data_entry))
     {
-        yaz_marc_cprintf(mt, 
+        yaz_marc_cprintf(mt,
                          "Length data entry at offset 20 should hold a digit."
                          " Assuming 4");
         *length_data_entry = 4;
@@ -415,7 +415,7 @@ void yaz_marc_set_leader(yaz_marc_t mt, const char *leader_c,
     }
     if (!atoi_n_check(leader+22, 1, length_implementation))
     {
-        yaz_marc_cprintf(mt, 
+        yaz_marc_cprintf(mt,
                          "Length implementation at offset 22 should hold a digit."
                          " Assuming 0");
         *length_implementation = 0;
@@ -470,7 +470,7 @@ static size_t cdata_one_character(yaz_marc_t mt, const char *buf)
     }
     return 1; /* we don't know */
 }
-                              
+
 void yaz_marc_reset(yaz_marc_t mt)
 {
     nmem_reset(mt->nmem);
@@ -491,7 +491,7 @@ int yaz_marc_write_check(yaz_marc_t mt, WRBUF wr)
             leader = n->u.leader;
             break;
         }
-    
+
     if (!leader)
         return -1;
     if (!atoi_n_check(leader+11, 1, &identifier_length))
@@ -502,7 +502,7 @@ int yaz_marc_write_check(yaz_marc_t mt, WRBUF wr)
         switch(n->which)
         {
         case YAZ_MARC_COMMENT:
-            wrbuf_iconv_write(wr, mt->iconv_cd, 
+            wrbuf_iconv_write(wr, mt->iconv_cd,
                               n->u.comment, strlen(n->u.comment));
             wrbuf_puts(wr, "\n");
             break;
@@ -537,7 +537,7 @@ int yaz_marc_write_line(yaz_marc_t mt, WRBUF wr)
             leader = n->u.leader;
             break;
         }
-    
+
     if (!leader)
         return -1;
     if (!atoi_n_check(leader+11, 1, &identifier_length))
@@ -555,12 +555,12 @@ int yaz_marc_write_line(yaz_marc_t mt, WRBUF wr)
             {
                 size_t using_code_len = get_subfield_len(mt, s->code_data,
                                                          identifier_length);
-                
-                wrbuf_puts (wr, mt->subfield_str); 
-                wrbuf_iconv_write(wr, mt->iconv_cd, s->code_data, 
+
+                wrbuf_puts (wr, mt->subfield_str);
+                wrbuf_iconv_write(wr, mt->iconv_cd, s->code_data,
                                   using_code_len);
                 wrbuf_iconv_puts(wr, mt->iconv_cd, " ");
-                wrbuf_iconv_puts(wr, mt->iconv_cd, 
+                wrbuf_iconv_puts(wr, mt->iconv_cd,
                                  s->code_data + using_code_len);
                 marc_iconv_reset(mt, wr);
             }
@@ -575,7 +575,7 @@ int yaz_marc_write_line(yaz_marc_t mt, WRBUF wr)
             break;
         case YAZ_MARC_COMMENT:
             wrbuf_puts(wr, "(");
-            wrbuf_iconv_write(wr, mt->iconv_cd, 
+            wrbuf_iconv_write(wr, mt->iconv_cd,
                               n->u.comment, strlen(n->u.comment));
             marc_iconv_reset(mt, wr);
             wrbuf_puts(wr, ")\n");
@@ -649,7 +649,7 @@ static const char *subfield_name[2]         = { "subfield", "s"};
     \retval -1 failure
 */
 static int yaz_marc_write_marcxml_wrbuf(yaz_marc_t mt, WRBUF wr,
-                                        const char *ns, 
+                                        const char *ns,
                                         const char *format,
                                         const char *type,
                                         int turbo)
@@ -664,12 +664,12 @@ static int yaz_marc_write_marcxml_wrbuf(yaz_marc_t mt, WRBUF wr,
             leader = n->u.leader;
             break;
         }
-    
+
     if (!leader)
         return -1;
     if (!atoi_n_check(leader+11, 1, &identifier_length))
         return -1;
-    
+
     if (mt->enable_collection != no_collection)
     {
         if (mt->enable_collection == collection_first)
@@ -726,7 +726,7 @@ static int yaz_marc_write_marcxml_wrbuf(yaz_marc_t mt, WRBUF wr,
                     wrbuf_iconv_write_cdata(wr, mt->iconv_cd,
                                             s->code_data, using_code_len);
                     wrbuf_iconv_puts(wr, mt->iconv_cd, "\">");
-                } 
+                }
                 else
                 {
                     element_name_append_attribute_value(mt, wr, "code", s->code_data, using_code_len);
@@ -793,7 +793,7 @@ static int yaz_marc_write_marcxml_wrbuf(yaz_marc_t mt, WRBUF wr,
 }
 
 static int yaz_marc_write_marcxml_ns(yaz_marc_t mt, WRBUF wr,
-                                     const char *ns, 
+                                     const char *ns,
                                      const char *format,
                                      const char *type,
                                      int turbo)
@@ -886,7 +886,7 @@ void add_marc_datafield_turbo_xml(yaz_marc_t mt, struct yaz_marc_node *n,
         {
             char ind_str[6];
             char ind_val[2];
-            
+
             ind_val[0] = n->u.datafield.indicator[i];
             ind_val[1] = '\0';
             sprintf(ind_str, "%s%d", indicator_name[1], i+1);
@@ -902,7 +902,7 @@ void add_marc_datafield_turbo_xml(yaz_marc_t mt, struct yaz_marc_node *n,
         wrbuf_rewind(wr_cdata);
         wrbuf_iconv_puts(wr_cdata, mt->iconv_cd, s->code_data + using_code_len);
         marc_iconv_reset(mt, wr_cdata);
-        
+
         wrbuf_rewind(subfield_name);
         wrbuf_puts(subfield_name, "s");
         not_written = element_name_append_attribute_value(mt, subfield_name, 0, s->code_data, using_code_len) != 0;
@@ -921,7 +921,7 @@ void add_marc_datafield_turbo_xml(yaz_marc_t mt, struct yaz_marc_node *n,
 }
 
 static int yaz_marc_write_xml_turbo_xml(yaz_marc_t mt, xmlNode **root_ptr,
-                                        const char *ns, 
+                                        const char *ns,
                                         const char *format,
                                         const char *type)
 {
@@ -938,7 +938,7 @@ static int yaz_marc_write_xml_turbo_xml(yaz_marc_t mt, xmlNode **root_ptr,
             leader = n->u.leader;
             break;
         }
-    
+
     if (!leader)
         return -1;
     if (!atoi_n_check(leader+11, 1, &identifier_length))
@@ -963,7 +963,7 @@ static int yaz_marc_write_xml_turbo_xml(yaz_marc_t mt, xmlNode **root_ptr,
         char field[10];
         field[0] = 'c';
         field[4] = '\0';
-            
+
         switch(n->which)
         {
         case YAZ_MARC_DATAFIELD:
@@ -973,7 +973,7 @@ static int yaz_marc_write_xml_turbo_xml(yaz_marc_t mt, xmlNode **root_ptr,
             wrbuf_rewind(wr_cdata);
             wrbuf_iconv_puts(wr_cdata, mt->iconv_cd, n->u.controlfield.data);
             marc_iconv_reset(mt, wr_cdata);
-            
+
             strncpy(field + 1, n->u.controlfield.tag, 3);
             ptr = xmlNewTextChild(record_ptr, ns_record,
                                   BAD_CAST field,
@@ -995,7 +995,7 @@ static int yaz_marc_write_xml_turbo_xml(yaz_marc_t mt, xmlNode **root_ptr,
 
 
 int yaz_marc_write_xml(yaz_marc_t mt, xmlNode **root_ptr,
-                       const char *ns, 
+                       const char *ns,
                        const char *format,
                        const char *type)
 {
@@ -1012,7 +1012,7 @@ int yaz_marc_write_xml(yaz_marc_t mt, xmlNode **root_ptr,
             leader = n->u.leader;
             break;
         }
-    
+
     if (!leader)
         return -1;
     if (!atoi_n_check(leader+11, 1, &identifier_length))
@@ -1078,11 +1078,11 @@ int yaz_marc_write_xml(yaz_marc_t mt, xmlNode **root_ptr,
             wrbuf_rewind(wr_cdata);
             wrbuf_iconv_puts(wr_cdata, mt->iconv_cd, n->u.controlfield.data);
             marc_iconv_reset(mt, wr_cdata);
-            
+
             ptr = xmlNewTextChild(record_ptr, ns_record,
                                   BAD_CAST "controlfield",
                                   BAD_CAST wrbuf_cstr(wr_cdata));
-            
+
             xmlNewProp(ptr, BAD_CAST "tag", BAD_CAST n->u.controlfield.tag);
             break;
         case YAZ_MARC_COMMENT:
@@ -1113,11 +1113,11 @@ int yaz_marc_write_iso2709(yaz_marc_t mt, WRBUF wr)
     const char *leader = 0;
     WRBUF wr_dir, wr_head, wr_data_tmp;
     int base_address;
-    
+
     for (n = mt->nodes; n; n = n->next)
         if (n->which == YAZ_MARC_LEADER)
             leader = n->u.leader;
-    
+
     if (!leader)
         return -1;
     if (!atoi_n_check(leader+10, 1, &indicator_length))
@@ -1160,7 +1160,7 @@ int yaz_marc_write_iso2709(yaz_marc_t mt, WRBUF wr)
             wrbuf_printf(wr_dir, "%.3s", n->u.controlfield.tag);
 
             wrbuf_rewind(wr_data_tmp);
-            wrbuf_iconv_puts(wr_data_tmp, mt->iconv_cd, 
+            wrbuf_iconv_puts(wr_data_tmp, mt->iconv_cd,
                              n->u.controlfield.data);
             marc_iconv_reset(mt, wr_data_tmp);
             wrbuf_iconv_putchar(wr_data_tmp, mt->iconv_cd, ' ');/* field sep */
@@ -1195,7 +1195,7 @@ int yaz_marc_write_iso2709(yaz_marc_t mt, WRBUF wr)
     wrbuf_printf(wr_head, "%05d", base_address);
     /* from "original" leader */
     wrbuf_write(wr_head, leader+17, 7);
-    
+
     wrbuf_write(wr, wrbuf_buf(wr_head), 24);
     wrbuf_write(wr, wrbuf_buf(wr_dir), wrbuf_len(wr_dir));
     wrbuf_destroy(wr_head);
@@ -1326,7 +1326,7 @@ static int marc_exec_leader(const char *leader_spec, char *leader, size_t size)
         {
             const char *vp = strchr(val+1, '\'');
             size_t len;
-            
+
             if (!vp)
                 return -1;
             len = vp-val-1;
@@ -1352,7 +1352,7 @@ static int marc_exec_leader(const char *leader_spec, char *leader, size_t size)
 
 int yaz_marc_decode_formatstr(const char *arg)
 {
-    int mode = -1; 
+    int mode = -1;
     if (!strcmp(arg, "marc"))
         mode = YAZ_MARC_ISO2709;
     if (!strcmp(arg, "marcxml"))
index 2fa028a..cf71f56 100644 (file)
@@ -24,7 +24,7 @@ int yaz_match_glob(const char *glob, const char *text)
         return *text == '\0';
     if (glob[0] == '*')
     {
-        do 
+        do
         {
             if (yaz_match_glob(glob+1, text))
                 return 1;
index b7deecf..990cd87 100644 (file)
@@ -74,7 +74,7 @@ void yaz_mutex_enter(YAZ_MUTEX p)
         EnterCriticalSection(&p->handle);
 #elif YAZ_POSIX_THREADS
         int r = 1; /* signal : not locked (yet) */
-        
+
         if (p->log_level)
         {   /* debugging */
             r = pthread_mutex_trylock(&p->handle);
index 6b0136c..ae327a8 100644 (file)
@@ -62,7 +62,7 @@ static int log_level = 0;
 static int log_level_initialized = 0;
 
 static void free_block(struct nmem_block *p)
-{  
+{
     xfree(p->buf);
     xfree(p);
     if (log_level)
@@ -85,7 +85,7 @@ static struct nmem_block *get_block(size_t size)
     if (log_level)
         yaz_log(log_level, "nmem get_block alloc new block size=%ld",
                 (long) get);
-    
+
     r = (struct nmem_block *) xmalloc(sizeof(*r));
     r->buf = (char *)xmalloc(r->size = get);
     r->top = 0;
@@ -95,7 +95,7 @@ static struct nmem_block *get_block(size_t size)
 void nmem_reset(NMEM n)
 {
     struct nmem_block *t;
-    
+
     yaz_log(log_level, "nmem_reset p=%p", n);
     if (!n)
         return;
@@ -145,7 +145,7 @@ NMEM nmem_create(void)
         log_level = yaz_log_module_level("nmem");
         log_level_initialized = 1;
     }
-    
+
     r = (struct nmem_control *)xmalloc(sizeof(*r));
 
     r->blocks = 0;
@@ -159,7 +159,7 @@ void nmem_destroy(NMEM n)
 {
     if (!n)
         return;
-    
+
     nmem_reset(n);
     xfree(n);
 }
index 49c7753..18a29f8 100644 (file)
--- a/src/odr.c
+++ b/src/odr.c
@@ -64,7 +64,7 @@ void odr_perror(ODR o, const char *message)
     fprintf(stderr, "%s: %s (code %d:%d)", message, odr_errlist[err], err, x);
     if (e && *e)
         fprintf(stderr, " element %s", e);
-    
+
     fprintf(stderr, "\n");
     if (element_path)
     {
@@ -177,7 +177,7 @@ void odr_setprint(ODR o, FILE *file)
 
 
 void odr_set_stream(ODR o, void *handle,
-                    void (*stream_write)(ODR o, 
+                    void (*stream_write)(ODR o,
                                          void *handle, int type,
                                          const char *buf, int len),
                     void (*stream_close)(void *handle))
@@ -254,7 +254,7 @@ void odr_reset(ODR o)
         yaz_iconv(o->op->iconv_handle, 0, 0, 0, 0);
     yaz_log(log_level, "odr_reset o=%p", o);
 }
-    
+
 void odr_destroy(ODR o)
 {
     nmem_destroy(o->mem);
index 54dabb0..94bfc1b 100644 (file)
@@ -60,7 +60,7 @@ int odr_bitstring(ODR o, Odr_bitmask **p, int opt, const char *name)
         (*p)->top = -1;
     }
 #if 0
-    /* ignoring the cons helps with at least one target. 
+    /* ignoring the cons helps with at least one target.
      * http://bugzilla.indexdata.dk/cgi-bin/bugzilla/show_bug.cgi?id=24
      */
     return ber_bitstring(o, *p, 0);
index 21fe3d2..fec7177 100644 (file)
@@ -141,9 +141,9 @@ int odr_iconv_string(ODR o, char **p, int opt, const char *name)
             size_t outleft = 4 * inleft + 2;
             char *outbuf = (char *) odr_malloc (o, outleft);
             size_t ret;
-            
+
             t->buf = (unsigned char *) outbuf;
-            
+
             ret = yaz_iconv(o->op->iconv_handle, &inbuf, &inleft,
                             &outbuf, &outleft);
             if (ret == (size_t)(-1))
@@ -188,7 +188,7 @@ int odr_iconv_string(ODR o, char **p, int opt, const char *name)
             size_t ret;
 
             *p = outbuf;
-            
+
             ret = yaz_iconv (o->op->iconv_handle, &inbuf, &inleft,
                              &outbuf, &outleft);
             if (ret == (size_t)(-1))
@@ -204,7 +204,7 @@ int odr_iconv_string(ODR o, char **p, int opt, const char *name)
                 return 0;
             }
             inleft = outbuf - (char*) *p;
-            
+
             (*p)[inleft] = '\0';    /* null terminate it */
         }
         if (!*p)
index b21c87b..6742be3 100644 (file)
@@ -60,12 +60,12 @@ int odr_set_begin(ODR o, void *p, int size, const char *name)
 
 int odr_sequence_end(ODR o)
 {
-    return odr_constructed_end(o);    
+    return odr_constructed_end(o);
 }
 
 int odr_set_end(ODR o)
 {
-    return odr_constructed_end(o);    
+    return odr_constructed_end(o);
 }
 
 static int odr_sequence_more(ODR o)
index f435563..0c652c1 100644 (file)
@@ -17,7 +17,7 @@ int odr_external(ODR o, Odr_external **p, int opt, const char *name)
     Odr_external *pp;
     static Odr_arm arm[] =
     {
-        {ODR_EXPLICIT, ODR_CONTEXT, 0, ODR_EXTERNAL_single, 
+        {ODR_EXPLICIT, ODR_CONTEXT, 0, ODR_EXTERNAL_single,
          (Odr_fun)odr_any, "single"},
         {ODR_IMPLICIT, ODR_CONTEXT, 1, ODR_EXTERNAL_octet,
          (Odr_fun)odr_octetstring, "octet"},
@@ -42,7 +42,7 @@ int odr_visiblestring(ODR o, char **p, int opt, const char *name)
 {
     return odr_implicit_tag(o, odr_cstring, p, ODR_UNIVERSAL,
                             ODR_VISIBLESTRING, opt, name);
-}    
+}
 
 /*
  * a char may not be sufficient to hold a general string, but we'll deal
@@ -52,13 +52,13 @@ int odr_generalstring(ODR o, char **p, int opt, const char *name)
 {
     return odr_implicit_tag(o, odr_iconv_string, p, ODR_UNIVERSAL,
                             ODR_GENERALSTRING,opt, name);
-}    
+}
 
 int odr_graphicstring(ODR o, char **p, int opt, const char *name)
 {
     return odr_implicit_tag(o, odr_cstring, p, ODR_UNIVERSAL,
                         ODR_GRAPHICSTRING, opt, name);
-}    
+}
 
 int odr_generalizedtime(ODR o, char **p, int opt, const char *name)
 {
index 644c3c3..17d1582 100644 (file)
@@ -20,7 +20,7 @@ void odr_prname(ODR o, const char *name)
     if (o->op->indent < 16)
         odr_printf(o, "%*s", o->op->indent * 2, "");
     else
-        odr_printf(o, "level=%-7d%*s", o->op->indent, 
+        odr_printf(o, "level=%-7d%*s", o->op->indent,
                    2 * (o->op->indent % 8) , "");
     if (name)
         odr_printf(o, "%s ", name);
index 2ae42f2..7713cc8 100644 (file)
@@ -119,7 +119,7 @@ char *oid_name_to_dotstring(oid_class oclass, const char *name, char *oid_buf)
 int yaz_oid_is_iso2709(const Odr_oid *oid)
 {
     if (oid_oidlen(oid) == 6 && oid[0] == 1 && oid[1] == 2
-       && oid[2] == 840 && oid[3] == 10003 && oid[4] == 5 
+       && oid[2] == 840 && oid[3] == 10003 && oid[4] == 5
        && oid[5] <= 29 && oid[5] != 16)
        return 1;
     return 0;
@@ -194,7 +194,7 @@ void yaz_oid_trav(yaz_oid_db_t oid_db,
     for (; oid_db; oid_db = oid_db->next)
     {
        struct yaz_oid_entry *e = get_entries(oid_db);
-       
+
        for (; e->name; e++)
            func(e->oid, e->oclass, e->name, client_data);
     }
index b54d040..7623f4f 100644 (file)
@@ -62,7 +62,7 @@ char *oid_oid_to_dotstring(const Odr_oid *oid, char *oidbuf)
     int i;
 
     oidbuf[0] = '\0';
-    for (i = 0; oid[i] != -1 && i < OID_SIZE; i++) 
+    for (i = 0; oid[i] != -1 && i < OID_SIZE; i++)
     {
         yaz_snprintf(tmpbuf, sizeof(tmpbuf)-1, "%d", oid[i]);
         if (i > 0)
index 7af28f1..1a3adf4 100644 (file)
@@ -29,7 +29,7 @@ static void opac_element_str(WRBUF wrbuf, yaz_iconv_t cd1, yaz_iconv_t cd2,
         wrbuf_puts(wrbuf, "<");
         wrbuf_puts(wrbuf, elem);
         wrbuf_puts(wrbuf, ">");
-        
+
         pos = wrbuf->pos; /* save position */
         if (wrbuf_iconv_write_x(wrbuf, cd1, data, strlen(data), 1) && cd2)
         {
@@ -68,7 +68,7 @@ void yaz_opac_decode_wrbuf2(yaz_marc_t mt, Z_OPACRecord *r, WRBUF wrbuf,
     if (r->bibliographicRecord)
     {
         Z_External *ext = r->bibliographicRecord;
-        
+
         wrbuf_puts(wrbuf, "  <bibliographicRecord>\n");
         if (ext->which == Z_External_octet)
             yaz_marc_decode_wrbuf(mt, (const char *) ext->u.octet_aligned->buf,
@@ -96,9 +96,9 @@ void yaz_opac_decode_wrbuf2(yaz_marc_t mt, Z_OPACRecord *r, WRBUF wrbuf,
         else if (h->which == Z_HoldingsRecord_holdingsAndCirc)
         {
             int j;
-            
+
             Z_HoldingsAndCircData *d = h->u.holdingsAndCirc;
-        
+
             opac_element_str(wrbuf, cd1, cd2, 2, "typeOfRecord",
                              d->typeOfRecord);
             opac_element_str(wrbuf, cd1, cd2, 2, "encodingLevel",
index 8bf7945..10be151 100644 (file)
@@ -23,7 +23,7 @@ int options(const char *desc, char **argv, int argc, char **arg)
     const char *opt_buf = 0;
     size_t i = 0;
     int ch = 0;
-    
+
     if (arg_no >= argc)
         return YAZ_OPTIONS_EOF;
     if (arg_off == 0)
@@ -81,7 +81,7 @@ int options(const char *desc, char **argv, int argc, char **arg)
             type = desc[i++];
         }
         if (desc_char == ch)
-        { 
+        {
             if (type) /* option with argument */
             {
                 if (argv[arg_no][arg_off])
@@ -109,7 +109,7 @@ int options(const char *desc, char **argv, int argc, char **arg)
                 }
             }
             return ch;
-        }               
+        }
     }
     *arg = argv[arg_no]+arg_off-1;
     arg_no = arg_no + 1;
index 37daa7b..8068bc6 100644 (file)
@@ -134,7 +134,7 @@ Z_OtherInformationUnit *yaz_oi_update(
         for (i = 0; i<otherInformation->num_elements; i++)
             newlist[i] = otherInformation->list[i];
         otherInformation->list = newlist;
-        
+
         otherInformation->list[i] = (Z_OtherInformationUnit*)
             odr_malloc (odr, sizeof(Z_OtherInformationUnit));
         if (oid)
@@ -143,14 +143,14 @@ Z_OtherInformationUnit *yaz_oi_update(
                 odr_malloc (odr, sizeof(Z_InfoCategory));
             otherInformation->list[i]->category->categoryTypeId = (Odr_oid*)
                 odr_oiddup (odr, oid);
-            otherInformation->list[i]->category->categoryValue = 
+            otherInformation->list[i]->category->categoryValue =
                 odr_intdup(odr, categoryValue);
         }
         else
             otherInformation->list[i]->category = 0;
         otherInformation->list[i]->which = Z_OtherInfo_characterInfo;
         otherInformation->list[i]->information.characterInfo = 0;
-        
+
         otherInformation->num_elements = i+1;
         return otherInformation->list[i];
     }
@@ -174,7 +174,7 @@ char *yaz_oi_get_string_oid (
     const Odr_oid *oid, int categoryValue, int delete_flag)
 {
     Z_OtherInformationUnit *oi;
-    
+
     if ((oi = yaz_oi_update(otherInformation, 0, oid, categoryValue,
                             delete_flag)) &&
         oi->which == Z_OtherInfo_characterInfo)
index cbdd754..0858c95 100644 (file)
@@ -3,7 +3,7 @@
  * See the file LICENSE for details.
  */
 /**
- * \file 
+ * \file
  * \brief Select, poll wrapper
  */
 #if HAVE_CONFIG_H
@@ -81,7 +81,7 @@ int yaz_poll_select(struct yaz_poll_fd *fds, int num_fds, int sec, int nsec)
     }
     tv.tv_sec = sec;
     tv.tv_usec = nsec / 1000;
-    
+
     r = select(max_fd+1, &input, &output, &except, (sec == -1 ? 0 : &tv));
     if (r >= 0)
     {
index e2f28b4..2cc285f 100644 (file)
@@ -33,7 +33,7 @@ struct yaz_pqf_parser {
 };
 
 static Z_RPNStructure *rpn_structure(struct yaz_pqf_parser *li, ODR o,
-                                     int num_attr, int max_attr, 
+                                     int num_attr, int max_attr,
                                      Odr_int *attr_list, char **attr_clist,
                                      Odr_oid **attr_set);
 
@@ -52,7 +52,7 @@ static int compare_term(struct yaz_pqf_parser *li, const char *src,
                         size_t off)
 {
     size_t len=strlen(src);
-    
+
     if (li->lex_len == len+off && !memcmp(li->lex_buf+off, src, len-off))
         return 1;
     return 0;
@@ -75,7 +75,7 @@ static int query_token(struct yaz_pqf_parser *li)
         ++(*qptr);
     }
     li->lex_buf = *qptr;
-   
+
     if (**qptr == li->escape_char && yaz_isdigit((*qptr)[1]))
     {
         ++(li->lex_len);
@@ -166,7 +166,7 @@ int escape_string(char *out_buf, const char *in, int len)
                     char s[4];
                     int n = 0;
                     s[0] = *in;
-                    s[1] = *++in;                   
+                    s[1] = *++in;
                     s[2] = *++in;
                     s[3] = '\0';
                     len = len - 2;
@@ -212,7 +212,7 @@ int p_query_parse_attr(struct yaz_pqf_parser *li, ODR o,
             return 0;
         }
     }
-    else 
+    else
     {
         if (num_attr > 0)
             attr_set[num_attr] = attr_set[num_attr-1];
@@ -314,7 +314,7 @@ Z_Term *z_Term_create(ODR o, int term_type, const char *buf, size_t len)
     memcpy(term_octet->buf, buf, len);
     term_octet->size = term_octet->len = len;
     term_octet->buf[term_octet->size] = 0;  /* null terminate */
-    
+
     switch (term_type)
     {
     case Z_Term_general:
@@ -323,7 +323,7 @@ Z_Term *z_Term_create(ODR o, int term_type, const char *buf, size_t len)
         break;
     case Z_Term_characterString:
         term->which = Z_Term_characterString;
-        term->u.characterString = (char*) term_octet->buf; 
+        term->u.characterString = (char*) term_octet->buf;
         /* null terminated above */
         break;
     case Z_Term_numeric:
@@ -454,7 +454,7 @@ static Z_ProximityOperator *rpn_proximity(struct yaz_pqf_parser *li, ODR o)
         li->error = YAZ_PQF_ERROR_PROXIMITY;
         return NULL;
     }
-    
+
     if (!lex (li))
     {
         li->error = YAZ_PQF_ERROR_MISSING;
@@ -503,7 +503,7 @@ static Z_ProximityOperator *rpn_proximity(struct yaz_pqf_parser *li, ODR o)
 }
 
 static Z_Complex *rpn_complex(struct yaz_pqf_parser *li, ODR o,
-                              int num_attr, int max_attr, 
+                              int num_attr, int max_attr,
                               Odr_int *attr_list, char **attr_clist,
                               Odr_oid **attr_set)
 {
@@ -577,9 +577,9 @@ static void rpn_term_type(struct yaz_pqf_parser *li)
 #endif
     lex(li);
 }
-                           
+
 static Z_RPNStructure *rpn_structure(struct yaz_pqf_parser *li, ODR o,
-                                     int num_attr, int max_attr, 
+                                     int num_attr, int max_attr,
                                      Odr_int *attr_list,
                                      char **attr_clist,
                                      Odr_oid **attr_set)
@@ -863,7 +863,7 @@ static Z_FacetField* parse_facet(ODR odr, const char *facet)
                 facet_field->terms[facet_field->num_terms] =
                     (Z_FacetTerm *) odr_malloc(odr, sizeof(Z_FacetTerm));
                 facet_field->terms[facet_field->num_terms]->term = term;
-                facet_field->terms[facet_field->num_terms]->count = 
+                facet_field->terms[facet_field->num_terms]->count =
                     odr_intdup(odr, 0);
                 facet_field->num_terms++;
             }
index fc4906c..0c130af 100644 (file)
@@ -22,7 +22,7 @@
 /*
  * The table below should be moved to the ODR structure itself and
  * be an image of the association context: To help
- * map indirect references when they show up. 
+ * map indirect references when they show up.
  */
 static Z_ext_typeent type_table[] =
 {
@@ -85,7 +85,7 @@ Z_ext_typeent *z_ext_getentbyref(const Odr_oid *oid)
     encoding              CHOICE {
       single-ASN1-type   [0] ABSTRACT_SYNTAX.&Type,
       octet-aligned      [1] IMPLICIT OCTET STRING,
-      arbitrary          [2] IMPLICIT BIT STRING 
+      arbitrary          [2] IMPLICIT BIT STRING
       }
     }
   </pre>
@@ -227,7 +227,7 @@ int z_External(ODR o, Z_External **p, int opt, const char *name)
                 return 0;
 
             /* Save our decoding ODR members */
-            o_bp = o->bp; 
+            o_bp = o->bp;
             o_buf = o->buf;
             o_size = o->size;
 
@@ -239,16 +239,16 @@ int z_External(ODR o, Z_External **p, int opt, const char *name)
             r = (*type->fun)(o, &voidp, 0, 0);
             (*p)->which = type->what;
             (*p)->u.single_ASN1_type = (Odr_any*) voidp;
-                
+
             /* Restore our decoding ODR member */
-            o->bp = o_bp; 
+            o->bp = o_bp;
             o->buf = o_buf;
             o->size = o_size;
 
             return r && odr_sequence_end(o);
         }
         if (zclass == ODR_CONTEXT && tag == 0 && cons == 1)
-        { 
+        {
             /* It's single ASN.1 type, bias the CHOICE. */
             odr_choice_bias(o, type->what);
         }
@@ -311,7 +311,7 @@ Z_External *z_ext_record_oid(ODR o, const Odr_oid *oid, const char *buf, int len
     else if (!oid_oidcmp(oid, yaz_oid_recsyn_sutrs))
     {    /* SUTRS is a single-ASN.1-type */
         Odr_oct *sutrs = (Odr_oct *)odr_malloc(o, sizeof(*sutrs));
-        
+
         thisext->which = Z_External_sutrs;
         thisext->u.sutrs = sutrs;
         sutrs->buf = (unsigned char *)odr_malloc(o, len);
index eb1eab5..21f8e97 100644 (file)
@@ -56,7 +56,7 @@ static void yaz_attribute_element_to_wrbuf(WRBUF b,
     if (element->attributeSet)
     {
         char oid_name_str[OID_STR_MAX];
-        const char *setname = yaz_oid_to_string_buf(element->attributeSet, 
+        const char *setname = yaz_oid_to_string_buf(element->attributeSet,
                                                     0, oid_name_str);
         if (setname)
         {
@@ -65,7 +65,7 @@ static void yaz_attribute_element_to_wrbuf(WRBUF b,
         }
     }
     wrbuf_printf(b, ODR_INT_PRINTF "=", *element->attributeType);
-    switch (element->which) 
+    switch (element->which)
     {
     case Z_AttributeValue_numeric:
         wrbuf_printf(b, ODR_INT_PRINTF, *element->value.numeric);
@@ -80,7 +80,7 @@ static void yaz_attribute_element_to_wrbuf(WRBUF b,
                 wrbuf_puts(b, element->value.complex->list[i]->u.string);
             else if (element->value.complex->list[i]->which ==
                      Z_StringOrNumeric_numeric)
-                wrbuf_printf(b, ODR_INT_PRINTF, 
+                wrbuf_printf(b, ODR_INT_PRINTF,
                              *element->value.complex->list[i]->u.numeric);
         }
         break;
@@ -113,7 +113,7 @@ static void yaz_apt_to_wrbuf(WRBUF b, const Z_AttributesPlusTerm *zapt)
     int i;
     for (i = 0; i < num_attributes; i++)
         yaz_attribute_element_to_wrbuf(b,zapt->attributes->attributes[i]);
-    
+
     switch (zapt->term->which)
     {
     case Z_Term_general:
@@ -152,7 +152,7 @@ static void yaz_rpnstructure_to_wrbuf(WRBUF b, const Z_RPNStructure *zs)
             else
                 wrbuf_putc(b, '0');
 
-            wrbuf_printf(b, " " ODR_INT_PRINTF " %d " 
+            wrbuf_printf(b, " " ODR_INT_PRINTF " %d "
                          ODR_INT_PRINTF " ", *op->u.prox->distance,
                          *op->u.prox->ordered,
                          *op->u.prox->relationType);
@@ -202,7 +202,7 @@ void yaz_rpnquery_to_wrbuf(WRBUF b, const Z_RPNQuery *rpn)
                                                      0, oid_name_str);
         if (oid_name)
             wrbuf_printf(b, "@attrset %s ", oid_name);
-    } 
+    }
     yaz_rpnstructure_to_wrbuf(b, rpn->RPNStructure);
     wrbuf_chop_right(b);
 }
@@ -213,7 +213,7 @@ void yaz_query_to_wrbuf(WRBUF b, const Z_Query *q)
     assert(b);
     switch (q->which)
     {
-    case Z_Query_type_1: 
+    case Z_Query_type_1:
     case Z_Query_type_101:
         wrbuf_puts(b,"RPN ");
         yaz_rpnquery_to_wrbuf(b, q->u.type_1);
index b293ff6..d2430e5 100644 (file)
@@ -24,7 +24,7 @@ int readconf_line(FILE *f, int *lineno, char *line, int len,
 {
     char *p;
     int argc;
-    
+
     while ((p = fgets(line, len, f)))
     {
         (*lineno)++;
@@ -35,7 +35,7 @@ int readconf_line(FILE *f, int *lineno, char *line, int len,
     }
     if (!p)
         return 0;
-    
+
     for (argc = 0; *p && argc < num ; argc++)
     {
         if (*p == '#')  /* trailing comment */
@@ -63,7 +63,7 @@ int readconf(char *name, void *rprivate,
     char line[512], *m_argv[50];
     int m_argc;
     int lineno = 0;
-    
+
     if (!(f = fopen(name, "r")))
     {
         yaz_log(YLOG_WARN|YLOG_ERRNO, "readconf: %s", name);
@@ -72,7 +72,7 @@ int readconf(char *name, void *rprivate,
     for (;;)
     {
         int res;
-        
+
         if (!(m_argc = readconf_line(f, &lineno, line, 512, m_argv, 50)))
         {
             fclose(f);
index 1809724..96ded54 100644 (file)
@@ -207,7 +207,7 @@ static void *construct_xslt(const xmlNode *ptr,
                          stylesheet, stylesheet);
             if (path)
                 wrbuf_printf(wr_error, " with path '%s'", path);
-                
+
             return 0;
         }
         info->xsp_doc = xmlParseFile(fullpath);
@@ -230,7 +230,7 @@ static void *construct_xslt(const xmlNode *ptr,
                 wrbuf_printf(wr_error, " with path '%s'", path);
             wrbuf_printf(wr_error, " ("
 #if YAZ_HAVE_EXSLT
-                         
+
                          "EXSLT enabled"
 #else
                          "EXSLT not supported"
@@ -270,7 +270,7 @@ static int convert_xslt(void *vinfo, WRBUF record, WRBUF wr_error)
         {
             xmlChar *out_buf = 0;
             int out_len;
-            
+
 #if HAVE_XSLTSAVERESULTTOSTRING
             xsltSaveResultToString(&out_buf, &out_len, res, xsp);
 #else
@@ -286,7 +286,7 @@ static int convert_xslt(void *vinfo, WRBUF record, WRBUF wr_error)
             {
                 wrbuf_rewind(record);
                 wrbuf_write(record, (const char *) out_buf, out_len);
-                
+
                 xmlFree(out_buf);
             }
             xmlFreeDoc(res);
@@ -361,7 +361,7 @@ static void *construct_marc(const xmlNode *ptr,
         {
             wrbuf_printf(wr_error, "Element <marc>: expected attributes"
                          "'inputformat', 'inputcharset', 'outputformat' or"
-                         " 'outputcharset', got attribute '%s'", 
+                         " 'outputcharset', got attribute '%s'",
                          attr->name);
             nmem_destroy(info->nmem);
             return 0;
@@ -382,7 +382,7 @@ static void *construct_marc(const xmlNode *ptr,
     {
         info->input_format_mode = YAZ_MARC_MARCXML;
         /** Libxml2 generates UTF-8 encoding by default .
-            So we convert from UTF-8 to outputcharset (if defined) 
+            So we convert from UTF-8 to outputcharset (if defined)
         */
         if (!info->input_charset && info->output_charset)
             info->input_charset = "utf-8";
@@ -391,15 +391,15 @@ static void *construct_marc(const xmlNode *ptr,
     {
         wrbuf_printf(wr_error, "Element <marc inputformat='%s'>: "
                      " Unsupported input format"
-                     " defined by attribute value", 
+                     " defined by attribute value",
                      input_format);
         nmem_destroy(info->nmem);
         return 0;
     }
-    
+
     if (!output_format)
     {
-        wrbuf_printf(wr_error, 
+        wrbuf_printf(wr_error,
                      "Element <marc>: attribute 'outputformat' required");
         nmem_destroy(info->nmem);
         return 0;
@@ -434,7 +434,7 @@ static void *construct_marc(const xmlNode *ptr,
     {
         wrbuf_printf(wr_error, "Element <marc outputformat='%s'>: "
                      " Unsupported output format"
-                     " defined by attribute value", 
+                     " defined by attribute value",
                      output_format);
         nmem_destroy(info->nmem);
         return 0;
@@ -445,7 +445,7 @@ static void *construct_marc(const xmlNode *ptr,
                                         info->input_charset);
         if (!cd)
         {
-            wrbuf_printf(wr_error, 
+            wrbuf_printf(wr_error,
                          "Element <marc inputcharset='%s' outputcharset='%s'>:"
                          " Unsupported character set mapping"
                          " defined by attribute values",
@@ -478,14 +478,14 @@ static int convert_marc(void *info, WRBUF record, WRBUF wr_error)
 {
     struct marc_info *mi = info;
     int ret = 0;
-    
+
     yaz_iconv_t cd = yaz_iconv_open(mi->output_charset, mi->input_charset);
     yaz_marc_t mt = yaz_marc_create();
-    
+
     yaz_marc_xml(mt, mi->output_format_mode);
     if (mi->leader_spec)
         yaz_marc_leader_spec(mt, mi->leader_spec);
-        
+
     if (cd)
         yaz_marc_iconv(mt, cd);
     if (mi->input_format_mode == YAZ_MARC_ISO2709)
@@ -536,7 +536,7 @@ static int convert_marc(void *info, WRBUF record, WRBUF wr_error)
 static void destroy_marc(void *info)
 {
     struct marc_info *mi = info;
-    
+
     nmem_destroy(mi->nmem);
 }
 
@@ -544,7 +544,7 @@ int yaz_record_conv_configure_t(yaz_record_conv_t p, const xmlNode *ptr,
                                 struct yaz_record_conv_type *types)
 {
     struct yaz_record_conv_type bt[2];
-    
+
     /* register marc */
     bt[0].construct = construct_marc;
     bt[0].convert = convert_marc;
@@ -560,7 +560,7 @@ int yaz_record_conv_configure_t(yaz_record_conv_t p, const xmlNode *ptr,
 #else
     bt[0].next = types;
 #endif
-    
+
     yaz_record_conv_reset(p);
 
     /* parsing element children */
@@ -613,7 +613,7 @@ static int yaz_record_conv_record_rule(yaz_record_conv_t p,
     int ret = 0;
     WRBUF record = output_record; /* pointer transfer */
     wrbuf_rewind(p->wr_error);
-    
+
     wrbuf_write(record, input_record_buf, input_record_len);
     for (; ret == 0 && r; r = r->next)
         ret = r->type->convert(r->info, record, p->wr_error);
@@ -636,16 +636,16 @@ int yaz_record_conv_opac_record(yaz_record_conv_t p,
         yaz_marc_t mt = yaz_marc_create();
         yaz_iconv_t cd = yaz_iconv_open(mi->output_charset,
                                         mi->input_charset);
-        
+
         wrbuf_rewind(p->wr_error);
         yaz_marc_xml(mt, mi->output_format_mode);
-        
+
         yaz_marc_iconv(mt, cd);
-        
+
         yaz_opac_decode_wrbuf(mt, input_record, res);
         if (ret != -1)
         {
-            ret = yaz_record_conv_record_rule(p, 
+            ret = yaz_record_conv_record_rule(p,
                                               r->next,
                                               wrbuf_buf(res), wrbuf_len(res),
                                               output_record);
@@ -689,8 +689,8 @@ yaz_record_conv_t yaz_record_conv_create()
     p->rules = 0;
     p->path = 0;
 #if YAZ_HAVE_EXSLT
-    exsltRegisterAll(); 
-#endif    
+    exsltRegisterAll();
+#endif
     return p;
 }
 
index 37fc9f5..7ad8b73 100644 (file)
@@ -38,10 +38,10 @@ static yaz_iconv_t iconv_create_charset(const char *record_charset,
     if (record_charset && *record_charset)
     {
         char *cp = charset_buf;
-        
+
         strncpy(charset_buf, record_charset, sizeof(charset_buf)-1);
         charset_buf[sizeof(charset_buf)-1] = '\0';
-        
+
         from_set1 = cp;
         while (*cp && *cp != ',' && *cp != '/')
             cp++;
@@ -60,7 +60,7 @@ static yaz_iconv_t iconv_create_charset(const char *record_charset,
                 cp++;
         }
     }
-    
+
     if (from_set1)
         cd = yaz_iconv_open(to_set, from_set1);
     if (cd2)
@@ -115,7 +115,7 @@ static const char *return_opac_record(WRBUF wrbuf,
         yaz_opac_decode_wrbuf2(mt, opac_rec, wrbuf, cd2);
     else
         yaz_opac_decode_wrbuf(mt, opac_rec, wrbuf);
-        
+
     yaz_marc_destroy(mt);
 
     if (cd)
@@ -195,7 +195,7 @@ static const char *return_record_wrbuf(WRBUF wrbuf, int *len,
     }
     return 0;
 }
-    
+
 static const char *get_record_format(WRBUF wrbuf, int *len,
                                      Z_NamePlusRecord *npr,
                                      int marctype, const char *charset,
@@ -220,7 +220,7 @@ static const char *get_record_format(WRBUF wrbuf, int *len,
             xmlFreeDoc(doc);
             res = wrbuf_cstr(wrbuf);
             *len = wrbuf_len(wrbuf);
-        } 
+        }
     }
 #endif
     return res;
@@ -378,7 +378,7 @@ const char *yaz_record_render(Z_NamePlusRecord *npr, const char *schema,
         }
         else if (!strncmp(cp + i, "format=", 7))
         {
-            size_t j = 0; 
+            size_t j = 0;
             i = i + 7;
             while (cp[i] == ' ')
                 i++;
@@ -388,7 +388,7 @@ const char *yaz_record_render(Z_NamePlusRecord *npr, const char *schema,
                     format[j++] = cp[i];
             }
             format[j] = '\0';
-        } 
+        }
         else if (!strncmp(cp + i, "base64=", 7))
         {
             size_t i0;
@@ -401,7 +401,7 @@ const char *yaz_record_render(Z_NamePlusRecord *npr, const char *schema,
 
             nmem = nmem_create();
             base64_xpath = nmem_strdupn(nmem, cp + i0, i - i0);
-        } 
+        }
     }
     if (!strcmp(type, "database"))
     {
@@ -415,7 +415,7 @@ const char *yaz_record_render(Z_NamePlusRecord *npr, const char *schema,
     }
     else if (!strcmp(type, "syntax"))
     {
-        const char *desc = 0;   
+        const char *desc = 0;
         if (npr->which == Z_NamePlusRecord_databaseRecord)
         {
             Z_External *r = (Z_External *) npr->u.databaseRecord;
index 26d28fd..ee1d1ff 100644 (file)
@@ -147,7 +147,7 @@ static int conf_retrieval(yaz_retrieval_t p, const xmlNode *ptr,
                 nmem_strdup(p->nmem, (const char *) attr->children->content);
         else if (!xmlStrcmp(attr->name, BAD_CAST "name") &&
                  attr->children && attr->children->type == XML_TEXT_NODE)
-            el->name = 
+            el->name =
                 nmem_strdup(p->nmem, (const char *) attr->children->content);
         else
         {
@@ -191,18 +191,18 @@ static int conf_retrieval(yaz_retrieval_t p, const xmlNode *ptr,
             /* parsing attributees */
             for (attr = ptr->properties; attr; attr = attr->next)
             {
-                if (!xmlStrcmp(attr->name, BAD_CAST "name") 
-                         && attr->children 
+                if (!xmlStrcmp(attr->name, BAD_CAST "name")
+                         && attr->children
                          && attr->children->type == XML_TEXT_NODE)
-                    el->backend_name 
-                        = nmem_strdup(p->nmem, 
+                    el->backend_name
+                        = nmem_strdup(p->nmem,
                                       (const char *) attr->children->content);
-                
-                else if (!xmlStrcmp(attr->name, BAD_CAST "syntax") 
-                         && attr->children 
+
+                else if (!xmlStrcmp(attr->name, BAD_CAST "syntax")
+                         && attr->children
                          && attr->children->type == XML_TEXT_NODE)
                 {
-                    el->backend_syntax 
+                    el->backend_syntax
                         = yaz_string_to_oid_odr(
                             yaz_oid_std(),
                             CLASS_RECSYN,
@@ -210,24 +210,24 @@ static int conf_retrieval(yaz_retrieval_t p, const xmlNode *ptr,
                             p->odr);
                     if (!el->backend_syntax)
                     {
-                        wrbuf_printf(p->wr_error, 
+                        wrbuf_printf(p->wr_error,
                                      "Element <backend syntax='%s'>: "
                                      "attribute 'syntax' has invalid "
-                                     "value '%s'", 
+                                     "value '%s'",
                                      attr->children->content,
                                      attr->children->content);
                         return -1;
-                    } 
+                    }
                 }
                 else
                 {
                     wrbuf_printf(p->wr_error, "Element <backend>: expected "
-                                 "attributes 'syntax' or 'name, got '%s'", 
+                                 "attributes 'syntax' or 'name, got '%s'",
                                  attr->name);
                     return -1;
                 }
             }
-          
+
              /* parsing internal of record conv */
             el->record_conv = yaz_record_conv_create();
 
@@ -242,7 +242,7 @@ static int conf_retrieval(yaz_retrieval_t p, const xmlNode *ptr,
             }
         }
     }
-    
+
     *p->list_p = el;
     p->list_p = &el->next;
     return 0;
@@ -268,7 +268,7 @@ int yaz_retrieval_configure_t(yaz_retrieval_t p, const xmlNode *ptr,
             else
             {
                 wrbuf_printf(p->wr_error, "Element <retrievalinfo>: "
-                             "expected element <retrieval>, got <%s>", 
+                             "expected element <retrieval>, got <%s>",
                              ptr->name);
                 return -1;
             }
@@ -317,7 +317,7 @@ int yaz_retrieval_request(yaz_retrieval_t p,
             if (!el->name && !el->identifier)
                 schema_ok = 1;
         }
-        
+
         if (syntax && el->syntax && !oid_oidcmp(syntax, el->syntax))
             syntax_ok = 1;
         if (!syntax)
@@ -339,7 +339,7 @@ int yaz_retrieval_request(yaz_retrieval_t p,
                 if (el->backend_name)
                     *backend_schema = el->backend_name;
                 else if (el->name)
-                    *backend_schema = el->name;                    
+                    *backend_schema = el->name;
                 else
                     *backend_schema = schema;
             }
index 1866442..c59ca90 100644 (file)
@@ -69,27 +69,27 @@ static const char *lookup_relation_index_from_attr(Z_AttributeList *attributes)
                 switch (*relation)
                 {
                     /* Unsure on whether this is the relation attribute constants? */
-                case Z_ProximityOperator_Prox_lessThan: 
+                case Z_ProximityOperator_Prox_lessThan:
                     return "<";
-                case Z_ProximityOperator_Prox_lessThanOrEqual: 
-                    return "<="; 
-                case Z_ProximityOperator_Prox_equal: 
-                    return "="; 
-                case Z_ProximityOperator_Prox_greaterThanOrEqual: 
-                    return ">="; 
-                case Z_ProximityOperator_Prox_greaterThan: 
-                    return ">"; 
-                case Z_ProximityOperator_Prox_notEqual: 
-                    return "<>"; 
-                case 100: 
+                case Z_ProximityOperator_Prox_lessThanOrEqual:
+                    return "<=";
+                case Z_ProximityOperator_Prox_equal:
+                    return "=";
+                case Z_ProximityOperator_Prox_greaterThanOrEqual:
+                    return ">=";
+                case Z_ProximityOperator_Prox_greaterThan:
+                    return ">";
+                case Z_ProximityOperator_Prox_notEqual:
+                    return "<>";
+                case 100:
                     /* phonetic is not supported in CQL */
-                    return 0; 
-                case 101: 
+                    return 0;
+                case 101:
                     /* stem is not supported in CQL */
-                    return 0; 
-                case 102: 
+                    return 0;
+                case 102:
                     /* relevance is supported in CQL, but not implemented yet */
-                    return 0; 
+                    return 0;
                 default:
                     /* Invalid relation */
                     return 0;
@@ -117,7 +117,7 @@ static int rpn2cql_attr(cql_transform_t ct,
         index = lookup_index_from_string_attr(attributes);
 
     /* Attempt to fix bug #2978: Look for a relation attribute */
-    if (!relation) 
+    if (!relation)
         relation = lookup_relation_index_from_attr(attributes);
 
     if (!index)
index b1aba46..c9638d0 100644 (file)
@@ -68,27 +68,27 @@ static const char *lookup_relation_index_from_attr(Z_AttributeList *attributes)
                 switch (*relation)
                 {
                     /* Unsure on whether this is the relation attribute constants? */
-                case Z_ProximityOperator_Prox_lessThan: 
+                case Z_ProximityOperator_Prox_lessThan:
                     return 0;
-                case Z_ProximityOperator_Prox_lessThanOrEqual: 
+                case Z_ProximityOperator_Prox_lessThanOrEqual:
                     return 0;
-                case Z_ProximityOperator_Prox_equal: 
+                case Z_ProximityOperator_Prox_equal:
                     return ":";
-                case Z_ProximityOperator_Prox_greaterThanOrEqual: 
+                case Z_ProximityOperator_Prox_greaterThanOrEqual:
                     return 0;
-                case Z_ProximityOperator_Prox_greaterThan: 
+                case Z_ProximityOperator_Prox_greaterThan:
                     return 0;
-                case Z_ProximityOperator_Prox_notEqual: 
+                case Z_ProximityOperator_Prox_notEqual:
                     return 0;
-                case 100: 
+                case 100:
                     /* phonetic is not implemented*/
-                    return 0; 
-                case 101: 
+                    return 0;
+                case 101:
                     /* stem is not not implemented */
-                    return 0; 
-                case 102: 
+                    return 0;
+                case 102:
                     /* relevance is supported in SOLR, but not implemented yet */
-                    return 0; 
+                    return 0;
                 default:
                     /* Invalid relation */
                     return 0;
@@ -116,7 +116,7 @@ static int rpn2solr_attr(solr_transform_t ct,
         index = lookup_index_from_string_attr(attributes);
 
     /* Attempt to fix bug #2978: Look for a relation attribute */
-    if (!relation) 
+    if (!relation)
         relation = lookup_relation_index_from_attr(attributes);
 
     if (!index)
@@ -258,7 +258,7 @@ static int rpn2solr_simple(solr_transform_t ct,
                     i++;
                     if (strchr(SOLR_SPECIAL, sterm[i]))
                         wrbuf_putc(w, '\\');
-                    wrbuf_putc(w, sterm[i]);                    
+                    wrbuf_putc(w, sterm[i]);
                 }
                 else if (sterm[i] == '?' && trunc == 104)
                 {
index 46a190f..3624009 100644 (file)
--- a/src/sc.c
+++ b/src/sc.c
@@ -145,7 +145,7 @@ static void parse_args(yaz_sc_t s, int *argc_p, char ***argv_p)
     }
 }
 
-VOID sc_ReportSvcStatus(yaz_sc_t s, 
+VOID sc_ReportSvcStatus(yaz_sc_t s,
                         DWORD dwCurrentState,
                         DWORD dwWin32ExitCode,
                         DWORD dwWaitHint)
@@ -162,13 +162,13 @@ VOID sc_ReportSvcStatus(yaz_sc_t s,
 
         if (dwCurrentState == SERVICE_START_PENDING)
             s->gSvcStatus.dwControlsAccepted = 0;
-        else 
+        else
             s->gSvcStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;
 
         if ( (dwCurrentState == SERVICE_RUNNING) ||
              (dwCurrentState == SERVICE_STOPPED) )
             s->gSvcStatus.dwCheckPoint = 0;
-        else 
+        else
             s->gSvcStatus.dwCheckPoint = dwCheckPoint++;
 
         // Report the status of the service to the SCM.
@@ -178,19 +178,19 @@ VOID sc_ReportSvcStatus(yaz_sc_t s,
 
 static yaz_sc_t global_sc = 0;
 
-VOID WINAPI sc_SvcCtrlHandler(DWORD dwCtrl)                                                     
+VOID WINAPI sc_SvcCtrlHandler(DWORD dwCtrl)
 {
-    switch(dwCtrl) 
-    {  
-    case SERVICE_CONTROL_STOP: 
+    switch(dwCtrl)
+    {
+    case SERVICE_CONTROL_STOP:
         yaz_log(YLOG_LOG, "Service %s to stop", global_sc->service_name);
         sc_ReportSvcStatus(global_sc, SERVICE_STOP_PENDING, NO_ERROR, 0);
         global_sc->sc_stop(global_sc);
         sc_ReportSvcStatus(global_sc, SERVICE_STOPPED, NO_ERROR, 0);
         return;
-    case SERVICE_CONTROL_INTERROGATE: 
-        break; 
-    default: 
+    case SERVICE_CONTROL_INTERROGATE:
+        break;
+    default:
         break;
     }
 }
@@ -202,22 +202,22 @@ static void WINAPI sc_service_main(DWORD argc, char **argv)
 
     yaz_log(YLOG_LOG, "Service %s starting", s->service_name);
 
-    s->gSvcStatusHandle = RegisterServiceCtrlHandler( 
+    s->gSvcStatusHandle = RegisterServiceCtrlHandler(
         s->service_name, sc_SvcCtrlHandler);
 
     if (!s->gSvcStatusHandle)
-    { 
+    {
         yaz_log(YLOG_FATAL|YLOG_ERRNO, "RegisterServiceCtrlHandler");
-        return; 
-    } 
+        return;
+    }
 
-    s->gSvcStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; 
-    s->gSvcStatus.dwServiceSpecificExitCode = 0;    
+    s->gSvcStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
+    s->gSvcStatus.dwServiceSpecificExitCode = 0;
 
     sc_ReportSvcStatus(s, SERVICE_START_PENDING, NO_ERROR, 3000);
 
     ret_code = s->sc_main(s, s->argc, s->argv);
-       
+
     sc_ReportSvcStatus(s, SERVICE_STOPPED,
                        ret_code ? ERROR_SERVICE_SPECIFIC_ERROR : NO_ERROR, ret_code);
 }
@@ -281,8 +281,8 @@ int yaz_sc_program(yaz_sc_t s, int argc, char **argv,
             wrbuf_puts(w, "\"");
             yaz_log(YLOG_LOG, "path: %s", wrbuf_cstr(w));
 
-            schService = 
-                CreateService( 
+            schService =
+                CreateService(
                     manager,          /* SCM database */
                     TEXT(s->service_name), /* name of service */
                     TEXT(s->display_name), /* service name to display */
@@ -297,7 +297,7 @@ int yaz_sc_program(yaz_sc_t s, int argc, char **argv,
                     NULL,                      /* no dependencies */
                     NULL,                      /* LocalSystem account */
                     NULL);                     /* no password */
-            if (schService == NULL) 
+            if (schService == NULL)
             {
                 yaz_log(YLOG_FATAL|YLOG_ERRNO, "Service %s could not be installed",
                         s->service_name);
@@ -312,9 +312,9 @@ int yaz_sc_program(yaz_sc_t s, int argc, char **argv,
         {
             SC_HANDLE schService = 0;
             SERVICE_STATUS serviceStatus;
-                       
+
             schService = OpenService(manager, TEXT(s->service_name), SERVICE_ALL_ACCESS);
-            if (schService == NULL) 
+            if (schService == NULL)
             {
                 yaz_log(YLOG_FATAL|YLOG_ERRNO, "Service %s could not be opened",
                         s->service_name);
index 2ac95fd..bc16416 100644 (file)
@@ -109,10 +109,10 @@ static void get_logbits(void)
     if (!logbits_set)
     {
         logbits_set = 1;
-        log_session = yaz_log_module_level("session"); 
+        log_session = yaz_log_module_level("session");
         log_sessiondetail = yaz_log_module_level("sessiondetail");
         log_request = yaz_log_module_level("request");
-        log_requestdetail = yaz_log_module_level("requestdetail"); 
+        log_requestdetail = yaz_log_module_level("requestdetail");
     }
 }
 
@@ -125,7 +125,7 @@ static void wr_diag(WRBUF w, int error, const char *addinfo)
         wrbuf_puts(w, "+");
         wrbuf_puts_replace_char(w, addinfo, ' ', '_');
     }
-    wrbuf_puts(w, " ");    
+    wrbuf_puts(w, " ");
 }
 
 static int odr_int_to_int(Odr_int v)
@@ -173,7 +173,7 @@ association *create_association(IOCHAN channel, COMSTACK link,
         if (*apdufile == '@')
         {
             odr_setprint(anew->print, yaz_log_file());
-        }       
+        }
         else if (*apdufile != '-')
         {
             char filename[256];
@@ -232,7 +232,7 @@ static void do_close_req(association *a, int reason, char *message,
 {
     Z_APDU *apdu = zget_APDU(a->encode, Z_APDU_close);
     Z_Close *cls = apdu->u.close;
-    
+
     /* Purge request queue */
     while (request_deq(&a->incoming));
     while (request_deq(&a->outgoing));
@@ -267,7 +267,7 @@ int ir_read(IOCHAN h, int event)
     association *assoc = (association *)iochan_getdata(h);
     COMSTACK conn = assoc->client_link;
     request *req;
-    
+
     if ((assoc->cs_put_mask & EVENT_INPUT) == 0 && (event & assoc->cs_get_mask))
     {
         /* We aren't speaking to this fellow */
@@ -290,7 +290,7 @@ int ir_read(IOCHAN h, int event)
                 yaz_log(log_session, "Connection error: %s res=%d",
                         cs_errmsg(cs_errno(conn)), res);
                 req = request_get(&assoc->incoming); /* get a new request */
-                do_close_req(assoc, Z_Close_protocolError, 
+                do_close_req(assoc, Z_Close_protocolError,
                              "Incoming package too large", req);
                 return 0;
             }
@@ -338,10 +338,10 @@ int ir_read(IOCHAN h, int event)
                 return 0;
             }
             req->request_mem = odr_extract_mem(assoc->decode);
-            if (assoc->print) 
+            if (assoc->print)
             {
                 if (!z_GDU(assoc->print, &req->gdu_request, 0, 0))
-                    yaz_log(YLOG_WARN, "ODR print error: %s", 
+                    yaz_log(YLOG_WARN, "ODR print error: %s",
                             odr_errmsg(odr_geterror(assoc->print)));
                 odr_reset(assoc->print);
             }
@@ -357,7 +357,7 @@ int ir_read(IOCHAN h, int event)
  * processing is initiated. Flow of control moves down through the
  * various process_* functions below, until the encoded result comes back up
  * to the output handler in here.
- * 
+ *
  *  h     : the I/O channel that has an outstanding event.
  *  event : the current outstanding event.
  */
@@ -396,9 +396,9 @@ void ir_session(IOCHAN h, int event)
             return;
         }
         iochan_clearflag(h, EVENT_OUTPUT);
-        if (conn->io_pending) 
+        if (conn->io_pending)
         {   /* cs_accept didn't complete */
-            assoc->cs_accept_mask = 
+            assoc->cs_accept_mask =
                 ((conn->io_pending & CS_WANT_WRITE) ? EVENT_OUTPUT : 0) |
                 ((conn->io_pending & CS_WANT_READ) ? EVENT_INPUT : 0);
 
@@ -509,7 +509,7 @@ static void assoc_init_reset(association *assoc)
     assoc->init->charneg_response = NULL;
 
     assoc->init->decode = assoc->decode;
-    assoc->init->peer_name = 
+    assoc->init->peer_name =
         odr_strdup(assoc->encode, cs_addrstr(assoc->client_link));
 
     yaz_log(log_requestdetail, "peer %s", assoc->init->peer_name);
@@ -526,7 +526,7 @@ static int srw_bend_init(association *assoc, Z_SRW_diagnostic **d, int *num, Z_S
 
         yaz_log(log_requestdetail, "srw_bend_init config=%s", cb->configname);
         assoc_init_reset(assoc);
-        
+
         if (sr->username)
         {
             Z_IdAuthentication *auth = (Z_IdAuthentication *)
@@ -534,10 +534,10 @@ static int srw_bend_init(association *assoc, Z_SRW_diagnostic **d, int *num, Z_S
             size_t len;
 
             len = strlen(sr->username) + 1;
-            if (sr->password) 
+            if (sr->password)
                 len += strlen(sr->password) + 2;
             yaz_log(log_requestdetail, "username=%s password-len=%ld",
-                    sr->username, (long) 
+                    sr->username, (long)
                     (sr->password ? strlen(sr->password) : 0));
             auth->which = Z_IdAuthentication_open;
             auth->u.open = (char *) odr_malloc(assoc->decode, len);
@@ -589,7 +589,7 @@ static int retrieve_fetch(association *assoc, bend_fetch_rr *rr)
         int r;
         const char *input_schema = yaz_get_esn(rr->comp);
         Odr_oid *input_syntax_raw = rr->request_format;
-        
+
         const char *backend_schema = 0;
         Odr_oid *backend_syntax = 0;
 
@@ -688,13 +688,13 @@ static int srw_bend_fetch(association *assoc, int pos,
             odr_malloc(assoc->decode, sizeof(Z_CompSpec));
     rr.comp->u.complex->selectAlternativeSyntax = (bool_t *)
         odr_malloc(assoc->encode, sizeof(bool_t));
-    *rr.comp->u.complex->selectAlternativeSyntax = 0;    
+    *rr.comp->u.complex->selectAlternativeSyntax = 0;
     rr.comp->u.complex->num_dbSpecific = 0;
     rr.comp->u.complex->dbSpecific = 0;
-    rr.comp->u.complex->num_recordSyntax = 0; 
+    rr.comp->u.complex->num_recordSyntax = 0;
     rr.comp->u.complex->recordSyntax = 0;
 
-    rr.comp->u.complex->generic = (Z_Specification *) 
+    rr.comp->u.complex->generic = (Z_Specification *)
             odr_malloc(assoc->decode, sizeof(Z_Specification));
 
     /* schema uri = recordSchema (or NULL if recordSchema is not given) */
@@ -705,14 +705,14 @@ static int srw_bend_fetch(association *assoc, int pos,
     rr.comp->u.complex->generic->elementSpec = 0;
     if (srw_req->recordSchema)
     {
-        rr.comp->u.complex->generic->elementSpec = 
+        rr.comp->u.complex->generic->elementSpec =
             (Z_ElementSpec *) odr_malloc(assoc->encode, sizeof(Z_ElementSpec));
-        rr.comp->u.complex->generic->elementSpec->which = 
+        rr.comp->u.complex->generic->elementSpec->which =
             Z_ElementSpec_elementSetName;
         rr.comp->u.complex->generic->elementSpec->u.elementSetName =
             srw_req->recordSchema;
     }
-    
+
     rr.stream = assoc->encode;
     rr.print = assoc->print;
 
@@ -761,7 +761,7 @@ static int cql2pqf(ODR odr, const char *cql, cql_transform_t ct,
     int srw_errcode = 0;
     const char *add = 0;
     WRBUF rpn_buf = wrbuf_alloc();
-         
+
     *sortkeys_p = 0;
     r = cql_parser_string(cp, cql);
     if (r)
@@ -780,7 +780,7 @@ static int cql2pqf(ODR odr, const char *cql, cql_transform_t ct,
         {
             char out[100];
             int r = cql_sortby_to_sortkeys_buf(cn, out, sizeof(out)-1);
-    
+
             if (r == 0)
             {
                 if (*out)
@@ -833,7 +833,7 @@ static int cql2pqf_scan(ODR odr, const char *cql, cql_transform_t ct,
     if (query.which != Z_Query_type_1 && query.which != Z_Query_type_101)
         return YAZ_SRW_QUERY_SYNTAX_ERROR; /* bad query type */
     rpn = query.u.type_1;
-    if (!rpn->RPNStructure) 
+    if (!rpn->RPNStructure)
         return YAZ_SRW_QUERY_SYNTAX_ERROR; /* must be structure */
     if (rpn->RPNStructure->which != Z_RPNStructure_simple)
         return YAZ_SRW_QUERY_SYNTAX_ERROR; /* must be simple */
@@ -843,7 +843,7 @@ static int cql2pqf_scan(ODR odr, const char *cql, cql_transform_t ct,
            sizeof(*result));
     return 0;
 }
-                   
+
 
 static int ccl2pqf(ODR odr, const Odr_oct *ccl, CCL_bibset bibset,
                    bend_search_rr *bsrr)
@@ -873,7 +873,7 @@ static void srw_bend_search(association *assoc,
     int srw_error = 0;
     Z_External *ext;
     Z_SRW_searchRetrieveRequest *srw_req = sr->u.request;
-    
+
     *http_code = 200;
     yaz_log(log_requestdetail, "Got SRW SearchRetrieveRequest");
     srw_bend_init(assoc, &srw_res->diagnostics, &srw_res->num_diagnostics, sr);
@@ -894,7 +894,7 @@ static void srw_bend_search(association *assoc,
         rr.query->u.type_1 = 0;
         rr.extra_args = sr->extra_args;
         rr.extra_response_data = 0;
-        
+
         if (srw_req->query_type == Z_SRW_query_type_cql)
         {
             if (assoc->server && assoc->server->cql_transform)
@@ -916,13 +916,13 @@ static void srw_bend_search(association *assoc,
             {
                 /* CQL query to backend. Wrap it - Z39.50 style */
                 ext = (Z_External *) odr_malloc(assoc->decode, sizeof(*ext));
-                ext->direct_reference = odr_getoidbystr(assoc->decode, 
+                ext->direct_reference = odr_getoidbystr(assoc->decode,
                                                         "1.2.840.10003.16.2");
                 ext->indirect_reference = 0;
                 ext->descriptor = 0;
                 ext->which = Z_External_CQL;
                 ext->u.cql = srw_req->query.cql;
-                
+
                 rr.query->which = Z_Query_type_104;
                 rr.query->u.type_104 =  ext;
             }
@@ -931,9 +931,9 @@ static void srw_bend_search(association *assoc,
         {
             Z_RPNQuery *RPNquery;
             YAZ_PQF_Parser pqf_parser;
-            
+
             pqf_parser = yaz_pqf_create();
-            
+
             RPNquery = yaz_pqf_parse(pqf_parser, assoc->decode,
                                      srw_req->query.pqf);
             if (!RPNquery)
@@ -945,10 +945,10 @@ static void srw_bend_search(association *assoc,
                         code, pqf_msg, (long) off);
                 srw_error = YAZ_SRW_QUERY_SYNTAX_ERROR;
             }
-            
+
             rr.query->which = Z_Query_type_1;
             rr.query->u.type_1 =  RPNquery;
-            
+
             yaz_pqf_destroy(pqf_parser);
         }
         else
@@ -963,7 +963,7 @@ static void srw_bend_search(association *assoc,
             rr.decode = assoc->decode;
             rr.print = assoc->print;
             if (srw_req->sort.sortKeys)
-                rr.srw_sortKeys = odr_strdup(assoc->encode, 
+                rr.srw_sortKeys = odr_strdup(assoc->encode,
                                              srw_req->sort.sortKeys);
             rr.association = assoc;
             rr.hits = 0;
@@ -972,7 +972,7 @@ static void srw_bend_search(association *assoc,
             rr.search_info = 0;
             rr.search_input = 0;
             yaz_log_zquery_level(log_requestdetail,rr.query);
-            
+
             (assoc->init->bend_search)(assoc->backend, &rr);
             if (rr.errcode)
             {
@@ -995,11 +995,11 @@ static void srw_bend_search(association *assoc,
                     odr_int_to_int(*srw_req->maximumRecords) : 0;
                 int start = srw_req->startRecord ?
                     odr_int_to_int(*srw_req->startRecord) : 1;
-                
+
                 yaz_log(log_requestdetail, "Request to pack %d+%d out of "
                         ODR_INT_PRINTF,
                         start, number, rr.hits);
-                
+
                 srw_res->numberOfRecords = odr_intdup(assoc->encode, rr.hits);
                if (rr.srw_setname)
                 {
@@ -1008,13 +1008,13 @@ static void srw_bend_search(association *assoc,
                     srw_res->resultSetIdleTime =
                         odr_intdup(assoc->encode, *rr.srw_setnameIdleTime );
                }
-                
+
                 if (start > rr.hits || start < 1)
                 {
                     /* if hits<=0 and start=1 we don't return a diagnostic */
                     if (start != 1)
                         yaz_add_srw_diagnostic(
-                            assoc->encode, 
+                            assoc->encode,
                             &srw_res->diagnostics, &srw_res->num_diagnostics,
                             YAZ_SRW_FIRST_RECORD_POSITION_OUT_OF_RANGE, 0);
                 }
@@ -1024,7 +1024,7 @@ static void srw_bend_search(association *assoc,
                     int ok = 1;
                     if (start + number > rr.hits)
                         number = odr_int_to_int(rr.hits) - start + 1;
-                    
+
                     /* Call bend_present if defined */
                     if (assoc->init->bend_present)
                     {
@@ -1054,7 +1054,7 @@ static void srw_bend_search(association *assoc,
                         bprr->errcode = 0;
                         bprr->errstring = NULL;
                         (*assoc->init->bend_present)(assoc->backend, bprr);
-                        
+
                         if (bprr->errcode)
                         {
                             srw_error = yaz_diag_bib1_to_srw(bprr->errcode);
@@ -1065,14 +1065,14 @@ static void srw_bend_search(association *assoc,
                             ok = 0;
                         }
                     }
-                    
+
                     if (ok)
                     {
                         int j = 0;
                         int packing = Z_SRW_recordPacking_string;
                         if (srw_req->recordPacking)
                         {
-                            packing = 
+                            packing =
                                 yaz_srw_str_to_pack(srw_req->recordPacking);
                             if (packing == -1)
                                 packing = Z_SRW_recordPacking_string;
@@ -1080,7 +1080,7 @@ static void srw_bend_search(association *assoc,
                         srw_res->records = (Z_SRW_record *)
                             odr_malloc(assoc->encode,
                                        number * sizeof(*srw_res->records));
-                        
+
                         srw_res->extra_records = (Z_SRW_extra_record **)
                             odr_malloc(assoc->encode,
                                        number*sizeof(*srw_res->extra_records));
@@ -1089,7 +1089,7 @@ static void srw_bend_search(association *assoc,
                         {
                             int errcode;
                             const char *addinfo = 0;
-                            
+
                             srw_res->records[j].recordPacking = packing;
                             srw_res->records[j].recordData_buf = 0;
                             srw_res->extra_records[j] = 0;
@@ -1104,7 +1104,7 @@ static void srw_bend_search(association *assoc,
                                                        &srw_res->num_diagnostics,
                                                        yaz_diag_bib1_to_srw(errcode),
                                                        addinfo);
-                                
+
                                 break;
                             }
                             if (srw_res->records[j].recordData_buf)
@@ -1160,10 +1160,10 @@ static void srw_bend_search(association *assoc,
                          (srw_res->numberOfRecords ?
                           *srw_res->numberOfRecords : 0));
         }
-        wrbuf_printf(wr, " %s " ODR_INT_PRINTF "+%d", 
+        wrbuf_printf(wr, " %s " ODR_INT_PRINTF "+%d",
                      (srw_res->resultSetId ?
                       srw_res->resultSetId : "-"),
-                     (srw_req->startRecord ? *srw_req->startRecord : 1), 
+                     (srw_req->startRecord ? *srw_req->startRecord : 1),
                      srw_res->num_records);
         yaz_log(log_request, "%s %s: %s", wrbuf_cstr(wr), querytype, querystr);
         wrbuf_destroy(wr);
@@ -1188,14 +1188,14 @@ static char *srw_bend_explain_default(bend_explain_rr *rr)
             char *content;
 
             ptr = xmlCopyNode(ptr, 1);
-        
+
             xmlDocSetRootElement(doc, ptr);
-            
+
             xmlDocDumpMemory(doc, &buf_out, &len);
             content = (char*) odr_malloc(rr->stream, 1+len);
             memcpy(content, buf_out, len);
             content[len] = '\0';
-            
+
             xmlFree(buf_out);
             xmlFreeDoc(doc);
             rr->explain_buf = content;
@@ -1218,7 +1218,7 @@ static void srw_bend_explain(association *assoc,
     if (assoc->init)
     {
         bend_explain_rr rr;
-        
+
         rr.stream = assoc->encode;
         rr.decode = assoc->decode;
         rr.print = assoc->print;
@@ -1239,7 +1239,7 @@ static void srw_bend_explain(association *assoc,
             int packing = Z_SRW_recordPacking_string;
             if (srw_req->recordPacking)
             {
-                packing = 
+                packing =
                     yaz_srw_str_to_pack(srw_req->recordPacking);
                 if (packing == -1)
                     packing = Z_SRW_recordPacking_string;
@@ -1288,10 +1288,10 @@ static void srw_bend_scan(association *assoc,
         bsrr->entries = 0;
         bsrr->setname = 0;
 
-        if (bsrr->num_entries > 0) 
+        if (bsrr->num_entries > 0)
         {
             int i;
-            bsrr->entries = (struct scan_entry *) 
+            bsrr->entries = (struct scan_entry *)
                 odr_malloc(assoc->decode, sizeof(*bsrr->entries) *
                            bsrr->num_entries);
             for (i = 0; i<bsrr->num_entries; i++)
@@ -1309,10 +1309,10 @@ static void srw_bend_scan(association *assoc,
             assoc->init->bend_scan)
         {
             YAZ_PQF_Parser pqf_parser = yaz_pqf_create();
-            
+
             bsrr->term = yaz_pqf_scan(pqf_parser, assoc->decode,
-                                      &bsrr->attributeset, 
-                                      srw_req->scanClause.pqf); 
+                                      &bsrr->attributeset,
+                                      srw_req->scanClause.pqf);
             yaz_pqf_destroy(pqf_parser);
             bsrr->scanClause = 0;
             ((int (*)(void *, bend_scan_rr *))
@@ -1385,14 +1385,14 @@ static void srw_bend_scan(association *assoc,
                 t->numberOfRecords =
                     odr_intdup(assoc->encode, bsrr->entries[i].occurrences);
                 t->displayTerm = 0;
-                if (save_entries == bsrr->entries && 
+                if (save_entries == bsrr->entries &&
                     bsrr->entries[i].display_term)
                 {
                     /* the entries was _not_ set by the handler. So it's
                        safe to test for new member display_term. It is
                        NULL'ed by us.
                     */
-                    t->displayTerm = odr_strdup(assoc->encode, 
+                    t->displayTerm = odr_strdup(assoc->encode,
                                                 bsrr->entries[i].display_term);
                 }
                 t->whereInList = 0;
@@ -1430,7 +1430,7 @@ static void srw_bend_scan(association *assoc,
             wrbuf_printf(wr, "OK - - ");
 
         wrbuf_printf(wr, ODR_INT_PRINTF "+" ODR_INT_PRINTF " ",
-                     (srw_req->responsePosition ? 
+                     (srw_req->responsePosition ?
                       *srw_req->responsePosition : 1),
                      (srw_req->maximumTerms ?
                       *srw_req->maximumTerms : 1));
@@ -1456,7 +1456,7 @@ static void srw_bend_update(association *assoc,
     {
        bend_update_rr rr;
         Z_SRW_extra_record *extra = srw_req->extra_record;
-       
+
        rr.stream = assoc->encode;
        rr.print = assoc->print;
         rr.num_bases = 1;
@@ -1475,7 +1475,7 @@ static void srw_bend_update(association *assoc,
         rr.uri = 0;
         rr.message = 0;
         rr.details = 0;
-        
+
        *http_code = 200;
         if (rr.operation == 0)
         {
@@ -1499,14 +1499,14 @@ static void srw_bend_update(association *assoc,
             if (srw_req->record)
             {
                 rr.record_data = odr_strdupn(
-                    assoc->encode, 
+                    assoc->encode,
                     srw_req->record->recordData_buf,
                     srw_req->record->recordData_len );
             }
             if (extra && extra->extraRecordData_len)
             {
                 rr.extra_record_data = odr_strdupn(
-                    assoc->encode, 
+                    assoc->encode,
                     extra->extraRecordData_buf,
                     extra->extraRecordData_len );
             }
@@ -1521,7 +1521,7 @@ static void srw_bend_update(association *assoc,
                 rr.record_id = srw_req->recordId;
             else if (extra && extra->recordIdentifier)
                 rr.record_id = extra->recordIdentifier;
-            else 
+            else
             {
                 yaz_add_sru_update_diagnostic(
                     assoc->encode, &srw_res->diagnostics,
@@ -1537,30 +1537,30 @@ static void srw_bend_update(association *assoc,
                     YAZ_SRU_UPDATE_MISSING_MANDATORY_ELEMENT_RECORD_REJECTED,
                     "record");
             }
-            else 
+            else
             {
                 if (srw_req->record->recordSchema)
                     rr.record_schema = odr_strdup(
                         assoc->encode, srw_req->record->recordSchema);
                 if (srw_req->record->recordData_len )
                 {
-                    rr.record_data = odr_strdupn(assoc->encode, 
+                    rr.record_data = odr_strdupn(assoc->encode,
                                                  srw_req->record->recordData_buf,
                                                  srw_req->record->recordData_len );
                 }
-                else 
+                else
                 {
                     yaz_add_sru_update_diagnostic(
                         assoc->encode, &srw_res->diagnostics,
                         &srw_res->num_diagnostics,
-                        YAZ_SRU_UPDATE_MISSING_MANDATORY_ELEMENT_RECORD_REJECTED,                                              
+                        YAZ_SRU_UPDATE_MISSING_MANDATORY_ELEMENT_RECORD_REJECTED,
                         "recordData" );
                 }
             }
             if (extra && extra->extraRecordData_len)
             {
                 rr.extra_record_data = odr_strdupn(
-                    assoc->encode, 
+                    assoc->encode,
                     extra->extraRecordData_buf,
                     extra->extraRecordData_len );
             }
@@ -1568,31 +1568,31 @@ static void srw_bend_update(association *assoc,
        else if (!strcmp(rr.operation, "insert"))
         {
             if (srw_req->recordId)
-                rr.record_id = srw_req->recordId; 
+                rr.record_id = srw_req->recordId;
             else if (extra)
                 rr.record_id = extra->recordIdentifier;
-            
+
             if (srw_req->record)
             {
                 if (srw_req->record->recordSchema)
                     rr.record_schema = odr_strdup(
                         assoc->encode, srw_req->record->recordSchema);
-            
+
                 if (srw_req->record->recordData_len)
                     rr.record_data = odr_strdupn(
-                        assoc->encode, 
+                        assoc->encode,
                         srw_req->record->recordData_buf,
                         srw_req->record->recordData_len );
             }
             if (extra && extra->extraRecordData_len)
             {
                 rr.extra_record_data = odr_strdupn(
-                    assoc->encode, 
+                    assoc->encode,
                     extra->extraRecordData_buf,
                     extra->extraRecordData_len );
             }
        }
-       else 
+       else
             yaz_add_sru_update_diagnostic(assoc->encode, &srw_res->diagnostics,
                                           &srw_res->num_diagnostics,
                                           YAZ_SRU_UPDATE_INVALID_ACTION,
@@ -1600,7 +1600,7 @@ static void srw_bend_update(association *assoc,
 
         if (srw_req->record)
         {
-            const char *pack_str = 
+            const char *pack_str =
                 yaz_srw_pack_to_str(srw_req->record->recordPacking);
             if (pack_str)
                 rr.record_packing = odr_strdup(assoc->encode, pack_str);
@@ -1621,7 +1621,7 @@ static void srw_bend_update(association *assoc,
         {
             if ( assoc->init->bend_srw_update)
                 (*assoc->init->bend_srw_update)(assoc->backend, &rr);
-            else 
+            else
                 yaz_add_sru_update_diagnostic(
                     assoc->encode, &srw_res->diagnostics,
                     &srw_res->num_diagnostics,
@@ -1633,7 +1633,7 @@ static void srw_bend_update(association *assoc,
             yaz_add_srw_diagnostic_uri(assoc->encode,
                                        &srw_res->diagnostics,
                                        &srw_res->num_diagnostics,
-                                       rr.uri, 
+                                       rr.uri,
                                        rr.message,
                                        rr.details);
        srw_res->recordId = rr.record_id;
@@ -1665,7 +1665,7 @@ static void srw_bend_update(association *assoc,
             srw_res->record->recordData_len = strlen(rr.record_data);
             if (rr.extra_record_data)
             {
-                Z_SRW_extra_record *ex = 
+                Z_SRW_extra_record *ex =
                     yaz_srw_get_extra_record(assoc->encode);
                 srw_res->extra_record = ex;
                 ex->extraRecordData_buf = rr.extra_record_data;
@@ -1699,7 +1699,7 @@ static char *read_file(const char *fname, ODR o, size_t *sz)
     if (fread(buf, 1, *sz, inf) != *sz)
         yaz_log(YLOG_WARN|YLOG_ERRNO, "short read %s", fname);
     fclose(inf);
-    return buf;     
+    return buf;
 }
 
 static void process_http_request(association *assoc, request *req)
@@ -1725,13 +1725,13 @@ static void process_http_request(association *assoc, request *req)
         r = 1;
     }
     if (r == 2 && assoc->server && assoc->server->docpath
-        && hreq->path[0] == '/' 
-        && 
+        && hreq->path[0] == '/'
+        &&
         /* check if path is a proper prefix of documentroot */
         strncmp(hreq->path+1, assoc->server->docpath,
                 strlen(assoc->server->docpath))
         == 0)
-    {   
+    {
         if (!check_path(hreq->path))
         {
             yaz_log(YLOG_LOG, "File %s access forbidden", hreq->path+1);
@@ -1750,7 +1750,7 @@ static void process_http_request(association *assoc, request *req)
             {
                 const char *ctype = 0;
                 yaz_mime_types types = yaz_mime_types_create();
-                
+
                 yaz_mime_types_add(types, "xsl", "application/xml");
                 yaz_mime_types_add(types, "xml", "application/xml");
                 yaz_mime_types_add(types, "css", "text/css");
@@ -1758,12 +1758,12 @@ static void process_http_request(association *assoc, request *req)
                 yaz_mime_types_add(types, "htm", "text/html");
                 yaz_mime_types_add(types, "txt", "text/plain");
                 yaz_mime_types_add(types, "js", "application/x-javascript");
-                
+
                 yaz_mime_types_add(types, "gif", "image/gif");
                 yaz_mime_types_add(types, "png", "image/png");
                 yaz_mime_types_add(types, "jpg", "image/jpeg");
                 yaz_mime_types_add(types, "jpeg", "image/jpeg");
-                
+
                 ctype = yaz_mime_lookup_fname(types, hreq->path);
                 if (!ctype)
                 {
@@ -1822,7 +1822,7 @@ static void process_http_request(association *assoc, request *req)
                                              sr->srw_version);
             stylesheet = sr->u.explain_request->stylesheet;
             if (num_diagnostic)
-            {   
+            {
                 res->u.explain_response->diagnostics = diagnostic;
                 res->u.explain_response->num_diagnostics = num_diagnostic;
             }
@@ -1836,7 +1836,7 @@ static void process_http_request(association *assoc, request *req)
                                              sr->srw_version);
             stylesheet = sr->u.scan_request->stylesheet;
             if (num_diagnostic)
-            {   
+            {
                 res->u.scan_response->diagnostics = diagnostic;
                 res->u.scan_response->num_diagnostics = num_diagnostic;
             }
@@ -1850,7 +1850,7 @@ static void process_http_request(association *assoc, request *req)
                                              sr->srw_version);
             yaz_log(YLOG_DEBUG, "handling SRW UpdateRequest");
             if (num_diagnostic)
-            {   
+            {
                 res->u.update_response->diagnostics = diagnostic;
                 res->u.update_response->num_diagnostics = num_diagnostic;
             }
@@ -1861,11 +1861,11 @@ static void process_http_request(association *assoc, request *req)
         }
         else
         {
-            yaz_log(log_request, "SOAP ERROR"); 
+            yaz_log(log_request, "SOAP ERROR");
             /* FIXME - what error, what query */
             http_code = 500;
             z_soap_error(assoc->encode, soap_package,
-                         "SOAP-ENV:Client", "Bad method", 0); 
+                         "SOAP-ENV:Client", "Bad method", 0);
         }
         if (http_code == 200 || http_code == 500)
         {
@@ -1908,7 +1908,7 @@ static void process_http_request(association *assoc, request *req)
     if (p == 0)
         p = z_get_HTTP_Response(o, 500);
     hres = p->u.HTTP_Response;
-    if (!strcmp(hreq->version, "1.0")) 
+    if (!strcmp(hreq->version, "1.0"))
     {
         const char *v = z_HTTP_header_lookup(hreq->headers, "Connection");
         if (v && !strcmp(v, "Keep-Alive"))
@@ -1973,7 +1973,7 @@ static int process_z_request(association *assoc, request *req, char **msg)
 {
     Z_APDU *res;
     int retval;
-    
+
     *msg = "Unknown Error";
     assert(req && req->state == REQUEST_IDLE);
     if (req->apdu_request->which != Z_APDU_initRequest && !assoc->init)
@@ -2068,7 +2068,7 @@ static int process_gdu_response(association *assoc, request *req, Z_GDU *res)
     if (assoc->print)
     {
         if (!z_GDU(assoc->print, &res, 0, 0))
-            yaz_log(YLOG_WARN, "ODR print error: %s", 
+            yaz_log(YLOG_WARN, "ODR print error: %s",
                 odr_errmsg(odr_geterror(assoc->print)));
         odr_reset(assoc->print);
     }
@@ -2152,7 +2152,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb)
     if (req->implementationVersion)
         yaz_log(log_requestdetail, "Version:   %s",
                 req->implementationVersion);
-    
+
     assoc_init_reset(assoc);
 
     assoc->init->auth = req->idAuthentication;
@@ -2177,9 +2177,9 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb)
         if (req->implementationVersion)
             yaz_log(log_requestdetail, "Config:    %s",
                     cb->configname);
-    
+
         iochan_settimeout(assoc->client_chan, cb->idle_timeout);
-        
+
         /* we have a backend control block, so call that init function */
         if (!(binitres = (*cb->bend_init)(assoc->init)))
         {
@@ -2202,16 +2202,16 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb)
     if ((assoc->init->bend_search))
         yaz_log(YLOG_DEBUG, "Search handler installed");
     if ((assoc->init->bend_present))
-        yaz_log(YLOG_DEBUG, "Present handler installed");   
+        yaz_log(YLOG_DEBUG, "Present handler installed");
     if ((assoc->init->bend_esrequest))
-        yaz_log(YLOG_DEBUG, "ESRequest handler installed");   
+        yaz_log(YLOG_DEBUG, "ESRequest handler installed");
     if ((assoc->init->bend_delete))
-        yaz_log(YLOG_DEBUG, "Delete handler installed");   
+        yaz_log(YLOG_DEBUG, "Delete handler installed");
     if ((assoc->init->bend_scan))
-        yaz_log(YLOG_DEBUG, "Scan handler installed");   
+        yaz_log(YLOG_DEBUG, "Scan handler installed");
     if ((assoc->init->bend_segment))
-        yaz_log(YLOG_DEBUG, "Segment handler installed");   
-    
+        yaz_log(YLOG_DEBUG, "Segment handler installed");
+
     resp->referenceId = req->referenceId;
     *options = '\0';
     /* let's tell the client what we can do */
@@ -2258,7 +2258,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb)
         ODR_MASK_SET(resp->options, Z_Options_sort);
         strcat(options, " sort");
     }
-    
+
     if (ODR_MASK_GET(req->options, Z_Options_negotiationModel))
     {
         Z_OtherInformationUnit *p0;
@@ -2268,7 +2268,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb)
             if (assoc->init->query_charset)
             {
                 assoc->init->charneg_response = yaz_set_response_charneg(
-                    assoc->encode, assoc->init->query_charset, 0, 
+                    assoc->encode, assoc->init->query_charset, 0,
                     assoc->init->records_in_same_charset);
             }
             else
@@ -2315,7 +2315,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb)
 
     resp->preferredMessageSize =
         odr_intdup(assoc->encode, assoc->preferredMessageSize);
-    resp->maximumRecordSize = 
+    resp->maximumRecordSize =
         odr_intdup(assoc->encode, assoc->maximumRecordSize);
 
     resp->implementationId = odr_prepend(assoc->encode,
@@ -2336,7 +2336,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb)
     }
     else
         assoc->state = ASSOC_UP;
-    
+
     if (log_request)
     {
         if (!req->idAuthentication)
@@ -2359,7 +2359,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb)
             yaz_log(log_request, "Auth idPass %s %s",
                     user ? user : "-", group ? group : "-");
         }
-        else if (req->idAuthentication->which 
+        else if (req->idAuthentication->which
                  == Z_IdAuthentication_anonymous)
         {
             yaz_log(log_request, "Auth anonymous");
@@ -2378,7 +2378,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb)
         else
             wrbuf_printf(wr, "OK -");
         wrbuf_printf(wr, " ID:%s Name:%s Version:%s",
-                     (req->implementationId ? req->implementationId :"-"), 
+                     (req->implementationId ? req->implementationId :"-"),
                      (req->implementationName ?
                       req->implementationName : "-"),
                      (req->implementationVersion ?
@@ -2422,7 +2422,7 @@ static Z_Records *diagrec(association *assoc, int error, char *addinfo)
 /*
  * surrogate diagnostic.
  */
-static Z_NamePlusRecord *surrogatediagrec(association *assoc, 
+static Z_NamePlusRecord *surrogatediagrec(association *assoc,
                                           const char *dbname,
                                           int error, const char *addinfo)
 {
@@ -2503,7 +2503,7 @@ static Z_Records *pack_records(association *a, char *setname, Odr_int start,
                 *pres = Z_PresentStatus_failure;
                 /* for 'present request out of range',
                    set addinfo to record position if not set */
-                if (freq.errcode == YAZ_BIB1_PRESENT_REQUEST_OUT_OF_RANGE  && 
+                if (freq.errcode == YAZ_BIB1_PRESENT_REQUEST_OUT_OF_RANGE  &&
                                 freq.errstring == 0)
                 {
                     sprintf(s, "%d", recno);
@@ -2599,9 +2599,9 @@ static Z_Records *pack_records(association *a, char *setname, Odr_int start,
 static Z_APDU *process_searchRequest(association *assoc, request *reqb)
 {
     Z_SearchRequest *req = reqb->apdu_request->u.searchRequest;
-    bend_search_rr *bsrr = 
+    bend_search_rr *bsrr =
         (bend_search_rr *)nmem_malloc(reqb->request_mem, sizeof(*bsrr));
-    
+
     yaz_log(log_requestdetail, "Got SearchRequest.");
     bsrr->association = assoc;
     bsrr->referenceId = req->referenceId;
@@ -2640,12 +2640,12 @@ static Z_APDU *process_searchRequest(association *assoc, request *reqb)
         bsrr->search_info = NULL;
         bsrr->search_input = req->otherInfo;
 
-        if (assoc->server && assoc->server->cql_transform 
+        if (assoc->server && assoc->server->cql_transform
             && req->query->which == Z_Query_type_104
             && req->query->u.type_104->which == Z_External_CQL)
         {
             /* have a CQL query and a CQL to PQF transform .. */
-            int srw_errcode = 
+            int srw_errcode =
                 cql2pqf(bsrr->stream, req->query->u.type_104->u.cql,
                         assoc->server->cql_transform, bsrr->query,
                         &bsrr->srw_sortKeys);
@@ -2653,11 +2653,11 @@ static Z_APDU *process_searchRequest(association *assoc, request *reqb)
                 bsrr->errcode = yaz_diag_srw_to_bib1(srw_errcode);
         }
 
-        if (assoc->server && assoc->server->ccl_transform 
+        if (assoc->server && assoc->server->ccl_transform
             && req->query->which == Z_Query_type_2) /*CCL*/
         {
             /* have a CCL query and a CCL to PQF transform .. */
-            int srw_errcode = 
+            int srw_errcode =
                 ccl2pqf(bsrr->stream, req->query->u.type_2,
                         assoc->server->ccl_transform, bsrr);
             if (srw_errcode)
@@ -2668,7 +2668,7 @@ static Z_APDU *process_searchRequest(association *assoc, request *reqb)
             (assoc->init->bend_search)(assoc->backend, bsrr);
     }
     else
-    { 
+    {
         /* FIXME - make a diagnostic for it */
         yaz_log(YLOG_WARN,"Search not supported ?!?!");
     }
@@ -2797,12 +2797,12 @@ static Z_APDU *response_searchRequest(association *assoc, request *reqb,
         resp->resultSetStatus = 0;
         if (bsrt->estimated_hit_count)
         {
-            resp->resultSetStatus = odr_intdup(assoc->encode, 
+            resp->resultSetStatus = odr_intdup(assoc->encode,
                                                Z_SearchResponse_estimate);
         }
         else if (bsrt->partial_resultset)
         {
-            resp->resultSetStatus = odr_intdup(assoc->encode, 
+            resp->resultSetStatus = odr_intdup(assoc->encode,
                                                Z_SearchResponse_subset);
         }
     }
@@ -2820,7 +2820,7 @@ static Z_APDU *response_searchRequest(association *assoc, request *reqb,
             wrbuf_puts(wr, req->databaseNames[i]);
         }
         wrbuf_printf(wr, " ");
-        
+
         if (bsrt->errcode)
             wrbuf_printf(wr, "ERROR %d", bsrt->errcode);
         else
@@ -2828,7 +2828,7 @@ static Z_APDU *response_searchRequest(association *assoc, request *reqb,
         wrbuf_printf(wr, " %s 1+" ODR_INT_PRINTF " ",
                      req->resultSetName, returnedrecs);
         yaz_query_to_wrbuf(wr, req->query);
-        
+
         yaz_log(log_request, "Search %s", wrbuf_cstr(wr));
         wrbuf_destroy(wr);
     }
@@ -2880,7 +2880,7 @@ static Z_APDU *process_presentRequest(association *assoc, request *reqb)
         bprr->errcode = 0;
         bprr->errstring = NULL;
         (*assoc->init->bend_present)(assoc->backend, bprr);
-        
+
         if (bprr->errcode)
         {
             resp->records = diagrec(assoc, bprr->errcode, bprr->errstring);
@@ -2891,12 +2891,12 @@ static Z_APDU *process_presentRequest(association *assoc, request *reqb)
     apdu = (Z_APDU *)odr_malloc(assoc->encode, sizeof(*apdu));
     next = odr_intdup(assoc->encode, 0);
     num = odr_intdup(assoc->encode, 0);
-    
+
     apdu->which = Z_APDU_presentResponse;
     apdu->u.presentResponse = resp;
     resp->referenceId = req->referenceId;
     resp->otherInfo = 0;
-    
+
     if (!resp->records)
     {
         *num = *req->numberOfRecordsRequested;
@@ -2904,7 +2904,7 @@ static Z_APDU *process_presentRequest(association *assoc, request *reqb)
             pack_records(assoc, req->resultSetId, *req->resultSetStartPoint,
                          num, req->recordComposition, next,
                          resp->presentStatus,
-                         req->referenceId, req->preferredRecordSyntax, 
+                         req->referenceId, req->preferredRecordSyntax,
                          &errcode);
     }
     if (log_request)
@@ -2930,7 +2930,7 @@ static Z_APDU *process_presentRequest(association *assoc, request *reqb)
         return 0;
     resp->numberOfRecordsReturned = num;
     resp->nextResultSetPosition = next;
-    
+
     return apdu;
 }
 
@@ -2993,7 +2993,7 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb)
     bsrr->stream = assoc->encode;
     bsrr->print = assoc->print;
     bsrr->step_size = &step_size;
-    bsrr->setname = yaz_oi_get_string_oid(&req->otherInfo, 
+    bsrr->setname = yaz_oi_get_string_oid(&req->otherInfo,
                                           yaz_oid_userinfo_scan_set, 1, 0);
     bsrr->entries = 0;
     /* For YAZ 2.0 and earlier it was the backend handler that
@@ -3003,7 +3003,7 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb)
        entries was modified - we assume that it is an old handler and
        that 'display_term' is _not_ set.
     */
-    if (bsrr->num_entries > 0) 
+    if (bsrr->num_entries > 0)
     {
         int i;
         bsrr->entries = (struct scan_entry *)
@@ -3021,7 +3021,7 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb)
     save_entries = bsrr->entries;  /* save it so we can compare later */
 
     bsrr->attributeset = req->attributeSet;
-    log_scan_term_level(log_requestdetail, req->termListAndStartPoint, 
+    log_scan_term_level(log_requestdetail, req->termListAndStartPoint,
                         bsrr->attributeset);
     bsrr->term_position = req->preferredPositionInResponse ?
         odr_int_to_int(*req->preferredPositionInResponse) : 1;
@@ -3037,7 +3037,7 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb)
         int i;
         Z_Entry **tab = (Z_Entry **)
             odr_malloc(assoc->encode, sizeof(*tab) * bsrr->num_entries);
-        
+
         if (bsrr->status == BEND_SCAN_PARTIAL)
             *scanStatus = Z_Scan_partial_5;
         else
@@ -3045,7 +3045,7 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb)
         res->stepSize = odr_intdup(assoc->encode, step_size);
         ents->entries = tab;
         ents->num_entries = bsrr->num_entries;
-        res->numberOfEntriesReturned = odr_intdup(assoc->encode, 
+        res->numberOfEntriesReturned = odr_intdup(assoc->encode,
                                                    ents->num_entries);
         res->positionOfTerm = odr_intdup(assoc->encode, bsrr->term_position);
         for (i = 0; i < bsrr->num_entries; i++)
@@ -3053,7 +3053,7 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb)
             Z_Entry *e;
             Z_TermInfo *t;
             Odr_oct *o;
-            
+
             tab[i] = e = (Z_Entry *)odr_malloc(assoc->encode, sizeof(*e));
             if (bsrr->entries[i].occurrences >= 0)
             {
@@ -3062,7 +3062,7 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb)
                     odr_malloc(assoc->encode, sizeof(*t));
                 t->suggestedAttributes = 0;
                 t->displayTerm = 0;
-                if (save_entries == bsrr->entries && 
+                if (save_entries == bsrr->entries &&
                     bsrr->entries[i].display_term)
                 {
                     /* the entries was _not_ set by the handler. So it's
@@ -3118,13 +3118,13 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb)
         }
 
         wrbuf_printf(wr, " ");
-        
+
         if (bsrr->errcode)
             wr_diag(wr, bsrr->errcode, bsrr->errstring);
         else
-            wrbuf_printf(wr, "OK"); 
+            wrbuf_printf(wr, "OK");
 
-        wrbuf_printf(wr, " " ODR_INT_PRINTF " - " ODR_INT_PRINTF "+" 
+        wrbuf_printf(wr, " " ODR_INT_PRINTF " - " ODR_INT_PRINTF "+"
                      ODR_INT_PRINTF "+" ODR_INT_PRINTF,
                      res->numberOfEntriesReturned ?
                      *res->numberOfEntriesReturned : 0,
@@ -3132,12 +3132,12 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb)
                       *req->preferredPositionInResponse : 1),
                      *req->numberOfTermsRequested,
                      (res->stepSize ? *res->stepSize : 1));
-        
+
         if (bsrr->setname)
             wrbuf_printf(wr, "+%s", bsrr->setname);
 
         wrbuf_printf(wr, " ");
-        yaz_scan_to_wrbuf(wr, req->termListAndStartPoint, 
+        yaz_scan_to_wrbuf(wr, req->termListAndStartPoint,
                           bsrr->attributeset);
         yaz_log(log_request, "%s", wrbuf_cstr(wr) );
         wrbuf_destroy(wr);
@@ -3175,9 +3175,9 @@ static Z_APDU *process_sortRequest(association *assoc, request *reqb)
     bsrr->sort_status = Z_SortResponse_failure;
     bsrr->errcode = 0;
     bsrr->errstring = 0;
-    
+
     (*assoc->init->bend_sort)(assoc->backend, bsrr);
-    
+
     res->referenceId = bsrr->referenceId;
     res->sortStatus = odr_intdup(assoc->encode, bsrr->sort_status);
     res->resultSetStatus = 0;
@@ -3246,14 +3246,14 @@ static Z_APDU *process_deleteRequest(association *assoc, request *reqb)
     bdrr->statuses = 0;
     if (bdrr->num_setnames > 0)
     {
-        bdrr->statuses = (int*) 
+        bdrr->statuses = (int*)
             odr_malloc(assoc->encode, sizeof(*bdrr->statuses) *
                        bdrr->num_setnames);
         for (i = 0; i < bdrr->num_setnames; i++)
             bdrr->statuses[i] = 0;
     }
     (*assoc->init->bend_delete)(assoc->backend, bdrr);
-    
+
     res->referenceId = req->referenceId;
 
     res->deleteOperationStatus = odr_intdup(assoc->encode,bdrr->delete_status);
@@ -3267,7 +3267,7 @@ static Z_APDU *process_deleteRequest(association *assoc, request *reqb)
         res->deleteListStatuses->num = bdrr->num_setnames;
         res->deleteListStatuses->elements =
             (Z_ListStatus **)
-            odr_malloc(assoc->encode, 
+            odr_malloc(assoc->encode,
                         sizeof(*res->deleteListStatuses->elements) *
                         bdrr->num_setnames);
         for (i = 0; i<bdrr->num_setnames; i++)
@@ -3341,7 +3341,7 @@ static Z_APDU *process_segmentRequest(association *assoc, request *reqb)
     req.decode = assoc->decode;
     req.print = assoc->print;
     req.association = assoc;
-    
+
     (*assoc->init->bend_segment)(assoc->backend, &req);
 
     return 0;
@@ -3367,7 +3367,7 @@ static Z_APDU *process_ESRequest(association *assoc, request *reqb)
     esrequest.association = assoc;
     esrequest.taskPackage = 0;
     esrequest.referenceId = req->referenceId;
-    
+
     if (esrequest.esr && esrequest.esr->taskSpecificParameters)
     {
         switch(esrequest.esr->taskSpecificParameters->which)
@@ -3385,7 +3385,7 @@ static Z_APDU *process_ESRequest(association *assoc, request *reqb)
     }
 
     (*assoc->init->bend_esrequest)(assoc->backend, &esrequest);
-    
+
     resp->referenceId = req->referenceId;
 
     if (esrequest.errcode == -1)
index 0182add..f16d259 100644 (file)
@@ -81,7 +81,7 @@ typedef struct request
 
     void *clientData;
     struct request *next;
-    struct request_q *q; 
+    struct request_q *q;
 } request;
 
 typedef struct request_q
index 0c974b8..0e94def 100644 (file)
@@ -185,10 +185,10 @@ size_t yaz_iconv(yaz_iconv_t cd, char **inbuf, size_t *inbytesleft,
     if (cd->init_flag)
     {
         cd->my_errno = YAZ_ICONV_UNKNOWN;
-        
+
         if (cd->encoder.init_handle)
             (*cd->encoder.init_handle)(&cd->encoder);
-        
+
         cd->unget_x = 0;
         cd->no_read_x = 0;
 
@@ -198,7 +198,7 @@ size_t yaz_iconv(yaz_iconv_t cd, char **inbuf, size_t *inbytesleft,
             size_t r = (cd->decoder.init_handle)(
                 cd, &cd->decoder,
                 inbuf ? (unsigned char *) *inbuf : 0,
-                inbytesleft ? *inbytesleft : 0, 
+                inbytesleft ? *inbytesleft : 0,
                 &no_read);
             if (r)
             {
@@ -249,7 +249,7 @@ size_t yaz_iconv(yaz_iconv_t cd, char **inbuf, size_t *inbytesleft,
                 break;
             }
             x = (*cd->decoder.read_handle)(
-                cd, &cd->decoder, 
+                cd, &cd->decoder,
                 (unsigned char *) *inbuf, *inbytesleft, &no_read);
             if (no_read == 0)
             {
index 0f564b0..8de0ca7 100644 (file)
@@ -23,7 +23,7 @@
 static const char *soap_v1_1 = "http://schemas.xmlsoap.org/soap/envelope/";
 static const char *soap_v1_2 = "http://www.w3.org/2001/06/soap-envelope";
 
-int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp, 
+int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp,
                          char **content_buf, int *content_len,
                          Z_SOAP_Handler *handlers,
                          const char *encoding,
@@ -55,7 +55,7 @@ int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp,
                                 "No Envelope element", 0);
         }
         /* check for SRU root node match */
-        
+
         for (i = 0; handlers[i].ns; i++)
             if (yaz_match_glob(handlers[i].ns, (const char *)ptr->ns->href))
                 break;
@@ -68,7 +68,7 @@ int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp,
             ret = (*handlers[i].f)(o, &p_top_tmp, &handler_data,
                                    handlers[i].client_data,
                                    (const char *)ptr->ns->href);
-            
+
             if (ret || !handler_data)
                 z_soap_error(o, p, "SOAP-ENV:Client",
                              "SOAP Handler returned error", 0);
@@ -120,7 +120,7 @@ int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp,
                 ptr = ptr->next;
         }
         /* check that Body is present */
-        if (!ptr || ptr->type != XML_ELEMENT_NODE || 
+        if (!ptr || ptr->type != XML_ELEMENT_NODE ||
             xmlStrcmp(ptr->name, BAD_CAST "Body"))
         {
             xmlFreeDoc(doc);
@@ -211,7 +211,7 @@ int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp,
             }
             else
             {
-                ret = z_soap_error(o, p, "SOAP-ENV:Client", 
+                ret = z_soap_error(o, p, "SOAP-ENV:Client",
                                    "No handler for NS", ns);
             }
         }
@@ -240,7 +240,7 @@ int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp,
             Z_SOAP_Fault *f = p->u.fault;
             xmlNodePtr fault_ptr = xmlNewChild(body_ptr, ns_env,
                                                BAD_CAST "Fault", 0);
-            xmlNewChild(fault_ptr, ns_env, BAD_CAST "faultcode", 
+            xmlNewChild(fault_ptr, ns_env, BAD_CAST "faultcode",
                         BAD_CAST f->fault_code);
             xmlNewChild(fault_ptr, ns_env, BAD_CAST "faultstring",
                         BAD_CAST f->fault_string);
@@ -251,7 +251,7 @@ int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp,
         else if (p->which == Z_SOAP_generic)
         {
             int ret, no = p->u.generic->no;
-            
+
             ret = (*handlers[no].f)(o, body_ptr, &p->u.generic->p,
                                     handlers[no].client_data,
                                     handlers[no].ns);
@@ -270,7 +270,7 @@ int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp,
         if (stylesheet)
         {
             char *content = (char *) odr_malloc(o, strlen(stylesheet) + 40);
-            
+
             xmlNodePtr pi, ptr = xmlDocGetRootElement(doc);
             sprintf(content, "type=\"text/xsl\" href=\"%s\"", stylesheet);
             pi = xmlNewPI(BAD_CAST "xml-stylesheet",
@@ -296,7 +296,7 @@ int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp,
     return 0;
 }
 #else
-int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp, 
+int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp,
                          char **content_buf, int *content_len,
                          Z_SOAP_Handler *handlers, const char *encoding,
                          const char *stylesheet)
@@ -321,7 +321,7 @@ int z_soap_codec_enc_xsl(ODR o, Z_SOAP **pp,
     return -1;
 }
 #endif
-int z_soap_codec_enc(ODR o, Z_SOAP **pp, 
+int z_soap_codec_enc(ODR o, Z_SOAP **pp,
                      char **content_buf, int *content_len,
                      Z_SOAP_Handler *handlers,
                      const char *encoding)
@@ -330,7 +330,7 @@ int z_soap_codec_enc(ODR o, Z_SOAP **pp,
                                 encoding, 0);
 }
 
-int z_soap_codec(ODR o, Z_SOAP **pp, 
+int z_soap_codec(ODR o, Z_SOAP **pp,
                  char **content_buf, int *content_len,
                  Z_SOAP_Handler *handlers)
 {
@@ -342,7 +342,7 @@ int z_soap_error(ODR o, Z_SOAP *p,
                  const char *details)
 {
     p->which = Z_SOAP_error;
-    p->u.soap_error = (Z_SOAP_Fault *) 
+    p->u.soap_error = (Z_SOAP_Fault *)
         odr_malloc(o, sizeof(*p->u.soap_error));
     p->u.soap_error->fault_code = odr_strdup(o, fault_code);
     p->u.soap_error->fault_string = odr_strdup(o, fault_string);
index 475f615..95e0cf1 100644 (file)
@@ -68,7 +68,7 @@ static void yaz_solr_decode_result_docs(ODR o, xmlNodePtr ptr,
     for (node = ptr->children; node; node = node->next)
         if (node->type == XML_ELEMENT_NODE)
             sr->num_records++;
-    
+
     if (sr->num_records)
         sr->records = odr_malloc(o, sizeof(*sr->records) * sr->num_records);
 
@@ -112,7 +112,7 @@ static int yaz_solr_decode_result(ODR o, xmlNodePtr ptr,
             {
                 sr->numberOfRecords = odr_intdup(o, odr_atoi(
                         (const char *) attr->children->content));
-            } 
+            }
             else if (!strcmp((const char *) attr->name, "start"))
             {
                 start = odr_atoi((const char *) attr->children->content);
@@ -368,7 +368,7 @@ static int yaz_solr_encode_facet_list(
                                             facet_list->elements[index]);
         if (r)
             return -1;
-        
+
     }
     return 0;
 }
@@ -382,8 +382,8 @@ int yaz_solr_encode_request(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu,
     char *uri_args;
     char *path;
     int i = 0;
-    
-    z_HTTP_header_add_basic_auth(encode, &hreq->headers, 
+
+    z_HTTP_header_add_basic_auth(encode, &hreq->headers,
                                  srw_pdu->username, srw_pdu->password);
     if (srw_pdu->which == Z_SRW_searchRetrieve_request)
     {
@@ -439,9 +439,9 @@ int yaz_solr_encode_request(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu,
     name[i++] = 0;
 
     yaz_array_to_uri(&uri_args, encode, name, value);
-    
+
     hreq->method = "GET";
-    
+
     path = (char *)
         odr_malloc(encode, strlen(hreq->path) +
                    strlen(uri_args) + strlen(solr_op) + 4);
index 2d8743b..d27c5f9 100644 (file)
@@ -93,7 +93,7 @@ static int solr_transform_parse_tok_line(solr_transform_t ct,
     int ret = 0; /* 0=OK, != 0 FAIL */
     int t;
     t = yaz_tok_move(tp);
-    
+
     while (t == YAZ_TOK_STRING && ae_num < 20)
     {
         WRBUF type_str = wrbuf_alloc();
@@ -101,7 +101,7 @@ static int solr_transform_parse_tok_line(solr_transform_t ct,
         Z_AttributeElement *elem = 0;
         const char *value_str = 0;
         /* attset type=value  OR  type=value */
-        
+
         elem = (Z_AttributeElement *) nmem_malloc(ct->nmem, sizeof(*elem));
         elem->attributeSet = 0;
         ae[ae_num] = elem;
@@ -112,19 +112,19 @@ static int solr_transform_parse_tok_line(solr_transform_t ct,
         {
             wrbuf_destroy(type_str);
             if (set_str)
-                wrbuf_destroy(set_str);                
+                wrbuf_destroy(set_str);
             break;
         }
-        if (t == YAZ_TOK_STRING)  
-        {  
+        if (t == YAZ_TOK_STRING)
+        {
             wrbuf_puts(ct->w, " ");
             wrbuf_puts(ct->w, yaz_tok_parse_string(tp));
             set_str = type_str;
-            
+
             elem->attributeSet =
                 yaz_string_to_oid_nmem(yaz_oid_std(), CLASS_ATTSET,
                                        wrbuf_cstr(set_str), ct->nmem);
-            
+
             type_str = wrbuf_alloc();
             wrbuf_puts(type_str, yaz_tok_parse_string(tp));
             t = yaz_tok_move(tp);
@@ -135,7 +135,7 @@ static int solr_transform_parse_tok_line(solr_transform_t ct,
         {
             wrbuf_destroy(type_str);
             if (set_str)
-                wrbuf_destroy(set_str);                
+                wrbuf_destroy(set_str);
             yaz_log(YLOG_WARN, "Expected numeric attribute type");
             ret = -1;
             break;
@@ -143,8 +143,8 @@ static int solr_transform_parse_tok_line(solr_transform_t ct,
 
         wrbuf_destroy(type_str);
         if (set_str)
-            wrbuf_destroy(set_str);                
-        
+            wrbuf_destroy(set_str);
+
         if (t != '=')
         {
             yaz_log(YLOG_WARN, "Expected = after after attribute type");
@@ -204,7 +204,7 @@ static int solr_transform_parse_tok_line(solr_transform_t ct,
             (*pp)->attr_list.attributes = (Z_AttributeElement **)
                 nmem_malloc(ct->nmem,
                             ae_num * sizeof(Z_AttributeElement *));
-            memcpy((*pp)->attr_list.attributes, ae, 
+            memcpy((*pp)->attr_list.attributes, ae,
                    ae_num * sizeof(Z_AttributeElement *));
         }
         (*pp)->next = 0;
@@ -232,7 +232,7 @@ int solr_transform_define_pattern(solr_transform_t ct, const char *pattern,
     yaz_tok_parse_destroy(tp);
     return r;
 }
-    
+
 solr_transform_t solr_transform_open_FILE(FILE *f)
 {
     solr_transform_t ct = solr_transform_create();
@@ -331,7 +331,7 @@ static int compare_attr(Z_AttributeElement *a, Z_AttributeElement *b)
 
     z_AttributeElement(odr_a, &a, 0, 0);
     z_AttributeElement(odr_b, &b, 0, 0);
-    
+
     buf_a = odr_getbuf(odr_a, &len_a, 0);
     buf_b = odr_getbuf(odr_b, &len_b, 0);
 
@@ -370,7 +370,7 @@ const char *solr_lookup_reverse(solr_transform_t ct,
                 }
                 if (j == attributes->num_attributes)
                     break; /* i was not found at all.. try next pattern */
-                    
+
             }
             if (i == e->attr_list.num_attributes)
                 return e->pattern + clen;
@@ -378,7 +378,7 @@ const char *solr_lookup_reverse(solr_transform_t ct,
     }
     return 0;
 }
-                                      
+
 static const char *solr_lookup_property(solr_transform_t ct,
                                        const char *pat1, const char *pat2,
                                        const char *pat3)
@@ -396,7 +396,7 @@ static const char *solr_lookup_property(solr_transform_t ct,
         sprintf(pattern, "%.39s", pat1);
     else
         return 0;
-    
+
     for (e = ct->entry; e; e = e->next)
     {
         if (!solr_strcmp(e->pattern, pattern))
@@ -414,11 +414,11 @@ int solr_pr_attr_uri(solr_transform_t ct, const char *category,
     const char *res = 0;
     const char *eval = val ? val : default_val;
     const char *prefix = 0;
-    
+
     if (uri)
     {
         struct solr_prop_entry *e;
-        
+
         for (e = ct->entry; e; e = e->next)
             if (!memcmp(e->pattern, "set.", 4) && e->value &&
                 !strcmp(e->value, uri))
@@ -541,19 +541,19 @@ static int solr_pr_prox(solr_transform_t ct, struct solr_node *mods,
                 proxrel = 5;
             else if (!strcmp(relation, "<"))
                 proxrel = 1;
-            else if (!strcmp(relation, ">=")) 
+            else if (!strcmp(relation, ">="))
                 proxrel = 4;
             else if (!strcmp(relation, "<="))
                 proxrel = 2;
             else if (!strcmp(relation, "<>"))
                 proxrel = 6;
-            else 
+            else
             {
                 ct->error = YAZ_SRW_UNSUPP_PROX_RELATION;
                 ct->addinfo = xstrdup(relation);
                 return 0;
             }
-        } 
+        }
         else if (!strcmp(name, "ordered"))
             ordered = 1;
         else if (!strcmp(name, "unordered"))
@@ -568,14 +568,14 @@ static int solr_pr_prox(solr_transform_t ct, struct solr_node *mods,
                 unit = 4;
             else if (!strcmp(term, "element"))
                 unit = 8;
-            else 
+            else
             {
                 ct->error = YAZ_SRW_UNSUPP_PROX_UNIT;
                 ct->addinfo = xstrdup(term);
                 return 0;
             }
-        } 
-        else 
+        }
+        else
         {
             ct->error = YAZ_SRW_UNSUPP_BOOLEAN_MODIFIER;
             ct->addinfo = xstrdup(name);
@@ -682,8 +682,8 @@ static void emit_term(solr_transform_t ct,
          * there's no mapping for it, that's fine: we just use a
          * general pattern-matching attribute.
          */
-        if (first_wc == term && second_wc == term + length-1 
-            && *first_wc == '*' && *second_wc == '*' 
+        if (first_wc == term && second_wc == term + length-1
+            && *first_wc == '*' && *second_wc == '*'
             && solr_pr_attr(ct, "truncation", "both", 0, pr, client_data, 0))
         {
             term++;
@@ -791,7 +791,7 @@ static void emit_terms(solr_transform_t ct,
             (*pr)("@", client_data);
             (*pr)(op, client_data);
             (*pr)(" ", client_data);
-        }            
+        }
         emit_term(ct, cn, ne->u.st.term, strlen(ne->u.st.term),
                   pr, client_data);
     }
@@ -881,11 +881,11 @@ void solr_transform_r(solr_transform_t ct,
         (*pr)(cn->u.boolean.value, client_data);
         (*pr)(" ", client_data);
         mods = cn->u.boolean.modifiers;
-        if (!strcmp(cn->u.boolean.value, "prox")) 
+        if (!strcmp(cn->u.boolean.value, "prox"))
         {
             if (!solr_pr_prox(ct, mods, pr, client_data))
                 return;
-        } 
+        }
         else if (mods)
         {
             /* Boolean modifiers other than on proximity not supported */
index 7e0f7fc..e6c032d 100644 (file)
@@ -25,10 +25,10 @@ Z_SortKeySpecList *yaz_sort_spec(ODR out, const char *arg)
     Z_SortKeySpecList *sksl = (Z_SortKeySpecList *)
         odr_malloc(out, sizeof(*sksl));
     int off;
-    
+
     sksl->num_specs = 0;
     sksl->specs = (Z_SortKeySpec **)odr_malloc(out, sizeof(sksl->specs) * 20);
-    
+
     while ((sscanf(arg, "%63s %63s%n", sort_string_buf,
                    sort_flags, &off)) == 2  && off > 1)
     {
@@ -37,14 +37,14 @@ Z_SortKeySpecList *yaz_sort_spec(ODR out, const char *arg)
         char *sort_string = sort_string_buf;
         Z_SortKeySpec *sks = (Z_SortKeySpec *) odr_malloc(out, sizeof(*sks));
         Z_SortKey *sk = (Z_SortKey *) odr_malloc(out, sizeof(*sk));
-        
+
         arg += off;
         sksl->specs[sksl->num_specs++] = sks;
         sks->sortElement = (Z_SortElement *)
             odr_malloc(out, sizeof(*sks->sortElement));
         sks->sortElement->which = Z_SortElement_generic;
         sks->sortElement->u.generic = sk;
-        
+
         if ((sort_string_sep = strchr(sort_string, '=')))
         {
             int i = 0;
@@ -55,7 +55,7 @@ Z_SortKeySpecList *yaz_sort_spec(ODR out, const char *arg)
             sk->u.sortAttributes->list = (Z_AttributeList *)
                 odr_malloc(out, sizeof(*sk->u.sortAttributes->list));
             sk->u.sortAttributes->list->attributes = (Z_AttributeElement **)
-                odr_malloc(out, 10 * 
+                odr_malloc(out, 10 *
                             sizeof(*sk->u.sortAttributes->list->attributes));
             while (i < 10 && sort_string && sort_string_sep)
             {
@@ -87,7 +87,7 @@ Z_SortKeySpecList *yaz_sort_spec(ODR out, const char *arg)
 
         sks->which = Z_SortKeySpec_null;
         sks->u.null = odr_nullval ();
-        
+
         for (i = 0; sort_flags[i]; i++)
         {
             switch (sort_flags[i])
@@ -300,7 +300,7 @@ int yaz_srw_sortkeys_to_sort_spec(const char *srw_sortkeys, WRBUF w)
     int num_sortspec = 0;
     int i;
     NMEM nmem = nmem_create();
-    
+
     if (srw_sortkeys)
         nmem_strsplit_blank(nmem, srw_sortkeys, &sortspec, &num_sortspec);
     if (num_sortspec > 0)
@@ -313,7 +313,7 @@ int yaz_srw_sortkeys_to_sort_spec(const char *srw_sortkeys, WRBUF w)
             int case_sensitive = 0;
             const char *missing = 0;
             nmem_strsplitx(nmem, ",", sortspec[i], &arg, &num_arg, 0);
-            
+
             if (num_arg > 2 && arg[2][0])
                 ascending = atoi(arg[2]);
             if (num_arg > 3 && arg[3][0])
index 43e9852..0fa75e4 100644 (file)
@@ -137,7 +137,7 @@ yaz_spipe_t yaz_spipe_create(int port_to_use, WRBUF *err_msg)
 #ifndef WIN32
         {
             unsigned long one = 1;
-            if (setsockopt(p->m_socket, SOL_SOCKET, SO_REUSEADDR, (char*) 
+            if (setsockopt(p->m_socket, SOL_SOCKET, SO_REUSEADDR, (char*)
                            &one, sizeof(one)))
             {
                 if (err_msg)
@@ -152,7 +152,7 @@ yaz_spipe_t yaz_spipe_create(int port_to_use, WRBUF *err_msg)
         add.sin_port = htons(port_to_use);
         add.sin_addr.s_addr = INADDR_ANY;
         addr = ( struct sockaddr *) &add;
-        
+
         if (bind(p->m_socket, addr, sizeof(struct sockaddr_in)))
         {
             if (err_msg)
@@ -160,7 +160,7 @@ yaz_spipe_t yaz_spipe_create(int port_to_use, WRBUF *err_msg)
             yaz_spipe_destroy(p);
             return 0;
         }
-        
+
         if (listen(p->m_socket, 3) < 0)
         {
             if (err_msg)
@@ -178,7 +178,7 @@ yaz_spipe_t yaz_spipe_create(int port_to_use, WRBUF *err_msg)
             yaz_spipe_destroy(p);
             return 0;
         }
-        
+
         memcpy(&add.sin_addr.s_addr, &tmpadd, sizeof(struct in_addr));
         p->m_fd[1] = socket(AF_INET, SOCK_STREAM, 0);
         if (p->m_fd[1] == YAZ_INVALID_SOCKET)
index 8e3196b..7a3440f 100644 (file)
--- a/src/srw.c
+++ b/src/srw.c
@@ -155,9 +155,9 @@ static int match_xsd_XML_n2(xmlNodePtr ptr, const char *elem, ODR o,
         {
             /* copy node to get NS right (bug #740). */
             xmlNode *tmp = xmlCopyNode(ptr, 1);
-            
+
             xmlNodeDump(buf, tmp->doc, tmp, 0, 0);
-            
+
             xmlFreeNode(tmp);
             no_root_nodes++;
         }
@@ -249,13 +249,13 @@ static int yaz_srw_record(ODR o, xmlNodePtr pptr, Z_SRW_record *rec,
 
         for (ptr = pptr->children; ptr; ptr = ptr->next)
         {
-            
-            if (match_xsd_string(ptr, "recordSchema", o, 
+
+            if (match_xsd_string(ptr, "recordSchema", o,
                                  &rec->recordSchema))
                 ;
             else if (match_xsd_string(ptr, "recordPacking", o, &spack))
                 ;  /* can't rely on it: in SRU 2.0 it's different semantics */
-            else if (match_xsd_integer(ptr, "recordPosition", o, 
+            else if (match_xsd_integer(ptr, "recordPosition", o,
                                        &rec->recordPosition))
                 ;
             else if (match_element(ptr, "recordData"))
@@ -270,24 +270,24 @@ static int yaz_srw_record(ODR o, xmlNodePtr pptr, Z_SRW_record *rec,
                 if (p)
                 {
                     match_xsd_XML_n2(
-                        ptr, "recordData", o, 
+                        ptr, "recordData", o,
                         &rec->recordData_buf, &rec->recordData_len, 1);
                     rec->recordPacking = Z_SRW_recordPacking_XML;
                 }
                 else
                 {
                     match_xsd_string_n(
-                        ptr, "recordData", o, 
+                        ptr, "recordData", o,
                         &rec->recordData_buf, &rec->recordData_len);
                     rec->recordPacking = Z_SRW_recordPacking_string;
                 }
             }
-            else if (match_xsd_XML_n(ptr, "extraRecordData", o, 
+            else if (match_xsd_XML_n(ptr, "extraRecordData", o,
                                      &ex.extraRecordData_buf,
                                      &ex.extraRecordData_len) )
                 ;
             else
-                match_xsd_string(ptr, "recordIdentifier", o, 
+                match_xsd_string(ptr, "recordIdentifier", o,
                                  &ex.recordIdentifier);
         }
         if (ex.extraRecordData_buf || ex.recordIdentifier)
@@ -390,8 +390,8 @@ static int yaz_srw_version(ODR o, xmlNodePtr pptr, Z_SRW_recordVersion *rec,
         rec->versionValue = 0;
         for (ptr = pptr->children; ptr; ptr = ptr->next)
         {
-            
-            if (match_xsd_string(ptr, "versionType", o, 
+
+            if (match_xsd_string(ptr, "versionType", o,
                                  &rec->versionType))
                 ;
             else
@@ -407,7 +407,7 @@ static int yaz_srw_version(ODR o, xmlNodePtr pptr, Z_SRW_recordVersion *rec,
     return 0;
 }
 
-static int yaz_srw_versions(ODR o, xmlNodePtr pptr, 
+static int yaz_srw_versions(ODR o, xmlNodePtr pptr,
                             Z_SRW_recordVersion **vers,
                             int *num, void *client_data, const char *ns)
 {
@@ -561,7 +561,7 @@ static int yaz_srw_decode_diagnostics(ODR o, xmlNodePtr pptr,
         (*recs)[i].uri = 0;
         (*recs)[i].details = 0;
         (*recs)[i].message = 0;
-    } 
+    }
     for (i = 0, ptr = pptr; ptr; ptr = ptr->next)
     {
         if (ptr->type == XML_ELEMENT_NODE &&
@@ -573,10 +573,10 @@ static int yaz_srw_decode_diagnostics(ODR o, xmlNodePtr pptr,
             (*recs)[i].message = 0;
             for (rptr = ptr->children; rptr; rptr = rptr->next)
             {
-                if (match_xsd_string(rptr, "uri", o, 
+                if (match_xsd_string(rptr, "uri", o,
                                      &(*recs)[i].uri))
                     ;
-                else if (match_xsd_string(rptr, "details", o, 
+                else if (match_xsd_string(rptr, "details", o,
                                           &(*recs)[i].details))
                     ;
                 else
@@ -599,7 +599,7 @@ int sru_decode_surrogate_diagnostics(const char *buf, size_t len,
         xmlNodePtr ptr = xmlDocGetRootElement(doc);
         while (ptr && ptr->type != XML_ELEMENT_NODE)
             ptr = ptr->next;
-        if (ptr && ptr->ns 
+        if (ptr && ptr->ns
             && !xmlStrcmp(ptr->ns->href,
                           BAD_CAST "http://www.loc.gov/zing/srw/diagnostic/"))
         {
@@ -668,10 +668,10 @@ static int yaz_srw_term(ODR o, xmlNodePtr pptr, Z_SRW_scanTerm *term,
         {
             if (match_xsd_string(ptr, "value", o,  &term->value))
                 ;
-            else if (match_xsd_integer(ptr, "numberOfRecords", o, 
+            else if (match_xsd_integer(ptr, "numberOfRecords", o,
                                        &term->numberOfRecords))
                 ;
-            else if (match_xsd_string(ptr, "displayTerm", o, 
+            else if (match_xsd_string(ptr, "displayTerm", o,
                                       &term->displayTerm))
                 ;
             else
@@ -737,14 +737,14 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
 
         while (method && method->type == XML_TEXT_NODE)
             method = method->next;
-        
+
         if (!method)
             return -1;
         if (method->type != XML_ELEMENT_NODE)
             return -1;
 
         *p = yaz_srw_get_core_v_1_1(o);
-        
+
         if (!xmlStrcmp(method->name, BAD_CAST "searchRetrieveRequest"))
         {
             xmlNodePtr ptr = method->children;
@@ -771,13 +771,13 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
                 if (match_xsd_string(ptr, "version", o,
                                      &(*p)->srw_version))
                     ;
-                else if (match_xsd_string(ptr, "query", o, 
+                else if (match_xsd_string(ptr, "query", o,
                                           &req->query.cql))
                     req->query_type = Z_SRW_query_type_cql;
-                else if (match_xsd_string(ptr, "pQuery", o, 
+                else if (match_xsd_string(ptr, "pQuery", o,
                                           &req->query.pqf))
                     req->query_type = Z_SRW_query_type_pqf;
-                else if (match_xsd_string(ptr, "xQuery", o, 
+                else if (match_xsd_string(ptr, "xQuery", o,
                                           &req->query.xcql))
                     req->query_type = Z_SRW_query_type_xcql;
                 else if (match_xsd_integer(ptr, "startRecord", o,
@@ -789,7 +789,7 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
                 else if (match_xsd_string(ptr, "recordPacking", o,
                                           &req->recordPacking))
                     ;
-                else if (match_xsd_string(ptr, "recordSchema", o, 
+                else if (match_xsd_string(ptr, "recordSchema", o,
                                           &req->recordSchema))
                     ;
                 else if (match_xsd_string(ptr, "recordXPath", o,
@@ -798,7 +798,7 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
                 else if (match_xsd_integer(ptr, "resultSetTTL", o,
                                            &req->resultSetTTL))
                     ;
-                else if (match_xsd_string(ptr, "sortKeys", o, 
+                else if (match_xsd_string(ptr, "sortKeys", o,
                                           &req->sort.sortKeys))
                     req->sort_type = Z_SRW_sort_type_sort;
                 else if (match_xsd_string(ptr, "stylesheet", o,
@@ -838,17 +838,17 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
                 if (match_xsd_string(ptr, "version", o,
                                      &(*p)->srw_version))
                     ;
-                else if (match_xsd_XML_n(ptr, "extraResponseData", o, 
+                else if (match_xsd_XML_n(ptr, "extraResponseData", o,
                                          &(*p)->extraResponseData_buf,
                                          &(*p)->extraResponseData_len))
                     ;
-                else if (match_xsd_integer(ptr, "numberOfRecords", o, 
+                else if (match_xsd_integer(ptr, "numberOfRecords", o,
                                            &res->numberOfRecords))
                     ;
-                else if (match_xsd_string(ptr, "resultSetId", o, 
+                else if (match_xsd_string(ptr, "resultSetId", o,
                                           &res->resultSetId))
                     ;
-                else if (match_xsd_integer(ptr, "resultSetIdleTime", o, 
+                else if (match_xsd_integer(ptr, "resultSetIdleTime", o,
                                            &res->resultSetIdleTime))
                     ;
                 else if (match_element(ptr, "records"))
@@ -870,7 +870,7 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
         {
             Z_SRW_explainRequest *req;
             xmlNodePtr ptr = method->children;
-            
+
             (*p)->which = Z_SRW_explain_request;
             req = (*p)->u.explain_request = (Z_SRW_explainRequest *)
                 odr_malloc(o, sizeof(*req));
@@ -882,7 +882,7 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
                 if (match_xsd_string(ptr, "version", o,
                                      &(*p)->srw_version))
                     ;
-                else if (match_xsd_XML_n(ptr, "extraResponseData", o, 
+                else if (match_xsd_XML_n(ptr, "extraResponseData", o,
                                          &(*p)->extraResponseData_buf,
                                          &(*p)->extraResponseData_len))
                     ;
@@ -916,7 +916,7 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
                 if (match_xsd_string(ptr, "version", o,
                                      &(*p)->srw_version))
                     ;
-                else if (match_xsd_XML_n(ptr, "extraResponseData", o, 
+                else if (match_xsd_XML_n(ptr, "extraResponseData", o,
                                          &(*p)->extraResponseData_buf,
                                          &(*p)->extraResponseData_len))
                     ;
@@ -944,13 +944,13 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
             req->maximumTerms = 0;
             req->stylesheet = 0;
             req->database = 0;
-            
+
             for (; ptr; ptr = ptr->next)
             {
                 if (match_xsd_string(ptr, "version", o,
                                      &(*p)->srw_version))
                     ;
-                else if (match_xsd_XML_n(ptr, "extraResponseData", o, 
+                else if (match_xsd_XML_n(ptr, "extraResponseData", o,
                                          &(*p)->extraResponseData_buf,
                                          &(*p)->extraResponseData_len))
                     ;
@@ -987,13 +987,13 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
             res->num_terms = 0;
             res->diagnostics = 0;
             res->num_diagnostics = 0;
-            
+
             for (; ptr; ptr = ptr->next)
             {
                 if (match_xsd_string(ptr, "version", o,
                                      &(*p)->srw_version))
                     ;
-                else if (match_xsd_XML_n(ptr, "extraResponseData", o, 
+                else if (match_xsd_XML_n(ptr, "extraResponseData", o,
                                          &(*p)->extraResponseData_buf,
                                          &(*p)->extraResponseData_len))
                     ;
@@ -1021,7 +1021,7 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
         Z_SRW_PDU **p = handler_data;
         xmlNsPtr ns_srw;
         xmlNodePtr ptr = 0;
-        
+
         if ((*p)->which == Z_SRW_searchRetrieve_request)
         {
             Z_SRW_searchRetrieveRequest *req = (*p)->u.request;
@@ -1174,10 +1174,10 @@ int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
         else
             return -1;
         if (ptr && (*p)->extraResponseData_len)
-            add_XML_n(ptr, "extraResponseData", 
-                      (*p)->extraResponseData_buf, 
+            add_XML_n(ptr, "extraResponseData",
+                      (*p)->extraResponseData_buf,
                       (*p)->extraResponseData_len, ns_srw);
-            
+
 
     }
     return 0;
@@ -1195,14 +1195,14 @@ int yaz_ucp_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
 
         while (method && method->type == XML_TEXT_NODE)
             method = method->next;
-        
+
         if (!method)
             return -1;
         if (method->type != XML_ELEMENT_NODE)
             return -1;
 
         *p = yaz_srw_get_core_v_1_1(o);
-        
+
         if (!xmlStrcmp(method->name, BAD_CAST "updateRequest"))
         {
             xmlNodePtr ptr = method->children;
@@ -1228,7 +1228,7 @@ int yaz_ucp_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
                 if (match_xsd_string(ptr, "version", o,
                                      &(*p)->srw_version))
                     ;
-                else if (match_xsd_string(ptr, "action", o, 
+                else if (match_xsd_string(ptr, "action", o,
                                           &oper)){
                     if (oper)
                     {
@@ -1285,13 +1285,13 @@ int yaz_ucp_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
                 if (match_xsd_string(ptr, "version", o,
                                      &(*p)->srw_version))
                     ;
-                else if (match_xsd_string(ptr, "operationStatus", o, 
+                else if (match_xsd_string(ptr, "operationStatus", o,
                                           &res->operationStatus ))
                     ;
-                else if (match_xsd_string(ptr, "recordIdentifier", o, 
+                else if (match_xsd_string(ptr, "recordIdentifier", o,
                                           &res->recordId))
                     ;
-                else if (match_element(ptr, "recordVersions" )) 
+                else if (match_element(ptr, "recordVersions" ))
                     yaz_srw_versions(o, ptr, &res->recordVersions,
                                      &res->num_recordVersions,
                                      client_data, ns_ucp_str);
@@ -1348,8 +1348,8 @@ int yaz_ucp_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
            }
            if (req->extraRequestData_len)
             {
-                add_XML_n(ptr, "extraRequestData", 
-                          req->extraRequestData_buf, 
+                add_XML_n(ptr, "extraRequestData",
+                          req->extraRequestData_buf,
                           req->extraRequestData_len, ns_srw);
             }
            add_xsd_string(ptr, "stylesheet", req->stylesheet);
@@ -1358,12 +1358,12 @@ int yaz_ucp_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
         else if ((*p)->which == Z_SRW_update_response)
         {
             Z_SRW_updateResponse *res = (*p)->u.update_response;
-            xmlNodePtr ptr = xmlNewChild(pptr, 0, (xmlChar *) 
+            xmlNodePtr ptr = xmlNewChild(pptr, 0, (xmlChar *)
                                          "updateResponse", 0);
            ns_ucp = xmlNewNs(ptr, BAD_CAST ns_ucp_str, BAD_CAST "zu");
            xmlSetNs(ptr, ns_ucp);
             ns_srw = xmlNewNs(ptr, BAD_CAST ns_srw_str, BAD_CAST "zs");
-            
+
            add_xsd_string_ns(ptr, "version", (*p)->srw_version, ns_srw);
             add_xsd_string(ptr, "operationStatus", res->operationStatus );
             add_xsd_string(ptr, "recordIdentifier", res->recordId );
@@ -1383,15 +1383,15 @@ int yaz_ucp_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
                 xmlNsPtr ns_diag =
                     xmlNewNs(pptr, BAD_CAST YAZ_XMLNS_DIAG_v1_1,
                              BAD_CAST "diag" );
-                
+
                xmlNodePtr rptr = xmlNewChild(ptr, ns_diag, BAD_CAST "diagnostics", 0);
                yaz_srw_diagnostics(o, rptr, &res->diagnostics,
                                     &res->num_diagnostics, client_data,
                                     ns_ucp_str);
             }
            if (res->extraResponseData_len)
-                add_XML_n(ptr, "extraResponseData", 
-                          res->extraResponseData_buf, 
+                add_XML_n(ptr, "extraResponseData",
+                          res->extraResponseData_buf,
                           res->extraResponseData_len, ns_srw);
         }
         else
index 3f42ff6..f7c8a2f 100644 (file)
@@ -148,7 +148,7 @@ void yaz_uri_val_int(const char *path, const char *name, ODR o, Odr_int **intp)
         *intp = odr_intdup(o, atoi(v));
 }
 
-void yaz_mk_srw_diagnostic(ODR o, Z_SRW_diagnostic *d, 
+void yaz_mk_srw_diagnostic(ODR o, Z_SRW_diagnostic *d,
                            const char *uri, const char *message,
                            const char *details)
 {
@@ -163,11 +163,11 @@ void yaz_mk_srw_diagnostic(ODR o, Z_SRW_diagnostic *d,
         d->details = 0;
 }
 
-void yaz_mk_std_diagnostic(ODR o, Z_SRW_diagnostic *d, 
+void yaz_mk_std_diagnostic(ODR o, Z_SRW_diagnostic *d,
                            int code, const char *details)
 {
     char uri[40];
-    
+
     sprintf(uri, "info:srw/diagnostic/1/%d", code);
     yaz_mk_srw_diagnostic(o, d, uri, 0, details);
 }
@@ -190,7 +190,7 @@ void yaz_add_srw_diagnostic(ODR o, Z_SRW_diagnostic **d,
                             int *num, int code, const char *addinfo)
 {
     char uri[40];
-    
+
     sprintf(uri, "info:srw/diagnostic/1/%d", code);
     yaz_add_srw_diagnostic_uri(o, d, num, uri, 0, addinfo);
 }
@@ -200,7 +200,7 @@ void yaz_add_sru_update_diagnostic(ODR o, Z_SRW_diagnostic **d,
                                    int *num, int code, const char *addinfo)
 {
     char uri[40];
-    
+
     sprintf(uri, "info:srw/diagnostic/12/%d", code);
     yaz_add_srw_diagnostic_uri(o, d, num, uri, 0, addinfo);
 }
@@ -215,9 +215,9 @@ void yaz_mk_sru_surrogate(ODR o, Z_SRW_record *record, int pos,
         len += strlen(message);
     if (details)
         len += strlen(details);
-    
+
     record->recordData_buf = (char *) odr_malloc(o, len);
-    
+
     sprintf(record->recordData_buf, "<diagnostic "
             "xmlns=\"http://www.loc.gov/zing/srw/diagnostic/\">\n"
             " <uri>info:srw/diagnostic/1/%d</uri>\n", code);
@@ -237,7 +237,7 @@ void yaz_mk_sru_surrogate(ODR o, Z_SRW_record *record, int pos,
 static void grab_charset(ODR o, const char *content_type, char **charset)
 {
     if (charset)
-    { 
+    {
         const char *charset_p = 0;
         if (content_type && (charset_p = strstr(content_type, "; charset=")))
         {
@@ -260,7 +260,7 @@ int yaz_srw_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
     {
         const char *content_type = z_HTTP_header_lookup(hreq->headers,
                                                         "Content-Type");
-        if (content_type && 
+        if (content_type &&
             (!yaz_strcmp_del("text/xml", content_type, "; ") ||
              !yaz_strcmp_del("application/soap+xml", content_type, "; ") ||
              !yaz_strcmp_del("text/plain", content_type, "; ")))
@@ -268,7 +268,7 @@ int yaz_srw_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
             char *db = "Default";
             const char *p0 = hreq->path, *p1;
             int ret = -1;
-            
+
             static Z_SOAP_Handler soap_handlers[4] = {
 #if YAZ_HAVE_XML2
                 { YAZ_XMLNS_SRU_v1_1, 0, (Z_SOAP_fun) yaz_srw_codec },
@@ -277,7 +277,7 @@ int yaz_srw_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
 #endif
                 {0, 0, 0}
             };
-            
+
             if (*p0 == '/')
                 p0++;
             p1 = strchr(p0, '?');
@@ -287,14 +287,14 @@ int yaz_srw_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
                 db = yaz_decode_sru_dbpath_odr(decode, p0, p1 - p0);
             grab_charset(decode, content_type, charset);
 
-            ret = z_soap_codec(decode, soap_package, 
+            ret = z_soap_codec(decode, soap_package,
                                &hreq->content_buf, &hreq->content_len,
                                soap_handlers);
             if (ret == 0 && (*soap_package)->which == Z_SOAP_generic)
             {
                 *srw_pdu = (Z_SRW_PDU*) (*soap_package)->u.generic->p;
                 yaz_srw_decodeauth(*srw_pdu, hreq, 0, 0, decode);
-                
+
                 if ((*srw_pdu)->which == Z_SRW_searchRetrieve_request &&
                     (*srw_pdu)->u.request->database == 0)
                     (*srw_pdu)->u.request->database = db;
@@ -320,7 +320,7 @@ int yaz_srw_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
 }
 
 #if YAZ_HAVE_XML2
-static int yaz_sru_decode_integer(ODR odr, const char *pname, 
+static int yaz_sru_decode_integer(ODR odr, const char *pname,
                                   const char *valstr, Odr_int **valp,
                                   Z_SRW_diagnostic **diag, int *num_diag,
                                   int min_value)
@@ -347,7 +347,7 @@ static int yaz_sru_decode_integer(ODR odr, const char *pname,
 
 /**
    http://www.loc.gov/z3950/agency/zing/srw/service.html
-*/ 
+*/
 int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
                    Z_SOAP **soap_package, ODR decode, char **charset,
                    Z_SRW_diagnostic **diag, int *num_diag)
@@ -367,7 +367,7 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
       not  "multipart/form-data" .
     */
     if (!strcmp(hreq->method, "GET")
-        || 
+        ||
         (!strcmp(hreq->method, "POST") && content_type &&
          !yaz_strcmp_del("application/x-www-form-urlencoded",
                          content_type, "; ")))
@@ -487,12 +487,12 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
                                    YAZ_SRW_UNSUPP_VERSION, "1.2");
             version = "1.2";
         }
-        
+
         if (!operation)
         {
             if (uri_name)
                 yaz_add_srw_diagnostic(
-                    decode, diag, num_diag, 
+                    decode, diag, num_diag,
                     YAZ_SRW_MANDATORY_PARAMETER_NOT_SUPPLIED, "operation");
             operation = "explain";
         }
@@ -516,7 +516,7 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
             }
             else
                 yaz_add_srw_diagnostic(
-                    decode, diag, num_diag, 
+                    decode, diag, num_diag,
                     YAZ_SRW_MANDATORY_PARAMETER_NOT_SUPPLIED, "query");
 
             if (sortKeys)
@@ -529,11 +529,11 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
             sr->u.request->recordPacking = recordPacking;
             sr->u.request->stylesheet = stylesheet;
 
-            yaz_sru_decode_integer(decode, "maximumRecords", maximumRecords, 
-                                   &sr->u.request->maximumRecords, 
+            yaz_sru_decode_integer(decode, "maximumRecords", maximumRecords,
+                                   &sr->u.request->maximumRecords,
                                    diag, num_diag, 0);
-            
-            yaz_sru_decode_integer(decode, "startRecord", startRecord, 
+
+            yaz_sru_decode_integer(decode, "startRecord", startRecord,
                                    &sr->u.request->startRecord,
                                    diag, num_diag, 1);
 
@@ -542,14 +542,14 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
             (*soap_package) = (Z_SOAP *)
                 odr_malloc(decode, sizeof(**soap_package));
             (*soap_package)->which = Z_SOAP_generic;
-            
+
             (*soap_package)->u.generic = (Z_SOAP_Generic *)
                 odr_malloc(decode, sizeof(*(*soap_package)->u.generic));
-            
+
             (*soap_package)->u.generic->p = sr;
             (*soap_package)->u.generic->ns = soap_handlers[0].ns;
             (*soap_package)->u.generic->no = 0;
-            
+
             (*soap_package)->ns = "SRU";
 
             return 0;
@@ -572,14 +572,14 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
             (*soap_package) = (Z_SOAP *)
                 odr_malloc(decode, sizeof(**soap_package));
             (*soap_package)->which = Z_SOAP_generic;
-            
+
             (*soap_package)->u.generic = (Z_SOAP_Generic *)
                 odr_malloc(decode, sizeof(*(*soap_package)->u.generic));
-            
+
             (*soap_package)->u.generic->p = sr;
             (*soap_package)->u.generic->ns = soap_handlers[0].ns;
             (*soap_package)->u.generic->no = 0;
-            
+
             (*soap_package)->ns = "SRU";
 
             return 0;
@@ -607,17 +607,17 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
             }
             else
                 yaz_add_srw_diagnostic(
-                    decode, diag, num_diag, 
+                    decode, diag, num_diag,
                     YAZ_SRW_MANDATORY_PARAMETER_NOT_SUPPLIED, "scanClause");
             sr->u.scan_request->database = db;
-            
+
             yaz_sru_decode_integer(decode, "maximumTerms",
-                                   maximumTerms, 
+                                   maximumTerms,
                                    &sr->u.scan_request->maximumTerms,
                                    diag, num_diag, 0);
-            
+
             yaz_sru_decode_integer(decode, "responsePosition",
-                                   responsePosition, 
+                                   responsePosition,
                                    &sr->u.scan_request->responsePosition,
                                    diag, num_diag, 0);
 
@@ -626,14 +626,14 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
             (*soap_package) = (Z_SOAP *)
                 odr_malloc(decode, sizeof(**soap_package));
             (*soap_package)->which = Z_SOAP_generic;
-            
+
             (*soap_package)->u.generic = (Z_SOAP_Generic *)
                 odr_malloc(decode, sizeof(*(*soap_package)->u.generic));
-            
+
             (*soap_package)->u.generic->p = sr;
             (*soap_package)->u.generic->ns = soap_handlers[0].ns;
             (*soap_package)->u.generic->no = 0;
-            
+
             (*soap_package)->ns = "SRU";
 
             return 0;
@@ -655,17 +655,17 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu,
             (*soap_package) = (Z_SOAP *)
                 odr_malloc(decode, sizeof(**soap_package));
             (*soap_package)->which = Z_SOAP_generic;
-            
+
             (*soap_package)->u.generic = (Z_SOAP_Generic *)
                 odr_malloc(decode, sizeof(*(*soap_package)->u.generic));
-            
+
             (*soap_package)->u.generic->p = sr;
             (*soap_package)->u.generic->ns = soap_handlers[0].ns;
             (*soap_package)->u.generic->no = 0;
-            
+
             (*soap_package)->ns = "SRU";
 
-            yaz_add_srw_diagnostic(decode, diag, num_diag, 
+            yaz_add_srw_diagnostic(decode, diag, num_diag,
                                    YAZ_SRW_UNSUPP_OPERATION, operation);
             return 0;
         }
@@ -890,14 +890,14 @@ static int yaz_get_sru_parms(const Z_SRW_PDU *srw_pdu, ODR encode,
         {
         case Z_SRW_sort_type_none:
             break;
-        case Z_SRW_sort_type_sort:            
+        case Z_SRW_sort_type_sort:
             yaz_add_name_value_str(encode, name, value, &i, "sortKeys",
                                    srw_pdu->u.request->sort.sortKeys);
             break;
         }
-        yaz_add_name_value_int(encode, name, value, &i, "startRecord", 
+        yaz_add_name_value_int(encode, name, value, &i, "startRecord",
                                srw_pdu->u.request->startRecord);
-        yaz_add_name_value_int(encode, name, value, &i, "maximumRecords", 
+        yaz_add_name_value_int(encode, name, value, &i, "maximumRecords",
                                srw_pdu->u.request->maximumRecords);
         yaz_add_name_value_str(encode, name, value, &i, "recordSchema",
                                srw_pdu->u.request->recordSchema);
@@ -907,7 +907,7 @@ static int yaz_get_sru_parms(const Z_SRW_PDU *srw_pdu, ODR encode,
                                srw_pdu->u.request->recordXPath);
         yaz_add_name_value_str(encode, name, value, &i, "stylesheet",
                                srw_pdu->u.request->stylesheet);
-        yaz_add_name_value_int(encode, name, value, &i, "resultSetTTL", 
+        yaz_add_name_value_int(encode, name, value, &i, "resultSetTTL",
                                srw_pdu->u.request->resultSetTTL);
         break;
     case Z_SRW_explain_request:
@@ -933,9 +933,9 @@ static int yaz_get_sru_parms(const Z_SRW_PDU *srw_pdu, ODR encode,
                                    srw_pdu->u.scan_request->scanClause.xcql);
             break;
         }
-        yaz_add_name_value_int(encode, name, value, &i, "responsePosition", 
+        yaz_add_name_value_int(encode, name, value, &i, "responsePosition",
                                srw_pdu->u.scan_request->responsePosition);
-        yaz_add_name_value_int(encode, name, value, &i, "maximumTerms", 
+        yaz_add_name_value_int(encode, name, value, &i, "maximumTerms",
                                srw_pdu->u.scan_request->maximumTerms);
         yaz_add_name_value_str(encode, name, value, &i, "stylesheet",
                                srw_pdu->u.scan_request->stylesheet);
@@ -968,14 +968,14 @@ int yaz_sru_get_encode(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu,
     char *uri_args;
     char *path;
 
-    z_HTTP_header_add_basic_auth(encode, &hreq->headers, 
+    z_HTTP_header_add_basic_auth(encode, &hreq->headers,
                                  srw_pdu->username, srw_pdu->password);
     if (yaz_get_sru_parms(srw_pdu, encode, name, value, MAX_SRU_PARAMETERS))
         return -1;
     yaz_array_to_uri(&uri_args, encode, name, value);
 
     hreq->method = "GET";
-    
+
     path = (char *)
         odr_malloc(encode, strlen(hreq->path) + strlen(uri_args) + 4);
 
@@ -994,7 +994,7 @@ int yaz_sru_post_encode(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu,
     char *name[MAX_SRU_PARAMETERS], *value[MAX_SRU_PARAMETERS]; /* definite upper limit for SRU params */
     char *uri_args;
 
-    z_HTTP_header_add_basic_auth(encode, &hreq->headers, 
+    z_HTTP_header_add_basic_auth(encode, &hreq->headers,
                                  srw_pdu->username, srw_pdu->password);
     if (yaz_get_sru_parms(srw_pdu, encode, name, value, MAX_SRU_PARAMETERS))
         return -1;
@@ -1002,7 +1002,7 @@ int yaz_sru_post_encode(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu,
     yaz_array_to_uri(&uri_args, encode, name, value);
 
     hreq->method = "POST";
-    
+
     hreq->content_buf = uri_args;
     hreq->content_len = strlen(uri_args);
 
@@ -1024,12 +1024,12 @@ int yaz_sru_soap_encode(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu,
     };
     Z_SOAP *p = (Z_SOAP*) odr_malloc(odr, sizeof(*p));
 
-    z_HTTP_header_add_basic_auth(odr, &hreq->headers, 
+    z_HTTP_header_add_basic_auth(odr, &hreq->headers,
                                  srw_pdu->username, srw_pdu->password);
     z_HTTP_header_add_content_type(odr,
                                    &hreq->headers,
                                    "text/xml", charset);
-    
+
     z_HTTP_header_add(odr, &hreq->headers,
                       "SOAPAction", "\"\"");
     p->which = Z_SOAP_generic;
@@ -1052,7 +1052,7 @@ int yaz_sru_soap_encode(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu,
 
 Z_SRW_recordVersion *yaz_srw_get_record_versions(ODR odr, int num)
 {
-    Z_SRW_recordVersion *ver 
+    Z_SRW_recordVersion *ver
         = (Z_SRW_recordVersion *) odr_malloc(odr,num * sizeof(*ver));
     int i;
     for (i = 0; i < num; ++i)
index 6129304..a1b5c98 100644 (file)
@@ -164,7 +164,7 @@ static xmlNodePtr xml_config_get_root(void)
             yaz_log(YLOG_WARN, "Bad/missing root element for config %s",
                     control_block.xml_config);
             return 0;
-        
+
         }
     }
     return ptr;
@@ -235,7 +235,7 @@ static struct gfs_server * gfs_server_new(const char *id)
 #endif
 
 #if YAZ_HAVE_XML2
-static struct gfs_listen * gfs_listen_new(const char *id, 
+static struct gfs_listen * gfs_listen_new(const char *id,
                                           const char *address)
 {
     struct gfs_listen *n = (struct gfs_listen *)
@@ -308,7 +308,7 @@ int control_association(association *assoc, const char *host, int force_open)
                 assoc->server = gfs;
                 assoc->last_control = &gfs->cb;
                 statserv_setcontrol(&gfs->cb);
-                
+
                 gfs_server_chdir(gfs);
                 break;
             }
@@ -325,7 +325,7 @@ int control_association(association *assoc, const char *host, int force_open)
         statserv_setcontrol(&control_block);
         assoc->last_control = &control_block;
     }
-    yaz_log(YLOG_DEBUG, "server select: config=%s", 
+    yaz_log(YLOG_DEBUG, "server select: config=%s",
             assoc->last_control->configname);
 
     assoc->maximumRecordSize = assoc->last_control->maxrecordsize;
@@ -377,7 +377,7 @@ static void xml_config_read(void)
             struct gfs_server *gfs;
 
             for ( ; attr; attr = attr->next)
-                if (!xmlStrcmp(attr->name, BAD_CAST "listenref") 
+                if (!xmlStrcmp(attr->name, BAD_CAST "listenref")
                     && attr->children && attr->children->type == XML_TEXT_NODE)
                     listenref = nmem_dup_xml_content(gfs_nmem, attr->children);
                 else if (!xmlStrcmp(attr->name, BAD_CAST "id")
@@ -444,12 +444,12 @@ static void xml_config_read(void)
                 }
                 else if (!strcmp((const char *) ptr->name, "directory"))
                 {
-                    gfs->directory = 
+                    gfs->directory =
                         nmem_dup_xml_content(gfs_nmem, ptr->children);
                 }
                 else if (!strcmp((const char *) ptr->name, "docpath"))
                 {
-                    gfs->docpath = 
+                    gfs->docpath =
                         nmem_dup_xml_content(gfs_nmem, ptr->children);
                 }
                 else if (!strcmp((const char *) ptr->name, "maximumrecordsize"))
@@ -471,7 +471,7 @@ static void xml_config_read(void)
                 else if (!strcmp((const char *) ptr->name, "retrievalinfo"))
                 {
                     if (yaz_retrieval_configure(gfs->retrieval, ptr))
-                    {       
+                    {
                         yaz_log(YLOG_FATAL, "%s in config %s",
                                 yaz_retrieval_get_error(gfs->retrieval),
                                 control_block.xml_config);
@@ -506,7 +506,7 @@ static void xml_config_open(void)
     init_control_tls = 1;
     pthread_key_create(&current_control_tls, 0);
 #endif
-    
+
     gfs_nmem = nmem_create();
 #if YAZ_HAVE_XML2
     if (control_block.xml_config[0] == '\0')
@@ -749,7 +749,7 @@ static void statserv_closedown()
 
                 /* Allocate the thread handle array */
                 pThreadHandles = (HANDLE *)malloc(sizeof(HANDLE) * iHandles);
-                pCurrentHandle = pThreadHandles; 
+                pCurrentHandle = pThreadHandles;
 
                 for (pCurrentThread = pFirstThread;
                      pCurrentThread != NULL;
@@ -788,7 +788,7 @@ void __cdecl event_loop_thread(IOCHAN iochan)
 }
 
 /* WIN32 listener */
-static void listener(IOCHAN h, int event)   
+static void listener(IOCHAN h, int event)
 {
     COMSTACK line = (COMSTACK) iochan_getdata(h);
     IOCHAN parent_chan = line->user;
@@ -846,7 +846,7 @@ static void listener(IOCHAN h, int event)
         newHandle = (HANDLE) _beginthread(event_loop_thread, 0, new_chan);
         if (newHandle == (HANDLE) -1)
         {
-            
+
             yaz_log(YLOG_FATAL|YLOG_ERRNO, "Failed to create new thread.");
             iochan_destroy(h);
             return;
@@ -868,7 +868,7 @@ static void listener(IOCHAN h, int event)
 #else /* ! WIN32 */
 
 /* To save having an #ifdef in event_loop we need to
-   define this empty function 
+   define this empty function
 */
 void statserv_remove(IOCHAN pIOChannel)
 {
@@ -988,7 +988,7 @@ static void *new_session(void *vp)
     COMSTACK new_line = (COMSTACK) vp;
     IOCHAN parent_chan = (IOCHAN) new_line->user;
 
-    unsigned cs_get_mask, cs_accept_mask, mask =  
+    unsigned cs_get_mask, cs_accept_mask, mask =
         ((new_line->io_pending & CS_WANT_WRITE) ? EVENT_OUTPUT : 0) |
         ((new_line->io_pending & CS_WANT_READ) ? EVENT_INPUT : 0);
 
@@ -1230,7 +1230,7 @@ static int statserv_sc_main(yaz_sc_t s, int argc, char **argv)
         return 1;
 
     xml_config_open();
-    
+
     xml_config_bend_start();
 
     if (control_block.inetd)
@@ -1278,9 +1278,9 @@ int check_options(int argc, char **argv)
     int ret = 0, r;
     char *arg;
 
-    yaz_log_init_level(yaz_log_mask_str(STAT_DEFAULT_LOG_LEVEL)); 
+    yaz_log_init_level(yaz_log_mask_str(STAT_DEFAULT_LOG_LEVEL));
 
-    get_logbits(1); 
+    get_logbits(1);
 
     while ((ret = options("1a:iszSTl:v:u:c:w:t:k:Kd:A:p:DC:f:m:r:",
                           argv, argc, &arg)) != -2)
@@ -1291,7 +1291,7 @@ int check_options(int argc, char **argv)
             if (add_listener(arg, 0))
                 return 1;  /* failed to create listener */
             break;
-        case '1':        
+        case '1':
             control_block.one_shot = 1;
             control_block.dynamic = 0;
             break;
@@ -1327,7 +1327,7 @@ int check_options(int argc, char **argv)
             break;
         case 'v':
             yaz_log_init_level(yaz_log_mask_str(arg));
-            get_logbits(1); 
+            get_logbits(1);
             break;
         case 'a':
             option_copy(control_block.apdufile, arg);
@@ -1369,7 +1369,7 @@ int check_options(int argc, char **argv)
         case 'w':
             if (chdir(arg))
             {
-                perror(arg);            
+                perror(arg);
                 return 1;
             }
             break;
index eab95c7..76b772a 100644 (file)
@@ -3,7 +3,7 @@
  * See the file LICENSE for details.
  */
 
-/** 
+/**
  * \file stemmer.c
  * \brief Implements stemmer wrapper
  */
@@ -51,14 +51,14 @@ yaz_stemmer_p yaz_stemmer_snowball_create(const char *locale, const char *rule,
     yaz_stemmer_p yaz_stemmer;
     if (stemmer == 0) {
         *status = U_ILLEGAL_ARGUMENT_ERROR;
-        yaz_log(YLOG_FATAL, "yaz_stemmer: Failed to create snowball stemmer from locale %srule %s. Showball: charenc %s algorithm %s ", 
+        yaz_log(YLOG_FATAL, "yaz_stemmer: Failed to create snowball stemmer from locale %srule %s. Showball: charenc %s algorithm %s ",
                locale, rule, charenc, algorithm);
        return 0;
     }
     yaz_log(YLOG_DEBUG, "created snowball stemmer: algoritm %s charenc %s ", algorithm, charenc);
     yaz_stemmer = xmalloc(sizeof(*yaz_stemmer));
     yaz_stemmer->implementation = yaz_snowball;
-      
+
     yaz_stemmer->locale = xstrdup(locale);
     yaz_stemmer->rule = xstrdup(rule);
     yaz_stemmer->sb_stemmer = stemmer;
@@ -96,7 +96,7 @@ void yaz_stemmer_stem(yaz_stemmer_p stemmer, struct icu_buf_utf16 *dst, struct i
 
                     const char *cstr2 = (const char *) sb_symbol;
                     icu_utf16_from_utf8_cstr(dst, cstr2 , status);
-#if 0            
+#if 0
                    yaz_log(YLOG_DEBUG, "stemming %s to %s ", cstr, cstr2);
 #endif
                 }
@@ -114,7 +114,7 @@ void yaz_stemmer_stem(yaz_stemmer_p stemmer, struct icu_buf_utf16 *dst, struct i
     }
 }
 
-void yaz_stemmer_destroy(yaz_stemmer_p stemmer) 
+void yaz_stemmer_destroy(yaz_stemmer_p stemmer)
 {
   /* Handle no stemmer correctly */
   if (stemmer == 0)
index 1d83211..eadb6fc 100644 (file)
@@ -68,7 +68,7 @@ int check_ip_tcpd(void *cd, const char *addr, int len, int type)
             struct hostent *host;
 
             struct sockaddr_in *addr_in = (struct sockaddr_in *) addr;
-            
+
             if ((host = gethostbyaddr((char*)&addr_in->sin_addr,
                                       sizeof(addr_in->sin_addr),
                                       AF_INET)))
index 986abc9..e0128a6 100644 (file)
@@ -459,7 +459,7 @@ void *tcpip_straddr(COMSTACK h, const char *str)
             return 0;
         assert(ai);
         h->iofile = s;
-        
+
         if (!tcpip_set_blocking(h, h->flags))
             return 0;
     }
@@ -500,7 +500,7 @@ void *tcpip_straddr(COMSTACK h, const char *str)
 int tcpip_more(COMSTACK h)
 {
     tcpip_state *sp = (tcpip_state *)h->cprivate;
-    
+
     return sp->altlen && (*sp->complete)(sp->altbuf, sp->altlen);
 }
 
@@ -582,17 +582,17 @@ int tcpip_rcvconnect(COMSTACK h)
     {
         int res;
         gnutls_global_init();
-        
+
         tcpip_create_cred(h);
 
         gnutls_init(&sp->session, GNUTLS_CLIENT);
         gnutls_set_default_priority(sp->session);
         gnutls_credentials_set (sp->session, GNUTLS_CRD_CERTIFICATE,
                                 sp->cred_ptr->xcred);
-        
+
         /* cast to intermediate size_t to avoid GCC warning. */
-        gnutls_transport_set_ptr(sp->session, 
-                                 (gnutls_transport_ptr_t) 
+        gnutls_transport_set_ptr(sp->session,
+                                 (gnutls_transport_ptr_t)
                                  (size_t) h->iofile);
         res = gnutls_handshake(sp->session);
         if (res < 0)
@@ -645,8 +645,8 @@ static int tcpip_bind(COMSTACK h, void *address, int mode)
 {
     int r;
     tcpip_state *sp = (tcpip_state *)h->cprivate;
-#if HAVE_GETADDRINFO 
-    struct addrinfo *ai = (struct addrinfo *) address;   
+#if HAVE_GETADDRINFO
+    struct addrinfo *ai = (struct addrinfo *) address;
 #else
     struct sockaddr *addr = (struct sockaddr *)address;
 #endif
@@ -664,7 +664,7 @@ static int tcpip_bind(COMSTACK h, void *address, int mode)
 
         tcpip_create_cred(h);
 
-        res = gnutls_certificate_set_x509_key_file(sp->cred_ptr->xcred, 
+        res = gnutls_certificate_set_x509_key_file(sp->cred_ptr->xcred,
                                                    sp->cert_fname,
                                                    sp->cert_fname,
                                                    GNUTLS_X509_FMT_PEM);
@@ -723,7 +723,7 @@ static int tcpip_bind(COMSTACK h, void *address, int mode)
     TRC(fprintf(stderr, "tcpip_bind\n"));
 #endif
 #ifndef WIN32
-    if (setsockopt(h->iofile, SOL_SOCKET, SO_REUSEADDR, (char*) 
+    if (setsockopt(h->iofile, SOL_SOCKET, SO_REUSEADDR, (char*)
         &one, sizeof(one)) < 0)
     {
         h->cerrno = CSYSERR;
@@ -781,7 +781,7 @@ int tcpip_listen(COMSTACK h, char *raddr, int *addrlen,
 #ifdef WIN32
             WSAGetLastError() == WSAEWOULDBLOCK
 #else
-            yaz_errno() == EWOULDBLOCK 
+            yaz_errno() == EWOULDBLOCK
 #ifdef EAGAIN
 #if EAGAIN != EWOULDBLOCK
             || yaz_errno() == EAGAIN
@@ -894,7 +894,7 @@ COMSTACK tcpip_accept(COMSTACK h)
 #endif
         cnew->state = CS_ST_ACCEPT;
         h->state = CS_ST_IDLE;
-        
+
 #if HAVE_GNUTLS_H
         state->cred_ptr = st->cred_ptr;
         state->session = 0;
@@ -918,7 +918,7 @@ COMSTACK tcpip_accept(COMSTACK h)
                 return 0;
             }
             res = gnutls_credentials_set(state->session,
-                                         GNUTLS_CRD_CERTIFICATE, 
+                                         GNUTLS_CRD_CERTIFICATE,
                                          st->cred_ptr->xcred);
             if (res != GNUTLS_E_SUCCESS)
             {
@@ -927,7 +927,7 @@ COMSTACK tcpip_accept(COMSTACK h)
                 return 0;
             }
             /* cast to intermediate size_t to avoid GCC warning. */
-            gnutls_transport_set_ptr(state->session, 
+            gnutls_transport_set_ptr(state->session,
                                      (gnutls_transport_ptr_t)
                                      (size_t) cnew->iofile);
         }
@@ -1050,7 +1050,7 @@ int tcpip_get(COMSTACK h, char **buf, int *bufsize)
         TRC(fprintf(stderr, "  recv res=%d, hasread=%d\n", res, hasread));
         if (res < 0)
         {
-            TRC(fprintf(stderr, "  recv errno=%d, (%s)\n", yaz_errno(), 
+            TRC(fprintf(stderr, "  recv errno=%d, (%s)\n", yaz_errno(),
                       strerror(yaz_errno())));
 #ifdef WIN32
             if (WSAGetLastError() == WSAEWOULDBLOCK)
@@ -1064,8 +1064,8 @@ int tcpip_get(COMSTACK h, char **buf, int *bufsize)
                 return -1;
             }
 #else
-            if (yaz_errno() == EWOULDBLOCK 
-#ifdef EAGAIN   
+            if (yaz_errno() == EWOULDBLOCK
+#ifdef EAGAIN
 #if EAGAIN != EWOULDBLOCK
                 || yaz_errno() == EAGAIN
 #endif
@@ -1245,7 +1245,7 @@ int tcpip_put(COMSTACK h, char *buf, int size)
     {
         if ((res =
              send(h->iofile, buf + state->written, size -
-                  state->written, 
+                  state->written,
 #ifdef MSG_NOSIGNAL
                   MSG_NOSIGNAL
 #else
@@ -1257,7 +1257,7 @@ int tcpip_put(COMSTACK h, char *buf, int size)
 #ifdef WIN32
                 WSAGetLastError() == WSAEWOULDBLOCK
 #else
-                yaz_errno() == EWOULDBLOCK 
+                yaz_errno() == EWOULDBLOCK
 #ifdef EAGAIN
 #if EAGAIN != EWOULDBLOCK
              || yaz_errno() == EAGAIN
@@ -1314,7 +1314,7 @@ int ssl_put(COMSTACK h, char *buf, int size)
     while (state->towrite > state->written)
     {
 #if HAVE_GNUTLS_H
-        res = gnutls_record_send(state->session, buf + state->written, 
+        res = gnutls_record_send(state->session, buf + state->written,
                                  size - state->written);
         if (res <= 0)
         {
@@ -1323,7 +1323,7 @@ int ssl_put(COMSTACK h, char *buf, int size)
             return -1;
         }
 #else
-        res = SSL_write(state->ssl, buf + state->written, 
+        res = SSL_write(state->ssl, buf + state->written,
                         size - state->written);
         if (res <= 0)
         {
@@ -1377,7 +1377,7 @@ void tcpip_close(COMSTACK h)
 
         if (--(sp->cred_ptr->ref) == 0)
         {
-            TRC(fprintf(stderr, "Removed credentials %p pid=%d\n", 
+            TRC(fprintf(stderr, "Removed credentials %p pid=%d\n",
                         sp->cred_ptr->xcred, getpid()));
             gnutls_certificate_free_credentials(sp->cred_ptr->xcred);
             xfree(sp->cred_ptr);
@@ -1413,27 +1413,27 @@ const char *tcpip_addrstr(COMSTACK h)
     char host[120];
     struct sockaddr_storage addr;
     YAZ_SOCKLEN_T len = sizeof(addr);
-    
+
     if (getpeername(h->iofile, (struct sockaddr *)&addr, &len) < 0)
     {
         h->cerrno = CSYSERR;
         return 0;
     }
-    if (getnameinfo((struct sockaddr *) &addr, len, host, sizeof(host)-1, 
-                    0, 0, 
+    if (getnameinfo((struct sockaddr *) &addr, len, host, sizeof(host)-1,
+                    0, 0,
                     (h->flags & CS_FLAGS_NUMERICHOST) ? NI_NUMERICHOST : 0))
     {
         r = "unknown";
     }
     else
         r = host;
-    
+
 #else
 
     struct sockaddr_in addr;
     YAZ_SOCKLEN_T len = sizeof(addr);
     struct hostent *host;
-    
+
     if (getpeername(h->iofile, (struct sockaddr*) &addr, &len) < 0)
     {
         h->cerrno = CSYSERR;
@@ -1447,7 +1447,7 @@ const char *tcpip_addrstr(COMSTACK h)
             r = (char*) host->h_name;
     }
     if (!r)
-        r = inet_ntoa(addr.sin_addr);        
+        r = inet_ntoa(addr.sin_addr);
 #endif
 
     if (h->protocol == PROTO_HTTP)
@@ -1477,7 +1477,7 @@ const char *tcpip_addrstr(COMSTACK h)
 static int tcpip_set_blocking(COMSTACK p, int flags)
 {
     unsigned long flag;
-    
+
 #ifdef WIN32
     flag = (flags & CS_FLAGS_BLOCKING) ? 0 : 1;
     if (ioctlsocket(p->iofile, FIONBIO, &flag) < 0)
@@ -1514,7 +1514,7 @@ void cs_print_session_info(COMSTACK cs)
     if (ssl)
     {
         X509 *server_cert = SSL_get_peer_certificate(ssl);
-        
+
         if (server_cert)
         {
             char *pem_buf;
@@ -1542,7 +1542,7 @@ void *cs_get_ssl(COMSTACK cs)
     if (cs && cs->type == ssl_type)
     {
         struct tcpip_state *sp = (struct tcpip_state *) cs->cprivate;
-        return sp->ssl;  
+        return sp->ssl;
     }
 #endif
     return 0;
@@ -1623,7 +1623,7 @@ static int tcpip_get_connect(COMSTACK h, char **buf, int *bufsize)
     struct tcpip_state *state = (struct tcpip_state *)h->cprivate;
     int r;
 
-    r = tcpip_get(h, &state->connect_response_buf, 
+    r = tcpip_get(h, &state->connect_response_buf,
                   &state->connect_response_len);
     if (r < 1)
         return r;
index ef0067d..673c450 100644 (file)
@@ -27,7 +27,7 @@ static int test_failed = 0;
 static int test_todo = 0;
 static int test_verbose = 1;
 static const char *test_prog = 0;
-static int log_tests = 0; 
+static int log_tests = 0;
 
 static FILE *get_file(void)
 {
@@ -76,7 +76,7 @@ void yaz_check_init1(int *argc_p, char ***argv_p)
             }
             else if (!strcmp(suf, "help"))
             {
-                fprintf(stderr, 
+                fprintf(stderr,
                         "--test-help           help\n"
                         "--test-file fname     output to fname\n"
                         "--test-verbose level  verbose level\n"
@@ -95,7 +95,7 @@ void yaz_check_init1(int *argc_p, char ***argv_p)
                 fprintf(stderr, "Use --test-help for more info\n");
                 exit(1);
             }
-            
+
         }
         break;
     }
@@ -110,7 +110,7 @@ void yaz_check_init1(int *argc_p, char ***argv_p)
 void yaz_check_init_log(const char *argv0)
 {
     char logfilename[2048];
-    log_tests = 1; 
+    log_tests = 1;
     sprintf(logfilename,"%s.log", progname(argv0) );
     yaz_log_init_file(logfilename);
     yaz_log_trunc();
@@ -160,15 +160,15 @@ void yaz_check_eq1(int type, const char *file, int line,
                    const char *left, const char *right, int lval, int rval)
 {
     char formstr[2048];
-    
-    if (type == YAZ_TEST_TYPE_OK) 
+
+    if (type == YAZ_TEST_TYPE_OK)
         sprintf(formstr, "%.500s == %.500s ", left, right);
     else
         sprintf(formstr, "%.500s != %.500s\n %d != %d", left, right, lval,rval);
     yaz_check_print1(type, file, line, formstr);
 }
 
-void yaz_check_print1(int type, const char *file, int line, 
+void yaz_check_print1(int type, const char *file, int line,
                       const char *expr)
 {
     const char *msg = "unknown";
index 27c959f..88a9775 100644 (file)
@@ -107,7 +107,7 @@ void yaz_timing_stop(yaz_timing_t t)
 {
 #if HAVE_SYS_TIMES_H
     times(&t->tms2);
-    
+
     t->user_sec = (double) (t->tms2.tms_utime - t->tms1.tms_utime)/100;
     t->sys_sec = (double) (t->tms2.tms_stime - t->tms1.tms_stime)/100;
 #endif
@@ -115,7 +115,7 @@ void yaz_timing_stop(yaz_timing_t t)
     gettimeofday(&t->end_time, 0);
     t->real_sec = ((t->end_time.tv_sec - t->start_time.tv_sec) * 1000000.0 +
                    t->end_time.tv_usec - t->start_time.tv_usec) / 1000000;
-#else    
+#else
 #ifdef WIN32
     get_date_as_largeinteger(&t->end_time);
     t->real_sec = (t->end_time - t->start_time) / 10000000.0;
index 197a323..0289771 100644 (file)
@@ -21,7 +21,7 @@ struct yaz_tok_parse {
     int unget_byte;
     WRBUF wr_string;
     int look;
-    
+
     yaz_tok_cfg_t cfg;
     yaz_tok_get_byte_t get_byte_func;
     void *get_byte_data;
@@ -118,7 +118,7 @@ yaz_tok_parse_t yaz_tok_parse_create(yaz_tok_cfg_t t,
     tp->wr_string = wrbuf_alloc();
     return tp;
 }
-                                           
+
 
 void yaz_tok_parse_destroy(yaz_tok_parse_t tp)
 {
@@ -136,7 +136,7 @@ int yaz_tok_move(yaz_tok_parse_t tp)
     /* skip white space */
     while (ch && strchr(t->white_space, ch))
         ch = get_byte(tp);
-    if (!ch) 
+    if (!ch)
         ch = YAZ_TOK_EOF;
     else if (strchr(t->comment, ch))
         ch = YAZ_TOK_EOF;
index deaf6f4..098b1b2 100644 (file)
@@ -56,7 +56,7 @@ size_t yaz_filepath_comp(const char **path_p, const char **comp)
         path_sep = strchr(path+2, ':');
     else
         path_sep = 0;
-    
+
     if (path_sep)
     {
         len = path_sep - path;
@@ -82,7 +82,7 @@ char *yaz_filepath_resolve(const char *fname, const char *path,
     {
         struct stat stat_buf;
         size_t slen = 0;
-       
+
         *fullpath = '\0';
         if (path)
         {
@@ -131,7 +131,7 @@ int yaz_is_abspath(const char *p)
 #ifdef WIN32
     if (*p == '\\')
         return 1;
-    if (*p && p[1] == ':' && 
+    if (*p && p[1] == ':' &&
         ((*p >= 'A' && *p <= 'Z') || (*p >= 'a' && *p <= 'z')))
         return 1;
 #endif
index 3341a94..3b45c3a 100644 (file)
@@ -22,7 +22,7 @@ static unsigned long read_UCS4(yaz_iconv_t cd, yaz_iconv_decoder_t d,
                                size_t inbytesleft, size_t *no_read)
 {
     unsigned long x = 0;
-    
+
     if (inbytesleft < 4)
     {
         yaz_iconv_set_errno(cd, YAZ_ICONV_EINVAL); /* incomplete input */
@@ -41,7 +41,7 @@ static unsigned long read_UCS4LE(yaz_iconv_t cd, yaz_iconv_decoder_t d,
                                  size_t inbytesleft, size_t *no_read)
 {
     unsigned long x = 0;
-    
+
     if (inbytesleft < 4)
     {
         yaz_iconv_set_errno(cd, YAZ_ICONV_EINVAL); /* incomplete input */
@@ -102,7 +102,7 @@ static size_t write_UCS4LE(yaz_iconv_t cd, yaz_iconv_encoder_t en,
 
 yaz_iconv_encoder_t yaz_ucs4_encoder(const char *tocode,
                                      yaz_iconv_encoder_t e)
-    
+
 {
     if (!yaz_matchstr(tocode, "UCS4"))
         e->write_handle = write_UCS4;
@@ -115,7 +115,7 @@ yaz_iconv_encoder_t yaz_ucs4_encoder(const char *tocode,
 
 yaz_iconv_decoder_t yaz_ucs4_decoder(const char *tocode,
                                      yaz_iconv_decoder_t d)
-    
+
 {
     if (!yaz_matchstr(tocode, "UCS4"))
         d->read_handle = read_UCS4;
index 08320f9..60cbedc 100644 (file)
@@ -247,7 +247,7 @@ static void *unix_straddr1(COMSTACK h, const char *str, char *f)
             {
                 char * end;
                 char * arg = s + 6;
-                
+
                 sp->umask = strtol(arg, &end, 8);
                 if (errno == EINVAL ||
                     *end)
@@ -513,7 +513,7 @@ static COMSTACK unix_accept(COMSTACK h)
             }
             return 0;
         }
-        if (!(cnew->flags&CS_FLAGS_BLOCKING) && 
+        if (!(cnew->flags&CS_FLAGS_BLOCKING) &&
             (fcntl(cnew->iofile, F_SETFL, O_NONBLOCK) < 0)
             )
         {
index 1d30cda..bae9a0a 100644 (file)
--- a/src/uri.c
+++ b/src/uri.c
@@ -101,7 +101,7 @@ void yaz_array_to_uri(char **path, ODR o, char **name, char **value)
     for(i = 0; name[i]; i++)
         sz += strlen(name[i]) + 3 + strlen(value[i]) * 3;
     *path = (char *) odr_malloc(o, sz);
-    
+
     for(i = 0; name[i]; i++)
     {
         size_t ilen;
@@ -190,7 +190,7 @@ char *yaz_uri_val(const char *path, const char *name, ODR o)
         {
             size_t i = 0;
             char *ret;
-            
+
             path = p1 + 1;
             p1 = strchr(path, '&');
             if (!p1)
index 7bf6f4e..24c579e 100644 (file)
--- a/src/url.c
+++ b/src/url.c
@@ -60,7 +60,7 @@ static void extract_user_pass(NMEM nmem,
     if (cp1 && cp1 > uri)
     {
         cp1--;
-        
+
         if (!strncmp(cp1, "://", 3))
         {
             const char *cp3 = 0;
@@ -76,7 +76,7 @@ static void extract_user_pass(NMEM nmem,
                 *uri_lean = nmem_malloc(nmem, strlen(uri) + 1);
                 memcpy(*uri_lean, uri, cp1 + 3 - uri);
                 strcpy(*uri_lean + (cp1 + 3 - uri), cp2 + 1);
-               
+
                 *http_user = nmem_strdupn(nmem, cp1 + 3, cp3 - (cp1 + 3));
                 *http_pass = nmem_strdupn(nmem, cp3 + 1, cp2 - (cp3 + 1));
             }
@@ -146,7 +146,7 @@ Z_HTTP_Response *yaz_url_exec(yaz_url_t p, const char *uri,
         {
             int len;
             char *buf = odr_getbuf(p->odr_out, &len, 0);
-            
+
             if (cs_put(conn, buf, len) < 0)
                 yaz_log(YLOG_WARN, "cs_put failed URL: %s", uri);
             else
index 038b744..d308645 100644 (file)
@@ -80,7 +80,7 @@ unsigned long yaz_read_UTF8_char(unsigned char *inp,
         }
         else
             *error = YAZ_ICONV_EILSEQ;
-    }            
+    }
     else if (inp[0] <= 0xf7 && inbytesleft >= 4)
     {
         if ((inp[1] & 0xc0) == 0x80 && (inp[2] & 0xc0) == 0x80
@@ -166,7 +166,7 @@ size_t yaz_write_UTF8_char(unsigned long x,
     {
         *outp++ = (unsigned char) x;
         (*outbytesleft)--;
-    } 
+    }
     else if (x <= 0x7ff && *outbytesleft >= 2)
     {
         *outp++ = (unsigned char) ((x >> 6) | 0xc0);
@@ -207,7 +207,7 @@ size_t yaz_write_UTF8_char(unsigned long x,
         *outp++ = (unsigned char) ((x & 0x3f) | 0x80);
         (*outbytesleft) -= 6;
     }
-    else 
+    else
     {
         *error = YAZ_ICONV_E2BIG;  /* not room for output */
         return (size_t)(-1);
@@ -218,7 +218,7 @@ size_t yaz_write_UTF8_char(unsigned long x,
 
 yaz_iconv_encoder_t yaz_utf8_encoder(const char *tocode,
                                      yaz_iconv_encoder_t e)
-    
+
 {
     if (!yaz_matchstr(tocode, "UTF8"))
     {
@@ -257,7 +257,7 @@ int yaz_utf8_check(const char *str)
         inbytesleft -= no_read;
     }
     return 1;
-}   
+}
 
 /*
  * Local variables:
index 135c047..8d44fc4 100644 (file)
@@ -96,7 +96,7 @@ void wrbuf_vp_puts(const char *buf, void *client_data)
     wrbuf_puts(b, buf);
 }
 
-void wrbuf_puts_replace_char(WRBUF b, const char *buf, 
+void wrbuf_puts_replace_char(WRBUF b, const char *buf,
                             const char from, const char to)
 {
     while(*buf)
index ba3a253..8bbb752 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <yaz/cql.h>
 
-static void pr_n(const char *buf, 
+static void pr_n(const char *buf,
                 void (*pr)(const char *buf, void *client_data),
                 void *client_data, int n)
 {
@@ -53,7 +53,7 @@ static void pr_cdata(const char *buf,
         src++;
     }
 }
-                    
+
 static void prefixes(struct cql_node *cn,
                      void (*pr)(const char *buf, void *client_data),
                      void *client_data, int level)
@@ -86,7 +86,7 @@ static void prefixes(struct cql_node *cn,
     if (head)
         pr_n("</prefixes>\n", pr, client_data, level);
 }
-                     
+
 static void cql_to_xml_mod(struct cql_node *m,
                            void (*pr)(const char *buf, void *client_data),
                            void *client_data, int level)
@@ -118,7 +118,7 @@ static void cql_to_xml_mod(struct cql_node *m,
     }
 }
 
-static void cql_sort_to_xml(struct cql_node *cn, 
+static void cql_sort_to_xml(struct cql_node *cn,
                          void (*pr)(const char *buf, void *client_data),
                             void *client_data, int level)
 {
@@ -128,7 +128,7 @@ static void cql_sort_to_xml(struct cql_node *cn,
         for (; cn; cn = cn->u.sort.next)
         {
             pr_n("<key>\n", pr, client_data, level+2);
-            
+
             if (cn->u.sort.index)
             {
                 pr_n("<index>", pr, client_data, level+4);
@@ -236,7 +236,7 @@ static void cql_to_xml_r(struct cql_node *cn,
     }
 }
 
-void cql_to_xml(struct cql_node *cn, 
+void cql_to_xml(struct cql_node *cn,
                 void (*pr)(const char *buf, void *client_data),
                 void *client_data)
 {
index 3796f4e..582c319 100644 (file)
@@ -46,7 +46,7 @@ void *xmalloc_d(size_t nbytes, const char *file, int line)
 {
     char *res;
     struct dmalloc_info *dinfo;
-    
+
     if (!log_level_initialized)
     {
         log_level = yaz_log_module_level("malloc");
@@ -60,13 +60,13 @@ void *xmalloc_d(size_t nbytes, const char *file, int line)
     dinfo->file[sizeof(dinfo->file)-1] = '\0';
     dinfo->line = line;
     dinfo->len = nbytes;
-    
+
     dinfo->prev = 0;
     dinfo->next = dmalloc_list;
     if (dinfo->next)
         dinfo->next->prev = dinfo;
     dmalloc_list = dinfo;
-    
+
     memcpy(res + sizeof(*dinfo), head, 8*sizeof(char));
     res += sizeof(*dinfo) + 8*sizeof(char);
     memcpy(res + nbytes, tail, 8*sizeof(char));
@@ -107,7 +107,7 @@ void *xrealloc_d(void *p, size_t nbytes, const char *file, int line)
     struct dmalloc_info *dinfo;
     char *ptr = (char*) p;
     char *res;
-    
+
     if (!log_level_initialized)
     {
         log_level = yaz_log_module_level("malloc");
@@ -141,7 +141,7 @@ void *xrealloc_d(void *p, size_t nbytes, const char *file, int line)
             dmalloc_list = dinfo->next;
         if (dinfo->next)
             dinfo->next->prev = dinfo->prev;
-        
+
         if (!nbytes)
         {
             free(dinfo);
@@ -163,7 +163,7 @@ void *xrealloc_d(void *p, size_t nbytes, const char *file, int line)
     if (dmalloc_list)
         dmalloc_list->prev = dinfo;
     dmalloc_list = dinfo;
-    
+
     memcpy(res + sizeof(*dinfo), head, 8*sizeof(char));
     res += sizeof(*dinfo) + 8*sizeof(char);
     memcpy(res + nbytes, tail, 8*sizeof(char));
@@ -175,7 +175,7 @@ void *xcalloc_d(size_t nmemb, size_t size, const char *file, int line)
     char *res;
     struct dmalloc_info *dinfo;
     size_t nbytes = nmemb * size;
-    
+
     if (!log_level_initialized)
     {
         log_level = yaz_log_module_level("malloc");
@@ -189,13 +189,13 @@ void *xcalloc_d(size_t nmemb, size_t size, const char *file, int line)
     dinfo->file[sizeof(dinfo->file)-1] = '\0';
     dinfo->line = line;
     dinfo->len = nbytes;
-    
+
     dinfo->prev = 0;
     dinfo->next = dmalloc_list;
     if (dinfo->next)
         dinfo->next->prev = dinfo;
     dmalloc_list = dinfo;
-    
+
     memcpy(res + sizeof(*dinfo), head, 8*sizeof(char));
     res += sizeof(*dinfo) + 8*sizeof(char);
     memcpy(res + nbytes, tail, 8*sizeof(char));
@@ -206,7 +206,7 @@ void xmalloc_trav_d(const char *file, int line)
 {
     size_t size = 0;
     struct dmalloc_info *dinfo = dmalloc_list;
-    
+
     if (!log_level_initialized)
     {
         log_level = yaz_log_module_level("malloc");
@@ -230,7 +230,7 @@ void xmalloc_trav_d(const char *file, int line)
 #define xmalloc_d(x, f, l) malloc(x)
 #define xcalloc_d(x,y, f, l) calloc(x,y)
 #define xfree_d(x, f, l) free(x)
-#define xmalloc_trav_d(f, l) 
+#define xmalloc_trav_d(f, l)
 #endif
 
 void xmalloc_trav_f(const char *s, const char *file, int line)
@@ -274,7 +274,7 @@ void *xrealloc_f(void *o, size_t size, const char *file, int line)
 void *xmalloc_f(size_t size, const char *file, int line)
 {
     void *p = xmalloc_d(size, file, line);
-    
+
     if (!log_level_initialized)
     {
         log_level = yaz_log_module_level("malloc");
@@ -282,7 +282,7 @@ void *xmalloc_f(size_t size, const char *file, int line)
     }
 
     if (log_level)
-        yaz_log(log_level, "%s:%d: xmalloc(s=%ld) %p", file, line, 
+        yaz_log(log_level, "%s:%d: xmalloc(s=%ld) %p", file, line,
                 (long) size, p);
 
     if (!p)
@@ -326,7 +326,7 @@ char *xstrdup_f(const char *s, const char *file, int line)
     }
 
     if (log_level)
-        yaz_log(log_level, "%s:%d: xstrdup(s=%ld) %p", file, line, 
+        yaz_log(log_level, "%s:%d: xstrdup(s=%ld) %p", file, line,
                 (long) strlen(s)+1, p);
 
     strcpy(p, s);
@@ -352,7 +352,7 @@ char *xstrndup_f(const char *s, size_t n, const char *file, int line)
         memcpy(a, s, n);
         a[n] = '\0';
         return a;
-    } 
+    }
 }
 
 /*
index a37ada9..3ddc570 100644 (file)
@@ -3,7 +3,7 @@
  * See the file LICENSE for details.
  */
 
-/** \file 
+/** \file
     \brief XML Include (not to be confused with W3C XInclude)
 */
 #if HAVE_CONFIG_H
@@ -102,7 +102,7 @@ static int config_include_src(yaz_xml_include_t config, xmlNode **np,
         yaz_glob_res_t glob_res;
 
         glob_ret = yaz_file_glob(wrbuf_cstr(w), &glob_res);
-        
+
         if (glob_ret == 0)
         {
             size_t i;
@@ -116,7 +116,7 @@ static int config_include_src(yaz_xml_include_t config, xmlNode **np,
     wrbuf_printf(w, " end include src=\"%s\" ", src);
     c = xmlNewComment((const xmlChar *) wrbuf_cstr(w));
     sib = xmlAddNextSibling(sib, c);
-    
+
     *np = sib;
     wrbuf_destroy(w);
     return ret;
@@ -138,7 +138,7 @@ static int process_config_includes(yaz_xml_include_t config, xmlNode *n)
                     xmlFree(src);
                     if (ret)
                         return ret;
-                        
+
                 }
             }
             else
index 0e50575..ca09633 100644 (file)
@@ -44,11 +44,11 @@ static void xml_error_handler(void *ctx, const char *fmt, ...)
 void yaz_log_xml_errors(const char *prefix, int log_level)
 {
     xml_error_log_level = log_level;
-    
+
 #if YAZ_HAVE_XML2
     xmlSetGenericErrorFunc((void *) (prefix ? prefix : "XML"),
                            xml_error_handler);
-#if YAZ_HAVE_XSLT 
+#if YAZ_HAVE_XSLT
     xsltSetGenericErrorFunc((void *) (prefix ? prefix : "XSLT"),
                             xml_error_handler);
 #endif
index b26ae7d..3ca2f3e 100644 (file)
@@ -67,7 +67,7 @@ static void yaz_query2xml_attribute_element(const Z_AttributeElement *element,
     char formstr[30];
     const char *setname = 0;
     char oid_name_str[OID_STR_MAX];
-    
+
     if (element->attributeSet)
     {
         setname = yaz_oid_to_string_buf(element->attributeSet,
@@ -94,17 +94,17 @@ static void yaz_query2xml_attribute_element(const Z_AttributeElement *element,
         for (i = 0; i<element->value.complex->num_list; i++)
         {
             xmlNodePtr node = xmlNewChild(parent, 0, BAD_CAST "attr", 0);
-            
+
             if (setname)
                 xmlNewProp(node, BAD_CAST "set", BAD_CAST setname);
-            
+
             sprintf(formstr, ODR_INT_PRINTF, *element->attributeType);
             xmlNewProp(node, BAD_CAST "type", BAD_CAST formstr);
-            
+
             if (element->value.complex->list[i]->which ==
                 Z_StringOrNumeric_string)
             {
-                xmlNewProp(node, BAD_CAST "value", BAD_CAST 
+                xmlNewProp(node, BAD_CAST "value", BAD_CAST
                            element->value.complex->list[i]->u.string);
             }
             else if (element->value.complex->list[i]->which ==
@@ -135,7 +135,7 @@ static xmlNodePtr yaz_query2xml_term(const Z_Term *term, xmlNodePtr parent)
     case Z_Term_numeric:
         type = "numeric";
        sprintf(formstr, ODR_INT_PRINTF, *term->u.numeric);
-       t = xmlNewText(BAD_CAST formstr);       
+       t = xmlNewText(BAD_CAST formstr);
         break;
     case Z_Term_characterString:
         type = "string";
@@ -201,11 +201,11 @@ static void yaz_query2xml_operator(Z_Operator *op, xmlNodePtr node)
         return;
     }
     xmlNewProp(node, BAD_CAST "type", BAD_CAST type);
-    
+
     if (op->which == Z_Operator_prox)
     {
         char formstr[30];
-        
+
         if (op->u.prox->exclusion)
         {
             if (*op->u.prox->exclusion)
@@ -218,12 +218,12 @@ static void yaz_query2xml_operator(Z_Operator *op, xmlNodePtr node)
 
         if (*op->u.prox->ordered)
             xmlNewProp(node, BAD_CAST "ordered", BAD_CAST "true");
-        else 
+        else
             xmlNewProp(node, BAD_CAST "ordered", BAD_CAST "false");
-       
+
         sprintf(formstr, ODR_INT_PRINTF, *op->u.prox->relationType);
         xmlNewProp(node, BAD_CAST "relationType", BAD_CAST formstr);
-        
+
         switch(op->u.prox->which)
         {
         case Z_ProximityOperator_known:
@@ -260,7 +260,7 @@ static xmlNodePtr yaz_query2xml_rpnstructure(const Z_RPNStructure *zs,
             return yaz_query2xml_apt(zs->u.simple->u.attributesPlusTerm,
                                     parent);
         else if (zs->u.simple->which == Z_Operand_resultSetId)
-            return xmlNewChild(parent, /* NS */ 0, BAD_CAST "rset", 
+            return xmlNewChild(parent, /* NS */ 0, BAD_CAST "rset",
                                BAD_CAST zs->u.simple->u.resultSetId);
     }
     return 0;
@@ -314,7 +314,7 @@ void yaz_query2xml(const Z_Query *q, xmlDocPtr *docp)
 
     switch (q->which)
     {
-    case Z_Query_type_1: 
+    case Z_Query_type_1:
     case Z_Query_type_101:
         q_node = xmlNewChild(top_node, 0, BAD_CAST "rpn", 0);
        child_node = yaz_query2xml_rpn(q->u.type_1, q_node);
@@ -440,7 +440,7 @@ static void yaz_xml2query_operator(const xmlNode *ptr, Z_Operator **op,
     xmlFree(type);
 }
 
-static void yaz_xml2query_attribute_element(const xmlNode *ptr, 
+static void yaz_xml2query_attribute_element(const xmlNode *ptr,
                                             Z_AttributeElement **elem, ODR odr,
                                             int *error_code,
                                             const char **addinfo)
@@ -484,7 +484,7 @@ static void yaz_xml2query_attribute_element(const xmlNode *ptr,
         *addinfo = "missing value attribute for att content";
         return;
     }
-        
+
     *elem = (Z_AttributeElement *) odr_malloc(odr, sizeof(**elem));
     if (set)
         (*elem)->attributeSet = yaz_string_to_oid_odr(yaz_oid_std(),
@@ -526,7 +526,7 @@ static void yaz_xml2query_attribute_element(const xmlNode *ptr,
             }
         }
         (*elem)->value.complex->num_semanticAction = 0;
-        (*elem)->value.complex->semanticAction = 0;        
+        (*elem)->value.complex->semanticAction = 0;
     }
     else
     {   /* good'ld numeric value */
@@ -633,7 +633,7 @@ static void yaz_xml2query_apt(const xmlNode *ptr_apt,
     (*zapt)->attributes->attributes = (Z_AttributeElement **)
         odr_malloc(odr, sizeof(Z_AttributeElement*) * num_attr);
 
-    i = 0;    
+    i = 0;
     ptr = ptr_apt->children;
     for (; ptr; ptr = ptr->next)
         if (ptr->type == XML_ELEMENT_NODE)
@@ -654,7 +654,7 @@ static void yaz_xml2query_apt(const xmlNode *ptr_apt,
     if (ptr && ptr->type == XML_ELEMENT_NODE)
     {
         if (!xmlStrcmp(ptr->name, BAD_CAST "term"))
-        {        
+        {
             /* deal with term */
             yaz_xml2query_term(ptr, &(*zapt)->term, odr, error_code, addinfo);
         }
@@ -691,7 +691,7 @@ static void yaz_xml2query_rpnstructure(const xmlNode *ptr, Z_RPNStructure **zs,
 {
     while (ptr && ptr->type != XML_ELEMENT_NODE)
         ptr = ptr->next;
-    
+
     if (!ptr || ptr->type != XML_ELEMENT_NODE)
     {
         *error_code = 1;
@@ -705,10 +705,10 @@ static void yaz_xml2query_rpnstructure(const xmlNode *ptr, Z_RPNStructure **zs,
     if (!xmlStrcmp(ptr->name, BAD_CAST "operator"))
     {
         Z_Complex *zc = (Z_Complex *) odr_malloc(odr, sizeof(Z_Complex));
-        
+
         (*zs)->which = Z_RPNStructure_complex;
         (*zs)->u.complex = zc;
-        
+
         yaz_xml2query_operator(ptr, &zc->roperator, odr, error_code, addinfo);
 
         ptr = ptr->children;
@@ -721,7 +721,7 @@ static void yaz_xml2query_rpnstructure(const xmlNode *ptr, Z_RPNStructure **zs,
             ptr = ptr->next;
         yaz_xml2query_rpnstructure(ptr, &zc->s2, odr, error_code, addinfo);
     }
-    else 
+    else
     {
         Z_Operand *s = (Z_Operand *) odr_malloc(odr, sizeof(Z_Operand));
         (*zs)->which = Z_RPNStructure_simple;
@@ -734,7 +734,7 @@ static void yaz_xml2query_rpnstructure(const xmlNode *ptr, Z_RPNStructure **zs,
         }
         else if (!xmlStrcmp(ptr->name, BAD_CAST "rset"))
         {
-            s->which = Z_Operand_resultSetId; 
+            s->which = Z_Operand_resultSetId;
             yaz_xml2query_rset(ptr, &s->u.resultSetId,
                                odr, error_code, addinfo);
         }
@@ -742,7 +742,7 @@ static void yaz_xml2query_rpnstructure(const xmlNode *ptr, Z_RPNStructure **zs,
         {
             *error_code = 1;
             *addinfo = "bad element: expected binary, apt or rset";
-        }        
+        }
     }
 }
 
@@ -770,7 +770,7 @@ static void yaz_xml2query_(const xmlNode *ptr, Z_Query **query, ODR odr,
 {
     if (check_diagnostic(ptr, odr, error_code, addinfo))
         return;
-    if (ptr && ptr->type == XML_ELEMENT_NODE && 
+    if (ptr && ptr->type == XML_ELEMENT_NODE &&
         !xmlStrcmp(ptr->name, BAD_CAST "query"))
     {
         const char *type;
index ae2cc0d..1f0f97f 100644 (file)
@@ -157,7 +157,7 @@ static Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o)
 {
     Z_DeleteResultSetResponse *r = (Z_DeleteResultSetResponse *)
         odr_malloc(o, sizeof(*r));
-    
+
     r->referenceId = 0;
     r->deleteOperationStatus = odr_intdup(o, Z_DeleteStatus_success);
     r->deleteListStatuses = 0;
@@ -171,7 +171,7 @@ static Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o)
 static Z_ScanRequest *zget_ScanRequest(ODR o)
 {
     Z_ScanRequest *r = (Z_ScanRequest *)odr_malloc(o, sizeof(*r));
-    
+
     r->referenceId = 0;
     r->num_databaseNames = 0;
     r->databaseNames = 0;
@@ -187,7 +187,7 @@ static Z_ScanRequest *zget_ScanRequest(ODR o)
 static Z_ScanResponse *zget_ScanResponse(ODR o)
 {
     Z_ScanResponse *r = (Z_ScanResponse *)odr_malloc(o, sizeof(*r));
-    
+
     r->referenceId = 0;
     r->stepSize = 0;
     r->scanStatus = odr_intdup(o, Z_Scan_success);
@@ -203,7 +203,7 @@ static Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o
 {
     Z_TriggerResourceControlRequest *r = (Z_TriggerResourceControlRequest *)
         odr_malloc(o, sizeof(*r));
-    
+
     r->referenceId = 0;
     r->requestedAction = odr_intdup(o, Z_TriggerResourceControlRequest_resourceReport);
     r->prefResourceReportFormat = 0;
@@ -376,7 +376,7 @@ static Z_DuplicateDetectionRequest *zget_DuplicateDetectionRequest(ODR o)
 {
     Z_DuplicateDetectionRequest *r = (Z_DuplicateDetectionRequest *)
         odr_malloc(o, sizeof(*r));
-    
+
     r->referenceId = 0;
     r->num_inputResultSetIds = 0;
     r->inputResultSetIds = 0;
@@ -397,7 +397,7 @@ static Z_DuplicateDetectionResponse *zget_DuplicateDetectionResponse(ODR o)
 {
     Z_DuplicateDetectionResponse *r = (Z_DuplicateDetectionResponse *)
         odr_malloc(o, sizeof(*r));
+
     r->referenceId = 0;
     r->status = odr_intdup(o, Z_DuplicateDetectionResponse_success);
     r->resultSetCount = 0;
@@ -406,11 +406,11 @@ static Z_DuplicateDetectionResponse *zget_DuplicateDetectionResponse(ODR o)
     r->otherInfo = 0;
     return r;
 }
+
 Z_APDU *zget_APDU(ODR o, int which)
 {
     Z_APDU *r = (Z_APDU *)odr_malloc(o, sizeof(*r));
-    
+
     switch (r->which = which)
     {
     case Z_APDU_initRequest:
@@ -498,9 +498,9 @@ Z_APDU *zget_APDU(ODR o, int which)
 Z_DefaultDiagFormat *zget_DefaultDiagFormat(ODR o, int error,
                                             const char *addinfo)
 {
-    Z_DefaultDiagFormat *dr = (Z_DefaultDiagFormat *) 
+    Z_DefaultDiagFormat *dr = (Z_DefaultDiagFormat *)
         odr_malloc(o, sizeof(*dr));
-    
+
     dr->diagnosticSetId = odr_oiddup(o, yaz_oid_diagset_bib_1);
     dr->condition = odr_intdup(o, error);
     dr->which = Z_DefaultDiagFormat_v2Addinfo;
@@ -531,7 +531,7 @@ Z_NamePlusRecord *zget_surrogateDiagRec(ODR o, const char *dbname,
 {
     Z_NamePlusRecord *rec = (Z_NamePlusRecord *) odr_malloc(o, sizeof(*rec));
     Z_DiagRec *drec = (Z_DiagRec *)odr_malloc(o, sizeof(*drec));
-    
+
     if (dbname)
         rec->databaseName = odr_strdup(o, dbname);
     else
@@ -553,7 +553,7 @@ Z_External *zget_init_diagnostics(ODR odr, int error, const char *addinfo)
 
     x = (Z_External*) odr_malloc(odr, sizeof *x);
     x->descriptor = 0;
-    x->indirect_reference = 0;  
+    x->indirect_reference = 0;
     x->direct_reference = odr_oiddup(odr, yaz_oid_userinfo_userinfo_1);
     x->which = Z_External_userInfo1;
 
@@ -633,7 +633,7 @@ Z_External *zget_init_diagnostics_octet(ODR odr, int error,
 
     x = (Z_External*) odr_malloc(odr, sizeof *x);
     x->descriptor = 0;
-    x->indirect_reference = 0;  
+    x->indirect_reference = 0;
     x->direct_reference = odr_oiddup(odr, yaz_oid_userinfo_userinfo_1);
     x->which = Z_External_octet;
     x->u.octet_aligned = (Odr_oct *) odr_malloc(odr, sizeof(Odr_oct));
index 2e3e1fe..37c866c 100644 (file)
@@ -89,7 +89,7 @@ void ZOOM_set_dset_error(ZOOM_connection c, int error,
 
 int ZOOM_uri_to_code(const char *uri)
 {
-    int code = 0;       
+    int code = 0;
     const char *cp;
     if ((cp = strrchr(uri, '/')))
         code = atoi(cp+1);
@@ -274,7 +274,7 @@ ZOOM_API(ZOOM_connection)
     c->host_port = 0;
     c->proxy = 0;
     c->tproxy = 0;
-    
+
     c->charset = c->lang = 0;
 
     c->cookie_out = 0;
@@ -327,7 +327,7 @@ char **ZOOM_connection_get_databases(ZOOM_connection con, ZOOM_options options,
 {
     char **databaseNames;
     const char *cp = ZOOM_options_get(options, "databaseName");
-    
+
     if ((!cp || !*cp) && con->host_port)
     {
         if (strncmp(con->host_port, "unix:", 5) == 0)
@@ -449,7 +449,7 @@ ZOOM_API(void)
         }
         else
             c->host_port = xstrdup(host);
-    }        
+    }
 
     {
         /*
@@ -497,7 +497,7 @@ ZOOM_API(void)
     c->cookie_out = 0;
     val = ZOOM_options_get(c->options, "cookie");
     if (val && *val)
-    { 
+    {
         yaz_log(c->log_details, "%p ZOOM_connection_connect cookie=%s", c, val);
         c->cookie_out = xstrdup(val);
     }
@@ -532,7 +532,7 @@ ZOOM_API(void)
 
     if (val && *val)
         c->password = xstrdup(val);
-    
+
     c->maximum_record_size =
         ZOOM_options_get_int(c->options, "maximumRecordSize", 64*1024*1024);
     c->preferred_message_size =
@@ -738,7 +738,7 @@ ZOOM_API(ZOOM_resultset)
     r->query = q;
 
     r->options = ZOOM_options_create_with_parent(c->options);
-    
+
     start = ZOOM_options_get_int(r->options, "start", 0);
     count = ZOOM_options_get_int(r->options, "count", 0);
     {
@@ -757,7 +757,7 @@ ZOOM_API(ZOOM_resultset)
 
     r->databaseNames = ZOOM_connection_get_databases(c, c->options, &r->num_databaseNames,
                                          r->odr);
-    
+
     r->connection = c;
 
 #if ZOOM_RESULT_LISTS
@@ -791,12 +791,12 @@ ZOOM_API(ZOOM_resultset)
     task->u.search.count = count;
     task->u.search.recv_search_fired = 0;
 
-    syntax = ZOOM_options_get(r->options, "preferredRecordSyntax"); 
+    syntax = ZOOM_options_get(r->options, "preferredRecordSyntax");
     task->u.search.syntax = syntax ? xstrdup(syntax) : 0;
     elementSetName = ZOOM_options_get(r->options, "elementSetName");
-    task->u.search.elementSetName = elementSetName 
+    task->u.search.elementSetName = elementSetName
         ? xstrdup(elementSetName) : 0;
-   
+
     ZOOM_resultset_addref(r);
 
     ZOOM_query_addref(q);
@@ -847,13 +847,13 @@ ZOOM_API(int)
             c->reconnect_ok = 1;
         }
     }
-    
+
     ZOOM_resultset_cache_reset(r);
     task = ZOOM_connection_add_task(c, ZOOM_TASK_SORT);
     task->u.sort.resultset = r;
     task->u.sort.q = newq;
 
-    ZOOM_resultset_addref(r);  
+    ZOOM_resultset_addref(r);
 
     if (!c->async)
     {
@@ -959,10 +959,10 @@ static void ZOOM_resultset_retrieve(ZOOM_resultset r,
     task->u.retrieve.start = start;
     task->u.retrieve.count = count;
 
-    syntax = ZOOM_options_get(r->options, "preferredRecordSyntax"); 
+    syntax = ZOOM_options_get(r->options, "preferredRecordSyntax");
     task->u.retrieve.syntax = syntax ? xstrdup(syntax) : 0;
     elementSetName = ZOOM_options_get(r->options, "elementSetName");
-    task->u.retrieve.elementSetName = elementSetName 
+    task->u.retrieve.elementSetName = elementSetName
         ? xstrdup(elementSetName) : 0;
 
     cp = ZOOM_options_get(r->options, "schema");
@@ -1066,7 +1066,7 @@ static void get_cert(ZOOM_connection c)
 {
     char *cert_buf;
     int cert_len;
-    
+
     if (cs_get_peer_certificate_x509(c->cs, &cert_buf, &cert_len))
     {
         ZOOM_connection_option_setl(c, "sslPeerCert",
@@ -1091,7 +1091,7 @@ static zoom_ret do_connect_host(ZOOM_connection c, const char *logical_url)
         cs_close(c->cs);
     c->cs = cs_create_host_proxy(logical_url, 0, &add,
                                  c->tproxy ? c->tproxy : c->proxy);
-    
+
     if (c->cs && c->cs->protocol == PROTO_HTTP)
     {
 #if YAZ_HAVE_XML2
@@ -1131,7 +1131,7 @@ static zoom_ret do_connect_host(ZOOM_connection c, const char *logical_url)
             if (c->cs->io_pending & CS_WANT_READ)
                 mask += ZOOM_SELECT_READ;
             ZOOM_connection_set_mask(c, mask);
-            c->state = STATE_CONNECTING; 
+            c->state = STATE_CONNECTING;
             return zoom_pending;
         }
     }
@@ -1141,14 +1141,14 @@ static zoom_ret do_connect_host(ZOOM_connection c, const char *logical_url)
 }
 
 /* returns 1 if PDU was sent OK (still pending )
-   0 if PDU was not sent OK (nothing to wait for) 
+   0 if PDU was not sent OK (nothing to wait for)
 */
 
 ZOOM_API(ZOOM_record)
     ZOOM_resultset_record_immediate(ZOOM_resultset s,size_t pos)
 {
     const char *syntax =
-        ZOOM_options_get(s->options, "preferredRecordSyntax"); 
+        ZOOM_options_get(s->options, "preferredRecordSyntax");
     const char *elementSetName =
         ZOOM_options_get(s->options, "elementSetName");
 
@@ -1216,7 +1216,7 @@ ZOOM_API(ZOOM_scanset)
     {
         ZOOM_task task = ZOOM_connection_add_task(c, ZOOM_TASK_SCAN);
         task->u.scan.scan = scan;
-        
+
         (scan->refcount)++;
         if (!c->async)
         {
@@ -1238,7 +1238,7 @@ ZOOM_API(void)
         ZOOM_query_destroy(scan->query);
 
         odr_destroy(scan->odr);
-        
+
         ZOOM_options_destroy(scan->options);
         xfree(scan);
     }
@@ -1252,10 +1252,10 @@ static zoom_ret send_package(ZOOM_connection c)
     if (!c->tasks)
         return zoom_complete;
     assert (c->tasks->which == ZOOM_TASK_PACKAGE);
-    
+
     event = ZOOM_Event_create(ZOOM_EVENT_SEND_APDU);
     ZOOM_connection_put_event(c, event);
-    
+
     c->buf_out = c->tasks->u.package->buf_out;
     c->len_out = c->tasks->u.package->len_out;
 
@@ -1281,7 +1281,7 @@ static void ZOOM_scanset_term_x(ZOOM_scanset scan, size_t pos,
                                 const char **disp_term, size_t *disp_len)
 {
     size_t noent = ZOOM_scanset_size(scan);
-    
+
     *value_term = 0;
     *value_len = 0;
 
@@ -1297,7 +1297,7 @@ static void ZOOM_scanset_term_x(ZOOM_scanset scan, size_t pos,
         if (res->entries->entries[pos]->which == Z_Entry_termInfo)
         {
             Z_TermInfo *t = res->entries->entries[pos]->u.termInfo;
-            
+
             *value_term = (const char *) t->term->u.general->buf;
             *value_len = t->term->u.general->len;
             if (t->displayTerm)
@@ -1343,7 +1343,7 @@ ZOOM_API(const char *)
 
     ZOOM_scanset_term_x(scan, pos, occ, &value_term, &value_len,
                         &disp_term, &disp_len);
-    
+
     *len = value_len;
     return value_term;
 }
@@ -1359,7 +1359,7 @@ ZOOM_API(const char *)
 
     ZOOM_scanset_term_x(scan, pos, occ, &value_term, &value_len,
                         &disp_term, &disp_len);
-    
+
     *len = disp_len;
     return disp_term;
 }
@@ -1402,7 +1402,7 @@ ZOOM_API(void)
     {
         odr_destroy(p->odr_out);
         xfree(p->buf_out);
-        
+
         ZOOM_options_destroy(p->options);
         xfree(p);
     }
@@ -1488,7 +1488,7 @@ ZOOM_API(int)
             ret = send_package(c);
             break;
         case ZOOM_TASK_SORT:
-            c->tasks->u.sort.resultset->r_sort_spec = 
+            c->tasks->u.sort.resultset->r_sort_spec =
                 ZOOM_query_get_sortspec(c->tasks->u.sort.q);
             ret = send_Z3950_sort(c, c->tasks->u.sort.resultset);
             break;
@@ -1609,8 +1609,8 @@ static void handle_http(ZOOM_connection c, Z_HTTP_Response *hres)
             return;
         }
     }
-    else 
-    {  
+    else
+    {
         ret = ZOOM_handle_sru(c, hres, &cret, &addinfo);
         if (ret == 0)
         {
@@ -1670,10 +1670,10 @@ static int do_read(ZOOM_connection c)
 {
     int r, more;
     ZOOM_Event event;
-    
+
     event = ZOOM_Event_create(ZOOM_EVENT_RECV_DATA);
     ZOOM_connection_put_event(c, event);
-    
+
     r = cs_get(c->cs, &c->buf_in, &c->len_in);
     more = cs_more(c->cs);
     yaz_log(c->log_details, "%p do_read len=%d more=%d", c, r, more);
@@ -1742,7 +1742,7 @@ static zoom_ret do_write_ex(ZOOM_connection c, char *buf_out, int len_out)
 {
     int r;
     ZOOM_Event event;
-    
+
     event = ZOOM_Event_create(ZOOM_EVENT_SEND_DATA);
     ZOOM_connection_put_event(c, event);
 
@@ -1762,7 +1762,7 @@ static zoom_ret do_write_ex(ZOOM_connection c, char *buf_out, int len_out)
         return zoom_complete;
     }
     else if (r == 1)
-    {    
+    {
         int mask = ZOOM_SELECT_EXCEPT;
         if (c->cs->io_pending & CS_WANT_WRITE)
             mask += ZOOM_SELECT_WRITE;
@@ -1943,7 +1943,7 @@ static void ZOOM_connection_do_io(ZOOM_connection c, int mask)
     int r = cs_look(c->cs);
     yaz_log(c->log_details, "%p ZOOM_connection_do_io mask=%d cs_look=%d",
             c, mask, r);
-    
+
     if (r == CS_NONE)
     {
         event = ZOOM_Event_create(ZOOM_EVENT_CONNECT);
@@ -2059,7 +2059,7 @@ ZOOM_API(int)
     int i;
 
     yaz_log(log_details0, "ZOOM_process_event(no=%d,cs=%p)", no, cs);
-    
+
     for (i = 0; i<no; i++)
     {
         ZOOM_connection c = cs[i];
@@ -2088,7 +2088,7 @@ ZOOM_API(int) ZOOM_connection_set_mask(ZOOM_connection c, int mask)
 {
     c->mask = mask;
     if (!c->cs)
-        return -1; 
+        return -1;
     return 0;
 }
 
index fd5e79c..15ca855 100644 (file)
@@ -64,7 +64,7 @@ ZOOM_API(ZOOM_options)
         ZOOM_options dst = ZOOM_options_create();
         struct ZOOM_options_entry *src_e = src->entries;
         struct ZOOM_options_entry **dst_e = &dst->entries;
-        
+
         while(src_e)
         {
             append_entry(dst_e, src_e->name, src_e->value, src_e->len);
@@ -122,7 +122,7 @@ ZOOM_API(ZOOM_options_callback)
     void *callback_handle)
 {
     ZOOM_options_callback callback_old;
-    
+
     assert(opt);
     callback_old = opt->callback_func;
     opt->callback_func = callback_func;
@@ -139,7 +139,7 @@ ZOOM_API(void)
     if (opt->refcount == 0)
     {
         struct ZOOM_options_entry *e;
-        
+
         ZOOM_options_destroy(opt->parent1);
         ZOOM_options_destroy(opt->parent2);
         e = opt->entries;
@@ -223,7 +223,7 @@ ZOOM_API(int)
     ZOOM_options_get_bool(ZOOM_options opt, const char *name, int defa)
 {
     const char *v = ZOOM_options_get(opt, name);
-    
+
     if (!v)
         return defa;
     if (!strcmp(v, "1") || !strcmp(v, "T"))
index fcf869f..be1107e 100644 (file)
@@ -48,7 +48,7 @@ typedef enum {
     zoom_sru_post,
     zoom_sru_solr
 } zoom_sru_mode;
-    
+
 
 typedef struct ZOOM_task_p *ZOOM_task;
 
@@ -258,7 +258,7 @@ int ZOOM_test_reconnect(ZOOM_connection c);
 ZOOM_record ZOOM_record_cache_lookup(ZOOM_resultset r, int pos,
                                      const char *syntax,
                                      const char *elementSetName);
-void ZOOM_record_cache_add(ZOOM_resultset r, Z_NamePlusRecord *npr, 
+void ZOOM_record_cache_add(ZOOM_resultset r, Z_NamePlusRecord *npr,
                            int pos,
                            const char *syntax, const char *elementSetName,
                            const char *schema,
index 71251b4..5a552bd 100644 (file)
@@ -76,7 +76,7 @@ static int generate(ZOOM_query s)
             s->z_query = (Z_Query *) odr_malloc(s->odr_query,
                                                 sizeof(*s->z_query));
             s->z_query->which = Z_Query_type_1;
-            s->z_query->u.type_1 = 
+            s->z_query->u.type_1 =
                 p_query_rpn(s->odr_query, wrbuf_cstr(s->full_query));
             if (!s->z_query->u.type_1)
             {
@@ -100,11 +100,11 @@ static int generate(ZOOM_query s)
             ext->descriptor = 0;
             ext->which = Z_External_CQL;
             ext->u.cql = odr_strdup(s->odr_query, wrbuf_cstr(s->full_query));
-            
+
             s->z_query = (Z_Query *) odr_malloc(s->odr_query, sizeof(*s->z_query));
             s->z_query->which = Z_Query_type_104;
             s->z_query->u.type_104 =  ext;
-            
+
             break;
         }
     }
@@ -161,18 +161,18 @@ static char *cql2pqf(ZOOM_connection c, const char *cql)
     }
 
     cqlfile = ZOOM_connection_option_get(c, "cqlfile");
-    if (cqlfile == 0) 
+    if (cqlfile == 0)
     {
         ZOOM_set_error(c, ZOOM_ERROR_CQL_TRANSFORM, "no CQL transform file");
     }
-    else if ((trans = cql_transform_open_fname(cqlfile)) == 0) 
+    else if ((trans = cql_transform_open_fname(cqlfile)) == 0)
     {
-        char buf[512];        
+        char buf[512];
         sprintf(buf, "can't open CQL transform file '%.200s': %.200s",
                 cqlfile, strerror(errno));
         ZOOM_set_error(c, ZOOM_ERROR_CQL_TRANSFORM, buf);
     }
-    else 
+    else
     {
         WRBUF wrbuf_result = wrbuf_alloc();
         error = cql_transform(trans, cql_parser_result(parser),
@@ -181,7 +181,7 @@ static char *cql2pqf(ZOOM_connection c, const char *cql)
             char buf[512];
             const char *addinfo;
             error = cql_transform_error(trans, &addinfo);
-            sprintf(buf, "%.200s (addinfo=%.200s)", 
+            sprintf(buf, "%.200s (addinfo=%.200s)",
                     cql_strerror(error), addinfo);
             ZOOM_set_error(c, ZOOM_ERROR_CQL_TRANSFORM, buf);
         }
index 7538ff5..d9d3765 100644 (file)
@@ -66,20 +66,20 @@ static size_t record_hash(int pos)
     return pos % RECORD_HASH_SIZE;
 }
 
-void ZOOM_record_cache_add(ZOOM_resultset r, Z_NamePlusRecord *npr, 
+void ZOOM_record_cache_add(ZOOM_resultset r, Z_NamePlusRecord *npr,
                            int pos,
                            const char *syntax, const char *elementSetName,
                            const char *schema,
                            Z_SRW_diagnostic *diag)
 {
     ZOOM_record_cache rc = 0;
-    
+
     ZOOM_Event event = ZOOM_Event_create(ZOOM_EVENT_RECV_RECORD);
     ZOOM_connection_put_event(r->connection, event);
 
     for (rc = r->record_hash[record_hash(pos)]; rc; rc = rc->next)
     {
-        if (pos == rc->pos 
+        if (pos == rc->pos
             && strcmp_null(r->schema, rc->schema) == 0
             && strcmp_null(elementSetName,rc->elementSetName) == 0
             && strcmp_null(syntax, rc->syntax) == 0)
@@ -96,9 +96,9 @@ void ZOOM_record_cache_add(ZOOM_resultset r, Z_NamePlusRecord *npr,
         rc->rec.wrbuf = 0;
 #endif
         rc->elementSetName = odr_strdup_null(r->odr, elementSetName);
-        
+
         rc->syntax = odr_strdup_null(r->odr, syntax);
-        
+
         rc->schema = odr_strdup_null(r->odr, r->schema);
 
         rc->pos = pos;
@@ -121,7 +121,7 @@ void ZOOM_record_cache_add(ZOOM_resultset r, Z_NamePlusRecord *npr,
                 *cp = '\0';
             rc->rec.diag_uri = odr_strdup(r->odr, diag->uri);
         }
-        rc->rec.diag_message = odr_strdup_null(r->odr, diag->message);            
+        rc->rec.diag_message = odr_strdup_null(r->odr, diag->message);
         rc->rec.diag_details = odr_strdup_null(r->odr, diag->details);
     }
 }
@@ -131,7 +131,7 @@ ZOOM_record ZOOM_record_cache_lookup(ZOOM_resultset r, int pos,
                                      const char *elementSetName)
 {
     ZOOM_record_cache rc;
-    
+
     for (rc = r->record_hash[record_hash(pos)]; rc; rc = rc->next)
     {
         if (pos == rc->pos)
@@ -160,7 +160,7 @@ ZOOM_API(ZOOM_record)
     if (!z_NamePlusRecord(odr_enc, &srec->npr, 0, 0))
         return 0;
     buf = odr_getbuf(odr_enc, &size, 0);
-    
+
     nrec = (ZOOM_record) xmalloc(sizeof(*nrec));
     nrec->odr = odr_createmem(ODR_DECODE);
 #if SHPTR
@@ -170,7 +170,7 @@ ZOOM_API(ZOOM_record)
 #endif
     odr_setbuf(nrec->odr, buf, size, 0);
     z_NamePlusRecord(nrec->odr, &nrec->npr, 0, 0);
-    
+
     nrec->schema = odr_strdup_null(nrec->odr, srec->schema);
     nrec->diag_uri = odr_strdup_null(nrec->odr, srec->diag_uri);
     nrec->diag_message = odr_strdup_null(nrec->odr, srec->diag_message);
@@ -217,10 +217,10 @@ ZOOM_API(const char *)
     ZOOM_record_get(ZOOM_record rec, const char *type_spec, int *len)
 {
     WRBUF wrbuf;
-    
+
     if (len)
         *len = 0; /* default return */
-        
+
     if (!rec || !rec->npr)
         return 0;
 
@@ -244,7 +244,7 @@ ZOOM_API(int)
                       const char **addinfo, const char **diagset)
 {
     Z_NamePlusRecord *npr;
-    
+
     if (!rec)
         return 0;
 
@@ -269,7 +269,7 @@ ZOOM_API(int)
         {
             Z_DefaultDiagFormat *ddf = diag_rec->u.defaultFormat;
             oid_class oclass;
-    
+
             error = *ddf->condition;
             switch (ddf->which)
             {
index cb5579a..4eac90c 100644 (file)
@@ -39,7 +39,7 @@ ZOOM_API(int)
     {
         ZOOM_connection c = cs[i];
         int fd, mask;
-        
+
         if (!c)
             continue;
         fd = ZOOM_connection_get_socket(c);
index 04aff43..9936bdd 100644 (file)
@@ -64,7 +64,7 @@ static zoom_ret send_srw(ZOOM_connection c, Z_SRW_PDU *sr)
     if (c->odr_save)
         z_GDU(c->odr_save, &gdu, 0, 0);
     c->buf_out = odr_getbuf(c->odr_out, &c->len_out, 0);
-        
+
     event = ZOOM_Event_create(ZOOM_EVENT_SEND_APDU);
     ZOOM_connection_put_event(c, event);
     odr_reset(c->odr_out);
@@ -94,7 +94,7 @@ zoom_ret ZOOM_connection_srw_send_scan(ZOOM_connection c)
         return zoom_complete;
     assert (c->tasks->which == ZOOM_TASK_SCAN);
     scan = c->tasks->u.scan.scan;
-        
+
     sr = ZOOM_srw_get_pdu(c, Z_SRW_scan_request);
 
     z_query = ZOOM_query_get_Z_Query(scan->query);
@@ -120,10 +120,10 @@ zoom_ret ZOOM_connection_srw_send_scan(ZOOM_connection c)
 
     sr->u.scan_request->maximumTerms = odr_intdup(
         c->odr_out, ZOOM_options_get_int(scan->options, "number", 10));
-    
+
     sr->u.scan_request->responsePosition = odr_intdup(
         c->odr_out, ZOOM_options_get_int(scan->options, "position", 1));
-    
+
     option_val = ZOOM_options_get(scan->options, "extraArgs");
     yaz_encode_sru_extra(sr, c->odr_out, option_val);
     return send_srw(c, sr);
@@ -197,7 +197,7 @@ zoom_ret ZOOM_connection_srw_send_search(ZOOM_connection c)
         return zoom_complete;
     }
     assert(resultset->query);
-        
+
     sr = ZOOM_srw_get_pdu(c, Z_SRW_searchRetrieve_request);
     z_query = ZOOM_query_get_Z_Query(resultset->query);
 
@@ -211,7 +211,7 @@ zoom_ret ZOOM_connection_srw_send_search(ZOOM_connection c)
     {
         sr->u.request->query_type = Z_SRW_query_type_pqf;
         sr->u.request->query.pqf =
-            odr_strdup(c->odr_out, 
+            odr_strdup(c->odr_out,
                        ZOOM_query_get_query_string(resultset->query));
     }
     else
@@ -219,7 +219,7 @@ zoom_ret ZOOM_connection_srw_send_search(ZOOM_connection c)
         ZOOM_set_error(c, ZOOM_ERROR_UNSUPPORTED_QUERY, 0);
         return zoom_complete;
     }
-   
+
     option_val = ZOOM_query_get_sru11(resultset->query);
     if (option_val)
     {
@@ -228,11 +228,11 @@ zoom_ret ZOOM_connection_srw_send_search(ZOOM_connection c)
     }
     sr->u.request->startRecord = odr_intdup(c->odr_out, *start + 1);
     sr->u.request->maximumRecords = odr_intdup(
-        c->odr_out, (resultset->step > 0 && resultset->step < *count) ? 
+        c->odr_out, (resultset->step > 0 && resultset->step < *count) ?
         resultset->step : *count);
     sr->u.request->recordSchema = resultset->schema;
     sr->u.request->facetList = facet_list;
-    
+
     option_val = ZOOM_resultset_option_get(resultset, "recordPacking");
     if (option_val)
         sr->u.request->recordPacking = odr_strdup(c->odr_out, option_val);
@@ -269,7 +269,7 @@ static zoom_ret handle_srw_response(ZOOM_connection c,
         start = &c->tasks->u.search.start;
         count = &c->tasks->u.search.count;
         syntax = c->tasks->u.search.syntax;
-        elementSetName = c->tasks->u.search.elementSetName;        
+        elementSetName = c->tasks->u.search.elementSetName;
 
         /* Required not for reporting client hit count multiple times into session */
         if (!c->tasks->u.search.recv_search_fired) {
@@ -317,19 +317,19 @@ static zoom_ret handle_srw_response(ZOOM_connection c,
             Z_SRW_record *sru_rec;
             Z_SRW_diagnostic *diag = 0;
             int num_diag;
-            
+
             Z_NamePlusRecord *npr = (Z_NamePlusRecord *)
                 odr_malloc(c->odr_in, sizeof(Z_NamePlusRecord));
 
             /* recordPosition is 1 based */
-            if (res->records[i].recordPosition && 
+            if (res->records[i].recordPosition &&
                 *res->records[i].recordPosition > 0)
                 pos = *res->records[i].recordPosition - 1;
             else
                 pos = *start + i;
 
             sru_rec = &res->records[i];
-            
+
             npr->databaseName = 0;
             npr->which = Z_NamePlusRecord_databaseRecord;
             npr->u.databaseRecord = (Z_External *)
@@ -339,16 +339,16 @@ static zoom_ret handle_srw_response(ZOOM_connection c,
                 odr_oiddup(c->odr_in, yaz_oid_recsyn_xml);
             npr->u.databaseRecord->indirect_reference = 0;
             npr->u.databaseRecord->which = Z_External_octet;
-            
+
             npr->u.databaseRecord->u.octet_aligned = (Odr_oct *)
                 odr_malloc(c->odr_in, sizeof(Odr_oct));
             npr->u.databaseRecord->u.octet_aligned->buf = (unsigned char*)
                 sru_rec->recordData_buf;
-            npr->u.databaseRecord->u.octet_aligned->len = 
-                npr->u.databaseRecord->u.octet_aligned->size = 
+            npr->u.databaseRecord->u.octet_aligned->len =
+                npr->u.databaseRecord->u.octet_aligned->size =
                 sru_rec->recordData_len;
-            
-            if (sru_rec->recordSchema 
+
+            if (sru_rec->recordSchema
                 && !strcmp(sru_rec->recordSchema,
                            "info:srw/schema/1/diagnostics-v1.1"))
             {
@@ -436,7 +436,7 @@ int ZOOM_handle_sru(ZOOM_connection c, Z_HTTP_Response *hres,
         if (!ret && soap_package->which == Z_SOAP_generic)
         {
             Z_SRW_PDU *sr = (Z_SRW_PDU*) soap_package->u.generic->p;
-            
+
             ZOOM_options_set(c->options, "sru_version", sr->srw_version);
             ZOOM_options_setl(c->options, "sru_extra_response_data",
                               sr->extraResponseData_buf, sr->extraResponseData_len);
@@ -468,7 +468,7 @@ int ZOOM_handle_sru(ZOOM_connection c, Z_HTTP_Response *hres,
                 strcpy(*addinfo + sz, "");
             ret = -1;
         }
-    }   
+    }
     return ret;
 #else
     return -1;
index 3d603ef..cf1b12f 100644 (file)
@@ -50,15 +50,15 @@ static Z_APDU *create_es_package(ZOOM_package p, const Odr_oid *oid)
     const char *str;
     Z_APDU *apdu = zget_APDU(p->odr_out, Z_APDU_extendedServicesRequest);
     Z_ExtendedServicesRequest *req = apdu->u.extendedServicesRequest;
-    
+
     str = ZOOM_options_get(p->options, "package-name");
     if (str && *str)
         req->packageName = odr_strdup(p->odr_out, str);
-    
+
     str = ZOOM_options_get(p->options, "user-id");
     if (str)
         req->userId = odr_strdup_null(p->odr_out, str);
-    
+
     req->packageType = odr_oiddup(p->odr_out, oid);
 
     str = ZOOM_options_get(p->options, "function");
@@ -99,13 +99,13 @@ static Z_External *encode_ill_request(ZOOM_package p)
     ILL_Request *req;
     Z_External *r = 0;
     struct ill_get_ctl ctl;
-        
+
     ctl.odr = p->odr_out;
     ctl.clientData = p;
     ctl.f = ill_array_lookup;
-        
+
     req = ill_get_ILLRequest(&ctl, "ill", 0);
-        
+
     if (!ill_Request(out, &req, 0, 0))
     {
         int ill_request_size;
@@ -118,13 +118,13 @@ static Z_External *encode_ill_request(ZOOM_package p)
     {
         int illRequest_size = 0;
         char *illRequest_buf = odr_getbuf(out, &illRequest_size, 0);
-                
+
         r = (Z_External *) odr_malloc(out, sizeof(*r));
         r->direct_reference = odr_oiddup(out, yaz_oid_general_isoill_1);
         r->indirect_reference = 0;
         r->descriptor = 0;
         r->which = Z_External_single;
-                
+
         r->u.single_ASN1_type =
             odr_create_Odr_oct(out,
                                (unsigned char *)illRequest_buf,
@@ -138,9 +138,9 @@ static Z_ItemOrder *encode_item_order(ZOOM_package p)
     Z_ItemOrder *req = (Z_ItemOrder *) odr_malloc(p->odr_out, sizeof(*req));
     const char *str;
     int len;
-    
+
     req->which = Z_IOItemOrder_esRequest;
-    req->u.esRequest = (Z_IORequest *) 
+    req->u.esRequest = (Z_IORequest *)
         odr_malloc(p->odr_out,sizeof(Z_IORequest));
 
     /* to keep part ... */
@@ -149,30 +149,30 @@ static Z_ItemOrder *encode_item_order(ZOOM_package p)
     req->u.esRequest->toKeep->supplDescription = 0;
     req->u.esRequest->toKeep->contact = (Z_IOContact *)
         odr_malloc(p->odr_out, sizeof(*req->u.esRequest->toKeep->contact));
-        
+
     str = ZOOM_options_get(p->options, "contact-name");
     req->u.esRequest->toKeep->contact->name =
         odr_strdup_null(p->odr_out, str);
-        
+
     str = ZOOM_options_get(p->options, "contact-phone");
     req->u.esRequest->toKeep->contact->phone =
         odr_strdup_null(p->odr_out, str);
-        
+
     str = ZOOM_options_get(p->options, "contact-email");
     req->u.esRequest->toKeep->contact->email =
         odr_strdup_null(p->odr_out, str);
-        
+
     req->u.esRequest->toKeep->addlBilling = 0;
-        
+
     /* not to keep part ... */
     req->u.esRequest->notToKeep = (Z_IOOriginPartNotToKeep *)
         odr_malloc(p->odr_out,sizeof(Z_IOOriginPartNotToKeep));
-        
+
     str = ZOOM_options_get(p->options, "itemorder-setname");
     if (!str)
         str = "default";
 
-    if (!*str) 
+    if (!*str)
         req->u.esRequest->notToKeep->resultSetItem = 0;
     else
     {
@@ -183,7 +183,7 @@ static Z_ItemOrder *encode_item_order(ZOOM_package p)
             odr_strdup(p->odr_out, str);
         req->u.esRequest->notToKeep->resultSetItem->item =
             odr_intdup(p->odr_out, 0);
-        
+
         str = ZOOM_options_get(p->options, "itemorder-item");
         *req->u.esRequest->notToKeep->resultSetItem->item =
             (str ? atoi(str) : 1);
@@ -197,11 +197,11 @@ static Z_ItemOrder *encode_item_order(ZOOM_package p)
     }
     else
         req->u.esRequest->notToKeep->itemRequest = encode_ill_request(p);
-    
+
     return req;
 }
 
-Z_APDU *create_admin_package(ZOOM_package p, int type, 
+Z_APDU *create_admin_package(ZOOM_package p, int type,
                              Z_ESAdminOriginPartToKeep **toKeepP,
                              Z_ESAdminOriginPartNotToKeep **notToKeepP)
 {
@@ -218,26 +218,26 @@ Z_APDU *create_admin_package(ZOOM_package p, int type,
                                                   p->odr_out);
         if (num_db > 0)
             first_db = db[0];
-            
+
         r->direct_reference = odr_oiddup(p->odr_out, yaz_oid_extserv_admin);
         r->descriptor = 0;
         r->indirect_reference = 0;
         r->which = Z_External_ESAdmin;
-        
+
         r->u.adminService = (Z_Admin *)
             odr_malloc(p->odr_out, sizeof(*r->u.adminService));
         r->u.adminService->which = Z_Admin_esRequest;
         r->u.adminService->u.esRequest = (Z_AdminEsRequest *)
             odr_malloc(p->odr_out, sizeof(*r->u.adminService->u.esRequest));
-        
+
         toKeep = r->u.adminService->u.esRequest->toKeep =
-            (Z_ESAdminOriginPartToKeep *) 
+            (Z_ESAdminOriginPartToKeep *)
             odr_malloc(p->odr_out, sizeof(*r->u.adminService->u.esRequest->toKeep));
         toKeep->which = type;
         toKeep->databaseName = odr_strdup(p->odr_out, first_db);
         toKeep->u.create = odr_nullval();
         apdu->u.extendedServicesRequest->taskSpecificParameters = r;
-        
+
         r->u.adminService->u.esRequest->notToKeep = notToKeep =
             (Z_ESAdminOriginPartNotToKeep *)
             odr_malloc(p->odr_out,
@@ -270,7 +270,7 @@ static Z_APDU *create_xmlupdate_package(ZOOM_package p)
     ext->direct_reference = req->packageType;
     ext->descriptor = 0;
     ext->indirect_reference = 0;
-    
+
     ext->which = Z_External_octet;
     ext->u.single_ASN1_type =
         odr_create_Odr_oct(p->odr_out, (const unsigned char *) doc, len);
@@ -324,14 +324,14 @@ static Z_APDU *create_update_package(ZOOM_package p)
                                            p->odr_out);
     }
     if (!syntax_oid)
-    { 
+    {
         ZOOM_set_error(p->connection, ZOOM_ERROR_ES_INVALID_SYNTAX, syntax_str);
         return 0;
     }
 
     if (num_db > 0)
         first_db = db[0];
-    
+
     switch (*version)
     {
     case '1':
@@ -354,7 +354,7 @@ static Z_APDU *create_update_package(ZOOM_package p)
         ZOOM_set_error(p->connection, ZOOM_ERROR_ES_INVALID_VERSION, version);
         return 0;
     }
-    
+
     if (!strcmp(action, "recordInsert"))
         action_no = Z_IUOriginPartToKeep_recordInsert;
     else if (!strcmp(action, "recordReplace"))
@@ -380,32 +380,32 @@ static Z_APDU *create_update_package(ZOOM_package p)
             odr_malloc(p->odr_out, sizeof(*r));
         const char *elementSetName =
             ZOOM_options_get(p->options, "elementSetName");
-        
+
         apdu->u.extendedServicesRequest->taskSpecificParameters = r;
-        
+
         r->direct_reference = odr_oiddup(p->odr_out, package_oid);
         r->descriptor = 0;
         r->which = Z_External_update;
         r->indirect_reference = 0;
         r->u.update = (Z_IUUpdate *)
             odr_malloc(p->odr_out, sizeof(*r->u.update));
-        
+
         r->u.update->which = Z_IUUpdate_esRequest;
         r->u.update->u.esRequest = (Z_IUUpdateEsRequest *)
             odr_malloc(p->odr_out, sizeof(*r->u.update->u.esRequest));
-        toKeep = r->u.update->u.esRequest->toKeep = 
+        toKeep = r->u.update->u.esRequest->toKeep =
             (Z_IUOriginPartToKeep *)
             odr_malloc(p->odr_out, sizeof(*toKeep));
-        
+
         toKeep->databaseName = odr_strdup(p->odr_out, first_db);
         toKeep->schema = 0;
-        
+
         toKeep->elementSetName = odr_strdup_null(p->odr_out, elementSetName);
-            
+
         toKeep->actionQualifier = 0;
         toKeep->action = odr_intdup(p->odr_out, action_no);
-        
-        notToKeep = r->u.update->u.esRequest->notToKeep = 
+
+        notToKeep = r->u.update->u.esRequest->notToKeep =
             (Z_IUSuppliedRecords *)
             odr_malloc(p->odr_out, sizeof(*notToKeep));
         notToKeep->num = 1;
@@ -416,7 +416,7 @@ static Z_APDU *create_update_package(ZOOM_package p)
         notToKeep->elements[0]->which = Z_IUSuppliedRecords_elem_opaque;
         if (recordIdOpaque)
         {
-            notToKeep->elements[0]->u.opaque = 
+            notToKeep->elements[0]->u.opaque =
                 odr_create_Odr_oct(p->odr_out,
                                    (const unsigned char *) recordIdOpaque,
                                    recordIdOpaque_len);
@@ -424,7 +424,7 @@ static Z_APDU *create_update_package(ZOOM_package p)
         else if (recordIdNumber)
         {
             notToKeep->elements[0]->which = Z_IUSuppliedRecords_elem_number;
-            
+
             notToKeep->elements[0]->u.number =
                 odr_intdup(p->odr_out, atoi(recordIdNumber));
         }
@@ -490,12 +490,12 @@ static void otherInfo_attach(ZOOM_connection c, Z_APDU *a, ODR out)
             len = sizeof(buf)-1;
         memcpy(buf, val, len);
         buf[len] = '\0';
-        
+
         oid = yaz_string_to_oid_odr(yaz_oid_std(), CLASS_USERINFO,
                                     buf, out);
         if (!oid)
             continue;
-        
+
         yaz_oi_APDU(a, &oi);
         yaz_oi_set_string_oid(oi, out, oid, 1, cp+1);
     }
@@ -510,14 +510,14 @@ static int encode_APDU(ZOOM_connection c, Z_APDU *a, ODR out)
     {
         Z_OtherInformation **oi;
         yaz_oi_APDU(a, &oi);
-        yaz_oi_set_string_oid(oi, out, yaz_oid_userinfo_cookie, 
+        yaz_oi_set_string_oid(oi, out, yaz_oid_userinfo_cookie,
                               1, c->cookie_out);
     }
     if (c->client_IP)
     {
         Z_OtherInformation **oi;
         yaz_oi_APDU(a, &oi);
-        yaz_oi_set_string_oid(oi, out, yaz_oid_userinfo_client_ip, 
+        yaz_oi_set_string_oid(oi, out, yaz_oid_userinfo_client_ip,
                               1, c->client_IP);
     }
     otherInfo_attach(c, a, out);
@@ -572,30 +572,30 @@ zoom_ret ZOOM_connection_Z3950_send_init(ZOOM_connection c)
     ODR_MASK_SET(ireq->options, Z_Options_sort);
     ODR_MASK_SET(ireq->options, Z_Options_extendedServices);
     ODR_MASK_SET(ireq->options, Z_Options_namedResultSets);
-    
+
     ODR_MASK_SET(ireq->protocolVersion, Z_ProtocolVersion_1);
     ODR_MASK_SET(ireq->protocolVersion, Z_ProtocolVersion_2);
     ODR_MASK_SET(ireq->protocolVersion, Z_ProtocolVersion_3);
-    
+
     ireq->implementationId =
         odr_prepend(c->odr_out,
                     ZOOM_options_get(c->options, "implementationId"),
                     ireq->implementationId);
-    
-    ireq->implementationName = 
+
+    ireq->implementationName =
         odr_prepend(c->odr_out,
                     ZOOM_options_get(c->options, "implementationName"),
                     odr_prepend(c->odr_out, "ZOOM-C",
                                 ireq->implementationName));
-    
-    ireq->implementationVersion = 
+
+    ireq->implementationVersion =
         odr_prepend(c->odr_out,
                     ZOOM_options_get(c->options, "implementationVersion"),
                                 ireq->implementationVersion);
-    
+
     *ireq->maximumRecordSize = c->maximum_record_size;
     *ireq->preferredMessageSize = c->preferred_message_size;
-    
+
     if (c->group || c->password)
     {
         Z_IdPass *pass = (Z_IdPass *) odr_malloc(c->odr_out, sizeof(*pass));
@@ -621,9 +621,9 @@ zoom_ret ZOOM_connection_Z3950_send_init(ZOOM_connection c)
     {
         Z_OtherInformation **oi;
         Z_OtherInformationUnit *oi_unit;
-        
+
         yaz_oi_APDU(apdu, &oi);
-        
+
         if ((oi_unit = yaz_oi_update(oi, c->odr_out, NULL, 0, 0)))
         {
             ODR_MASK_SET(ireq->options, Z_Options_negotiationModel);
@@ -691,7 +691,7 @@ zoom_ret ZOOM_connection_Z3950_send_search(ZOOM_connection c)
         ZOOM_set_error(c, ZOOM_ERROR_INVALID_QUERY, 0);
         return zoom_complete;
     }
-    if (search_req->query->which == Z_Query_type_1 || 
+    if (search_req->query->which == Z_Query_type_1 ||
         search_req->query->which == Z_Query_type_101)
     {
         const char *cp = ZOOM_options_get(r->options, "rpnCharset");
@@ -703,7 +703,7 @@ zoom_ret ZOOM_connection_Z3950_send_search(ZOOM_connection c)
                 int r;
                 search_req->query = yaz_copy_Z_Query(search_req->query,
                                                      c->odr_out);
-                
+
                 r = yaz_query_charset_convert_rpnquery_check(
                     search_req->query->u.type_1,
                     c->odr_out, cd);
@@ -738,7 +738,7 @@ zoom_ret ZOOM_connection_Z3950_send_search(ZOOM_connection c)
         /* Regular piggyback - do it unless we're going to do sort */
         *search_req->largeSetLowerBound = 2000000000;
         *search_req->smallSetUpperBound = 1;
-        *search_req->mediumSetPresentNumber = 
+        *search_req->mediumSetPresentNumber =
             r->step>0 ? r->step : c->tasks->u.search.count;
     }
     else
@@ -752,7 +752,7 @@ zoom_ret ZOOM_connection_Z3950_send_search(ZOOM_connection c)
     {
         Z_ElementSetNames *esn = (Z_ElementSetNames *)
             odr_malloc(c->odr_out, sizeof(*esn));
-        
+
         esn->which = Z_ElementSetNames_generic;
         esn->u.generic = odr_strdup(c->odr_out, smallSetElementSetName);
         search_req->smallSetElementSetNames = esn;
@@ -761,7 +761,7 @@ zoom_ret ZOOM_connection_Z3950_send_search(ZOOM_connection c)
     {
         Z_ElementSetNames *esn =(Z_ElementSetNames *)
             odr_malloc(c->odr_out, sizeof(*esn));
-        
+
         esn->which = Z_ElementSetNames_generic;
         esn->u.generic = odr_strdup(c->odr_out, mediumSetElementSetName);
         search_req->mediumSetElementSetNames = esn;
@@ -769,7 +769,7 @@ zoom_ret ZOOM_connection_Z3950_send_search(ZOOM_connection c)
     if (syntax)
         search_req->preferredRecordSyntax =
             zoom_yaz_str_to_z3950oid(c, CLASS_RECSYN, syntax);
-    
+
     if (!r->setname)
     {
         if (c->support_named_resultsets)
@@ -879,7 +879,7 @@ zoom_ret ZOOM_connection_Z3950_send_scan(ZOOM_connection c)
     req->stepSize =
         odr_intdup(c->odr_out,
                    ZOOM_options_get_int(scan->options, "stepSize", 0));
-    
+
     req->databaseNames = scan->databaseNames;
     req->num_databaseNames = scan->num_databaseNames;
 
@@ -903,8 +903,8 @@ ZOOM_API(void)
         if (apdu)
         {
             Z_External *r = (Z_External *) odr_malloc(p->odr_out, sizeof(*r));
-            
-            r->direct_reference = 
+
+            r->direct_reference =
                 odr_oiddup(p->odr_out, yaz_oid_extserv_item_order);
             r->descriptor = 0;
             r->which = Z_External_itemOrder;
@@ -918,7 +918,7 @@ ZOOM_API(void)
     {
         apdu = create_admin_package(p, Z_ESAdminOriginPartToKeep_create,
                                     0, 0);
-    }   
+    }
     else if (!strcmp(type, "drop"))  /* drop database */
     {
         apdu = create_admin_package(p, Z_ESAdminOriginPartToKeep_drop,
@@ -948,7 +948,7 @@ ZOOM_API(void)
             buf = odr_getbuf(p->odr_out, &p->len_out, 0);
             p->buf_out = (char *) xmalloc(p->len_out);
             memcpy(p->buf_out, buf, p->len_out);
-            
+
             (p->refcount)++;
             if (!c->async)
             {
@@ -1023,7 +1023,7 @@ static int es_response_taskpackage(ZOOM_connection c,
     if (id)
         ZOOM_options_setl(c->tasks->u.package->options,
                           "targetReference", (char*) id->buf, id->len);
-    
+
     switch ( *taskPackage->taskStatus ) {
     case Z_TaskPackage_pending:
         ZOOM_options_set(c->tasks->u.package->options,"taskStatus", "pending");
@@ -1075,7 +1075,7 @@ static int handle_Z3950_es_response(ZOOM_connection c,
         Z_TaskPackage *taskPackage = res->taskPackage->u.extendedService;
         es_response_taskpackage(c, taskPackage);
     }
-    if (res->taskPackage && 
+    if (res->taskPackage &&
         res->taskPackage->which == Z_External_octet)
     {
         Odr_oct *doc = res->taskPackage->u.octet_aligned;
@@ -1107,10 +1107,10 @@ static void interpret_otherinformation_field(ZOOM_connection c,
         if (unit->which == Z_OtherInfo_externallyDefinedInfo &&
             unit->information.externallyDefinedInfo &&
             unit->information.externallyDefinedInfo->which ==
-            Z_External_diag1) 
+            Z_External_diag1)
         {
             interpret_init_diag(c, unit->information.externallyDefinedInfo->u.diag1);
-        } 
+        }
     }
 }
 
@@ -1186,7 +1186,7 @@ static void handle_queryExpressionTerm(ZOOM_options opt, const char *name,
     {
     case Z_Term_general:
         ZOOM_options_setl(opt, name,
-                          (const char *)(term->u.general->buf), 
+                          (const char *)(term->u.general->buf),
                           term->u.general->len);
         break;
     case Z_Term_characterString:
@@ -1202,7 +1202,7 @@ static void handle_queryExpression(ZOOM_options opt, const char *name,
                                    Z_QueryExpression *exp)
 {
     char opt_name[80];
-    
+
     switch (exp->which)
     {
     case Z_QueryExpression_term:
@@ -1227,12 +1227,12 @@ static void handle_search_result(ZOOM_connection c, ZOOM_resultset resultset,
         if (o->list[i]->which == Z_OtherInfo_externallyDefinedInfo)
         {
             Z_External *ext = o->list[i]->information.externallyDefinedInfo;
-            
+
             if (ext->which == Z_External_searchResult1)
             {
                 int j;
                 Z_SearchInfoReport *sr = ext->u.searchResult1;
-                
+
                 if (sr->num)
                     ZOOM_options_set_int(
                         resultset->options, "searchresult.size", sr->num);
@@ -1242,7 +1242,7 @@ static void handle_search_result(ZOOM_connection c, ZOOM_resultset resultset,
                     Z_SearchInfoReport_s *ent =
                         ext->u.searchResult1->elements[j];
                     char pref[80];
-                    
+
                     sprintf(pref, "searchresult.%d", j);
 
                     if (ent->subqueryId)
@@ -1279,7 +1279,7 @@ static void handle_search_result(ZOOM_connection c, ZOOM_resultset resultset,
                         sprintf(opt_name, "%s.count", pref);
                         ZOOM_options_set_int(resultset->options, opt_name,
                                              *ent->subqueryCount);
-                    }                                             
+                    }
                 }
             }
         }
@@ -1370,7 +1370,7 @@ static void handle_Z3950_records(ZOOM_connection c, Z_Records *sr,
         elementSetName = c->tasks->u.search.elementSetName;
         break;
     case ZOOM_TASK_RETRIEVE:
-        resultset = c->tasks->u.retrieve.resultset;        
+        resultset = c->tasks->u.retrieve.resultset;
         start = &c->tasks->u.retrieve.start;
         count = &c->tasks->u.retrieve.count;
         syntax = c->tasks->u.retrieve.syntax;
@@ -1388,7 +1388,7 @@ static void handle_Z3950_records(ZOOM_connection c, Z_Records *sr,
         else
             ZOOM_set_error(c, ZOOM_ERROR_DECODE, 0);
     }
-    else 
+    else
     {
         if (*count + *start > resultset->size)
             *count = resultset->size - *start;
@@ -1410,7 +1410,7 @@ static void handle_Z3950_records(ZOOM_connection c, Z_Records *sr,
             if (*count < 0)
                 *count = 0;
             *start += i;
-            yaz_log(c->log_details, 
+            yaz_log(c->log_details,
                     "handle_records resultset=%p start=%d count=%d",
                     resultset, *start, *count);
 
@@ -1420,9 +1420,9 @@ static void handle_Z3950_records(ZOOM_connection c, Z_Records *sr,
             if (present_phase && p->num_records == 0)
             {
                 /* present response and we didn't get any records! */
-                Z_NamePlusRecord *myrec = 
+                Z_NamePlusRecord *myrec =
                     zget_surrogateDiagRec(
-                        resultset->odr, 0, 
+                        resultset->odr, 0,
                         YAZ_BIB1_SYSTEM_ERROR_IN_PRESENTING_RECORDS,
                         "ZOOM C generated. Present phase and no records");
                 ZOOM_record_cache_add(resultset, myrec, *start,
@@ -1432,7 +1432,7 @@ static void handle_Z3950_records(ZOOM_connection c, Z_Records *sr,
         else if (present_phase)
         {
             /* present response and we didn't get any records! */
-            Z_NamePlusRecord *myrec = 
+            Z_NamePlusRecord *myrec =
                 zget_surrogateDiagRec(
                     resultset->odr, 0,
                     YAZ_BIB1_SYSTEM_ERROR_IN_PRESENTING_RECORDS,
@@ -1467,7 +1467,7 @@ zoom_ret send_Z3950_sort(ZOOM_connection c, ZOOM_resultset resultset)
     {
         Z_APDU *apdu = zget_APDU(c->odr_out, Z_APDU_sortRequest);
         Z_SortRequest *req = apdu->u.sortRequest;
-        
+
         req->num_inputResultSetNames = 1;
         req->inputResultSetNames = (Z_InternationalString **)
             odr_malloc(c->odr_out, sizeof(*req->inputResultSetNames));
@@ -1496,7 +1496,7 @@ zoom_ret send_Z3950_present(ZOOM_connection c)
         yaz_log(c->log_details, "%p send_present no tasks", c);
         return zoom_complete;
     }
-    
+
     switch (c->tasks->which)
     {
     case ZOOM_TASK_SEARCH:
@@ -1563,7 +1563,7 @@ zoom_ret send_Z3950_present(ZOOM_connection c)
         *req->numberOfRecordsRequested = resultset->step;
     else
         *req->numberOfRecordsRequested = *count;
-    
+
     if (*req->numberOfRecordsRequested + *start > resultset->size)
         *req->numberOfRecordsRequested = resultset->size - *start;
     assert(*req->numberOfRecordsRequested > 0);
@@ -1581,7 +1581,7 @@ zoom_ret send_Z3950_present(ZOOM_connection c)
         compo->which = Z_RecordComp_complex;
         compo->u.complex = (Z_CompSpec *)
             odr_malloc(c->odr_out, sizeof(*compo->u.complex));
-        compo->u.complex->selectAlternativeSyntax = (bool_t *) 
+        compo->u.complex->selectAlternativeSyntax = (bool_t *)
             odr_malloc(c->odr_out, sizeof(bool_t));
         *compo->u.complex->selectAlternativeSyntax = 0;
 
@@ -1621,7 +1621,7 @@ zoom_ret send_Z3950_present(ZOOM_connection c)
             odr_malloc(c->odr_out, sizeof(*esn));
         Z_RecordComposition *compo = (Z_RecordComposition *)
             odr_malloc(c->odr_out, sizeof(*compo));
-        
+
         esn->which = Z_ElementSetNames_generic;
         esn->u.generic = odr_strdup(c->odr_out, elementSetName);
         compo->which = Z_RecordComp_simple;
@@ -1646,7 +1646,7 @@ static zoom_ret send_Z3950_sort_present(ZOOM_connection c)
 void ZOOM_handle_Z3950_apdu(ZOOM_connection c, Z_APDU *apdu)
 {
     Z_InitResponse *initrs;
-    
+
     ZOOM_connection_set_mask(c, 0);
     yaz_log(c->log_details, "%p handle_Z3950_apdu apdu->which=%d",
             c, apdu->which);
@@ -1711,12 +1711,12 @@ void ZOOM_handle_Z3950_apdu(ZOOM_connection c, Z_APDU *apdu)
             NMEM tmpmem = nmem_create();
             Z_CharSetandLanguageNegotiation *p =
                 yaz_get_charneg_record(initrs->otherInfo);
-            
+
             if (p)
             {
                 char *charset = NULL, *lang = NULL;
                 int sel;
-                
+
                 yaz_get_response_charneg(tmpmem, p, &charset, &lang, &sel);
                 yaz_log(c->log_details, "%p handle_Z3950_apdu target accepted: "
                         "charset %s, language %s, select %d",
@@ -1734,7 +1734,7 @@ void ZOOM_handle_Z3950_apdu(ZOOM_connection c, Z_APDU *apdu)
                     (sel != 0) ? "1" : "0");
                 nmem_destroy(tmpmem);
             }
-        }       
+        }
         break;
     case Z_APDU_searchResponse:
         yaz_log(c->log_api, "%p handle_Z3950_apdu Search response", c);
index 4cc8423..de611d3 100644 (file)
@@ -22,14 +22,14 @@ static int tst_ccl_query(CCL_bibset bibset,
     if (parser && bibset)
     {
         struct ccl_rpn_node *rpn;
-        
+
         rpn = ccl_parser_find_str(parser, query);
         if (rpn)
         {
             /* parse ok. check that result is there and match */
             WRBUF wrbuf = wrbuf_alloc();
             ccl_pquery(wrbuf, rpn);
-            
+
             /* check expect a result and that it matches */
             if (result && !strcmp(wrbuf_cstr(wrbuf), result))
                 ret = 1;
@@ -43,7 +43,7 @@ static int tst_ccl_query(CCL_bibset bibset,
             ccl_rpn_delete(rpn);
             wrbuf_destroy(wrbuf);
         }
-        else 
+        else
         {
             if (result)
             {
@@ -126,7 +126,7 @@ void tst1(int pass)
                      "reg t=x\r\n"
                      "z t=z\r\n"
                      "dc.title 1=/my/title\n"
-                     "date r=r\n" 
+                     "date r=r\n"
                      "x r=o\n"
                      "title dc.title\n"
                      "comb term dc.title\n"
@@ -140,7 +140,7 @@ void tst1(int pass)
             xmlDocPtr doc;
             int r;
             const char *addinfo = 0;
-            const char *xml_str = 
+            const char *xml_str =
                 "<cclmap>\n"
                 " <qual name=\"ti\">\n"
                 "   <attr type=\"u\" value=\"4\"/>\n"
@@ -178,7 +178,7 @@ void tst1(int pass)
                 "   <attr type=\"s\" value=\"ag\"/>\n"
                 " </qual>\n"
                 "</cclmap>\n";
-            
+
             doc = xmlParseMemory(xml_str, strlen(xml_str));
             YAZ_CHECK(doc);
 
@@ -195,7 +195,7 @@ void tst1(int pass)
         YAZ_CHECK(0);
         return;
     }
-    
+
     YAZ_CHECK(tst_ccl_query(bibset, "x1", "@attr 4=2 @attr 1=1016 x1 "));
 
     YAZ_CHECK(tst_ccl_query(bibset, "k\xc3\xb8" "benhavn", "@attr 4=2 @attr 1=1016 k\xc3\xb8" "benhavn "));
@@ -213,59 +213,59 @@ void tst1(int pass)
     YAZ_CHECK(tst_ccl_query(bibset, "x1 and", 0));
     YAZ_CHECK(tst_ccl_query(bibset, "tix=x5", 0));
 
-    YAZ_CHECK(tst_ccl_query(bibset, "a%b", 
+    YAZ_CHECK(tst_ccl_query(bibset, "a%b",
                   "@prox 0 1 0 2 k 2 "
                   "@attr 4=2 @attr 1=1016 a "
                   "@attr 4=2 @attr 1=1016 b "));
-    YAZ_CHECK(tst_ccl_query(bibset, "a%(b)", 
+    YAZ_CHECK(tst_ccl_query(bibset, "a%(b)",
                   "@prox 0 1 0 2 k 2 "
                   "@attr 4=2 @attr 1=1016 a "
                   "@attr 4=2 @attr 1=1016 b "));
-    YAZ_CHECK(tst_ccl_query(bibset, "(a)%(b)", 
+    YAZ_CHECK(tst_ccl_query(bibset, "(a)%(b)",
                   "@prox 0 1 0 2 k 2 "
                   "@attr 4=2 @attr 1=1016 a "
                   "@attr 4=2 @attr 1=1016 b "));
-    YAZ_CHECK(tst_ccl_query(bibset, "a%1b", 
+    YAZ_CHECK(tst_ccl_query(bibset, "a%1b",
                   "@prox 0 1 0 2 k 2 "
                   "@attr 4=2 @attr 1=1016 a "
                   "@attr 4=2 @attr 1=1016 b "));
 
-    YAZ_CHECK(tst_ccl_query(bibset, "a%2b", 
+    YAZ_CHECK(tst_ccl_query(bibset, "a%2b",
                   "@prox 0 2 0 2 k 2 "
                   "@attr 4=2 @attr 1=1016 a "
                   "@attr 4=2 @attr 1=1016 b "));
 
-    YAZ_CHECK(tst_ccl_query(bibset, "(a)%2(b)", 
+    YAZ_CHECK(tst_ccl_query(bibset, "(a)%2(b)",
                   "@prox 0 2 0 2 k 2 "
                   "@attr 4=2 @attr 1=1016 a "
                   "@attr 4=2 @attr 1=1016 b "));
 
-    YAZ_CHECK(tst_ccl_query(bibset, "a%19b", 
+    YAZ_CHECK(tst_ccl_query(bibset, "a%19b",
                   "@prox 0 19 0 2 k 2 "
                   "@attr 4=2 @attr 1=1016 a "
                   "@attr 4=2 @attr 1=1016 b "));
 
-    YAZ_CHECK(tst_ccl_query(bibset, "spid%æserne", 
+    YAZ_CHECK(tst_ccl_query(bibset, "spid%æserne",
                   "@prox 0 1 0 2 k 2 "
                   "@attr 4=2 @attr 1=1016 spid "
                   "@attr 4=2 @attr 1=1016 Ã¦serne "));
 
-    YAZ_CHECK(tst_ccl_query(bibset, "a!b", 
+    YAZ_CHECK(tst_ccl_query(bibset, "a!b",
                   "@prox 0 1 1 2 k 2 "
                   "@attr 4=2 @attr 1=1016 a "
                   "@attr 4=2 @attr 1=1016 b "));
-    YAZ_CHECK(tst_ccl_query(bibset, "a!2b", 
+    YAZ_CHECK(tst_ccl_query(bibset, "a!2b",
                   "@prox 0 2 1 2 k 2 "
                   "@attr 4=2 @attr 1=1016 a "
                   "@attr 4=2 @attr 1=1016 b "));
 
-    YAZ_CHECK(tst_ccl_query(bibset, "a% (b or dc.title=c)", 
+    YAZ_CHECK(tst_ccl_query(bibset, "a% (b or dc.title=c)",
                   "@prox 0 1 0 2 k 2 "
                   "@attr 4=2 @attr 1=1016 a "
                   "@or @attr 4=2 @attr 1=1016 b "
                             "@attr 4=2 @attr 1=1016 @attr 1=/my/title c "));
 
-    YAZ_CHECK(tst_ccl_query(bibset, "(a b) % (c)", 
+    YAZ_CHECK(tst_ccl_query(bibset, "(a b) % (c)",
                             "@prox 0 1 0 2 k 2 @and "
                             "@attr 4=2 @attr 1=1016 a @attr 4=2 @attr 1=1016 b "
                             "@attr 4=2 @attr 1=1016 c " ));
@@ -307,30 +307,30 @@ void tst1(int pass)
 
     YAZ_CHECK(tst_ccl_query(bibset, "a?",
                             "@attr 5=1 @attr 4=2 @attr 1=1016 a "));
-    YAZ_CHECK(tst_ccl_query(bibset, "a b", 
+    YAZ_CHECK(tst_ccl_query(bibset, "a b",
                             "@and @attr 4=2 @attr 1=1016 a "
                             "@attr 4=2 @attr 1=1016 b "));
 
-    YAZ_CHECK(tst_ccl_query(bibset, "a b?", 
+    YAZ_CHECK(tst_ccl_query(bibset, "a b?",
                             "@and @attr 4=2 @attr 1=1016 a "
                             "@attr 5=1 @attr 4=2 @attr 1=1016 b "));
 
-    YAZ_CHECK(tst_ccl_query(bibset, "title=a", 
+    YAZ_CHECK(tst_ccl_query(bibset, "title=a",
                             "@attr 1=/my/title a "));
 
-    YAZ_CHECK(tst_ccl_query(bibset, "reg=a?b#\"c?\"", 
+    YAZ_CHECK(tst_ccl_query(bibset, "reg=a?b#\"c?\"",
                             "@attr 5=102 a.*b.c\\\\? "));
-    YAZ_CHECK(tst_ccl_query(bibset, "z=a?b#\"c?\"", 
+    YAZ_CHECK(tst_ccl_query(bibset, "z=a?b#\"c?\"",
                             "@attr 5=104 a?b#c\\\\? "));
 
-    YAZ_CHECK(tst_ccl_query(bibset, "reg=\\(", 
+    YAZ_CHECK(tst_ccl_query(bibset, "reg=\\(",
                             "@attr 5=102 \\\\( "));
-    YAZ_CHECK(tst_ccl_query(bibset, "z=\\(", 
+    YAZ_CHECK(tst_ccl_query(bibset, "z=\\(",
                             "( "));
 
-    YAZ_CHECK(tst_ccl_query(bibset, "reg=\\\"", 
+    YAZ_CHECK(tst_ccl_query(bibset, "reg=\\\"",
                             "\"\\\"\" "));
-    YAZ_CHECK(tst_ccl_query(bibset, "z=\\\"", 
+    YAZ_CHECK(tst_ccl_query(bibset, "z=\\\"",
                             "\"\\\"\" "));
 
     YAZ_CHECK(tst_ccl_query(bibset, "reg=.",
@@ -338,9 +338,9 @@ void tst1(int pass)
     YAZ_CHECK(tst_ccl_query(bibset, "z=.",
                             ". "));
 
-    YAZ_CHECK(tst_ccl_query(bibset, "reg=\".\"", 
+    YAZ_CHECK(tst_ccl_query(bibset, "reg=\".\"",
                             "@attr 5=102 \\\\. "));
-    YAZ_CHECK(tst_ccl_query(bibset, "z=\".\"", 
+    YAZ_CHECK(tst_ccl_query(bibset, "z=\".\"",
                             ". "));
 
     YAZ_CHECK(tst_ccl_query(bibset, "reg=?\\?",
@@ -358,30 +358,30 @@ void tst1(int pass)
     YAZ_CHECK(tst_ccl_query(bibset, "z=\\\\",
                             "@attr 5=104 \\\\\\\\ "));
 
-    YAZ_CHECK(tst_ccl_query(bibset, "\\\\", 
+    YAZ_CHECK(tst_ccl_query(bibset, "\\\\",
                             "@attr 4=2 @attr 1=1016 \\\\ "));
 
-    YAZ_CHECK(tst_ccl_query(bibset, "comb=a", 
+    YAZ_CHECK(tst_ccl_query(bibset, "comb=a",
                             "@or @attr 4=2 @attr 1=1016 a "
                             "@attr 1=/my/title a "));
 
-    YAZ_CHECK(tst_ccl_query(bibset, "a? b?", 
+    YAZ_CHECK(tst_ccl_query(bibset, "a? b?",
                             "@and @attr 5=1 @attr 4=2 @attr 1=1016 a "
                             "@attr 5=1 @attr 4=2 @attr 1=1016 b "));
 
-    YAZ_CHECK(tst_ccl_query(bibset, "\"a\"? \"b?\"", 
+    YAZ_CHECK(tst_ccl_query(bibset, "\"a\"? \"b?\"",
                             "@and @attr 5=1 @attr 4=2 @attr 1=1016 a "
                             "@attr 4=2 @attr 1=1016 b? "));
 
     YAZ_CHECK(tst_ccl_query(bibset, "@and",
                             "@attr 4=2 @attr 1=1016 \\@and "));
-                            
+
     YAZ_CHECK(tst_ccl_query(bibset, "a@and",
                             "@attr 4=2 @attr 1=1016 a@and "));
-                           
+
     YAZ_CHECK(tst_ccl_query(bibset, "}",
                             "@attr 4=2 @attr 1=1016 } "));
-    
+
     YAZ_CHECK(tst_ccl_query(bibset, "{",
                             "@attr 4=2 @attr 1=1016 \"{\" "));
 
@@ -412,7 +412,7 @@ void tst1(int pass)
 
     YAZ_CHECK(tst_ccl_query(bibset, "ag=\"a b c\"",
                             "@attr 4=1 \"a b c\" "));
+
     YAZ_CHECK(tst_ccl_query(bibset, "ag=\"a b c\" \"d e\"",
                             "@and @attr 4=1 \"a b c\" @attr 4=1 \"d e\" "));
     ccl_qual_rm(&bibset);
index d3c8ac0..9ebc491 100644 (file)
@@ -18,12 +18,12 @@ static void tst_http_request(void)
 {
     {
         /* no content, no headers */
-        const char *http_buf = 
+        const char *http_buf =
             /*123456789012345678 */
             "GET / HTTP/1.1\r\n"
             "\r\n"
             "GET / HTTP/1.0\r\n";
-        
+
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 1), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 2), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 16), 0);
@@ -33,99 +33,99 @@ static void tst_http_request(void)
     }
     {
         /* one header, no content */
-        const char *http_buf = 
+        const char *http_buf =
             /*123456789012345678 */
             "GET / HTTP/1.1\r\n"
             "Content-Type: x\r\n"
             "\r\n"
             "GET / HTTP/1.0\r\n";
-        
+
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 1), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 2), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 34), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 35), 35);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 36), 35);
-    }        
+    }
     {
         /* one content-length header, length 0 */
-        const char *http_buf = 
+        const char *http_buf =
             /*123456789012345678 */
             "GET / HTTP/1.1\r\n"
             "Content-Length: 0\r\n"
             "\r\n"
             "GET / HTTP/1.0\r\n";
-        
+
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 1), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 2), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 35), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 37), 37);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 38), 37);
-    }        
+    }
     {
         /* one content-length header, length 5 */
-        const char *http_buf = 
+        const char *http_buf =
             /*123456789012345678 */
             "GET / HTTP/1.1\r\n"
             "Content-Length: 5\r\n"
             "\r\n"
             "ABCDE"
             "GET / HTTP/1.0\r\n";
-        
+
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 1), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 2), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 41), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 42), 42);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 43), 42);
-    }        
+    }
     {
         /* LF only in GET, one content-length header, length 5 */
-        const char *http_buf = 
+        const char *http_buf =
             /*123456789012345678 */
             "GET / HTTP/1.1\n"
             "Content-Length: 5\r\n"
             "\r\n"
             "ABCDE"
             "GET / HTTP/1.0\r\n";
-        
+
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 1), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 2), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 40), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 41), 41);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 42), 41);
-    }        
+    }
     {
         /* LF only in all places, one content-length header, length 5 */
-        const char *http_buf = 
+        const char *http_buf =
             /*123456789012345678 */
             "GET / HTTP/1.1\n"
             "Content-Length: 5\n"
             "\n"
             "ABCDE"
             "GET / HTTP/1.0\r\n";
-        
+
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 1), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 2), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 38), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 39), 39);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 40), 39);
-    }        
+    }
 
     {
         /* one header, unknown transfer-encoding (no content) */
-        const char *http_buf = 
+        const char *http_buf =
             /*12345678901234567890123456789 */
             "GET / HTTP/1.1\r\n"
             "Transfer-Encoding: chunke_\r\n"
             "\r\n"
             "GET / HTTP/1.0\r\n";
-        
+
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 45), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 46), 46);
-    }        
+    }
 
     {
         /* one header, one chunk */
-        const char *http_buf = 
+        const char *http_buf =
             /*12345678901234567890123456789 */
             "GET / HTTP/1.1\r\n"
             "Transfer-Encoding: chunked\r\n"
@@ -134,14 +134,14 @@ static void tst_http_request(void)
             "123\r\n"
             "0\r\n\r\n"
             "GET / HTTP/1.0\r\n";
-        
+
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 58), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 59), 59);
-    }        
+    }
 
     {
         /* one header, two chunks */
-        const char *http_buf = 
+        const char *http_buf =
             /*12345678901234567890123456789 */
             "GET / HTTP/1.1\r\n"
             "Transfer-Encoding: chunked\r\n"
@@ -152,36 +152,36 @@ static void tst_http_request(void)
             "12\n"
             "0\r\n\r\n"
             "GET / HTTP/1.0\r\n";
-        
+
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 64), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 65), 65);
-    }        
+    }
 }
 
 static void tst_http_response(void)
 {
     {
         /* unlimited content, no headers */
-        const char *http_buf = 
+        const char *http_buf =
             /*123456789012345678 */
             "HTTP/1.1 200 OK\r\n"
             "\r\n"
             "HTTP/1.1 200 OK\r\n";
-        
+
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 1), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 2), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 24), 0);
     }
     {
         /* response, content  */
-        const char *http_buf = 
+        const char *http_buf =
             /*123456789012345678 */
             "HTTP/1.1 200 OK\r\n"
             "Content-Length: 2\r\n"
             "\r\n"
             "12"
             "HTTP/1.1 200 OK\r\n";
-        
+
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 1), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 2), 0);
         YAZ_CHECK_EQ(cs_complete_auto(http_buf, 39), 0);
@@ -192,7 +192,7 @@ static void tst_http_response(void)
 
 /** \brief COMSTACK synopsis from manual, doc/comstack.xml */
 static int comstack_example(const char *server_address_str)
-{    
+{
     COMSTACK stack;
     char *buf = 0;
     int size = 0, length_incoming;
@@ -207,28 +207,28 @@ static int comstack_example(const char *server_address_str)
         perror("cs_create");  /* use perror() here since we have no stack yet */
         return -1;
     }
-    
+
     server_address_ip = cs_straddr(stack, server_address_str);
     if (!server_address_ip)
     {
         fprintf(stderr, "cs_straddr: address could not be resolved\n");
         return -1;
     }
-    
+
     status = cs_connect(stack, server_address_ip);
     if (status != 0) {
         fprintf(stderr, "cs_connect: %s\n", cs_strerror(stack));
         return -1;
     }
-    
+
     status = cs_put(stack, protocol_package, protocol_package_length);
     if (status) {
         fprintf(stderr, "cs_put: %s\n", cs_strerror(stack));
         return -1;
     }
-    
+
     /* Now get a response */
-    
+
     length_incoming = cs_get(stack, &buf, &size);
     if (!length_incoming) {
         fprintf(stderr, "Connection closed\n");
@@ -237,10 +237,10 @@ static int comstack_example(const char *server_address_str)
         fprintf(stderr, "cs_get: %s\n", cs_strerror(stack));
         return -1;
     }
-    
+
     /* Print result */
     fwrite(buf, length_incoming, 1, stdout);
-    
+
     /* clean up */
     cs_close(stack);
     if (buf)
index c050f7e..f31f29c 100644 (file)
@@ -18,7 +18,7 @@ static int tst_query_s(const char *cql, const char *expected_ccl,
     int ret = 1;
     CQL_parser cp = cql_parser_create();
     int r = cql_parser_string(cp, cql);
-    
+
     if (r)
     {
         yaz_log(YLOG_WARN, "cql: parse error: %s", cql);
@@ -52,7 +52,7 @@ static int tst_query_s(const char *cql, const char *expected_ccl,
                 yaz_log(YLOG_WARN, " got error");
         }
         wrbuf_rewind(w);
-        r = cql_sortby_to_sortkeys(cql_parser_result(cp), 
+        r = cql_sortby_to_sortkeys(cql_parser_result(cp),
                                    wrbuf_vp_puts, w);
         if (expected_keys && !r && !strcmp(wrbuf_cstr(w), expected_keys))
             ;
@@ -148,7 +148,7 @@ static void tst(void)
     YAZ_CHECK(tst_query("dc.title=encyclopedia prox/distance<=3 dinosaurs",
                         "(dc.title=\"encyclopedia\") %3 (\"dinosaurs\")"));
     YAZ_CHECK(tst_query("dc.title=encyclopedia prox/distance<=3/unit=word "
-                        "dinosaurs", 
+                        "dinosaurs",
                         "(dc.title=\"encyclopedia\") %3 (\"dinosaurs\")"));
     YAZ_CHECK(tst_query("dc.title=encyclopedia prox/distance<=3/unit=phrase "
                         "dinosaurs", 0));
index ebb8a6a..15eb845 100644 (file)
@@ -47,7 +47,7 @@ void test1(void)
 
 void test2(void)
 {
-  char base_enc[] = 
+  char base_enc[] =
     "MDA3NjZuYW0gIDIyMDAyNjU4YSA0NTAwMDAxMDAxMjAwMDAwMDAzMDAwNjAwMDEyMDA1MDAx"
     "NzAwMDE4MDA4MDA0MTAwMDM1MDEwMDAxNzAwMDc2MDIwMDAxNTAwMDkzMDM1MDAxODAwMTA4"
     "MDQwMDAxODAwMTI2MDQ5MDAwOTAwMTQ0MDUwMDAyNjAwMTUzMDgyMDAxNzAwMTc5MTAwMDAx"
@@ -64,7 +64,7 @@ void test2(void)
     "bmQgaW5kZXguHiAwH2FDT01NT04gTElTUCAoQ29tcHV0ZXIgcHJvZ3JhbSBsYW5ndWFnZSke"
     "H2xVQUhJTEweHQ==";
 
-    char bin_marc[] = 
+    char bin_marc[] =
       "00766nam  22002658a 4500001001200000003000600012005001700018008004100035010001700076020001500093035001800108040001800126049000900144050002600153082001700179100001800196245006700214260005200281263000900333300002700342500002700369504005100396650004400447999000900491\036ocm28339863\036OCoLC\03619940105074522.0\036930609s1994    cou      b    001 0 eng  \036  \037a   93009047 \036  \037a0130305529\036  \037a(ocm)28339863\036  \037aDLC\037cDLC\037dKKU\036  \037aKKUJ\03600\037aQA76.73.C28\037bG73 1994\03600\037a005.13/3\037220\0361 \037aGraham, Paul.\03610\037aOn Lisp :\037badvanced techniques for common Lisp /\037cPaul Graham.\036  \037aEnglewood Cliffs, N.J. :\037bPrentice Hall,\037c1994.\036  \037a9410\036  \037axiii, 413 p. ;\037c23 cm.\036  \037a\"An Alan R. Apt book.\"\036  \037aIncludes bibliographical references and index.\036 0\037aCOMMON LISP (Computer program language)\036\037lUAHILL\036\035";
 
     int marc_size = strlen(bin_marc);
@@ -142,7 +142,7 @@ int main(int argc, char **argv)
     YAZ_CHECK(test_render("xml", 0, "<my/>", "<my/>"));
 
     YAZ_CHECK(test_render(
-                  "xml", 1, 
+                  "xml", 1,
                   "\x30\x30\x31\x33\x38\x6E\x61\x6D\x20\x20\x32\x32\x30\x30\x30\x37"
                   "\x33\x38\x61\x20\x34\x35\x30\x30\x30\x30\x31\x30\x30\x31\x33\x30"
                   "\x30\x30\x30\x30\x30\x30\x33\x30\x30\x30\x34\x30\x30\x30\x31\x33"
index 6a07818..0a07691 100644 (file)
@@ -48,7 +48,7 @@ void tst(void)
     int ret;
     WRBUF tpath = wrbuf_alloc();
     const char *srcdir = getenv("srcdir");
-    
+
     if (srcdir)
     {
         wrbuf_puts(tpath, srcdir);
index 3c5d7fa..aacea86 100644 (file)
@@ -22,7 +22,7 @@ static int compare_buffers(char *msg, int no,
     if (expect_len == got_len
         && !memcmp(expect_buf, got_buf, expect_len))
         return 1;
-    
+
     if (0) /* use 1 see how the buffers differ (for debug purposes) */
     {
         int i;
@@ -32,21 +32,21 @@ static int compare_buffers(char *msg, int no,
         {
             char got_char[10];
             char expect_char[10];
-            
+
             if (i < got_len)
                 sprintf(got_char, "%02X", got_buf[i]);
             else
                 sprintf(got_char, "?  ");
-            
+
             if (i < expect_len)
                 sprintf(expect_char, "%02X", expect_buf[i]);
             else
                 sprintf(expect_char, "?  ");
-            
+
             printf("%02d  %s  %s %c\n",
                    i, got_char, expect_char, got_buf[i] == expect_buf[i] ?
                    ' ' : '*');
-            
+
         }
     }
     return 0;
@@ -124,7 +124,7 @@ static int tst_convert_x(yaz_iconv_t cd, const char *buf, const char *cmpbuf,
             break;
         }
     }
-    if (wrbuf_len(b) == strlen(cmpbuf) 
+    if (wrbuf_len(b) == strlen(cmpbuf)
         && !memcmp(cmpbuf, wrbuf_buf(b), wrbuf_len(b)))
         ;
     else
@@ -139,7 +139,7 @@ static int tst_convert_x(yaz_iconv_t cd, const char *buf, const char *cmpbuf,
         wrbuf_rewind(w);
         wrbuf_write_escaped(w, wrbuf_buf(b), wrbuf_len(b));
         yaz_log(YLOG_LOG, "got %s", wrbuf_cstr(w));
-        
+
         wrbuf_rewind(w);
         wrbuf_puts_escaped(w, cmpbuf);
         yaz_log(YLOG_LOG, "exp %s", wrbuf_cstr(w));
@@ -172,12 +172,12 @@ static void tst_marc8_to_ucs4b(void)
     YAZ_CHECK(cd);
     if (!cd)
         return;
-    
+
     YAZ_CHECK(tst_convert_l(
                   cd,
                   0,
                   "\033$1" "\x21\x2B\x3B" /* FF1F */ "\033(B" "o",
-                  8, 
+                  8,
                   "\x00\x00\xFF\x1F" "\x00\x00\x00o"));
     YAZ_CHECK(tst_convert_l(
                   cd,
@@ -197,7 +197,7 @@ static void tst_marc8_to_ucs4b(void)
                   "\x21\x33\x53"  /* UCS 5206 */
                   "\x21\x44\x2B"  /* UCS 6790 */
                   "\033(B",
-                  24, 
+                  24,
                   "\x00\x00\x7C\xFB"
                   "\x00\x00\x7D\x71"
                   "\x00\x00\x5B\x89"
@@ -209,13 +209,13 @@ static void tst_marc8_to_ucs4b(void)
                   cd,
                   0,
                   "\xB0\xB2",     /* AYN and oSLASH */
-                  8, 
+                  8,
                   "\x00\x00\x02\xBB"  "\x00\x00\x00\xF8"));
     YAZ_CHECK(tst_convert_l(
                   cd,
                   0,
                   "\xF6\x61",     /* a underscore */
-                  8, 
+                  8,
                   "\x00\x00\x00\x61"  "\x00\x00\x03\x32"));
 
     YAZ_CHECK(tst_convert_l(
@@ -244,7 +244,7 @@ static void tst_marc8_to_ucs4b(void)
                   cd,
                   0,
                   "\xe5\xe8\x41",
-                  12, 
+                  12,
                   "\x00\x00\x00\x41" "\x00\x00\x03\x04" "\x00\x00\x03\x08"));
     /* bug #416 */
     YAZ_CHECK(tst_convert_l(
@@ -258,7 +258,7 @@ static void tst_marc8_to_ucs4b(void)
                   cd,
                   0,
                   "\xFA\x74\xFB\x73",
-                  12, 
+                  12,
                   "\x00\x00\x00\x74" "\x00\x00\x03\x60" "\x00\x00\x00\x73"));
 
     yaz_iconv_close(cd);
@@ -279,7 +279,7 @@ static void tst_ucs4b_to_utf8(void)
 
     YAZ_CHECK(tst_convert_l(
                   cd,
-                  8, 
+                  8,
                   "\x00\x00\xAE\x0E\x00\x00\xC0\xF4",
                   6,
                   "\xEA\xB8\x8E\xEC\x83\xB4"));
@@ -313,7 +313,7 @@ static void dconvert(int mandatory, const char *tmpcode)
         yaz_iconv_close(cd);
         if (r == (size_t) (-1))
             return;
-        
+
         cd = yaz_iconv_open("ISO-8859-1", tmpcode);
         YAZ_CHECK(cd || !mandatory);
         if (!cd)
@@ -333,7 +333,7 @@ static void dconvert(int mandatory, const char *tmpcode)
         }
         YAZ_CHECK(r != (size_t) (-1));
 
-        if (r != (size_t)(-1)) 
+        if (r != (size_t)(-1))
         {
             ret = compare_buffers("dconvert", i,
                                   strlen(iso_8859_1_a[i]), iso_8859_1_a[i],
@@ -362,7 +362,7 @@ int utf8_check(unsigned c)
             return 0;
         for (i = 0; i<4; i++)
             src[i] = c >> (i*8);
-        
+
         r = yaz_iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
         yaz_iconv_close(cd);
 
@@ -389,7 +389,7 @@ int utf8_check(unsigned c)
     }
     return 1;
 }
-        
+
 static void tst_marc8_to_utf8(void)
 {
     yaz_iconv_t cd = yaz_iconv_open("UTF-8", "MARC8");
@@ -398,10 +398,10 @@ static void tst_marc8_to_utf8(void)
     if (!cd)
         return;
 
-    YAZ_CHECK(tst_convert(cd, "Cours de math", 
+    YAZ_CHECK(tst_convert(cd, "Cours de math",
                           "Cours de math"));
     /* COMBINING ACUTE ACCENT */
-    YAZ_CHECK(tst_convert(cd, "Cours de mathâe", 
+    YAZ_CHECK(tst_convert(cd, "Cours de mathâe",
                           "Cours de mathe\xcc\x81"));
 
     YAZ_CHECK(tst_convert(cd, "\xea" "a", "a\xcc\x8a"));
@@ -433,10 +433,10 @@ static void tst_marc8s_to_utf8(void)
     if (!cd)
         return;
 
-    YAZ_CHECK(tst_convert(cd, "Cours de math", 
+    YAZ_CHECK(tst_convert(cd, "Cours de math",
                           "Cours de math"));
     /* E9: LATIN SMALL LETTER E WITH ACUTE */
-    YAZ_CHECK(tst_convert(cd, "Cours de mathâe", 
+    YAZ_CHECK(tst_convert(cd, "Cours de mathâe",
                           "Cours de math\xc3\xa9"));
 
     yaz_iconv_close(cd);
@@ -465,21 +465,21 @@ static void tst_marc8_to_latin1(void)
 
     YAZ_CHECK(tst_convert(cd, "\xea" "a"  "\xea" "a", "\xe5" "\xe5"));
 
-    YAZ_CHECK(tst_convert(cd, "Cours de math", 
+    YAZ_CHECK(tst_convert(cd, "Cours de math",
                           "Cours de math"));
-    YAZ_CHECK(tst_convert(cd, "Cours de mathâe", 
+    YAZ_CHECK(tst_convert(cd, "Cours de mathâe",
                           "Cours de mathé"));
-    YAZ_CHECK(tst_convert(cd, "12345678âe", 
+    YAZ_CHECK(tst_convert(cd, "12345678âe",
                           "12345678é"));
-    YAZ_CHECK(tst_convert(cd, "123456789âe", 
+    YAZ_CHECK(tst_convert(cd, "123456789âe",
                           "123456789é"));
-    YAZ_CHECK(tst_convert(cd, "1234567890âe", 
+    YAZ_CHECK(tst_convert(cd, "1234567890âe",
                           "1234567890é"));
-    YAZ_CHECK(tst_convert(cd, "12345678901âe", 
+    YAZ_CHECK(tst_convert(cd, "12345678901âe",
                           "12345678901é"));
-    YAZ_CHECK(tst_convert(cd, "Cours de mathâem", 
+    YAZ_CHECK(tst_convert(cd, "Cours de mathâem",
                           "Cours de mathém"));
-    YAZ_CHECK(tst_convert(cd, "Cours de mathâematiques", 
+    YAZ_CHECK(tst_convert(cd, "Cours de mathâematiques",
                           "Cours de mathématiques"));
 
     yaz_iconv_close(cd);
@@ -513,7 +513,7 @@ static void tst_utf8_to_marc8(const char *marc8_type)
     /** A MACRON + UMLAUT, DIAERESIS */
     YAZ_CHECK(tst_convert(cd, "A" "\xCC\x84" "\xCC\x88",
                           "\xE5\xE8\x41"));
-    
+
     /* Ligature spanning two characters */
     YAZ_CHECK(tst_convert(cd,
                           "\x74" "\xCD\xA1" "\x73",  /* UTF-8 */
@@ -539,21 +539,21 @@ static void tst_utf8_to_marc8(const char *marc8_type)
     YAZ_CHECK(tst_convert(cd,
                           "(\xe2\x81\xb0)",        /* UTF-8 */
                           "(\033p0\x1bs)"));
-    
-    
+
+
     /** bug #1778 */
     YAZ_CHECK(tst_convert(cd,
                           /* offset 0x530 in UTF-8 rec marccol4.u8.marc */
-                          "\xE3\x83\xB3" "\xE3\x82\xBF" 
+                          "\xE3\x83\xB3" "\xE3\x82\xBF"
                           "\xCC\x84" "\xCC\x84" "\xE3\x83\xBC" /* UTF-8 */,
                           "\x1B\x24\x31" "\x69\x25\x73"
-                          "\x1B\x28\x42" "\xE5\xE5" "\x1B\x24\x31" 
+                          "\x1B\x28\x42" "\xE5\xE5" "\x1B\x24\x31"
                           "\x69\x25\x3F"
                           "\x69\x21\x3C" "\x1B\x28\x42"));
 
-    
+
     /** bug #2120 */
-    YAZ_CHECK(tst_convert(cd, 
+    YAZ_CHECK(tst_convert(cd,
                           "\xCE\x94\xCE\xB5\xCF\x84"
                           "\xCE\xBF\xCF\x81\xCE\xB1"
                           "\xCE\xBA\xCE\xB7\xCF\x82\x2C",
@@ -562,7 +562,7 @@ static void tst_utf8_to_marc8(const char *marc8_type)
                           "\x61\x6D\x6A\x77"
                           "\x1B\x28\x42\x2C"
                   ));
+
     {
         char *inbuf0 = "\xe2\x81\xb0";
         char *inbuf = inbuf0;
@@ -695,7 +695,7 @@ static void tst_danmarc_to_latin1(void)
 
     YAZ_CHECK(tst_convert(cd, "@\xe5", "aa"));
     YAZ_CHECK(tst_convert(cd, "@\xc5.", "Aa."));
-    
+
     yaz_iconv_close(cd);
 }
 
index abb7462..de31121 100644 (file)
@@ -4,7 +4,7 @@
  */
 
 /* DO NOT EDIT THIS FILE IF YOUR EDITOR DOES NOT SUPPORT UTF-8 */
+
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -44,8 +44,8 @@ static int icu_termmap_cmp(const void *vp1, const void *vp2)
     struct icu_termmap *itmp2 = *(struct icu_termmap **) vp2;
 
     int cmp = 0;
-    
-    cmp = strcmp((const char *)itmp1->sort_key, 
+
+    cmp = strcmp((const char *)itmp1->sort_key,
                  (const char *)itmp2->sort_key);
     return cmp;
 }
@@ -71,12 +71,12 @@ static int test_icu_casemap(const char * locale, char action,
 
     /* perform case mapping */
     icu_utf16_casemap(dest16, src16, locale, action, &status);
-  
+
     /* converting to UTF8 */
     icu_utf16_to_utf8(dest8, dest16, &status);
 
     /* determine success */
-    if (dest8->utf8 
+    if (dest8->utf8
         && (dest8->utf8_len == strlen(chk8cstr))
         && !strcmp(chk8cstr, (const char *) dest8->utf8))
         success = 1;
@@ -89,18 +89,18 @@ static int test_icu_casemap(const char * locale, char action,
         yaz_log(YLOG_WARN, "test_icu_casemap failed");
         yaz_log(YLOG_LOG, "Original string:   '%s' (%d)",
                 src8cstr, src8cstr_len);
-        yaz_log(YLOG_LOG, "icu_casemap '%s:%c' '%s' (%d)", 
+        yaz_log(YLOG_LOG, "icu_casemap '%s:%c' '%s' (%d)",
                 locale, action, dest8->utf8, dest8->utf8_len);
         yaz_log(YLOG_LOG, "expected string:   '%s' (%d)",
                 chk8cstr, chk8cstr_len);
     }
-  
+
     /* clean the buffers */
     icu_buf_utf8_destroy(src8);
     icu_buf_utf8_destroy(dest8);
     icu_buf_utf16_destroy(src16);
     icu_buf_utf16_destroy(dest16);
-    
+
     return success;
 }
 
@@ -110,38 +110,38 @@ static void check_icu_casemap(void)
 
     /* successful tests */
     YAZ_CHECK(test_icu_casemap("en", 'l',
-                               "A ReD fOx hunTS sQUirriLs", 
+                               "A ReD fOx hunTS sQUirriLs",
                                "a red fox hunts squirrils"));
-    
+
     YAZ_CHECK(test_icu_casemap("en", 'u',
-                               "A ReD fOx hunTS sQUirriLs", 
+                               "A ReD fOx hunTS sQUirriLs",
                                "A RED FOX HUNTS SQUIRRILS"));
-    
+
     YAZ_CHECK(test_icu_casemap("en", 'f',
-                               "A ReD fOx hunTS sQUirriLs", 
+                               "A ReD fOx hunTS sQUirriLs",
                                "a red fox hunts squirrils"));
-    
+
     YAZ_CHECK(test_icu_casemap("en", 't',
-                               "A ReD fOx hunTS sQUirriLs", 
+                               "A ReD fOx hunTS sQUirriLs",
                                "A Red Fox Hunts Squirrils"));
-    
+
     /* Locale 'da' */
 
     /* success expected */
     YAZ_CHECK(test_icu_casemap("da", 'l',
-                               "Ã¥h Ã†bLE, Ã¸s fLØde i Ã…en efter bLÃ¥BærGRødeN", 
+                               "Ã¥h Ã†bLE, Ã¸s fLØde i Ã…en efter bLÃ¥BærGRødeN",
                                "Ã¥h Ã¦ble, Ã¸s fløde i Ã¥en efter blÃ¥bærgrøden"));
 
     YAZ_CHECK(test_icu_casemap("da", 'u',
-                               "Ã¥h Ã†bLE, Ã¸s fLØde i Ã…en efter bLÃ¥BærGRødeN", 
+                               "Ã¥h Ã†bLE, Ã¸s fLØde i Ã…en efter bLÃ¥BærGRødeN",
                                "Ã…H Ã†BLE, Ã˜S FLØDE I Ã…EN EFTER BLÃ…BÆRGRØDEN"));
 
     YAZ_CHECK(test_icu_casemap("da", 'f',
-                               "Ã¥h Ã†bLE, Ã¸s fLØde i Ã…en efter bLÃ¥BærGRødeN", 
+                               "Ã¥h Ã†bLE, Ã¸s fLØde i Ã…en efter bLÃ¥BærGRødeN",
                                "Ã¥h Ã¦ble, Ã¸s fløde i Ã¥en efter blÃ¥bærgrøden"));
 
     YAZ_CHECK(test_icu_casemap("da", 't',
-                               "Ã¥h Ã†bLE, Ã¸s fLØde i Ã…en efter bLÃ¥BærGRødeN", 
+                               "Ã¥h Ã†bLE, Ã¸s fLØde i Ã…en efter bLÃ¥BærGRødeN",
                                "Ã…h Ã†ble, Ã˜s Fløde I Ã…en Efter BlÃ¥bærgrøden"));
 
     /* Locale 'de' */
@@ -179,20 +179,20 @@ static int test_icu_sortmap(const char * locale, int src_list_len,
 
     struct icu_termmap * list[src_list_len];
 
-    UCollator *coll = ucol_open(locale, &status); 
+    UCollator *coll = ucol_open(locale, &status);
     icu_check_status(status);
 
     if (U_FAILURE(status))
         return 0;
 
     /* assigning display terms and sort keys using buf 8 and buf16 */
-    for (i = 0; i < src_list_len; i++) 
+    for (i = 0; i < src_list_len; i++)
     {
 
         list[i] = (struct icu_termmap *) malloc(sizeof(struct icu_termmap));
 
         /* copy display term */
-        strcpy(list[i]->disp_term, src_list[i]);    
+        strcpy(list[i]->disp_term, src_list[i]);
 
         /* transforming to UTF16 */
         icu_utf16_from_utf8_cstr(buf16, list[i]->disp_term, &status);
@@ -201,10 +201,10 @@ static int test_icu_sortmap(const char * locale, int src_list_len,
         /* computing sortkeys */
         icu_sortkey8_from_utf16(coll, buf8, buf16, &status);
         icu_check_status(status);
-    
+
         /* assigning sortkeys */
-        memcpy(list[i]->sort_key, buf8->utf8, buf8->utf8_len);    
-    } 
+        memcpy(list[i]->sort_key, buf8->utf8, buf8->utf8_len);
+    }
 
     /* do the sorting */
     qsort(list, src_list_len, sizeof(struct icu_termmap *), icu_termmap_cmp);
@@ -219,30 +219,30 @@ static int test_icu_sortmap(const char * locale, int src_list_len,
 
     if (!success)
     {
-        yaz_log(YLOG_LOG, "ERROR"); 
-        yaz_log(YLOG_LOG, "Input str:'%s':", locale); 
+        yaz_log(YLOG_LOG, "ERROR");
+        yaz_log(YLOG_LOG, "Input str:'%s':", locale);
         for (i = 0; i < src_list_len; i++) {
-            yaz_log(YLOG_LOG, "  '%s'", list[i]->disp_term); 
+            yaz_log(YLOG_LOG, "  '%s'", list[i]->disp_term);
         }
-        yaz_log(YLOG_LOG, "ICU sort: '%s':", locale); 
+        yaz_log(YLOG_LOG, "ICU sort: '%s':", locale);
         for (i = 0; i < src_list_len; i++) {
-            yaz_log(YLOG_LOG, " '%s'", list[i]->disp_term); 
+            yaz_log(YLOG_LOG, " '%s'", list[i]->disp_term);
         }
-        yaz_log(YLOG_LOG, "Expected: '%s':", locale); 
+        yaz_log(YLOG_LOG, "Expected: '%s':", locale);
         for (i = 0; i < src_list_len; i++) {
-            yaz_log(YLOG_LOG, " '%s'", chk_list[i]); 
+            yaz_log(YLOG_LOG, " '%s'", chk_list[i]);
         }
     }
-  
+
     for (i = 0; i < src_list_len; i++)
         free(list[i]);
-   
+
     ucol_close(coll);
 
     icu_buf_utf8_destroy(buf8);
     icu_buf_utf16_destroy(buf16);
 
-    return success;  
+    return success;
 }
 
 static void check_icu_sortmap(void)
@@ -256,7 +256,7 @@ static void check_icu_sortmap(void)
     YAZ_CHECK(test_icu_sortmap("en_CA", en_1_len, en_1_src, en_1_cck));
     YAZ_CHECK(test_icu_sortmap("en_GB", en_1_len, en_1_src, en_1_cck));
     YAZ_CHECK(test_icu_sortmap("en_US", en_1_len, en_1_src, en_1_cck));
-    
+
     /* successful tests */
     {
         size_t da_1_len = 6;
@@ -281,7 +281,7 @@ static int test_icu_normalizer(const char * rules8cstr,
                                const char * chk8cstr)
 {
     int success = 0;
-    
+
     UErrorCode status = U_ZERO_ERROR;
 
     struct icu_buf_utf16 * src16 = icu_buf_utf16_create(0);
@@ -290,7 +290,7 @@ static int test_icu_normalizer(const char * rules8cstr,
     struct icu_transform * transform
         = icu_transform_create(rules8cstr, 'f', 0, &status);
     icu_check_status(status);
-    
+
     icu_utf16_from_utf8_cstr(src16, src8cstr, &status);
     icu_check_status(status);
 
@@ -301,7 +301,7 @@ static int test_icu_normalizer(const char * rules8cstr,
     icu_check_status(status);
 
 
-    if (!strcmp((const char *) dest8->utf8, 
+    if (!strcmp((const char *) dest8->utf8,
                (const char *) chk8cstr))
         success = 1;
     else
@@ -327,7 +327,7 @@ static void check_icu_normalizer(void)
     YAZ_CHECK(test_icu_normalizer("[:Punctuation:] Any-Remove",
                                   "Don't shoot!",
                                   "Dont shoot"));
-    
+
     YAZ_CHECK(test_icu_normalizer("[:Control:] Any-Remove",
                                   "Don't\n shoot!",
                                   "Don't shoot!"));
@@ -339,7 +339,7 @@ static void check_icu_normalizer(void)
     YAZ_CHECK(test_icu_normalizer("Lower; [:^Letter:] Remove",
                                   "Don't shoot!",
                                   "dontshoot"));
-    
+
     YAZ_CHECK(test_icu_normalizer("[:^Number:] Remove",
                                   "Monday 15th of April",
                                   "15"));
@@ -375,7 +375,7 @@ static int test_icu_tokenizer(const char * locale, char action,
     YAZ_CHECK(tokenizer);
 
     /* attach text buffer to tokenizer */
-    icu_tokenizer_attach(tokenizer, src16, &status);    
+    icu_tokenizer_attach(tokenizer, src16, &status);
     icu_check_status(status);
 
     /* perform work on tokens */
@@ -400,25 +400,25 @@ static int test_icu_tokenizer(const char * locale, char action,
     icu_buf_utf16_destroy(src16);
     icu_buf_utf16_destroy(tkn16);
     icu_buf_utf8_destroy(tkn8);
-        
+
     return success;
 }
 
 static void check_icu_tokenizer(void)
 {
-    const char * en_str 
+    const char * en_str
         = "O Romeo, Romeo! wherefore art thou Romeo?";
-    
+
     YAZ_CHECK(test_icu_tokenizer("en", 's', en_str, 2));
     YAZ_CHECK(test_icu_tokenizer("en", 'l', en_str, 7));
     YAZ_CHECK(test_icu_tokenizer("en", 'w', en_str, 16));
     YAZ_CHECK(test_icu_tokenizer("en", 'c', en_str, 41));
 
     {
-        const char * da_str 
+        const char * da_str
             = "BlÃ¥bærtærte. Denne kage stammer fra Finland. "
             "Den er med blÃ¥bær, men alle sommerens forskellige bær kan bruges.";
-        
+
         YAZ_CHECK(test_icu_tokenizer("da", 's', da_str, 3));
         YAZ_CHECK(test_icu_tokenizer("dar", 'l', da_str, 17));
         YAZ_CHECK(test_icu_tokenizer("da", 'w', da_str, 37));
@@ -428,12 +428,12 @@ static void check_icu_tokenizer(void)
 
 static void check_icu_chain(void)
 {
-    const char * en_str 
+    const char * en_str
         = "O Romeo, Romeo! wherefore art thou\t Romeo?";
 
     UErrorCode status = U_ZERO_ERROR;
     struct icu_chain * chain = 0;
-    
+
     const char * xml_str = "<icu locale=\"en\">"
         "<transform rule=\"[:Control:] Any-Remove\"/>"
         "<tokenize rule=\"l\"/>"
@@ -442,7 +442,7 @@ static void check_icu_chain(void)
         "<casemap rule=\"l\"/>"
         "</icu>";
 
-    
+
     xmlDoc *doc = xmlParseMemory(xml_str, strlen(xml_str));
     xmlNode *xml_node = xmlDocGetRootElement(doc);
     YAZ_CHECK(xml_node);
@@ -488,7 +488,7 @@ static void check_bug_1140(void)
 {
     UErrorCode status = U_ZERO_ERROR;
     struct icu_chain * chain = 0;
-    
+
     const char * xml_str = "<icu locale=\"en\">"
 
         /* if the first rule is normalize instead. Then it works */
@@ -501,7 +501,7 @@ static void check_bug_1140(void)
         "<casemap rule=\"l\"/>"
         "</icu>";
 
-    
+
     xmlDoc *doc = xmlParseMemory(xml_str, strlen(xml_str));
     xmlNode *xml_node = xmlDocGetRootElement(doc);
     YAZ_CHECK(xml_node);
@@ -512,7 +512,7 @@ static void check_bug_1140(void)
     YAZ_CHECK(chain);
     if (!chain)
         return;
-    
+
     YAZ_CHECK(icu_chain_assign_cstr(
                   chain,  "O Romeo, Romeo! wherefore art thou\t Romeo?",
                   &status));
@@ -525,7 +525,7 @@ static void check_bug_1140(void)
            icu_chain_token_norm(chain),
            icu_chain_token_display(chain)); */
     }
-    
+
 
     YAZ_CHECK_EQ(icu_chain_token_number(chain), 7);
 
@@ -556,7 +556,7 @@ static void check_chain_empty_token(void)
         "<tokenize rule=\"w\"/>"
         "<transform rule=\"[[:WhiteSpace:][:Punctuation:]] Remove\"/>"
         "</icu>";
-    
+
     xmlDoc *doc = xmlParseMemory(xml_str, strlen(xml_str));
     xmlNode *xml_node = xmlDocGetRootElement(doc);
     YAZ_CHECK(xml_node);
@@ -565,7 +565,7 @@ static void check_chain_empty_token(void)
 
     xmlFreeDoc(doc);
     YAZ_CHECK(chain);
-    
+
     YAZ_CHECK(icu_chain_assign_cstr(
                   chain,  "a string with 15 tokenss and 8 displays",
                   &status));
@@ -591,7 +591,7 @@ static void check_chain_empty_chain(void)
 
     const char * xml_str = "<icu locale=\"en\">"
         "</icu>";
-    
+
     const char * src8 = "some 5487 weired !¤%&(/& sTuFf";
     char * dest8 = 0;
 
@@ -603,7 +603,7 @@ static void check_chain_empty_chain(void)
 
     xmlFreeDoc(doc);
     YAZ_CHECK(chain);
-    
+
     YAZ_CHECK(icu_chain_assign_cstr(
                   chain,  src8,
                   &status));
@@ -621,7 +621,7 @@ static void check_chain_empty_chain(void)
 
     dest8 = (char *) icu_chain_token_norm(chain);
     YAZ_CHECK_EQ(strcmp(src8, dest8), 0);
-    
+
     icu_chain_destroy(chain);
 }
 
@@ -636,7 +636,7 @@ static void check_icu_iter1(void)
         "<tokenize rule=\"w\"/>"
         "<transform rule=\"[[:WhiteSpace:][:Punctuation:]] Remove\"/>"
         "</icu>";
-    
+
     xmlDoc *doc = xmlParseMemory(xml_str, strlen(xml_str));
     YAZ_CHECK(doc);
     if (!doc)
@@ -650,7 +650,7 @@ static void check_icu_iter1(void)
 
     xmlFreeDoc(doc);
     YAZ_CHECK(chain);
-    
+
     iter = icu_iter_create(chain);
     icu_iter_first(iter, "a string with 15 tokens and 8 displays");
     YAZ_CHECK(iter);
@@ -739,7 +739,7 @@ static void *iter_thread(void *p)
 {
     struct icu_chain *chain = (struct icu_chain *) p;
     int i;
-    
+
     for (i = 0; i < 1000; i++)
     {
         YAZ_CHECK(test_iter(chain, "Adobe Acrobat Reader, 1991-1999.",
@@ -794,7 +794,7 @@ static void check_icu_iter2(void)
     YAZ_CHECK(chain);
     if (!chain)
         return;
-    
+
     YAZ_CHECK(test_iter(chain, "Adobe Acrobat Reader, 1991-1999.",
                         "[adobe][acrobat][reader][1991][][1999][]"));
 
@@ -812,7 +812,7 @@ static void check_icu_iter3(void)
     struct icu_chain * chain = 0;
     xmlNode *xml_node;
 
-    const char * xml_str = 
+    const char * xml_str =
         "<icu_chain id=\"sort\" locale=\"el\">\n"
         "<transform rule=\"[:Control:] Any-Remove\"/>\n"
         "<transform rule=\"[[:Control:][:WhiteSpace:][:Punctuation:]] Remove\"/>\n"
@@ -836,7 +836,7 @@ static void check_icu_iter3(void)
     YAZ_CHECK(chain);
     if (!chain)
         return;
-    
+
     YAZ_CHECK(test_iter(chain, "Adobe Acrobat Reader, 1991-1999.",
                         "[adobeacrobatreader19911999]"));
 
@@ -850,7 +850,7 @@ static void check_icu_iter3(void)
 
 int main(int argc, char **argv)
 {
-    YAZ_CHECK_INIT(argc, argv); 
+    YAZ_CHECK_INIT(argc, argv);
     YAZ_CHECK_LOG();
 
 #if YAZ_HAVE_ICU
@@ -862,10 +862,10 @@ int main(int argc, char **argv)
     check_icu_chain();
     check_chain_empty_token();
     check_chain_empty_chain();
-    check_icu_iter1();  
+    check_icu_iter1();
     check_icu_iter2();
     check_icu_iter3();
-  
+
     check_bug_1140();
 
     u_cleanup();
@@ -875,7 +875,7 @@ int main(int argc, char **argv)
     YAZ_CHECK(0 == 0);
 
 #endif /* YAZ_HAVE_ICU */
-   
+
     YAZ_CHECK_TERM;
 }
 
index 6b41046..4a3c0a6 100644 (file)
@@ -3,7 +3,7 @@
  * See the file LICENSE for details.
  */
 /**
- * \file 
+ * \file
  * \brief JSON test
  */
 #if HAVE_CONFIG_H
@@ -15,7 +15,7 @@
 #include <string.h>
 #include <yaz/log.h>
 
-static int expect(json_parser_t p, const char *input, 
+static int expect(json_parser_t p, const char *input,
                   const char *output)
 {
     int ret = 0;
@@ -84,7 +84,7 @@ static void tst1(void)
     YAZ_CHECK(expect(p, "{}  extra", 0));
 
     YAZ_CHECK(expect(p, "{\"a\":[1,2,3}", 0));
-    
+
     YAZ_CHECK(expect(p, "{\"a\":[1,2,", 0));
 
     YAZ_CHECK(expect(p, "{\"k\":\"wa\"}", "{\"k\":\"wa\"}"));
@@ -150,7 +150,7 @@ static void tst2(void)
         return;
 
     YAZ_CHECK_EQ(json_count_children(n), 3);
-    
+
     n1 = json_get_object(n, "a");
     YAZ_CHECK(n1 && n1->type == json_node_number && n1->u.number == 1.0);
     YAZ_CHECK_EQ(json_count_children(n1), 0);
index 0d18c7b..839429d 100644 (file)
 #if YAZ_HAVE_ICU
 #include <yaz/stemmer.h>
 
-int test_stemmer_stem(yaz_stemmer_p stemmer, const char* to_stem, const char *expected) 
+int test_stemmer_stem(yaz_stemmer_p stemmer, const char* to_stem, const char *expected)
 {
     struct icu_buf_utf16 *src  = icu_buf_utf16_create(0);
     struct icu_buf_utf16 *dst  = icu_buf_utf16_create(0);
     struct icu_buf_utf8  *dst8 = icu_buf_utf8_create(0);
     int rc = 0;
-    UErrorCode status; 
+    UErrorCode status;
     const char *result;
 
     icu_utf16_from_utf8_cstr(src, to_stem, &status);
-    yaz_stemmer_stem(stemmer, dst, src, &status); 
+    yaz_stemmer_stem(stemmer, dst, src, &status);
     if (status == U_ZERO_ERROR) {
         icu_utf16_to_utf8(dst8, dst, &status);
         result = icu_buf_utf8_to_cstr(dst8);
@@ -41,23 +41,23 @@ int test_stemmer_stem(yaz_stemmer_p stemmer, const char* to_stem, const char *ex
 static void tst(void)
 {
     UErrorCode status;
-    //== U_ZERO_ERROR; 
+    //== U_ZERO_ERROR;
     yaz_stemmer_p stemmer = yaz_stemmer_create("en", "porter", &status);
-    YAZ_CHECK(stemmer); 
+    YAZ_CHECK(stemmer);
 
     /* fail  */
-    YAZ_CHECK(test_stemmer_stem(stemmer, "beer", "water") == 0 ); 
+    YAZ_CHECK(test_stemmer_stem(stemmer, "beer", "water") == 0 );
 
     /* Same */
-    YAZ_CHECK(test_stemmer_stem(stemmer, "adadwwr", "adadwwr")); 
+    YAZ_CHECK(test_stemmer_stem(stemmer, "adadwwr", "adadwwr"));
 
     /* Remove S */
-    YAZ_CHECK(test_stemmer_stem(stemmer, "beers", "beer")); 
-    YAZ_CHECK(test_stemmer_stem(stemmer, "persons", "person")); 
+    YAZ_CHECK(test_stemmer_stem(stemmer, "beers", "beer"));
+    YAZ_CHECK(test_stemmer_stem(stemmer, "persons", "person"));
 
     /* Remove s and ing  */
-    YAZ_CHECK(test_stemmer_stem(stemmer, "runs", "run")); 
-    YAZ_CHECK(test_stemmer_stem(stemmer, "running", "run")); 
+    YAZ_CHECK(test_stemmer_stem(stemmer, "runs", "run"));
+    YAZ_CHECK(test_stemmer_stem(stemmer, "running", "run"));
 
     yaz_stemmer_destroy(stemmer);
 }
index 5e77136..569aad0 100644 (file)
@@ -53,7 +53,7 @@ int main(int argc, char **argv)
         case 'n':
             number = atoi(arg);
             break;
-        case 'm':        
+        case 'm':
             level = yaz_log_module_level(arg);
             break;
         case 'w':
index 7384cf2..7f78b74 100644 (file)
@@ -34,12 +34,12 @@ static void *t_loop2(void *vp)
 static void t_test(void)
 {
     pthread_t tids[4];
-    
+
     pthread_create(tids+0, 0, t_loop2, 0);
     pthread_create(tids+1, 0, t_loop2, 0);
     pthread_create(tids+2, 0, t_loop2, 0);
     pthread_create(tids+3, 0, t_loop2, 0);
-    
+
     pthread_join(tids[0], 0);
     pthread_join(tids[1], 0);
     pthread_join(tids[2], 0);
index 3664a36..e4ab870 100644 (file)
@@ -61,9 +61,9 @@ static void tst_cond(void)
     {
         r = yaz_gettimeofday(&abstime);
         YAZ_CHECK_EQ(r, 0);
-        
+
         abstime.tv_sec += 1; /* wait 1 second */
-        
+
         r = yaz_cond_wait(c, p, &abstime);
         YAZ_CHECK(r != 0);
 
@@ -91,7 +91,7 @@ static void tst_create_thread(void)
     YAZ_CHECK(t[0]);
     t[1] = yaz_thread_create(my_handler, &mydata);
     YAZ_CHECK(t[1]);
-    
+
     return_data = 0;
     yaz_thread_join(&t[0], &return_data);
     YAZ_CHECK(!t[0]);
@@ -101,7 +101,7 @@ static void tst_create_thread(void)
     yaz_thread_join(&t[1], &return_data);
     YAZ_CHECK(!t[1]);
     YAZ_CHECK(return_data == &mydata);
-    
+
     YAZ_CHECK_EQ(mydata, 44);
 }
 
index a9d1363..ac6910c 100644 (file)
@@ -36,7 +36,7 @@ void tst_nmem_malloc(void)
         if ((int) sizeof(double) >= j)
             *(double*) cp = 12.2;
     }
-    
+
     for (j = 2000; j<20000; j+= 2000)
     {
         cp = (char *) nmem_malloc(n, j);
@@ -57,7 +57,7 @@ void tst_nmem_strsplit(void)
     nmem_strsplitx(nmem, ",", "", &array, &num, 0);
     YAZ_CHECK(num == 1);
     YAZ_CHECK(num > 0 && !strcmp(array[0], ""));
-    
+
     nmem_strsplit(nmem, ",", ",,", &array, &num);
     YAZ_CHECK(num == 0);
 
@@ -66,7 +66,7 @@ void tst_nmem_strsplit(void)
     YAZ_CHECK(num > 0 && !strcmp(array[0], ""));
     YAZ_CHECK(num > 1 && !strcmp(array[1], ""));
     YAZ_CHECK(num > 2 && !strcmp(array[2], ""));
+
     nmem_strsplit(nmem, ",", ",a,b,,cd", &array, &num);
     YAZ_CHECK(num == 3);
     YAZ_CHECK(num > 0 && !strcmp(array[0], "a"));
index 8b2fe88..3721858 100644 (file)
@@ -31,14 +31,14 @@ void tst_MySequence1(ODR encode, ODR decode)
     s->third = odr_booldup(encode, 1);
     s->fourth = odr_nullval();
     s->fifth = odr_intdup(encode, YC_MySequence_enum1);
-    
+
     s->myoid = odr_getoidbystr(decode, MYOID);
 
     ret = yc_MySequence(encode, &s, 0, 0);
     YAZ_CHECK(ret);
     if (!ret)
         return;
-    
+
     ber_buf = odr_getbuf(encode, &ber_len, 0);
 
     odr_setbuf(decode, ber_buf, ber_len, 0);
@@ -130,7 +130,7 @@ static void tst_berint32(ODR encode, ODR decode)
     Odr_int val;
     Odr_int ret_val;
     int r;
-    
+
     val = 0;
     odr_reset(encode);
     r = ber_integer(encode, &val);
@@ -253,7 +253,7 @@ static void tst_berint64(ODR encode, ODR decode)
     Odr_int val;
     Odr_int ret_val;
     int r;
-    
+
     val = (Odr_int) 2 * 2147483648UL; /* 2^32 */
     odr_reset(encode);
     r = ber_integer(encode, &val);
@@ -340,7 +340,7 @@ void do_nothing_useful(Odr_int value)
     Odr_int *valp, *resvalp;
     char *bufferp;
     int len;
-     
+
     /* allocate streams */
     if (!(encode = odr_createmem(ODR_ENCODE)))
         return;
index 7b04707..311d7a6 100644 (file)
@@ -31,7 +31,7 @@ static void tst(void)
     int argc = sizeof(argv) / sizeof(*argv);
     char *arg = 0;
     const char *desc = "a{longa}b{longb}cdn:m{marmelade}:";
-    
+
     YAZ_CHECK_EQ(options(desc, argv, argc, &arg), 'a');
     YAZ_CHECK_EQ(options(desc, argv, argc, &arg), 'b');
     YAZ_CHECK_EQ(options(desc, argv, argc, &arg), 0);
index bac5c16..49cf998 100644 (file)
@@ -42,11 +42,11 @@ int expect_pqf(const char *pqf, const char *expect_pqf, int expect_error)
     else if (expect_error == YAZ_PQF_ERROR_NONE)
     {
         WRBUF wrbuf = wrbuf_alloc();
-        
+
         if (wrbuf)
         {
             yaz_rpnquery_to_wrbuf(wrbuf, rpn);
-            
+
             if (!strcmp(wrbuf_cstr(wrbuf), expect_pqf))
             {
                 res = 1;
index c96f453..ddd5072 100644 (file)
@@ -23,7 +23,7 @@ enum query_charset_status {
     CONV_FAILED
 };
 
-enum query_charset_status t(yaz_iconv_t cd, 
+enum query_charset_status t(yaz_iconv_t cd,
                             const char *pqf, const char *expect_pqf)
 {
     YAZ_PQF_Parser parser = yaz_pqf_create();
index cc7b06b..986336b 100644 (file)
@@ -51,7 +51,7 @@ yaz_record_conv_t conv_configure(const char *xmlstring, WRBUF w)
 
 
             int r = yaz_record_conv_configure(p, ptr);
-            
+
             if (r)
             {
                 wrbuf_puts(w, yaz_record_conv_get_error(p));
@@ -61,7 +61,7 @@ yaz_record_conv_t conv_configure(const char *xmlstring, WRBUF w)
         }
         xmlFreeDoc(doc);
         return p;
-    }    
+    }
 }
 
 int conv_configure_test(const char *xmlstring, const char *expect_error,
@@ -144,7 +144,7 @@ static void tst_configure(void)
                                   "</backend>",
                                   "xslt unsupported."
                                   " YAZ compiled without XSLT support", 0));
-#endif 
+#endif
 }
 
 static int conv_convert_test(yaz_record_conv_t p,
@@ -181,7 +181,7 @@ static int conv_convert_test(yaz_record_conv_t p,
             else if (strcmp(output_expect_record, wrbuf_cstr(output_record)))
             {
                 ret = 0;
-                printf("got-output_record len=%ld: %s\n", 
+                printf("got-output_record len=%ld: %s\n",
                        (long) wrbuf_len(output_record),
                        wrbuf_cstr(output_record));
                 printf("output_expect_record len=%ld %s\n",
@@ -346,7 +346,7 @@ int main(int argc, char **argv)
 #if YAZ_HAVE_XML2
     tst_configure();
 #endif
-#if  YAZ_HAVE_XSLT 
+#if  YAZ_HAVE_XSLT
     tst_convert1();
     tst_convert2();
 #endif
index a374159..0c5fd74 100644 (file)
@@ -49,7 +49,7 @@ yaz_retrieval_t conv_configure(const char *xmlstring, WRBUF w)
         else
         {
             int r = yaz_retrieval_configure(p, ptr);
-            
+
             if (r)
             {
                 wrbuf_puts(w, yaz_retrieval_get_error(p));
@@ -59,7 +59,7 @@ yaz_retrieval_t conv_configure(const char *xmlstring, WRBUF w)
         }
         xmlFreeDoc(doc);
         return p;
-    }    
+    }
 }
 
 int conv_configure_test(const char *xmlstring, const char *expect_error,
@@ -102,10 +102,10 @@ int conv_configure_test(const char *xmlstring, const char *expect_error,
 
 static void tst_configure(void)
 {
-    YAZ_CHECK(conv_configure_test("<bad", 
+    YAZ_CHECK(conv_configure_test("<bad",
                                   "xmlParseMemory", 0));
 
-    YAZ_CHECK(conv_configure_test("<bad/>", 
+    YAZ_CHECK(conv_configure_test("<bad/>",
                                   "Expected element <retrievalinfo>", 0));
 
     YAZ_CHECK(conv_configure_test("<retrievalinfo/>", 0, 0));
@@ -121,7 +121,7 @@ static void tst_configure(void)
 
 
     YAZ_CHECK(conv_configure_test("<retrievalinfo>"
-                                  "<retrieval" 
+                                  "<retrieval"
                                   " unknown=\"unknown\""
                                   ">"
                                   "</retrieval>"
@@ -131,7 +131,7 @@ static void tst_configure(void)
                                   "'unknown'", 0));
 
     YAZ_CHECK(conv_configure_test("<retrievalinfo>"
-                                  "<retrieval" 
+                                  "<retrieval"
                                   " syntax=\"unknown_synt\""
                                   ">"
                                   "</retrieval>"
@@ -140,14 +140,14 @@ static void tst_configure(void)
                                   "value syntax='unknown_synt'", 0));
 
     YAZ_CHECK(conv_configure_test("<retrievalinfo>"
-                                  "<retrieval" 
+                                  "<retrieval"
                                   " syntax=\"usmarc\""
                                   "/>"
                                   "</retrievalinfo>",
                                   0, 0));
 
     YAZ_CHECK(conv_configure_test("<retrievalinfo>"
-                                  "<retrieval" 
+                                  "<retrieval"
                                   " syntax=\"usmarc\""
                                   " name=\"marcxml\"/>"
                                   "</retrievalinfo>",
@@ -155,9 +155,9 @@ static void tst_configure(void)
 
 
     YAZ_CHECK(conv_configure_test("<retrievalinfo>"
-                                  "<retrieval" 
+                                  "<retrieval"
                                   " syntax=\"usmarc\""
-                                  " name=\"marcxml\"" 
+                                  " name=\"marcxml\""
                                   " identifier=\"info:srw/schema/1/marcxml-v1.1\""
                                   "/>"
                                   "</retrievalinfo>",
@@ -166,18 +166,18 @@ static void tst_configure(void)
 
 
     YAZ_CHECK(conv_configure_test("<retrievalinfo>"
-                                  "<retrieval" 
+                                  "<retrieval"
                                   " syntax=\"usmarc\""
                                   " identifier=\"info:srw/schema/1/marcxml-v1.1\""
                                   " name=\"marcxml\">"
                                   "<convert/>"
-                                  "</retrieval>" 
+                                  "</retrieval>"
                                   "</retrievalinfo>",
                                   "Element <retrieval>: expected zero or one element "
                                   "<backend>, got <convert>", 0));
 
     YAZ_CHECK(conv_configure_test("<retrievalinfo>"
-                                  "<retrieval" 
+                                  "<retrieval"
                                   " syntax=\"usmarc\""
                                   " identifier=\"info:srw/schema/1/marcxml-v1.1\""
                                   " name=\"marcxml\">"
@@ -190,7 +190,7 @@ static void tst_configure(void)
                                   " got 'schema'", 0));
 
     YAZ_CHECK(conv_configure_test("<retrievalinfo>"
-                                  "<retrieval" 
+                                  "<retrieval"
                                   " syntax=\"usmarc\""
                                   " identifier=\"info:srw/schema/1/marcxml-v1.1\""
                                   " name=\"marcxml\">"
@@ -202,7 +202,7 @@ static void tst_configure(void)
                                   0, 0));
 
     YAZ_CHECK(conv_configure_test("<retrievalinfo>"
-                                  "<retrieval" 
+                                  "<retrieval"
                                   " syntax=\"usmarc\""
                                   " identifier=\"info:srw/schema/1/marcxml-v1.1\""
                                   " name=\"marcxml\">"
@@ -216,7 +216,7 @@ static void tst_configure(void)
 
 
     YAZ_CHECK(conv_configure_test("<retrievalinfo>"
-                                  "<retrieval" 
+                                  "<retrieval"
                                   " syntax=\"usmarc\""
                                   " identifier=\"info:srw/schema/1/marcxml-v1.1\""
                                     " name=\"marcxml\">"
index e822c8f..72e999c 100644 (file)
@@ -21,7 +21,7 @@ static int compare(cql_transform_t ct, const char *pqf, const char *cql)
     ODR odr = odr_createmem(ODR_ENCODE);
     WRBUF w = wrbuf_alloc();
     Z_RPNQuery *q = p_query_rpn(odr, pqf);
-    
+
     if (q)
     {
         int r = cql_transform_rpn2cql_wrbuf(ct, w, q);
@@ -54,7 +54,7 @@ static int compare(cql_transform_t ct, const char *pqf, const char *cql)
 
 static void tst1(void)
 {
-    cql_transform_t ct = cql_transform_create();    
+    cql_transform_t ct = cql_transform_create();
 
     YAZ_CHECK(compare(ct, "abc", "\"abc\""));
     YAZ_CHECK(compare(ct, "\"a b c\"", "\"a b c\""));
@@ -82,7 +82,7 @@ static void tst2(void)
         wrbuf_puts(w, "/");
     }
     wrbuf_puts(w, "../etc/pqf.properties");
-    
+
     ct = cql_transform_open_fname(wrbuf_cstr(w));
     YAZ_CHECK(compare(ct, "@attr 1=4 abc", "dc.title=\"abc\""));
     YAZ_CHECK(compare(ct, "@attr 1=4 @attr 4=108 abc", "dc.title=/exact \"abc\""));
index 159f949..ae4e742 100644 (file)
@@ -105,7 +105,7 @@ static void tst2(void)
         wrbuf_puts(w, "/");
     }
     wrbuf_puts(w, "../etc/pqf.properties");
-    
+
     ct = solr_transform_open_fname(wrbuf_cstr(w));
     YAZ_CHECK(compare(ct, "@attr 1=4 abc", "dc.title:abc"));
 #if 0
index a7ea152..fd737db 100644 (file)
@@ -27,7 +27,7 @@ static void test(void)
     WRBUF w = wrbuf_alloc();
 
     WRBUF_shptr_t t = 0;
-    
+
     YAZ_SHPTR_INIT(t, w);
     YAZ_CHECK(t);
 
index 7974c73..6bc0296 100644 (file)
@@ -29,10 +29,10 @@ void tst(void)
 
     top = xmlNewNode(0, BAD_CAST "top");
     YAZ_CHECK(top);
-    
+
     xmlNewTextChild(top, 0, BAD_CAST "sub", BAD_CAST val);
     xmlDocSetRootElement(doc, top);
-    
+
     xmlDocDumpMemory(doc, &buf_out, &len_out);
 #if 0
     printf("%*s", len_out, buf_out);
index 9de11ae..ea10cc4 100644 (file)
@@ -32,9 +32,9 @@ static void tst_srw(void)
     YAZ_CHECK(sr);
     YAZ_CHECK(p);
 #if 0
-    sr->u.request->query.cql = "jordb" "\xe6" "r"; 
+    sr->u.request->query.cql = "jordb" "\xe6" "r";
 #else
-    sr->u.request->query.cql = "jordbaer"; 
+    sr->u.request->query.cql = "jordbaer";
 #endif
 
     p->which = Z_SOAP_generic;
@@ -81,7 +81,7 @@ static void tst_array_to_uri(void)
     {
         YAZ_CHECK(names[0] && !strcmp(names[0], "a"));
         YAZ_CHECK(values[0] && !strcmp(values[0], "AA"));
-        
+
         YAZ_CHECK(names[1] && !strcmp(names[1], "bb"));
         YAZ_CHECK(values[1] && !strcmp(values[1], "BB"));
 
@@ -142,7 +142,7 @@ static void tst_array_to_uri(void)
         YAZ_CHECK(values[1] && !strcmp(values[1], ""));
 
         YAZ_CHECK(names[2] && !strcmp(names[2], "x"));
-        YAZ_CHECK(values[2] && !strcmp(values[2], "")); 
+        YAZ_CHECK(values[2] && !strcmp(values[2], ""));
 
         YAZ_CHECK(names[3] == 0);
         YAZ_CHECK(values[3] == 0);
index 27eafc8..a25765c 100644 (file)
@@ -39,7 +39,7 @@ int compare_solr_req(ODR odr, Z_SRW_PDU *sr,
     {
         int len = 0;
         char *buf = odr_getbuf(odr, &len, 0);
-        
+
         if (buf)
         {
             if (len == strlen(expect) && !memcmp(buf, expect, len))
@@ -64,7 +64,7 @@ void tst_encoding(void)
     {
         Z_SRW_PDU *sr = yaz_srw_get_pdu(odr, Z_SRW_searchRetrieve_request,
                                         "1.2");
-        
+
         YAZ_CHECK(compare_solr_req(
                       odr, sr, 0,
                       "GET Default/select? HTTP/1.1\r\n"
@@ -87,7 +87,7 @@ void tst_encoding(void)
     {
         Z_SRW_PDU *sr = yaz_srw_get_pdu(odr, Z_SRW_searchRetrieve_request,
                                         "1.2");
-        
+
         sr->u.request->query_type = Z_SRW_query_type_cql;
         sr->u.request->query.cql = "title:solr";
         sr->u.request->startRecord = odr_intdup(odr, 3);
@@ -105,7 +105,7 @@ void tst_encoding(void)
     {
         Z_SRW_PDU *sr = yaz_srw_get_pdu(odr, Z_SRW_searchRetrieve_request,
                                         "1.2");
-        
+
         sr->u.request->query_type = Z_SRW_query_type_cql;
         sr->u.request->query.cql = "title:solr";
         sr->u.request->startRecord = odr_intdup(odr, 3);
@@ -137,7 +137,7 @@ int check_response(ODR o, const char *content, Z_SRW_searchRetrieveResponse **p)
     Z_SRW_PDU *sr_p;
     char *http_response = odr_malloc(o, strlen(content) + 300);
 
-    strcpy(http_response, 
+    strcpy(http_response,
            "HTTP/1.1 200 OK\r\n"
            "Last-Modified: Wed, 13 Apr 2011 08:30:59 GMT\r\n"
            "ETag: \"MjcyMWE5M2JiNDgwMDAwMFNvbHI=\"\r\n"
@@ -167,7 +167,7 @@ void tst_decoding(void)
     Z_SRW_searchRetrieveResponse *response;
 
     YAZ_CHECK(check_response(
-                  odr, 
+                  odr,
                   "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
                   "<response>\n"
                   "<lst name=\"responseHeader\"><int name=\"status\">0</int>"
@@ -188,7 +188,7 @@ void tst_decoding(void)
 
     YAZ_CHECK(
         check_response(
-            odr, 
+            odr,
             "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
             "<response><lst name=\"responseHeader\">"
             "<int name=\"status\">0</int><int name=\"QTime\">2</int>"
@@ -269,7 +269,7 @@ void tst_decoding(void)
             "</doc>";
 
         Z_SRW_record *record = response->records;
-        
+
         YAZ_CHECK(record->recordData_len == strlen(doc) &&
                   !memcmp(record->recordData_buf, doc, record->recordData_len));
     }
index ff5d514..caea25b 100644 (file)
@@ -44,11 +44,11 @@ static void tst(void)
     user = yaz_timing_get_user(t);
     YAZ_CHECK(user == -1.0 || user >= 0.0);
 
-    sys = yaz_timing_get_sys(t); 
+    sys = yaz_timing_get_sys(t);
     YAZ_CHECK(sys == -1.0 || sys >= 0.0);
 
     yaz_log(YLOG_LOG, "real=%f user=%f sys=%f", real, user, sys);
-   
+
     yaz_timing_destroy(&t);
     YAZ_CHECK(!t);
 }
index f963e45..153ee9c 100644 (file)
@@ -41,7 +41,7 @@ static void tstwrbuf(void)
             buf[i] = '\0';
             wrbuf_puts(wr, buf);
         }
-        
+
         cp = wrbuf_buf(wr);
         len = wrbuf_len(wr);
         YAZ_CHECK(len == step * (step-1) / 2);
index 0889e4c..b1faf61 100644 (file)
@@ -52,7 +52,7 @@ enum pqf2xml_status pqf2xml_text(const char *pqf, const char *expect_xml,
         xmlDocPtr doc = 0;
 
         yaz_rpnquery2xml(rpn, &doc);
-        
+
         if (!doc)
             status = QUERY2XML_FAILED;
         else
@@ -61,7 +61,7 @@ enum pqf2xml_status pqf2xml_text(const char *pqf, const char *expect_xml,
             int len_out;
 
             xmlDocDumpMemory(doc, (xmlChar **) &buf_out, &len_out);
-            
+
             if (len_out == (int) strlen(expect_xml)
                 && memcmp(buf_out, expect_xml, len_out) == 0)
             {
@@ -70,7 +70,7 @@ enum pqf2xml_status pqf2xml_text(const char *pqf, const char *expect_xml,
                 const char *addinfo = 0;
                 const xmlNode *root_element = xmlDocGetRootElement(doc);
                 ODR odr2 = odr_createmem(ODR_ENCODE);
-                
+
                 yaz_xml2query(root_element, &query2, odr2,
                               &error_code, &addinfo);
                 if (error_code || !query2)
@@ -111,7 +111,7 @@ static void tst(void)
     YAZ_CHECK_EQ(pqf2xml_text("@attr 1=4 bad query", "", 0), PQF_FAILED);
 #if YAZ_HAVE_XML2
     YAZ_CHECK_EQ(pqf2xml_text(
-                     "@attr 1=4 computer", 
+                     "@attr 1=4 computer",
                      "<?xml version=\"1.0\"?>\n"
                      "<query><rpn set=\"Bib-1\">"
                      "<apt><attr type=\"1\" value=\"4\"/>"
@@ -119,7 +119,7 @@ static void tst(void)
                      "</rpn></query>\n",
                      "RPN @attrset Bib-1 @attr 1=4 computer"
                      ), XML_MATCH);
-    
+
     YAZ_CHECK_EQ(pqf2xml_text(
                      "@attr 2=1 @attr 1=title computer",
                      "<?xml version=\"1.0\"?>\n"
@@ -141,9 +141,9 @@ static void tst(void)
                      "</rpn></query>\n",
                      "RPN @attrset Bib-1 @attr Exp-1 1=1 @attr 2=1 computer"
                      ), XML_MATCH);
-    
+
     YAZ_CHECK_EQ(pqf2xml_text(
-                     "@and a b", 
+                     "@and a b",
                      "<?xml version=\"1.0\"?>\n"
                      "<query><rpn set=\"Bib-1\">"
                      "<operator type=\"and\">"
@@ -152,9 +152,9 @@ static void tst(void)
                      "</operator></rpn></query>\n",
                      "RPN @attrset Bib-1 @and a b"
                      ), XML_MATCH);
-    
+
     YAZ_CHECK_EQ(pqf2xml_text(
-                     "@or @and a b c", 
+                     "@or @and a b c",
                      "<?xml version=\"1.0\"?>\n"
                      "<query><rpn set=\"Bib-1\">"
                      "<operator type=\"or\">"
@@ -167,7 +167,7 @@ static void tst(void)
                      ), XML_MATCH);
 
     YAZ_CHECK_EQ(pqf2xml_text(
-                     "@set abe", 
+                     "@set abe",
                      "<?xml version=\"1.0\"?>\n"
                      "<query><rpn set=\"Bib-1\">"
                      "<rset>abe</rset></rpn></query>\n",
@@ -175,9 +175,9 @@ static void tst(void)
                      ), XML_MATCH);
 
     YAZ_CHECK_EQ(pqf2xml_text(
-                     /* exclusion, distance, ordered, relationtype, 
+                     /* exclusion, distance, ordered, relationtype,
                         knownunit, proxunit */
-                     "@prox 0 3 1 2 k 2           a b", 
+                     "@prox 0 3 1 2 k 2           a b",
                      "<?xml version=\"1.0\"?>\n"
                      "<query><rpn set=\"Bib-1\">"
                      "<operator type=\"prox\" exclusion=\"false\" "
@@ -192,7 +192,7 @@ static void tst(void)
                      ), XML_MATCH);
 
     YAZ_CHECK_EQ(pqf2xml_text(
-                     "@term numeric 32", 
+                     "@term numeric 32",
                      "<?xml version=\"1.0\"?>\n"
                      "<query><rpn set=\"Bib-1\">"
                      "<apt>"
@@ -200,9 +200,9 @@ static void tst(void)
                      "</rpn></query>\n",
                      "RPN @attrset Bib-1 @term numeric 32"
                      ), XML_MATCH);
-    
+
     YAZ_CHECK_EQ(pqf2xml_text(
-                     "@term string computer", 
+                     "@term string computer",
                      "<?xml version=\"1.0\"?>\n"
                      "<query><rpn set=\"Bib-1\">"
                      "<apt>"
@@ -210,9 +210,9 @@ static void tst(void)
                      "</rpn></query>\n",
                      "RPN @attrset Bib-1 @term string computer"
                      ), XML_MATCH);
-    
+
     YAZ_CHECK_EQ(pqf2xml_text(
-                     "@term null void", 
+                     "@term null void",
                      "<?xml version=\"1.0\"?>\n"
                      "<query><rpn set=\"Bib-1\">"
                      "<apt>"
@@ -222,7 +222,7 @@ static void tst(void)
                      ), XML_MATCH);
 
     YAZ_CHECK_EQ(pqf2xml_text(
-                     "@attrset gils @attr 4=2 x", 
+                     "@attrset gils @attr 4=2 x",
                      "<?xml version=\"1.0\"?>\n"
                      "<query><rpn set=\"GILS\">"
                      "<apt>"
index 36f49c1..ab55bc8 100644 (file)
@@ -47,7 +47,7 @@ int main(int argc, char **argv)
     int ok;
     int nok = 0;
     char *arg;
-    
+
     while ((c = options("c:s:p:fbd:rv:", argv, argc, &arg)) != -2) {
         switch (c) {
         case 0:
index 638e7ba..80114ee 100644 (file)
@@ -14,7 +14,7 @@
 #include <yaz/options.h>
 
 #if HAVE_READLINE_READLINE_H
-#include <readline/readline.h> 
+#include <readline/readline.h>
 #endif
 #if HAVE_READLINE_HISTORY_H
 #include <readline/history.h>
@@ -44,8 +44,8 @@ int main(int argc, char **argv)
     WRBUF q_wrbuf = 0;
 
     prog = *argv;
-    bibset = ccl_qual_mk();    
-    
+    bibset = ccl_qual_mk();
+
     while ((ret = options("db:x:", argv, argc, &arg)) != -2)
     {
         switch(ret)
@@ -97,11 +97,11 @@ int main(int argc, char **argv)
         CCL_parser cclp = ccl_parser_create(bibset);
         int error;
         struct ccl_rpn_node *rpn;
-        
+
         rpn = ccl_parser_find_str(cclp, wrbuf_cstr(q_wrbuf));
-        
+
         error = ccl_parser_get_error(cclp, 0);
-        
+
         if (error)
         {
             printf("%s\n", ccl_err_msg(error));
@@ -141,19 +141,19 @@ int main(int argc, char **argv)
             }
             strcpy(buf,line_in);
             free(line_in);
-#else    
+#else
         printf("CCLSH>"); fflush(stdout);
         if (!fgets(buf, 999, stdin))
             break;
-#endif 
+#endif
 
         for (i = 0; i<1; i++)
         {
             CCL_parser cclp = ccl_parser_create(bibset);
             int pos;
-            
+
             rpn = ccl_parser_find_str(cclp, buf);
-            
+
             error = ccl_parser_get_error(cclp, &pos);
 
             if (error)
@@ -174,7 +174,7 @@ int main(int argc, char **argv)
                         printf("Second:\n");
                         ccl_pr_tree(rpn, stdout);
                         printf("\n");
-                        
+
                         for (idx = 0; ; idx++)
                         {
                             const char *qname;
@@ -182,7 +182,7 @@ int main(int argc, char **argv)
                             if (!ccl_stop_words_info(csw, idx,
                                                      &qname, &term))
                                 break;
-                            printf("Removed from %s: %s\n", 
+                            printf("Removed from %s: %s\n",
                                    qname ? qname : "none", term);
                         }
                     }
index e182db0..d5571dd 100644 (file)
@@ -79,11 +79,11 @@ int main(int argc, char **argv)
             {
                 fprintf(stderr, "PQF syntax error\n");
             }
-            else 
+            else
             {
                 int ret = cql_transform_rpn2cql_stream(ct, cql_fputs,
                                                        stdout, rpn);
-                
+
                 if (ret)
                 {
                     const char *addinfo;
@@ -101,7 +101,7 @@ int main(int argc, char **argv)
     {
         CQL_parser cp = cql_parser_create();
         int r = 0;
-        
+
         if (query)
         {
             if (verbose)
@@ -111,7 +111,7 @@ int main(int argc, char **argv)
         }
         else
             r = cql_parser_stdio(cp, stdin);
-        
+
         if (r)
             fprintf(stderr, "Syntax error\n");
         else
index bd78e3b..8016fbb 100644 (file)
@@ -48,7 +48,7 @@ int main(int argc, char **argv)
             do_sortkeys = 1;
             break;
         default:
-            usage(prog);            
+            usage(prog);
         }
     }
 
@@ -75,7 +75,7 @@ int main(int argc, char **argv)
         if (do_sortkeys)
         {
             WRBUF w = wrbuf_alloc();
-            r = cql_sortby_to_sortkeys(cql_parser_result(cp), 
+            r = cql_sortby_to_sortkeys(cql_parser_result(cp),
                                        wrbuf_vp_puts, w);
             if (r == 0)
                 printf("sortkeys: %s\n", wrbuf_cstr(w));
index 08c9bec..adc6cba 100644 (file)
@@ -62,7 +62,7 @@ static void usage(const char *prog)
             "[-l pos=value] [-c cfile] [-s prefix] [-C size] [-n] "
             "[-p] [-v] [-V] file...\n",
             prog);
-} 
+}
 
 static void show_version(void)
 {
@@ -103,7 +103,7 @@ static void marcdump_read_line(yaz_marc_t mt, const char *fname)
                 prog, fname, strerror(errno));
         exit(1);
     }
-    
+
     while (yaz_marc_read_line(mt, getbyte_stream,
                               ungetbyte_stream, inf) == 0)
     {
@@ -131,12 +131,12 @@ static void marcdump_read_xml(yaz_marc_t mt, const char *fname)
             int type = xmlTextReaderNodeType(reader);
             if (type == XML_READER_TYPE_ELEMENT)
             {
-                const char *name = (const char *) 
+                const char *name = (const char *)
                     xmlTextReaderLocalName(reader);
                 if (!strcmp(name, "record") || !strcmp(name, "r"))
                 {
                     xmlNodePtr ptr = xmlTextReaderExpand(reader);
-        
+
                     int r = yaz_marc_read_xml(mt, ptr);
                     if (r)
                         fprintf(stderr, "yaz_marc_read_xml failed\n");
@@ -145,7 +145,7 @@ static void marcdump_read_xml(yaz_marc_t mt, const char *fname)
                         int write_rc = yaz_marc_write_mode(mt, wrbuf);
                         if (write_rc)
                             yaz_log(YLOG_WARN, "yaz_marc_write_mode: write error: %d", write_rc);
-                        
+
                         fputs(wrbuf_cstr(wrbuf), stdout);
                         wrbuf_rewind(wrbuf);
                     }
@@ -176,7 +176,7 @@ static void marcdump_read_xml(yaz_marc_t mt, const char *fname)
                     else
                     {
                         yaz_marc_write_mode(mt, wrbuf);
-                        
+
                         fputs(wrbuf_cstr(wrbuf), stdout);
                         wrbuf_rewind(wrbuf);
                     }
@@ -255,7 +255,7 @@ static void dump(const char *fname, const char *from, const char *to,
             size_t len_result;
             size_t r;
             char buf[100001];
-            
+
             r = fread(buf, 1, 5, inf);
             if (r < 5)
             {
@@ -270,7 +270,7 @@ static void dump(const char *fname, const char *from, const char *to,
                 long off = ftell(inf) - 5;
                 if (verbose || print_offset)
                     printf("<!-- Skipping bad byte %d (0x%02X) at offset "
-                           "%ld (0x%lx) -->\n", 
+                           "%ld (0x%lx) -->\n",
                            *buf & 0xff, *buf & 0xff,
                            off, off);
                 for (i = 0; i<4; i++)
@@ -364,10 +364,10 @@ static void dump(const char *fname, const char *from, const char *to,
                     if ((i & 15) == 0)
                         fprintf(cfile, "  \"");
                     fprintf(cfile, "\\x%02X", p[i] & 255);
-                    
+
                     if (i < r - 1 && (i & 15) == 15)
                         fprintf(cfile, "\"\n");
-                    
+
                 }
                 fprintf(cfile, "\"\n");
             }
@@ -430,7 +430,7 @@ int main (int argc, char **argv)
             }
 #if YAZ_HAVE_XML2
 #else
-            if (input_format == YAZ_MARC_MARCXML 
+            if (input_format == YAZ_MARC_MARCXML
                 || input_format == YAZ_MARC_XCHANGE)
             {
                 fprintf(stderr, "%s: Libxml2 support not enabled\n", prog);
@@ -519,7 +519,7 @@ int main (int argc, char **argv)
         case 'v':
             verbose++;
             break;
-        case 'V': 
+        case 'V':
             show_version();
             break;
         default:
index e387750..f12c2d7 100644 (file)
@@ -36,7 +36,7 @@ int main(int argc, char **argv)
     decode = odr_createmem(ODR_DECODE);
     encode = odr_createmem(ODR_ENCODE);
     content_len = no;
-    z_soap_codec(decode, &soap_package, 
+    z_soap_codec(decode, &soap_package,
                  &content_buf, &content_len, h);
     if (!soap_package)
     {
@@ -51,7 +51,7 @@ int main(int argc, char **argv)
         {
             Z_SRW_PDU *sr = (Z_SRW_PDU *) soap_package->u.generic->p;
             if (sr->which == Z_SRW_searchRetrieve_request)
-            { 
+            {
                 Z_SRW_searchRetrieveRequest *req = sr->u.request;
                 switch(req->query_type)
                 {
index 603517b..d853428 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <unicode/ucnv.h>
 #include <unicode/ustring.h>
-#include <unicode/ucol.h> 
+#include <unicode/ucol.h>
 #include <unicode/ubrk.h>
 #include <unicode/utrans.h>
 #include <unicode/uclean.h>
@@ -28,7 +28,7 @@
 #include <yaz/wrbuf.h>
 
 /* commando line and config parameters */
-struct config_t { 
+struct config_t {
     char conffile[1024];
     char print[1024];
     int xmloutput;
@@ -37,9 +37,9 @@ struct config_t {
     FILE * infile;
     FILE * outfile;
 };
-  
+
 void print_option_error(const struct config_t *p_config)
-{  
+{
     fprintf(stderr, "yaz-icu [options] [infile]\n"
             "Options:\n"
             "   -c file         XML configuration\n"
@@ -65,10 +65,10 @@ void print_option_error(const struct config_t *p_config)
 }
 
 void read_params(int argc, char **argv, struct config_t *p_config)
-{    
+{
     char *arg;
     int ret;
-    
+
     /* set default parameters */
     p_config->conffile[0] = 0;
     p_config->print[0] = 0;
@@ -77,9 +77,9 @@ void read_params(int argc, char **argv, struct config_t *p_config)
     p_config->chain = 0;
     p_config->infile = 0;
     p_config->outfile = stdout;
-    
+
     /* set up command line parameters */
-    
+
     while ((ret = options("c:p:xs", argv, argc, &arg)) != -2)
     {
         switch (ret)
@@ -133,21 +133,21 @@ static void print_icu_converters(const struct config_t *p_config)
         fprintf(p_config->outfile, "<converters count=\"%d\" default=\"%s\">\n",
                 count, ucnv_getDefaultName());
     else
-    {    
+    {
         fprintf(p_config->outfile, "Available ICU converters: %d\n", count);
-        fprintf(p_config->outfile, "Default ICU Converter is: '%s'\n", 
+        fprintf(p_config->outfile, "Default ICU Converter is: '%s'\n",
                 ucnv_getDefaultName());
     }
-    
+
     for (i = 0; i < count; i++)
     {
         if (p_config->xmloutput)
-            fprintf(p_config->outfile, "<converter id=\"%s\"/>\n", 
+            fprintf(p_config->outfile, "<converter id=\"%s\"/>\n",
                     ucnv_getAvailableName(i));
-        else     
+        else
             fprintf(p_config->outfile, "%s\n", ucnv_getAvailableName(i));
     }
-    
+
     if (p_config->xmloutput)
         fprintf(p_config->outfile, "</converters>\n");
     else
@@ -164,7 +164,7 @@ static void print_icu_transliterators(const struct config_t *p_config)
 
     if (p_config->xmloutput)
         fprintf(p_config->outfile, "<transliterators count=\"%d\">\n",  count);
-    else 
+    else
         fprintf(p_config->outfile, "Available ICU transliterators: %d\n", count);
 
     while ((name = uenum_next(en, &length, &status)))
@@ -219,10 +219,10 @@ static void print_icu_transliterators(const struct config_t *p_config)
                 "see http://userguide.icu-project.org/transforms/general\n"
                 "    http://www.unicode.org/reports/tr44/\n"
             );
-        
-        
+
+
         fprintf(p_config->outfile, "\n\n");
-        
+
     }
 }
 
@@ -231,7 +231,7 @@ static void print_icu_xml_locales(const struct config_t *p_config)
     int32_t count;
     int32_t i;
     UErrorCode status = U_ZERO_ERROR;
-    
+
     UChar keyword[64];
     int32_t keyword_len = 0;
     char keyword_str[128];
@@ -271,7 +271,7 @@ static void print_icu_xml_locales(const struct config_t *p_config)
 
     if (p_config->xmloutput)
     {
-        fprintf(p_config->outfile, "<locales count=\"%d\" default=\"%s\" collations=\"%d\">\n", 
+        fprintf(p_config->outfile, "<locales count=\"%d\" default=\"%s\" collations=\"%d\">\n",
                 count, uloc_getDefault(), ucol_countAvailable());
     }
     else
@@ -279,23 +279,23 @@ static void print_icu_xml_locales(const struct config_t *p_config)
         fprintf(p_config->outfile, "Available ICU locales: %d\n", count);
         fprintf(p_config->outfile, "Default locale is: %s\n",  uloc_getDefault());
     }
-  
-    for (i = 0; i < count; i++) 
+
+    for (i = 0; i < count; i++)
     {
 
-        keyword_len 
-            = uloc_getDisplayKeyword(uloc_getAvailable(i), "en", 
-                                     keyword, 64, 
+        keyword_len
+            = uloc_getDisplayKeyword(uloc_getAvailable(i), "en",
+                                     keyword, 64,
                                      &status);
 
         u_strToUTF8(keyword_str, 128, &keyword_str_len,
                     keyword, keyword_len,
                     &status);
-    
-    
-        language_len 
-            = uloc_getDisplayLanguage(uloc_getAvailable(i), "en", 
-                                      language, 64, 
+
+
+        language_len
+            = uloc_getDisplayLanguage(uloc_getAvailable(i), "en",
+                                      language, 64,
                                       &status);
 
         u_strToUTF8(lang_str, 128, &lang_str_len,
@@ -303,45 +303,45 @@ static void print_icu_xml_locales(const struct config_t *p_config)
                     &status);
 
 
-        script_len 
-            = uloc_getDisplayScript(uloc_getAvailable(i), "en", 
-                                    script, 64, 
+        script_len
+            = uloc_getDisplayScript(uloc_getAvailable(i), "en",
+                                    script, 64,
                                     &status);
 
         u_strToUTF8(script_str, 128, &script_str_len,
                     script, script_len,
                     &status);
 
-        location_len 
-            = uloc_getDisplayCountry(uloc_getAvailable(i), "en", 
-                                     location, 64, 
+        location_len
+            = uloc_getDisplayCountry(uloc_getAvailable(i), "en",
+                                     location, 64,
                                      &status);
 
         u_strToUTF8(location_str, 128, &location_str_len,
                     location, location_len,
                     &status);
 
-        variant_len 
-            = uloc_getDisplayVariant(uloc_getAvailable(i), "en", 
-                                     variant, 64, 
+        variant_len
+            = uloc_getDisplayVariant(uloc_getAvailable(i), "en",
+                                     variant, 64,
                                      &status);
 
         u_strToUTF8(variant_str, 128, &variant_str_len,
                     variant, variant_len,
                     &status);
 
-        name_len 
-            = uloc_getDisplayName(uloc_getAvailable(i), "en", 
-                                  name, 64, 
+        name_len
+            = uloc_getDisplayName(uloc_getAvailable(i), "en",
+                                  name, 64,
                                   &status);
 
         u_strToUTF8(name_str, 128, &name_str_len,
                     name, name_len,
                     &status);
 
-        localname_len 
-            = uloc_getDisplayName(uloc_getAvailable(i), uloc_getAvailable(i), 
-                                  localname, 64, 
+        localname_len
+            = uloc_getDisplayName(uloc_getAvailable(i), uloc_getAvailable(i),
+                                  localname, 64,
                                   &status);
 
         u_strToUTF8(localname_str, 128, &localname_str_len,
@@ -351,7 +351,7 @@ static void print_icu_xml_locales(const struct config_t *p_config)
 
         if (p_config->xmloutput)
         {
-            fprintf(p_config->outfile, "<locale id=\"%s\"", uloc_getAvailable(i)); 
+            fprintf(p_config->outfile, "<locale id=\"%s\"", uloc_getAvailable(i));
             if (strlen(lang_str))
                 fprintf(p_config->outfile, " language=\"%s\"", lang_str);
             if (strlen(script_str))
@@ -367,11 +367,11 @@ static void print_icu_xml_locales(const struct config_t *p_config)
             fprintf(p_config->outfile, ">");
             if (strlen(localname_str))
                 fprintf(p_config->outfile, "%s", localname_str);
-            fprintf(p_config->outfile, "</locale>\n"); 
+            fprintf(p_config->outfile, "</locale>\n");
         }
         else if (1 == p_config->xmloutput)
         {
-            fprintf(p_config->outfile, "%s", uloc_getAvailable(i)); 
+            fprintf(p_config->outfile, "%s", uloc_getAvailable(i));
             fprintf(p_config->outfile, " | ");
             if (strlen(name_str))
                 fprintf(p_config->outfile, "%s", name_str);
@@ -426,17 +426,17 @@ static void process_text_file(struct config_t *p_config)
 {
     char *line = 0;
     char linebuf[1024];
-    xmlDoc *doc = xmlParseFile(p_config->conffile);  
+
+    xmlDoc *doc = xmlParseFile(p_config->conffile);
     xmlNode *xml_node = xmlDocGetRootElement(doc);
 
-    long unsigned int token_count = 0;    
-    long unsigned int line_count = 0;    
-    
+    long unsigned int token_count = 0;
+    long unsigned int line_count = 0;
+
     UErrorCode status = U_ZERO_ERROR;
-    
+
     if (!xml_node)
-    {   
+    {
         printf("Could not parse XML config file '%s' \n",
                 p_config->conffile);
         exit(1);
@@ -445,7 +445,7 @@ static void process_text_file(struct config_t *p_config)
     p_config->chain = icu_chain_xml_config(xml_node, 1, &status);
 
     if (!p_config->chain || !U_SUCCESS(status))
-    {   
+    {
         printf("Could not set up ICU chain from config file '%s' \n",
                 p_config->conffile);
         if (!U_SUCCESS(status))
@@ -458,7 +458,7 @@ static void process_text_file(struct config_t *p_config)
                 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
                 "<icu>\n"
                 "<tokens>\n");
-    
+
     /* read input lines for processing */
     while ((line=fgets(linebuf, sizeof(linebuf)-1, p_config->infile)))
     {
@@ -477,9 +477,9 @@ static void process_text_file(struct config_t *p_config)
                 wrbuf_rewind(sw);
                 wrbuf_puts_escaped(sw, sortkey);
                 token_count++;
-                if (p_config->xmloutput)                    
+                if (p_config->xmloutput)
                 {
-                    fprintf(p_config->outfile, 
+                    fprintf(p_config->outfile,
                             "<token id=\"%lu\" line=\"%lu\"",
                             token_count, line_count);
 
@@ -492,7 +492,7 @@ static void process_text_file(struct config_t *p_config)
                     wrbuf_xmlputs(cdata, icu_chain_token_display(p_config->chain));
                     fprintf(p_config->outfile, " display=\"%s\"",
                             wrbuf_cstr(cdata));
-                    
+
                     if (p_config->sortoutput)
                     {
                         wrbuf_rewind(cdata);
@@ -525,7 +525,7 @@ static void process_text_file(struct config_t *p_config)
         fprintf(p_config->outfile,
                 "</tokens>\n"
                 "</icu>\n");
-    
+
     icu_chain_destroy(p_config->chain);
     xmlFreeDoc(doc);
     if (line)
@@ -535,7 +535,7 @@ static void process_text_file(struct config_t *p_config)
 #endif /* YAZ_HAVE_ICU */
 
 
-int main(int argc, char **argv) 
+int main(int argc, char **argv)
 {
 #if YAZ_HAVE_ICU
     struct config_t config;
@@ -544,7 +544,7 @@ int main(int argc, char **argv)
 
     if (config.conffile && strlen(config.conffile))
         process_text_file(&config);
-     
+
     if (config.print && strlen(config.print))
         print_info(&config);
 
index 548f782..546e60b 100644 (file)
@@ -13,7 +13,7 @@
  *  and yaz already provides the APDUS for it.
  *
  *  This is not an interactive client like yaz-client, but driven by command-
- *  line arguments. Its output is a return code, and possibly some text on 
+ *  line arguments. Its output is a return code, and possibly some text on
  *  stdout.
  *
  *  Exit codes  (note, the program exits as soon as it finds a good reason)
@@ -106,9 +106,9 @@ struct nameval *parse_nameval( char *arg ) {
     struct nameval *nv = (struct nameval *) xmalloc(sizeof(*nv));
     char *p=arg;
     int len;
-    if (!p || !*p) 
+    if (!p || !*p)
         return 0; /* yeah, leaks a bit of memory. so what */
-    while ( *p && ( *p != '=' ) ) 
+    while ( *p && ( *p != '=' ) )
         p++;
     len = p - arg;
     if (!len)
@@ -134,7 +134,7 @@ void append_nameval (struct prog_args *args, struct nameval *nv) {
         return;
     if (args->namevals) {
         nv->next=args->namevals->next; /* first */
-        args->namevals->next=nv; 
+        args->namevals->next=nv;
         args->namevals=nv;
     } else {
         nv->next=nv;
@@ -145,7 +145,7 @@ void append_nameval (struct prog_args *args, struct nameval *nv) {
 /** \brief parse a parameter file */
 void parse_paramfile(char *arg, struct prog_args *args) {
     FILE *f=fopen(arg,"r");
-#define BUFSIZE 4096    
+#define BUFSIZE 4096
     char buf[BUFSIZE];
     int len;
     struct nameval *nv;
@@ -195,7 +195,7 @@ void parseargs( int argc, char * argv[],  struct prog_args *args) {
     args->oclc_recno=0;
     args->auth_userid = 0;
     args->auth_passwd = 0;
-#if 0    
+#if 0
     /* Example 3 - directly from OCLC, supposed to work on their test server*/
     args->auth_userid = "100-310-658" ; /* FIXME - get from cmd line */
     args->auth_passwd = "apii2test" ;   /* FIXME - get from cmd line */
@@ -290,7 +290,7 @@ COMSTACK connect_to( char *hostaddr ){
                  hostaddr );
         exit(2);
     }
-    
+
     yaz_log(YLOG_DEBUG,"Created stack ok ");
 
     status = cs_connect(stack, server_address_ip);
@@ -309,11 +309,11 @@ COMSTACK connect_to( char *hostaddr ){
 Z_PromptObject1 *makeprompt(struct prog_args *args, ODR odr) {
     Z_PromptObject1 *p = (Z_PromptObject1 *) odr_malloc(odr, sizeof(*p) );
     Z_ResponseUnit1 *ru = (Z_ResponseUnit1 *) odr_malloc(odr, sizeof(*ru) );
-    
+
     p->which=Z_PromptObject1_response;
     p->u.response = (Z_Response1*) odr_malloc(odr, sizeof(*(p->u.response)) );
     p->u.response->num=2;
-    p->u.response->elements= (Z_ResponseUnit1 **) odr_malloc(odr, 
+    p->u.response->elements= (Z_ResponseUnit1 **) odr_malloc(odr,
              p->u.response->num*sizeof(*(p->u.response->elements)) );
     /* user id, aka "oclc authorization number" */
     p->u.response->elements[0] = ru;
@@ -321,7 +321,7 @@ Z_PromptObject1 *makeprompt(struct prog_args *args, ODR odr) {
     ru->promptId->which = Z_PromptId_enumeratedPrompt;
     ru->promptId->u.enumeratedPrompt = (Z_PromptIdEnumeratedPrompt *)
         odr_malloc(odr, sizeof(*(ru->promptId->u.enumeratedPrompt) ));
-    ru->promptId->u.enumeratedPrompt->type = 
+    ru->promptId->u.enumeratedPrompt->type =
          odr_intdup(odr,Z_PromptIdEnumeratedPrompt_userId);
     ru->promptId->u.enumeratedPrompt->suggestedString = 0 ;
     ru->which = Z_ResponseUnit1_string ;
@@ -333,7 +333,7 @@ Z_PromptObject1 *makeprompt(struct prog_args *args, ODR odr) {
     ru->promptId->which = Z_PromptId_enumeratedPrompt;
     ru->promptId->u.enumeratedPrompt =  (Z_PromptIdEnumeratedPrompt *)
         odr_malloc(odr, sizeof(*(ru->promptId->u.enumeratedPrompt) ));
-    ru->promptId->u.enumeratedPrompt->type = 
+    ru->promptId->u.enumeratedPrompt->type =
          odr_intdup(odr,Z_PromptIdEnumeratedPrompt_password);
     ru->promptId->u.enumeratedPrompt->suggestedString = 0 ;
     ru->which = Z_ResponseUnit1_string ;
@@ -357,12 +357,12 @@ ILL_Extension *makepromptextension(struct prog_args *args, ODR odr) {
         yaz_log(YLOG_FATAL,"Encoding of z_PromptObject1 failed ");
         exit (6);
     }
-    
+
     printf ("Prompt: \n"); /*!*/
     z_PromptObject1(odr_prt, &p, 0,0 ); /*!*/
 
     buf= odr_getbuf(odr_ext,&siz,0);
-    ext->u.single_ASN1_type=(Odr_any *) 
+    ext->u.single_ASN1_type=(Odr_any *)
         odr_malloc(odr,sizeof(*ext->u.single_ASN1_type));
     ext->u.single_ASN1_type->buf= (unsigned char *) odr_malloc(odr, siz);
     memcpy(ext->u.single_ASN1_type->buf,buf, siz );
@@ -379,7 +379,7 @@ ILL_Extension *makepromptextension(struct prog_args *args, ODR odr) {
     }
     printf("External: \n");
     z_External(odr_prt, &ext,0,0);  /*!*/
-    buf= odr_getbuf(odr_ext,&siz,0); 
+    buf= odr_getbuf(odr_ext,&siz,0);
     e->item->buf= (unsigned char *) odr_malloc(odr, siz);
     memcpy(e->item->buf,buf, siz );
     e->item->len = e->item->size = siz;
@@ -416,7 +416,7 @@ ILL_Extension *makeoclcextension(struct prog_args *args, ODR odr) {
         yaz_log(YLOG_FATAL,"Encoding of ill_OCLCILLRequestExtension failed ");
         exit (6);
     }
-    
+
     printf ("OCLC: \n"); /*!*/
     ill_OCLCILLRequestExtension(odr_prt, &oc, 0,0 ); /*!*/
 
@@ -438,7 +438,7 @@ ILL_Extension *makeoclcextension(struct prog_args *args, ODR odr) {
     }
     printf("External: \n");
     z_External(odr_prt, &ext,0,0);  /*!*/
-    buf= odr_getbuf(odr_ext,&siz,0); 
+    buf= odr_getbuf(odr_ext,&siz,0);
     e->item->buf= (unsigned char *) odr_malloc(odr, siz);
     memcpy(e->item->buf, buf, siz);
     e->item->len = e->item->size = siz;
@@ -484,7 +484,7 @@ void sendrequest(ILL_APDU *apdu, ODR odr, COMSTACK stack ) {
     char *buf_out;
     int len_out;
     int res;
-    if (!ill_APDU  (odr, &apdu, 0, 0)) { 
+    if (!ill_APDU  (odr, &apdu, 0, 0)) {
         yaz_log(YLOG_FATAL,"ill_Apdu failed");
         exit(2);
     }
@@ -518,7 +518,7 @@ void sendrequest(ILL_APDU *apdu, ODR odr, COMSTACK stack ) {
                 yaz_log(YLOG_FATAL|YLOG_ERRNO, "write req.apdu failed");
         }
     }
-    
+
 } /* sendrequest */
 
 /* * * * * * * * * * * * * * * */
@@ -533,7 +533,7 @@ ILL_APDU *getresponse( COMSTACK stack, ODR in_odr ){
     yaz_log(YLOG_DEBUG,"Got a response of %d bytes at %p. res=%d", len_in,buf_in, res);
     if (res<0) {
         yaz_log(YLOG_FATAL,"Could not receive packet. code %d",res );
-        yaz_log(YLOG_DEBUG,"%02x %02x %02x %02x %02x %02x %02x %02x ...", 
+        yaz_log(YLOG_DEBUG,"%02x %02x %02x %02x %02x %02x %02x %02x ...",
                 buf_in[0], buf_in[1], buf_in[2], buf_in[3],
                 buf_in[4], buf_in[5], buf_in[6], buf_in[7]  );
         yaz_log(YLOG_DEBUG,"PDU Dump:");
@@ -550,7 +550,7 @@ ILL_APDU *getresponse( COMSTACK stack, ODR in_odr ){
         sprintf(msg, "ODR code %d:%d element=%-20s",
                 err, x, element ? element : "<unknown>");
         yaz_log(YLOG_FATAL,"Error decoding incoming packet: %s",msg);
-        yaz_log(YLOG_DEBUG,"%02x %02x %02x %02x %02x %02x %02x %02x ...", 
+        yaz_log(YLOG_DEBUG,"%02x %02x %02x %02x %02x %02x %02x %02x ...",
                 buf_in[0], buf_in[1], buf_in[2], buf_in[3],
                 buf_in[4], buf_in[5], buf_in[6], buf_in[7]  );
         yaz_log(YLOG_DEBUG,"PDU Dump:");
@@ -573,7 +573,7 @@ void dumpapdu( ILL_APDU *apdu) {
 ILL_Status_Or_Error_Report *getstaterr( ILL_APDU *resp, ODR in_odr ) {
     if (resp->which != ILL_APDU_Status_Or_Error_Report ) {
         const char *element = odr_getelement(in_odr);
-        if (!element) 
+        if (!element)
             element="unknown";
         printf("Server returned wrong packet type: %d\n", resp->which);
         yaz_log(YLOG_FATAL,"Server returned a (%d) and "
@@ -586,9 +586,9 @@ ILL_Status_Or_Error_Report *getstaterr( ILL_APDU *resp, ODR in_odr ) {
 
 /** \brief  Return a printable string from an ILL_String */
 char *getillstring( ILL_String *s) {
-    if (s->which == ILL_String_GeneralString ) 
+    if (s->which == ILL_String_GeneralString )
         return s->u.GeneralString;
-    else if (s->which == ILL_String_EDIFACTString ) 
+    else if (s->which == ILL_String_EDIFACTString )
         return s->u.EDIFACTString;
     else {
         yaz_log(YLOG_FATAL,"Invalid ILL_String ");
@@ -611,15 +611,15 @@ void checkerr( ILL_Status_Or_Error_Report *staterr ) {
                     printf("Already forwarded: \n");
                     break;
                 case ILL_User_Error_Report_intermediary_problem:
-                    printf("Intermediary problem: " ODR_INT_PRINTF "\n", 
+                    printf("Intermediary problem: " ODR_INT_PRINTF "\n",
                         *uerr->u.intermediary_problem);
                     break;
                 case ILL_User_Error_Report_security_problem:
-                    printf("Security problem: %s\n", 
+                    printf("Security problem: %s\n",
                         getillstring(uerr->u.security_problem));
                     break;
                 case ILL_User_Error_Report_unable_to_perform:
-                    printf("Unable to perform: " ODR_INT_PRINTF "\n", 
+                    printf("Unable to perform: " ODR_INT_PRINTF "\n",
                           *uerr->u.unable_to_perform);
                     break;
                 default:
@@ -631,11 +631,11 @@ void checkerr( ILL_Status_Or_Error_Report *staterr ) {
             ILL_Provider_Error_Report *perr= err->provider_error_report;
             switch( perr->which ) {
                 case ILL_Provider_Error_Report_general_problem:
-                    printf("General Problem: " ODR_INT_PRINTF ":", 
+                    printf("General Problem: " ODR_INT_PRINTF ":",
                           *perr->u.general_problem);
                     break;
                 case ILL_Provider_Error_Report_transaction_id_problem:
-                    printf("Transaction Id Problem: " ODR_INT_PRINTF ":", 
+                    printf("Transaction Id Problem: " ODR_INT_PRINTF ":",
                           *perr->u.general_problem);
                     break;
                 case ILL_Provider_Error_Report_state_transition_prohibited:
@@ -643,11 +643,11 @@ void checkerr( ILL_Status_Or_Error_Report *staterr ) {
                     break;
             }
             /*exit(7);*/
-        } 
+        }
         /* fallbacks */
-        if ( staterr->note ) 
+        if ( staterr->note )
             printf("%s", getillstring(staterr->note));
-        else 
+        else
             printf("Unknown error type");
         printf("\n");
         exit(7);
@@ -658,7 +658,7 @@ void checkerr( ILL_Status_Or_Error_Report *staterr ) {
 
 /* * * * * * * * * * * * * * * */
 
-/** \brief Main program 
+/** \brief Main program
  *
  * Parse arguments
  * Validate arguments
@@ -683,11 +683,11 @@ int main (int argc, char * argv[]) {
     validateargs(&args);
     stack = connect_to(args.host);
     apdu = createrequest(&args, out_odr);
-    if (1) 
+    if (1)
         dumpapdu(apdu);
-    sendrequest(apdu, out_odr, stack ); 
+    sendrequest(apdu, out_odr, stack );
     resp = getresponse(stack, in_odr );
-    if (1) 
+    if (1)
         dumpapdu(resp);
     staterr=getstaterr(resp, in_odr);
     checkerr(staterr);
index c18d0a4..24df9d0 100644 (file)
@@ -72,15 +72,15 @@ int main (int argc, char **argv)
                 }
                 while ((c = getc(f)) != EOF)
                     wrbuf_putc(input_record, c);
-                
-                r = yaz_record_conv_record(p, 
+
+                r = yaz_record_conv_record(p,
                                            wrbuf_buf(input_record),
                                            wrbuf_len(input_record),
                                            output_record);
                 if (r)
                 {
                     fprintf(stderr, "%s: %s: Error %s\n",
-                            prog, arg, 
+                            prog, arg,
                             yaz_record_conv_get_error(p));
                     no_errors++;
                 }
index 795b17e..fbd5de4 100644 (file)
@@ -52,9 +52,9 @@ void pqftoxmlquery(const char *pqf)
     else
     {
        xmlDocPtr doc = 0;
-       
+
         yaz_rpnquery2xml(rpn, &doc);
-        
+
         if (!doc)
        {
            fprintf(stderr, "%s: yaz_rpnquery2xml failed for query %s\n",
@@ -84,7 +84,7 @@ void pqftoxmlquery(const char *pqf)
            }
             xmlFreeDoc(doc);
        }
-    }    
+    }
     odr_destroy(odr);
 }
 
@@ -162,7 +162,7 @@ void xmlfiletopqf(const char *xmlfile)
        fprintf(stderr, "%s: close failed for file %s\n", prog, xmlfile);
        exit(1);
     }
-    
+
     xmlquerytopqf(xmlstr);
     xfree(xmlstr);
 }
index b06cd8f..5bdd488 100644 (file)
@@ -78,7 +78,7 @@ void convert(FILE *inf, yaz_iconv_t cd, int verbose)
                 return ;
             }
             else if (e == YAZ_ICONV_EINVAL) /* incomplete input */
-            { 
+            {
                 size_t i;
                 for (i = 0; i<inbytesleft; i++)
                     inbuf0[i] = inbuf[i];
index 407501c..18a0618 100644 (file)
@@ -22,7 +22,7 @@ static char* zoom_events[ZOOM_EVENT_MAX+1];
 static int zoom_progress[ZOOM_EVENT_MAX+1];
 
 /* commando line parameters */
-static struct parameters_t { 
+static struct parameters_t {
     char host[1024];
     char query[1024];
     int progress[4096];
@@ -34,7 +34,7 @@ static struct parameters_t {
     int gnuplot;
 } parameters;
 
-struct  event_line_t 
+struct  event_line_t
 {
     int connection;
     long time_sec;
@@ -50,9 +50,9 @@ struct  event_line_t
 void print_event_line(struct event_line_t *pel)
 {
     printf ("%d\t%ld.%06ld\t%d\t%d\t%s\t%d\t%s\n",
-            pel->connection, pel->time_sec, pel->time_usec, 
+            pel->connection, pel->time_sec, pel->time_usec,
             pel->progress,
-            pel->event, pel->zoom_event, 
+            pel->event, pel->zoom_event,
             pel->error, pel->errmsg);
 }
 
@@ -87,7 +87,7 @@ void  update_events(int *elc, struct event_line_t *els,
     elc[ielc] += 1;
 }
 
-void  print_events(int *elc,  struct event_line_t *els, 
+void  print_events(int *elc,  struct event_line_t *els,
                    int connections){
     int i;
     int j;
@@ -153,10 +153,10 @@ void init_statics(void)
     for (i = 0; i < 4096; i++){
         parameters.progress[i] = 0;
     }
-    
+
 }
-struct time_type 
+
+struct time_type
 {
     struct timeval now;
     struct timeval then;
@@ -207,7 +207,7 @@ void print_option_error(void)
 }
 
 
-void read_params(int argc, char **argv, struct parameters_t *p_parameters){    
+void read_params(int argc, char **argv, struct parameters_t *p_parameters){
     char *arg;
     int ret;
     while ((ret = options("h:q:c:t:p:bgn:", argv, argc, &arg)) != -2)
@@ -247,7 +247,7 @@ void read_params(int argc, char **argv, struct parameters_t *p_parameters){
             print_option_error();
         }
     }
-    
+
     if(0){
         printf("zoom-benchmark\n");
         printf("   host:       %s \n", p_parameters->host);
@@ -324,7 +324,7 @@ int main(int argc, char **argv)
         ZOOM_options_set (o, "preferredRecordSyntax", "usmarc");
         ZOOM_options_set (o, "elementSetName", "F");
     }
-    
+
     time_init(&time);
     /* repeat loop */
     for (k = 0; k < parameters.repeat; k++){
@@ -341,7 +341,7 @@ int main(int argc, char **argv)
 
             /* create connection - pass options (they are the same for all) */
             z[i] = ZOOM_connection_create(o);
-            
+
             /* connect and init */
             ZOOM_connection_connect(z[i], parameters.host, 0);
         }
@@ -350,13 +350,13 @@ int main(int argc, char **argv)
             r[i] = ZOOM_connection_search_pqf (z[i], parameters.query);
 
         /* network I/O. pass number of connections and array of connections */
-        while ((i = ZOOM_event (parameters.concurrent, z))){ 
+        while ((i = ZOOM_event (parameters.concurrent, z))){
             int event = ZOOM_connection_last_event(z[i-1]);
             const char *errmsg;
             const char *addinfo;
             int error = 0;
             //int progress = zoom_progress[event];
-            
+
             if (event == ZOOM_EVENT_SEND_DATA || event == ZOOM_EVENT_RECV_DATA)
                 continue;
 
@@ -372,12 +372,12 @@ int main(int argc, char **argv)
             else
                 //parameters.progress[i] = zoom_progress[event];
                 parameters.progress[i] += 1;
-            
+
             update_events(elc, els,
-                          k, i-1, 
-                          time_sec(&time), time_usec(&time), 
+                          k, i-1,
+                          time_sec(&time), time_usec(&time),
                           parameters.progress[i],
-                          event, zoom_events[event], 
+                          event, zoom_events[event],
                           error, errmsg);
         }
 
@@ -409,10 +409,10 @@ int main(int argc, char **argv)
         printf("\n");
         printf("\n");
     }
-    
-    print_table_header();    
+
+    print_table_header();
     print_events(elc,  els, parameters.concurrent);
-    
+
     if (parameters.gnuplot){
         printf("end\n");
         printf("pause -1 \"Hit ENTER to return\"\n");
index fafc767..ca84cfb 100644 (file)
@@ -18,7 +18,7 @@ int main(int argc, char **argv)
     ZOOM_connection z;
     ZOOM_options o = ZOOM_options_create ();
     const char *errmsg, *addinfo;
-    
+
     if (argc != 4)
     {
         fprintf (stderr, "usage:\nzoom-ka sleepinterval target query\n");
@@ -35,7 +35,7 @@ int main(int argc, char **argv)
         ZOOM_resultset rset;
         ZOOM_connection_connect (z, argv[2], 0);
         rset = ZOOM_connection_search_pqf(z, argv[3]);
-        
+
         while ((i = ZOOM_event(1, &z)))
         {
             printf ("no = %d event = %d\n", i-1,
index c5019aa..fde447e 100644 (file)
@@ -17,7 +17,7 @@
 #include <yaz/options.h>
 
 #if HAVE_READLINE_READLINE_H
-#include <readline/readline.h> 
+#include <readline/readline.h>
 #endif
 #if HAVE_READLINE_HISTORY_H
 #include <readline/history.h>
@@ -175,7 +175,7 @@ static int cmd_rget(ZOOM_connection *c, ZOOM_resultset *r,
             const char *val;
             if (!r[i])
                 continue;
-            
+
             val = ZOOM_resultset_option_get(r[i], wrbuf_cstr(key));
             printf("%s = %s\n", wrbuf_cstr(key), val ? val : "<null>");
         }
@@ -223,14 +223,14 @@ static void display_records(ZOOM_connection c,
         size_t pos = i + start;
         ZOOM_record rec = ZOOM_resultset_record(r, pos);
         const char *db = ZOOM_record_get(rec, "database", 0);
-        
+
         if (ZOOM_record_error(rec, 0, 0, 0))
         {
             const char *msg;
             const char *addinfo;
             const char *diagset;
             int error = ZOOM_record_error(rec, &msg, &addinfo, &diagset);
-            
+
             printf("%lld %s: %s (%s:%d) %s\n", (long long) pos,
                    (db ? db : "unknown"),
                    msg, diagset, error, addinfo ? addinfo : "none");
@@ -409,7 +409,7 @@ static int cmd_ext(ZOOM_connection *c, ZOOM_resultset *r,
     int i;
     int ret = 0;
     WRBUF ext_type_str = next_token_new_wrbuf(args);
-    
+
     if (!ext_type_str)
     {
         printf("es: missing type "
@@ -477,7 +477,7 @@ static int cmd_search(ZOOM_connection *c, ZOOM_resultset *r,
     const char *query_str = *args;
     int i;
     int ret = 0;
-    
+
     s = ZOOM_query_create();
     while (*query_str == ' ')
         query_str++;
@@ -529,7 +529,7 @@ static int cmd_search(ZOOM_connection *c, ZOOM_resultset *r,
 
             printf("%s: %lld hits\n", ZOOM_connection_option_get(c[i], "host"),
                    (long long int) ZOOM_resultset_size(r[i]));
-            
+
             facet_num = ZOOM_resultset_facets_size(r[i]);
             if (facet_num)
             {
@@ -566,7 +566,7 @@ static int cmd_scan(ZOOM_connection *c, ZOOM_resultset *r,
     int i;
     int ret = 0;
     ZOOM_scanset s[MAX_CON];
-    
+
     while (*query_str == ' ')
         query_str++;
 
@@ -616,7 +616,7 @@ static int cmd_scan(ZOOM_connection *c, ZOOM_resultset *r,
                 const char *term = ZOOM_scanset_display_term(s[i], p,
                                                              &occ, &len);
                 printf("%.*s %lld\n", (int) len, term, (long long int) occ);
-            }            
+            }
             ZOOM_scanset_destroy(s[i]);
         }
     }
@@ -630,10 +630,10 @@ static int cmd_sort(ZOOM_connection *c, ZOOM_resultset *r,
     const char *sort_spec = *args;
     int i;
     int ret = 0;
-    
+
     while (*sort_spec == ' ')
         sort_spec++;
-    
+
     for (i = 0; i<MAX_CON; i++)
     {
         if (r[i])
@@ -721,7 +721,7 @@ static int cmd_connect(ZOOM_connection *c, ZOOM_resultset *r,
     }
     c[i] = ZOOM_connection_create(options);
     ZOOM_connection_connect(c[i], wrbuf_cstr(host), 0);
-        
+
     if ((error = ZOOM_connection_error_x(c[i], &errmsg, &addinfo, &dset)))
     {
         printf("%s error: %s (%s:%d) %s\n",
@@ -743,7 +743,7 @@ static int cmd_connect(ZOOM_connection *c, ZOOM_resultset *r,
     \retval -1 EOF (no more commands or quit seen)
 */
 static int cmd_parse(ZOOM_connection *c, ZOOM_resultset *r,
-                     ZOOM_options options, 
+                     ZOOM_options options,
                      const char **buf)
 {
     int cmd_len;
@@ -826,14 +826,14 @@ static int shell(ZOOM_connection *c, ZOOM_resultset *r,
         }
         strcpy(buf,line_in);
         free(line_in);
-#else    
+#else
         printf("ZOOM>"); fflush(stdout);
         if (!fgets(buf, sizeof(buf)-1, stdin))
         {
             res = -1;
             break;
         }
-#endif 
+#endif
         if ((cp = strchr(buf, '\n')))
             *cp = '\0';
         res = cmd_parse(c, r, options, &bp);
index cadfe97..8369f63 100644 (file)
@@ -22,7 +22,7 @@ int main(int argc, char **argv)
         exit (1);
     }
     z = ZOOM_connection_new (argv[1], 0);
-    
+
     if ((error = ZOOM_connection_error(z, &errmsg, &addinfo)))
     {
         fprintf (stderr, "Error: %s (%d) %s\n", errmsg, error, addinfo);
index eb4a133..ddf957b 100644 (file)
@@ -25,7 +25,7 @@ int main(int argc, char **argv)
         exit (1);
     }
 
-    if (ZOOM_query_ccl2rpn(q, argv[2], 
+    if (ZOOM_query_ccl2rpn(q, argv[2],
                            "term t=l,r s=al\n" "ti u=4 s=pw\n",
                            &ccl_error_code, &ccl_error_string, &ccl_error_pos))
     {
@@ -37,13 +37,13 @@ int main(int argc, char **argv)
     else
     {
         z = ZOOM_connection_new (argv[1], 0);
-        
+
         if ((error = ZOOM_connection_error(z, &errmsg, &addinfo)))
         {
             fprintf (stderr, "Error: %s (%d) %s\n", errmsg, error, addinfo);
             exit (2);
         }
-        
+
         r = ZOOM_connection_search (z, q);
         ZOOM_query_destroy(q);
         if ((error = ZOOM_connection_error(z, &errmsg, &addinfo)))
index 658b2cf..00a5c41 100644 (file)
@@ -90,7 +90,7 @@ int main(int argc, char **argv)
         if (idle)
         {
             ZOOM_connection_connect(z, 0, 0); /* allow reconnect */
-            
+
             if (++use <= 10)
             {
                 probe_search(z, use, use&1);
index 4bba2b8..90ddaf7 100644 (file)
@@ -50,7 +50,7 @@ int main(int argc, char **argv)
         exit (2);
     }
     else /* OK print hit count */
-        printf ("Result count: %ld\n", (long) ZOOM_resultset_size(r));  
+        printf ("Result count: %ld\n", (long) ZOOM_resultset_size(r));
     ZOOM_resultset_destroy (r);
     ZOOM_connection_destroy (z);
     exit (0);
index 5ac8ef5..461b8b8 100644 (file)
@@ -73,7 +73,7 @@ int main(int argc, char **argv)
                event,
                ZOOM_get_event_str(event));
     }
-    
+
     /* no more to be done. Inspect results */
     for (i = 0; i<no; i++)
     {
index eb6602d..23943f8 100644 (file)
@@ -45,7 +45,7 @@ int main(int argc, char **argv)
 
     /* set proxy */
     ZOOM_options_set (o, "proxy", argv[1]);
-    
+
     /* create query */
     q = ZOOM_query_create ();
     if (ZOOM_query_prefix (q, argv[argc-1]))
index ca33b7d..69559b6 100644 (file)
@@ -109,7 +109,7 @@ int main(int argc, char **argv)
                 /* if rec is non-null, we got a record for display */
                 if (str)
                 {
-                    printf("%d %s %s\n", pos+1, syntax, 
+                    printf("%d %s %s\n", pos+1, syntax,
                            (db ? db : "unknown"));
                     if (rec)
                     {
index 85123b8..077218e 100644 (file)
@@ -28,7 +28,7 @@ int main(int argc, char **argv)
         printf ("error - couldn't connect?\n");
         exit (1);
     }
-        
+
     ZOOM_connection_destroy (z);
 
     for (block = 0; block < 3; block++)
@@ -55,15 +55,15 @@ int main(int argc, char **argv)
             sprintf (host, "localhost:9999/%d", i);
             z = ZOOM_connection_create (o);
             ZOOM_connection_connect (z, host, 0);
-            
+
             for (j = 0; j < 10; j++)
             {
                 ZOOM_record recs[2];
                 char query[40];
                 ZOOM_query s = ZOOM_query_create ();
-                
+
                 sprintf (query, "i%dr%d", i, j);
-                
+
                 if (ZOOM_query_prefix (s, query))
                 {
                     printf ("bad PQF: %s\n", query);
@@ -71,11 +71,11 @@ int main(int argc, char **argv)
                 }
                 ZOOM_options_set (o, "start", "0");
                 ZOOM_options_set (o, "count", "0");
-                
+
                 r[j] = ZOOM_connection_search (z, s); /* non-piggy */
-                
+
                 ZOOM_resultset_records (r[j], recs, 0, 2);  /* first two */
-                
+
                 ZOOM_resultset_records (r[j], recs, 1, 2);  /* third */
 
                 ZOOM_resultset_records (r[j], recs, 0, 0);  /* ignored */
@@ -88,7 +88,7 @@ int main(int argc, char **argv)
                         exit (1);
                     }
                 }
-                
+
                 ZOOM_query_destroy (s);
 
                 printf (".");
@@ -114,15 +114,15 @@ int main(int argc, char **argv)
             sprintf (host, "localhost:9999/%d", i);
             z = ZOOM_connection_create (o);
             ZOOM_connection_connect (z, host, 0);
-            
+
             for (j = 0; j < 10; j++)
             {
                 char query[40];
-                
+
                 sprintf (query, "i%dr%d", i, j);
-                
+
                 ZOOM_options_set (o, "count", "0");
-                
+
                 r[j] = ZOOM_connection_search_pqf (z, query);
 
                 printf (".");
@@ -132,7 +132,7 @@ int main(int argc, char **argv)
             }
 
             ZOOM_connection_destroy (z);
-            
+
             for (j = 0; j < 10; j++)
             {
                 ZOOM_resultset_records (r[j], 0, 0, 1);
@@ -167,7 +167,7 @@ int main(int argc, char **argv)
                 term = ZOOM_scanset_term (scan, j, &occur, &len);
                 if (term)
                     printf ("%d %.*s %d\n", j, (int) len, term, (int) occur);
-                
+
             }
             ZOOM_scanset_destroy (scan);
             ZOOM_connection_destroy (z);
index 9f29bf1..cc2754c 100644 (file)
@@ -38,7 +38,7 @@ int main(int argc, char **argv)
 
         /* connect and init */
         ZOOM_connection_connect (z[i], argv[1+i], 0);
-        
+
     }
     /* scan all */
     for (i = 0; i<no; i++)
index 0f6aa5a..b3bb17f 100644 (file)
@@ -32,15 +32,15 @@ int main(int argc, char **argv)
     ZOOM_options o = ZOOM_options_create ();
     int error;
     const char *errmsg, *addinfo;
-    
+
     if (argc < 3)
         usage();
 
     z = ZOOM_connection_create (o);
-    
+
     /* connect and init */
     ZOOM_connection_connect (z, argv[1], 0);
-    
+
     if ((error = ZOOM_connection_error(z, &errmsg, &addinfo)))
     {
         fprintf(stderr, "%s error: %s (%d) %s\n",
index beb1229..f16bf49 100644 (file)
@@ -31,11 +31,11 @@ Z_OPACRecord *dummy_opac(int num, ODR odr, const char *marc_input)
             odr_malloc(odr, sizeof(*hr));
         Z_HoldingsAndCircData *hc = (Z_HoldingsAndCircData *)
             odr_malloc(odr, sizeof(*hc));
-        
+
         rec->holdingsData[i] = hr;
         hr->which = Z_HoldingsRecord_holdingsAndCirc;
         hr->u.holdingsAndCirc = hc;
-            
+
         hc->typeOfRecord = "u";
 
         hc->encodingLevel = "u";
@@ -46,7 +46,7 @@ Z_OPACRecord *dummy_opac(int num, ODR odr, const char *marc_input)
         hc->completeness = 0; /* OPT */
         hc->dateOfReport = "000000";
         hc->nucCode = "s-FM/GC";
-        hc->localLocation = 
+        hc->localLocation =
             "Main or Science/Business Reading Rms - STORED OFFSITE";
         hc->shelvingLocation = 0; /* OPT */
         hc->callNumber = "MLCM 89/00602 (N)";
index c2b3abd..024a8f7 100644 (file)
@@ -87,10 +87,10 @@ static void remove_sets(struct session_handle *sh)
     sh->result_sets = 0;
 }
 
-/** \brief use term value as hit count 
+/** \brief use term value as hit count
     \param s RPN structure
     \return >= 0: search term number or -1: not found
-   
+
     Traverse RPN tree 'in order' and use term value as hit count.
     Only terms  that looks a numeric is used.. Returns -1 if
     no sub tree has a hit count term
@@ -129,7 +129,7 @@ static Odr_int get_term_hit(Z_RPNStructure *s)
 /** \brief gets hit count for numeric terms in RPN queries
     \param q RPN Query
     \return number of hits (random or number for term)
-    
+
     This is just for testing.. A real database of course uses
     the content of a database to establish a value.. In our case, we
     have a way to trigger a certain hit count. Good for testing of
@@ -242,7 +242,7 @@ static void addterms(ODR odr, Z_FacetField *facet_field, const char *facet_name)
         Z_FacetTerm *facet_term;
         sprintf(key, "%s%d", facet_name, index);
         yaz_log(YLOG_DEBUG, "facet add term %s %d %s", facet_name, index, key);
-        
+
         facet_term = facet_term_create_cstr(odr, key, freq);
         freq = freq - 10 ;
         facet_field_term_set(odr, facet_field, facet_term, index);
@@ -303,7 +303,7 @@ int ztest_search(void *handle, bend_search_rr *rr)
         rr->errcode = YAZ_BIB1_COMBI_OF_SPECIFIED_DATABASES_UNSUPP;
         return 0;
     }
-    
+
     db = rr->basenames[0];
 
     /* Allow Default, db.* and Slow */
@@ -322,7 +322,7 @@ int ztest_search(void *handle, bend_search_rr *rr)
         return 0;
     }
 
-    new_set = get_set(sh, rr->setname);    
+    new_set = get_set(sh, rr->setname);
     if (new_set)
     {
         if (!rr->replace_set)
@@ -410,7 +410,7 @@ int ztest_search(void *handle, bend_search_rr *rr)
     }
     do_delay(&new_set->search_delay);
     new_set->hits = rr->hits;
-    
+
     return 0;
 }
 
@@ -439,7 +439,7 @@ int ztest_esrequest(void *handle, bend_esrequest_rr *rr)
             Z_IOOriginPartToKeep *k = ir->toKeep;
             Z_IOOriginPartNotToKeep *n = ir->notToKeep;
             const char *xml_in_response = 0;
-            
+
             if (k && k->contact)
             {
                 if (k->contact->name)
@@ -453,7 +453,7 @@ int ztest_esrequest(void *handle, bend_esrequest_rr *rr)
             {
                 yaz_log(log_level, "Billing info (not shown)");
             }
-            
+
             if (n->resultSetItem)
             {
                 yaz_log(log_level, "resultsetItem");
@@ -469,7 +469,7 @@ int ztest_esrequest(void *handle, bend_esrequest_rr *rr)
                 {
                     char oid_name_str[OID_STR_MAX];
                     oid_class oclass;
-                    const char *oid_name = 
+                    const char *oid_name =
                         yaz_oid_to_string_buf(r->direct_reference,
                                               &oclass, oid_name_str);
                     if (oid_name)
@@ -480,10 +480,10 @@ int ztest_esrequest(void *handle, bend_esrequest_rr *rr)
                         if (r->which == Z_External_octet)
                             yaz_log(log_level, "%.*s",
                                     r->u.octet_aligned->len,
-                                    r->u.octet_aligned->buf); 
+                                    r->u.octet_aligned->buf);
                         xml_in_response = "<dummy>x</dummy>";
                     }
-                    if (!oid_oidcmp(r->direct_reference, 
+                    if (!oid_oidcmp(r->direct_reference,
                                     yaz_oid_general_isoill_1))
                     {
                         yaz_log(log_level, "Decode ItemRequest begin");
@@ -492,7 +492,7 @@ int ztest_esrequest(void *handle, bend_esrequest_rr *rr)
                             odr_setbuf(rr->decode,
                                        (char *) r->u.single_ASN1_type->buf,
                                        r->u.single_ASN1_type->len, 0);
-                            
+
                             if (!ill_ItemRequest(rr->decode, &item_req, 0, 0))
                             {
                                 yaz_log(log_level,
@@ -515,7 +515,7 @@ int ztest_esrequest(void *handle, bend_esrequest_rr *rr)
                             odr_setbuf(rr->decode,
                                        (char*) r->u.single_ASN1_type->buf,
                                        r->u.single_ASN1_type->len, 0);
-                            
+
                             if (!ill_APDU(rr->decode, &ill_apdu, 0, 0))
                             {
                                 yaz_log(log_level,
@@ -595,7 +595,7 @@ int ztest_esrequest(void *handle, bend_esrequest_rr *rr)
                                          strlen(xml_in_response));
                 else
                     targetPart->itemRequest = 0;
-                    
+
                 targetPart->statusOrErrorReport = 0;
                 targetPart->auxiliaryStatus = 0;
             }
@@ -610,7 +610,7 @@ int ztest_esrequest(void *handle, bend_esrequest_rr *rr)
             Z_IUUpdateEsRequest *esRequest = up->u.esRequest;
             Z_IUOriginPartToKeep *toKeep = esRequest->toKeep;
             Z_IUSuppliedRecords *notToKeep = esRequest->notToKeep;
-            
+
             yaz_log(log_level, "action");
             if (toKeep->action)
             {
@@ -701,7 +701,7 @@ int ztest_esrequest(void *handle, bend_esrequest_rr *rr)
                 targetPart->num_globalDiagnostics = 0;
                 targetPart->globalDiagnostics = (Z_DiagRec **) odr_nullval();
                 targetPart->num_taskPackageRecords = 1;
-                targetPart->taskPackageRecords = 
+                targetPart->taskPackageRecords =
                     (Z_IUTaskPackageRecordStructure **)
                     odr_malloc(rr->stream,
                                sizeof(Z_IUTaskPackageRecordStructure *));
@@ -709,15 +709,15 @@ int ztest_esrequest(void *handle, bend_esrequest_rr *rr)
                     (Z_IUTaskPackageRecordStructure *)
                     odr_malloc(rr->stream,
                                sizeof(Z_IUTaskPackageRecordStructure));
-                
+
                 targetPart->taskPackageRecords[0]->which =
                     Z_IUTaskPackageRecordStructure_record;
-                targetPart->taskPackageRecords[0]->u.record = 
+                targetPart->taskPackageRecords[0]->u.record =
                     z_ext_record_sutrs(rr->stream, "test", 4);
-                targetPart->taskPackageRecords[0]->correlationInfo = 0; 
+                targetPart->taskPackageRecords[0]->correlationInfo = 0;
                 targetPart->taskPackageRecords[0]->recordStatus =
                     odr_intdup(rr->stream,
-                               Z_IUTaskPackageRecordStructure_success);  
+                               Z_IUTaskPackageRecordStructure_success);
                 targetPart->taskPackageRecords[0]->num_supplementalDiagnostics
                     = 0;
 
@@ -733,7 +733,7 @@ int ztest_esrequest(void *handle, bend_esrequest_rr *rr)
                     if (rec->direct_reference)
                     {
                         char oid_name_str[OID_STR_MAX];
-                        const char *oid_name 
+                        const char *oid_name
                             = oid_name = yaz_oid_to_string_buf(
                                 rec->direct_reference, 0,
                                 oid_name_str);
@@ -793,7 +793,7 @@ int ztest_sort(void *handle, bend_sort_rr *rr)
 int ztest_present(void *handle, bend_present_rr *rr)
 {
     struct session_handle *sh = (struct session_handle*) handle;
-    struct result_set *set = get_set(sh, rr->setname);    
+    struct result_set *set = get_set(sh, rr->setname);
 
     if (!set)
     {
@@ -811,7 +811,7 @@ int ztest_fetch(void *handle, bend_fetch_rr *r)
     struct session_handle *sh = (struct session_handle*) handle;
     char *cp;
     const Odr_oid *oid = r->request_format;
-    struct result_set *set = get_set(sh, r->setname);    
+    struct result_set *set = get_set(sh, r->setname);
 
     if (!set)
     {
@@ -861,7 +861,7 @@ int ztest_fetch(void *handle, bend_fetch_rr *r)
     {
         /* this section returns a small record */
         char buf[100];
-        
+
         sprintf(buf, "This is dummy SUTRS record number %d\n", r->number);
 
         r->len = strlen(buf);
@@ -917,7 +917,7 @@ int ztest_fetch(void *handle, bend_fetch_rr *r)
             r->len = strlen(cp);
             r->record = cp;
         }
-        else 
+        else
         {
             r->errcode = YAZ_BIB1_SYSTEM_ERROR_IN_PRESENTING_RECORDS;
             r->surrogate_flag = 1;