From: Adam Dickmeiss Date: Thu, 2 Mar 1995 09:32:10 +0000 (+0000) Subject: New presentation formats. f0=full, f1=brief, f2=mid X-Git-Url: http://lists.indexdata.com/cgi-bin?a=commitdiff_plain;h=e11028ba3000e458c269b1c5e330f4920218e6c4;p=egate.git New presentation formats. f0=full, f1=brief, f2=mid --- diff --git a/kernel/default.fml b/kernel/default.fml index 69c3224..d512392 100644 --- a/kernel/default.fml +++ b/kernel/default.fml @@ -1,5 +1,5 @@ # Fml scripts to display MARC records -# $Id: default.fml,v 1.3 1995/02/23 08:32:15 adam Exp $ +# $Id: default.fml,v 1.4 1995/03/02 09:32:10 adam Exp $ \func f0 rec { \foreach line {\rec} { \line \index 1 \ @@ -13,30 +13,70 @@ \n } } -\func mline prefix suffix lin tag subfield { - \if {{\strcmp {\lin \index 1} \tag}\eq 0} { - \foreach field {\lin \index 3} { - \if {{\strcmp {\field \index 1} \subfield}\eq 0} { - \prefix - \field \index 2 - \suffix + +\func case tag indicator identifier \code max { + \if {\match \tag {\line\index 1}} { + \if {\match \indicator {\line\index 2}} { + \foreach field {\line \index 3} { + \if{\match \identifier \field\index 1} { + \set info {\field \index 2} + \if {{\strlen \info}\gt \max} + { + \set info {\strsub \info 0 50 ..} + } + \code } } - } + } } } -\func f1 rec { - \foreach Line {\rec} { - \mline '' ': ' \Line 245 c - } - \foreach Line {\rec} { - \mline '' {} \Line 245 a +\func casx tag identifier \pre \mid \end { + \set no {} + \if {\match \tag {\line\index 1}} { + \foreach field {\line \index 3} { + \if {\match \identifier \field\index 1} { + \set info {\field \index 2} + \if {\no} { + \mid + \incr \no + } + \else { + \set no 1 + \pre + } + } + } + } + \if {\no} { + \end } - ' - ' - \foreach Line {\rec} { - \mline '' ', ' \Line 260 b - \mline '' ' ' \Line 260 c +} + +\func marc rec \code { + \foreach line {\rec} {\code} +} + +\func f1 record { + \marc {\record} { + \case 245 .. [a] { \info } 60 + \case 260 .. c { - \info} 9 } \n } +\func f2 record { + \foreach line {\record} { + \case 245 .. [ab] {\info\ } 400 + \casx 260 [abc] {\n\ \ \info} {\ \info} {} + \casx 300 [ab] {- \info} {\ \info} {} + } + \n + \foreach line {\record} { + \casx 700 a {\info} {\ ,\info} {\n} + } + \foreach line {\record} { + \case 020 .. a {ISBN: \info\n} 50 + \case 022 .. a {ISSN: \info\n} 50 + \casx 050 [ab] {LC: \info} {\info} {\n} + } +} diff --git a/kernel/urp.c b/kernel/urp.c index 788d7be..6816906 100644 --- a/kernel/urp.c +++ b/kernel/urp.c @@ -2,7 +2,10 @@ * Europagate, 1995 * * $Log: urp.c,v $ - * Revision 1.18 1995/03/01 14:32:26 adam + * Revision 1.19 1995/03/02 09:32:11 adam + * New presentation formats. f0=full, f1=brief, f2=mid + * + * Revision 1.18 1995/03/01 14:32:26 adam * Better diagnostics. Default is, that only one database selected when * several are known. * @@ -407,7 +410,7 @@ static void present (const char *set, int offset, int number, const struct zass_presentent *zp; int len; int max_number; - char format_str[40]; + char format_str[16]; max_number = atoi (gw_res_get (info.kernel_res, "gw.max.show", "200")); @@ -472,11 +475,14 @@ static void present (const char *set, int offset, int number, if (format_token) { len = format_token->len; + if (len >= sizeof(format_str)) + len = sizeof(format_str)-1; memcpy (format_str, format_token->name, len); format_str[len] = '\0'; } if (info.fml && format_token && - (!strcmp (format_str, "0") || !strcmp (format_str, "1"))) + (!strcmp (format_str, "0") || !strcmp (format_str, "1") + || !strcmp(format_str, "2"))) { arg_ar[0] = "\\f"; arg_ar[1] = format_str;