mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
Add global Foundation header file.
Fix some missed memory allocation function usage. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2682 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e0e21e1aa0
commit
5c9a97f30d
15 changed files with 134 additions and 24 deletions
27
ChangeLog
27
ChangeLog
|
@ -1,3 +1,30 @@
|
||||||
|
Sat Jan 3 14:05:32 1998 Scott Christley <scottc@net-community.com>
|
||||||
|
|
||||||
|
* confdefs.h: Delete transient file.
|
||||||
|
|
||||||
|
* src/include/Foundation.h: New file.
|
||||||
|
* src/include/NSEnumerator.h: New file.
|
||||||
|
* src/GNUmakefile: Install new header files.
|
||||||
|
* src/include/NSUtilities.h: Move NSEnumerator interface
|
||||||
|
to NSEnumerator.h file.
|
||||||
|
|
||||||
|
* src/NSObject.m (-copyWithZone:): Eliminate semicolon.
|
||||||
|
|
||||||
|
* Fix memory allocation function usage. (As reported by
|
||||||
|
Matthias Klose <Matthias.Klose@cs.tu-berlin.de>).
|
||||||
|
* src/Connection.m (-_service_forwardForProxy:): Use
|
||||||
|
function instead of function pointer.
|
||||||
|
* src/Decoder.m (-decodeClass, -decodeSelectorWithName:): Likewise.
|
||||||
|
* src/Invocation.m (-initWithReturnType:): Likewise.
|
||||||
|
(-_initArgframeFrom:withType:retainArgs:): Likewise.
|
||||||
|
(-_deallocArgFrame): Likewise.
|
||||||
|
* src/NSAutoreleasePool.m (-reallyDealloc): Likewise.
|
||||||
|
* src/NSConnection.m (-_service_forwardForProxy:): Likewise.
|
||||||
|
* src/TextCStream.m (-decodeValueOfCType:at:withName:): Likewise.
|
||||||
|
* src/include/objc-gnu2next.h (list_cons): Likewise.
|
||||||
|
(list_remove_head, list_free): Likewise.
|
||||||
|
* src/include/preface.h.in (OBJC_FREE): Likewise.
|
||||||
|
|
||||||
Fri Jan 2 13:04:53 1998 Adam Fedor <fedor@doc.com>
|
Fri Jan 2 13:04:53 1998 Adam Fedor <fedor@doc.com>
|
||||||
|
|
||||||
* doc/Makefile.postamble: Generate html,texi from tmpl.texi files.
|
* doc/Makefile.postamble: Generate html,texi from tmpl.texi files.
|
||||||
|
|
48
Headers/gnustep/base/Foundation.h
Normal file
48
Headers/gnustep/base/Foundation.h
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
/*
|
||||||
|
Global include file for the GNUstep Base Library.
|
||||||
|
|
||||||
|
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Scott Christley <scottc@net-community.com>
|
||||||
|
Date: Sep 1997
|
||||||
|
|
||||||
|
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __Foundation_h_GNUSTEP_BASE_INCLUDE
|
||||||
|
#define __Foundation_h_GNUSTEP_BASE_INCLUDE
|
||||||
|
|
||||||
|
#include <Foundation/NSObject.h>
|
||||||
|
#include <Foundation/NSArchiver.h>
|
||||||
|
#include <Foundation/NSArray.h>
|
||||||
|
#include <Foundation/NSAutoreleasePool.h>
|
||||||
|
#include <Foundation/NSException.h>
|
||||||
|
#include <Foundation/NSBundle.h>
|
||||||
|
#include <Foundation/NSDate.h>
|
||||||
|
#include <Foundation/NSData.h>
|
||||||
|
#include <Foundation/NSDictionary.h>
|
||||||
|
#include <Foundation/NSCharacterSet.h>
|
||||||
|
#include <Foundation/NSCoder.h>
|
||||||
|
#include <Foundation/NSLock.h>
|
||||||
|
#include <Foundation/NSFileManager.h>
|
||||||
|
#include <Foundation/NSValue.h>
|
||||||
|
#include <Foundation/NSNotification.h>
|
||||||
|
#include <Foundation/NSPortCoder.h>
|
||||||
|
#include <Foundation/NSProcessInfo.h>
|
||||||
|
#include <Foundation/NSUserDefaults.h>
|
||||||
|
|
||||||
|
#endif /* __Foundation_h_GNUSTEP_BASE_INCLUDE */
|
35
Headers/gnustep/base/NSEnumerator.h
Normal file
35
Headers/gnustep/base/NSEnumerator.h
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
NSEnumerator.h
|
||||||
|
|
||||||
|
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Author: Scott Christley <scottc@net-community.com>
|
||||||
|
Date: January 1998
|
||||||
|
|
||||||
|
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NSEnumerator_h_GNUSTEP_BASE_INCLUDE
|
||||||
|
#define __NSEnumerator_h_GNUSTEP_BASE_INCLUDE
|
||||||
|
|
||||||
|
#include <Foundation/NSObject.h>
|
||||||
|
|
||||||
|
@interface NSEnumerator : NSObject
|
||||||
|
- (id) nextObject;
|
||||||
|
@end
|
||||||
|
|
||||||
|
#endif /* __NSEnumerator_h_GNUSTEP_BASE_INCLUDE */
|
|
@ -24,10 +24,9 @@
|
||||||
#ifndef __NSUtilties_h_GNUSTEP_BASE_INCLUDE
|
#ifndef __NSUtilties_h_GNUSTEP_BASE_INCLUDE
|
||||||
#define __NSUtilties_h_GNUSTEP_BASE_INCLUDE
|
#define __NSUtilties_h_GNUSTEP_BASE_INCLUDE
|
||||||
|
|
||||||
#include <Foundation/NSObject.h>
|
#include <Foundation/NSObjCRuntime.h>
|
||||||
|
#include <Foundation/NSString.h>
|
||||||
@interface NSEnumerator : NSObject
|
#include <Foundation/NSDictionary.h>
|
||||||
- (id) nextObject;
|
#include <Foundation/NSEnumerator.h>
|
||||||
@end
|
|
||||||
|
|
||||||
#endif /* __NSUtilties_h_GNUSTEP_BASE_INCLUDE */
|
#endif /* __NSUtilties_h_GNUSTEP_BASE_INCLUDE */
|
||||||
|
|
|
@ -164,7 +164,7 @@ list_cons(void* head, struct objc_list* tail)
|
||||||
{
|
{
|
||||||
struct objc_list* cell;
|
struct objc_list* cell;
|
||||||
|
|
||||||
cell = (struct objc_list*)(*objc_malloc)(sizeof(struct objc_list));
|
cell = (struct objc_list*)objc_malloc(sizeof(struct objc_list));
|
||||||
cell->head = head;
|
cell->head = head;
|
||||||
cell->tail = tail;
|
cell->tail = tail;
|
||||||
return cell;
|
return cell;
|
||||||
|
@ -209,11 +209,11 @@ list_remove_head(struct objc_list** list)
|
||||||
{
|
{
|
||||||
struct objc_list* tail = (*list)->tail; /* fetch next */
|
struct objc_list* tail = (*list)->tail; /* fetch next */
|
||||||
*(*list) = *tail;/* copy next to list head */
|
*(*list) = *tail;/* copy next to list head */
|
||||||
(*objc_free)(tail);/* free next */
|
objc_free(tail);/* free next */
|
||||||
}
|
}
|
||||||
else/* only one element in list */
|
else/* only one element in list */
|
||||||
{
|
{
|
||||||
(*objc_free)(*list);
|
objc_free(*list);
|
||||||
(*list) = 0;
|
(*list) = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -265,7 +265,7 @@ list_free(struct objc_list* list)
|
||||||
if(list)
|
if(list)
|
||||||
{
|
{
|
||||||
list_free(list->tail);
|
list_free(list->tail);
|
||||||
(*objc_free)(list);
|
objc_free(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ extern const char o_NeXT_cc_version[];
|
||||||
((VAR) = (TYPE *) objc_realloc ((VAR), (unsigned)(NUM)*sizeof(TYPE)))
|
((VAR) = (TYPE *) objc_realloc ((VAR), (unsigned)(NUM)*sizeof(TYPE)))
|
||||||
#define OBJC_CALLOC(VAR, TYPE, NUM) \
|
#define OBJC_CALLOC(VAR, TYPE, NUM) \
|
||||||
((VAR) = (TYPE *) objc_calloc ((unsigned)(NUM), sizeof(TYPE)))
|
((VAR) = (TYPE *) objc_calloc ((unsigned)(NUM), sizeof(TYPE)))
|
||||||
#define OBJC_FREE(PTR) (*objc_free)((PTR))
|
#define OBJC_FREE(PTR) objc_free (PTR)
|
||||||
|
|
||||||
#ifndef MAX
|
#ifndef MAX
|
||||||
#define MAX(a,b) \
|
#define MAX(a,b) \
|
||||||
|
|
|
@ -763,7 +763,7 @@ static int messages_received_count;
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
|
|
||||||
if (forward_type)
|
if (forward_type)
|
||||||
(*objc_free) (forward_type);
|
objc_free (forward_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (Proxy*) rootProxy
|
- (Proxy*) rootProxy
|
||||||
|
|
|
@ -413,7 +413,7 @@ static id dummyObject;
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Decoder decoding registered class xref %u\n", xref);
|
"Decoder decoding registered class xref %u\n", xref);
|
||||||
}
|
}
|
||||||
(*objc_free) (class_name);
|
objc_free (class_name);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -496,8 +496,8 @@ static id dummyObject;
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Decoder decoding registered sel xref %u\n", xref);
|
"Decoder decoding registered sel xref %u\n", xref);
|
||||||
}
|
}
|
||||||
(*objc_free)(sel_name);
|
objc_free(sel_name);
|
||||||
(*objc_free)(sel_types);
|
objc_free(sel_types);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -382,6 +382,7 @@ NSCallBacks.h \
|
||||||
tzfile.h
|
tzfile.h
|
||||||
|
|
||||||
BASE_HEADERS = \
|
BASE_HEADERS = \
|
||||||
|
Foundation/Foundation.h \
|
||||||
Foundation/byte_order.h \
|
Foundation/byte_order.h \
|
||||||
Foundation/DistributedObjects.h \
|
Foundation/DistributedObjects.h \
|
||||||
Foundation/NSArchiver.h \
|
Foundation/NSArchiver.h \
|
||||||
|
@ -401,6 +402,7 @@ Foundation/NSDebug.h \
|
||||||
Foundation/NSDictionary.h \
|
Foundation/NSDictionary.h \
|
||||||
Foundation/NSDistantObject.h \
|
Foundation/NSDistantObject.h \
|
||||||
Foundation/NSDistributedLock.h \
|
Foundation/NSDistributedLock.h \
|
||||||
|
Foundation/NSEnumerator.h \
|
||||||
Foundation/NSException.h \
|
Foundation/NSException.h \
|
||||||
Foundation/NSFileHandle.h \
|
Foundation/NSFileHandle.h \
|
||||||
Foundation/NSFileManager.h \
|
Foundation/NSFileManager.h \
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
{
|
{
|
||||||
/* Work around bug in objc_sizeof_type; it doesn't handle void type */
|
/* Work around bug in objc_sizeof_type; it doesn't handle void type */
|
||||||
return_size = objc_sizeof_type (enc);
|
return_size = objc_sizeof_type (enc);
|
||||||
return_value = (*objc_calloc) (1, return_size);
|
return_value = objc_calloc (1, return_size);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -329,9 +329,9 @@ my_method_get_next_argument (arglist_t argframe,
|
||||||
/* allocate the argframe */
|
/* allocate the argframe */
|
||||||
stack_argsize = types_get_size_of_stack_arguments (type);
|
stack_argsize = types_get_size_of_stack_arguments (type);
|
||||||
reg_argsize = types_get_size_of_register_arguments(type);
|
reg_argsize = types_get_size_of_register_arguments(type);
|
||||||
argframe = (arglist_t) (*objc_calloc) (1 ,sizeof(char*) + reg_argsize);
|
argframe = (arglist_t) objc_calloc (1 ,sizeof(char*) + reg_argsize);
|
||||||
if (stack_argsize)
|
if (stack_argsize)
|
||||||
argframe->arg_ptr = (*objc_calloc) (1, stack_argsize);
|
argframe->arg_ptr = objc_calloc (1, stack_argsize);
|
||||||
else
|
else
|
||||||
argframe->arg_ptr = 0;
|
argframe->arg_ptr = 0;
|
||||||
|
|
||||||
|
@ -461,8 +461,8 @@ my_method_get_next_argument (arglist_t argframe,
|
||||||
if (argframe)
|
if (argframe)
|
||||||
{
|
{
|
||||||
if (argframe->arg_ptr)
|
if (argframe->arg_ptr)
|
||||||
(*objc_free) (argframe->arg_ptr);
|
objc_free (argframe->arg_ptr);
|
||||||
(*objc_free) (argframe);
|
objc_free (argframe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -343,7 +343,7 @@ pop_pool_from_cache (struct autorelease_thread_vars *tv)
|
||||||
for (a = _released_head; a; )
|
for (a = _released_head; a; )
|
||||||
{
|
{
|
||||||
void *n = a->next;
|
void *n = a->next;
|
||||||
(*objc_free) (a);
|
objc_free (a);
|
||||||
a = n;
|
a = n;
|
||||||
}
|
}
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
|
|
|
@ -1247,7 +1247,7 @@ static int messages_received_count;
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
|
|
||||||
if (forward_type)
|
if (forward_type)
|
||||||
(*objc_free) (forward_type);
|
objc_free (forward_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) _service_rootObject: rmc
|
- (void) _service_rootObject: rmc
|
||||||
|
|
|
@ -149,7 +149,7 @@ extraRefCount (id anObject)
|
||||||
return [[self alloc] init];
|
return [[self alloc] init];
|
||||||
}
|
}
|
||||||
|
|
||||||
- copyWithZone:(NSZone *)zone;
|
- copyWithZone:(NSZone *)zone
|
||||||
{
|
{
|
||||||
return NSCopyObject (self, 0, zone);
|
return NSCopyObject (self, 0, zone);
|
||||||
}
|
}
|
||||||
|
|
|
@ -332,7 +332,7 @@ if (debug_textcoder) \
|
||||||
freeWhenDone: YES]
|
freeWhenDone: YES]
|
||||||
autorelease];
|
autorelease];
|
||||||
else
|
else
|
||||||
(*objc_free) (tmpname);
|
objc_free (tmpname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue