From: Adam Dickmeiss Date: Tue, 29 Jan 2002 13:47:33 +0000 (+0000) Subject: New call oid_trav. X-Git-Tag: YAZ.1.8.5~9 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=506058d7a9f17fcc88f899d92476fe59cc09bdfb;p=yaz-moved-to-github.git New call oid_trav. --- diff --git a/CHANGELOG b/CHANGELOG index 78acb57..63ffe48 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,8 @@ Possible compatibility problems with earlier versions marked with '*'. --- 1.8.5 2002/XX/XX +New call oid_trav, that visits all registered OIDs via callback. + Function ZOOM_record_get now returns const char pointer rather than void pointer. It saves a lot of type casts. diff --git a/include/yaz/oid.h b/include/yaz/oid.h index 45fcd76..0e745ec 100644 --- a/include/yaz/oid.h +++ b/include/yaz/oid.h @@ -23,7 +23,7 @@ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. * - * $Id: oid.h,v 1.8 2001-10-29 09:16:27 adam Exp $ + * $Id: oid.h,v 1.9 2002-01-29 13:47:33 adam Exp $ */ #ifndef OID_H @@ -223,6 +223,10 @@ YAZ_EXPORT void oid_setprivateoids(oident *list); YAZ_EXPORT struct oident *oid_addent (int *oid, enum oid_proto proto, enum oid_class oclass, const char *desc, int value); + +YAZ_EXPORT void oid_trav (void (*func)(struct oident *oidinfo, void *vp), + void *vp); + YAZ_EXPORT void oid_init(void); YAZ_EXPORT void oid_exit(void); diff --git a/util/oid.c b/util/oid.c index 284533b..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.51 2002-01-26 20:50:59 adam Exp $ + * $Id: oid.c,v 1.52 2002-01-29 13:47:33 adam Exp $ */ /* @@ -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); +}