From: Adam Dickmeiss Date: Wed, 14 May 1997 06:53:19 +0000 (+0000) Subject: C++ support. X-Git-Tag: YAZ.1.8~659 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=bf4149c63ad2e11429e302a89f472de52b4d7ce8 C++ support. --- diff --git a/CHANGELOG b/CHANGELOG index ea794b7..e211b23 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,14 +2,16 @@ Possible compatibility problems with earlier versions marked with '*'. --- XXXXX +Added support for C++, headers uses extern "C" for public definitions. +With input from RVDM. + In handling of SEQUENCE OF: Counter set to zero when SEQUENCE OF is absent. - Thanks to Ronald van der Meer (RVDM). +Thanks to Ronald van der Meer (RVDM). Added initializers (zget_ routines) for a number of PDUs. Thanks to RVDM. - Ronald van der Meer. Added support for private extensions to the OID database - (oid_setprivateoids()). Thanks to RVDM. +(oid_setprivateoids()). Thanks to RVDM. Added optional, physical ANY (key replication) diff --git a/asn/prt-ext.c b/asn/prt-ext.c index 7c56703..aac6bfc 100644 --- a/asn/prt-ext.c +++ b/asn/prt-ext.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-ext.c,v $ - * Revision 1.12 1997-04-30 08:52:02 quinn + * Revision 1.13 1997-05-14 06:53:22 adam + * C++ support. + * + * Revision 1.12 1997/04/30 08:52:02 quinn * Null * * Revision 1.11 1996/10/10 12:35:13 quinn @@ -127,14 +130,14 @@ int z_External(ODR o, Z_External **p, int opt) (oid = oid_getentbyoid((*p)->direct_reference)) && (type = z_ext_getentbyref(oid->value))) { - int class, tag, cons; + int zclass, tag, cons; /* * We know it. If it's represented as an ASN.1 type, bias the CHOICE. */ - if (!odr_peektag(o, &class, &tag, &cons)) + if (!odr_peektag(o, &zclass, &tag, &cons)) return opt && odr_ok(o); - if (class == ODR_CONTEXT && tag == 0 && cons == 1) + if (zclass == ODR_CONTEXT && tag == 0 && cons == 1) odr_choice_bias(o, type->what); } return diff --git a/asn/prt-grs.c b/asn/prt-grs.c index abeb4c7..08c5ca6 100644 --- a/asn/prt-grs.c +++ b/asn/prt-grs.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: prt-grs.c,v $ - * Revision 1.5 1995-10-18 16:12:20 quinn + * Revision 1.6 1997-05-14 06:53:23 adam + * C++ support. + * + * Revision 1.5 1995/10/18 16:12:20 quinn * Added a couple of special cases to handle the WAIS server. * * Revision 1.4 1995/09/29 17:11:55 quinn @@ -197,7 +200,7 @@ int z_Triple(ODR o, Z_Triple **p, int opt) return opt && odr_ok(o); return odr_implicit(o, odr_oid, &(*p)->variantSetId, ODR_CONTEXT, 0, 1) && - odr_implicit(o, odr_integer, &(*p)->class, ODR_CONTEXT, 1, 0) && + odr_implicit(o, odr_integer, &(*p)->zclass, ODR_CONTEXT, 1, 0) && odr_implicit(o, odr_integer, &(*p)->type, ODR_CONTEXT, 2, 0) && odr_constructed_begin(o, &(*p)->value, ODR_CONTEXT, 3) && odr_choice(o, arm, &(*p)->value, &(*p)->which) && diff --git a/ccl/cclfind.c b/ccl/cclfind.c index 595b3dc..cd40122 100644 --- a/ccl/cclfind.c +++ b/ccl/cclfind.c @@ -45,7 +45,10 @@ * Europagate, 1995 * * $Log: cclfind.c,v $ - * Revision 1.6 1997-04-30 08:52:06 quinn + * Revision 1.7 1997-05-14 06:53:26 adam + * C++ support. + * + * Revision 1.6 1997/04/30 08:52:06 quinn * Null * * Revision 1.5 1996/10/11 15:00:24 adam @@ -181,7 +184,7 @@ static char *copy_token_name (struct ccl_token *tp) * kind: Type of node. * return: pointer to allocated node. */ -static struct ccl_rpn_node *mk_node (enum rpn_node_kind kind) +static struct ccl_rpn_node *mk_node (int kind) { struct ccl_rpn_node *p; p = malloc (sizeof(*p)); diff --git a/client/client.c b/client/client.c index 0c5944c..1057b99 100644 --- a/client/client.c +++ b/client/client.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: client.c,v $ - * Revision 1.44 1997-05-05 11:20:35 adam + * Revision 1.45 1997-05-14 06:53:29 adam + * C++ support. + * + * Revision 1.44 1997/05/05 11:20:35 adam * Client uses "options" utility and marc dump filename may be specified * as an option (-m ). * @@ -370,7 +373,7 @@ static void display_variant(Z_Variant *v, int level) for (i = 0; i < v->num_triples; i++) { - printf("%*sclass=%d,type=%d", level * 4, "", *v->triples[i]->class, + printf("%*sclass=%d,type=%d", level * 4, "", *v->triples[i]->zclass, *v->triples[i]->type); if (v->triples[i]->which == Z_Triple_internationalString) printf(",value=%s\n", v->triples[i]->value.internationalString); @@ -900,7 +903,7 @@ int cmd_cancel(char *arg) Z_APDU *apdu = zget_APDU(out, Z_APDU_triggerResourceControlRequest); Z_TriggerResourceControlRequest *req = apdu->u.triggerResourceControlRequest; - bool_t false = 0; + bool_t rfalse = 0; if (!session) { @@ -913,7 +916,7 @@ int cmd_cancel(char *arg) return 0; } *req->requestedAction = Z_TriggerResourceCtrl_cancel; - req->resultSetWanted = &false; + req->resultSetWanted = &rfalse; send_apdu(apdu); printf("Sent cancel request\n"); diff --git a/comstack/tcpip.c b/comstack/tcpip.c index 17c31a9..31e6290 100644 --- a/comstack/tcpip.c +++ b/comstack/tcpip.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: tcpip.c,v $ - * Revision 1.14 1997-05-01 15:06:32 adam + * Revision 1.15 1997-05-14 06:53:33 adam + * C++ support. + * + * Revision 1.14 1997/05/01 15:06:32 adam * Moved WINSOCK init. code to tcpip_init routine. * * Revision 1.13 1996/11/01 08:45:18 adam @@ -213,7 +216,7 @@ COMSTACK tcpip_type(int s, int blocking, int protocol) new_socket = 0; if (!(p = xmalloc(sizeof(struct comstack)))) return 0; - if (!(state = p->private = xmalloc(sizeof(tcpip_state)))) + if (!(state = p->cprivate = xmalloc(sizeof(tcpip_state)))) return 0; #ifdef WINDOWS @@ -289,7 +292,7 @@ struct sockaddr_in *tcpip_strtoaddr(const char *str) int tcpip_more(COMSTACK h) { - tcpip_state *sp = h->private; + tcpip_state *sp = h->cprivate; return sp->altlen && (*sp->complete)((unsigned char *) sp->altbuf, sp->altlen); @@ -387,8 +390,8 @@ int tcpip_listen(COMSTACK h, char *raddr, int *addrlen) COMSTACK tcpip_accept(COMSTACK h) { - COMSTACK new; - tcpip_state *state, *st = h->private; + COMSTACK cnew; + tcpip_state *state, *st = h->cprivate; #ifdef WINDOWS unsigned long tru = 1; #endif @@ -399,31 +402,31 @@ COMSTACK tcpip_accept(COMSTACK h) h->cerrno = CSOUTSTATE; return 0; } - if (!(new = xmalloc(sizeof(*new)))) + if (!(cnew = xmalloc(sizeof(*cnew)))) { h->cerrno = CSYSERR; return 0; } - memcpy(new, h, sizeof(*h)); - new->iofile = h->newfd; - if (!(state = new->private = xmalloc(sizeof(tcpip_state)))) + memcpy(cnew, h, sizeof(*h)); + cnew->iofile = h->newfd; + if (!(state = cnew->cprivate = xmalloc(sizeof(tcpip_state)))) { h->cerrno = CSYSERR; return 0; } #ifdef WINDOWS - if (!new->blocking && ioctlsocket(new->iofile, FIONBIO, &tru) < 0) + if (!cnew->blocking && ioctlsocket(new->iofile, FIONBIO, &tru) < 0) #else - if (!new->blocking && fcntl(new->iofile, F_SETFL, O_NONBLOCK) < 0) + if (!cnew->blocking && fcntl(cnew->iofile, F_SETFL, O_NONBLOCK) < 0) #endif return 0; state->altbuf = 0; state->altsize = state->altlen = 0; state->towrite = state->written = -1; state->complete = st->complete; - new->state = CS_DATAXFER; + cnew->state = CS_DATAXFER; h->state = CS_IDLE; - return new; + return cnew; } #define CS_TCPIP_BUFCHUNK 4096 @@ -434,7 +437,7 @@ COMSTACK tcpip_accept(COMSTACK h) */ int tcpip_get(COMSTACK h, char **buf, int *bufsize) { - tcpip_state *sp = h->private; + tcpip_state *sp = h->cprivate; char *tmpc; int tmpi, berlen, rest, req, tomove; int hasread = 0, res; @@ -510,7 +513,7 @@ int tcpip_get(COMSTACK h, char **buf, int *bufsize) int tcpip_put(COMSTACK h, char *buf, int size) { int res; - struct tcpip_state *state = h->private; + struct tcpip_state *state = h->cprivate; TRC(fprintf(stderr, "tcpip_put: size=%d\n", size)); if (state->towrite < 0) @@ -551,7 +554,7 @@ int tcpip_put(COMSTACK h, char *buf, int size) int tcpip_close(COMSTACK h) { - tcpip_state *sp = h->private; + tcpip_state *sp = h->cprivate; TRC(fprintf(stderr, "tcpip_close\n")); #ifdef WINDOWS diff --git a/comstack/xmosi.c b/comstack/xmosi.c index ef47253..ea8a71b 100644 --- a/comstack/xmosi.c +++ b/comstack/xmosi.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: xmosi.c,v $ - * Revision 1.14 1996-07-26 12:34:07 quinn + * Revision 1.15 1997-05-14 06:53:34 adam + * C++ support. + * + * Revision 1.14 1996/07/26 12:34:07 quinn * Porting. * * Revision 1.13 1996/07/06 19:58:30 quinn @@ -186,7 +189,7 @@ COMSTACK mosi_type(int s, int blocking, int protocol) if (!(r = xmalloc(sizeof(*r)))) return 0; - if (!(state = r->private = xmalloc(sizeof(*state)))) + if (!(state = r->cprivate = xmalloc(sizeof(*state)))) return 0; state->call = 0; @@ -391,7 +394,7 @@ int mosi_bind(COMSTACK h, void *address, int mode) int mosi_listen(COMSTACK h, char *addp, int *addrlen) { int res; - mosi_state *st = h->private; + mosi_state *st = h->cprivate; if (!(st->call = (struct t_call*) t_alloc(h->iofile, T_CALL_STR, T_ALL))) @@ -410,7 +413,7 @@ COMSTACK mosi_accept(COMSTACK h) { COMSTACK new; void *local; - struct mosi_state *st = h->private, *ns; + struct mosi_state *st = h->cprivate, *ns; int flags = O_RDWR; if (h->state != CS_INCON) @@ -421,7 +424,7 @@ COMSTACK mosi_accept(COMSTACK h) if (!(new = xmalloc(sizeof(*new)))) return 0; *new = *h; - if (!(new->private = ns = xmalloc(sizeof(*ns)))) + if (!(new->cprivate = ns = xmalloc(sizeof(*ns)))) return 0; *ns = *st; if (!h->blocking) @@ -446,7 +449,7 @@ COMSTACK mosi_accept(COMSTACK h) int mosi_get(COMSTACK h, char **buf, int *bufsize) { int flags = 0, res; - mosi_state *ct = h->private; + mosi_state *ct = h->cprivate; int got; do @@ -479,7 +482,7 @@ int mosi_get(COMSTACK h, char **buf, int *bufsize) int mosi_put(COMSTACK h, char *buf, int size) { - mosi_state *ct = h->private; + mosi_state *ct = h->cprivate; int res = u_snd(h->iofile, buf + ct->haswrit, size - ct->haswrit, 0); if (res == size - ct->haswrit) @@ -499,7 +502,7 @@ int mosi_put(COMSTACK h, char *buf, int size) int mosi_close(COMSTACK h) { - xfree(h->private); + xfree(h->cprivate); if (h->iofile >= 0) u_close(h->iofile); xfree(h); diff --git a/include/backend.h b/include/backend.h index 92ffb50..7d5dcef 100644 --- a/include/backend.h +++ b/include/backend.h @@ -32,6 +32,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + typedef struct bend_initrequest { char *configname; @@ -136,4 +140,8 @@ bend_deleteresult *bend_deleteresponse(void *handle); void bend_close(void *handle); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/ccl.h b/include/ccl.h index 816a395..f5921a4 100644 --- a/include/ccl.h +++ b/include/ccl.h @@ -46,7 +46,10 @@ * CCL - header file * * $Log: ccl.h,v $ - * Revision 1.5 1997-04-30 08:52:08 quinn + * Revision 1.6 1997-05-14 06:53:37 adam + * C++ support. + * + * Revision 1.5 1997/04/30 08:52:08 quinn * Null * * Revision 1.4 1996/10/11 15:02:26 adam @@ -88,6 +91,10 @@ #ifndef CCL_H #define CCL_H +#ifdef __cplusplus +extern "C" { +#endif + /* CCL error numbers */ #define CCL_ERR_OK 0 #define CCL_ERR_TERM_EXPECTED 1 @@ -110,14 +117,16 @@ struct ccl_rpn_attr { int value; }; +#define CCL_RPN_AND 1 +#define CCL_RPN_OR 2 +#define CCL_RPN_NOT 3 +#define CCL_RPN_TERM 4 +#define CCL_RPN_SET 5 +#define CCL_RPN_PROX 6 + /* RPN tree structure */ struct ccl_rpn_node { - enum rpn_node_kind { - CCL_RPN_AND, CCL_RPN_OR, CCL_RPN_NOT, - CCL_RPN_TERM, - CCL_RPN_SET, - CCL_RPN_PROX - } kind; + int kind; union { struct ccl_rpn_node *p[2]; struct { @@ -263,5 +272,10 @@ int ccl_memicmp (const char *s1, const char *s2, size_t n); /* Search for qualifier 'name' in set 'b'. */ struct ccl_rpn_attr *ccl_qual_search (CCL_bibset b, const char *name, int len); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/comstack.h b/include/comstack.h index e9cda33..ee8ebd7 100644 --- a/include/comstack.h +++ b/include/comstack.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: comstack.h,v $ - * Revision 1.15 1996-07-06 19:58:32 quinn + * Revision 1.16 1997-05-14 06:53:37 adam + * C++ support. + * + * Revision 1.15 1996/07/06 19:58:32 quinn * System headerfiles gathered in yconfig * * Revision 1.14 1996/02/10 12:23:41 quinn @@ -116,6 +119,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #define COMSTACK_DEFAULT_TIMEOUT -1 /* not used yet */ struct comstack; @@ -129,7 +136,7 @@ struct comstack 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 (ignored for now) */ - void *private; /* state info for lower stack */ + void *cprivate;/* state info for lower stack */ int more; /* connection has extra data in buffer */ int state; /* current state */ #define CS_UNBND 0 @@ -200,4 +207,8 @@ extern char *cs_errlist[]; #define CS_SR PROTO_SR #define CS_Z3950 PROTO_Z3950 +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/d1_attset.h b/include/d1_attset.h index 191e004..c9d8e73 100644 --- a/include/d1_attset.h +++ b/include/d1_attset.h @@ -30,6 +30,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* * This structure describes a attset, perhaps made up by inclusion * (supersetting) of other attribute sets. When indexing and searching, @@ -68,4 +72,9 @@ typedef struct data1_attset data1_att *data1_getattbyname(data1_attset *s, char *name); data1_attset *data1_read_attset(char *file); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/d1_map.h b/include/d1_map.h index a11087b..80f9f7b 100644 --- a/include/d1_map.h +++ b/include/d1_map.h @@ -28,15 +28,17 @@ #ifndef D1_MAP_H #define D1_MAP_H +#ifdef __cplusplus +extern "C" { +#endif + typedef struct data1_maptag { int new_field; int type; - enum - { - D1_MAPTAG_numeric, - D1_MAPTAG_string - } which; +#define D1_MAPTAG_numeric 1 +#define D1_MAPTAG_string 2 + int which; union { int numeric; @@ -62,4 +64,8 @@ typedef struct data1_maptab struct data1_maptab *next; } data1_maptab; +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/data1.h b/include/data1.h index 96c2d40..e1b3aef 100644 --- a/include/data1.h +++ b/include/data1.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: data1.h,v $ - * Revision 1.20 1996-10-29 13:34:39 adam + * Revision 1.21 1997-05-14 06:53:38 adam + * C++ support. + * + * Revision 1.20 1996/10/29 13:34:39 adam * New functions to get/set data1_tabpath. * * Revision 1.19 1996/10/11 11:57:16 quinn @@ -138,6 +141,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #define data1_matchstr(s1, s2) yaz_matchstr(s1, s2) extern char *data1_tabpath; /* global path for tables */ @@ -203,7 +210,7 @@ typedef struct data1_esetname typedef struct data1_vartype { char *name; - struct data1_varclass *class; + struct data1_varclass *zclass; int type; data1_datatype datatype; struct data1_vartype *next; @@ -213,7 +220,7 @@ typedef struct data1_varclass { char *name; struct data1_varset *set; - int class; + int zclass; data1_vartype *types; struct data1_varclass *next; } data1_varclass; @@ -234,11 +241,9 @@ struct data1_tagset; typedef struct data1_tag { data1_name *names; - enum - { - DATA1T_numeric, - DATA1T_string - } which; +#define DATA1T_numeric 1 +#define DATA1T_string 2 + int which; union { int numeric; @@ -300,14 +305,17 @@ typedef struct data1_absyn typedef struct data1_node { - enum - { - DATA1N_root, /* the root of a record (containing global data) */ - DATA1N_tag, /* a tag */ - DATA1N_data, /* some data under a leaf tag or variant */ - DATA1N_variant, /* variant specification (a triple, actually) */ - DATA1N_indicator /* ISO2709 indicator */ - } which; + /* the root of a record (containing global data) */ +#define DATA1N_root 1 + /* a tag */ +#define DATA1N_tag 2 + /* some data under a leaf tag or variant */ +#define DATA1N_data 3 + /* variant specification (a triple, actually) */ +#define DATA1N_variant 4 + /* ISO2709 indicator */ +#define DATA1N_indicator 5 + int which; union { @@ -329,14 +337,17 @@ typedef struct data1_node struct { - enum - { - DATA1I_inctxt, /* text inclusion */ - DATA1I_incbin, /* binary data inclusion */ - DATA1I_text, /* text data */ - DATA1I_num, /* numerical data */ - DATA1I_oid /* object identifier */ - } what; + /* text inclusion */ +#define DATA1I_inctxt 1 + /* binary data inclusion */ +#define DATA1I_incbin 2 + /* text data */ +#define DATA1I_text 3 + /* numerical data */ +#define DATA1I_num 4 + /* object identifier */ +#define DATA1I_oid 5 + int what; int formatted_text; /* newlines are significant */ int len; char *data; /* filename or data */ @@ -386,7 +397,7 @@ data1_node *data1_insert_taggeddata(data1_node *root, data1_node *at, char *tagname, NMEM m); data1_datatype data1_maptype(char *t); data1_varset *data1_read_varset(char *file); -data1_vartype *data1_getvartypebyct(data1_varset *set, char *class, char *type); +data1_vartype *data1_getvartypebyct(data1_varset *set, char *zclass, char *type); Z_Espec1 *data1_read_espec1(char *file, ODR o); int data1_doespec1(data1_node *n, Z_Espec1 *e); data1_esetname *data1_getesetbyname(data1_absyn *a, char *name); @@ -404,4 +415,8 @@ char *data1_nodetosoif(data1_node *n, int select, int *len); void data1_set_tabpath(const char *path); const char *data1_get_tabpath(void); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/diagbib1.h b/include/diagbib1.h index 67433b1..752c0c7 100644 --- a/include/diagbib1.h +++ b/include/diagbib1.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: diagbib1.h,v $ - * Revision 1.4 1995-09-29 17:12:02 quinn + * Revision 1.5 1997-05-14 06:53:39 adam + * C++ support. + * + * Revision 1.4 1995/09/29 17:12:02 quinn * Smallish * * Revision 1.3 1995/09/27 15:02:47 quinn @@ -41,6 +44,19 @@ * */ +#ifndef DIAGBIB1_H +#define DIAGBIB1_H + #include +#ifdef __cplusplus +extern "C" { +#endif + const char *diagbib1_str (int code); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/dmalloc.h b/include/dmalloc.h index a68b59b..e713687 100644 --- a/include/dmalloc.h +++ b/include/dmalloc.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: dmalloc.h,v $ - * Revision 1.5 1995-10-16 13:51:43 quinn + * Revision 1.6 1997-05-14 06:53:39 adam + * C++ support. + * + * Revision 1.5 1995/10/16 13:51:43 quinn * Changes to provide Especs to the backend. * * Revision 1.4 1995/09/29 17:12:02 quinn @@ -49,6 +52,10 @@ #ifndef DMALLOC_H #define DMALLOC_H +#ifdef __cplusplus +extern "C" { +#endif + #ifdef DEBUG_MALLOC #ifdef malloc @@ -70,4 +77,8 @@ void *d_realloc(char *file, int line, char *ptr, int nbytes); #endif +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/log.h b/include/log.h index a0dd4cd..3208599 100644 --- a/include/log.h +++ b/include/log.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: log.h,v $ - * Revision 1.9 1997-05-01 15:06:42 adam + * Revision 1.10 1997-05-14 06:53:40 adam + * C++ support. + * + * Revision 1.9 1997/05/01 15:06:42 adam * Added log_mask_str_x routine. * * Revision 1.8 1996/05/01 12:45:00 quinn @@ -71,6 +74,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #define LOG_FATAL 0x0001 #define LOG_DEBUG 0x0002 #define LOG_WARN 0x0004 @@ -93,4 +100,8 @@ void log_event_start (void (*func)(int level, const char *msg, void *info), void log_event_end (void (*func)(int level, const char *msg, void *info), void *info); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/marcdisp.h b/include/marcdisp.h index 759403c..01c0601 100644 --- a/include/marcdisp.h +++ b/include/marcdisp.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: marcdisp.h,v $ - * Revision 1.4 1995-09-29 17:12:03 quinn + * Revision 1.5 1997-05-14 06:53:40 adam + * C++ support. + * + * Revision 1.4 1995/09/29 17:12:03 quinn * Smallish * * Revision 1.3 1995/09/27 15:02:47 quinn @@ -38,6 +41,19 @@ * */ +#ifndef MARCDISP_H +#define MARCDISP_H + #include + +#ifdef __cplusplus +extern "C" { +#endif + int marc_display (const char *buf, FILE *outf); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/nmem.h b/include/nmem.h index 227d99f..5e0a521 100644 --- a/include/nmem.h +++ b/include/nmem.h @@ -29,6 +29,10 @@ #ifndef NMEM_H #define NMEM_H +#ifdef __cplusplus +extern "C" { +#endif + typedef struct nmem_control *NMEM; void nmem_reset(NMEM n); @@ -37,4 +41,8 @@ int nmem_total(NMEM n); NMEM nmem_create(void); void nmem_destroy(NMEM n); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/odr.h b/include/odr.h index 5f4dac1..4bf13b3 100644 --- a/include/odr.h +++ b/include/odr.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: odr.h,v $ - * Revision 1.20 1997-04-30 08:52:08 quinn + * Revision 1.21 1997-05-14 06:53:41 adam + * C++ support. + * + * Revision 1.20 1997/04/30 08:52:08 quinn * Null * * Revision 1.19 1996/10/08 12:58:08 adam @@ -142,6 +145,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #ifndef bool_t #define bool_t int #endif @@ -274,7 +281,7 @@ typedef int (*Odr_fun)(); typedef struct odr_arm { int tagmode; - int class; + int zclass; int tag; int which; Odr_fun fun; @@ -378,6 +385,10 @@ NMEM odr_extract_mem(ODR o); #define ODR_MAXNAME 256 +#ifdef __cplusplus +} +#endif + #include #include diff --git a/include/odr_use.h b/include/odr_use.h index 615f3e1..e7b2ea0 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.6 1995-09-29 17:12:04 quinn + * Revision 1.7 1997-05-14 06:53:42 adam + * C++ support. + * + * Revision 1.6 1995/09/29 17:12:04 quinn * Smallish * * Revision 1.5 1995/09/27 15:02:48 quinn @@ -55,6 +58,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + typedef struct Odr_external { Odr_oid *direct_reference; /* OPTIONAL */ @@ -78,4 +85,8 @@ int odr_visiblestring(ODR o, char **p, int opt); int odr_graphicstring(ODR o, char **p, int opt); int odr_generalizedtime(ODR o, char **p, int opt); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/oid.h b/include/oid.h index a10c0ff..53e1232 100644 --- a/include/oid.h +++ b/include/oid.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: oid.h,v $ - * Revision 1.17 1997-05-02 08:39:27 quinn + * Revision 1.18 1997-05-14 06:53:42 adam + * C++ support. + * + * Revision 1.17 1997/05/02 08:39:27 quinn * Support for private OID table added. Thanks to Ronald van der Meer * * Revision 1.16 1997/04/30 08:52:08 quinn @@ -86,6 +89,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #define OID_SIZE 100 typedef enum oid_proto @@ -189,4 +196,8 @@ int oid_oidlen(int *o); oid_value oid_getvalbyname(const char *name); void oid_setprivateoids(oident *list); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/options.h b/include/options.h index 51bdf8b..8a360f9 100644 --- a/include/options.h +++ b/include/options.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: options.h,v $ - * Revision 1.4 1995-09-29 17:12:05 quinn + * Revision 1.5 1997-05-14 06:53:43 adam + * C++ support. + * + * Revision 1.4 1995/09/29 17:12:05 quinn * Smallish * * Revision 1.3 1995/09/27 15:02:48 quinn @@ -51,6 +54,16 @@ #ifndef OPTIONS_H #define OPTIONS_H #include + +#ifdef __cplusplus +extern "C" { +#endif + int options (const char *desc, char **argv, int argc, char **arg); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/pquery.h b/include/pquery.h index 417986b..b8ff386 100644 --- a/include/pquery.h +++ b/include/pquery.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: pquery.h,v $ - * Revision 1.6 1996-08-12 14:09:24 adam + * Revision 1.7 1997-05-14 06:53:43 adam + * C++ support. + * + * Revision 1.6 1996/08/12 14:09:24 adam * Default prefix query attribute set defined by using p_query_attset. * * Revision 1.5 1996/03/15 11:01:46 adam @@ -51,9 +54,18 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + Z_RPNQuery *p_query_rpn (ODR o, oid_proto proto, const char *qbuf); Z_AttributesPlusTerm *p_query_scan (ODR o, oid_proto proto, Odr_oid **attributeSetP, const char *qbuf); int p_query_attset (const char *arg); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/proto.h b/include/proto.h index 0874a0e..59f0dc1 100644 --- a/include/proto.h +++ b/include/proto.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: proto.h,v $ - * Revision 1.38 1997-04-30 08:52:09 quinn + * Revision 1.39 1997-05-14 06:53:44 adam + * C++ support. + * + * Revision 1.38 1997/04/30 08:52:09 quinn * Null * * Revision 1.37 1996/10/09 15:54:58 quinn @@ -181,6 +184,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /* * Because we didn't have time to put all of the extra v3 elements in here * before the first applications were written, we have to place them @@ -1355,6 +1362,10 @@ int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt); Z_APDU *zget_APDU(ODR o, int which); int z_Query(ODR o, Z_Query **p, int opt); +#ifdef __cplusplus +} +#endif + #include #include #include diff --git a/include/prt-acc.h b/include/prt-acc.h index deca70d..9dcd21c 100644 --- a/include/prt-acc.h +++ b/include/prt-acc.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: prt-acc.h,v $ - * Revision 1.6 1996-01-02 08:57:35 quinn + * Revision 1.7 1997-05-14 06:53:46 adam + * C++ support. + * + * Revision 1.6 1996/01/02 08:57:35 quinn * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass * * Revision 1.5 1995/09/29 17:12:09 quinn @@ -48,6 +51,10 @@ #ifndef PRT_ACC_H #define PRT_ACC_H +#ifdef __cplusplus +extern "C" { +#endif + typedef struct Z_Encryption1 { Odr_oct *cryptType; /* OPTIONAL */ @@ -155,4 +162,8 @@ typedef struct Z_PromptObject1 int z_PromptObject1(ODR o, Z_PromptObject1 **p, int opt); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/prt-add.h b/include/prt-add.h index 857b194..92bc5d7 100644 --- a/include/prt-add.h +++ b/include/prt-add.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: prt-add.h,v $ - * Revision 1.2 1997-04-30 08:52:09 quinn + * Revision 1.3 1997-05-14 06:53:46 adam + * C++ support. + * + * Revision 1.2 1997/04/30 08:52:09 quinn * Null * * Revision 1.1 1996/10/10 11:51:58 quinn @@ -36,6 +39,10 @@ #ifndef PRT_ADD_H #define PRT_ADD_H +#ifdef __cplusplus +extern "C" { +#endif + typedef struct Z_QueryExpressionTerm { Z_Term *queryTerm; @@ -98,4 +105,8 @@ typedef struct Z_SearchInfoReport int z_SearchInfoReport (ODR o, Z_SearchInfoReport **p, int opt); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/prt-arc.h b/include/prt-arc.h index 5dcabcf..bf120b5 100644 --- a/include/prt-arc.h +++ b/include/prt-arc.h @@ -28,6 +28,10 @@ #ifndef PRT_ARC_H #define PRT_ARC_H +#ifdef __cplusplus +extern "C" { +#endif + /* ------------------- Summary Record --------------------- */ typedef struct Z_FormatSpec @@ -126,4 +130,8 @@ typedef struct Z_OPACRecord int z_BriefBib(ODR o, Z_BriefBib **p, int opt); int z_OPACRecord(ODR o, Z_OPACRecord **p, int opt); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/prt-dia.h b/include/prt-dia.h index a7e80d2..e971786 100644 --- a/include/prt-dia.h +++ b/include/prt-dia.h @@ -30,6 +30,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + typedef struct Z_TooMany { int *tooManyWhat; @@ -324,4 +328,8 @@ typedef struct Z_DiagnosticFormat int z_DiagnosticFormat(ODR o, Z_DiagnosticFormat **p, int opt); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/prt-esp.h b/include/prt-esp.h index c1c7c56..7e2ad53 100644 --- a/include/prt-esp.h +++ b/include/prt-esp.h @@ -30,6 +30,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + typedef struct Z_OccurValues { int *start; @@ -134,4 +138,8 @@ typedef struct Z_Espec1 int z_Espec1(ODR o, Z_Espec1 **p, int opt); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/prt-exd.h b/include/prt-exd.h index 0b8bdce..48ea85d 100644 --- a/include/prt-exd.h +++ b/include/prt-exd.h @@ -30,6 +30,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + typedef struct Z_TaskPackage { Odr_oid *packageType; @@ -254,4 +258,8 @@ typedef struct Z_IUUpdate int z_IUUpdate(ODR o, Z_IUUpdate **p, int opt); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/prt-exp.h b/include/prt-exp.h index e842231..cfcf2bc 100644 --- a/include/prt-exp.h +++ b/include/prt-exp.h @@ -30,6 +30,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #define multipleDbSearch multipleDBsearch typedef struct Z_CommonInfo @@ -148,7 +152,7 @@ typedef struct Z_ProxSupportUnit union { int *known; - Z_ProxSupportPrivate *private; + Z_ProxSupportPrivate *zprivate; } u; } Z_ProxSupportUnit; @@ -186,7 +190,7 @@ typedef struct Z_QueryTypeDetails #define Z_QueryTypeDetails_rankedList 5 union { - Z_PrivateCapabilities *private; + Z_PrivateCapabilities *zprivate; Z_RpnCapabilities *rpn; Z_Iso8777Capabilities *iso8777; Z_HumanString *z3958; @@ -997,4 +1001,8 @@ typedef struct Z_ExplainRecord int z_ExplainRecord(ODR o, Z_ExplainRecord **p, int opt); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/prt-ext.h b/include/prt-ext.h index 5fb4729..30b2541 100644 --- a/include/prt-ext.h +++ b/include/prt-ext.h @@ -34,6 +34,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* * Used to keep track of known External definitions (a loose approach * to DEFINED_BY). @@ -98,4 +102,8 @@ struct Z_External int z_External(ODR o, Z_External **p, int opt); Z_ext_typeent *z_ext_getentbyref(oid_value val); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/prt-grs.h b/include/prt-grs.h index 7983a63..f65eccc 100644 --- a/include/prt-grs.h +++ b/include/prt-grs.h @@ -30,6 +30,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + struct Z_GenericRecord; typedef struct Z_GenericRecord Z_GenericRecord; @@ -94,7 +98,7 @@ typedef struct Z_HitVector typedef struct Z_Triple { Odr_oid *variantSetId; /* OPTIONAL */ - int *class; + int *zclass; int *type; int which; #define Z_Triple_integer 0 @@ -173,4 +177,8 @@ struct Z_GenericRecord int z_GenericRecord(ODR o, Z_GenericRecord **p, int opt); int z_Variant(ODR o, Z_Variant **p, int opt); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/prt-rsc.h b/include/prt-rsc.h index 1fff481..5cc2e61 100644 --- a/include/prt-rsc.h +++ b/include/prt-rsc.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: prt-rsc.h,v $ - * Revision 1.5 1995-09-29 17:12:11 quinn + * Revision 1.6 1997-05-14 06:53:50 adam + * C++ support. + * + * Revision 1.5 1995/09/29 17:12:11 quinn * Smallish * * Revision 1.4 1995/09/27 15:02:52 quinn @@ -47,6 +50,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* -------------------- Resource-1 -------------------- */ #define Z_EstimateType_currentSearchRecords 1 @@ -99,4 +106,8 @@ typedef struct Z_ResourceReport2 int z_ResourceReport2(ODR o, Z_ResourceReport2 **p, int opt); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/prt.h b/include/prt.h index ef51694..4c52abf 100644 --- a/include/prt.h +++ b/include/prt.h @@ -3,16 +3,20 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + int ber_boolean(ODR o, int *val); -int ber_tag(ODR o, void *p, int class, int tag, int *constructed, int opt); -int ber_enctag(ODR o, int class, int tag, int constructed); -int ber_dectag(unsigned char *buf, int *class, int *tag, int *constructed); +int ber_tag(ODR o, void *p, int zclass, int tag, int *constructed, int opt); +int ber_enctag(ODR o, int zclass, int tag, int constructed); +int ber_dectag(unsigned char *buf, int *zclass, int *tag, int *constructed); int odr_bool(ODR o, int **p, int opt); int odr_integer(ODR o, int **p, int opt); -int odr_implicit_settag(ODR o, int class, int tag); +int odr_implicit_settag(ODR o, int zclass, int tag); #if 0 int odr_implicit(ODR o, int (*type)(ODR o, void *p, int opt), void *p, - int class, int tag, int opt); + int zclass, int tag, int opt); #endif int ber_enclen(ODR o, int len, int lenlen, int exact); int ber_declen(unsigned char *buf, int *len); @@ -20,7 +24,7 @@ char *odr_indent(ODR o); int ber_null(ODR o); int odr_null(ODR o, Odr_null **p, int opt); int ber_integer(ODR o, int *val); -int odr_constructed_begin(ODR o, void *p, int class, int tag); +int odr_constructed_begin(ODR o, void *p, int zclass, int tag); int odr_constructed_end(ODR o); int odr_sequence_begin(ODR o, void *p, int size); int odr_sequence_end(ODR o); @@ -52,7 +56,11 @@ int odr_total(ODR o); char *odr_errmsg(int n); Odr_oid *odr_getoidbystr(ODR o, char *str); int odr_initmember(ODR o, void *p, int size); -int odr_peektag(ODR o, int *class, int *tag, int *cons); +int odr_peektag(ODR o, int *zclass, int *tag, int *cons); void odr_setlenlen(ODR o, int len); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/readconf.h b/include/readconf.h index a494586..7d76de1 100644 --- a/include/readconf.h +++ b/include/readconf.h @@ -4,9 +4,17 @@ #include -int readconf(char *name, void *private, - int (*fun)(char *name, void *private, int argc, char *argv[])); +#ifdef __cplusplus +extern "C" { +#endif + +int readconf(char *name, void *rprivate, +int (*fun)(char *name, void *rprivate, int argc, char *argv[])); int readconf_line(FILE *f, char *line, int len, char *argv[], int num); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/statserv.h b/include/statserv.h index 99c3834..2276efd 100644 --- a/include/statserv.h +++ b/include/statserv.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: statserv.h,v $ - * Revision 1.7 1995-09-29 17:12:12 quinn + * Revision 1.8 1997-05-14 06:53:51 adam + * C++ support. + * + * Revision 1.7 1995/09/29 17:12:12 quinn * Smallish * * Revision 1.6 1995/09/27 15:02:53 quinn @@ -48,6 +51,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + typedef struct statserv_options_block { int dynamic; /* fork on incoming requests */ @@ -66,4 +73,8 @@ int statserv_main(int argc, char **argv); statserv_options_block *statserv_getcontrol(void); void statserv_setcontrol(statserv_options_block *block); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/tcpip.h b/include/tcpip.h index 44efb12..a39ccfc 100644 --- a/include/tcpip.h +++ b/include/tcpip.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: tcpip.h,v $ - * Revision 1.7 1996-07-06 19:58:32 quinn + * Revision 1.8 1997-05-14 06:53:52 adam + * C++ support. + * + * Revision 1.7 1996/07/06 19:58:32 quinn * System headerfiles gathered in yconfig * * Revision 1.6 1996/02/10 12:23:42 quinn @@ -63,8 +66,16 @@ #define YNETINCLUDE #include +#ifdef __cplusplus +extern "C" { +#endif + struct sockaddr_in *tcpip_strtoaddr(const char *str); COMSTACK tcpip_type(int s, int blocking, int protocol); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/tpath.h b/include/tpath.h index 9bb286e..2ddfc10 100644 --- a/include/tpath.h +++ b/include/tpath.h @@ -25,4 +25,17 @@ * */ +#ifndef TPATH_H +#define TPATH_H + +#ifdef __cplusplus +extern "C" { +#endif + FILE *yaz_path_fopen(const char *path, const char *name, const char *mode); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/wrbuf.h b/include/wrbuf.h index 9e8d15e..4c011e3 100644 --- a/include/wrbuf.h +++ b/include/wrbuf.h @@ -30,6 +30,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + typedef struct wrbuf { char *buf; @@ -50,4 +54,8 @@ int wrbuf_write(WRBUF b, char *buf, int size); (((b)->pos >= (b)->size ? wrbuf_grow(b, 1) : 0), \ (b)->buf[(b)->pos++] = (c), 0) +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/xmalloc.h b/include/xmalloc.h index 4d8af51..48d0fb8 100644 --- a/include/xmalloc.h +++ b/include/xmalloc.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: xmalloc.h,v $ - * Revision 1.1 1995-11-01 11:55:41 quinn + * Revision 1.2 1997-05-14 06:53:53 adam + * C++ support. + * + * Revision 1.1 1995/11/01 11:55:41 quinn * Added xmalloc.c * * Revision 1.8 1995/10/16 14:03:07 quinn @@ -62,6 +65,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + void *xrealloc_f (void *o, size_t size, char *file, int line); void *xmalloc_f (size_t size, char *file, int line); void *xcalloc_f (size_t nmemb, size_t size, char *file, int line); @@ -74,4 +81,8 @@ void xfree_f (void *p, char *file, int line); #define xfree(x) xfree_f(x, __FILE__, __LINE__) #define xstrdup(s) xstrdup_f(s, __FILE__, __LINE__) +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/xmosi.h b/include/xmosi.h index 384a2ba..c359faa 100644 --- a/include/xmosi.h +++ b/include/xmosi.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: xmosi.h,v $ - * Revision 1.5 1996-02-10 12:23:43 quinn + * Revision 1.6 1997-05-14 06:53:53 adam + * C++ support. + * + * Revision 1.5 1996/02/10 12:23:43 quinn * Enable inetd operations fro TCP/IP stack * * Revision 1.4 1995/09/29 17:12:13 quinn @@ -61,8 +64,16 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + struct netbuf *mosi_strtoaddr(const char *str); COMSTACK mosi_type(int s, int blocking, int protocol); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/yaz-ccl.h b/include/yaz-ccl.h index 2868acd..b433acf 100644 --- a/include/yaz-ccl.h +++ b/include/yaz-ccl.h @@ -24,7 +24,10 @@ * OF THIS SOFTWARE. * * $Log: yaz-ccl.h,v $ - * Revision 1.5 1995-09-29 17:12:14 quinn + * Revision 1.6 1997-05-14 06:53:54 adam + * C++ support. + * + * Revision 1.5 1995/09/29 17:12:14 quinn * Smallish * * Revision 1.4 1995/09/27 15:02:54 quinn @@ -43,7 +46,15 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + Z_RPNQuery *ccl_rpn_query (struct ccl_rpn_node *p); Z_AttributesPlusTerm *ccl_scan_query (struct ccl_rpn_node *p); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/yaz-util.h b/include/yaz-util.h index 92a80b2..5446824 100644 --- a/include/yaz-util.h +++ b/include/yaz-util.h @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: yaz-util.h,v $ - * Revision 1.2 1996-02-20 17:58:09 adam + * Revision 1.3 1997-05-14 06:53:54 adam + * C++ support. + * + * Revision 1.2 1996/02/20 17:58:09 adam * Added const to yaz_matchstr. * * Revision 1.1 1996/02/20 16:32:49 quinn @@ -16,6 +19,14 @@ #ifndef YAZ_UTIL_H #define YAZ_UTIL_H +#ifdef __cplusplus +extern "C" { +#endif + int yaz_matchstr(const char *s1, const char *s2); +#ifdef __cplusplus +} +#endif + #endif diff --git a/odr/ber_any.c b/odr/ber_any.c index ace1738..7b56f0f 100644 --- a/odr/ber_any.c +++ b/odr/ber_any.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ber_any.c,v $ - * Revision 1.12 1995-09-29 17:12:15 quinn + * Revision 1.13 1997-05-14 06:53:56 adam + * C++ support. + * + * Revision 1.12 1995/09/29 17:12:15 quinn * Smallish * * Revision 1.11 1995/09/27 15:02:54 quinn @@ -76,14 +79,14 @@ int ber_any(ODR o, Odr_any **p) */ int completeBER(unsigned char *buf, int len) { - int res, ll, class, tag, cons; + int res, ll, zclass, tag, cons; unsigned char *b = buf; if (!len) return 0; if (!buf[0] && !buf[1]) return 0; - if ((res = ber_dectag(b, &class, &tag, &cons)) <= 0) + if ((res = ber_dectag(b, &zclass, &tag, &cons)) <= 0) return 0; if (res > len) return 0; diff --git a/odr/ber_tag.c b/odr/ber_tag.c index b71acea..de1ad36 100644 --- a/odr/ber_tag.c +++ b/odr/ber_tag.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ber_tag.c,v $ - * Revision 1.13 1995-09-29 17:12:21 quinn + * Revision 1.14 1997-05-14 06:53:56 adam + * C++ support. + * + * Revision 1.13 1995/09/29 17:12:21 quinn * Smallish * * Revision 1.12 1995/09/27 15:02:57 quinn @@ -54,12 +57,12 @@ * if p: write tag. return 1 (success) or -1 (error). * if !p: return 0. * On decoding: - * if tag && class match up, advance pointer and return 1. set cons. + * if tag && zclass match up, advance pointer and return 1. set cons. * else leave pointer unchanged. Return 0. * * Should perhaps be odr_tag? */ -int ber_tag(ODR o, void *p, int class, int tag, int *constructed, int opt) +int ber_tag(ODR o, void *p, int zclass, int tag, int *constructed, int opt) { static int lclass = -1, ltag, br, lcons; /* save t&c rather than decoding twice */ @@ -85,10 +88,10 @@ int ber_tag(ODR o, void *p, int class, int tag, int *constructed, int opt) o->error = OREQUIRED; return 0; } - if ((rd = ber_enctag(o, class, tag, *constructed)) < 0) + if ((rd = ber_enctag(o, zclass, tag, *constructed)) < 0) return -1; #ifdef ODR_DEBUG - fprintf(stderr, "\n[class=%d,tag=%d,cons=%d,stackp=%d]", class, tag, + fprintf(stderr, "\n[class=%d,tag=%d,cons=%d,stackp=%d]", zclass, tag, *constructed, o->stackp); #endif return 1; @@ -111,7 +114,7 @@ int ber_tag(ODR o, void *p, int class, int tag, int *constructed, int opt) lcons, o->stackp); #endif } - if (class == lclass && tag == ltag) + if (zclass == lclass && tag == ltag) { o->bp += br; o->left -= br; @@ -134,15 +137,15 @@ int ber_tag(ODR o, void *p, int class, int tag, int *constructed, int opt) } /* ber_enctag - * BER-encode a class/tag/constructed package (identifier octets). Return + * BER-encode a zclass/tag/constructed package (identifier octets). Return * number of bytes encoded, or -1 if out of bounds. */ -int ber_enctag(ODR o, int class, int tag, int constructed) +int ber_enctag(ODR o, int zclass, int tag, int constructed) { int cons = (constructed ? 1 : 0), n = 0; unsigned char octs[sizeof(int)], b; - b = (class << 6) & 0XC0; + b = (zclass << 6) & 0XC0; b |= (cons << 5) & 0X20; if (tag <= 30) { @@ -177,11 +180,11 @@ int ber_enctag(ODR o, int class, int tag, int constructed) /* ber_dectag * Decode BER identifier octets. Return number of bytes read or -1 for error. */ -int ber_dectag(unsigned char *buf, int *class, int *tag, int *constructed) +int ber_dectag(unsigned char *buf, int *zclass, int *tag, int *constructed) { unsigned char *b = buf; - *class = *b >> 6; + *zclass = *b >> 6; *constructed = (*b >> 5) & 0X01; if ((*tag = *b & 0x1F) <= 30) return 1; diff --git a/odr/dumpber.c b/odr/dumpber.c index 7acc3aa..47ca851 100644 --- a/odr/dumpber.c +++ b/odr/dumpber.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: dumpber.c,v $ - * Revision 1.7 1996-03-08 14:38:41 quinn + * Revision 1.8 1997-05-14 06:53:57 adam + * C++ support. + * + * Revision 1.7 1996/03/08 14:38:41 quinn * Fixed output. * * Revision 1.6 1996/01/19 15:41:34 quinn @@ -33,14 +36,14 @@ static int do_dumpBER(FILE *f, char *buf, int len, int level, int offset) { - int res, ll, class, tag, cons; + int res, ll, zclass, tag, cons; char *b = buf; if (!len) return 0; if (!buf[0] && !buf[1]) return 0; - if ((res = ber_dectag((unsigned char*)b, &class, &tag, &cons)) <= 0) + if ((res = ber_dectag((unsigned char*)b, &zclass, &tag, &cons)) <= 0) return 0; if (res > len) { @@ -48,7 +51,7 @@ static int do_dumpBER(FILE *f, char *buf, int len, int level, int offset) return 0; } fprintf(f, "%5d: %*s", offset, level * 4, ""); - if (class == ODR_UNIVERSAL) + if (zclass == ODR_UNIVERSAL) { static char *nl[] = { @@ -65,10 +68,10 @@ static int do_dumpBER(FILE *f, char *buf, int len, int level, int offset) else fprintf(f, "[UNIV %d]", tag); } - else if (class == ODR_CONTEXT) + else if (zclass == ODR_CONTEXT) fprintf(f, "[%d]", tag); else - fprintf(f, "[%d:%d]", class, tag); + fprintf(f, "[%d:%d]", zclass, tag); b += res; len -= res; if ((res = ber_declen((unsigned char*)b, &ll)) <= 0) diff --git a/odr/odr_choice.c b/odr/odr_choice.c index 46be207..a4df25e 100644 --- a/odr/odr_choice.c +++ b/odr/odr_choice.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_choice.c,v $ - * Revision 1.13 1997-04-30 08:52:10 quinn + * Revision 1.14 1997-05-14 06:53:57 adam + * C++ support. + * + * Revision 1.13 1997/04/30 08:52:10 quinn * Null * * Revision 1.12 1996/10/08 12:58:17 adam @@ -79,10 +82,10 @@ int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp) } else if (o->direction != ODR_DECODE) { - cl = arm[i].class; + cl = arm[i].zclass; tg = arm[i].tag; } - if (tg == arm[i].tag && cl == arm[i].class) + if (tg == arm[i].tag && cl == arm[i].zclass) { if (arm[i].tagmode == ODR_IMPLICIT) { diff --git a/odr/odr_cons.c b/odr/odr_cons.c index 70dab2d..c1abbf4 100644 --- a/odr/odr_cons.c +++ b/odr/odr_cons.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_cons.c,v $ - * Revision 1.17 1996-10-23 12:31:24 adam + * Revision 1.18 1997-05-14 06:53:58 adam + * C++ support. + * + * Revision 1.17 1996/10/23 12:31:24 adam * Added 'static' modifier to dummy variable in odr_constructed_begin. * * Revision 1.16 1996/07/26 13:38:20 quinn @@ -68,7 +71,7 @@ void odr_setlenlen(ODR o, int len) o->lenlen = len; } -int odr_constructed_begin(ODR o, void *p, int class, int tag) +int odr_constructed_begin(ODR o, void *p, int zclass, int tag) { int res; int cons = 1; @@ -79,7 +82,7 @@ int odr_constructed_begin(ODR o, void *p, int class, int tag) o->lenlen = 1; /* reset lenlen */ if (o->t_class < 0) { - o->t_class = class; + o->t_class = zclass; o->t_tag = tag; } if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, 1)) < 0) diff --git a/odr/odr_seq.c b/odr/odr_seq.c index d682c3f..7597d28 100644 --- a/odr/odr_seq.c +++ b/odr/odr_seq.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_seq.c,v $ - * Revision 1.17 1997-05-05 11:21:09 adam + * Revision 1.18 1997-05-14 06:53:58 adam + * C++ support. + * + * Revision 1.17 1997/05/05 11:21:09 adam * In handling of SEQUENCE OF: Counter set to zero when SEQUENCE * OF isn't there at all. * @@ -102,12 +105,8 @@ int odr_sequence_of(ODR o, Odr_fun type, void *p, int *num) char **tmp = 0; int size = 0, i; - if (!odr_sequence_begin(o, p, 0)) { - if (o->direction == ODR_DECODE) { - *num = 0; - } + if (!odr_sequence_begin(o, p, 0)) return 0; - } switch (o->direction) { diff --git a/odr/odr_tag.c b/odr/odr_tag.c index 9948645..129a272 100644 --- a/odr/odr_tag.c +++ b/odr/odr_tag.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_tag.c,v $ - * Revision 1.7 1996-02-20 12:52:54 quinn + * Revision 1.8 1997-05-14 06:53:59 adam + * C++ support. + * + * Revision 1.7 1996/02/20 12:52:54 quinn * Added odr_peektag * * Revision 1.6 1995/12/14 16:28:26 quinn @@ -29,7 +32,7 @@ #include -int odr_peektag(ODR o, int *class, int *tag, int *cons) +int odr_peektag(ODR o, int *zclass, int *tag, int *cons) { if (o->direction != ODR_DECODE) { @@ -38,7 +41,7 @@ int odr_peektag(ODR o, int *class, int *tag, int *cons) } if (o->stackp > -1 && !odr_constructed_more(o)) return 0; - if (ber_dectag(o->bp, class, tag, cons) <= 0) + if (ber_dectag(o->bp, zclass, tag, cons) <= 0) { o->error = OREQUIRED; return 0; @@ -46,13 +49,13 @@ int odr_peektag(ODR o, int *class, int *tag, int *cons) return 1; } -int odr_implicit_settag(ODR o, int class, int tag) +int odr_implicit_settag(ODR o, int zclass, int tag) { if (o->error) return 0; if (o->t_class < 0) { - o->t_class = class; + o->t_class = zclass; o->t_tag = tag; } return 1; diff --git a/retrieval/d1_absyn.c b/retrieval/d1_absyn.c index 9fcc3ed..3f2f3a0 100644 --- a/retrieval/d1_absyn.c +++ b/retrieval/d1_absyn.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_absyn.c,v $ - * Revision 1.9 1997-02-19 14:46:15 adam + * Revision 1.10 1997-05-14 06:54:01 adam + * C++ support. + * + * Revision 1.9 1997/02/19 14:46:15 adam * The "all" specifier only affects elements that are indexed (and not * all elements). * @@ -174,7 +177,7 @@ data1_absyn *data1_read_absyn(char *file) *args = '\0'; if (!strcmp(cmd, "elm")) { - data1_element *new; + data1_element *new_element; int i; char path[512], name[512], termlists[512], *p; int type, value; @@ -204,15 +207,15 @@ data1_absyn *data1_read_absyn(char *file) return 0; } level = i; - if (!(new = cur[level] = *ppl[level] = xmalloc(sizeof(*new)))) + if (!(new_element = cur[level] = *ppl[level] = xmalloc(sizeof(*new_element)))) abort; - new->next = new->children = 0; - new->tag = 0; - new->termlists = 0; - new->parent = level ? cur[level - 1] : 0; - tp = &new->termlists; - ppl[level] = &new->next; - ppl[level+1] = &new->children; + new_element->next = new_element->children = 0; + new_element->tag = 0; + new_element->termlists = 0; + new_element->parent = level ? cur[level - 1] : 0; + tp = &new_element->termlists; + ppl[level] = &new_element->next; + ppl[level+1] = &new_element->children; /* well-defined tag */ if (sscanf(p, "(%d,%d)", &type, &value) == 2) @@ -223,7 +226,7 @@ data1_absyn *data1_read_absyn(char *file) fclose(f); return 0; } - if (!(new->tag = data1_gettagbynum(res->tagset, type, value))) + if (!(new_element->tag = data1_gettagbynum(res->tagset, type, value))) { logf(LOG_WARN, "Couldn't find tag %s in tagset in %s", p, file); @@ -234,10 +237,10 @@ data1_absyn *data1_read_absyn(char *file) /* private tag */ else if (*p) { - data1_tag *nt = new->tag = xmalloc(sizeof(*new->tag)); + data1_tag *nt = new_element->tag = xmalloc(sizeof(*new_element->tag)); nt->which = DATA1T_string; nt->value.string = xstrdup(p); - nt->names = xmalloc(sizeof(*new->tag->names)); + nt->names = xmalloc(sizeof(*new_element->tag->names)); nt->names->name = nt->value.string; nt->names->next = 0; nt->kind = DATA1K_string; @@ -254,7 +257,7 @@ data1_absyn *data1_read_absyn(char *file) /* parse termList definitions */ p = termlists; if (*p == '-') - new->termlists = 0; + new_element->termlists = 0; else { if (!res->attset) @@ -301,7 +304,7 @@ data1_absyn *data1_read_absyn(char *file) *tp = all; /* append any ALL entries to the list */ } - new->name = xstrdup(name); + new_element->name = xstrdup(name); } else if (!strcmp(cmd, "all")) { diff --git a/retrieval/d1_doespec.c b/retrieval/d1_doespec.c index 5914a67..29a6df4 100644 --- a/retrieval/d1_doespec.c +++ b/retrieval/d1_doespec.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_doespec.c,v $ - * Revision 1.7 1997-04-30 08:52:11 quinn + * Revision 1.8 1997-05-14 06:54:02 adam + * C++ support. + * + * Revision 1.7 1997/04/30 08:52:11 quinn * Null * * Revision 1.6 1996/10/11 11:57:22 quinn @@ -48,7 +51,7 @@ static int match_children_wildpath(data1_node *n, Z_Espec1 *e, int i, * triple with an unknown set. */ static Z_Triple *find_triple(Z_Variant *var, oid_value universalset, - oid_value set, int class, int type) + oid_value set, int zclass, int type) { int i; oident *defaultsetent = oid_getentbyoid(var->globalVariantSetId); @@ -62,7 +65,7 @@ static Z_Triple *find_triple(Z_Variant *var, oid_value universalset, oid_value curset = cursetent ? cursetent->value : defaultset; if (set == curset && - *var->triples[i]->class == class && + *var->triples[i]->zclass == zclass && *var->triples[i]->type == type) return var->triples[i]; } diff --git a/retrieval/d1_espec.c b/retrieval/d1_espec.c index c157ad2..83fe26f 100644 --- a/retrieval/d1_espec.c +++ b/retrieval/d1_espec.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_espec.c,v $ - * Revision 1.6 1996-07-06 19:58:34 quinn + * Revision 1.7 1997-05-14 06:54:02 adam + * C++ support. + * + * Revision 1.6 1996/07/06 19:58:34 quinn * System headerfiles gathered in yconfig * * Revision 1.5 1996/01/02 08:57:44 quinn @@ -56,11 +59,11 @@ static Z_Variant *read_variant(int argc, char **argv, ODR o) r->num_triples = argc; for (i = 0; i < argc; i++) { - int class, type; + int zclass, type; char value[512]; Z_Triple *t; - if (sscanf(argv[i], "(%d,%d,%[^)])", &class, &type, value) < 3) + if (sscanf(argv[i], "(%d,%d,%[^)])", &zclass, &type, value) < 3) { logf(LOG_WARN, "Syntax error in variant component '%s'", argv[i]); @@ -68,8 +71,8 @@ static Z_Variant *read_variant(int argc, char **argv, ODR o) } t = r->triples[i] = odr_malloc(o, sizeof(Z_Triple)); t->variantSetId = 0; - t->class = odr_malloc(o, sizeof(int)); - *t->class = class; + t->zclass = odr_malloc(o, sizeof(int)); + *t->zclass = zclass; t->type = odr_malloc(o, sizeof(int)); *t->type = type; /* diff --git a/retrieval/d1_grs.c b/retrieval/d1_grs.c index 8f0b66e..1a9d313 100644 --- a/retrieval/d1_grs.c +++ b/retrieval/d1_grs.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_grs.c,v $ - * Revision 1.8 1996-12-05 13:17:49 quinn + * Revision 1.9 1997-05-14 06:54:03 adam + * C++ support. + * + * Revision 1.8 1996/12/05 13:17:49 quinn * Fixed GRS-1 null-ref * * Revision 1.7 1996/10/11 11:57:23 quinn @@ -89,8 +92,8 @@ static Z_Variant *make_variant(data1_node *n, int num, ODR o) assert(p->which == DATA1N_variant); t = v->triples[num] = odr_malloc(o, sizeof(*t)); t->variantSetId = 0; - t->class = odr_malloc(o, sizeof(int)); - *t->class = p->u.variant.type->class->class; + t->zclass = odr_malloc(o, sizeof(int)); + *t->zclass = p->u.variant.type->zclass->zclass; t->type = odr_malloc(o, sizeof(int)); *t->type = p->u.variant.type->type; diff --git a/retrieval/d1_read.c b/retrieval/d1_read.c index a430565..1740c21 100644 --- a/retrieval/d1_read.c +++ b/retrieval/d1_read.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_read.c,v $ - * Revision 1.13 1996-10-29 13:35:38 adam + * Revision 1.14 1997-05-14 06:54:04 adam + * C++ support. + * + * Revision 1.13 1996/10/29 13:35:38 adam * Implemented data1_set_tabpath and data1_get_tabpath. * * Revision 1.12 1996/10/11 10:35:38 adam @@ -302,18 +305,18 @@ data1_node *data1_read_node(char **buf, data1_node *parent, int *line, } else if (!strncmp(tag, "var", 3)) { - char class[DATA1_MAX_SYMBOL], type[DATA1_MAX_SYMBOL]; + char tclass[DATA1_MAX_SYMBOL], type[DATA1_MAX_SYMBOL]; data1_vartype *tp; int val_offset; data1_node *p; - if (sscanf(args, "%s %s %n", class, type, &val_offset) != 2) + if (sscanf(args, "%s %s %n", tclass, type, &val_offset) != 2) { logf(LOG_WARN, "Malformed variant triple at '%s'", tag); return 0; } if (!(tp = data1_getvartypebyct(parent->root->u.root.absyn->varset, - class, type))) + tclass, type))) return 0; /* diff --git a/retrieval/d1_varset.c b/retrieval/d1_varset.c index f132610..1af6e70 100644 --- a/retrieval/d1_varset.c +++ b/retrieval/d1_varset.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_varset.c,v $ - * Revision 1.3 1995-11-01 16:34:58 quinn + * Revision 1.4 1997-05-14 06:54:04 adam + * C++ support. + * + * Revision 1.3 1995/11/01 16:34:58 quinn * Making data1 look for tables in data1_tabpath * * Revision 1.2 1995/11/01 13:54:50 quinn @@ -26,28 +29,28 @@ #include #include -data1_vartype *data1_getvartypebyct(data1_varset *set, char *class, char *type) +data1_vartype *data1_getvartypebyct(data1_varset *set, char *zclass, char *type) { data1_varclass *c; data1_vartype *t; for (c = set->classes; c; c = c->next) - if (!data1_matchstr(c->name, class)) + if (!data1_matchstr(c->name, zclass)) { for (t = c->types; t; t = t->next) if (!data1_matchstr(t->name, type)) return t; - logf(LOG_WARN, "Unknown variant type %s in class %s", type, class); + logf(LOG_WARN, "Unknown variant type %s in class %s", type, zclass); return 0; } - logf(LOG_WARN, "Unknown variant class %s", class); + logf(LOG_WARN, "Unknown variant class %s", zclass); return 0; } data1_varset *data1_read_varset(char *file) { data1_varset *res = xmalloc(sizeof(*res)); - data1_varclass **classp = &res->classes, *class = 0; + data1_varclass **classp = &res->classes, *zclass = 0; data1_vartype **typep = 0; FILE *f; int argc; @@ -73,9 +76,9 @@ data1_varset *data1_read_varset(char *file) fclose(f); return 0; } - *classp = r = class = xmalloc(sizeof(*r)); + *classp = r = zclass = xmalloc(sizeof(*r)); r->set = res; - r->class = atoi(argv[1]); + r->zclass = atoi(argv[1]); r->name = xmalloc(strlen(argv[2])+1); strcpy(r->name, argv[2]); r->types = 0; @@ -102,7 +105,7 @@ data1_varset *data1_read_varset(char *file) *typep = r = xmalloc(sizeof(*r)); r->name = xmalloc(strlen(argv[2])+1); strcpy(r->name, argv[2]); - r->class = class; + r->zclass = zclass; r->type = atoi(argv[1]); if (!(r->datatype = data1_maptype(argv[3]))) { diff --git a/util/readconf.c b/util/readconf.c index 119b471..57ac8ad 100644 --- a/util/readconf.c +++ b/util/readconf.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: readconf.c,v $ - * Revision 1.3 1996-05-29 15:48:48 quinn + * Revision 1.4 1997-05-14 06:54:07 adam + * C++ support. + * + * Revision 1.3 1996/05/29 15:48:48 quinn * Added \n to the isspace rule. * * Revision 1.2 1996/05/29 10:05:01 quinn @@ -64,8 +67,8 @@ int readconf_line(FILE *f, char *line, int len, char *argv[], int num) /* * Read lines of a configuration file. */ -int readconf(char *name, void *private, - int (*fun)(char *name, void *private, int argc, char *argv[])) +int readconf(char *name, void *rprivate, + int (*fun)(char *name, void *rprivate, int argc, char *argv[])) { FILE *f; char line[512], *m_argv[50]; @@ -86,7 +89,7 @@ int readconf(char *name, void *private, return 0; } - if ((res = (*fun)(name, private, m_argc, m_argv))) + if ((res = (*fun)(name, rprivate, m_argc, m_argv))) { fclose(f); return res;