Allow configuration of extra keys in :INTERNAL: domain.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23112 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2006-06-27 19:06:44 +00:00
parent 2c0ee96dfe
commit 401e64c806
4 changed files with 51 additions and 7 deletions

View file

@ -1,3 +1,10 @@
2006-06-27 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSUserDefaults.m: Fix spelling in comment
* Source/NSPathUtilities.m: Add GNUSTEP_EXTRA to allow extra info
in GSConfigDomain without producing an error message.
* Documentation/Base.gsdoc: Document GNUSTEP_EXTRA
2006-06-22 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSString.m: small optimisation for initialisation with

View file

@ -556,6 +556,20 @@ notice and this notice are preserved.
These add to the path for NSSystemDomainMask, or
NSLocalDomainMask as appropriate.
</p>
<p>
All the above values from the configuration file are made
available in the NSUserDefaults system at runtime, in the
GSConfigDomain of the defaults.<br />
In addition, the configuration file may contain the key
<em>GNUSTEP_EXTRA</em> with a value set to be a comma separated
list of extra key names which are to be allowed in the config
file. This lets you add more key/value pairs to the config
file intended to be seen in the NSUserDefaults system.<br />
However, you must take care that any key names you choose
do not conflict with variable names used with the GNUstep
Makefiles package or your configuration script may cause
problems when building software.
</p>
<p>
The exact format of the configuration file is expected to
be that of a basic unix "conf" style file, with one
@ -563,9 +577,10 @@ notice and this notice are preserved.
can 'source' in order to define shell variables).<br />
This configuration file uses the escape sequence and
quoting conventions of the standard bourne shell.<br />
The only Keys permitted are those listed in the
documentation, and all consist of uppercase letters, digits,
and underscores, and must not begin with a digit.<br />
The only Keys permitted are those listed above (plus any
specified in the GNUSTEP_EXTRA list), and all consist of
uppercase letters, digits, and underscores, and must
not begin with a digit.<br />
A value may be any quoted string (or an unquoted string
containing no white space).<br />
Lines beginning with a hash '#' are deemed comment lines
@ -592,7 +607,7 @@ notice and this notice are preserved.
and just run.
</p>
<p>
Firstly, wariables in the configuration file which define
Firstly, variables in the configuration file which define
paths, are expected to by full path specifications, except
for the special case in which they begin with dot-slash (./).
In this case the text after the dot-slash is appended to

View file

@ -22,7 +22,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
<title>NSPathUtilities function reference</title>
$Date$ $Revision$
@ -252,6 +253,7 @@ getPathConfig(NSDictionary *dict, NSString *key)
static void ExtractValuesFromConfig(NSDictionary *config)
{
NSMutableDictionary *c = [config mutableCopy];
NSString *extra;
/*
* Move values out of the dictionary and into variables for rapid reference.
@ -276,6 +278,25 @@ static void ExtractValuesFromConfig(NSDictionary *config)
ASSIGN_PATH(localApps, c, @"GNUSTEP_PLATFORM_LOCAL_APPS");
ASSIGN_PATH(localLibs, c, @"GNUSTEP_PLATFORM_LOCAL_LIBS");
/*
* The GNUSTEP_EXTRA field may contain a list of extra keys which
* we permit in the dictionary without generating a warning.
*/
extra = [c objectForKey: @"GNUSTEP_EXTRA"];
if (extra != nil)
{
NSEnumerator *enumerator;
NSString *key;
enumerator = [[extra componentsSeparatedByString: @","] objectEnumerator];
[c removeObjectForKey: @"GNUSTEP_EXTRA"];
while ((key = [enumerator nextObject]) != nil)
{
key = [key stringByTrimmingSpaces];
[c removeObjectForKey: key];
}
}
/*
* Remove any other dictionary entries we have used.
*/

View file

@ -20,7 +20,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
<title>NSUserDefaults class reference</title>
$Date$ $Revision$
@ -197,7 +198,7 @@ static void updateCache(NSUserDefaults *self)
* <desc>
* Information retrieved from the GNUstep configuration system.
* Usually the system wide and user specific GNUstep.conf files,
* or from information cimplied in when the base library was
* or from information compiled in when the base library was
* built.
* </desc>
* <term><code>NSRegistrationDomain</code> ... volatile</term>