Minor changes.
[egate.git] / include / zaccess.h
1 /*
2  * Europagate, 1995
3  *
4  * zaccess.h,v
5  * Revision 1.7  1995/02/17  13:59:06  quinn
6  * Added header.
7  *
8  */
9
10 #ifndef ZACCESS_H
11 #define ZACCESS_H
12
13 #define ZASS_DEBUG GW_LOG_DEBUGN(9)
14 #define ZASS_TYPE "zass"
15
16 #define ZASS_ID "EUROPAGATE/DTB/ID"
17 #define ZASS_NAME "EUROPAGATE E-mail/Z39.50 gateway"
18 #define ZASS_VERSION "development 0.1"
19
20 #define ZASS_MAXRECORDSIZE  10000
21 #define ZASS_PREFERREDMESSAGESIZE 10000
22
23 typedef struct zass *ZASS;
24
25 enum present_status
26 {
27     ZASS_PRES_SUCCESS,        /* all records available */
28     ZASS_PRES_PARTIAL_1,      /* subset only 'cause of access control */
29     ZASS_PRES_PARTIAL_2,      /* subset 'cause of max msg size constraints*/
30     ZASS_PRES_PARTIAL_3,      /* subset 'cause of resource control org */
31     ZASS_PRES_PARTIAL_4,      /* subset 'cause of resource control trg */
32     ZASS_PRES_FAILURE         /* check errcode */
33 };
34
35 typedef struct zass_searchent
36 {
37     int num;      /* # hits */
38     int status;   /* status - boolean - qualified by setstatus */
39     enum present_status setstatus; /* consult if status. Value according to Z proto */
40
41     /* These two fields provide info from a diagnostic rec returned with 
42        response */
43     int errcode;           /* bib 1 assumed here. -1 if none provided */
44     char errstring[512];   /* Additional info from diagnostic rec, or "" */
45 } zass_searchent;
46
47 typedef struct zass_record
48 {
49     enum
50     {
51         ZASS_REC_DIAG=0,
52         ZASS_REC_USMARC=10
53     } which;      /* 0 = diagnostic, others according to z3950v3 */
54     char *record;   /* marc or other */
55
56     int errcode;    /* Only valid if which == 0 */
57     char errstring[200];
58
59     struct zass_record *next;
60 } zass_record;
61
62 typedef struct zass_presentent
63 {
64     int num;             /* # of recs returned */
65     int nextpos;         /* next resultset position. 1==first record */
66     enum present_status presentstatus;   /* status of set */
67     struct zass_record *records;
68 } zass_presentent;
69
70 ZASS zass_open(char *host, int port);
71 const struct zass_searchent *zass_search(ZASS a, struct ccl_rpn_node *query,
72     char *resname, char *databases);
73 const struct zass_presentent *zass_present(ZASS a, char *resname, int start,
74     int num);
75
76 #endif