From 06ffe54b115addbb1bda4085780cc5d86b45f91c Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Fri, 9 Mar 2012 09:22:09 +0000 Subject: [PATCH] mkae method names more consistent git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/devmodules/dev-libs/ec@34911 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 0 Command.m | 2 +- Console.m | 2 +- Control.m | 2 +- EcConsole.m | 2 +- EcControl.m | 4 +-- EcProcess.h | 16 +++++------ EcProcess.m | 80 ++++++++++++++++++++++++++--------------------------- 8 files changed, 54 insertions(+), 54 deletions(-) create mode 100644 ChangeLog diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/Command.m b/Command.m index de43df4..4acc051 100644 --- a/Command.m +++ b/Command.m @@ -58,7 +58,7 @@ inner_main() exit(1); } - [EcProc prcRun]; + [EcProc ecRun]; [arp release]; diff --git a/Console.m b/Console.m index f32200d..4ffdfd2 100644 --- a/Console.m +++ b/Console.m @@ -50,7 +50,7 @@ inner_main() [arp release]; arp = [NSAutoreleasePool new]; - [EcProc prcRun]; + [EcProc ecRun]; } [arp release]; exit(0); diff --git a/Control.m b/Control.m index f4ac6dc..d058bf4 100644 --- a/Control.m +++ b/Control.m @@ -56,7 +56,7 @@ inner_main() exit(1); } - [EcProc prcRun]; + [EcProc ecRun]; [arp release]; exit(0); diff --git a/EcConsole.m b/EcConsole.m index 78200f9..1552fe4 100644 --- a/EcConsole.m +++ b/EcConsole.m @@ -729,7 +729,7 @@ static BOOL commandIsRepeat (NSString *string) return self; } -- (int) prcRun +- (int) ecRun { NSRunLoop *loop; diff --git a/EcControl.m b/EcControl.m index 73b9923..cdded7e 100644 --- a/EcControl.m +++ b/EcControl.m @@ -1725,7 +1725,7 @@ static NSString* cmdWord(NSArray* a, unsigned int pos) return self; } -- (int) prcRun +- (int) ecRun { int result; @@ -1733,7 +1733,7 @@ static NSString* cmdWord(NSArray* a, unsigned int pos) */ sink = [[EcAlarmSinkSNMP alarmSinkSNMP] retain]; - result = [super prcRun]; + result = [super ecRun]; [sink shutdown]; DESTROY(sink); diff --git a/EcProcess.h b/EcProcess.h index 4fc19e0..63050d8 100644 --- a/EcProcess.h +++ b/EcProcess.h @@ -325,7 +325,7 @@ extern NSString* cmdVersion(NSString *ver); /** Return a short copyright notice ... subclasses should override. */ -- (NSString*) prcCopyright; +- (NSString*) ecCopyright; /* Call these methods during initialisation of your instance * to set up automatic management of connections to servers. @@ -639,40 +639,40 @@ extern NSString* cmdVersion(NSString *ver); /** Records the timestamp of the latest significant input for this process. * If when is nil the current timestmp is used. */ -- (void) prcHadIP: (NSDate*)when; +- (void) ecHadIP: (NSDate*)when; /** Records the timestamp of the latest significant output for this process. * If when is nil the current timestmp is used. */ -- (void) prcHadOP: (NSDate*)when; +- (void) ecHadOP: (NSDate*)when; /** Called on the first timeout of a new day.
* The argument 'when' is the timestamp of the timeout. */ -- (void) prcNewDay: (NSCalendarDate*)when; +- (void) ecNewDay: (NSCalendarDate*)when; /** Called on the first timeout of a new hour.
* The argument 'when' is the timestamp of the timeout. */ -- (void) prcNewHour: (NSCalendarDate*)when; +- (void) ecNewHour: (NSCalendarDate*)when; /** Called on the first timeout of a new minute.
* The argument 'when' is the timestamp of the timeout. */ -- (void) prcNewMinute: (NSCalendarDate*)when; +- (void) ecNewMinute: (NSCalendarDate*)when; /** Return heap memory known not to be leaked ... for use in internal * monitoring of memory usage. You should override this ti add in any * heap store you have used and know is not leaked. */ -- (NSUInteger) prcNotLeaked; +- (NSUInteger) ecNotLeaked; /** Establishes the receiver as a DO server and runs the runloop.
* Returns zero when the run loop completes.
* Returns one (immediately) if the receiver is transent.
* Returns two if unable to register as a DO server. */ -- (int) prcRun; +- (int) ecRun; @end diff --git a/EcProcess.m b/EcProcess.m index 5e22e06..9bd8f99 100644 --- a/EcProcess.m +++ b/EcProcess.m @@ -100,7 +100,7 @@ /* Lock for controlling access to per-process singleton instance. */ -static NSRecursiveLock *prcLock = nil; +static NSRecursiveLock *ecLock = nil; static BOOL cmdFlagDaemon = NO; static BOOL cmdFlagTesting = NO; @@ -475,7 +475,7 @@ findAction(NSString *cmd) } static NSString* -prcCommandHost() +ecCommandHost() { NSString *host; @@ -488,7 +488,7 @@ prcCommandHost() } static NSString* -prcCommandName() +ecCommandName() { NSString *name; @@ -1317,16 +1317,16 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); } } -- (NSString*) prcCopyright +- (NSString*) ecCopyright { return @""; } + (void) initialize { - if (nil == prcLock) + if (nil == ecLock) { - prcLock = [NSRecursiveLock new]; + ecLock = [NSRecursiveLock new]; dateClass = [NSDate class]; cDateClass = [NSCalendarDate class]; stringClass = [NSString class]; @@ -1649,8 +1649,8 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); NS_DURING { - host = prcCommandHost(); - name = prcCommandName(); + host = ecCommandHost(); + name = ecCommandName(); proxy = [NSConnection rootProxyForConnectionWithRegisteredName: name @@ -1767,7 +1767,7 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); va_end (ap); } -- (void) prcNewDay: (NSCalendarDate*)when +- (void) ecNewDay: (NSCalendarDate*)when { NSString *sub; @@ -1779,12 +1779,12 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); NSLog(@"%@", [self cmdArchive: sub]); } -- (void) prcNewHour: (NSCalendarDate*)when +- (void) ecNewHour: (NSCalendarDate*)when { return; } -- (void) prcNewMinute: (NSCalendarDate*)when +- (void) ecNewMinute: (NSCalendarDate*)when { struct mallinfo info; @@ -1795,7 +1795,7 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); NSUInteger notLeaked; int i; - notLeaked = [self prcNotLeaked]; + notLeaked = [self ecNotLeaked]; /* Next slot to record in will be zero. */ @@ -1876,7 +1876,7 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); return; } -- (void) prcHadIP: (NSDate*)when +- (void) ecHadIP: (NSDate*)when { if (when == nil) { @@ -1885,7 +1885,7 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); ASSIGN(lastIP, when); } -- (void) prcHadOP: (NSDate*)when +- (void) ecHadOP: (NSDate*)when { if (when == nil) { @@ -1894,12 +1894,12 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); ASSIGN(lastOP, when); } -- (NSUInteger) prcNotLeaked +- (NSUInteger) ecNotLeaked { return 0; } -- (int) prcRun +- (int) ecRun { NSConnection *c; @@ -2782,13 +2782,13 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver: self]; - [prcLock lock]; + [ecLock lock]; if (self == EcProc) { EcProc = nil; cmdIsInitialised = NO; } - [prcLock unlock]; + [ecLock unlock]; [super dealloc]; } @@ -2821,17 +2821,17 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); - (id) initWithDefaults: (NSDictionary*) defs { - [prcLock lock]; + [ecLock lock]; if (nil != EcProc) { [self release]; - [prcLock unlock]; + [ecLock unlock]; [NSException raise: NSGenericException format: @"EcProcess initialiser called more than once"]; } if (nil == (self = [super init])) { - [prcLock unlock]; + [ecLock unlock]; return nil; } else @@ -2882,15 +2882,15 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); prf, prf, prf, prf, prf, prf, prf, prf, prf, prf ); RELEASE(self); - [prcLock unlock]; + [ecLock unlock]; return nil; } if ([[pinfo arguments] containsObject: @"--version"]) { - NSLog(@"%@ %@", [self prcCopyright], cmdVersion(nil)); + NSLog(@"%@ %@", [self ecCopyright], cmdVersion(nil)); RELEASE(self); - [prcLock unlock]; + [ecLock unlock]; return nil; } @@ -2925,14 +2925,14 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); { if (0 != setuid(uid)) { - [prcLock unlock]; + [ecLock unlock]; NSLog(@"You must be '%@' to run this.", cmdUser); exit(1); } } else { - [prcLock unlock]; + [ecLock unlock]; NSLog(@"You must be '%@' to run this.", cmdUser); exit(1); } @@ -2940,7 +2940,7 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); GSSetUserName(cmdUser); if (NO == [cmdUser isEqualToString: NSUserName()]) { - [prcLock unlock]; + [ecLock unlock]; NSLog(@"You must be '%@' to run this.", cmdUser); exit(1); } @@ -3072,7 +3072,7 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); { if ([mgr fileExistsAtPath: str isDirectory: &flag] == NO) { - [prcLock unlock]; + [ecLock unlock]; NSLog(@"Unable to create directory - %@", str); exit(1); } @@ -3084,7 +3084,7 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); } if (flag == NO) { - [prcLock unlock]; + [ecLock unlock]; NSLog(@"The path '%@' is not a directory", str); exit(1); } @@ -3165,7 +3165,7 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); { if ([mgr fileExistsAtPath: str isDirectory: &flag] == NO) { - [prcLock unlock]; + [ecLock unlock]; NSLog(@"Unable to create directory - %@", str); exit(1); } @@ -3177,14 +3177,14 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); } if (flag == NO) { - [prcLock unlock]; + [ecLock unlock]; NSLog(@"The path '%@' is not a directory", str); exit(1); } if ([mgr changeCurrentDirectoryPath: str] == NO) { - [prcLock unlock]; + [ecLock unlock]; NSLog(@"Unable to move to directory - %@", str); exit(1); } @@ -3194,7 +3194,7 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); */ if ([self cmdDataDirectory] == nil) { - [prcLock unlock]; + [ecLock unlock]; NSLog(@"Unable to create/access data directory"); exit(1); } @@ -3204,7 +3204,7 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); */ if (cmdLogsDir(nil) == nil) { - [prcLock unlock]; + [ecLock unlock]; NSLog(@"Unable to create/access logs directory"); exit(1); } @@ -3235,7 +3235,7 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); hdl = [self cmdLogFile: cmdDebugName]; if (hdl == nil) { - [prcLock unlock]; + [ecLock unlock]; exit(1); } } @@ -3272,12 +3272,12 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); if (YES == [self cmdIsClient] && nil == [self cmdNewServer]) { NSLog(@"Giving up - unable to contact '%@' server on '%@'", - prcCommandName(), prcCommandHost()); + ecCommandName(), ecCommandHost()); [self release]; self = nil; } } - [prcLock unlock]; + [ecLock unlock]; /* * Finally, put self in background. @@ -3651,15 +3651,15 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval); } if (YES == newMinute) { - [self prcNewMinute: now]; + [self ecNewMinute: now]; } if (YES == newHour) { - [self prcNewHour: now]; + [self ecNewHour: now]; } if (YES == newDay) { - [self prcNewDay: now]; + [self ecNewDay: now]; } if (cmdTimSelector != 0) {