Added printing stream (ODR) for backend functions.
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 12 Jan 2000 14:36:07 +0000 (14:36 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 12 Jan 2000 14:36:07 +0000 (14:36 +0000)
include/yaz/backend.h
server/seshigh.c
ztest/ztest.c

index fa1988f..b3b3078 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995-1999, Index Data.
+ * Copyright (c) 1995-2000, Index Data.
  *
  * Permission to use, copy, modify, distribute, and sell this software and
  * its documentation, in whole or in part, for any purpose, is hereby granted,
  * OF THIS SOFTWARE.
  *
  * $Log: backend.h,v $
- * Revision 1.2  1999-12-16 23:36:19  adam
+ * Revision 1.3  2000-01-12 14:36:07  adam
+ * Added printing stream (ODR) for backend functions.
+ *
+ * Revision 1.2  1999/12/16 23:36:19  adam
  * Implemented ILL protocol. Minor updates ASN.1 compiler.
  *
  * Revision 1.1  1999/11/30 13:47:11  adam
@@ -99,6 +102,7 @@ typedef struct
     Z_Query *query;            /* query structure */
     ODR stream;                /* encoding stream */
     ODR decode;                /* decoding stream */
+    ODR print;                 /* printing stream */
 } bend_searchrequest;
 
 /* old search request output */
