5 * Revision 1.12 1995/04/20 15:25:25 quinn
8 * Revision 1.11 1995/04/19 12:55:41 quinn
11 * Revision 1.10 1995/04/17 11:27:24 quinn
14 * Revision 1.9 1995/02/23 08:32:12 adam
17 * Revision 1.7 1995/02/17 13:59:06 quinn
25 #define ZASS_DEBUG GW_LOG_DEBUGN(9)
26 #define ZASS_TYPE "zass"
28 #define ZASS_ID "EUROPAGATE/DTV/ID"
29 #define ZASS_NAME "EUROPAGATE E-mail/Z39.50 gateway"
30 #define ZASS_VERSION "development 0.2"
32 #define ZASS_MAXRECORDSIZE 40000
33 #define ZASS_PREFERREDMESSAGESIZE 40000
35 typedef struct zass *ZASS;
39 ZASS_PRES_SUCCESS, /* all records available */
40 ZASS_PRES_PARTIAL_1, /* subset only 'cause of access control */
41 ZASS_PRES_PARTIAL_2, /* subset 'cause of max msg size constraints*/
42 ZASS_PRES_PARTIAL_3, /* subset 'cause of resource control org */
43 ZASS_PRES_PARTIAL_4, /* subset 'cause of resource control trg */
44 ZASS_PRES_FAILURE /* check errcode */
47 typedef struct zass_searchent
50 int status; /* status - boolean - qualified by setstatus */
51 enum present_status setstatus; /* consult if status. Value according to Z proto */
53 /* These two fields provide info from a diagnostic rec returned with
55 int errcode; /* bib 1 assumed here. -1 if none provided */
56 char errstring[512]; /* Additional info from diagnostic rec, or "" */
59 typedef struct zass_record
66 } which; /* 0 = diagnostic, others according to z3950v3 */
67 char *record; /* marc or other */
69 int errcode; /* Only valid if which == 0 */
72 struct zass_record *next;
75 typedef struct zass_presentent
77 int num; /* # of recs returned */
78 int nextpos; /* next resultset position. 1==first record */
79 enum present_status presentstatus; /* status of set */
80 struct zass_record *records;
84 * open a connection to the target. If complete is NULL, the connection
85 * will be blocking, and complete will be ignored by the following
86 * primitives. If complete is not null, the connection will be non-blocking.
87 * if the connection cannot be established immediately, *complete will
88 * be set to zero, and the user should call openresult when select signals
89 * that I/O is possible. Returns NULL on a fatal error in the connection
92 ZASS zass_open(char *host, int port, int *complete, char *auth);
95 * second half of connection establishment in nonblocking mode.
97 * -1 with *complete == 0 : call again when select allows.
98 * -1 with *complete == 1 : fatal error. Abort connection.
101 int zass_openresult(ZASS a, int *complete);
104 * Return the file handle of the association (for select() & other fun.
106 int zass_fileno(ZASS a);
110 * NULL with *complete == 0 : call searchresult when select allows (nonbl. only)
111 * NULL with *complete == 1 : fatal error. Abort connection.
112 * non-null : operation complete.
114 const struct zass_searchent *zass_search(ZASS a, struct ccl_rpn_node *query,
115 char *resname, char *databases, int *complete);
119 * NULL with *complete == 0 : call again when select allows (nonbl. only)
120 * NULL with *complete == 1 : fatal error. Abort connection.
121 * non-null : operation complete.
123 const struct zass_searchent *zass_searchresult(ZASS a, int *complete);
127 * NULL with *complete == 0 : call presentresult when select ok (nonbl. only)
128 * NULL with *complete == 1 : fatal error. Abort connection.
129 * non-null : operation complete.
131 const struct zass_presentent *zass_present(ZASS a, char *resname, int start,
132 int num, int *complete);
136 * NULL with *complete == 0 : call again when select allows (nonbl. only)
137 * NULL with *complete == 1 : fatal error. Abort connection.
138 * non-null : operation complete.
140 const struct zass_presentent *zass_presentresult(ZASS a, int *complete);