38 "Memory allocation failed",
41 "Required data element missing",
47 "Length of constructed type different from sum of members",
48 "Overflow writing definite length of constructed type",
64 fprintf(stderr,
"%s: %s (code %d:%d)", message,
odr_errlist[err], err, x);
66 fprintf(stderr,
" element %s", e);
68 fprintf(stderr,
"\n");
71 fprintf(stderr,
"Element path:");
73 fprintf(stderr,
" %s", *element_path++);
74 fprintf(stderr,
"\n");
135 const char *buf,
int len)
138 for (i = 0; i <
len; i++)
140 unsigned c = ((
const unsigned char *) buf)[i];
141 if (i == 20000 &&
len > 31000)
143 fputs(
" ..... ", (FILE*) handle);
146 if (strchr(
"\r\n\f\t", c) || (c >=
' ' && c <= 126))
147 putc(c, (FILE*) handle);
151 sprintf(x,
"\\X%02X", c);
152 fputs(x, (FILE*) handle);
159 FILE *f = (FILE *) handle;
160 if (f && f != stderr && f != stdout)
175 void (*stream_write)(
ODR o,
176 void *handle,
int type,
177 const char *buf,
int len),
178 void (*stream_close)(
void *handle))
void yaz_log(int level, const char *fmt,...)
Writes log message.
int yaz_log_module_level(const char *name)
returns level for module
void nmem_reset(NMEM n)
releases memory associaged with an NMEM handle
NMEM nmem_create(void)
returns new NMEM handle
void nmem_destroy(NMEM n)
destroys NMEM handle and memory associated with it
Internal ODR definitions.
void odr_perror(ODR o, const char *message)
void odr_setprint_noclose(ODR o, FILE *file)
const char ** odr_get_element_path(ODR o)
void odr_FILE_close(void *handle)
void odr_setelement(ODR o, const char *element)
int odr_geterrorx(ODR o, int *x)
void odr_seterror(ODR o, int error, int id)
void odr_FILE_write(ODR o, void *handle, int type, const char *buf, int len)
ODR odr_createmem(int direction)
int odr_set_charset(ODR o, const char *to, const char *from)
void odr_setbuf(ODR o, char *buf, int len, int can_grow)
void odr_setprint(ODR o, FILE *file)
Odr_null * odr_nullval(void)
void odr_set_stream(ODR o, void *handle, void(*stream_write)(ODR o, void *handle, int type, const char *buf, int len), void(*stream_close)(void *handle))
static int log_level_initialized
char * odr_getbuf(ODR o, int *len, int *size)
const char * odr_getelement(ODR o)
void odr_printf(ODR o, const char *fmt,...)
#define ODR_VISIBLESTRING
int odr_seek(ODR o, int whence, int offset)
void * odr_malloc(ODR o, size_t size)
size_t yaz_iconv(yaz_iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
just like iconv(3)
int yaz_iconv_close(yaz_iconv_t cd)
just like iconv_close(3)
yaz_iconv_t yaz_iconv_open(const char *tocode, const char *fromcode)
just like iconv_open(3)
void yaz_vsnprintf(char *buf, size_t size, const char *fmt, va_list ap)
Header for config file reading utilities.
struct odr_constack * stack_top
void(* stream_write)(ODR o, void *handle, int type, const char *buf, int len)
void(* stream_close)(void *handle)
const char ** tmp_names_buf
struct odr_constack * stack_first
struct Odr_ber_tag odr_ber_tag
stack for BER constructed items
struct odr_constack * prev
Header for memory handling functions.
#define xfree(x)
utility macro which calls xfree_f
#define xmalloc(x)
utility macro which calls malloc_f