+/*
+ * Europagate, 1995
+ *
+ * $Log: zaccess.h,v $
+ * Revision 1.9 1995/02/23 08:32:12 adam
+ * Changed header.
+ *
+ * Revision 1.7 1995/02/17 13:59:06 quinn
+ * Added header.
+ *
+ */
+
#ifndef ZACCESS_H
#define ZACCESS_H
typedef struct zass *ZASS;
+enum present_status
+{
+ ZASS_PRES_SUCCESS, /* all records available */
+ ZASS_PRES_PARTIAL_1, /* subset only 'cause of access control */
+ ZASS_PRES_PARTIAL_2, /* subset 'cause of max msg size constraints*/
+ ZASS_PRES_PARTIAL_3, /* subset 'cause of resource control org */
+ ZASS_PRES_PARTIAL_4, /* subset 'cause of resource control trg */
+ ZASS_PRES_FAILURE /* check errcode */
+};
+
typedef struct zass_searchent
{
int num; /* # hits */
- int status; /* status - boolean */
- int setstatus; /* consult if !status. Value according to Z proto */
+ int status; /* status - boolean - qualified by setstatus */
+ enum present_status setstatus; /* consult if status. Value according to Z proto */
- /* These two field provide info from a diagnostic rec returned with
+ /* These two fields provide info from a diagnostic rec returned with
response */
int errcode; /* bib 1 assumed here. -1 if none provided */
char errstring[512]; /* Additional info from diagnostic rec, or "" */
} zass_searchent;
-typedef struct zass_records
+typedef struct zass_record
{
- int which; /* 0 = diagnostic, others according to z3950v3 */
+ enum
+ {
+ ZASS_REC_DIAG=0,
+ ZASS_REC_USMARC=10
+ } which; /* 0 = diagnostic, others according to z3950v3 */
char *record; /* marc or other */
int errcode; /* Only valid if which == 0 */
- char addinfo[200];
-} zass_records;
+ char errstring[200];
+
+ struct zass_record *next;
+} zass_record;
typedef struct zass_presentent
{
int num; /* # of recs returned */
int nextpos; /* next resultset position. 1==first record */
- int presentstatus; /* status of set */
- int num_records;
- zass_records *records;
+ enum present_status presentstatus; /* status of set */
+ struct zass_record *records;
} zass_presentent;
+ZASS zass_open(char *host, int port);
+const struct zass_searchent *zass_search(ZASS a, struct ccl_rpn_node *query,
+ char *resname, char *databases);
+const struct zass_presentent *zass_present(ZASS a, char *resname, int start,
+ int num);
+
#endif