tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

uuid_name_lookup()



     I'm thinking of importing uuid_name_lookup() and uuid_addr_lookup()
from DragonflyBSD.  These functions look in a file, /etc/uuids and
/etc/defaults/uuids, which contains a table mapping uuids to
descriptive strings.  The advantage is that it makes it easy for
various tools to know about new uuids without having to recompile
them.  The code is here:
http://gitweb.dragonflybsd.org/dragonfly.git/blob/refs/heads/master:/lib/libc/uuid/uuid_name_lookup.c
or http://tinyurl.com/j4kotc7 .

     The problem is that the code uses sys/tree.h with extensions
(the DragonflyBSD version is based on an old NetBSD version).
Also, the interfaces in sys/tree.h are considered to be deprecated.
It seems that I have three choices: extend sys/tree.h, convert
uuid_name_lookup.c to use the newer sys/rbtree.h, or redo it
completely.  I was thinking of a small array to cache the items
being looked up.  It is highly unlikely that more then a handful
of items will be needed at any given time, which means that using
an rbtree is overkill and the time spent manipulating the tree is
likely to be excessive overhead.  Any thoughts on which route to
go?


Home | Main Index | Thread Index | Old Index