Added member request_format and output_format for backend fetch method.
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 31 Aug 2000 10:20:12 +0000 (10:20 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 31 Aug 2000 10:20:12 +0000 (10:20 +0000)
CHANGELOG
include/yaz/backend.h
server/seshigh.c

index b26fa00..c1e9025 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
 Possible compatibility problems with earlier versions marked with '*'.
 
-Added record_syntax OID for fetch interface for backend API.
+Added raw OID member for preferred record syntax (request_format_raw)
+and returned record syntax (output_format_raw) for backend fetch method.
 
 Config file yaz-config now accepts options so that it returns specific
 compile settings, etc. Thanks to Morten Bøgeskov <morten@bogeskov.dk>
index 46d1d4b..4a43f41 100644 (file)
  * OF THIS SOFTWARE.
  *
  * $Log: backend.h,v $
- * Revision 1.8  2000-08-31 09:51:25  adam
+ * Revision 1.9  2000-08-31 10:20:12  adam
+ * Added member request_format and output_format for backend fetch method.
+ *
+ * Revision 1.8  2000/08/31 09:51:25  adam
  * Added record_syntax member for fetch method (raw OID).
  *
  * Revision 1.7  2000/04/05 07:39:55  adam
@@ -129,7 +132,6 @@ typedef struct {
     int start;
     int number;                /* record number */
     oid_value format;          /* One of the CLASS_RECSYN members */
-    int *record_syntax;        /* same as above (raw OID) */
     Z_ReferenceId *referenceId;/* reference ID */
     Z_RecordComposition *comp; /* Formatting instructions */
     ODR stream;                /* encoding stream - memory source if required */
@@ -147,7 +149,7 @@ typedef struct bend_fetch_rr {
     int number;                /* record number */
     Z_ReferenceId *referenceId;/* reference ID */
     oid_value request_format;  /* One of the CLASS_RECSYN members */
-    int *record_syntax;        /* same as above (raw OID) */
+    int *request_format_raw;   /* same as above (raw OID) */
     Z_RecordComposition *comp; /* Formatting instructions */
     ODR stream;                /* encoding stream - memory source if req */
     ODR print;                 /* printing stream */
@@ -157,6 +159,7 @@ typedef struct bend_fetch_rr {
     char *record;              /* record */
     int last_in_set;           /* is it?  */
     oid_value output_format;   /* format */
+    int *output_format_raw;    /* used instead of above if not-null */
     int errcode;               /* 0==success */
     char *errstring;           /* system error string or NULL */
     int surrogate_flag;        /* surrogate diagnostic */
index 755b3e9..0bd8ba5 100644 (file)
@@ -3,7 +3,10 @@
  * See the file LICENSE for details.
  *
  * $Log: seshigh.c,v $
- * Revision 1.106  2000-08-31 09:51:25  adam
+ * Revision 1.107  2000-08-31 10:20:12  adam
+ * Added member request_format and output_format for backend fetch method.
+ *
+ * Revision 1.106  2000/08/31 09:51:25  adam
  * Added record_syntax member for fetch method (raw OID).
  *
  * Revision 1.105  2000/07/06 10:38:47  adam
@@ -1187,8 +1190,9 @@ static Z_Records *pack_records(association *a, char *setname, int start,
        freq.number = recno;
        freq.comp = comp;
        freq.request_format = format;
-       freq.record_syntax = oid;
-       freq.output_format = 0;
+       freq.request_format_raw = oid;
+       freq.output_format = format;
+       freq.output_format_raw = 0;
        freq.stream = a->encode;
        freq.print = a->print;
        freq.surrogate_flag = 0;
@@ -1260,6 +1264,12 @@ static Z_Records *pack_records(association *a, char *setname, int start,
            return 0;
        strcpy(thisrec->databaseName, freq.basename);
        thisrec->which = Z_NamePlusRecord_databaseRecord;
+
+       if (freq.output_format_raw)
+       {
+           struct oident *ident = oid_getentbyoid(freq.output_format_raw);
+           freq.output_format = ident->value;
+       }
        thisrec->u.databaseRecord = z_ext_record(a->encode, freq.output_format,
                                                 freq.record, freq.len);
        if (!thisrec->u.databaseRecord)
@@ -1494,7 +1504,6 @@ static Z_APDU *process_presentRequest(association *assoc, request *reqb,
        bprr->start = *req->resultSetStartPoint;
        bprr->number = *req->numberOfRecordsRequested;
        bprr->format = form;
-       bprr->record_syntax = req->preferredRecordSyntax;
        bprr->comp = req->recordComposition;
        bprr->referenceId = req->referenceId;
        bprr->stream = assoc->encode;