more reduction of externals symbols pollution.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23846 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2006-10-11 05:26:14 +00:00
parent a3c61af23b
commit c927fca12a
7 changed files with 24 additions and 198 deletions

View file

@ -1,3 +1,13 @@
2006-10-11 Richard Frith-Macdonald <rfm@gnu.org>
* Source/externs.m:
* Source/Additions/Unicode.m:
* Source/NSDecimal.m:
* Source/GSFormat.m:
* Testing/tcpport-server.m:
* Testing/exported-strings.m:
Make many globals static, remove some obsolete variables etc.
2006-10-11 Nicola Pero <nicola.pero@meta-innovation.com>
* SSL/Makefile.postamble (after-distclean): Remove all configure

View file

@ -387,43 +387,6 @@ static BOOL isEncodingSupported(NSStringEncoding enc)
return NO;
}
NSStringEncoding *
GetAvailableEncodings()
{
if (_availableEncodings == 0)
{
GSSetupEncodingTable();
[GS_INITIALIZED_LOCK(local_lock, GSLazyLock) lock];
if (_availableEncodings == 0)
{
NSStringEncoding *encodings;
unsigned pos;
unsigned i;
/*
* Now build up a list of supported encodings ... in the
* format needed to support [NSString+availableStringEncodings]
* Check to see what iconv support we have as we go along.
* This is also the place where we determine the name we use
* for iconv to support unicode.
*/
encodings = objc_malloc(sizeof(NSStringEncoding) * (encTableSize+1));
pos = 0;
for (i = 0; i < encTableSize+1; i++)
{
if (isEncodingSupported(i) == YES)
{
encodings[pos++] = i;
}
}
encodings[pos] = 0;
_availableEncodings = encodings;
}
[local_lock unlock];
}
return _availableEncodings;
}
/** Returns the NSStringEncoding that matches the specified
* character set registry and encoding information. For instance,
* for the iso8859-5 character set, the registry is iso8859 and

View file

@ -218,10 +218,10 @@ enum
/* Digits. */
/* Lower-case digits. */
const char _itowa_lower_digits[36]
static const char _itowa_lower_digits[36]
= "0123456789abcdefghijklmnopqrstuvwxyz";
/* Upper-case digits. */
const char _itowa_upper_digits[36]
static const char _itowa_upper_digits[36]
= "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";

View file

