From 8bc51f33ab734a72217dc0d5930bfb5f3e22df3e Mon Sep 17 00:00:00 2001 From: rfm Date: Sun, 7 Dec 2008 06:02:02 +0000 Subject: [PATCH] Minor cleanup/reorganisation git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27240 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 9 ++++ Headers/Additions/GNUstepBase/GSCategories.h | 11 +---- Headers/Additions/GNUstepBase/NSTask+GS.h | 43 ++++++++++++++++++++ Source/NSDistributedNotificationCenter.m | 2 +- Source/NSSocketPortNameServer.m | 2 +- 5 files changed, 56 insertions(+), 11 deletions(-) create mode 100644 Headers/Additions/GNUstepBase/NSTask+GS.h diff --git a/ChangeLog b/ChangeLog index ac809532c..11ff59d4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-12-07 Richard Frith-Macdonald + + * Headers/Additions/GNUstepBase/NSTask+GS.h: NSTask category + * Headers/Additions/GNUstepBase/GSCategories.h: remove NSTask + * Source/NSDistributedNotificationCenter.m: Use new header + * Source/NSSocketPortNameServer.m: Use new header + Reorganise so we have a lightweight header for the category of + NSTask containing additional gnustep specific methods. + 2008-12-06 Wolfgang Lux * Source/NSBundle.m (+bundleForLibrary:version:): Fix infinite diff --git a/Headers/Additions/GNUstepBase/GSCategories.h b/Headers/Additions/GNUstepBase/GSCategories.h index 674149ad9..465645d23 100644 --- a/Headers/Additions/GNUstepBase/GSCategories.h +++ b/Headers/Additions/GNUstepBase/GSCategories.h @@ -362,21 +362,14 @@ GS_EXPORT NSString *GSDebugFunctionMsg(const char *func, const char *file, #endif /* OS_API_VERSION(GS_API_NONE,GS_API_NONE) */ +#include + #if defined(__cplusplus) } #endif #endif /* GNUSTEP */ -@interface NSTask (GSCategories) -/** Returns the launch path given the name of a tool.
- * Locates the tool by looking in the standard directories, - * and failing that in the PATH set in the environment.
- * Returns the path found, or nil if the tool could not be located. - */ -+ (NSString*) launchPathForTool: (NSString*)name; -@end - #endif /* INCLUDED_GS_CATEGORIES_H */ diff --git a/Headers/Additions/GNUstepBase/NSTask+GS.h b/Headers/Additions/GNUstepBase/NSTask+GS.h new file mode 100644 index 000000000..4fb7613bb --- /dev/null +++ b/Headers/Additions/GNUstepBase/NSTask+GS.h @@ -0,0 +1,43 @@ +/** Declaration of additional methods for NSTask + + Copyright (C) 2008 Free Software Foundation, Inc. + + Written by: Richard Frith-Macdonald + + This file is part of the GNUstep Base Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. + + AutogsdocSource: Additions/GSCategories.m + +*/ + +#ifndef INCLUDED_NSTASK_GS_H +#define INCLUDED_NSTASK_GS_H + +@interface NSTask (GSCategories) +/** Returns the launch path for a tool given the name of a tool.
+ * Locates the tool by looking in the standard directories and, + * if not found there, looking in the PATH set in the environment.
+ * On ms-windows, this also tries appending common executable path + * extensions to the tool name in order to find it.
+ * Returns the path found, or nil if the tool could not be located. + */ ++ (NSString*) launchPathForTool: (NSString*)name; +@end + +#endif /* INCLUDED_NSTASK_GS */ + diff --git a/Source/NSDistributedNotificationCenter.m b/Source/NSDistributedNotificationCenter.m index ee88c9cbd..4ad9c2d6f 100644 --- a/Source/NSDistributedNotificationCenter.m +++ b/Source/NSDistributedNotificationCenter.m @@ -38,13 +38,13 @@ #import "Foundation/NSPathUtilities.h" #import "Foundation/NSRunLoop.h" #import "Foundation/NSTask.h" +#import "GNUstepBase/NSTask+GS.h" #import "Foundation/NSDistributedNotificationCenter.h" #import "Foundation/NSUserDefaults.h" #import "Foundation/NSHost.h" #import "Foundation/NSPortNameServer.h" #import "Foundation/NSDebug.h" #import "Foundation/NSThread.h" -#import "GNUstepBase/GSCategories.h" #import "../Tools/gdnc.h" diff --git a/Source/NSSocketPortNameServer.m b/Source/NSSocketPortNameServer.m index 419c94e7b..f51ddb9bf 100644 --- a/Source/NSSocketPortNameServer.m +++ b/Source/NSSocketPortNameServer.m @@ -41,12 +41,12 @@ #import "Foundation/NSSet.h" #import "Foundation/NSHost.h" #import "Foundation/NSTask.h" +#import "GNUstepBase/NSTask+GS.h" #import "Foundation/NSDate.h" #import "Foundation/NSTimer.h" #import "Foundation/NSPathUtilities.h" #import "Foundation/NSPortNameServer.h" #import "Foundation/NSDebug.h" -#import "GNUstepBase/GSCategories.h" #import "GSPortPrivate.h"