From: Adam Dickmeiss Date: Tue, 30 Sep 1997 11:50:04 +0000 (+0000) Subject: Added handler data1_get_map_buf that is used by data1_nodetomarc. X-Git-Tag: YAZ.1.8~576 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=0eb2cd457af935a98a1ae9d3b3cbb7c83cf3e368;p=yaz-moved-to-github.git Added handler data1_get_map_buf that is used by data1_nodetomarc. --- diff --git a/retrieval/d1_handle.c b/retrieval/d1_handle.c index d294218..062b4ad 100644 --- a/retrieval/d1_handle.c +++ b/retrieval/d1_handle.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_handle.c,v $ - * Revision 1.1 1997-09-17 12:28:24 adam + * Revision 1.2 1997-09-30 11:50:04 adam + * Added handler data1_get_map_buf that is used by data1_nodetomarc. + * + * Revision 1.1 1997/09/17 12:28:24 adam * Introduced new 'global' data1 handle. * */ @@ -18,9 +21,15 @@ struct data1_handle_info { WRBUF wrbuf; char *tab_path; + char *read_buf; int read_len; + data1_absyn_cache absyn_cache; + + char *map_buf; + int map_len; + NMEM mem; }; @@ -33,6 +42,8 @@ data1_handle data1_create (void) p->wrbuf = wrbuf_alloc(); p->read_buf = NULL; p->read_len = 0; + p->map_buf = NULL; + p->map_len = 0; p->absyn_cache = NULL; p->mem = nmem_create (); return p; @@ -57,6 +68,8 @@ void data1_destroy (data1_handle dh) xfree (dh->tab_path); if (dh->read_buf) xfree (dh->read_buf); + if (dh->map_buf) + xfree (dh->map_buf); nmem_destroy (dh->mem); xfree (dh); @@ -70,9 +83,16 @@ WRBUF data1_get_wrbuf (data1_handle dp) char **data1_get_read_buf (data1_handle dp, int **lenp) { *lenp = &dp->read_len; + logf (LOG_DEBUG, "data1_get_read_buf lenp=%u", **lenp); return &dp->read_buf; } +char **data1_get_map_buf (data1_handle dp, int **lenp) +{ + *lenp = &dp->map_len; + logf (LOG_DEBUG, "data1_get_map_buf lenp=%u", **lenp); + return &dp->map_buf; +} void data1_set_tabpath (data1_handle dp, const char *p) { diff --git a/retrieval/d1_marc.c b/retrieval/d1_marc.c index 3c65dfe..dd35a5e 100644 --- a/retrieval/d1_marc.c +++ b/retrieval/d1_marc.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_marc.c,v $ - * Revision 1.9 1997-09-24 13:35:45 adam + * Revision 1.10 1997-09-30 11:50:04 adam + * Added handler data1_get_map_buf that is used by data1_nodetomarc. + * + * Revision 1.9 1997/09/24 13:35:45 adam * Added two members to data1_marctab to ease reading of weird MARC records. * * Revision 1.8 1997/09/17 12:10:37 adam @@ -222,6 +225,7 @@ static int nodetomarc(data1_marctab *p, data1_node *n, int selected, char *op; data1_node *field, *subf; + logf (LOG_DEBUG, "nodetomarc"); for (field = n->child; field; field = field->next) { if (field->which != DATA1N_tag) @@ -333,7 +337,7 @@ char *data1_nodetomarc(data1_handle dh, data1_marctab *p, data1_node *n, int selected, int *len) { int *size; - char **buf = data1_get_read_buf (dh, &size); + char **buf = data1_get_map_buf (dh, &size); *len = nodetomarc(p, n, selected, buf, size); return *buf;