@@ -119,6 +123,7 @@ typedef struct {
     Z_Query *query;            /* query structure */
     ODR stream;                /* encode stream */
     ODR decode;                /* decode stream */
+    ODR print;                 /* print stream */
 
     bend_request request;
     bend_association association;
@@ -137,6 +142,7 @@ typedef struct {
     Z_ReferenceId *referenceId;/* reference ID */
     Z_RecordComposition *comp; /* Formatting instructions */
     ODR stream;                /* encoding stream - memory source if required */
+    ODR print;                 /* printing stream */
     bend_request request;
     bend_association association;
 
@@ -157,6 +163,7 @@ typedef struct
     oid_value format;          /* One of the CLASS_RECSYN members */
     Z_RecordComposition *comp; /* Formatting instructions */
     ODR stream;                /* encoding stream - memory source if req */
+    ODR print;                 /* printing stream */
     int surrogate_flag;        /* surrogate diagnostic flag (rw) */
 } bend_fetchrequest;
 
@@ -185,6 +192,7 @@ typedef struct
     int term_position;  /* desired index of term in result list */
     int num_entries;    /* number of entries requested */
     ODR stream;         /* encoding stream - memory source if required */
+    ODR print;          /* printing stream */
 } bend_scanrequest;
 
 struct scan_entry {
@@ -216,6 +224,7 @@ typedef struct bend_scan_rr {
     Z_ReferenceId *referenceId; /* reference ID */
     Z_AttributesPlusTerm *term;
     ODR stream;         /* encoding stream - memory source if required */
+    ODR print;          /* printing stream */
 
     int term_position;  /* desired index of term in result list/returned */
     int num_entries;    /* number of entries requested/returned */
@@ -239,6 +248,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; 
 } bend_delete_rr;
 
 /* close handler */
@@ -252,6 +262,7 @@ typedef struct bend_sort_rr
     char *output_setname;
     Z_SortKeySpecList *sort_sequence;
     ODR stream;
+    ODR print;
     Z_ReferenceId *referenceId;/* reference ID */
 
     int sort_status;
@@ -266,6 +277,7 @@ typedef struct bend_esrequest_rr
     
     ODR stream;                /* encoding stream */
     ODR decode;                /* decoding stream */
+    ODR print;                 /* printing stream */
     Z_ReferenceId *referenceId;/* reference ID */
     bend_request request;
     bend_association association;
@@ -278,6 +290,7 @@ typedef struct bend_initrequest
     char *configname;
     Z_IdAuthentication *auth;
     ODR stream;                /* encoding stream */
+    ODR print;                 /* printing stream */
     Z_ReferenceId *referenceId;/* reference ID */
     
     char *implementation_name;
index eb26f03..3013c83 100644 (file)
@@ -1,10 +1,12 @@
 /*
- * Copyright (c) 1995-1999, Index Data
+ * Copyright (c) 1995-2000, Index Data
  * See the file LICENSE for details.
- * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: seshigh.c,v $
- * Revision 1.100  1999-12-16 23:36:19  adam
+ * Revision 1.101  2000-01-12 14:36:07  adam
+ * Added printing stream (ODR) for backend functions.
+ *
+ * Revision 1.100  1999/12/16 23:36:19  adam
  * Implemented ILL protocol. Minor updates ASN.1 compiler.
  *
  * Revision 1.99  1999/11/30 13:47:12  adam
@@ -834,6 +836,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb)
        yaz_log(LOG_LOG, "Version:   %s", req->implementationVersion);
 
     binitreq.stream = assoc->encode;
+    binitreq.print = assoc->print;
     binitreq.configname = "default-config";
     binitreq.auth = req->idAuthentication;
     binitreq.referenceId = req->referenceId;
@@ -1135,6 +1138,7 @@ static Z_Records *pack_records(association *a, char *setname, int start,
        freq.comp = comp;
        freq.format = format;
        freq.stream = a->encode;
+       freq.print = a->print;
        freq.surrogate_flag = 0;
        freq.referenceId = referenceId;
        if (!(fres = bend_fetch(a->backend, &freq, 0)))
@@ -1255,6 +1259,7 @@ static Z_APDU *process_searchRequest(association *assoc, request *reqb,
        bsrr->query = req->query;
        bsrr->stream = assoc->encode;
        bsrr->decode = assoc->decode;
+       bsrr->print = assoc->print;
        bsrr->errcode = 0;
        bsrr->hits = 0;
        bsrr->errstring = NULL;
@@ -1276,6 +1281,7 @@ static Z_APDU *process_searchRequest(association *assoc, request *reqb,
         bsrq.referenceId = req->referenceId;
        bsrq.stream = assoc->encode;
        bsrq.decode = assoc->decode;
+       bsrq.print = assoc->print;
        if (!(bsrt = bend_search (assoc->backend, &bsrq, fd)))
            return 0;
        bsrr->hits = bsrt->hits;
@@ -1441,6 +1447,7 @@ static Z_APDU *process_presentRequest(association *assoc, request *reqb,
        bprr->comp = req->recordComposition;
        bprr->referenceId = req->referenceId;
        bprr->stream = assoc->encode;
+       bprr->print = assoc->print;
        bprr->request = reqb;
        bprr->association = assoc;
        bprr->errcode = 0;
@@ -1491,6 +1498,7 @@ static int bend_default_scan (void *handle, bend_scan_rr *rr)
     srq.term_position = rr->term_position;
     srq.num_entries = rr->num_entries;
     srq.stream = rr->stream;
+    srq.print = rr->print;
     
     srs = bend_scan(handle, &srq, 0);
 
@@ -1564,6 +1572,7 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb, int *fd)
        bsrr->term = req->termListAndStartPoint;
        bsrr->referenceId = req->referenceId;
        bsrr->stream = assoc->encode;
+       bsrr->print = assoc->print;
        if (!(attset = oid_getentbyoid(req->attributeSet)) ||
            attset->oclass != CLASS_RECSYN)
            bsrr->attributeset = VAL_NONE;
@@ -1665,6 +1674,7 @@ static Z_APDU *process_sortRequest(association *assoc, request *reqb,
     bsrr->output_setname = req->sortedResultSetName;
     bsrr->sort_sequence = req->sortSequence;
     bsrr->stream = assoc->encode;
+    bsrr->print = assoc->print;
 
     bsrr->sort_status = Z_SortStatus_failure;
     bsrr->errcode = 0;
@@ -1717,6 +1727,7 @@ static Z_APDU *process_deleteRequest(association *assoc, request *reqb,
     bdrr->num_setnames = req->num_resultSetList;
     bdrr->setnames = req->resultSetList;
     bdrr->stream = assoc->encode;
+    bdrr->print = assoc->print;
     bdrr->function = *req->deleteFunction;
     bdrr->referenceId = req->referenceId;
     bdrr->statuses = 0;
@@ -1875,6 +1886,7 @@ static Z_APDU *process_ESRequest(association *assoc, request *reqb, int *fd)
     esrequest.esr = reqb->request->u.extendedServicesRequest;
     esrequest.stream = assoc->encode;
     esrequest.decode = assoc->decode;
+    esrequest.print = assoc->print;
     esrequest.errcode = 0;
     esrequest.errstring = NULL;
     esrequest.request = reqb;
index b9e0c38..cd6d186 100644 (file)
@@ -1,13 +1,15 @@
 /*
- * Copyright (c) 1995-1999, Index Data.
+ * Copyright (c) 1995-2000, Index Data.
  * See the file LICENSE for details.
- * Sebastian Hammer, Adam Dickmeiss
  *
  * NT Service interface by
  *    Chas Woodfield, Fretwell Downing Datasystems.
  *
  * $Log: ztest.c,v $
- * Revision 1.28  1999-12-16 23:36:19  adam
+ * Revision 1.29  2000-01-12 14:36:07  adam
+ * Added printing stream (ODR) for backend functions.
+ *
+ * Revision 1.28  1999/12/16 23:36:19  adam
  * Implemented ILL protocol. Minor updates ASN.1 compiler.
  *
  * Revision 1.27  1999/11/30 13:47:12  adam
@@ -211,6 +213,8 @@ int ztest_esrequest (void *handle, bend_esrequest_rr *rr)
                                       r->u.single_ASN1_type->len, 0);
                            
                            ill_ItemRequest (rr->decode, &item_req, 0, 0);
+                           if (rr->print)
+                               ill_ItemRequest (rr->print, &item_req, 0, 0);
                        }
                    }
                }