--On Friday, May 31, 2002 9:38 AM +0200 Stipe Tolj <[EMAIL PROTECTED]>
wrote:
> Harrie Hazewinkel wrote:
>> I was wondering if someone could tell me the reason why putting it
>> in a dictionary first as a very general configuration representation
>> and later search into it for only those parts needed??
>
> I'm not sure, but is the dictionary needed for faster lookups later
> when the groups are needed.
OK, but what is fast, you only do this at startup. :-)
The thing I merely was wondering of is why a 2 step phase.
First loading it all in the process and that as a second
phase look into the values of it.
See also below.
>
>> Another question I have is why one would have all configuration tokens
>> known to each process and depending on the process totally ignore it??
>> The main reason is maybe that this way a single configuration file
>> can be used for all, but I guess there is more.
>
> Hmm, I didn't understand the question Harrie.
I will explain it again.
The cfg.def, cfg.c and cfg.h file in the gwlib are the core of the
configuration handling. All tokens are known there. Those who are
not will cause an error while reading the configuration file.
All others are put into a list/dictionary for later use.
The later use by the process is just to call the ones it needs
from the list/dictionary. All others are basically ignored.
One could make it like this. Each process only knows those
tokens it will use. All other tokens will generate an error.
This as oppose to read all possible tokens of any of the
processes and just ignore those not used by that process.
Therefore, my question 'why should each process know all possible
tokens for all processes of the package and those not needed being
ignored by the process'??
I believe this is done so only one configuration file is needed
for the complete system (bearebox and wap/smsbox).
Howevr, this would make a more module system problematic, since not
all processes need the same module and thus do not know all the
same tokens.
Hope this explains it better.
Harrie
Internet Management Consulting
mailto:[EMAIL PROTECTED] http ://www.mod-snmp.com/