X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Ficonv_decode_danmarc.c;h=cf9e50c45810ff4c15e4cbec1e2e1745c75d167e;hp=3dc0f6efcda4e04bbaf22ec095360181b7631872;hb=0b121738c22cd67b153792d645746447d8a81767;hpb=4e58607ee6ef2a5d183262b9a87415fed2311c85 diff --git a/src/iconv_decode_danmarc.c b/src/iconv_decode_danmarc.c index 3dc0f6e..cf9e50c 100644 --- a/src/iconv_decode_danmarc.c +++ b/src/iconv_decode_danmarc.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2008 Index Data + * Copyright (C) Index Data * See the file LICENSE for details. */ /** @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -25,7 +24,7 @@ struct decoder_data { unsigned long x_back; }; -static unsigned long read_danmarc(yaz_iconv_t cd, +static unsigned long read_danmarc(yaz_iconv_t cd, yaz_iconv_decoder_t d, unsigned char *inp, size_t inbytesleft, size_t *no_read) @@ -58,14 +57,12 @@ static unsigned long read_danmarc(yaz_iconv_t cd, *no_read = 2; break; case 0xe5: /* LATIN SMALL LETTER A WITH RING ABOVE */ - x = 'a'; - data->x_back = 'a'; - *no_read = 1; + x = 0xa733; + *no_read = 2; break; case 0xc5: /* LATIN CAPITAL LETTER A WITH RING ABOVE */ - x = 'A'; - data->x_back = 'a'; - *no_read = 1; + x = 0xa732; + *no_read = 2; break; default: if (inbytesleft < 5) @@ -77,7 +74,7 @@ static unsigned long read_danmarc(yaz_iconv_t cd, else { unsigned long v; - sscanf(inp+1, "%4lx", &v); + sscanf((const char *) inp+1, "%4lx", &v); *no_read = 5; x = v; } @@ -106,7 +103,7 @@ void destroy_danmarc(yaz_iconv_decoder_t d) yaz_iconv_decoder_t yaz_danmarc_decoder(const char *fromcode, yaz_iconv_decoder_t d) - + { if (!yaz_matchstr(fromcode, "danmarc")) { @@ -126,7 +123,9 @@ yaz_iconv_decoder_t yaz_danmarc_decoder(const char *fromcode, /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ +