declare constant strings as constant, and move values from source files into externs.m

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20092 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
arobert 2004-09-19 23:19:53 +00:00
parent fabb191ef1
commit 24c11fe90e
13 changed files with 69 additions and 55 deletions

View file

@ -42,7 +42,7 @@
* mapped to an [NSArray] containing the names of each class and category
* loaded (as strings).
*/
GS_EXPORT NSString* NSBundleDidLoadNotification;
GS_EXPORT NSString* const NSBundleDidLoadNotification;
/**
* A user default affecting the behavior of
@ -51,7 +51,7 @@ GS_EXPORT NSString* NSBundleDidLoadNotification;
* equivalent found. This can be useful during development to check where
* a given string in the UI is "coming from".
*/
GS_EXPORT NSString* NSShowNonLocalizedStrings;
GS_EXPORT NSString* const NSShowNonLocalizedStrings;
/**
* When an [NSBundle] loads classes and posts a
@ -59,7 +59,7 @@ GS_EXPORT NSString* NSShowNonLocalizedStrings;
* contains this key, mapped to an [NSArray] containing the names of each
* class and category loaded (as strings).
*/
GS_EXPORT NSString* NSLoadedClasses;
GS_EXPORT NSString* const NSLoadedClasses;
/**
<p>

View file

@ -46,38 +46,38 @@
* Key for dictionary returned by [NSConnection-statistics]: number of
* messages replied to so far by the remote connection.
*/
GS_EXPORT NSString *NSConnectionRepliesReceived;
GS_EXPORT NSString* const NSConnectionRepliesReceived;
/**
* Key for dictionary returned by [NSConnection-statistics]: number of
* messages sent so far to the remote connection.
*/
GS_EXPORT NSString *NSConnectionRepliesSent;
GS_EXPORT NSString* const NSConnectionRepliesSent;
/**
* Key for dictionary returned by [NSConnection-statistics]: number of
* messages received so far from the remote connection.
*/
GS_EXPORT NSString *NSConnectionRequestsReceived;
GS_EXPORT NSString* const NSConnectionRequestsReceived;
/**
* Key for dictionary returned by [NSConnection-statistics]: number of
* messages sent so far to the remote connection.
*/
GS_EXPORT NSString *NSConnectionRequestsSent;
GS_EXPORT NSString* const NSConnectionRequestsSent;
/* These Are GNUstep extras */
/**
* GNUstep-specific key for dictionary returned by [NSConnection-statistics]:
* number of local objects currently in use remotely.
*/
GS_EXPORT NSString *NSConnectionLocalCount; /* Objects sent out */
GS_EXPORT NSString* const NSConnectionLocalCount; /* Objects sent out */
/**
* GNUstep-specific key for dictionary returned by [NSConnection-statistics]:
* number of remote objects currently in use.
*/
GS_EXPORT NSString *NSConnectionProxyCount; /* Objects received */
GS_EXPORT NSString* const NSConnectionProxyCount; /* Objects received */
@ -214,9 +214,6 @@ GS_EXPORT NSString *NSConnectionProxyCount; /* Objects received */
@end
/* PENDING: This is not referenced elsewhere in Base. Is it still needed? */
/** Present for backwards compatibility. Do not use. */
GS_EXPORT NSString *ConnectionBecameInvalidNotification;
@interface Object (NSConnectionDelegate)
/**

View file

@ -55,14 +55,14 @@ typedef enum {
* Type for [NSDistributedNotificationCenter+notificationCenterForType:] -
* localhost broadcast only. This is the only type on OS X.
*/
GS_EXPORT NSString *NSLocalNotificationCenterType;
GS_EXPORT NSString* const NSLocalNotificationCenterType;
#ifndef NO_GNUSTEP
/**
* Type of [NSDistributedNotificationCenter+notificationCenterForType:] -
* localhost and LAN broadcast. This type is available only on GNUstep.
*/
GS_EXPORT NSString *GSNetworkNotificationCenterType;
GS_EXPORT NSString* const GSNetworkNotificationCenterType;
#endif
@interface NSDistributedNotificationCenter : NSNotificationCenter

View file

@ -176,7 +176,7 @@ GS_EXPORT NSString * const NSPortTimeoutException; /* OPENSTEP */
* Notification posted when an instance of [NSPort] or a subclass becomes
* invalid.
*/
GS_EXPORT NSString* NSPortDidBecomeInvalidNotification;
GS_EXPORT NSString* const NSPortDidBecomeInvalidNotification;
#define PortBecameInvalidNotification NSPortDidBecomeInvalidNotification

View file

@ -104,6 +104,6 @@
* subprocess ending or the [NSTask-terminate] method explicitly being
* called.
*/
GS_EXPORT NSString* NSTaskDidTerminateNotification;
GS_EXPORT NSString* const NSTaskDidTerminateNotification;
#endif /* __NSTask_h_GNUSTEP_BASE_INCLUDE */

View file

@ -118,14 +118,14 @@ GS_EXPORT void GSUnregisterCurrentThread (void);
* can assume the application is in single-threaded mode and locks are not
* necessary. Afterwards multiple threads <em>may</em> be running.
*/
GS_EXPORT NSString *NSWillBecomeMultiThreadedNotification;
GS_EXPORT NSString* const NSWillBecomeMultiThreadedNotification;
#define NSBecomingMultiThreaded NSWillBecomeMultiThreadedNotification
/**
* Notification posted when an [NSThread] instance receives an exit message,
* or an external thread has been deregistered.
*/
GS_EXPORT NSString *NSThreadWillExitNotification;
GS_EXPORT NSString* const NSThreadWillExitNotification;
#define NSThreadExiting NSThreadWillExitNotification
#ifndef NO_GNUSTEP
@ -134,7 +134,7 @@ GS_EXPORT NSString *NSThreadWillExitNotification;
* Notification posted whenever a new thread is started up. This is a
* GNUstep extension.
*/
GS_EXPORT NSString *NSThreadDidStartNotification;
GS_EXPORT NSString* const NSThreadDidStartNotification;
/*
* Get current thread and it's dictionary.

View file

@ -33,7 +33,7 @@
/**
* URL scheme constant for use with [NSURL-initWithScheme:host:path:].
*/
GS_EXPORT NSString* NSURLFileScheme;
GS_EXPORT NSString* const NSURLFileScheme;
@interface NSURL: NSObject <NSCoding, NSCopying, NSURLHandleClient>
{

View file

@ -42,37 +42,37 @@ enum {
* group. The undo manager itself is the notification object, with no
* <em>userInfo</em> dictionary.
*/
GS_EXPORT NSString *NSUndoManagerCheckpointNotification;
GS_EXPORT NSString* const NSUndoManagerCheckpointNotification;
/**
* Notification posted after an [NSUndoManager] opens an undo group.
*/
GS_EXPORT NSString *NSUndoManagerDidOpenUndoGroupNotification;
GS_EXPORT NSString* const NSUndoManagerDidOpenUndoGroupNotification;
/**
* Notification posted after an [NSUndoManager] executes a redo operation.
*/
GS_EXPORT NSString *NSUndoManagerDidRedoChangeNotification;
GS_EXPORT NSString* const NSUndoManagerDidRedoChangeNotification;
/**
* Notification posted after an [NSUndoManager] executes an undo operation.
*/
GS_EXPORT NSString *NSUndoManagerDidUndoChangeNotification;
GS_EXPORT NSString* const NSUndoManagerDidUndoChangeNotification;
/**
* Notification posted before an [NSUndoManager] closes an undo group.
*/
GS_EXPORT NSString *NSUndoManagerWillCloseUndoGroupNotification;
GS_EXPORT NSString* const NSUndoManagerWillCloseUndoGroupNotification;
/**
* Notification posted before an [NSUndoManager] will execute a redo operation.
*/
GS_EXPORT NSString *NSUndoManagerWillRedoChangeNotification;
GS_EXPORT NSString* const NSUndoManagerWillRedoChangeNotification;
/**
* Notification posted before an [NSUndoManager] will execute an undo operation.
*/
GS_EXPORT NSString *NSUndoManagerWillUndoChangeNotification;
GS_EXPORT NSString* const NSUndoManagerWillUndoChangeNotification;
@interface NSUndoManager: NSObject
{

View file

@ -42,14 +42,6 @@
#include "../Tools/gdnc.h"
/*
* Global variables for distributed notification center types.
*/
NSString *NSLocalNotificationCenterType =
@"NSLocalNotificationCenterType";
NSString *GSNetworkNotificationCenterType =
@"GSNetworkNotificationCenterType";
@interface NSDistributedNotificationCenter (Private)
- (void) _connect;

View file

@ -100,7 +100,6 @@
#define NOFILE 256
#endif
NSString *NSTaskDidTerminateNotification = @"NSTaskDidTerminateNotification";
static NSRecursiveLock *tasksLock = nil;
static NSMapTable *activeTasks = 0;

View file

@ -51,8 +51,6 @@ function may be incorrect
#include "Foundation/NSValue.h"
#include "Foundation/NSZone.h"
NSString *NSURLFileScheme = @"file";
/*
* Structure describing a URL.
* All the char* fields may be NULL pointers, except path, which

View file

@ -33,22 +33,6 @@
#include "Foundation/NSRunLoop.h"
#include "Foundation/NSUndoManager.h"
/* Public notifications */
NSString *NSUndoManagerCheckpointNotification =
@"NSUndoManagerCheckpointNotification";
NSString *NSUndoManagerDidOpenUndoGroupNotification =
@"NSUndoManagerDidOpenUndoGroupNotification";
NSString *NSUndoManagerDidRedoChangeNotification =
@"NSUndoManagerDidRedoChangeNotification";
NSString *NSUndoManagerDidUndoChangeNotification =
@"NSUndoManagerDidUndoChangeNotification";
NSString *NSUndoManagerWillCloseUndoGroupNotification =
@"NSUndoManagerWillCloseUndoGroupNotification";
NSString *NSUndoManagerWillRedoChangeNotification =
@"NSUndoManagerWillRedoChangeNotification";
NSString *NSUndoManagerWillUndoChangeNotification =
@"NSUndoManagerWillUndoChangeNotification";
/*
* Private class for grouping undo/redo actions.

View file

@ -30,6 +30,14 @@
#include "GSPrivate.h"
/*
PENDING some string constants are scattered about in the class impl
files and should be moved here
furthermore, the test for this in Testing/exported-strings.m
needs to be updated
*/
/* Global lock to be used by classes when operating on any global
data that invoke other methods which also access global; thus,
creating the potential for deadlock. */
@ -44,6 +52,12 @@ NSString *NSConnectionDidDieNotification = @"NSConnectionDidDieNotification";
NSString *NSConnectionDidInitializeNotification = @"NSConnectionDidInitializeNotification";
/*
* NSDistributedNotificationCenter types.
*/
NSString *NSLocalNotificationCenterType = @"NSLocalNotificationCenterType";
NSString *GSNetworkNotificationCenterType = @"GSNetworkNotificationCenterType";
/*
* NSThread Notifications
*/
@ -63,10 +77,29 @@ NSString *InPortClientBecameInvalidNotification = @"InPortClientBecameInvalidNot
NSString *InPortAcceptedClientNotification = @"InPortAcceptedClientNotification";
NSString *NSPortDidBecomeInvalidNotification = @"NSPortDidBecomeInvalidNotification";
/* NSTask notifications */
NSString *NSTaskDidTerminateNotification = @"NSTaskDidTerminateNotification";
/* NSUndoManager notifications */
NSString *NSUndoManagerCheckpointNotification = @"NSUndoManagerCheckpointNotification";
NSString *NSUndoManagerDidOpenUndoGroupNotification = @"NSUndoManagerDidOpenUndoGroupNotification";
NSString *NSUndoManagerDidRedoChangeNotification = @"NSUndoManagerDidRedoChangeNotification";
NSString *NSUndoManagerDidUndoChangeNotification = @"NSUndoManagerDidUndoChangeNotification";
NSString *NSUndoManagerWillCloseUndoGroupNotification = @"NSUndoManagerWillCloseUndoGroupNotification";
NSString *NSUndoManagerWillRedoChangeNotification = @"NSUndoManagerWillRedoChangeNotification";
NSString *NSUndoManagerWillUndoChangeNotification = @"NSUndoManagerWillUndoChangeNotification";
/* NSURL constants */
NSString *NSURLFileScheme = @"file";
/* RunLoop modes */
NSString *NSConnectionReplyMode = @"NSConnectionReplyMode";
@ -221,6 +254,7 @@ GSBuildStrings()
*/
[NSStringClass performSelector: @selector(initialize)];
GS_REPLACE_CONSTANT_STRING(GSNetworkNotificationCenterType);
GS_REPLACE_CONSTANT_STRING(InPortAcceptedClientNotification);
GS_REPLACE_CONSTANT_STRING(InPortClientBecameInvalidNotification);
GS_REPLACE_CONSTANT_STRING(NSAMPMDesignation);
@ -252,6 +286,7 @@ GSBuildStrings()
GS_REPLACE_CONSTANT_STRING(NSLaterTimeDesignations);
GS_REPLACE_CONSTANT_STRING(NSLoadedClasses);
GS_REPLACE_CONSTANT_STRING(NSLocale);
GS_REPLACE_CONSTANT_STRING(NSLocalNotificationCenterType);
GS_REPLACE_CONSTANT_STRING(NSMonthNameArray);
GS_REPLACE_CONSTANT_STRING(NSNegativeCurrencyFormatString);
GS_REPLACE_CONSTANT_STRING(NSNextDayDesignations);
@ -265,12 +300,21 @@ GSBuildStrings()
GS_REPLACE_CONSTANT_STRING(NSShortTimeDateFormatString);
GS_REPLACE_CONSTANT_STRING(NSShortWeekDayNameArray);
GS_REPLACE_CONSTANT_STRING(NSShowNonLocalizedStrings);
GS_REPLACE_CONSTANT_STRING(NSTaskDidTerminateNotification);
GS_REPLACE_CONSTANT_STRING(NSThisDayDesignations);
GS_REPLACE_CONSTANT_STRING(NSThousandsSeparator);
GS_REPLACE_CONSTANT_STRING(NSThreadDidStartNotification);
GS_REPLACE_CONSTANT_STRING(NSThreadWillExitNotification);
GS_REPLACE_CONSTANT_STRING(NSTimeDateFormatString);
GS_REPLACE_CONSTANT_STRING(NSTimeFormatString);
GS_REPLACE_CONSTANT_STRING(NSUndoManagerCheckpointNotification);
GS_REPLACE_CONSTANT_STRING(NSUndoManagerDidOpenUndoGroupNotification);
GS_REPLACE_CONSTANT_STRING(NSUndoManagerDidRedoChangeNotification);
GS_REPLACE_CONSTANT_STRING(NSUndoManagerDidUndoChangeNotification);
GS_REPLACE_CONSTANT_STRING(NSUndoManagerWillCloseUndoGroupNotification);
GS_REPLACE_CONSTANT_STRING(NSUndoManagerWillRedoChangeNotification);
GS_REPLACE_CONSTANT_STRING(NSUndoManagerWillUndoChangeNotification);
GS_REPLACE_CONSTANT_STRING(NSURLFileScheme);
GS_REPLACE_CONSTANT_STRING(NSUserDefaultsDidChangeNotification);
GS_REPLACE_CONSTANT_STRING(NSWeekDayNameArray);
GS_REPLACE_CONSTANT_STRING(NSWillBecomeMultiThreadedNotification);