X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fiso5428.c;h=de8044b0dfc15bc8280ea71e29f4fb46ba764c73;hp=a78b00d3287186cc62a436d79c104e28775ded14;hb=65f1b9fce2d1d86df7d75645fb46fbba32dd01e3;hpb=e4fc51d4432f2adcc67db4b50ac5ce687302f9be diff --git a/src/iso5428.c b/src/iso5428.c index a78b00d..de8044b 100644 --- a/src/iso5428.c +++ b/src/iso5428.c @@ -2,11 +2,10 @@ * Copyright (C) 1995-2008, Index Data ApS * See the file LICENSE for details. * - * $Id: siconv.c,v 1.50 2008-03-12 08:53:28 adam Exp $ */ /** * \file - * \brief ISO-5428 character mapping (iconv) + * \brief ISO-5428:1984 encoding and decoding */ #if HAVE_CONFIG_H @@ -270,8 +269,9 @@ unsigned long yaz_read_iso5428_1984(yaz_iconv_t cd, unsigned char *inp, return x; } -size_t yaz_write_iso5428_1984(yaz_iconv_t cd, unsigned long x, - char **outbuf, size_t *outbytesleft) +static size_t write_iso_5428_1984(yaz_iconv_t cd, yaz_iconv_encoder_t en, + unsigned long x, + char **outbuf, size_t *outbytesleft) { size_t k = 0; unsigned char *out = (unsigned char*) *outbuf; @@ -365,6 +365,18 @@ size_t yaz_write_iso5428_1984(yaz_iconv_t cd, unsigned long x, return 0; } +yaz_iconv_encoder_t yaz_iso_5428_encoder(const char *name, + yaz_iconv_encoder_t e) +{ + if (!yaz_matchstr(name, "iso54281984") + || !yaz_matchstr(name, "iso5428:1984")) + { + e->write_handle = write_iso_5428_1984; + return e; + } + return 0; +} + /* * Local variables: