X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fiso5428.c;h=61309bcae1f509d0a4a346d3a5acb9dcf5089809;hb=80fee38926477efd73c739731c5670d59c5d1bf7;hp=752f9c824f8011d0bf308afa74da46096a1726d9;hpb=ee6ab2ee3a9ee1a8c65d7272ec7fba1d886f5af0;p=yaz-moved-to-github.git diff --git a/src/iso5428.c b/src/iso5428.c index 752f9c8..61309bc 100644 --- a/src/iso5428.c +++ b/src/iso5428.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2008 Index Data + * Copyright (C) 1995-2010 Index Data * See the file LICENSE for details. */ /** @@ -18,8 +18,9 @@ #include "iconv-p.h" -unsigned long yaz_read_iso5428_1984(yaz_iconv_t cd, unsigned char *inp, - size_t inbytesleft, size_t *no_read) +static unsigned long read_iso_5428_1984(yaz_iconv_t cd, yaz_iconv_decoder_t d, + unsigned char *inp, + size_t inbytesleft, size_t *no_read) { unsigned long x = 0; int tonos = 0; @@ -376,11 +377,26 @@ yaz_iconv_encoder_t yaz_iso_5428_encoder(const char *name, return 0; } +yaz_iconv_decoder_t yaz_iso_5428_decoder(const char *name, + yaz_iconv_decoder_t d) +{ + if (!yaz_matchstr(name, "iso54281984") + || !yaz_matchstr(name, "iso5428:1984")) + { + d->read_handle = read_iso_5428_1984; + return d; + } + return 0; +} + + /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ +