Yann POUPET wrote:
Since many (most ?) config files may be something like :
# some comments
param1 = arg1
param2 = arg2
param3 = arg3
# another comment
param4 = arg4
why not having a lib function that would help parsing/reading/writing such a
file ?
There actually is an undocumented/private library much like that already for
reading the files in that format in /etc/default - libcmd.
http://cvs.opensolaris.org/source/xref/on/usr/src/lib/libcmd/common/deflt.c
Of course, some configuration files would need some more complex things. I
can't think about one right now, but I can imagine that paramX=argX would not
fit all needs.
X server config files, like OWconfig and xorg.conf are more complex, since
they need to group by device and may have the same key/value pairs repeated
for different devices. For example, you'll have one with device="/dev/kbd"
and another with device="/dev/mouse" in most configs. (And in some configs
you'll have multiple keyboard or mouse devices, so you can't just have
keyboard-device= and mouse-device= .
Thus maybe writing config files with an XML format would help ?
Furthermore, as I said before, there may be a lot of config files.
Why not have ALL configuration into a single file ? That could be a hash, a
berkeleydb file (I think E17 uses such files for conf), or whatever. (isn't it
the way MS Win does with is registry ?)
For files needed by everyone, this file would be /config (or /etc/config), for
personnal config that could be ~/config. Thus only two locations for all
configs.
Now that's starting to sound a lot like the SMF properties database.
--
-Alan Coopersmith- [EMAIL PROTECTED]
Sun Microsystems, Inc. - X Window System Engineering
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org