X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=retrieval%2Fd1_marc.c;h=198e8520365b478123060926050b6f25a9cd1866;hb=559aecba0e61eca34706023436692ba23faa29a7;hp=dd35a5e4faa452427b6ec0cbccbe50f945f12c5e;hpb=0eb2cd457af935a98a1ae9d3b3cbb7c83cf3e368;p=yaz-moved-to-github.git diff --git a/retrieval/d1_marc.c b/retrieval/d1_marc.c index dd35a5e..198e852 100644 --- a/retrieval/d1_marc.c +++ b/retrieval/d1_marc.c @@ -1,10 +1,16 @@ /* - * Copyright (c) 1995-1997, Index Data. + * Copyright (c) 1995-1998, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_marc.c,v $ - * Revision 1.10 1997-09-30 11:50:04 adam + * Revision 1.12 1998-02-23 10:57:09 adam + * Take care of integer data nodes as well in conversion. + * + * Revision 1.11 1998/02/11 11:53:35 adam + * Changed code so that it compiles as C++. + * + * 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 @@ -55,7 +61,7 @@ data1_marctab *data1_read_marctab (data1_handle dh, const char *file) { FILE *f; NMEM mem = data1_nmem_get (dh); - data1_marctab *res = nmem_malloc(mem, sizeof(*res)); + data1_marctab *res = (data1_marctab *)nmem_malloc(mem, sizeof(*res)); char line[512], *argv[50]; int argc; @@ -176,7 +182,8 @@ static char *get_data(data1_node *n, int *len) while (n->which != DATA1N_data && n->child) n = n->child; - if (n->which != DATA1N_data || n->u.data.what != DATA1I_text) + if (n->which != DATA1N_data || + (n->u.data.what != DATA1I_text && n->u.data.what != DATA1I_num)) { r = "[Structured/included data]"; *len = strlen(r); @@ -263,9 +270,9 @@ static int nodetomarc(data1_marctab *p, data1_node *n, int selected, } if (!*buf) - *buf = xmalloc(*size = len); + *buf = (char *)xmalloc(*size = len); else if (*size <= len) - *buf = xrealloc(*buf, *size = len); + *buf = (char *)xrealloc(*buf, *size = len); op = *buf; memint (op, len, 5);