Update to use Odr_int
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 1 Dec 2009 20:42:00 +0000 (21:42 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 1 Dec 2009 20:42:00 +0000 (21:42 +0100)
include/yazpp/ir-assoc.h
include/yazpp/z-server.h
src/yaz-ir-assoc.cpp
src/yaz-my-client.cpp
src/yaz-z-server-sr.cpp
src/yaz-z-server.cpp

index 4da019b..84a3e36 100644 (file)
@@ -77,7 +77,7 @@ class YAZ_EXPORT IR_Assoc: public Z_Assoc {
     /// Send Services
     int send_initRequest(char* pRefId=NULL);
     int send_searchRequest(Yaz_Z_Query *query, char* pResultSetId = NULL, char* pRefId = NULL);
-    int send_presentRequest(int start, int number, char* pResultSetId = NULL, char* pRefId = NULL);
+    int send_presentRequest(Odr_int start, Odr_int number, char* pResultSetId = NULL, char* pRefId = NULL);
     int send_deleteResultSetRequest(char* pResultSetId = 0, char* pRefId = 0);
     
     /// Recv Services
index 33d935f..755052d 100644 (file)
@@ -117,7 +117,7 @@ class YAZ_EXPORT Yaz_Facility_Retrieval : public IServer_Facility,
                              const char *resultSetName,
                              int start, int num,
                              Z_RecordComposition *comp,
-                             int *next, int *pres,
+                             Odr_int *next, Odr_int *pres,
                              Odr_oid *oid);
 
     void fetch_via_piggyback (Z_Server *s,
index d5854d1..ad35d00 100644 (file)
@@ -221,10 +221,10 @@ int IR_Assoc::send_searchRequest(Yaz_Z_Query *query,
     return send_Z_PDU(apdu, 0);
 }
 
-int IR_Assoc::send_presentRequest(int start, 
-                                      int number, 
-                                      char* pResultSetId,
-                                      char* pRefId)
+int IR_Assoc::send_presentRequest(Odr_int start, 
+                                  Odr_int number, 
+                                  char* pResultSetId,
+                                  char* pRefId)
 {
     Z_APDU *apdu = create_Z_PDU(Z_APDU_presentRequest);
     Z_PresentRequest *req = apdu->u.presentRequest;
index 90504e2..33186ac 100644 (file)
@@ -153,7 +153,7 @@ void MyClient::recv_diagrecs(Z_DiagRec **pp, int num)
         }
         else
             r = p->u.defaultFormat;
-             printf("    [%d] %s", *r->condition, diagbib1_str(*r->condition));
+             printf("    [" ODR_INT_PRINTF "] %s", *r->condition, diagbib1_str(*r->condition));
         switch (r->which)
         {
         case Z_DefaultDiagFormat_v2Addinfo:
@@ -277,7 +277,7 @@ void MyClient::recv_searchResponse(Z_SearchResponse *searchResponse)
     else
     {
         printf ("Ok\n");
-        printf ("Hits: %d\n", *searchResponse->resultCount);
+        printf ("Hits: " ODR_INT_PRINTF "\n", *searchResponse->resultCount);
     }
     recv_records (searchResponse->records);
 }
index ed8c6c2..f77e749 100644 (file)
@@ -12,7 +12,7 @@ Z_Records *Yaz_Facility_Retrieval::pack_records (Z_Server *s,
                                                  const char *resultSetName,
                                                  int start, int xnum,
                                                  Z_RecordComposition *comp,
-                                                 int *next, int *pres,
+                                                 Odr_int *next, Odr_int *pres,
                                                  Odr_oid *format)
 {
     int recno, total_length = 0, toget = xnum, dumped_records = 0;
@@ -114,7 +114,7 @@ void Yaz_Facility_Retrieval::fetch_via_piggyback (Z_Server *s,
     Z_RecordComposition comp, *compp = 0;
     int hits = *res->resultCount;
     
-    int *nulint = (int *)odr_malloc (odr_encode(), sizeof(*nulint));
+    Odr_int *nulint = (Odr_int *)odr_malloc (odr_encode(), sizeof(*nulint));
     *nulint = 0;
     
     comp.which = Z_RecordComp_simple;
@@ -136,7 +136,8 @@ void Yaz_Facility_Retrieval::fetch_via_piggyback (Z_Server *s,
     
     if (toget && !res->records)
     {
-        res->presentStatus = (int *) odr_malloc (odr_encode(), sizeof(int));
+        res->presentStatus = (Odr_int *)
+            odr_malloc (odr_encode(), sizeof(Odr_int));
         *res->presentStatus = Z_PRES_SUCCESS;
         res->records =
             pack_records(s, req->resultSetName, 1, toget, compp, 
index ffa9d26..6f077c4 100644 (file)
@@ -128,7 +128,7 @@ void Z_ServerUtility::create_surrogateDiagnostics(
     ODR odr, Z_NamePlusRecord *rec, const char *dbname,
     int error, char *const addinfo)
 {
-    int *err = (int *)odr_malloc (odr, sizeof(*err));
+    Odr_int *err = (Odr_int *)odr_malloc (odr, sizeof(*err));
     Z_DiagRec *drec = (Z_DiagRec *)odr_malloc (odr, sizeof(*drec));
     Z_DefaultDiagFormat *dr = (Z_DefaultDiagFormat *)
         odr_malloc (odr, sizeof(*dr));
@@ -152,7 +152,7 @@ Z_Records *Z_ServerUtility::create_nonSurrogateDiagnostics (
 {
     Z_Records *rec = (Z_Records *)
         odr_malloc (odr, sizeof(*rec));
-    int *err = (int *)
+    Odr_int *err = (Odr_int *)
         odr_malloc (odr, sizeof(*err));
     Z_DiagRec *drec = (Z_DiagRec *)
         odr_malloc (odr, sizeof(*drec));