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