From: Adam Dickmeiss Date: Thu, 17 Apr 2014 06:47:03 +0000 (+0200) Subject: Add odr_setprint_noclose X-Git-Tag: v5.1.0~5 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=ce627148dbba2878565b8d9da33f6b25f33da4bd;p=yaz-moved-to-github.git Add odr_setprint_noclose Like odr_setprint, but does not fclose. --- diff --git a/include/yaz/odr.h b/include/yaz/odr.h index 8e72650..7f9308f 100644 --- a/include/yaz/odr.h +++ b/include/yaz/odr.h @@ -171,6 +171,7 @@ YAZ_EXPORT void odr_setelement(ODR o, const char *addinfo); YAZ_EXPORT const char *odr_getelement(ODR o); YAZ_EXPORT void odr_perror(ODR o, const char *message); YAZ_EXPORT void odr_setprint(ODR o, FILE *file); +YAZ_EXPORT void odr_setprint_noclose(ODR o, FILE *file); YAZ_EXPORT ODR odr_createmem(int direction); YAZ_EXPORT void odr_reset(ODR o); YAZ_EXPORT void odr_destroy(ODR o); diff --git a/src/odr.c b/src/odr.c index e866862..9cbac0d 100644 --- a/src/odr.c +++ b/src/odr.c @@ -166,6 +166,10 @@ void odr_setprint(ODR o, FILE *file) odr_set_stream(o, file, odr_FILE_write, odr_FILE_close); } +void odr_setprint_noclose(ODR o, FILE *file) +{ + odr_set_stream(o, file, odr_FILE_write, 0); +} void odr_set_stream(ODR o, void *handle, void (*stream_write)(ODR o, @@ -213,7 +217,7 @@ ODR odr_createmem(int direction) o->op->enable_bias = 1; o->op->odr_ber_tag.lclass = -1; o->op->iconv_handle = 0; - odr_setprint(o, stderr); + odr_setprint_noclose(o, stderr); odr_reset(o); yaz_log(log_level, "odr_createmem dir=%d o=%p", direction, o); return o;