X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=recctrl%2Fmarcread.c;h=0edc5d441ef1aed5e4dd1a46c7cd6a4001fda588;hb=4415da5dbbba04e50d4524347486d60113ed569c;hp=44d93f552e86e0b61b7343eed4730c7f51166bc7;hpb=b9093505b17a074e79137ed64595c8269f77d330;p=idzebra-moved-to-github.git diff --git a/recctrl/marcread.c b/recctrl/marcread.c index 44d93f5..0edc5d4 100644 --- a/recctrl/marcread.c +++ b/recctrl/marcread.c @@ -1,10 +1,25 @@ /* - * Copyright (C) 1997, Index Data I/S + * Copyright (C) 1997-1999, Index Data * All rights reserved. * Sebastian Hammer, Adam Dickmeiss * * $Log: marcread.c,v $ - * Revision 1.2 1997-09-17 12:19:21 adam + * Revision 1.7 1999-05-20 12:57:18 adam + * Implemented TCL filter. Updated recctrl system. + * + * Revision 1.6 1999/02/02 14:51:27 adam + * Updated WIN32 code specific sections. Changed header. + * + * Revision 1.5 1997/11/18 10:03:24 adam + * Member num_children removed from data1_node. + * + * Revision 1.4 1997/10/27 14:34:26 adam + * Fixed bug - data1 root node wasn't tagged at all! + * + * Revision 1.3 1997/09/24 13:36:51 adam + * *** empty log message *** + * + * Revision 1.2 1997/09/17 12:19:21 adam * Zebra version corresponds to YAZ version 1.4. * Changed Zebra server so that it doesn't depend on global common_resource. * @@ -36,7 +51,6 @@ data1_node *data1_mk_node_wp (data1_handle dh, NMEM mem, data1_node *parent) parent->child = parent->last_child = res; else parent->last_child->next = res; - parent->num_children++; parent->last_child = res; } return res; @@ -123,6 +137,7 @@ data1_node *grs_read_marc (struct grs_read_info *p) data1_node *res_root; data1_absyn *absyn; char *absynName; + data1_marctab *marctab; if ((*p->readf)(p->fh, buf, 5) != 5) return NULL; @@ -154,16 +169,24 @@ data1_node *grs_read_marc (struct grs_read_info *p) return NULL; } res_root = data1_mk_node_wp (p->dh, p->mem, NULL); + res_root->which = DATA1N_root; res_root->u.root.type = nmem_malloc (p->mem, strlen(absynName)+1); strcpy (res_root->u.root.type, absynName); res_root->u.root.absyn = absyn; - indicator_length = atoi_n (buf+10, 1); - identifier_length = atoi_n (buf+11, 1); + marctab = absyn->marc; + + if (marctab && marctab->force_indicator_length >= 0) + indicator_length = marctab->force_indicator_length; + else + indicator_length = atoi_n (buf+10, 1); + if (marctab && marctab->force_identifier_length >= 0) + identifier_length = marctab->force_identifier_length; + else + identifier_length = atoi_n (buf+11, 1); base_address = atoi_n (buf+12, 4); - length_data_entry = atoi_n (buf+20, 1); - length_data_entry = atoi_n (buf+20, 1); + length_data_entry = atoi_n (buf+20, 1); length_starting = atoi_n (buf+21, 1); length_implementation = atoi_n (buf+22, 1); @@ -265,3 +288,21 @@ data1_node *grs_read_marc (struct grs_read_info *p) } return res_root; } + +static void *grs_init_marc() +{ + return 0; +} + +static void grs_destroy_marc(void *clientData) +{ +} + +static struct recTypeGrs marc_type = { + "marc", + grs_init_marc, + grs_destroy_marc, + grs_read_marc +}; + +RecTypeGrs recTypeGrs_marc = &marc_type;