From: Adam Dickmeiss Date: Fri, 31 Oct 1997 12:20:07 +0000 (+0000) Subject: Improved memory debugging for xmalloc/nmem.c. References to NMEM X-Git-Tag: YAZ.1.8~562 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=068a5a7412f492019b4d6f5e89158098d44368f7;p=yaz-moved-to-github.git Improved memory debugging for xmalloc/nmem.c. References to NMEM instead of ODR in n ESPEC-1 handling in source d1_espec.c. Bug fix: missing fclose in data1_read_espec1. --- diff --git a/client/client.c b/client/client.c index dbf4c7a..16a6175 100644 --- a/client/client.c +++ b/client/client.c @@ -4,7 +4,12 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: client.c,v $ - * Revision 1.54 1997-10-27 13:52:46 adam + * Revision 1.55 1997-10-31 12:20:08 adam + * Improved memory debugging for xmalloc/nmem.c. References to NMEM + * instead of ODR in n ESPEC-1 handling in source d1_espec.c. + * Bug fix: missing fclose in data1_read_espec1. + * + * Revision 1.54 1997/10/27 13:52:46 adam * Header yaz-util includes all YAZ utility header files. * * Revision 1.53 1997/09/29 13:18:59 adam @@ -672,7 +677,6 @@ static int send_searchRequest(char *arg) mediumSetPresentNumber > 0)) { oident prefsyn; - int oid[OID_SIZE]; prefsyn.proto = protocol; prefsyn.oclass = CLASS_RECSYN; diff --git a/include/data1.h b/include/data1.h index e2d0d20..f6e6448 100644 --- a/include/data1.h +++ b/include/data1.h @@ -24,7 +24,12 @@ * OF THIS SOFTWARE. * * $Log: data1.h,v $ - * Revision 1.29 1997-10-27 13:54:18 adam + * Revision 1.30 1997-10-31 12:20:07 adam + * Improved memory debugging for xmalloc/nmem.c. References to NMEM + * instead of ODR in n ESPEC-1 handling in source d1_espec.c. + * Bug fix: missing fclose in data1_read_espec1. + * + * Revision 1.29 1997/10/27 13:54:18 adam * Changed structure field in data1 node to be simple string which * is "unknown" to the retrieval system itself. * @@ -433,8 +438,7 @@ YAZ_EXPORT data1_varset *data1_read_varset(data1_handle dh, const char *file); YAZ_EXPORT data1_vartype *data1_getvartypebyct(data1_handle dh, data1_varset *set, char *zclass, char *type); -YAZ_EXPORT Z_Espec1 *data1_read_espec1(data1_handle dh, const char *file, - ODR o); +YAZ_EXPORT Z_Espec1 *data1_read_espec1(data1_handle dh, const char *file); YAZ_EXPORT int data1_doespec1(data1_handle dh, data1_node *n, Z_Espec1 *e); YAZ_EXPORT data1_esetname *data1_getesetbyname(data1_handle dh, data1_absyn *a, char *name); diff --git a/include/nmem.h b/include/nmem.h index 8713375..bd3581a 100644 --- a/include/nmem.h +++ b/include/nmem.h @@ -23,12 +23,24 @@ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. * - * $log$ + * $Log: nmem.h,v $ + * Revision 1.7 1997-10-31 12:20:08 adam + * Improved memory debugging for xmalloc/nmem.c. References to NMEM + * instead of ODR in n ESPEC-1 handling in source d1_espec.c. + * Bug fix: missing fclose in data1_read_espec1. + * */ #ifndef NMEM_H #define NMEM_H #include + +#define NMEM_DEBUG 0 + +#ifndef NMEM_DEBUG +#define NMEM_DEBUG 0 +#endif + #ifdef __cplusplus extern "C" { #endif @@ -53,9 +65,21 @@ typedef struct nmem_control *NMEM; YAZ_EXPORT void nmem_reset(NMEM n); YAZ_EXPORT void *nmem_malloc(NMEM n, int size); YAZ_EXPORT int nmem_total(NMEM n); +YAZ_EXPORT char *nmem_strdup (NMEM mem, const char *src); + +#if NMEM_DEBUG + +YAZ_EXPORT NMEM nmem_create_f(const char *file, int line); +YAZ_EXPORT void nmem_destroy_f(const char *file, int line, NMEM n); +#define nmem_create() nmem_create_f(__FILE__, __LINE__) +#define nmem_destroy(x) nmem_destroy_f(__FILE__, __LINE__, (x)) + +#else + YAZ_EXPORT NMEM nmem_create(void); YAZ_EXPORT void nmem_destroy(NMEM n); -YAZ_EXPORT char *nmem_strdup (NMEM mem, const char *src); + +#endif YAZ_EXPORT void nmem_init (void); YAZ_EXPORT void nmem_exit (void); diff --git a/include/prt.h b/include/prt.h index 20187e8..89ca6e0 100644 --- a/include/prt.h +++ b/include/prt.h @@ -1,3 +1,16 @@ +/* + * Copyright (c) 1995-1997, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Log: prt.h,v $ + * Revision 1.21 1997-10-31 12:20:08 adam + * Improved memory debugging for xmalloc/nmem.c. References to NMEM + * instead of ODR in n ESPEC-1 handling in source d1_espec.c. + * Bug fix: missing fclose in data1_read_espec1. + * + */ + #ifndef PRT_H #define PRT_H @@ -46,6 +59,7 @@ YAZ_EXPORT int completeBER(unsigned char *buf, int len); YAZ_EXPORT void odr_begin(ODR o); YAZ_EXPORT void odr_end(ODR o); YAZ_EXPORT Odr_oid *odr_oiddup(ODR odr, Odr_oid *o); +YAZ_EXPORT Odr_oid *odr_oiddup_nmem(NMEM nmem, Odr_oid *o); YAZ_EXPORT int odr_grow_block(odr_ecblock *b, int min_bytes); YAZ_EXPORT int odr_write(ODR o, unsigned char *buf, int bytes); YAZ_EXPORT int odr_seek(ODR o, int whence, int offset); @@ -55,6 +69,7 @@ YAZ_EXPORT void odr_choice_enable_bias(ODR o, int mode); YAZ_EXPORT int odr_total(ODR o); YAZ_EXPORT char *odr_errmsg(int n); YAZ_EXPORT Odr_oid *odr_getoidbystr(ODR o, char *str); +YAZ_EXPORT Odr_oid *odr_getoidbystr_nmem(NMEM o, char *str); YAZ_EXPORT int odr_initmember(ODR o, void *p, int size); YAZ_EXPORT int odr_peektag(ODR o, int *zclass, int *tag, int *cons); YAZ_EXPORT void odr_setlenlen(ODR o, int len); diff --git a/include/tpath.h b/include/tpath.h index 2ddfc10..2c9b7c1 100644 --- a/include/tpath.h +++ b/include/tpath.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, Index Data. + * Copyright (c) 1995-1997, Index Data. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation, in whole or in part, for any purpose, is hereby granted, @@ -23,16 +23,25 @@ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. * + * $Log: tpath.h,v $ + * Revision 1.4 1997-10-31 12:20:08 adam + * Improved memory debugging for xmalloc/nmem.c. References to NMEM + * instead of ODR in n ESPEC-1 handling in source d1_espec.c. + * Bug fix: missing fclose in data1_read_espec1. + * */ #ifndef TPATH_H #define TPATH_H +#include + #ifdef __cplusplus extern "C" { #endif -FILE *yaz_path_fopen(const char *path, const char *name, const char *mode); +YAZ_EXPORT FILE *yaz_path_fopen(const char *path, + const char *name, const char *mode); #ifdef __cplusplus } diff --git a/include/wrbuf.h b/include/wrbuf.h index 70e5d48..3a699bc 100644 --- a/include/wrbuf.h +++ b/include/wrbuf.h @@ -24,7 +24,12 @@ * OF THIS SOFTWARE. * * $Log: wrbuf.h,v $ - * Revision 1.5 1997-09-17 12:10:32 adam + * Revision 1.6 1997-10-31 12:20:08 adam + * Improved memory debugging for xmalloc/nmem.c. References to NMEM + * instead of ODR in n ESPEC-1 handling in source d1_espec.c. + * Bug fix: missing fclose in data1_read_espec1. + * + * Revision 1.5 1997/09/17 12:10:32 adam * YAZ version 1.4. * */ @@ -45,11 +50,11 @@ typedef struct wrbuf int size; } wrbuf, *WRBUF; -WRBUF wrbuf_alloc(void); -void wrbuf_free(WRBUF b, int free_buf); -void wrbuf_rewind(WRBUF b); -int wrbuf_grow(WRBUF b, int minsize); -int wrbuf_write(WRBUF b, char *buf, int size); +YAZ_EXPORT WRBUF wrbuf_alloc(void); +YAZ_EXPORT void wrbuf_free(WRBUF b, int free_buf); +YAZ_EXPORT void wrbuf_rewind(WRBUF b); +YAZ_EXPORT int wrbuf_grow(WRBUF b, int minsize); +YAZ_EXPORT int wrbuf_write(WRBUF b, char *buf, int size); #define wrbuf_len(b) ((b)->pos) #define wrbuf_buf(b) ((b)->buf) diff --git a/include/xmalloc.h b/include/xmalloc.h index a8ea211..0c7df51 100644 --- a/include/xmalloc.h +++ b/include/xmalloc.h @@ -24,7 +24,12 @@ * OF THIS SOFTWARE. * * $Log: xmalloc.h,v $ - * Revision 1.3 1997-09-01 08:49:54 adam + * Revision 1.4 1997-10-31 12:20:08 adam + * Improved memory debugging for xmalloc/nmem.c. References to NMEM + * instead of ODR in n ESPEC-1 handling in source d1_espec.c. + * Bug fix: missing fclose in data1_read_espec1. + * + * Revision 1.3 1997/09/01 08:49:54 adam * New windows NT/95 port using MSV5.0. To export DLL functions the * YAZ_EXPORT modifier was added. Defined in yconfig.h. * @@ -71,6 +76,12 @@ #include +#define TRACE_XMALLOC 0 + +#ifndef TRACE_XMALLOC +#define TRACE_XMALLOC 0 +#endif + #ifdef __cplusplus extern "C" { #endif diff --git a/odr/odr.c b/odr/odr.c index 1dbbda6..efded18 100644 --- a/odr/odr.c +++ b/odr/odr.c @@ -1,10 +1,15 @@ /* - * Copyright (c) 1995, Index Data + * Copyright (c) 1995-1997, Index Data * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: odr.c,v $ - * Revision 1.24 1997-09-01 08:51:07 adam + * Revision 1.25 1997-10-31 12:20:08 adam + * Improved memory debugging for xmalloc/nmem.c. References to NMEM + * instead of ODR in n ESPEC-1 handling in source d1_espec.c. + * Bug fix: missing fclose in data1_read_espec1. + * + * Revision 1.24 1997/09/01 08:51:07 adam * New windows NT/95 port using MSV5.0. Had to avoid a few static * variables used in function ber_tag. These are now part of the * ODR structure. @@ -127,10 +132,14 @@ void odr_setprint(ODR o, FILE *file) o->print = file; } +#include + ODR odr_createmem(int direction) { struct odr *r; + + logf (LOG_DEBUG, "odr_createmem dir=%d", direction); if (!(r = xmalloc(sizeof(*r)))) return 0; r->direction = direction; @@ -170,7 +179,7 @@ void odr_destroy(ODR o) xfree(o->ecb.buf); if (o->print != stderr) fclose(o->print); - xfree(o); + xfree(o); } void odr_setbuf(ODR o, char *buf, int len, int can_grow) diff --git a/odr/odr_util.c b/odr/odr_util.c index cfa28cc..0cee539 100644 --- a/odr/odr_util.c +++ b/odr/odr_util.c @@ -1,3 +1,16 @@ +/* + * Copyright (c) 1995-1997, Index Data + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Log: odr_util.c,v $ + * Revision 1.12 1997-10-31 12:20:08 adam + * Improved memory debugging for xmalloc/nmem.c. References to NMEM + * instead of ODR in n ESPEC-1 handling in source d1_espec.c. + * Bug fix: missing fclose in data1_read_espec1. + * + */ + #include #include #include @@ -35,19 +48,24 @@ int odp_more_chunks(ODR o, unsigned char *base, int len) return o->bp - base < len; } -Odr_oid *odr_oiddup(ODR odr, Odr_oid *o) +Odr_oid *odr_oiddup_nmem(NMEM nmem, Odr_oid *o) { Odr_oid *r; if (!o) return 0; - if (!(r = odr_malloc(odr, (oid_oidlen(o) + 1) * sizeof(int)))) + if (!(r = nmem_malloc(nmem, (oid_oidlen(o) + 1) * sizeof(int)))) return 0; oid_oidcpy(r, o); return r; } -Odr_oid *odr_getoidbystr(ODR o, char *str) +Odr_oid *odr_oiddup(ODR odr, Odr_oid *o) +{ + return odr_oiddup_nmem (odr->mem, o); +} + +Odr_oid *odr_getoidbystr_nmem(NMEM nmem, char *str) { int num = 1, i = 0; char *p = str; @@ -57,7 +75,7 @@ Odr_oid *odr_getoidbystr(ODR o, char *str) return 0; while ((p = strchr(p, '.'))) num++, p++; - ret = odr_malloc(o, sizeof(*ret)*(num + 1)); + ret = nmem_malloc(nmem, sizeof(*ret)*(num + 1)); p = str; do ret[i++] = atoi(p); @@ -65,3 +83,9 @@ Odr_oid *odr_getoidbystr(ODR o, char *str) ret[i] = -1; return ret; } + +Odr_oid *odr_getoidbystr(ODR o, char *str) +{ + return odr_getoidbystr_nmem (o->mem, str); +} + diff --git a/retrieval/d1_absyn.c b/retrieval/d1_absyn.c index 3262dec..c8479a4 100644 --- a/retrieval/d1_absyn.c +++ b/retrieval/d1_absyn.c @@ -4,7 +4,12 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_absyn.c,v $ - * Revision 1.13 1997-10-27 13:54:18 adam + * Revision 1.14 1997-10-31 12:20:09 adam + * Improved memory debugging for xmalloc/nmem.c. References to NMEM + * instead of ODR in n ESPEC-1 handling in source d1_espec.c. + * Bug fix: missing fclose in data1_read_espec1. + * + * Revision 1.13 1997/10/27 13:54:18 adam * Changed structure field in data1 node to be simple string which * is "unknown" to the retrieval system itself. * @@ -162,6 +167,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file) data1_termlist *all = 0; int level = 0; + logf (LOG_DEBUG, "begin data1_read_absyn file=%s", file); if (!(f = yaz_path_fopen(data1_get_tabpath (dh), file, "r"))) { logf(LOG_WARN|LOG_ERRNO, "%s", file); @@ -194,10 +200,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file) break; } if (!r) - { - fclose(f); - return res; - } + break; if (sscanf(r, "%s %[^\n]", cmd, args) < 2) *args = '\0'; if (!strcmp(cmd, "elm")) @@ -267,7 +270,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file) new_element->tag = nmem_malloc(data1_nmem_get (dh), sizeof(*new_element->tag)); nt->which = DATA1T_string; - nt->value.string = xstrdup(p); + nt->value.string = nmem_strdup(data1_nmem_get (dh), p); nt->names = nmem_malloc(data1_nmem_get(dh), sizeof(*new_element->tag->names)); nt->names->name = nt->value.string; @@ -334,7 +337,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file) *tp = all; /* append any ALL entries to the list */ } - new_element->name = xstrdup(name); + new_element->name = nmem_strdup(data1_nmem_get (dh), name); } else if (!strcmp(cmd, "all")) { @@ -485,7 +488,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file) (*esetpp)->next = 0; if (*fname == '@') (*esetpp)->spec = 0; - else if (!((*esetpp)->spec = data1_read_espec1 (dh, fname, 0))) + else if (!((*esetpp)->spec = data1_read_espec1 (dh, fname))) { logf(LOG_WARN, "%s: Espec-1 read failed", file); fclose(f); @@ -534,4 +537,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file) return 0; } } + fclose(f); + logf (LOG_DEBUG, "end data1_read_absyn file=%s", file); + return res; } diff --git a/retrieval/d1_espec.c b/retrieval/d1_espec.c index 0f36614..0a02536 100644 --- a/retrieval/d1_espec.c +++ b/retrieval/d1_espec.c @@ -4,7 +4,12 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_espec.c,v $ - * Revision 1.11 1997-09-29 13:18:59 adam + * Revision 1.12 1997-10-31 12:20:09 adam + * Improved memory debugging for xmalloc/nmem.c. References to NMEM + * instead of ODR in n ESPEC-1 handling in source d1_espec.c. + * Bug fix: missing fclose in data1_read_espec1. + * + * Revision 1.11 1997/09/29 13:18:59 adam * Added function, oid_ent_to_oid, to replace the function * oid_getoidbyent, which is not thread safe. * @@ -46,7 +51,6 @@ #include #include #include -#include #include #include #include @@ -54,9 +58,9 @@ #include #include -static Z_Variant *read_variant(int argc, char **argv, ODR o) +static Z_Variant *read_variant(int argc, char **argv, NMEM nmem) { - Z_Variant *r = odr_malloc(o, sizeof(*r)); + Z_Variant *r = nmem_malloc(nmem, sizeof(*r)); oident var1; int i; int oid[OID_SIZE]; @@ -64,10 +68,10 @@ static Z_Variant *read_variant(int argc, char **argv, ODR o) var1.proto = PROTO_Z3950; var1.oclass = CLASS_VARSET; var1.value = VAL_VAR1; - r->globalVariantSetId = odr_oiddup(o, oid_ent_to_oid(&var1, oid)); + r->globalVariantSetId = odr_oiddup_nmem(nmem, oid_ent_to_oid(&var1, oid)); if (argc) - r->triples = odr_malloc(o, sizeof(Z_Triple*) * argc); + r->triples = nmem_malloc(nmem, sizeof(Z_Triple*) * argc); else r->triples = 0; r->num_triples = argc; @@ -83,11 +87,11 @@ static Z_Variant *read_variant(int argc, char **argv, ODR o) argv[i]); return 0; } - t = r->triples[i] = odr_malloc(o, sizeof(Z_Triple)); + t = r->triples[i] = nmem_malloc(nmem, sizeof(Z_Triple)); t->variantSetId = 0; - t->zclass = odr_malloc(o, sizeof(int)); + t->zclass = nmem_malloc(nmem, sizeof(int)); *t->zclass = zclass; - t->type = odr_malloc(o, sizeof(int)); + t->type = nmem_malloc(nmem, sizeof(int)); *t->type = type; /* * This is wrong.. we gotta look up the correct type for the @@ -101,29 +105,29 @@ static Z_Variant *read_variant(int argc, char **argv, ODR o) else if (isdigit(*value)) { t->which = Z_Triple_integer; - t->value.integer = odr_malloc(o, sizeof(*t->value.integer)); + t->value.integer = nmem_malloc(nmem, sizeof(*t->value.integer)); *t->value.integer = atoi(value); } else { t->which = Z_Triple_internationalString; - t->value.internationalString = odr_malloc(o, strlen(value)+1); + t->value.internationalString = nmem_malloc(nmem, strlen(value)+1); strcpy(t->value.internationalString, value); } } return r; } -static Z_Occurrences *read_occurrences(char *occ, ODR o) +static Z_Occurrences *read_occurrences(char *occ, NMEM nmem) { - Z_Occurrences *op = odr_malloc(o, sizeof(*op)); + Z_Occurrences *op = nmem_malloc(nmem, sizeof(*op)); char *p; if (!occ) { op->which = Z_Occurrences_values; - op->u.values = odr_malloc(o, sizeof(Z_OccurValues)); - op->u.values->start = odr_malloc(o, sizeof(int)); + op->u.values = nmem_malloc(nmem, sizeof(Z_OccurValues)); + op->u.values->start = nmem_malloc(nmem, sizeof(int)); *op->u.values->start = 1; op->u.values->howMany = 0; } @@ -139,7 +143,7 @@ static Z_Occurrences *read_occurrences(char *occ, ODR o) } else { - Z_OccurValues *ov = odr_malloc(o, sizeof(*ov)); + Z_OccurValues *ov = nmem_malloc(nmem, sizeof(*ov)); if (!isdigit(*occ)) { @@ -148,11 +152,11 @@ static Z_Occurrences *read_occurrences(char *occ, ODR o) } op->which = Z_Occurrences_values; op->u.values = ov; - ov->start = odr_malloc(o, sizeof(*ov->start)); + ov->start = nmem_malloc(nmem, sizeof(*ov->start)); *ov->start = atoi(occ); if ((p = strchr(occ, '+'))) { - ov->howMany = odr_malloc(o, sizeof(*ov->howMany)); + ov->howMany = nmem_malloc(nmem, sizeof(*ov->howMany)); *ov->howMany = atoi(p + 1); } else @@ -162,9 +166,9 @@ static Z_Occurrences *read_occurrences(char *occ, ODR o) } -static Z_ETagUnit *read_tagunit(char *buf, ODR o) +static Z_ETagUnit *read_tagunit(char *buf, NMEM nmem) { - Z_ETagUnit *u = odr_malloc(o, sizeof(*u)); + Z_ETagUnit *u = nmem_malloc(nmem, sizeof(*u)); int terms; int type; char value[512], occ[512]; @@ -178,9 +182,9 @@ static Z_ETagUnit *read_tagunit(char *buf, ODR o) { u->which = Z_ETagUnit_wildThing; if (buf[1] == ':') - u->u.wildThing = read_occurrences(buf+2, o); + u->u.wildThing = read_occurrences(buf+2, nmem); else - u->u.wildThing = read_occurrences(0, o); + u->u.wildThing = read_occurrences(0, nmem); } else if ((terms = sscanf(buf, "(%d,%[^)]):%[a-z0-9+]", &type, value, occ)) >= 2) @@ -196,24 +200,24 @@ static Z_ETagUnit *read_tagunit(char *buf, ODR o) force_string = 1; } u->which = Z_ETagUnit_specificTag; - u->u.specificTag = t = odr_malloc(o, sizeof(*t)); - t->tagType = odr_malloc(o, sizeof(*t->tagType)); + u->u.specificTag = t = nmem_malloc(nmem, sizeof(*t)); + t->tagType = nmem_malloc(nmem, sizeof(*t->tagType)); *t->tagType = type; - t->tagValue = odr_malloc(o, sizeof(*t->tagValue)); + t->tagValue = nmem_malloc(nmem, sizeof(*t->tagValue)); if (!force_string && (numval = atoi(valp))) { t->tagValue->which = Z_StringOrNumeric_numeric; - t->tagValue->u.numeric = odr_malloc(o, sizeof(int)); + t->tagValue->u.numeric = nmem_malloc(nmem, sizeof(int)); *t->tagValue->u.numeric = numval; } else { t->tagValue->which = Z_StringOrNumeric_string; - t->tagValue->u.string = odr_malloc(o, strlen(valp)+1); + t->tagValue->u.string = nmem_malloc(nmem, strlen(valp)+1); strcpy(t->tagValue->u.string, valp); } if (terms > 2) /* an occurrences-spec exists */ - t->occurrences = read_occurrences(occ, o); + t->occurrences = read_occurrences(occ, nmem); else t->occurrences = 0; } @@ -222,14 +226,15 @@ static Z_ETagUnit *read_tagunit(char *buf, ODR o) /* * Read an element-set specification from a file. - * NOTE: If !o, memory is allocated directly from the heap by odr_malloc(). + * NOTE: If !o, memory is allocated directly from the heap by nmem_malloc(). */ -Z_Espec1 *data1_read_espec1 (data1_handle dh, const char *file, ODR o) +Z_Espec1 *data1_read_espec1 (data1_handle dh, const char *file) { FILE *f; + NMEM nmem = data1_nmem_get (dh); int argc, size_esn = 0; char *argv[50], line[512]; - Z_Espec1 *res = odr_malloc(o, sizeof(*res)); + Z_Espec1 *res = nmem_malloc(nmem, sizeof(*res)); if (!(f = yaz_path_fopen(data1_get_tabpath(dh), file, "r"))) { @@ -257,10 +262,11 @@ Z_Espec1 *data1_read_espec1 (data1_handle dh, const char *file, ODR o) continue; } - res->elementSetNames = odr_malloc(o, sizeof(char**)*nnames); + res->elementSetNames = nmem_malloc(nmem, sizeof(char**)*nnames); for (i = 0; i < nnames; i++) { - res->elementSetNames[i] = odr_malloc(o, strlen(argv[i+1])+1); + res->elementSetNames[i] = nmem_malloc(nmem, + strlen(argv[i+1])+1); strcpy(res->elementSetNames[i], argv[i+1]); } res->num_elementSetNames = nnames; @@ -268,7 +274,7 @@ Z_Espec1 *data1_read_espec1 (data1_handle dh, const char *file, ODR o) else if (!strcmp(argv[0], "defaultvariantsetid")) { if (argc != 2 || !(res->defaultVariantSetId = - odr_getoidbystr(o, argv[1]))) + odr_getoidbystr_nmem(nmem, argv[1]))) { logf(LOG_WARN, "%s: Bad defaultvariantsetid directive", file); continue; @@ -281,12 +287,13 @@ Z_Espec1 *data1_read_espec1 (data1_handle dh, const char *file, ODR o) logf(LOG_WARN, "%s: Bad defaulttagtype directive", file); continue; } - res->defaultTagType = odr_malloc(o, sizeof(int)); + res->defaultTagType = nmem_malloc(nmem, sizeof(int)); *res->defaultTagType = atoi(argv[1]); } else if (!strcmp(argv[0], "defaultvariantrequest")) { - if (!(res->defaultVariantRequest = read_variant(argc-1, argv+1, o))) + if (!(res->defaultVariantRequest = read_variant(argc-1, + argv+1, nmem))) { logf(LOG_WARN, "%s: Bad defaultvariantrequest", file); continue; @@ -302,20 +309,13 @@ Z_Espec1 *data1_read_espec1 (data1_handle dh, const char *file, ODR o) int num, i = 0; if (!res->elements) - res->elements = odr_malloc(o, size_esn = 24*sizeof(er)); + res->elements = nmem_malloc(nmem, size_esn = 24*sizeof(er)); else if (res->num_elements >= (int) (size_esn/sizeof(er))) { + Z_ElementRequest **oe = res->elements; size_esn *= 2; - if (o) - { - Z_ElementRequest **oe = res->elements; - - res->elements = odr_malloc (o, size_esn*sizeof(er)); - memcpy (res->elements, oe, size_esn/2); - } - else - res->elements = - xrealloc(res->elements, size_esn*sizeof(er)); + res->elements = nmem_malloc (nmem, size_esn*sizeof(er)); + memcpy (res->elements, oe, size_esn/2); } if (argc < 2) { @@ -324,18 +324,18 @@ Z_Espec1 *data1_read_espec1 (data1_handle dh, const char *file, ODR o) } res->elements[res->num_elements++] = er = - odr_malloc(o, sizeof(*er)); + nmem_malloc(nmem, sizeof(*er)); er->which = Z_ERequest_simpleElement; - er->u.simpleElement = se = odr_malloc(o, sizeof(*se)); + er->u.simpleElement = se = nmem_malloc(nmem, sizeof(*se)); se->variantRequest = 0; - se->path = tp = odr_malloc(o, sizeof(*tp)); + se->path = tp = nmem_malloc(nmem, sizeof(*tp)); tp->num_tags = 0; /* * Parse the element selector. */ for (num = 1, ep = path; (ep = strchr(ep, '/')); num++, ep++) ; - tp->tags = odr_malloc(o, sizeof(Z_ETagUnit*)*num); + tp->tags = nmem_malloc(nmem, sizeof(Z_ETagUnit*)*num); for ((ep = strchr(path, '/')) ; path ; (void)((path = ep) && (ep = strchr(path, '/')))) @@ -344,11 +344,11 @@ Z_Espec1 *data1_read_espec1 (data1_handle dh, const char *file, ODR o) ep++; assert(itags[tp->num_tags++] = read_tagunit(path, o); + tp->tags[tp->num_tags++] = read_tagunit(path, nmem); } if (argc > 2 && !strcmp(argv[2], "variant")) - se->variantRequest= read_variant(argc-3, argv+3, o); + se->variantRequest= read_variant(argc-3, argv+3, nmem); } else { @@ -356,6 +356,6 @@ Z_Espec1 *data1_read_espec1 (data1_handle dh, const char *file, ODR o) fclose(f); return 0; } - + fclose (f); return res; } diff --git a/server/statserv.c b/server/statserv.c index e777879..ec506a5 100644 --- a/server/statserv.c +++ b/server/statserv.c @@ -7,7 +7,12 @@ * Chas Woodfield, Fretwell Downing Datasystem. * * $Log: statserv.c,v $ - * Revision 1.42 1997-10-27 14:03:02 adam + * Revision 1.43 1997-10-31 12:20:09 adam + * Improved memory debugging for xmalloc/nmem.c. References to NMEM + * instead of ODR in n ESPEC-1 handling in source d1_espec.c. + * Bug fix: missing fclose in data1_read_espec1. + * + * Revision 1.42 1997/10/27 14:03:02 adam * Added new member to statserver_options_block, pre_init, which * specifies a callback to be invoked after command line parsing and * before the server listens for the first time. @@ -399,10 +404,12 @@ static void listener(IOCHAN h, int event) } logf(LOG_DEBUG, "Setting timeout %d", control_block.idle_timeout); iochan_setdata(new_chan, newas); - iochan_settimeout(new_chan, control_block.idle_timeout * 60); + iochan_settimeout(new_chan, control_block.idle_timeout * 60); +#ifndef WINDOWS logf(LOG_DEBUG, "Determining client address"); a = cs_addrstr(new_line); - logf(LOG_LOG, "Accepted connection from %s", a ? a : "[Unknown]"); + logf(LOG_LOG, "Accepted connection from %s", a ? a : "[Unknown]"); +#endif /* Now what we need todo is create a new thread with this iochan as the parameter */ /* if (CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)event_loop, new_chan, diff --git a/util/Makefile b/util/Makefile index 047e7cc..96a0d68 100644 --- a/util/Makefile +++ b/util/Makefile @@ -1,14 +1,13 @@ # Copyright (C) 1994-1997, Index Data I/S # All rights reserved. # Sebastian Hammer, Adam Dickmeiss -# $Id: Makefile,v 1.25 1997-10-27 14:04:21 adam Exp $ +# $Id: Makefile,v 1.26 1997-10-31 12:20:09 adam Exp $ SHELL=/bin/sh INCLUDE=-I../include -I. LIBDIR=../lib LIBINCLUDE=-L$(LIBDIR) DEFS=$(INCLUDE) $(CDEFS) -#DEFS=$(INCLUDE) $(CDEFS) -DTRACE_XMALLOC=1 LIB=$(LIBDIR)/libutil.a LIBS= PO = options.o log.o marcdisp.o yaz-ccl.o pquery.o oid.o wrbuf.o nmemsdup.o \ diff --git a/util/nmem.c b/util/nmem.c index 0e4009f..ea9a9b8 100644 --- a/util/nmem.c +++ b/util/nmem.c @@ -4,7 +4,12 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: nmem.c,v $ - * Revision 1.5 1997-10-06 09:09:52 adam + * Revision 1.6 1997-10-31 12:20:09 adam + * Improved memory debugging for xmalloc/nmem.c. References to NMEM + * instead of ODR in n ESPEC-1 handling in source d1_espec.c. + * Bug fix: missing fclose in data1_read_espec1. + * + * Revision 1.5 1997/10/06 09:09:52 adam * Function mmem_exit releases memory used by the freelists. * * Revision 1.4 1997/09/29 07:12:50 adam @@ -30,6 +35,7 @@ #include #include +#include #ifdef WINDOWS #include #endif @@ -47,6 +53,7 @@ static CRITICAL_SECTION critical_section; static nmem_block *freelist = NULL; /* "global" freelists */ static nmem_control *cfreelist = NULL; +static int nmem_active_no = 0; static void free_block(nmem_block *p) { @@ -127,32 +134,51 @@ int nmem_total(NMEM n) return n->total; } +#if NMEM_DEBUG +NMEM nmem_create_f(const char *file, int line) +#else NMEM nmem_create(void) +#endif { NMEM r; NMEM_ENTER; + nmem_active_no++; r = cfreelist; if (r) cfreelist = cfreelist->next; else r = xmalloc(sizeof(*r)); NMEM_LEAVE; + +#if NMEM_DEBUG + logf (LOG_DEBUG, "%s:%d: nmem_create %d p=%p", file, line, + nmem_active_no-1, r); +#endif r->blocks = 0; r->total = 0; r->next = 0; return r; } +#if NMEM_DEBUG +void nmem_destroy_f(const char *file, int line, NMEM n) +#else void nmem_destroy(NMEM n) +#endif { if (!n) return; nmem_reset(n); NMEM_ENTER; + nmem_active_no--; n->next = cfreelist; cfreelist = n; NMEM_LEAVE; +#if NMEM_DEBUG + logf (LOG_DEBUG, "%s:%d: nmem_destroy %d p=%p", file, line, + nmem_active_no, n); +#endif } void nmem_init (void) @@ -160,6 +186,7 @@ void nmem_init (void) #ifdef WINDOWS InitializeCriticalSection(&critical_section); #endif + nmem_active_no = 0; freelist = NULL; cfreelist = NULL; } diff --git a/util/xmalloc.c b/util/xmalloc.c index ce7852a..8fd0132 100644 --- a/util/xmalloc.c +++ b/util/xmalloc.c @@ -4,7 +4,12 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: xmalloc.c,v $ - * Revision 1.4 1996-07-03 13:21:36 adam + * Revision 1.5 1997-10-31 12:20:09 adam + * Improved memory debugging for xmalloc/nmem.c. References to NMEM + * instead of ODR in n ESPEC-1 handling in source d1_espec.c. + * Bug fix: missing fclose in data1_read_espec1. + * + * Revision 1.4 1996/07/03 13:21:36 adam * Function xfree_f checks for NULL pointer. * * Revision 1.3 1995/12/05 15:08:44 adam @@ -48,8 +53,9 @@ void *xrealloc_f (void *o, size_t size, char *file, int line) { void *p = realloc (o, size); -#ifdef TRACE_XMALLOC - fprintf(stderr, "%s:%d: xrealloc(s=%d) %p -> %p\n", file, line, size, o, p); +#if TRACE_XMALLOC + logf (LOG_DEBUG, + "%s:%d: xrealloc(s=%d) %p -> %p", file, line, size, o, p); #endif if (!p) { @@ -63,8 +69,8 @@ void *xmalloc_f (size_t size, char *file, int line) { void *p = malloc (size); -#ifdef TRACE_XMALLOC - fprintf(stderr, "%s:%d: xmalloc(s=%d) %p\n", file, line, size, p); +#if TRACE_XMALLOC + logf (LOG_DEBUG, "%s:%d: xmalloc(s=%d) %p", file, line, size, p); #endif if (!p) { @@ -77,8 +83,8 @@ void *xmalloc_f (size_t size, char *file, int line) void *xcalloc_f (size_t nmemb, size_t size, char *file, int line) { void *p = calloc (nmemb, size); -#ifdef TRACE_XMALLOC - fprintf(stderr, "%s:%d: xcalloc(s=%d) %p\n", file, line, size, p); +#if TRACE_XMALLOC + logf (LOG_DEBUG, "%s:%d: xcalloc(s=%d) %p", file, line, size, p); #endif if (!p) { @@ -91,8 +97,8 @@ void *xcalloc_f (size_t nmemb, size_t size, char *file, int line) char *xstrdup_f (const char *s, char *file, int line) { char *p = xmalloc (strlen(s)+1); -#ifdef TRACE_XMALLOC - fprintf(stderr, "%s:%d: xstrdup(s=%d) %p\n", file, line, strlen(s)+1, p); +#if TRACE_XMALLOC + logf (LOG_DEBUG, "%s:%d: xstrdup(s=%d) %p", file, line, strlen(s)+1, p); #endif strcpy (p, s); return p; @@ -103,9 +109,9 @@ void xfree_f(void *p, char *file, int line) { if (!p) return ; -#ifdef TRACE_XMALLOC +#if TRACE_XMALLOC if (p) - fprintf(stderr, "%s:%d: xfree %p\n", file, line, p); + logf (LOG_DEBUG, "%s:%d: xfree %p", file, line, p); #endif free(p); } diff --git a/yaz.dsp b/yaz.dsp index e85eeeb..4272ee1 100644 --- a/yaz.dsp +++ b/yaz.dsp @@ -62,7 +62,7 @@ TargetName=yaz SOURCE=$(InputPath) PostBuild_Desc=Copy Lib and Dll PostBuild_Cmds=copy $(OutDir)\$(TargetName).lib $(ProjDir)\lib copy\ - $(OutDir)\$(TargetName).dll $(ProjDir)\lib + $(OutDir)\$(TargetName).dll $(ProjDir)\lib # End Special Build Tool !ELSEIF "$(CFG)" == "yaz - Win32 Debug" @@ -99,7 +99,7 @@ TargetName=yaz SOURCE=$(InputPath) PostBuild_Desc=Copy Lib and Dll PostBuild_Cmds=copy $(OutDir)\$(TargetName).lib $(ProjDir)\lib copy\ - $(OutDir)\$(TargetName).dll $(ProjDir)\lib + $(OutDir)\$(TargetName).dll $(ProjDir)\lib # End Special Build Tool !ENDIF @@ -114,266 +114,98 @@ PostBuild_Cmds=copy $(OutDir)\$(TargetName).lib $(ProjDir)\lib copy\ # Begin Source File SOURCE=.\Util\atoin.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\ber_any.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\ber_bit.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\ber_bool.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\ber_int.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\ber_len.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\ber_null.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\ber_oct.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\ber_oid.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\ber_tag.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\ccl\cclerrms.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\ccl\cclfind.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\ccl\cclptree.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\ccl\cclqfile.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\ccl\cclqual.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\ccl\cclstr.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\ccl\ccltoken.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\comstack\comstack.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\retrieval\d1_absyn.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\retrieval\d1_attset.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\retrieval\d1_doespec.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\retrieval\d1_espec.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\retrieval\d1_expout.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\retrieval\d1_grs.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File @@ -382,167 +214,66 @@ SOURCE=.\retrieval\d1_handle.c # Begin Source File SOURCE=.\retrieval\d1_map.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\retrieval\d1_marc.c +# End Source File +# Begin Source File -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - +SOURCE=.\retrieval\d1_prtree.c # End Source File # Begin Source File SOURCE=.\retrieval\d1_read.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\retrieval\d1_soif.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\retrieval\d1_sumout.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\retrieval\d1_sutrs.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\retrieval\d1_tagset.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\retrieval\d1_varset.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\retrieval\d1_write.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\asn\diagbib1.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\util\dmalloc.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\dumpber.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\util\log.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - -# End Source File -# Begin Source File +# End Source File +# Begin Source File SOURCE=.\util\marcdisp.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\util\nmem.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File @@ -551,442 +282,162 @@ SOURCE=.\util\nmemsdup.c # Begin Source File SOURCE=.\odr\odr.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\odr_any.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\odr_bit.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\odr_bool.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\odr_choice.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\odr_cons.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\odr_int.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\odr_mem.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\odr_null.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\odr_oct.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\odr_oid.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\odr_priv.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\odr_seq.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\odr_tag.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\odr_use.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\odr\odr_util.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\util\oid.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\util\options.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\util\pquery.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\asn\proto.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=".\asn\prt-acc.c" - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=".\asn\prt-add.c" - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=".\asn\prt-arc.c" - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=".\asn\prt-dia.c" - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=".\asn\prt-esp.c" - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=".\asn\prt-exd.c" - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=".\asn\prt-exp.c" - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=".\asn\prt-ext.c" - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=".\asn\prt-grs.c" - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=".\asn\prt-rsc.c" - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\util\query.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\util\readconf.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\comstack\tcpip.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\util\tpath.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\comstack\waislen.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\util\wrbuf.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\util\xmalloc.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=".\util\yaz-ccl.c" - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=".\util\yaz-util.c" - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=.\asn\zget.c - -!IF "$(CFG)" == "yaz - Win32 Release" - -!ELSEIF "$(CFG)" == "yaz - Win32 Debug" - -!ENDIF - # End Source File # End Group # Begin Group "Header Files"