X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=zoom%2Fzoomsh.c;h=7276d63fef7bea7a2adb0b4b747e4380424242c0;hb=f517f60a95e2f94edd1efd750024642b5941ef08;hp=c6b29ae16237e68906aae0bdceba7d069fad7e98;hpb=b0555501e434d0f71f97ea17f282db2e795ff950;p=yaz-moved-to-github.git diff --git a/zoom/zoomsh.c b/zoom/zoomsh.c index c6b29ae..7276d63 100644 --- a/zoom/zoomsh.c +++ b/zoom/zoomsh.c @@ -1,14 +1,19 @@ /* - * $Id: zoomsh.c,v 1.22 2003-07-10 11:50:32 mike Exp $ + * Copyright (C) 1995-2005, Index Data ApS + * See the file LICENSE for details. * - * ZOOM-C Shell + * $Id: zoomsh.c,v 1.32 2005-01-15 19:47:15 adam Exp $ */ +/* ZOOM-C Shell */ + #include #include #include #include +#include + #if HAVE_READLINE_READLINE_H #include #endif @@ -153,8 +158,9 @@ 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) @@ -166,7 +172,10 @@ static void display_records (ZOOM_connection c, if (render) fwrite (render, 1, len, stdout); printf ("\n"); + if (opac_render) + fwrite (opac_render, 1, opac_len, stdout); } + } } @@ -216,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