projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add function yaz_iso5426_decode
[yaz-moved-to-github.git]
/
src
/
iconv_decode_marc8.c
diff --git
a/src/iconv_decode_marc8.c
b/src/iconv_decode_marc8.c
index
7b890ad
..
96a72bd
100644
(file)
--- a/
src/iconv_decode_marc8.c
+++ b/
src/iconv_decode_marc8.c
@@
-56,7
+56,7
@@
static unsigned long read_marc8(yaz_iconv_t cd, yaz_iconv_decoder_t d,
unsigned char *inp,
size_t inbytesleft, size_t *no_read)
{
unsigned char *inp,
size_t inbytesleft, size_t *no_read)
{
- struct decoder_data *data = d->data;
+ struct decoder_data *data = (struct decoder_data *) d->data;
unsigned long x;
if (data->comb_offset < data->comb_size)
{
unsigned long x;
if (data->comb_offset < data->comb_size)
{
@@
-110,7
+110,7
@@
static unsigned long read_marc8s(yaz_iconv_t cd, yaz_iconv_decoder_t d,
unsigned char *inp,
size_t inbytesleft, size_t *no_read)
{
unsigned char *inp,
size_t inbytesleft, size_t *no_read)
{
- struct decoder_data *data = d->data;
+ struct decoder_data *data = (struct decoder_data *) d->data;
unsigned long x = read_marc8(cd, d, inp, inbytesleft, no_read);
if (x && data->comb_size == 1)
{
unsigned long x = read_marc8(cd, d, inp, inbytesleft, no_read);
if (x && data->comb_size == 1)
{
@@
-243,7
+243,7
@@
static size_t init_marc8(yaz_iconv_t cd, yaz_iconv_decoder_t d,
unsigned char *inp,
size_t inbytesleft, size_t *no_read)
{
unsigned char *inp,
size_t inbytesleft, size_t *no_read)
{
- struct decoder_data *data = d->data;
+ struct decoder_data *data = (struct decoder_data *) d->data;
data->g0_mode = 'B';
data->g1_mode = 'E';
data->comb_offset = data->comb_size = 0;
data->g0_mode = 'B';
data->g1_mode = 'E';
data->comb_offset = data->comb_size = 0;
@@
-252,21
+252,22
@@
static size_t init_marc8(yaz_iconv_t cd, yaz_iconv_decoder_t d,
void destroy_marc8(yaz_iconv_decoder_t d)
{
void destroy_marc8(yaz_iconv_decoder_t d)
{
- struct decoder_data *data = d->data;
+ struct decoder_data *data = (struct decoder_data *) d->data;
xfree(data);
}
yaz_iconv_decoder_t yaz_marc8_decoder(const char *fromcode,
yaz_iconv_decoder_t d)
{
xfree(data);
}
yaz_iconv_decoder_t yaz_marc8_decoder(const char *fromcode,
yaz_iconv_decoder_t d)
{
- if (!yaz_matchstr(fromcode, "MARC8"))
+ if (!yaz_matchstr(fromcode, "MARC8") || !yaz_matchstr(fromcode, "ANSEL"))
d->read_handle = read_marc8;
else if (!yaz_matchstr(fromcode, "MARC8s"))
d->read_handle = read_marc8s;
else
return 0;
{
d->read_handle = read_marc8;
else if (!yaz_matchstr(fromcode, "MARC8s"))
d->read_handle = read_marc8s;
else
return 0;
{
- struct decoder_data *data = xmalloc(sizeof(*data));
+ struct decoder_data *data = (struct decoder_data *)
+ xmalloc(sizeof(*data));
d->data = data;
d->init_handle = init_marc8;
d->destroy_handle = destroy_marc8;
d->data = data;
d->init_handle = init_marc8;
d->destroy_handle = destroy_marc8;