@ -237,7 +237,7 @@ GSDecimalCompare(const GSDecimal *leftOperand, const GSDecimal *rightOperand)
static NSComparisonResult
NSSimpleCompare(const NSDecimal *leftOperand, const NSDecimal *rightOperand);
void
static void
GSDecimalRound(GSDecimal *result, int scale, NSRoundingMode mode)
{
int i;
@ -333,7 +333,7 @@ GSDecimalRound(GSDecimal *result, int scale, NSRoundingMode mode)
GSDecimalCompact(result);
}
NSCalculationError
static NSCalculationError
GSDecimalNormalize(GSDecimal *n1, GSDecimal *n2, NSRoundingMode mode)
{
// Both are valid numbers and the exponents are not equal
@ -674,7 +674,7 @@ NSDecimalMultiply(NSDecimal *result, const NSDecimal *l, const NSDecimal *r,
return error;
}
NSCalculationError
static NSCalculationError
GSSimpleDivide(NSDecimal *result, const NSDecimal *l, const NSDecimal *r,
NSRoundingMode mode);
@ -797,7 +797,7 @@ NSDecimalMultiplyByPowerOf10(NSDecimal *result, const NSDecimal *n, short power,
return NSCalculationNoError;
}
NSString*
static NSString*
GSDecimalString(const GSDecimal *number, NSDictionary *locale)
{
int i;
@ -903,7 +903,7 @@ NSDecimalMin(NSDecimal *result)
}
// Give back the value of a NSDecimal as a double
double
static double
GSDecimalDouble(GSDecimal *number)
{
double d = 0.0;
@ -932,7 +932,7 @@ GSDecimalDouble(GSDecimal *number)
// Create a NSDecimal with a cMantissa, exponent and a negative flag
void
static void
GSDecimalFromComponents(GSDecimal *result, unsigned long long mantissa,
short exponent, BOOL negative)
{
@ -964,7 +964,7 @@ GSDecimalFromComponents(GSDecimal *result, unsigned long long mantissa,
}
// Create a NSDecimal from a string using the local
void
static void
GSDecimalFromString(GSDecimal *result, NSString *numberValue,
NSDictionary *locale)
{
@ -1158,7 +1158,7 @@ NSDecimalNormalize(NSDecimal *n1, NSDecimal *n2, NSRoundingMode mode)
*/
}
NSCalculationError
static NSCalculationError
GSSimpleAdd(NSDecimal *result, const NSDecimal *left, const NSDecimal *right,
NSRoundingMode mode)
{
@ -1236,7 +1236,7 @@ GSSimpleMultiply(NSDecimal *result, NSDecimal *left, NSDecimal *right, NSRoundin
return error;
}
NSCalculationError
static NSCalculationError
GSSimpleDivide(NSDecimal *result, const NSDecimal *left, const NSDecimal *right,
NSRoundingMode mode)
{
@ -1536,7 +1536,7 @@ GSSimpleMultiply(NSDecimal *result, NSDecimal *l, NSDecimal *r, NSRoundingMode m
return error;
}
NSCalculationError
static NSCalculationError
GSSimpleDivide(NSDecimal *result, const NSDecimal *l, const NSDecimal *r,
NSRoundingMode mode)
{

View file

@ -18,7 +18,8 @@
You should have received a copy of the GNU Library 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.
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#include "config.h"
@ -72,11 +73,6 @@ NSString *NSThreadWillExitNotification = @"NSThreadWillExitNotification";
/*
* Port Notifications
*/
NSString *PortBecameInvalidNotification = @"PortBecameInvalidNotification";
NSString *InPortClientBecameInvalidNotification = @"InPortClientBecameInvalidNotification";
NSString *InPortAcceptedClientNotification = @"InPortAcceptedClientNotification";
NSString *NSPortDidBecomeInvalidNotification = @"NSPortDidBecomeInvalidNotification";
@ -121,11 +117,6 @@ NSString *NSShowNonLocalizedStrings = @"NSShowNonLocalizedStrings";
NSString *NSLoadedClasses = @"NSLoadedClasses";
/* Stream */
NSString *StreamException = @"StreamException";
/* Standard domains */
NSString *NSArgumentDomain = @"NSArgumentDomain";
@ -258,8 +249,6 @@ 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);
GS_REPLACE_CONSTANT_STRING(NSArgumentDomain);
GS_REPLACE_CONSTANT_STRING(NSBundleDidLoadNotification);
@ -322,8 +311,6 @@ GSBuildStrings()
GS_REPLACE_CONSTANT_STRING(NSWeekDayNameArray);
GS_REPLACE_CONSTANT_STRING(NSWillBecomeMultiThreadedNotification);
GS_REPLACE_CONSTANT_STRING(NSYearMonthWeekDesignations);
GS_REPLACE_CONSTANT_STRING(PortBecameInvalidNotification);
GS_REPLACE_CONSTANT_STRING(StreamException);
}
}

View file

@ -55,9 +55,6 @@ main()
MyAssert1(NSWillBecomeMultiThreadedNotification);
MyAssert1(NSThreadDidStartNotification);
MyAssert1(NSThreadWillExitNotification);
// MyAssert1(PortBecameInvalidNotification);
// MyAssert1(InPortClientBecameInvalidNotification);
// MyAssert1(InPortAcceptedClientNotification);
MyAssert1(NSPortDidBecomeInvalidNotification);
MyAssert1(NSConnectionReplyMode);
MyAssert1(NSBundleDidLoadNotification);
@ -118,9 +115,6 @@ main()
MyAssert2(NSWillBecomeMultiThreadedNotification);
MyAssert2(NSThreadDidStartNotification);
MyAssert2(NSThreadWillExitNotification);
// MyAssert2(PortBecameInvalidNotification);
// MyAssert2(InPortClientBecameInvalidNotification);
// MyAssert2(InPortAcceptedClientNotification);
MyAssert2(NSPortDidBecomeInvalidNotification);
MyAssert2(NSConnectionReplyMode);
MyAssert2(NSBundleDidLoadNotification);

View file

@ -1,128 +0,0 @@
/* Test/example program for the base library
Copyright (C) 2005 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
This file is part of the GNUstep Base Library.
*/
#include <stdio.h>
#include <GNUstepBase/TcpPort.h>
#include <GNUstepBase/Invocation.h>
#include <Foundation/NSNotification.h>
#include <Foundation/NSRunLoop.h>
@interface Dummy: NSObject
+ (id) announce_new_connection: notification;
+ (id) announce_broken_connection: notification;
@end
@implementation Dummy
+ announce_new_connection: notification
{
id in_port = [notification object];
id out_port = [notification userInfo];
NSLog (@"{%@}\n\tconnected to\n\t{%@}\n",
[out_port description], [in_port description]);
NSLog (@"Now servicing %d connection(s).\n",
[in_port numberOfConnectedOutPorts]);
return nil;
}
+ announce_broken_connection: notification
{
id in_port = [notification object];
id out_port = [notification userInfo];
NSLog (@"{%@}\n\tdisconnected from\n\t{%@}\n",
[out_port description], [in_port description]);
NSLog (@"Now servicing %d connection(s).\n",
[in_port numberOfConnectedOutPorts]);
return nil;
}
@end
static id port = nil;
id handle_incoming_packet (TcpInPacket *packet)
{
static unsigned message_count = 0;
id reply_port;
message_count++;
fprintf (stdout, "received >");
fwrite ([packet streamBuffer] + [packet streamBufferPrefix],
[packet streamEofPosition], 1, stdout);
fprintf (stdout, "<\n");
reply_port = [packet replyOutPort];
[packet release];
packet = [[TcpOutPacket alloc] initForSendingWithCapacity: 100
replyInPort: port];
[packet writeFormat: @"Your's was my message number %d",
message_count];
[reply_port sendPacket: packet timeout:10.0];
[packet release];
return nil;
}
int main (int argc, char *argv[])
{
if (argc > 1)
port = [TcpInPort newForReceivingFromRegisteredName:
[NSString stringWithUTF8String: argv[1]]];
else
port = [TcpInPort newForReceivingFromRegisteredName: @"tcpport-test"];
[[NSNotificationCenter defaultCenter]
addObserver: [Dummy class]
selector: @selector(announce_broken_connection:)
name: InPortClientBecameInvalidNotification
object: port];
[[NSNotificationCenter defaultCenter]
addObserver: [Dummy class]
selector: @selector(announce_new_connection:)
name: InPortAcceptedClientNotification
object: port];
printf ("Waiting for connections.\n");
#if 1
[port setReceivedPacketInvocation:
[[[ObjectFunctionInvocation alloc]
initWithObjectFunction: handle_incoming_packet]
autorelease]];
[[NSRunLoop currentRunLoop] addPort: port
forMode: NSDefaultRunLoopMode];
[[NSRunLoop currentRunLoop] run];
#else
{
id packet;
unsigned message_count = 0;
id reply_port;
while ((packet = [port receivePacketWithTimeout: -1]))
{
message_count++;
fprintf (stdout, "received >");
fwrite ([packet streamBuffer] + [packet streamBufferPrefix],
[packet streamEofPosition], 1, stdout);
fprintf (stdout, "<\n");
reply_port = [packet replyPort];
[packet release];
packet = [[TcpPacket alloc] initForSendingWithCapacity: 100
replyPort: port];
[packet writeFormat: @"Your's was my message number %d",
message_count];
[reply_port sendPacket: packet timeout: 20.0];
[packet release];
}
}
#endif
fprintf (stdout, "Timed out. Exiting.\n");
exit (0);
}