--- ../cvsver/core/base/Headers/Foundation/NSPathUtilities.h 2004-02-10 13:17:03.000000000 +0800 +++ ../core/base/Headers/Foundation/NSPathUtilities.h 2004-04-06 13:43:33.000000000 +0800 @@ -20,7 +20,7 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. - AutogsdocSource: NSUser.m + AutogsdocSource: NSPathUtilities.m */ #ifndef __NSPathUtilities_h_GNUSTEP_BASE_INCLUDE @@ -34,15 +34,22 @@ * LOGNAME environment variable. Using it will almost certainly cause * trouble if the process does not posess the file access priviliges of the * new name. This is provided primarily for use by processes that run as - * system-manager and need to act as particular users. If uses the + * system-manager and need to act as particular users. It uses the * [NSUserDefaults +resetUserDefaults] extension to reset the defaults system * to use the defaults belonging to the new user. */ -GS_EXPORT void GSSetUserName(NSString *name); +GS_EXPORT void GSSetUserName(NSString *name); + +/** + * Try to locate file/directory (aName).(anExtension) in paths. + * Will return the first found or nil if nothing is found. + */ +GS_EXPORT NSString *GSFindNamedFile(NSArray *paths, NSString *aName, NSString *anExtension); GS_EXPORT NSString *GSDefaultsRootForUser(NSString *userName); -GS_EXPORT NSString *GSSystemRootDirectory(void); -GS_EXPORT NSArray *GSStandardPathPrefixes(void); + +//GS_EXPORT NSString *GSSystemRootDirectory(void); DEPRECATED +//GS_EXPORT NSArray *GSStandardPathPrefixes(void); DEPRECATED #endif GS_EXPORT NSString *NSUserName(void); GS_EXPORT NSString *NSHomeDirectory(void); @@ -51,7 +58,7 @@ #ifndef STRICT_OPENSTEP typedef enum { - NSApplicationDirectory, + NSApplicationDirectory = 1, NSDemoApplicationDirectory, NSDeveloperApplicationDirectory, NSAdminApplicationDirectory, @@ -59,24 +66,37 @@ NSDeveloperDirectory, NSUserDirectory, NSDocumentationDirectory, - NSAllApplicationsDirectory, - NSAllLibrariesDirectory, + NSDocumentDirectory, + +/* Apple Reserved Directory Identifiers */ + + NSAllApplicationsDirectory = 100, + NSAllLibrariesDirectory = 101, + +/* GNUstep Directory Identifiers */ + + GSApplicationSupportDirectory = 150, + GSFontsDirectory, + GSFrameworksDirectory, GSLibrariesDirectory, GSToolsDirectory, - GSApplicationSupportDirectory, + GSPreferencesDirectory + } NSSearchPathDirectory; -typedef unsigned int NSSearchPathDomainMask; -#define NSUserDomainMask 0x00000001 -#define NSLocalDomainMask 0x00000002 -#define NSNetworkDomainMask 0x00000004 -#define NSSystemDomainMask 0x00000008 -#define NSAllDomainsMask 0xffffffff +typedef enum +{ + NSUserDomainMask = 1, + NSLocalDomainMask = 2, + NSNetworkDomainMask = 4, + NSSystemDomainMask = 8, + NSAllDomainsMask = 0xffffffff, +} NSSearchPathDomainMask; -GS_EXPORT NSArray *NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directoryKey, NSSearchPathDomainMask domainMask, BOOL expandTilde); +GS_EXPORT NSArray *NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directoryKey, NSSearchPathDomainMask domainMask, BOOL expandTilde); GS_EXPORT NSString *NSFullUserName(void); -GS_EXPORT NSArray *NSStandardApplicationPaths(void); -GS_EXPORT NSArray *NSStandardLibraryPaths(void); +GS_EXPORT NSArray *NSStandardApplicationPaths(void); +GS_EXPORT NSArray *NSStandardLibraryPaths(void); GS_EXPORT NSString *NSTemporaryDirectory(void); GS_EXPORT NSString *NSOpenStepRootDirectory(void); #endif /* !STRICT_OPENSTEP */