From c70f63352bac2f0bfdcc3078d69f43adbcc7ad2d Mon Sep 17 00:00:00 2001 From: Sebastian Hammer Date: Mon, 19 Jun 1995 12:38:23 +0000 Subject: [PATCH] Reorganized include-files. Added small features. --- include/backend.h | 66 ++++++++++++++++++++++++++-------------------------- include/comstack.h | 9 ++++--- include/log.h | 8 +++++-- include/odr.h | 8 +++++-- include/odr_use.h | 7 ++++-- include/proto.h | 8 ++++++- include/prt.h | 1 + include/statserv.h | 13 +++++++---- 8 files changed, 72 insertions(+), 48 deletions(-) diff --git a/include/backend.h b/include/backend.h index 78d670a..392f68b 100644 --- a/include/backend.h +++ b/include/backend.h @@ -44,6 +44,8 @@ typedef struct bend_initresult void *handle; /* private handle to the backend module */ } bend_initresult; +bend_initresult *bend_init(bend_initrequest *r); + typedef struct bend_searchrequest { char *setname; /* name to give to this set */ @@ -53,6 +55,35 @@ typedef struct bend_searchrequest Z_Query *query; /* query structure */ } bend_searchrequest; +typedef struct bend_searchresult +{ + int hits; /* number of hits */ + int errcode; /* 0==OK */ + char *errstring; /* system error string or NULL */ +} bend_searchresult; + +bend_searchresult *bend_search(void *handle, bend_searchrequest *r, int *fd); +bend_searchresult *bend_searchresponse(void *handle); + +typedef struct bend_fetchrequest +{ + char *setname; /* set name */ + int number; /* record number */ +} bend_fetchrequest; + +typedef struct bend_fetchresult +{ + char *basename; /* name of database that provided record */ + int len; /* length of record */ + char *record; /* record */ + int last_in_set; /* is it? */ + int errcode; /* 0==success */ + char *errstring; /* system error string or NULL */ +} bend_fetchresult; + +bend_fetchresult *bend_fetch(void *handle, bend_fetchrequest *r, int *fd); +bend_fetchresult *bend_fetchresponse(void *handle); + typedef struct bend_scanrequest { int num_bases; /* number of elements in databaselist */ @@ -80,28 +111,8 @@ typedef struct bend_scanresult char *errstring; } bend_scanresult; -typedef struct bend_searchresult -{ - int hits; /* number of hits */ - int errcode; /* 0==OK */ - char *errstring; /* system error string or NULL */ -} bend_searchresult; - -typedef struct bend_fetchrequest -{ - char *setname; /* set name */ - int number; /* record number */ -} bend_fetchrequest; - -typedef struct bend_fetchresult -{ - char *basename; /* name of database that provided record */ - int len; /* length of record */ - char *record; /* record */ - int last_in_set; /* is it? */ - int errcode; /* 0==success */ - char *errstring; /* system error string or NULL */ -} bend_fetchresult; +bend_scanresult *bend_scan(void *handle, bend_scanrequest *r, int *fd); +bend_scanresult *bend_scanresponse(void *handle); typedef struct bend_deleterequest { @@ -114,17 +125,6 @@ typedef struct bend_deleteresult char *errstring; /* system error string or NULL */ } bend_deleteresult; -bend_initresult *bend_init(bend_initrequest *r); - -bend_searchresult *bend_search(void *handle, bend_searchrequest *r, int *fd); -bend_searchresult *bend_searchresponse(void *handle); - -bend_fetchresult *bend_fetch(void *handle, bend_fetchrequest *r, int *fd); -bend_fetchresult *bend_fetchresponse(void *handle); - -bend_scanresult *bend_scan(void *handle, bend_scanrequest *r, int *fd); -bend_scanresult *bend_scanresponse(void *handle); - bend_deleteresult *bend_delete(void *handle, bend_deleterequest *r, int *fd); bend_deleteresult *bend_deleteresponse(void *handle); diff --git a/include/comstack.h b/include/comstack.h index 12c9dc6..ffcc995 100644 --- a/include/comstack.h +++ b/include/comstack.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: comstack.h,v $ - * Revision 1.6 1995-05-30 10:54:51 quinn + * Revision 1.7 1995-06-19 12:38:24 quinn + * Reorganized include-files. Added small features. + * + * Revision 1.6 1995/05/30 10:54:51 quinn * Added some backwards compatibility to the comstack (CS_SR->PROTO_SR) * * Revision 1.5 1995/05/29 08:11:31 quinn @@ -87,7 +90,7 @@ #include #include -#define COMSTACK_DEFAULT_TIMEOUT -1 +#define COMSTACK_DEFAULT_TIMEOUT -1 /* not used yet */ struct comstack; typedef struct comstack *COMSTACK; @@ -99,7 +102,7 @@ struct comstack int errno; /* current error code of this stack */ char *stackerr;/* current lower-layer error string, or null if none */ int iofile; /* UNIX file descriptor for iochannel */ - int timeout; /* how long to wait for trailing blocks */ + int timeout; /* how long to wait for trailing blocks (ignored for now) */ void *private; /* state info for lower stack */ int more; /* connection has extra data in buffer */ int state; /* current state */ diff --git a/include/log.h b/include/log.h index b1644e2..fb365e0 100644 --- a/include/log.h +++ b/include/log.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: log.h,v $ - * Revision 1.2 1995-05-16 08:50:31 quinn + * Revision 1.3 1995-06-19 12:38:25 quinn + * Reorganized include-files. Added small features. + * + * Revision 1.2 1995/05/16 08:50:31 quinn * License, documentation, and memory fixes * * Revision 1.1 1995/03/30 09:39:41 quinn @@ -51,7 +54,7 @@ #define LOG_DEBUG 0x0002 #define LOG_WARN 0x0004 #define LOG_LOG 0x0008 -#define LOG_ERRNO 0x0010 /* apend strerror to message */ +#define LOG_ERRNO 0x0010 /* append strerror to message */ #define LOG_ALL 0xffff @@ -60,5 +63,6 @@ void log_init(int level, const char *prefix, const char *name); void logf(int level, const char *fmt, ...); int log_mask_str (const char *str); +FILE *log_file(void); #endif diff --git a/include/odr.h b/include/odr.h index a1787fb..de65bc6 100644 --- a/include/odr.h +++ b/include/odr.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: odr.h,v $ - * Revision 1.8 1995-06-16 13:16:04 quinn + * Revision 1.9 1995-06-19 12:38:26 quinn + * Reorganized include-files. Added small features. + * + * Revision 1.8 1995/06/16 13:16:04 quinn * Fixed Defaultdiagformat. * * Revision 1.7 1995/05/29 08:11:32 quinn @@ -248,6 +251,7 @@ typedef struct odr_arm #define OPROTO 7 #define ODATA 8 #define OSTACK 9 +#define OCONLEN 10 extern char *odr_errlist[]; @@ -285,7 +289,7 @@ void odr_release_mem(ODR_MEM p); #define ODR_MASK_GET(mask, num) ( ((num) >> 3 <= (mask)->top) ? \ ((mask)->bits[(num) >> 3] & (0X80 >> ((num) & 0X07)) ? 1 : 0) : 0) -/* +/* Private macro. * write a single character at the current position - grow buffer if * necessary. * (no, we're not usually this anal about our macros, but this baby is diff --git a/include/odr_use.h b/include/odr_use.h index 6da24cf..50cf391 100644 --- a/include/odr_use.h +++ b/include/odr_use.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: odr_use.h,v $ - * Revision 1.2 1995-05-16 08:50:34 quinn + * Revision 1.3 1995-06-19 12:38:27 quinn + * Reorganized include-files. Added small features. + * + * Revision 1.2 1995/05/16 08:50:34 quinn * License, documentation, and memory fixes * * Revision 1.1 1995/03/30 09:39:41 quinn @@ -53,7 +56,7 @@ typedef struct Odr_external union { Odr_any *single_ASN1_type; - Odr_oct *octet_aligned; /* should be union */ + Odr_oct *octet_aligned; Odr_bitmask *arbitrary; /* we aren't really equipped for this*/ } u; } Odr_external; diff --git a/include/proto.h b/include/proto.h index 62fdd31..ec99207 100644 --- a/include/proto.h +++ b/include/proto.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: proto.h,v $ - * Revision 1.18 1995-06-16 13:16:05 quinn + * Revision 1.19 1995-06-19 12:38:28 quinn + * Reorganized include-files. Added small features. + * + * Revision 1.18 1995/06/16 13:16:05 quinn * Fixed Defaultdiagformat. * * Revision 1.17 1995/06/15 15:42:05 quinn @@ -196,6 +199,8 @@ typedef struct Z_IntUnit Z_Unit *unitUsed; } Z_IntUnit; +typedef Odr_oct Z_SUTRS; + /* ----------------- INIT SERVICE ----------------*/ typedef struct @@ -1047,6 +1052,7 @@ typedef struct Z_APDU } Z_APDU; int z_APDU(ODR o, Z_APDU **p, int opt); +int z_SUTRS(ODR o, Odr_oct **p, int opt); Z_InitRequest *zget_InitRequest(ODR o); Z_InitResponse *zget_InitResponse(ODR o); diff --git a/include/prt.h b/include/prt.h index a47a9d9..5276e16 100644 --- a/include/prt.h +++ b/include/prt.h @@ -41,3 +41,4 @@ Odr_oid *odr_oiddup(ODR odr, Odr_oid *o); int odr_grow_block(odr_ecblock *b, int min_bytes); int odr_write(ODR o, unsigned char *buf, int bytes); int odr_seek(ODR o, int whence, int offset); +int odr_dumpBER(FILE *f, char *buf, int len); diff --git a/include/statserv.h b/include/statserv.h index 8173bf0..1caa038 100644 --- a/include/statserv.h +++ b/include/statserv.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: statserv.h,v $ - * Revision 1.4 1995-06-15 07:45:08 quinn + * Revision 1.5 1995-06-19 12:38:31 quinn + * Reorganized include-files. Added small features. + * + * Revision 1.4 1995/06/15 07:45:08 quinn * Moving to v3. * * Revision 1.3 1995/05/16 08:50:38 quinn @@ -42,14 +45,14 @@ typedef struct statserv_options_block { int dynamic; /* fork on incoming requests */ int loglevel; /* desired logging-level */ - char apdufile[ODR_MAXNAME+1]; /* file for pretty-printed PDUs */ - char logfile[ODR_MAXNAME+1]; /* file for diagnostic output */ + char apdufile[ODR_MAXNAME+1]; /* file for pretty-printed PDUs */ + char logfile[ODR_MAXNAME+1]; /* file for diagnostic output */ char default_listen[1024]; /* 0 == no default listen */ enum oid_proto default_proto; /* PROTO_SR or PROTO_Z3950 */ int idle_timeout; /* how many minutes to wait before closing */ int maxrecordsize; /* maximum value for negotiation */ - char configname[ODR_MAXNAME+1]; /* given to the backend in bend_init */ - char setuid[ODR_MAXNAME+1]; /* setuid to this user after binding */ + char configname[ODR_MAXNAME+1]; /* given to the backend in bend_init */ + char setuid[ODR_MAXNAME+1]; /* setuid to this user after binding */ } statserv_options_block; int statserv_main(int argc, char **argv); -- 1.7.10.4