X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fodr_oct.c;h=1ea73539d706816abab347378b30c714fde79256;hb=5c3d2d2ab097e4bb59ba5718a396b020a2d302c0;hp=27cd9b0e64b16dfe74024fbe5f5b8a8a81cb55bb;hpb=0a7d4354288c747883261e9f430a7e0069225a5b;p=yaz-moved-to-github.git diff --git a/src/odr_oct.c b/src/odr_oct.c index 27cd9b0..1ea7353 100644 --- a/src/odr_oct.c +++ b/src/odr_oct.c @@ -1,15 +1,17 @@ /* - * Copyright (c) 1995-2003, Index Data + * Copyright (c) 1995-2004, Index Data * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss * - * $Id: odr_oct.c,v 1.2 2004-08-11 12:15:38 adam Exp $ + * $Id: odr_oct.c,v 1.7 2004-11-18 15:18:13 heikki Exp $ + */ +/** + * \file odr_oct.c + * \brief Implements ODR OCTET codec */ #if HAVE_CONFIG_H #include #endif -#include #include "odr-priv.h" /* @@ -33,18 +35,11 @@ int odr_octetstring(ODR o, Odr_oct **p, int opt, const char *name) return odr_missing(o, opt, name); if (o->direction == ODR_PRINT) { - int i; odr_prname(o, name); - odr_printf(o, "OCTETSTRING(len=%d)", (*p)->len); - for (i = 0; i<(*p)->len; i++) - { - if (i < 5 || i > ((*p)->len - 4)) - { - odr_printf(o, " %02X", (*p)->buf[i]); - } - else if (i == 5) - odr_printf(o, " .. "); - } + odr_printf(o, "OCTETSTRING(len=%d) ", (*p)->len); + + o->op->stream_write(o, o->print, ODR_OCTETSTRING, + (char*) (*p)->buf, (*p)->len); odr_printf(o, "\n"); return 1; }