X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=zoom%2Fzoomsh.c;h=be86ef6a24331cec7353ceb3d5dcdce189caea61;hb=0e967e932ab262eb724f19922594359a4bb3336e;hp=2983b43ee2d96718d5fc1957ebada34280528fb4;hpb=72a7de6dfe07d7079de3c287aecdeb0f164c78b8;p=yaz-moved-to-github.git diff --git a/zoom/zoomsh.c b/zoom/zoomsh.c index 2983b43..be86ef6 100644 --- a/zoom/zoomsh.c +++ b/zoom/zoomsh.c @@ -1,14 +1,19 @@ /* - * $Id: zoomsh.c,v 1.20 2003-05-26 11:35:46 adam Exp $ + * Copyright (c) 2002-2004, Index Data. + * See the file LICENSE for details. * - * ZOOM-C Shell + * $Id: zoomsh.c,v 1.29 2004-04-29 08:54:56 adam Exp $ */ +/* ZOOM-C Shell */ + #include #include #include #include +#include + #if HAVE_READLINE_READLINE_H #include #endif @@ -21,6 +26,7 @@ #include #include #include +#include #define MAX_CON 100 @@ -152,17 +158,24 @@ static void display_records (ZOOM_connection c, int pos = i + start; ZOOM_record rec = ZOOM_resultset_record (r, pos); const char *db = ZOOM_record_get (rec, "database", 0); - int len; + int len, opac_len; const char *render = ZOOM_record_get (rec, "render", &len); + const char *opac_render = ZOOM_record_get (rec, "opac", &opac_len); const char *syntax = ZOOM_record_get (rec, "syntax", 0); /* if rec is non-null, we got a record for display */ if (rec) { - printf ("%d %s %s\n", pos+1, (db ? db : "unknown"), syntax); + char oidbuf[100]; + (void) oid_name_to_dotstring(CLASS_RECSYN, syntax, oidbuf); + printf ("%d %s %s (%s)\n", + pos+1, (db ? db : "unknown"), syntax, oidbuf); if (render) fwrite (render, 1, len, stdout); printf ("\n"); + if (opac_render) + fwrite (opac_render, 1, opac_len, stdout); } + } } @@ -212,15 +225,19 @@ static void cmd_ext (ZOOM_connection *c, ZOOM_resultset *r, const char **args) { ZOOM_package p[MAX_CON]; + char ext_type_str[10]; int i; + + if (next_token_copy (args, ext_type_str, sizeof(ext_type_str)) < 0) + return; for (i = 0; i