mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Updates to reduce global namespace pollution. Plenty more remaining.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23795 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9d71af9cbf
commit
eae859d1c7
85 changed files with 1090 additions and 1277 deletions
|
@ -38,6 +38,7 @@
|
|||
|
||||
|
||||
#include "GNUstepBase/GSObjCRuntime.h"
|
||||
#include "Foundation/NSString.h"
|
||||
|
||||
/**
|
||||
* Macro to manage memory for chunks of code that need to work with
|
||||
|
@ -100,17 +101,6 @@
|
|||
because NXConstantString returns a pointer
|
||||
to it's internal pointer. */
|
||||
|
||||
/*
|
||||
* Function to get the name of a string encoding as an NSString.
|
||||
*/
|
||||
GS_EXPORT NSString *GSEncodingName(NSStringEncoding encoding);
|
||||
|
||||
/*
|
||||
* Function to determine whether data in a particular encoding can
|
||||
* generally be represented as 8-bit characters including ascii.
|
||||
*/
|
||||
GS_EXPORT BOOL GSIsByteEncoding(NSStringEncoding encoding);
|
||||
|
||||
/*
|
||||
* Type to hold either UTF-16 (unichar) or 8-bit encodings,
|
||||
* while satisfying alignment constraints.
|
||||
|
@ -173,10 +163,15 @@ typedef struct {
|
|||
typedef GSStr_t *GSStr;
|
||||
|
||||
/*
|
||||
* Functions to append to GSStr
|
||||
* Function to append to GSStr
|
||||
*/
|
||||
extern void GSStrAppendUnichar(GSStr s, unichar);
|
||||
extern void GSStrAppendUnichars(GSStr s, const unichar *u, unsigned l);
|
||||
/*
|
||||
* Make the content of this string into unicode if it is not in
|
||||
* the external defaults C string encoding.
|
||||
*/
|
||||
void GSStrExternalize(GSStr s);
|
||||
|
||||
|
||||
/*
|
||||
* Enumeration for MacOS-X compatibility user defaults settings.
|
||||
|
@ -192,21 +187,6 @@ typedef enum {
|
|||
GSUserDefaultMaxFlag // End marker.
|
||||
} GSUserDefaultFlagType;
|
||||
|
||||
/*
|
||||
* Get the dictionary representation.
|
||||
*/
|
||||
NSDictionary *GSUserDefaultsDictionaryRepresentation(void);
|
||||
|
||||
/*
|
||||
* Get one of several potentially useful flags.
|
||||
*/
|
||||
BOOL GSUserDefaultsFlag(GSUserDefaultFlagType type);
|
||||
|
||||
/**
|
||||
* Get a flag from an environment variable - return def if not defined.
|
||||
*/
|
||||
BOOL GSEnvironmentFlag(const char *name, BOOL def);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -238,5 +218,68 @@ extern void GSNotifyASAP(void);
|
|||
extern void GSNotifyIdle(void);
|
||||
extern BOOL GSNotifyMore(void);
|
||||
|
||||
/* This class exists to encapsulate various otherwise unrelated functions
|
||||
* so that we expose a single global symbol (the class) whose name marks it
|
||||
* very clearly as for private/internal use only. Avoiding the exposure
|
||||
* (and hence possible accidental use) of symbols for each function ...
|
||||
* The formal implementation of the class is a near empty implementation
|
||||
* (in Additions/GSCategories.h), with most methods being provided by other
|
||||
* categories in the files wishing to expose some functionality for use
|
||||
* by other parts of the base library.
|
||||
*/
|
||||
@interface _GSPrivate : NSObject
|
||||
/* Return the text describing the last system error to have occurred.
|
||||
*/
|
||||
+ (NSString*) error;
|
||||
+ (NSString*) error: (long)number;
|
||||
@end
|
||||
|
||||
@interface _GSPrivate (ProcessInfo)
|
||||
/* Used by NSException uncaught exception handler - must not call any
|
||||
* methods/functions which might cause a recursive exception.
|
||||
*/
|
||||
+ (const char*) argZero;
|
||||
|
||||
/* get a flag from an environment variable - return def if not defined.
|
||||
*/
|
||||
+ (BOOL) environmentFlag: (const char *)name defaultValue: (BOOL)def;
|
||||
@end
|
||||
|
||||
@interface _GSPrivate (Unicode)
|
||||
/* get the available string encodings (nul terminated array)
|
||||
*/
|
||||
+ (NSStringEncoding*) availableEncodings;
|
||||
|
||||
/* get the default C-string encoding.
|
||||
*/
|
||||
+ (NSStringEncoding) defaultCStringEncoding;
|
||||
|
||||
/* get the name of a string encoding as an NSString.
|
||||
*/
|
||||
+ (NSString*) encodingName: (NSStringEncoding)encoding;
|
||||
|
||||
/* determine whether data in a particular encoding can
|
||||
* generally be represented as 8-bit characters including ascii.
|
||||
*/
|
||||
+ (BOOL) isByteEncoding: (NSStringEncoding)encoding;
|
||||
|
||||
/* determine whether encoding is currently supported.
|
||||
*/
|
||||
+ (BOOL) isEncodingSupported: (NSStringEncoding)encoding;
|
||||
|
||||
@end
|
||||
|
||||
@interface _GSPrivate (UserDefaults)
|
||||
/*
|
||||
* Get the dictionary representation.
|
||||
*/
|
||||
+ (NSDictionary*) userDefaultsDictionaryRepresentation;
|
||||
|
||||
/*
|
||||
* Get one of several potentially useful flags.
|
||||
*/
|
||||
+ (BOOL) userDefaultsFlag: (GSUserDefaultFlagType)type;
|
||||
@end
|
||||
|
||||
#endif /* __GSPrivate_h_ */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue