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