mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
* Continuation of NSPathUtilities patches
* configure.ac: Add config-file option * Headers/Foundation/NSPathUtilities.h: Add GSFindNamedFile, more NSSearchPathDirectory enums. * Source/GNUmakefile: Don't install Win32 headers. * Source/NSPathUtilities.m (InitializePathUtilities, ...): Add support for reading standard path locations from a configuration file. Various support functions added/removed to fit. (GSFindNamedFile): New function. (GSSetUserName): Do nothing if the user is the same. (NSHomeDirectoryForUser): Use Windows utilities to get user name (on Windows, of course). (NSFullUserName): Default to NSUserName on Windows. (GSSystemRootDirectory): Mark as deprecated. (GSDefaultsRootForUser): Correctly return the actual defaults directory, not the user directory. (GSStandardPathPrefixes): Mark as deprecated. (NSSearchPathForDirectoriesInDomains): Add platform paths and additional search directories. * Source/NSUserDefaults (pathForUser): Correct use of GSDefaultsRootForUser. Remove obsolete path checking and defaults location checking. (Patches from Sheldon Gill with some modifications). * Documentation/Base.gsdoc: Update documentation. * Headers/Additions/GNUstepBase/Win32_Utilities.h, Source/win32/Win32_Utilities.m: Fix function arguments. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20908 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
fc96b0fdbe
commit
6292a363bc
12 changed files with 1277 additions and 769 deletions
|
@ -41,11 +41,11 @@
|
|||
* Returns a hive key or 0 if unable.
|
||||
*/
|
||||
HKEY
|
||||
Win32OpenRegistry(DWORD hive, const char *key)
|
||||
Win32OpenRegistry(HKEY hive, const char *key)
|
||||
{
|
||||
HKEY regkey;
|
||||
|
||||
if (ERROR_SUCCESS == RegOpenKeyEx((HKEY)hive, key, 0, KEY_READ, ®key))
|
||||
if (ERROR_SUCCESS == RegOpenKeyEx(hive, key, 0, KEY_READ, ®key))
|
||||
{
|
||||
return regkey;
|
||||
}
|
||||
|
@ -57,13 +57,13 @@ Win32OpenRegistry(DWORD hive, const char *key)
|
|||
* Returns an NSString as read from a registry STRING value.
|
||||
*/
|
||||
NSString *
|
||||
Win32NSStringFromRegistry(HKEY regkey, const char *regValue)
|
||||
Win32NSStringFromRegistry(HKEY regkey, NSString *regValue)
|
||||
{
|
||||
char buf[MAX_PATH];
|
||||
DWORD bufsize=MAX_PATH;
|
||||
DWORD type;
|
||||
|
||||
if (ERROR_SUCCESS==RegQueryValueEx(regkey, regValue, 0, &type, buf, &bufsize))
|
||||
if (ERROR_SUCCESS==RegQueryValueEx(regkey, [regValue cString], 0, &type, buf, &bufsize))
|
||||
{
|
||||
// FIXME: Check type is correct!
|
||||
|
||||
|
@ -77,8 +77,8 @@ Win32NSStringFromRegistry(HKEY regkey, const char *regValue)
|
|||
return nil;
|
||||
}
|
||||
|
||||
// NSNumber *Win32NSNumberFromRegistry(HKEY regkey, const char *regValue);
|
||||
// NSData *Win32NSDataFromRegistry(HKEY regkey, const char *regValue);
|
||||
// NSNumber *Win32NSNumberFromRegistry(HKEY regkey, NSString *regValue);
|
||||
// NSData *Win32NSDataFromRegistry(HKEY regkey, NSString *regValue);
|
||||
|
||||
/* ------+---------+---------+---------+---------+---------+---------+---------+
|
||||
#pragma mark -
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue