# 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 \
\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}
+ }
+}
* 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.
*
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"));
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;