From 4884a9b3412dfd4c948c29b5f5275dfdf9b14207 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 30 Dec 2008 16:44:45 +0100 Subject: [PATCH] Added implementation-codes directive for .mar files --- data1/d1_marc.c | 15 +++++++++++++++ tab/usmarc.mar | 3 +++ 2 files changed, 18 insertions(+) diff --git a/data1/d1_marc.c b/data1/d1_marc.c index 8cd728b..1f9c8b8 100644 --- a/data1/d1_marc.c +++ b/data1/d1_marc.c @@ -148,6 +148,21 @@ data1_marctab *data1_read_marctab (data1_handle dh, const char *file) } res->force_identifier_length = atoi(argv[1]); } + else if (!strcmp(*argv, "implementation-codes")) + { + if (argc != 2) + { + yaz_log(YLOG_WARN, "%s:%d: Missing arg for %s", file, lineno, + *argv); + continue; + } + /* up to 4 characters .. space pad */ + if (strlen(argv[1]) > 4) + yaz_log(YLOG_WARN, "%s:%d: Max 4 characters for " + "implementation-codes", file, lineno); + else + memcpy(res->implementation_codes, argv[1], strlen(argv[1])); + } else yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'", file, lineno, *argv); diff --git a/tab/usmarc.mar b/tab/usmarc.mar index 348c9a1..eae1ea5 100644 --- a/tab/usmarc.mar +++ b/tab/usmarc.mar @@ -1,2 +1,5 @@ name usmarc reference USmarc + +# Defines implementation codes (offset 6..9) +#implementation-codes ABCD -- 1.7.10.4