mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +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
3e76492092
commit
d8a2ff7287
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>
|
||||
|
||||
* Source/NSKeyValueObserving.m: add setters for common structures.
|
||||
|
|
|
@ -237,19 +237,25 @@ enum {
|
|||
*/
|
||||
- (BOOL) setLogFile: (NSString*)path;
|
||||
|
||||
/**
|
||||
* Fallback/override method. 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 method to override the effects
|
||||
* of the automatic initialisation, which some applications may need
|
||||
* to do when using GNUstep libraries embedded within other frameworks.
|
||||
/** Obsolete ... the GSInitializeProcess() function has the same effect and
|
||||
* can be called more easily from other languages (particularly C).
|
||||
*/
|
||||
+ (void) initializeWithArguments: (char**)argv
|
||||
count: (int)argc
|
||||
environment: (char**)env;
|
||||
@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 />
|
||||
* This is used by the debugging macros.<br />
|
||||
|
|
|
@ -1362,6 +1362,16 @@ static void determineOperatingSystem()
|
|||
|
||||
@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)
|
||||
|
||||
static BOOL debugTemporarilyDisabled = NO;
|
||||
|
@ -1370,10 +1380,7 @@ static BOOL debugTemporarilyDisabled = NO;
|
|||
count: (int)argc
|
||||
environment: (char**)env
|
||||
{
|
||||
[gnustep_global_lock lock];
|
||||
fallbackInitialisation = YES;
|
||||
_gnu_process_args(argc, argv, env);
|
||||
[gnustep_global_lock unlock];
|
||||
GSInitializeProcess(argc, argv, env);
|
||||
}
|
||||
|
||||
- (BOOL) debugLoggingEnabled
|
||||
|
|
|
@ -1124,7 +1124,7 @@ int main (int argc, char** argv, char** env)
|
|||
CREATE_AUTORELEASE_POOL(pool);
|
||||
|
||||
#ifdef GS_PASS_ARGUMENTS
|
||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||
GSInitializeProcess(argc, argv, env);
|
||||
#endif
|
||||
|
||||
/* Set up the cache. */
|
||||
|
|
|
@ -704,7 +704,7 @@ main(int argc, char **argv, char **env)
|
|||
*/
|
||||
|
||||
#ifdef GS_PASS_ARGUMENTS
|
||||
[NSProcessInfo initializeWithArguments: argv count: argc environment: env];
|
||||
GSInitializeProcess(argc, argv, env);
|
||||
#endif
|
||||
|
||||
#if GS_WITH_GC == 0
|
||||
|
|
|
@ -64,7 +64,7 @@ main(int argc, char** argv, char **env)
|
|||
NSStringEncoding enc = 0;
|
||||
|
||||
#ifdef GS_PASS_ARGUMENTS
|
||||
[NSProcessInfo initializeWithArguments: argv count: argc environment: env];
|
||||
GSInitializeProcess(argc, argv, env);
|
||||
#endif
|
||||
pool = [NSAutoreleasePool new];
|
||||
proc = [NSProcessInfo processInfo];
|
||||
|
|
|
@ -135,7 +135,7 @@ main(int argc, char** argv, char **env)
|
|||
int derror = 0;
|
||||
|
||||
#ifdef GS_PASS_ARGUMENTS
|
||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||
GSInitializeProcess(argc, argv, env);
|
||||
#endif
|
||||
[NSObject enableDoubleReleaseCheck: YES];
|
||||
pool = [NSAutoreleasePool new];
|
||||
|
|
|
@ -1059,7 +1059,7 @@ main(int argc, char** argv, char** env)
|
|||
CREATE_AUTORELEASE_POOL(pool);
|
||||
|
||||
#ifdef GS_PASS_ARGUMENTS
|
||||
[NSProcessInfo initializeWithArguments: argv count: argc environment: env];
|
||||
GSInitializeProcess(argc, argv, env);
|
||||
#endif
|
||||
[NSObject enableDoubleReleaseCheck: YES];
|
||||
pInfo = [NSProcessInfo processInfo];
|
||||
|
|
|
@ -52,7 +52,7 @@ main(int argc, char** argv, char **env)
|
|||
NSArray *args;
|
||||
|
||||
#ifdef GS_PASS_ARGUMENTS
|
||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||
GSInitializeProcess(argc, argv, env);
|
||||
#endif
|
||||
pool = [NSAutoreleasePool new];
|
||||
proc = [NSProcessInfo processInfo];
|
||||
|
|
|
@ -44,7 +44,7 @@ main(int argc, char** argv, char **env)
|
|||
NSString *entry;
|
||||
|
||||
#ifdef GS_PASS_ARGUMENTS
|
||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||
GSInitializeProcess(argc, argv, env);
|
||||
#endif
|
||||
pool = [NSAutoreleasePool new];
|
||||
procinfo = [NSProcessInfo processInfo];
|
||||
|
|
|
@ -43,7 +43,7 @@ main(int argc, char** argv, char **env)
|
|||
unsigned i;
|
||||
|
||||
#ifdef GS_PASS_ARGUMENTS
|
||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||
GSInitializeProcess(argc, argv, env);
|
||||
#endif
|
||||
pool = [NSAutoreleasePool new];
|
||||
proc = [NSProcessInfo processInfo];
|
||||
|
|
|
@ -51,7 +51,7 @@ main(int argc, char** argv, char **env)
|
|||
int count;
|
||||
|
||||
#ifdef GS_PASS_ARGUMENTS
|
||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||
GSInitializeProcess(argc, argv, env);
|
||||
#endif
|
||||
proc = [NSProcessInfo processInfo];
|
||||
if (proc == nil)
|
||||
|
|
|
@ -48,7 +48,7 @@ main(int argc, char** argv, char **env)
|
|||
unsigned i;
|
||||
|
||||
#ifdef GS_PASS_ARGUMENTS
|
||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||
GSInitializeProcess(argc, argv, env);
|
||||
#endif
|
||||
pool = [NSAutoreleasePool new];
|
||||
procinfo = [NSProcessInfo processInfo];
|
||||
|
|
|
@ -80,7 +80,7 @@ main(int argc, char** argv, char **env)
|
|||
int retval = 0;
|
||||
|
||||
#ifdef GS_PASS_ARGUMENTS
|
||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||
GSInitializeProcess(argc, argv, env);
|
||||
#endif
|
||||
pool = [NSAutoreleasePool new];
|
||||
proc = [NSProcessInfo processInfo];
|
||||
|
|
|
@ -43,7 +43,7 @@ main(int argc, char** argv, char **env)
|
|||
unsigned i;
|
||||
|
||||
#ifdef GS_PASS_ARGUMENTS
|
||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||
GSInitializeProcess(argc, argv, env);
|
||||
#endif
|
||||
pool = [NSAutoreleasePool new];
|
||||
proc = [NSProcessInfo processInfo];
|
||||
|
|
|
@ -120,7 +120,7 @@ main(int argc, char** argv, char **env)
|
|||
int retval = 0;
|
||||
|
||||
#ifdef GS_PASS_ARGUMENTS
|
||||
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
|
||||
GSInitializeProcess(argc, argv, env);
|
||||
#endif
|
||||
pool = [NSAutoreleasePool new];
|
||||
proc = [NSProcessInfo processInfo];
|
||||
|
|
|
@ -73,7 +73,7 @@ main(int argc, char **argv, char **env)
|
|||
CREATE_AUTORELEASE_POOL(pool);
|
||||
|
||||
#ifdef GS_PASS_ARGUMENTS
|
||||
[NSProcessInfo initializeWithArguments: argv count: argc environment: env];
|
||||
GSInitializeProcess(argc, argv, env);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_LIBXML
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue