2 * Copyright (C) 1995-2007, Index Data ApS
3 * See the file LICENSE for details.
5 * $Id: oid_util.c,v 1.1 2007-04-12 13:52:57 adam Exp $
10 * \brief Implements OID base utilities
21 #include <yaz/snprintf.h>
22 #include <yaz/oid_util.h>
24 void oid_oidcpy(int *t, const int *s)
26 while ((*(t++) = *(s++)) > -1);
29 void oid_oidcat(int *t, const int *s)
33 while ((*(t++) = *(s++)) > -1);
36 int oid_oidcmp(const int *o1, const int *o2)
38 while (*o1 == *o2 && *o1 > -1)
51 int oid_oidlen(const int *o)
61 char *oid_to_dotstring(const int *oid, char *oidbuf)
67 for (i = 0; oid[i] != -1 && i < OID_SIZE; i++)
69 yaz_snprintf(tmpbuf, sizeof(tmpbuf)-1, "%d", oid[i]);
72 strcat(oidbuf, tmpbuf);
80 * indent-tabs-mode: nil
82 * vim: shiftwidth=4 tabstop=8 expandtab