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
Spell fix
[yaz-moved-to-github.git]
/
src
/
iconv_encode_marc8.c
diff --git
a/src/iconv_encode_marc8.c
b/src/iconv_encode_marc8.c
index
87c2a89
..
f29ccbf
100644
(file)
--- a/
src/iconv_encode_marc8.c
+++ b/
src/iconv_encode_marc8.c
@@
-1,5
+1,5
@@
/* This file is part of the YAZ toolkit.
/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2010 Index Data
+ * Copyright (C) 1995-2012 Index Data
* See the file LICENSE for details.
*/
/**
* See the file LICENSE for details.
*/
/**
@@
-17,7
+17,6
@@
#include <assert.h>
#include <errno.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/xmalloc.h>
#include <yaz/snprintf.h>
#include <yaz/xmalloc.h>
#include <yaz/snprintf.h>
@@
-59,7
+58,7
@@
static void init_marc8(yaz_iconv_encoder_t w)
data->write_marc8_g1 = 0;
}
data->write_marc8_g1 = 0;
}
-static size_t yaz_write_marc8_page_chr(yaz_iconv_t cd,
+static size_t yaz_write_marc8_page_chr(yaz_iconv_t cd,
struct encoder_data *w,
char **outbuf, size_t *outbytesleft,
const char *page_chr);
struct encoder_data *w,
char **outbuf, size_t *outbytesleft,
const char *page_chr);
@@
-85,7
+84,7
@@
static unsigned long lookup_marc8(yaz_iconv_t cd,
size_t inbytesleft, no_read_sub = 0;
unsigned long x;
size_t inbytesleft, no_read_sub = 0;
unsigned long x;
- *utf8_outbuf = '\0';
+ *utf8_outbuf = '\0';
inp = (unsigned char *) utf8_buf;
inbytesleft = strlen(utf8_buf);
inp = (unsigned char *) utf8_buf;
inbytesleft = strlen(utf8_buf);
@@
-211,7
+210,7
@@
static size_t flush_combos(yaz_iconv_t cd,
{
*(*outbuf)++ = w->write_marc8_second_half_char;
(*outbytesleft)--;
{
*(*outbuf)++ = w->write_marc8_second_half_char;
(*outbytesleft)--;
- }
+ }
w->write_marc8_last = 0;
w->write_marc8_ncr = 0;
w->write_marc8_last = 0;
w->write_marc8_ncr = 0;
@@
-220,7
+219,7
@@
static size_t flush_combos(yaz_iconv_t cd,
return 0;
}
return 0;
}
-static size_t yaz_write_marc8_page_chr(yaz_iconv_t cd,
+static size_t yaz_write_marc8_page_chr(yaz_iconv_t cd,
struct encoder_data *w,
char **outbuf, size_t *outbytesleft,
const char *page_chr)
struct encoder_data *w,
char **outbuf, size_t *outbytesleft,
const char *page_chr)
@@
-235,17
+234,17
@@
static size_t yaz_write_marc8_page_chr(yaz_iconv_t cd,
{
size_t plen = 0;
const char *page_out = page_chr;
{
size_t plen = 0;
const char *page_out = page_chr;
-
+
if (*outbytesleft < 8)
{
yaz_iconv_set_errno(cd, YAZ_ICONV_E2BIG);
if (*outbytesleft < 8)
{
yaz_iconv_set_errno(cd, YAZ_ICONV_E2BIG);
-
+
return (size_t) (-1);
}
if (*old_page_chr)
{
return (size_t) (-1);
}
if (*old_page_chr)
{
- if (!strcmp(*old_page_chr, ESC "p")
+ if (!strcmp(*old_page_chr, ESC "p")
|| !strcmp(*old_page_chr, ESC "g")
|| !strcmp(*old_page_chr, ESC "b"))
{
|| !strcmp(*old_page_chr, ESC "g")
|| !strcmp(*old_page_chr, ESC "b"))
{
@@
-291,7
+290,7
@@
static size_t yaz_write_marc8_2(yaz_iconv_t cd, struct encoder_data *w,
y = '|';
else
{
y = '|';
else
{
- y = x;
+ y = x;
enable_ncr = 1;
}
}
enable_ncr = 1;
}
}
@@
-357,7
+356,7
@@
static size_t yaz_write_marc8_generic(yaz_iconv_t cd, struct encoder_data *w,
int ncr = w->write_marc8_ncr;
const char *lpage = w->write_marc8_lpage;
size_t r;
int ncr = w->write_marc8_ncr;
const char *lpage = w->write_marc8_lpage;
size_t r;
-
+
r = yaz_write_marc8_2(cd, w, x1,
outbuf, outbytesleft, loss_mode);
if (r)
r = yaz_write_marc8_2(cd, w, x1,
outbuf, outbytesleft, loss_mode);
if (r)
@@
-409,7
+408,7
@@
static void destroy_marc8(yaz_iconv_encoder_t e)
yaz_iconv_encoder_t yaz_marc8_encoder(const char *tocode,
yaz_iconv_encoder_t e)
yaz_iconv_encoder_t yaz_marc8_encoder(const char *tocode,
yaz_iconv_encoder_t e)
-
+
{
if (!yaz_matchstr(tocode, "MARC8"))
e->write_handle = write_marc8_normal;
{
if (!yaz_matchstr(tocode, "MARC8"))
e->write_handle = write_marc8_normal;