Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/idzebra
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 22 Jan 2010 13:39:34 +0000 (14:39 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 22 Jan 2010 13:39:34 +0000 (14:39 +0100)
data1/d1_expout.c
index/rpnsearch.c
index/zebrasrv.c
util/zebramap.c
version-change.txt

index b740444..ce0a5e3 100644 (file)
@@ -68,18 +68,15 @@ static int is_data_tag (ExpHandle *eh, data1_node *c)
     return 1;
 }
 
-static int *f_integer(ExpHandle *eh, data1_node *c)
+static Odr_int *f_integer(ExpHandle *eh, data1_node *c)
 {
-    int *r;
     char intbuf[64];
 
     c = c->child;
-    if (!is_data_tag (eh, c) || c->u.data.len > 63)
+    if (!is_data_tag (eh, c) || c->u.data.len >= sizeof(intbuf))
        return 0;
-    r = (int *)odr_malloc(eh->o, sizeof(*r));
     sprintf(intbuf, "%.*s", c->u.data.len, c->u.data.data);
-    *r = atoi(intbuf);
-    return r;
+    return odr_intdup(eh->o, atoi(intbuf));
 }
 
 static char *f_string(ExpHandle *eh, data1_node *c)
@@ -251,7 +248,7 @@ Z_RpnCapabilities *f_rpnCapabilities (ExpHandle *eh, data1_node *n)
                (res->num_operators)++;
            }
            if (res->num_operators)
-               res->operators = (int **)
+               res->operators = (Odr_int **)
                    odr_malloc (eh->o, res->num_operators
                                * sizeof(*res->operators));
            for (n = c->child; n; n = n->next)
@@ -388,9 +385,8 @@ static Z_AccessInfo *f_accessInfo(ExpHandle *eh, data1_node *n)
     return res;
 }
 
-static int *f_recordCount(ExpHandle *eh, data1_node *c, int *which)
+static Odr_int *f_recordCount(ExpHandle *eh, data1_node *c, int *which)
 {
-    int *r= (int *)odr_malloc(eh->o, sizeof(*r));
     int *wp = which;
     char intbuf[64];
 
@@ -403,11 +399,11 @@ static int *f_recordCount(ExpHandle *eh, data1_node *c, int *which)
        *wp = Z_DatabaseInfo_approxNumber;
     else
        return 0;
-    if (!c->child || c->child->which != DATA1N_data)
+    if (!c->child || c->child->which != DATA1N_data || 
+        c->child->u.data.len >= sizeof(intbuf))
        return 0;
     sprintf(intbuf, "%.*s", c->child->u.data.len, c->child->u.data.data);
-    *r = atoi(intbuf);
-    return r;
+    return odr_intdup(eh->o, atoi(intbuf));
 }
 
 static Z_ContactInfo *f_contactInfo(ExpHandle *eh, data1_node *n)
index 69a7e9a..543f61c 100644 (file)
@@ -1977,7 +1977,7 @@ static ZEBRA_RES rpn_sort_spec(ZebraHandle zh, Z_AttributesPlusTerm *zapt,
     sk->u.sortAttributes->id = odr_oiddup_nmem(stream, attributeSet);
     sk->u.sortAttributes->list = zapt->attributes;
 
-    sks->sortRelation = (int *)
+    sks->sortRelation = (Odr_int *)
         nmem_malloc(stream, sizeof(*sks->sortRelation));
     if (sort_relation_value == 1)
         *sks->sortRelation = Z_SortKeySpec_ascending;
@@ -1986,7 +1986,7 @@ static ZEBRA_RES rpn_sort_spec(ZebraHandle zh, Z_AttributesPlusTerm *zapt,
     else 
         *sks->sortRelation = Z_SortKeySpec_ascending;
 
-    sks->caseSensitivity = (int *)
+    sks->caseSensitivity = (Odr_int *)
         nmem_malloc(stream, sizeof(*sks->caseSensitivity));
     *sks->caseSensitivity = 0;
 
index 8de6803..8e9a3f0 100644 (file)
@@ -224,7 +224,7 @@ static void search_terms(ZebraHandle zh, bend_search_rr *r)
         se->subqueryId = term_ref_id ? 
            odr_strdup(r->stream, term_ref_id) : 0;
            
-        se->fullQuery = odr_intdup(r->stream, 0);
+        se->fullQuery = odr_booldup(r->stream, 0);
         se->subqueryExpression = 
             odr_malloc(r->stream, sizeof(Z_QueryExpression));
         se->subqueryExpression->which = 
@@ -516,10 +516,10 @@ int bend_esrequest(void *handle, bend_esrequest_rr *rr)
 {
     ZebraHandle zh = (ZebraHandle) handle;
     
-    yaz_log(YLOG_LOG, "function: %d", *rr->esr->function);
+    yaz_log(YLOG_LOG, "function: " ODR_INT_PRINTF, *rr->esr->function);
     if (rr->esr->packageName)
        yaz_log(YLOG_LOG, "packagename: %s", rr->esr->packageName);
-    yaz_log(YLOG_LOG, "Waitaction: %d", *rr->esr->waitAction);
+    yaz_log(YLOG_LOG, "Waitaction: " ODR_INT_PRINTF, *rr->esr->waitAction);
 
     if (!rr->esr->taskSpecificParameters)
     {
@@ -566,7 +566,8 @@ int bend_esrequest(void *handle, bend_esrequest_rr *rr)
                    yaz_log(YLOG_LOG, "start");
                    break;
                default:
-                   yaz_log(YLOG_LOG, " unknown (%d)", *toKeep->action);
+                   yaz_log(YLOG_LOG, " unknown (" ODR_INT_PRINTF ")",
+                            *toKeep->action);
                }
            }
            if (toKeep->databaseName)
index 8af0c93..a1b9a79 100644 (file)
@@ -698,6 +698,9 @@ int zebra_map_tokenize_next(zebra_map_t zm,
 int zebra_map_tokenize_start(zebra_map_t zm,
                              const char *buf, size_t len)
 {
+#if YAZ_HAVE_ICU
+    int ret;
+#endif
     assert(zm->use_chain);
 
     wrbuf_rewind(zm->input_str);
@@ -716,10 +719,9 @@ int zebra_map_tokenize_start(zebra_map_t zm,
             yaz_log(YLOG_LOG, "input %s", 
                     wrbuf_cstr(zm->print_str)); 
         }
-        icu_chain_assign_cstr(zm->icu_chain,
-                              wrbuf_cstr(zm->input_str),
-                              &status);
-        if (!U_SUCCESS(status))
+        ret = icu_chain_assign_cstr(zm->icu_chain,
+                                    wrbuf_cstr(zm->input_str), &status);
+        if (!ret && !U_SUCCESS(status))
         {
             if (zm->debug)
             {
index 3421f09..b8d7b8d 100644 (file)
@@ -3,10 +3,6 @@ Things to change for version update
 configure.ac:  AC_INIT, PACKAGE_SUFFIX, ZEBRALIBS_VERSION_INFO
          AC_OUTPUT (idzebra-config-2.0 - 5 places!)
  
-include/idzebra/version.h
 debian/changelog + debian/rules
 
-win/zebra.nsi
-
 idzebra.spec.in