2 * Copyright (c) 1995-2003, Index Data
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
6 * $Id: odr_oid.c,v 1.18 2003-01-06 08:20:28 adam Exp $
16 * Top level oid en/decoder.
17 * Returns 1 on success, 0 on error.
19 int odr_oid(ODR o, Odr_oid **p, int opt, const char *name)
27 o->t_class = ODR_UNIVERSAL;
30 if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt)) < 0)
39 if (o->direction == ODR_PRINT)
44 fprintf(o->print, "OID:");
45 for (i = 0; (*p)[i] > -1; i++)
46 fprintf(o->print, " %d", (*p)[i]);
47 fprintf(o->print, "\n");
50 if (o->direction == ODR_DECODE)
51 *p = (int *)odr_malloc(o, OID_SIZE * sizeof(**p));
52 return ber_oidc(o, *p);