X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=client%2Fclient.c;h=90438a6d6e958c7ab61fc7fcffe2535fd77f4b0b;hp=f1537008ccd9d40b98077f3333133bd07d053d7d;hb=f1bb2364c333c161a8197785e51348c70f31ca6b;hpb=17c6fa471c8ff21bd9133a806569e10a0919e24c diff --git a/client/client.c b/client/client.c index f153700..90438a6 100644 --- a/client/client.c +++ b/client/client.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: client.c,v $ - * Revision 1.29 1996-01-02 08:57:25 quinn + * Revision 1.30 1996-02-12 18:18:09 quinn + * Fidgeting. + * + * Revision 1.29 1996/01/02 08:57:25 quinn * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass * * Revision 1.28 1995/12/14 11:09:31 quinn @@ -149,6 +152,8 @@ static Z_InitResponse *session = 0; /* session parameters */ static char last_scan[512] = "0"; static char last_cmd[100] = "?"; static oid_value attributeset = VAL_BIB1; +static FILE *marcdump = 0; +static char marcdump_file[512] = "marc.out"; #ifdef RPN_QUERY #ifndef PREFIX_QUERY @@ -403,7 +408,29 @@ static void display_record(Z_DatabaseRecord *p) } } if (r->which == Z_External_octet && p->u.octet_aligned->len) + { +#if 0 + if (marcdump) + fwrite(p->u.octet_aligned->buf, p->u.octet_aligned->len, 1, + marcdump); +#endif + static count = 0; + FILE *f; + char buf[256]; + + sprintf(buf, "marc.%d", count++); + if (!(f = fopen(buf, "w"))) + { + perror(buf); + exit(1); + + } + fwrite(p->u.octet_aligned->buf, p->u.octet_aligned->len, 1, f); + fclose(f); + + marc_display ((char*)p->u.octet_aligned->buf, stdout); + } else if (ent->value == VAL_SUTRS) { if (r->which != Z_External_sutrs) @@ -1147,5 +1174,10 @@ int main(int argc, char **argv) cmd_open(argv[1]); else printf(C_PROMPT); + if (*marcdump_file && !(marcdump = fopen(marcdump_file, "a"))) + { + perror(marcdump_file); + exit(1); + } return client(); }