Fixed bug regarding Options for Sort.
[yaz-moved-to-github.git] / server / session.h
index aefe3da..7c13234 100644 (file)
@@ -1,10 +1,29 @@
 /*
- * Copyright (C) 1995, Index Data I/S 
+ * Copyright (C) 1995-1998, Index Data I/S 
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: session.h,v $
- * Revision 1.12  1997-09-01 08:53:01  adam
+ * Revision 1.18  1998-08-03 10:23:57  adam
+ * Fixed bug regarding Options for Sort.
+ *
+ * Revision 1.17  1998/07/20 12:38:43  adam
+ * Implemented delete result set service to server API.
+ *
+ * Revision 1.16  1998/03/31 11:07:45  adam
+ * Furhter work on UNIverse resource report.
+ * Added Extended Services handling in frontend server.
+ *
+ * Revision 1.15  1998/02/11 11:53:36  adam
+ * Changed code so that it compiles as C++.
+ *
+ * Revision 1.14  1998/02/10 11:03:57  adam
+ * Added support for extended handlers in backend server interface.
+ *
+ * Revision 1.13  1998/01/29 13:30:23  adam
+ * Better event handle system for NT/Unix.
+ *
+ * Revision 1.12  1997/09/01 08:53:01  adam
  * New windows NT/95 port using MSV5.0. The test server 'ztest' was
  * moved a separate directory. MSV5.0 project server.dsp created.
  * As an option, the server can now operate as an NT service.
 #include <sys/types.h>
 #include "eventl.h"
 
+typedef enum {
+       REQUEST_IDLE,    /* the request is just sitting in the queue */
+       REQUEST_PENDING  /* operation pending (b'end processing or network I/O*/
+       /* this list will have more elements when acc/res control is added */
+} request_state;
+
 typedef struct request
 {
     int len_refid;          /* length of referenceid */
     char *refid;            /* referenceid */
-    enum {
-       REQUEST_IDLE,    /* the request is just sitting in the queue */
-       REQUEST_PENDING  /* operation pending (b'end processing or network I/O*/
-       /* this list will have more elements when acc/res control is added */
-    } state;
+    request_state state;
 
     Z_APDU *request;        /* Current request */
     NMEM request_mem;    /* memory handle for request */
@@ -73,6 +94,7 @@ typedef struct request
     int len_response;      /* length of encoded data */
     char *response;        /* encoded data waiting for transmission */
 
+    void *clientData;
     struct request *next;
     struct request_q *q; 
 } request;
@@ -88,6 +110,13 @@ typedef struct request_q
 /*
  * association state.
  */
+typedef enum
+{
+    ASSOC_NEW,                /* not initialized yet */
+    ASSOC_UP,                 /* normal operation */
+    ASSOC_DEAD                /* dead. Close if input arrives */
+} association_state;
+
 typedef struct association
 {
     IOCHAN client_chan;           /* event-loop control */
@@ -104,17 +133,18 @@ typedef struct association
     void *backend;                /* backend handle */
     request_q incoming;           /* Q of incoming PDUs */
     request_q outgoing;           /* Q of outgoing data buffers (enc. PDUs) */
-    enum
-    {
-       ASSOC_NEW,                /* not initialized yet */
-       ASSOC_UP,                 /* normal operation */
-       ASSOC_DEAD                /* dead. Close if input arrives */
-    } state;
+    association_state state;
 
     /* session parameters */
     int preferredMessageSize;
     int maximumRecordSize;
     int version;                  /* highest version-bit set (2 or 3) */
+
+    int (*bend_sort) ();
+    int (*bend_search) ();
+    int (*bend_present) ();
+    int (*bend_esrequest) ();
+    int (*bend_delete) ();
 } association;
 
 association *create_association(IOCHAN channel, COMSTACK link);
@@ -124,6 +154,7 @@ void ir_session(IOCHAN h, int event);
 void request_enq(request_q *q, request *r);
 request *request_head(request_q *q);
 request *request_deq(request_q *q);
+request *request_deq_x(request_q *q, request *r);
 void request_initq(request_q *q);
 void request_delq(request_q *q);
 request *request_get(request_q *q);