X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=util%2Foid.c;h=aefa1e1fd81c325ea74bea00d8d70be31bc93af2;hb=506058d7a9f17fcc88f899d92476fe59cc09bdfb;hp=c4202dc66b1180cc892bb56a688c60ebc179c53e;hpb=5c08a4b4de3ef50d6842d5604a34238e200f7716;p=yaz-moved-to-github.git diff --git a/util/oid.c b/util/oid.c index c4202dc..aefa1e1 100644 --- a/util/oid.c +++ b/util/oid.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2002, Index Data * See the file LICENSE for details. * - * $Id: oid.c,v 1.50 2002-01-23 20:22:49 adam Exp $ + * $Id: oid.c,v 1.52 2002-01-29 13:47:33 adam Exp $ */ /* @@ -447,8 +447,6 @@ struct oident *oid_addent (int *oid, enum oid_proto proto, struct oident *oident = 0; nmem_mutex_enter (oid_mutex); - if (desc) - oident = oid_getentbyoid_x (oid); if (!oident) { char desc_str[200]; @@ -514,7 +512,9 @@ static oid_value oid_getval_raw(const char *name) } oid[i] = val; oid[i+1] = -1; - oident = oid_addent (oid, PROTO_GENERAL, CLASS_GENERAL, NULL, + oident = oid_getentbyoid_x (oid); + if (!oident) + oident = oid_addent (oid, PROTO_GENERAL, CLASS_GENERAL, NULL, VAL_DYNAMIC); return oident->value; } @@ -538,3 +538,12 @@ void oid_setprivateoids(oident *list) { oid_transfer (list); } + +void oid_trav (void (*func)(struct oident *oidinfo, void *vp), void *vp) +{ + struct oident_list *ol; + + oid_init (); + for (ol = oident_table; ol; ol = ol->next) + (*func)(&ol->oident, vp); +}