more work on hding external symbols and simplifying.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23890 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2006-10-16 09:30:18 +00:00
parent 9a7c19a8df
commit 6f2073da6e
7 changed files with 101 additions and 53 deletions

View file

@ -1,3 +1,14 @@
2006-10-16 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSFFCallInvocation.m:
* Source/GSFFIInvocation.m:
* Source/GSPrivate.h:
* Source/Additions/GNUmakefile:
* Source/Additions/GSPrivate.m:
* Source/Additions/GSCategories.m:
Minor further work simplifying and getting rid of unnecessary
external symbols etc.
2006-10-13 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSFileHandle.m: Look for SSL bundle in any domain.

View file

@ -19,7 +19,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.
#
GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../../base.make
@ -39,6 +40,7 @@ Additions_OBJC_FILES =\
GSMime.m \
GSXML.m \
GSFunctions.m \
GSPrivate.m \
behavior.m
ifneq ($(OBJC_RUNTIME_LIB), gnu)

View file

@ -32,52 +32,6 @@
/* Test for ASCII whitespace which is safe for unicode characters */
#define space(C) ((C) > 127 ? NO : isspace(C))
#ifndef HAVE_STRERROR
const char *
strerror(int eno)
{
extern char *sys_errlist[];
extern int sys_nerr;
if (eno < 0 || eno >= sys_nerr)
{
return("unknown error number");
}
return(sys_errlist[eno]);
}
#endif
@implementation _GSPrivate
+ (NSString*) error
{
#if defined(__MINGW32__)
return [self error: GetLastError()];
#else
extern int errno;
return [self error: errno];
#endif
}
+ (NSString*) error: (long)number
{
NSString *text;
#if defined(__MINGW32__)
LPVOID lpMsgBuf;
FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, nuymber, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPWSTR) &lpMsgBuf, 0, NULL );
text = [NSString stringWithCharacters: lpMsgBuf length: wcslen(lpMsgBuf)];
LocalFree(lpMsgBuf);
#else
text = [NSString stringWithCString: strerror(number)
encoding: [NSString defaultCStringEncoding]];
#endif
return text;
}
@end
@implementation NSArray (GSCategories)
- (unsigned) insertionPosition: (id)item

View file

@ -0,0 +1,80 @@
/* Private internal methods for use within the base library
Copyright (C) 2006 Free Software Foundation, Inc.
Written by: Richard Frith-Macdonald <rfm@gnu.org>
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 Library 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 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.
*/
#include "config.h"
#include <string.h>
#include <Foundation/Foundation.h>
#include "GNUstepBase/GSCategories.h"
#include "GNUstepBase/GSLock.h"
#include "GSPrivate.h"
/* Test for ASCII whitespace which is safe for unicode characters */
#define space(C) ((C) > 127 ? NO : isspace(C))
#ifndef HAVE_STRERROR
const char *
strerror(int eno)
{
extern char *sys_errlist[];
extern int sys_nerr;
if (eno < 0 || eno >= sys_nerr)
{
return("unknown error number");
}
return(sys_errlist[eno]);
}
#endif
@implementation _GSPrivate
+ (NSString*) error
{
#if defined(__MINGW32__)
return [self error: GetLastError()];
#else
extern int errno;
return [self error: errno];
#endif
}
+ (NSString*) error: (long)number
{
NSString *text;
#if defined(__MINGW32__)
LPVOID lpMsgBuf;
FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, nuymber, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPWSTR) &lpMsgBuf, 0, NULL );
text = [NSString stringWithCharacters: lpMsgBuf length: wcslen(lpMsgBuf)];
LocalFree(lpMsgBuf);
#else
text = [NSString stringWithCString: strerror(number)
encoding: [NSString defaultCStringEncoding]];
#endif
return text;
}
@end

View file

@ -141,7 +141,7 @@ static objc_mutex_t ff_callback_map_lock = NULL;
static vacallReturnTypeInfo returnTypeInfo [STATIC_CALLBACK_LIST_SIZE];
/* Function that implements the actual forwarding */
void
static void
GSInvocationCallback(void *callback_data, va_alist args);
/*
@ -771,7 +771,7 @@ gs_protocol_selector(const char *types)
* information.
*/
void
static void
GSInvocationCallback (void *callback_data, va_alist args)
{
id obj;

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 "Foundation/NSException.h"
#include "Foundation/NSCoder.h"
@ -44,7 +45,7 @@ typedef void (*ffi_closure_fun) (ffi_cif*,void*,void**,void*);
typedef void (*f_fun) ();
void GSFFIInvocationCallback(ffi_cif*, void*, void **, void*);
static void GSFFIInvocationCallback(ffi_cif*, void*, void **, void*);
/*
* If we are using the GNU ObjC runtime we could
@ -407,7 +408,7 @@ gs_protocol_selector(const char *types)
return NO;
}
void
static void
GSFFIInvocationCallback(ffi_cif *cif, void *retp, void **args, void *user)
{
id obj;

View file

@ -223,7 +223,7 @@ extern BOOL GSNotifyMore(void);
* very clearly as for private/internal use only. Avoiding the exposure
* (and hence possible accidental use) of symbols for each function ...
* The formal implementation of the class is a near empty implementation
* (in Additions/GSCategories.h), with most methods being provided by other
* (in Additions/GSPrivate.m), with most methods being provided by other
* categories in the files wishing to expose some functionality for use
* by other parts of the base library.
*/