/*
- * 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.1 2003-10-27 12:21:33 adam Exp $
+ * $Id: odr_oct.c,v 1.5 2004-10-02 13:28:26 adam Exp $
*/
#if HAVE_CONFIG_H
#include <config.h>
return odr_missing(o, opt, name);
if (o->direction == ODR_PRINT)
{
- int i;
odr_prname(o, name);
- fprintf(o->print, "OCTETSTRING(len=%d)", (*p)->len);
- for (i = 0; i<(*p)->len; i++)
- {
- if (i < 5 || i > ((*p)->len - 4))
- {
- fprintf (o->print, " %02X", (*p)->buf[i]);
- }
- else if (i == 5)
- fprintf (o->print, " .. ");
- }
- fprintf(o->print, "\n");
+ 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;
}
if (o->direction == ODR_DECODE)
if (o->direction == ODR_PRINT)
{
odr_prname(o, name);
- fprintf(o->print, "'%s'\n", *p);
+ odr_printf(o, "'%s'\n", *p);
return 1;
}
t = (Odr_oct *)odr_malloc(o, sizeof(Odr_oct)); /* wrapper for octstring */
if (o->direction == ODR_PRINT)
{
odr_prname(o, name);
- fprintf(o->print, "'%s'\n", *p);
+ odr_printf(o, "'%s'\n", *p);
return 1;
}
t = (Odr_oct *)odr_malloc(o, sizeof(Odr_oct)); /* wrapper for octstring */