mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
new initialisation function.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28806 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
70af2643ac
commit
febe972488
17 changed files with 60 additions and 25 deletions
22
ChangeLog
22
ChangeLog
|
@ -1,3 +1,25 @@
|
||||||
|
2009-10-12 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSProcessInfo.m:
|
||||||
|
* Headers/Foundation/NSProcessInfo.h:
|
||||||
|
* Tools/gspath.m:
|
||||||
|
* Tools/plmerge.m:
|
||||||
|
* Tools/xmlparse.m:
|
||||||
|
* Tools/sfparse.m:
|
||||||
|
* Tools/plparse.m:
|
||||||
|
* Tools/pldes.m:
|
||||||
|
* Tools/defaults.m:
|
||||||
|
* Tools/plget.m:
|
||||||
|
* Tools/pl2link.m:
|
||||||
|
* Tools/gdnc.m:
|
||||||
|
* Tools/plser.m:
|
||||||
|
* Tools/autogsdoc.m:
|
||||||
|
* Tools/HTMLLinker.m:
|
||||||
|
* Tools/cvtenc.m:
|
||||||
|
Add function for easy process initialisation when the automatic
|
||||||
|
mechanisms don't work (eg calling ObjC code from within a C or C++
|
||||||
|
application).
|
||||||
|
|
||||||
2009-10-11 Eric Wasylishen <ewasylishen@gmail.com>
|
2009-10-11 Eric Wasylishen <ewasylishen@gmail.com>
|
||||||
|
|
||||||
* Source/NSKeyValueObserving.m: add setters for common structures.
|
* Source/NSKeyValueObserving.m: add setters for common structures.
|
||||||
|
|
|
@ -237,19 +237,25 @@ enum {
|
||||||
*/
|
*/
|
||||||
- (BOOL) setLogFile: (NSString*)path;
|
- (BOOL) setLogFile: (NSString*)path;
|
||||||
|
|
||||||
/**
|
/** Obsolete ... the GSInitializeProcess() function has the same effect and
|
||||||
* Fallback/override method. The developer must call this method to initialize
|
* can be called more easily from other languages (particularly C).
|
||||||
* the NSProcessInfo system if none of the system-specific hacks to
|
|
||||||
* auto-initialize it are working.<br />
|
|
||||||
* It is also safe to call this method to override the effects
|
|
||||||
* of the automatic initialisation, which some applications may need
|
|
||||||
* to do when using GNUstep libraries embedded within other frameworks.
|
|
||||||
*/
|
*/
|
||||||
+ (void) initializeWithArguments: (char**)argv
|
+ (void) initializeWithArguments: (char**)argv
|
||||||
count: (int)argc
|
count: (int)argc
|
||||||
environment: (char**)env;
|
environment: (char**)env;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fallback/override function.<br />
|
||||||
|
* The developer must call this method to initialize
|
||||||
|
* the NSProcessInfo system if none of the system-specific hacks to
|
||||||
|
* auto-initialize it are working.<br />
|
||||||
|
* It is also safe to call this function to override the effects
|
||||||
|
* of the automatic initialisation, which some applications may need
|
||||||
|
* to do when using GNUstep libraries embedded within other frameworks.
|
||||||
|
*/
|
||||||
|
GS_EXPORT void GSInitializeProcess(int argc, char **argv, char **envp);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function for rapid testing to see if a debug level is set.<br />
|
* Function for rapid testing to see if a debug level is set.<br />
|
||||||
* This is used by the debugging macros.<br />
|
* This is used by the debugging macros.<br />
|
||||||
|
|
|
@ -1362,6 +1362,16 @@ static void determineOperatingSystem()
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
void
|
||||||
|
GSInitializeProcess(int argc, char **argv, char **envp)
|
||||||
|
{
|
||||||
|
[NSProcessInfo class];
|
||||||
|
[gnustep_global_lock lock];
|
||||||
|
fallbackInitialisation = YES;
|
||||||
|
_gnu_process_args(argc, argv, envp);
|
||||||
|
[gnustep_global_lock unlock];
|
||||||
|
}
|
||||||
|
|
||||||
@implementation NSProcessInfo (GNUstep)
|
@implementation NSProcessInfo (GNUstep)
|
||||||
|
|
||||||
static BOOL debugTemporarilyDisabled = NO;
|
static BOOL debugTemporarilyDisabled = NO;
|
||||||
|
@ -1370,10 +1380,7 @@ static BOOL debugTemporarilyDisabled = NO;
|
||||||
count: (int)argc
|
count: (int)argc
|
||||||
environment: (char**)env
|
environment: (char**)env
|
||||||
{
|
{
|
||||||
[gnustep_global_lock lock];
|
GSInitializeProcess(argc, argv, env);
|
||||||
fallbackInitialisation = YES;
|
|
||||||
_gnu_process_args(argc, argv, env);
|
|
||||||
[gnustep_global_lock unlock];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) debugLoggingEnabled
|
- (BOOL) debugLoggingEnabled
|
||||||
|
|
|
@ -1124,7 +1124,7 @@ int main (int argc, char** argv, char** env)
|
||||||
CREATE_AUTORELEASE_POOL(pool);
|
CREATE_AUTORELEASE_POOL(pool);
|
||||||
|
|
||||||
#ifdef GS_PASS_ARGUMENTS
|
#ifdef GS_PASS_ARGUMENTS
|
||||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
GSInitializeProcess(argc, argv, env);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Set up the cache. */
|
/* Set up the cache. */
|
||||||
|
|
|
@ -704,7 +704,7 @@ main(int argc, char **argv, char **env)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef GS_PASS_ARGUMENTS
|
#ifdef GS_PASS_ARGUMENTS
|
||||||
[NSProcessInfo initializeWithArguments: argv count: argc environment: env];
|
GSInitializeProcess(argc, argv, env);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GS_WITH_GC == 0
|
#if GS_WITH_GC == 0
|
||||||
|
|
|
@ -64,7 +64,7 @@ main(int argc, char** argv, char **env)
|
||||||
NSStringEncoding enc = 0;
|
NSStringEncoding enc = 0;
|
||||||
|
|
||||||
#ifdef GS_PASS_ARGUMENTS
|
#ifdef GS_PASS_ARGUMENTS
|
||||||
[NSProcessInfo initializeWithArguments: argv count: argc environment: env];
|
GSInitializeProcess(argc, argv, env);
|
||||||
#endif
|
#endif
|
||||||
pool = [NSAutoreleasePool new];
|
pool = [NSAutoreleasePool new];
|
||||||
proc = [NSProcessInfo processInfo];
|
proc = [NSProcessInfo processInfo];
|
||||||
|
|
|
@ -135,7 +135,7 @@ main(int argc, char** argv, char **env)
|
||||||
int derror = 0;
|
int derror = 0;
|
||||||
|
|
||||||
#ifdef GS_PASS_ARGUMENTS
|
#ifdef GS_PASS_ARGUMENTS
|
||||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
GSInitializeProcess(argc, argv, env);
|
||||||
#endif
|
#endif
|
||||||
[NSObject enableDoubleReleaseCheck: YES];
|
[NSObject enableDoubleReleaseCheck: YES];
|
||||||
pool = [NSAutoreleasePool new];
|
pool = [NSAutoreleasePool new];
|
||||||
|
|
|
@ -1059,7 +1059,7 @@ main(int argc, char** argv, char** env)
|
||||||
CREATE_AUTORELEASE_POOL(pool);
|
CREATE_AUTORELEASE_POOL(pool);
|
||||||
|
|
||||||
#ifdef GS_PASS_ARGUMENTS
|
#ifdef GS_PASS_ARGUMENTS
|
||||||
[NSProcessInfo initializeWithArguments: argv count: argc environment: env];
|
GSInitializeProcess(argc, argv, env);
|
||||||
#endif
|
#endif
|
||||||
[NSObject enableDoubleReleaseCheck: YES];
|
[NSObject enableDoubleReleaseCheck: YES];
|
||||||
pInfo = [NSProcessInfo processInfo];
|
pInfo = [NSProcessInfo processInfo];
|
||||||
|
|
|
@ -52,7 +52,7 @@ main(int argc, char** argv, char **env)
|
||||||
NSArray *args;
|
NSArray *args;
|
||||||
|
|
||||||
#ifdef GS_PASS_ARGUMENTS
|
#ifdef GS_PASS_ARGUMENTS
|
||||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
GSInitializeProcess(argc, argv, env);
|
||||||
#endif
|
#endif
|
||||||
pool = [NSAutoreleasePool new];
|
pool = [NSAutoreleasePool new];
|
||||||
proc = [NSProcessInfo processInfo];
|
proc = [NSProcessInfo processInfo];
|
||||||
|
|
|
@ -44,7 +44,7 @@ main(int argc, char** argv, char **env)
|
||||||
NSString *entry;
|
NSString *entry;
|
||||||
|
|
||||||
#ifdef GS_PASS_ARGUMENTS
|
#ifdef GS_PASS_ARGUMENTS
|
||||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
GSInitializeProcess(argc, argv, env);
|
||||||
#endif
|
#endif
|
||||||
pool = [NSAutoreleasePool new];
|
pool = [NSAutoreleasePool new];
|
||||||
procinfo = [NSProcessInfo processInfo];
|
procinfo = [NSProcessInfo processInfo];
|
||||||
|
|
|
@ -43,7 +43,7 @@ main(int argc, char** argv, char **env)
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
#ifdef GS_PASS_ARGUMENTS
|
#ifdef GS_PASS_ARGUMENTS
|
||||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
GSInitializeProcess(argc, argv, env);
|
||||||
#endif
|
#endif
|
||||||
pool = [NSAutoreleasePool new];
|
pool = [NSAutoreleasePool new];
|
||||||
proc = [NSProcessInfo processInfo];
|
proc = [NSProcessInfo processInfo];
|
||||||
|
|
|
@ -51,7 +51,7 @@ main(int argc, char** argv, char **env)
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
#ifdef GS_PASS_ARGUMENTS
|
#ifdef GS_PASS_ARGUMENTS
|
||||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
GSInitializeProcess(argc, argv, env);
|
||||||
#endif
|
#endif
|
||||||
proc = [NSProcessInfo processInfo];
|
proc = [NSProcessInfo processInfo];
|
||||||
if (proc == nil)
|
if (proc == nil)
|
||||||
|
|
|
@ -48,7 +48,7 @@ main(int argc, char** argv, char **env)
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
#ifdef GS_PASS_ARGUMENTS
|
#ifdef GS_PASS_ARGUMENTS
|
||||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
GSInitializeProcess(argc, argv, env);
|
||||||
#endif
|
#endif
|
||||||
pool = [NSAutoreleasePool new];
|
pool = [NSAutoreleasePool new];
|
||||||
procinfo = [NSProcessInfo processInfo];
|
procinfo = [NSProcessInfo processInfo];
|
||||||
|
|
|
@ -80,7 +80,7 @@ main(int argc, char** argv, char **env)
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
|
||||||
#ifdef GS_PASS_ARGUMENTS
|
#ifdef GS_PASS_ARGUMENTS
|
||||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
GSInitializeProcess(argc, argv, env);
|
||||||
#endif
|
#endif
|
||||||
pool = [NSAutoreleasePool new];
|
pool = [NSAutoreleasePool new];
|
||||||
proc = [NSProcessInfo processInfo];
|
proc = [NSProcessInfo processInfo];
|
||||||
|
|
|
@ -43,7 +43,7 @@ main(int argc, char** argv, char **env)
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
#ifdef GS_PASS_ARGUMENTS
|
#ifdef GS_PASS_ARGUMENTS
|
||||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
GSInitializeProcess(argc, argv, env);
|
||||||
#endif
|
#endif
|
||||||
pool = [NSAutoreleasePool new];
|
pool = [NSAutoreleasePool new];
|
||||||
proc = [NSProcessInfo processInfo];
|
proc = [NSProcessInfo processInfo];
|
||||||
|
|
|
@ -120,7 +120,7 @@ main(int argc, char** argv, char **env)
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
|
||||||
#ifdef GS_PASS_ARGUMENTS
|
#ifdef GS_PASS_ARGUMENTS
|
||||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
GSInitializeProcess(argc, argv, env);
|
||||||
#endif
|
#endif
|
||||||
pool = [NSAutoreleasePool new];
|
pool = [NSAutoreleasePool new];
|
||||||
proc = [NSProcessInfo processInfo];
|
proc = [NSProcessInfo processInfo];
|
||||||
|
|
|
@ -73,7 +73,7 @@ main(int argc, char **argv, char **env)
|
||||||
CREATE_AUTORELEASE_POOL(pool);
|
CREATE_AUTORELEASE_POOL(pool);
|
||||||
|
|
||||||
#ifdef GS_PASS_ARGUMENTS
|
#ifdef GS_PASS_ARGUMENTS
|
||||||
[NSProcessInfo initializeWithArguments: argv count: argc environment: env];
|
GSInitializeProcess(argc, argv, env);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_LIBXML
|
#ifndef HAVE_LIBXML
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue