diff --git a/Source/objects/Archiver.h b/Source/objects/Archiver.h deleted file mode 100644 index de1506116..000000000 --- a/Source/objects/Archiver.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Interface for GNU Objective-C Archiver object for use serializing - Copyright (C) 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: January 1996 - - This file is part of the GNU Objective C Class 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 __Archiver_h_OBJECTS_INCLUDE -#define __Archiver_h_OBJECTS_INCLUDE - -#include -#include - -/* Eventually some functionality may be moved out of Coder and - into these objects. - - These class should be used as concrete classes, not the Coder class. */ - - -@interface Archiver : Encoder -@end - -@interface Unarchiver : Decoder -@end - -#endif /* __Archiver_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/Array.h b/Source/objects/Array.h deleted file mode 100644 index 53f01148d..000000000 --- a/Source/objects/Array.h +++ /dev/null @@ -1,73 +0,0 @@ -/* Interface for Objective-C Array collection object - Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __Array_h_INCLUDE_GNU -#define __Array_h_INCLUDE_GNU - -#include -#include -#include - -@interface ConstantArray : ConstantIndexedCollection -{ - @public - id *_contents_array; - unsigned int _count; -} -@end - -@interface Array : ConstantArray -{ - @public - unsigned int _capacity; - int _grow_factor; -} - -+ (unsigned) defaultCapacity; -+ (int) defaultGrowFactor; - -- initWithCapacity: (unsigned) aCapacity; - -- (void) setCapacity: (unsigned)newCapacity; -- (int) growFactor; -- (void) setGrowFactor: (int)aNum; - -@end - -/* Put this on category instead of class to avoid bogus complaint from gcc */ -@interface Array (Ordering) -@end - -#define FOR_ARRAY(ARRAY, ELEMENT_VAR) \ -{ \ - unsigned _FOR_ARRAY_i; \ - for (_FOR_ARRAY_i = 0; \ - _FOR_ARRAY_i < ((Array*)ARRAY)->_count; \ - _FOR_ARRAY_i++) \ - { \ - ELEMENT_VAR = \ - (((Array*)ARRAY)->_contents_array[_FOR_ARRAY_i]); - -#define END_FOR_ARRAY(ARRAY) }} - -#endif /* __Array_h_INCLUDE_GNU */ diff --git a/Source/objects/ArrayPrivate.h b/Source/objects/ArrayPrivate.h deleted file mode 100644 index 40f75cf71..000000000 --- a/Source/objects/ArrayPrivate.h +++ /dev/null @@ -1,88 +0,0 @@ -/* Array definitions for the use of subclass implementations only - Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __ArrayPrivate_h_INCLUDE_GNU -#define __ArrayPrivate_h_INCLUDE_GNU - -#include -#include - -#define DEFAULT_ARRAY_CAPACITY 2 -#define DEFAULT_ARRAY_GROW_FACTOR 2 - - -/* Routines that help with inserting and removing elements */ - -/* Assumes that _count has already been incremented to make room - for the hole. The data at _contents_array[_count-1] is not part - of the collection). */ -static inline void -makeHoleAt(Array *self, unsigned index) -{ - int i; - - for (i = (self->_count)-1; i > index; i--) - self->_contents_array[i] = self->_contents_array[i-1]; -} - -/* Assumes that _count has not yet been decremented. The data at - _contents_array[_count-1] is part of the collection. */ -static inline void -fillHoleAt(Array *self, unsigned index) -{ - int i; - - for (i = index; i < (self->_count)-1; i++) - self->_contents_array[i] = self->_contents_array[i+1]; -} - -/* These are the only two routines that change the value of the instance - variable _count, except for "-initWithType:capacity:" and "-empty" */ - -/* Should these be methods instead of functions? Doing so would make - them slower. */ - -/* Do this before adding an element */ -static inline void -incrementCount(Array *self) -{ - (self->_count)++; - if (self->_count == self->_capacity) - { - [self setCapacity:(self->_capacity) * ABS(self->_grow_factor)]; - } -} - -/* Do this after removing an element */ -static inline void -decrementCount(Array *self) -{ - (self->_count)--; - if (self->_grow_factor > 0 - && self->_count < (self->_capacity / self->_grow_factor)) - { - [self setCapacity:(self->_capacity) / self->_grow_factor]; - } -} - -#endif /* __ArrayPrivate_h_INCLUDE_GNU */ diff --git a/Source/objects/AutoreleasePool.h b/Source/objects/AutoreleasePool.h deleted file mode 100644 index b1d78d0b5..000000000 --- a/Source/objects/AutoreleasePool.h +++ /dev/null @@ -1,53 +0,0 @@ -/* Interface for relase pools for delayed disposal - Copyright (C) 1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __AutoreleasePool_m_OBJECTS_INCLUDE -#define __AutoreleasePool_m_OBJECTS_INCLUDE - -#include -#include - -@interface AutoreleasePool : Object -{ - AutoreleasePool *parent; - unsigned released_count; - unsigned released_size; - id *released; -} - -+ currentPool; -+ (void) autoreleaseObject: anObj; -- (void) autoreleaseObject: anObj; - -- init; - -@end - -@interface Object (Retaining) -@end - -void objc_retain_object (id anObj); -void objc_release_object (id anObj); -unsigned objc_retain_count (id anObj); - -#endif /* __AutoreleasePool_m_OBJECTS_INCLUDE */ diff --git a/Source/objects/AutoreleaseStack.h b/Source/objects/AutoreleaseStack.h deleted file mode 100644 index db5aae229..000000000 --- a/Source/objects/AutoreleaseStack.h +++ /dev/null @@ -1,122 +0,0 @@ -/* Interface to release stack for delayed disposal - Copyright (C) 1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __AutoreleaseStack_m_OBJECTS_INCLUDE -#define __AutoreleaseStack_m_OBJECTS_INCLUDE - -#include -#include - -@interface AutoreleaseStack : Object -{ -} - -+ (void) autoreleaseObject: anObj; -- (void) autoreleaseObject: anObj; - -- init; - -@end - -void objc_release_stack_objects(); - -/* - Use of this autorelease class gives -autorelease the following semantics: - - - autorelease; - - Use this message when the sender is done with this object, but the - sender doesn't want the object to be deallocated immediately - because the function that sends this message will use this object - as its return value. The object will be queued to receive the - actual "release" message only after the caller's caller returns. - (Well, not "queued", "stacked" actually.) - - Due to this delayed release, the function that receives the object - as a return value will have the opportunity to retain the object - before the "release" instigated by the "autorelease" actually - takes place. - - IMPORTANT PROGRAMMING CONVENTION: Since a autoreleased object may - be freed in the caller's caller's frame, a function must be careful - when returning an object that has been been autoreleased to it - (i.e. returning the object to the autorelease caller's caller's - caller). Since you cannot always know which objects returned to - the current function have been autoreleased by their returners, - you must use the following rule to insure safety for these - situations: - - When returning an object that has been allocated, copied or - retained by the returner, return the object as usual. If - returning an object that has been received in this function by - another function, always retain and autorelease the object - before returning it. (Unless, of course, the returner still - needs to keep a reference to the object, in which case the final - autorelease should be omitted.) - - The autorelease mechanism works as follows: The implementation of - the "autorelease" method pushes the receiver and the caller's - caller's frame address onto an internally maintained stack. But, - before pushing the reciever, the implementation checks the entries - already on the stack, popping elements off the stack until the - recorded frame address is less than the caller's caller's frame - address. Each object popped off the stack is sent a "release" - message. The stack capacity grows automatically if necessary. - - This mechanism ensures that not too many autoreleased objects can - be stacked before we check to see what objects can be released - (i.e. no objects). It also ensures that objects which have been - autoreleased are released as soon as we autorelease any other - object in a lower stack frame. - - The only way to build up an unnecessarily large collection of - autoreleased objects is by calling functions that autorelease an - object, and by repeatedly calling those functions from functions - with equal or increasingly higher frame addresses. - - Any time that you suspect that you may be creating an unnecessarily - large number of autoreleased objects in a function, (e.g. the - function contains a loop that creates many autoreleased objects - that the function doesn't need), you can always release all the - releasable autoreleased objects for this frame by calling - objc_release_stack_objects(). Be warned that calling this function - will release all objects that have been autoreleased to this - function; if you still need to use some of them, you will have to - retain them beforehand, and release or autorelease them - afterwards. - - If desired, you can also use objc_release_stack_objects() at the - top of an event loop, a guaranteed "catch-all" coding practise - similar to the creation and destruction of AutoreleasePool objects - in the event loop. - - As an alternative to calling objc_release_stack_objects() you can - also use the same scheme for forcing autorelease's as used for - AutoreleasePool's: s = [[AutoreleaseStack alloc] init], ... code - that autoreleases a bunch of objects to the same stack level ..., - [s release]. It has the same effect. - -*/ - - -#endif /* __AutoreleaseStack_m_OBJECTS_INCLUDE */ diff --git a/Source/objects/Bag.h b/Source/objects/Bag.h deleted file mode 100644 index 03142030f..000000000 --- a/Source/objects/Bag.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Interface for Objective-C Bag collection object - Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: May 1993 - - This file is part of the GNU Objective C Class 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 __Bag_h_INCLUDE_GNU -#define __Bag_h_INCLUDE_GNU - -#include -#include -#include - -@interface Bag : Collection -{ - NSMapTable *_contents_map; - unsigned int _count; // the number of elements; -} - -// INITIALIZING AND FREEING; -- initWithCapacity: (unsigned)aCapacity; - -// ADDING; -- (void) addObject: newObject withOccurrences: (unsigned)count; - -// REMOVING AND REPLACING; -- (void) removeObject: oldObject occurrences: (unsigned)count; - -// TESTING; -- (unsigned) uniqueCount; - -@end - -#endif /* __Bag_h_INCLUDE_GNU */ diff --git a/Source/objects/BinaryCStream.h b/Source/objects/BinaryCStream.h deleted file mode 100644 index 6114005d8..000000000 --- a/Source/objects/BinaryCStream.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Interface for GNU Objective-C binary stream object for use serializing - Copyright (C) 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Written: Jan 1996 - - This file is part of the GNU Objective C Class 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 __BinaryCStream_h_OBJECTS_INCLUDE -#define __BinaryCStream_h_OBJECTS_INCLUDE - -#include -#include -#include - -@interface BinaryCStream : CStream - -+ setDebugging: (BOOL)f; - -@end - -#endif /* __BinaryCStream_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/BinaryTree.h b/Source/objects/BinaryTree.h deleted file mode 100644 index 168be9fed..000000000 --- a/Source/objects/BinaryTree.h +++ /dev/null @@ -1,77 +0,0 @@ -/* Interface for Objective-C BinaryTree collection object - Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: May 1993 - - This file is part of the GNU Objective C Class 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. -*/ - -/* - Binary Tree. - Base class for smarter binary trees. -*/ - -#ifndef __BinaryTree_h_INCLUDE_GNU -#define __BinaryTree_h_INCLUDE_GNU - -#include -#include - -/* The protocol defines the interface to an object - that may be an element in a BinaryTree. -*/ -@protocol BinaryTreeComprising -- leftNode; -- rightNode; -- parentNode; -- (void) setLeftNode: (id )aNode; -- (void) setRightNode: (id )aNode; -- (void) setParentNode: (id )aNode; -- binaryTree; -- (void) setBinaryTree: anObject; -@end - -#define NODE_IS_RIGHTCHILD(NODE) (NODE == [[NODE parentNode] rightNode]) -#define NODE_IS_LEFTCHILD(NODE) (NODE == [[NODE parentNode] leftNode]) - -@interface BinaryTree : IndexedCollection -{ - unsigned int _count; - id _contents_root; -} - -- nilNode; -- rootNode; - -- leftmostNodeFromNode: aNode; -- rightmostNodeFromNode: aNode; - -- (unsigned) depthOfNode: aNode; -- (unsigned) heightOfNode: aNode; - -- (unsigned) nodeCountUnderNode: aNode; - -- leftRotateAroundNode: aNode; -- rightRotateAroundNode: aNode; - -- binaryTreePrintForDebugger; - -@end - - -#endif /* __BinaryTree_h_INCLUDE_GNU */ diff --git a/Source/objects/BinaryTreeEltNode.h b/Source/objects/BinaryTreeEltNode.h deleted file mode 100644 index b7912a1e5..000000000 --- a/Source/objects/BinaryTreeEltNode.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Interface for Objective-C BinaryTreeEltNode object - Copyright (C) 1993,1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __BinaryTreeEltNode_h_INCLUDE_GNU -#define __BinaryTreeEltNode_h_INCLUDE_GNU - -#include -#include -#include - -@interface BinaryTreeEltNode : BinaryTreeNode -#include -@end - - -#endif /* __BinaryTreeEltNode_h_INCLUDE_GNU */ diff --git a/Source/objects/BinaryTreeNode.h b/Source/objects/BinaryTreeNode.h deleted file mode 100644 index a04708fee..000000000 --- a/Source/objects/BinaryTreeNode.h +++ /dev/null @@ -1,41 +0,0 @@ -/* Interface for Objective-C BinaryTreeNode object - Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: May 1993 - - This file is part of the GNU Objective C Class 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 __BinaryTreeNode_h_INCLUDE_GNU -#define __BinaryTreeNode_h_INCLUDE_GNU - -#include -#include -#include - -@interface BinaryTreeNode : NSObject -{ - id _left; - id _right; - id _parent; - id _binary_tree; -} -@end - - -#endif /* __BinaryTreeNode_h_INCLUDE_GNU */ diff --git a/Source/objects/CStream.h b/Source/objects/CStream.h deleted file mode 100644 index aca06ada2..000000000 --- a/Source/objects/CStream.h +++ /dev/null @@ -1,59 +0,0 @@ -/* Interface for GNU Objective-C stream object for use in archiving - Copyright (C) 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Written: Jan 1996 - - This file is part of the GNU Objective C Class 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 __CStream_h_OBJECTS_INCLUDE -#define __CStream_h_OBJECTS_INCLUDE - -#include -#include -#include - -@interface CStream : Stream -{ - Stream *stream; - int format_version; - int indentation; -} - -/* These are the standard ways to create a new CStream from a Stream - that is open for reading. - It reads the CStream signature at the beginning of the file, and - automatically creates the appropriate subclass of CStream with - the correct format version. */ -+ cStreamReadingFromFile: (id ) filename; -+ cStreamReadingFromStream: (id ) stream; - -/* These are standard ways to create a new CStream with a Stream - that is open for writing. */ -- initForWritingToFile: (id ) filename; -- initForWritingToStream: (id ) stream; - -- initForWritingToStream: (id ) s - withFormatVersion: (int)version; - -+ cStreamWritingToStream: (id ) stream; -+ cStreamWritingToFile: (id ) filename; - -@end - -#endif /* __CStream_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/CStreaming.h b/Source/objects/CStreaming.h deleted file mode 100644 index a97b7c0c8..000000000 --- a/Source/objects/CStreaming.h +++ /dev/null @@ -1,60 +0,0 @@ -/* Protocol for GNU Objective C byte streams that can code C types and indentn - Copyright (C) 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: April 1995 - - This file is part of the GNU Objective C Class 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 __CStreaming_h__OBJECTS_INCLUDE -#define __CStreaming_h__OBJECTS_INCLUDE - -#include -#include - -@protocol CStreaming - -- (void) encodeValueOfCType: (const char*) type - at: (const void*) d - withName: (id ) name; -- (void) decodeValueOfCType: (const char*) type - at: (void*) d - withName: (id *) namePtr; - -- (void) encodeWithName: (id ) name - valuesOfCTypes: (const char *) types, ...; -- (void) decodeWithName: (id *)name - valuesOfCTypes: (const char *)types, ...; - -- (void) encodeName: (id ) name; -- (void) decodeName: (id *) name; - -- (void) encodeIndent; -- (void) decodeIndent; - -- (void) encodeUnindent; -- (void) decodeUnindent; - -- (id ) stream; - -+ (int) defaultFormatVersion; - -@end - -#endif /* __CStreaming_h__OBJECTS_INCLUDE */ - diff --git a/Source/objects/CircularArray.h b/Source/objects/CircularArray.h deleted file mode 100644 index b4b138b84..000000000 --- a/Source/objects/CircularArray.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Interface for Objective-C CircularArray collection object - Copyright (C) 1993,1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __CircularArray_h_INCLUDE_GNU -#define __CircularArray_h_INCLUDE_GNU - -#include -#include - -@interface CircularArray : Array -{ - @public - unsigned int _start_index; -} - -@end - -#endif /* __CircularArray_h_INCLUDE_GNU */ diff --git a/Source/objects/CircularArrayPrivate.h b/Source/objects/CircularArrayPrivate.h deleted file mode 100644 index 67f0e5580..000000000 --- a/Source/objects/CircularArrayPrivate.h +++ /dev/null @@ -1,75 +0,0 @@ -/* CircularArray definitions for the use of subclass implementations - Copyright (C) 1993,1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __CircularArrayPrivate_h_INCLUDE_GNU -#define __CircularArrayPrivate_h_INCLUDE_GNU - -#include -#include - -#define CIRCULAR_TO_BASIC(INDEX) \ - ((INDEX + self->_start_index) % self->_capacity) - -#define BASIC_TO_CIRCULAR(INDEX) \ - ((INDEX + self->_capacity - self->_start_index) % self->_capacity) - -#define NEXT_CIRCULAR_INDEX(INDEX) \ - ((INDEX + 1) % self->_capacity) - -#define PREV_CIRCULAR_INDEX(INDEX) \ - ((INDEX + self->_capacity - 1) % self->_capacity) - -static inline void -circularMakeHoleAt(CircularArray *self, unsigned basicIndex) -{ - int i; - if (self->_start_index && basicIndex > self->_start_index) - { - for (i = self->_start_index; i < basicIndex; i++) - self->_contents_array[i-1] = self->_contents_array[i]; - } - else - { - for (i = CIRCULAR_TO_BASIC(self->_count-1); i >= basicIndex; i--) - self->_contents_array[i+1] = self->_contents_array[i]; - } - /* This is never called with _count == 0 */ -} - -static inline void -circularFillHoleAt(CircularArray *self, unsigned basicIndex) -{ - int i; - if (basicIndex > self->_start_index) - { - for (i = basicIndex; i > self->_start_index; i--) - self->_contents_array[i] = self->_contents_array[i-1]; - } - else - { - for (i = basicIndex; i < CIRCULAR_TO_BASIC(self->_count-1); i++) - self->_contents_array[i] = self->_contents_array[i+1]; - } -} - -#endif /* __CircularArrayPrivate_h_INCLUDE_GNU */ diff --git a/Source/objects/Coder.h b/Source/objects/Coder.h deleted file mode 100644 index 2bccd46cf..000000000 --- a/Source/objects/Coder.h +++ /dev/null @@ -1,148 +0,0 @@ -/* Interface for GNU Objective-C coder object for use serializing - Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: July 1994 - - This file is part of the GNU Objective C Class 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 __Coder_h_OBJECTS_INCLUDE -#define __Coder_h_OBJECTS_INCLUDE - -#include -#include -#include -#include -#include -#include - -@class CStream; - - -/* The root abstract class for archiving */ - -@interface Coder : NSObject -{ - int format_version; - CStream *cstream; - NSMapTable *classname_2_classname; /* for changing class names on r/w */ - int interconnect_stack_height; /* number of nested root objects */ -} - -+ setDebugging: (BOOL)f; - -@end - - -/* An abstract class for writing an archive */ - -@interface Encoder : Coder -{ - /* xxx in_progress_table should actually be an NSHashTable, - but we are working around a bug right now. */ - NSMapTable *in_progress_table; /* objects begun writing, but !finished */ - NSMapTable *object_2_xref; /* objects already written */ - NSMapTable *object_2_fref; /* table of forward references */ - NSMapTable *const_ptr_2_xref; /* const pointers already written */ - unsigned fref_counter; /* Keep track of unused fref numbers */ -} - -- initForWritingToFile: (id ) filename; -- initForWritingToFile: (id ) filename - withCStreamClass: (Class) cStreamClass; -- initForWritingToFile: (id ) filename - withFormatVersion: (int) version - cStreamClass: (Class)scc - cStreamFormatVersion: (int) cStreamFormatVersion; - -- initForWritingToStream: (id ) s; -- initForWritingToStream: (id ) s - withCStreamClass: (Class) cStreamClass; -- initForWritingToStream: (id ) s - withFormatVersion: (int) version - cStreamClass: (Class) cStreamClass - cStreamFormatVersion: (int) cStreamFormatVersion; - -+ (BOOL) encodeRootObject: anObject - withName: (id ) name - toFile: (id ) filename; -+ (BOOL) encodeRootObject: anObject - withName: (id ) name - toStream: (id )stream; - -/* Defaults */ -+ (void) setDefaultStreamClass: sc; -+ defaultStreamClass; -+ (void) setDefaultCStreamClass: sc; -+ defaultCStreamClass; -+ (void) setDefaultFormatVersion: (int)fv; -+ (int) defaultFormatVersion; - -@end - -@interface Encoder (Encoding) -@end - - - -/* An abstract class for reading an archive. */ - -@interface Decoder : Coder -{ - NSZone *zone; /* zone in which to create objects */ - id xref_2_object; /* objects already read */ - id xref_2_object_root; /* objs read since last -startDecodoingI.. */ - NSMapTable *xref_2_const_ptr; /* const pointers already written */ - NSMapTable *fref_2_object; /* table of forward references */ - NSMapTable *address_2_fref; /* table of forward references */ -} - -/* These are class methods (and not instance methods) because the - header of the file or stream determines which subclass of Decoder - is created. */ - -+ newReadingFromFile: (id ) filename; -+ newReadingFromStream: (id )stream; - -+ decodeObjectWithName: (id *) name - fromFile: (id ) filename; -+ decodeObjectWithName: (id *) name - fromStream: (id )stream; - -@end - -@interface Decoder (Decoding) -@end - - -/* Extensions to NSObject for encoding and decoding. */ - -@interface NSObject (OptionalNewWithCoder) -+ newWithCoder: (Coder*)aDecoder; -@end - -@interface NSObject (CoderAdditions) -/* not needed because of NSCoding */ -/* These methods here temporarily until ObjC runtime category bug fixed */ -- classForConnectedCoder:aRmc; -+ (void) encodeObject: anObject withConnectedCoder: aRmc; -@end - -extern id CoderSignatureMalformedException; - -#endif /* __Coder_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/CoderPrivate.h b/Source/objects/CoderPrivate.h deleted file mode 100644 index 19ffc0014..000000000 --- a/Source/objects/CoderPrivate.h +++ /dev/null @@ -1,67 +0,0 @@ -/* Private interface for GNU Objective-C coder object for use serializing - Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: February 1996 - - This file is part of the GNU Objective C Class 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 __CoderPrivate_h_OBJECTS_INCLUDE -#define __CoderPrivate_h_OBJECTS_INCLUDE - -#include -#include -#include - -enum { - CODER_OBJECT_NIL = 0, - CODER_OBJECT, - CODER_OBJECT_ROOT, - CODER_OBJECT_REPEATED, - CODER_OBJECT_FORWARD_REFERENCE, - CODER_OBJECT_CLASS, - CODER_CLASS_NIL, - CODER_CLASS, - CODER_CLASS_REPEATED, - CODER_CONST_PTR_NULL, - CODER_CONST_PTR, - CODER_CONST_PTR_REPEATED -}; - -#define DOING_ROOT_OBJECT (interconnect_stack_height != 0) - -@interface Coder (Private) -- _initWithCStream: (id ) cs formatVersion: (int) version; -- (unsigned) _coderReferenceForObject: anObject; -@end - -#define SIGNATURE_FORMAT_STRING \ -@"GNU Objective C (%s %d.%d.%d) [%s %d]\n" - -#define WRITE_SIGNATURE_FORMAT_ARGS \ -STRINGIFY(OBJECTS_PACKAGE_NAME), \ -OBJECTS_MAJOR_VERSION, \ -OBJECTS_MINOR_VERSION, \ -OBJECTS_SUBMINOR_VERSION, \ -[self defaultDecoderClassname], \ -format_version - - -#define NO_SEL_TYPES "none" - -#endif /* __CoderPrivate_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/Coding.h b/Source/objects/Coding.h deleted file mode 100644 index 686e768ad..000000000 --- a/Source/objects/Coding.h +++ /dev/null @@ -1,163 +0,0 @@ -/* Protocol for GNU Objective-C objects that can write/read to a coder - Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: July 1994 - - This file is part of the GNU Objective C Class 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 __Coding_h_OBJECTS_INCLUDE -#define __Coding_h_OBJECTS_INCLUDE - -#include - -/* #include - xxx Think about trying to get back in types, - but now there is a circular dependancy in the include files. */ - -@protocol CommonCoding -- (BOOL) isDecoding; -- (void) close; -- (BOOL) isClosed; -+ (int) defaultFormatVersion; -- cStream; -@end - -@protocol Encoding - -- (void) encodeValueOfObjCType: (const char*)type - at: (const void*)d - withName: (id /**/)name; - -- (void) encodeValueOfCType: (const char*)type - at: (const void*)d - withName: (id /**/)name; - -- (void) encodeWithName: (id /**/)name - valuesOfObjCTypes: (const char *)types, ...; - -- (void) encodeArrayOfObjCType: (const char *)type - count: (unsigned)c - at: (const void *)d - withName: (id /**/)name; - -- (void) encodeObject: anObj - withName: (id /**/)name; -- (void) encodeBycopyObject: anObj - withName: (id /**/)name; - -- (void) encodeRootObject: anObj - withName: (id /**/)name; -- (void) encodeObjectReference: anObj - withName: (id /**/)name; -- (void) startEncodingInterconnectedObjects; -- (void) finishEncodingInterconnectedObjects; - -- (void) encodeAtomicString: (const char*)sp - withName: (id /**/)name; - -- (void) encodeClass: aClass; - -/* For inserting a name into a TextCoder stream */ -- (void) encodeName: (id /**/) n; - -/* For classes that want to keep track of recursion */ -- (void) encodeIndent; -- (void) encodeUnindent; - -- (void) encodeBytes: (const void *)b - count: (unsigned)c - withName: (id /**/)name; - -@end - -@protocol Decoding - -- (void) decodeValueOfObjCType: (const char*)type - at: (void*)d - withName: (id /**/ *) namePtr; - -- (void) decodeValueOfCType: (const char*)type - at: (void*)d - withName: (id /**/ *) namePtr; - -- (void) decodeWithName: (id /**/*)name - valuesOfObjCTypes: (const char *) types, ...; - -- (void) decodeArrayOfObjCType: (const char *)type - count: (unsigned)c - at: (void *)d - withName: (id /**/*)name; - -- (void) decodeObjectAt: (id*)anObjPtr - withName: (id /**/*)name; - -- (void) startDecodingInterconnectedObjects; -- (void) finishDecodingInterconnectedObjects; - -- (const char *) decodeAtomicStringWithName: (id /**/*) name; - -- decodeClass; - -/* For inserting a name into a TextCoder stream */ -- (void) decodeName: (id /**/ *)n; - -/* For classes that want to keep track of recursion */ -- (void) decodeIndent; -- (void) decodeUnindent; - -- (void) decodeBytes: (void *)b - count: (unsigned)c - withName: (id /**/ *) name; - -@end - -@interface NSObject (SelfCoding) - -- (void) encodeWithCoder: (id )anEncoder; -- (id) initWithCoder: (id )aDecoder; -+ (id) newWithCoder: (id )aDecoder; - -/* NOTE: - - If the class responds to +newWithCoder Coder will send it for - decoding, otherwise Coder will allocate the object itself and send - initWithCoder instead. - - +newWithCoder is useful because many classes keep track of their - instances and only allow one instance of each configuration. For - example, see the designated initializers of SocketPort, Connection, - and Proxy. - - Using +new.. instead of -init.. prevents us from having to waste - the effort of allocating space for an object to be decoded, then - immediately deallocating that space because we're just returning a - pre-existing object. - - The newWithCoder and initWithCoder methods must return the decoded - object. - - This is not a Protocol, because objects are not required to - implement newWithCoder or initWithCoder. They probably want to - implement one of them, though. - - -mccallum */ - -@end - -#endif /* __Coding_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/Collecting.h b/Source/objects/Collecting.h deleted file mode 100644 index e361d5824..000000000 --- a/Source/objects/Collecting.h +++ /dev/null @@ -1,131 +0,0 @@ -/* Protocol for Objective-C objects that hold collections of elements. - Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: May 1993 - - This file is part of the GNU Objective C Class 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. -*/ - -/* The protocol is root of the collection protocol heirarchy. - - The protocol defines the most general interface to a - collection of elements. Elements can be added, removed, and replaced. - The contents can be tested, enumerated, and enumerated through various - filters. Elements may be objects, or any C type included in the - "elt" union given in elt.h, but all elements of a collection must be of - the same C type. -*/ - -#ifndef __Collecting_h_INCLUDE_GNU -#define __Collecting_h_INCLUDE_GNU - -#include -#include -#include -#include - -@protocol ConstantCollecting - -// INITIALIZING; -- init; -- initWithObjects: (id*)objc count: (unsigned)c; -- initWithObjects: firstObject, ...; -- initWithObjects: firstObject rest: (va_list)ap; -- initWithContentsOf: (id )aCollection; - -// QUERYING COUNTS; -- (BOOL) isEmpty; -- (unsigned) count; -- (BOOL) containsObject: anObject; -- (unsigned) occurrencesOfObject: anObject; - -// COMPARISON WITH OTHER COLLECTIONS; -- (BOOL) isSubsetOf: (id )aCollection; -- (BOOL) isDisjointFrom: (id )aCollection; -- (BOOL) isEqual: anObject; -- (int) compare: anObject; -- (BOOL) contentsEqual: (id )aCollection; - -// PROPERTIES OF CONTENTS; -- (BOOL) trueForAllObjectsByInvoking: (id )anInvocation; -- (BOOL) trueForAnyObjectsByInvoking: (id )anInvocation; -- detectObjectByInvoking: (id )anInvocation; -- maxObject; -- minObject; - -// ENUMERATING -- (id ) objectEnumerator; -- (void) withObjectsInvoke: (id )anInvocation; -- (void) withObjectsInvoke: (id )anInvocation whileTrue:(BOOL *)flag; -- (void) makeObjectsPerform: (SEL)aSel; -- (void) makeObjectsPerform: (SEL)aSel withObject: argObject; - -// FILTERED ENUMERATING; -- (void) withObjectsTrueByInvoking: (id )testInvocation - invoke: (id )anInvocation; -- (void) withObjectsFalseByInvoking: (id )testInvocation - invoke: (id )anInvocation; -- (void) withObjectsTransformedByInvoking: (id )transInvocation - invoke: (id )anInvocation; - -// LOW-LEVEL ENUMERATING; -- (void*) newEnumState; -- nextObjectWithEnumState: (void**)enumState; -- (void) freeEnumState: (void**)enumState; - -// COPYING; -- allocCopy; -- emptyCopy; -- emptyCopyAs: (Class)aCollectionClass; -- shallowCopy; -- shallowCopyAs: (Class)aCollectionClass; -- copy; -- copyAs: (Class)aCollectionClass; -- species; - -@end - - -@protocol Collecting - -// ADDING; -- (void) addObject: newObject; -- (void) addObjectIfAbsent: newObject; -- (void) addContentsOf: (id )aCollection; -- (void) addContentsIfAbsentOf: (id )aCollection; -- (void) addWithObjects: (id*)objc count: (unsigned)c; -- (void) addObjects: firstObject, ...; -- (void) addObjects: firstObject rest: (va_list)ap; - -// REMOVING; -- (void) removeObject: oldObject; -- (void) removeAllOccurrencesOfObject: oldObject; -- (void) removeContentsIn: (id )aCollection; -- (void) removeContentsNotIn: (id )aCollection; -- (void) uniqueContents; -- (void) empty; - -// REPLACING; -- (void) replaceObject: oldObject withObject: newObject; -- (void) replaceAllOccurrencesOfObject: oldObject withObject: newObject; - -@end - -#define NO_OBJECT nil - -#endif /* __Collecting_h_INCLUDE_GNU */ diff --git a/Source/objects/Collection.h b/Source/objects/Collection.h deleted file mode 100644 index 774041c39..000000000 --- a/Source/objects/Collection.h +++ /dev/null @@ -1,103 +0,0 @@ -/* Interface for Objective-C Collection object - Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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. -*/ - -/* This is the abstract superclass that satisfies the Collecting - protocol, without using any instance variables. -*/ - -#ifndef __Collection_h_INCLUDE_GNU -#define __Collection_h_INCLUDE_GNU - -#include -#include -#include -#include -#include - -@interface ConstantCollection : NSObject -- printForDebugger; /* This method will disappear later. */ -@end - -@interface Collection : ConstantCollection -@end - -@interface Enumerator : NSObject -{ - id collection; - void *enum_state; -} -@end - -#define FOR_COLLECTION(ACOLL, ELT) \ -{ \ - void *_es = [ACOLL newEnumState]; \ - while ((ELT = [ACOLL nextObjectWithEnumState: &_es])) \ - { - -#define END_FOR_COLLECTION(ACOLL) \ - } \ - [ACOLL freeEnumState: &_es]; \ -} - -#define FOR_COLLECTION_WHILE_TRUE(ACOLL, ELT, FLAG) \ -{ \ - void *_es = [ACOLL newEnumState]; \ - while (FLAG && (ELT = [ACOLL nextObjectWithEnumState: &_es])) \ - { - -#define END_FOR_COLLECTION_WHILE_TRUE(ACOLL) \ - } \ - [ACOLL freeEnumState: &_es]; \ -} - -/* The only subclassResponsibilities in Collection are: - - addElement: - removeElement: - getNextElement:withEnumState: - empty - - But subclasses may need to override the following for correctness: - - contentType - comparisonFunction - - but subclasses will want to override others as well in order to - increase efficiency, especially: - - count - - and perhaps: - - includesElement: - occurrencesOfElement: - uniqueContents - withElementsCall:whileTrue: - withElementsCall: - isEmpty - releaseObjects - -*/ - -#endif /* __Collection_h_INCLUDE_GNU */ - diff --git a/Source/objects/CollectionPrivate.h b/Source/objects/CollectionPrivate.h deleted file mode 100644 index 27e9bc611..000000000 --- a/Source/objects/CollectionPrivate.h +++ /dev/null @@ -1,52 +0,0 @@ -/* Collection definitions for the use of subclass implementations only - Copyright (C) 1993,1994, 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: May 1993 - - This file is part of the GNU Objective C Class 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 __CollectionPrivate_h_INCLUDE_GNU -#define __CollectionPrivate_h_INCLUDE_GNU - -#include - -@interface ConstantCollection (ArchivingHelpers) -/* These methods should never be called except in order, and inside - -encodeWithCoder: and -decodeWithCoder: */ -- (void) _encodeCollectionWithCoder: (id )aCoder; -- _initCollectionWithCoder: (id )aCoder; -- (void) _encodeContentsWithCoder: (id )aCoder; -- (void) _decodeContentsWithCoder: (id )aCoder; -@end - -@interface ConstantCollection (DeallocationHelpers) - -/* Empty the internals of a collection after the contents have - already been released. */ -- (void) _collectionEmpty; - -- (void) _collectionReleaseContents; - -/* Deallocate the internals of a collection after the contents - have already been released. */ -- (void) _collectionDealloc; - -@end - -#endif /* __CollectionPrivate_h_INCLUDE_GNU */ diff --git a/Source/objects/ConnectedCoder.h b/Source/objects/ConnectedCoder.h deleted file mode 100644 index 7b0ed2b06..000000000 --- a/Source/objects/ConnectedCoder.h +++ /dev/null @@ -1,83 +0,0 @@ -/* Interface for coder object for distributed objects - Copyright (C) 1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: July 1994 - - This file is part of the GNU Objective C Class 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 __ConnectedCoder_h -#define __ConnectedCoder_h - -#include -#include -#include - -/* ConnectedCoder identifiers */ -enum { - METHOD_REQUEST = 0, - METHOD_REPLY, - ROOTPROXY_REQUEST, - ROOTPROXY_REPLY, - CONNECTION_SHUTDOWN, - METHODTYPE_REQUEST, /* these two only needed with NeXT runtime */ - METHODTYPE_REPLY -}; - -@class Connection; - -@interface ConnectedEncoder : Encoder -{ - Connection *connection; - unsigned sequence_number; - int identifier; -} - -+ newForWritingWithConnection: (Connection*)c - sequenceNumber: (int)n - identifier: (int)i; -- (void) dismiss; - -- connection; -- (unsigned) sequenceNumber; -- (int) identifier; - -@end - -@interface ConnectedDecoder : Decoder -{ - Connection *connection; - unsigned sequence_number; - int identifier; -} - -+ newDecodingWithPacket: (InPacket*)packet - connection: (Connection*)c; -+ newDecodingWithConnection: (Connection*)c - timeout: (int) timeout; -- (void) dismiss; - -- connection; -- (unsigned) sequenceNumber; -- (int) identifier; - -- replyPort; - -@end - -#endif /* __ConnectedCoder_h */ diff --git a/Source/objects/Connection.h b/Source/objects/Connection.h deleted file mode 100644 index 880d02955..000000000 --- a/Source/objects/Connection.h +++ /dev/null @@ -1,222 +0,0 @@ -/* Interface for GNU Objective-C connection for remote object messaging - Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: July 1994 - - This file is part of the GNU Objective C Class 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 __Connection_h_OBJECTS_INCLUDE -#define __Connection_h_OBJECTS_INCLUDE - -#include -#include -#include -#include -#include -#include -#include -#include - -@class Proxy; -@class InPort, OutPort; - -@interface Connection : NSObject -{ - unsigned is_valid:1; - unsigned delay_dialog_interruptions:1; - unsigned connection_filler:6; - unsigned retain_count:24; - unsigned reply_depth; - InPort *in_port; - OutPort *out_port; - unsigned message_count; - NSMapTable *local_targets; - NSMapTable *remote_proxies; - int in_timeout; - int out_timeout; - Class in_port_class; - Class out_port_class; - Class encoding_class; - NSMapTable *incoming_xref_2_const_ptr; - NSMapTable *outgoing_const_ptr_2_xref; - id delegate; -} - -/* Setting and getting class configuration */ -+ (Class) defaultInPortClass; -+ (void) setDefaultInPortClass: (Class) aPortClass; -+ (Class) defaultOutPortClass; -+ (void) setDefaultOutPortClass: (Class) aPortClass; -+ (Class) defaultProxyClass; -+ (void) setDefaultProxyClass: (Class) aClass; -+ (int) defaultOutTimeout; -+ (void) setDefaultOutTimeout: (int)to; -+ (int) defaultInTimeout; -+ (void) setDefaultInTimeout: (int)to; - -/* Querying the state of all the connections */ -+ (int) messagesReceived; -+ (id ) allConnections; -+ (unsigned) connectionsCount; -+ (unsigned) connectionsCountWithInPort: (InPort*)aPort; - -/* Use these when you're release'ing an object that may have been vended - or registered for invalidation notification */ -+ (void) removeLocalObject: anObj; - -/* Registering your server object on the network. - These methods create a new connection object that must be "run" in order - to start handling requests from clients. - These method names may change when we get the capability to register - ports with names after the ports have been created. */ -/* I want the second method name to clearly indicate that we're not - connecting to a pre-existing registration name, we're registering a - new name, and this method will fail if that name has already been - registered. This is why I don't like "newWithRegisteredName:" --- - it's unclear if we're connecting to another Connection that already - registered with that name. */ -+ (Connection*) newWithRootObject: anObj; -+ (Connection*) newRegisteringAtName: (id )n withRootObject: anObj; - -/* Get a proxy to a remote server object. - A new connection is created if necessary. */ -+ (Proxy*) rootProxyAtName: (id )name onHost: (id )host; -+ (Proxy*) rootProxyAtName: (id )name; -+ (Proxy*) rootProxyAtPort: (OutPort*)anOutPort; -+ (Proxy*) rootProxyAtPort: (OutPort*)anOutPort withInPort: (InPort*)anInPort; - -/* This is the designated initializer for the Connection class. - You don't need to call it yourself. */ -+ (Connection*) newForInPort: (InPort*)anInPort outPort: (OutPort*)anOutPort - ancestorConnection: (Connection*)ancestor; - -/* Make a connection object start listening for incoming requests. After - after DATE. */ -- (void) runConnectionUntilDate: date; - -/* Same as above, but never time out. */ -- (void) runConnection; - -/* When you get an invalidation notification from a connection, use - this method in order to find out if any of the proxy objects you're - using are going away. */ -- (id ) proxies; - -/* If you somehow have a connection to a server, but don't have it's - a proxy to its root object yet, you can use this to get it. */ -- (Proxy*) rootProxy; - -/* For getting the root object of a connection or port */ -- rootObject; -+ rootObjectForInPort: (InPort*)aPort; - -/* Used for setting the root object of a connection that we - created without one, or changing the root object of a connection - that already has one. */ -+ (void) setRootObject: anObj forInPort: (InPort*)aPort; -- setRootObject: anObj; - -/* Querying and setting some instance variables */ -- (int) outTimeout; -- (int) inTimeout; -- (void) setOutTimeout: (int)to; -- (void) setInTimeout: (int)to; -- (Class) inPortClass; -- (Class) outPortClass; -- (void) setInPortClass: (Class)aPortClass; -- (void) setOutPortClass: (Class)aPortClass; -- (Class) proxyClass; -- (Class) encodingClass; -- (Class) decodingClass; -- outPort; -- inPort; -- delegate; -- (void) setDelegate: anObj; - -- (void) invalidate; -- (BOOL) isValid; - -/* Only subclassers and power-users need worry about these */ -- (Proxy*) proxyForTarget: (unsigned)target; -- (void) addProxy: (Proxy*)aProxy; -- (BOOL) includesProxyForTarget: (unsigned)target; -- (void) removeProxy: (Proxy*)aProxy; -- (id ) localObjects; -- (void) addLocalObject: anObj; -- (BOOL) includesLocalObject: anObj; -- (void) removeLocalObject: anObj; -- (retval_t) forwardForProxy: (Proxy*)object - selector: (SEL)sel - argFrame: (arglist_t)frame; -- (const char *) typeForSelector: (SEL)sel remoteTarget: (unsigned)target; -- (unsigned) _encoderReferenceForConstPtr: (const void*)ptr; -- (const void*) _decoderConstPtrAtReference: (unsigned)xref; -- (unsigned) _encoderCreateReferenceForConstPtr: (const void*)ptr; -- (unsigned) _decoderCreateReferenceForConstPtr: (const void*)ptr; - -@end - -extern NSString *ConnectionBecameInvalidNotification; - -@protocol ConnectedSelfCoding -+ (void) encodeObject: anObj withConnectedCoder: aRmc; -@end - -@interface Object (ConnectionDelegate) -- (Connection*) connection: ancestorConn didConnect: newConn; -/* If the delegate responds to this method, it will be used to ask the - delegate's permission to establish a new connection from the old one. - Often this is used so that the delegate can register for invalidation - notification on new child connections. - Normally return newConn. */ -@end - -#if 0 /* Put in Coder.m until ObjC runtime category-loading bug is fixed */ - -@interface Object (ConnectionRequests) -- classForConnectedCoder: aRmc; -/* Must return the class that will be created on the remote side - of the connection. - Used by the remote objects system to determine how the receiver - should be encoded across the network. - In general, you can: - return [Proxy class] to send a proxy of the receiver; - return [self class] to send the receiver bycopy. - The Object class implementation returns [Proxy class]. */ -+ (void) encodeObject: anObject withConnectedCoder: aRmc; -/* This message is sent to the class returned by -classForConnectedCoder: - The Proxy class implementation encodes a proxy for anObject. - The Object class implementation encodes the receiver itself. */ -@end - -@interface Object (Retaining) -/* Make sure objects don't crash when you send them messages. - These implementations, however, do nothing. */ -@end - -#endif /* 0 Put in Coder.m */ - -#define CONNECTION_DEFAULT_TIMEOUT 15000 /* in milliseconds */ - -extern NSString *ConnectionBecameInvalidNotification; -extern NSString *ConnectionWasCreatedNotification; - -extern NSString *RunLoopConnectionReplyMode; - -#endif /* __Connection_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/DelegatePool.h b/Source/objects/DelegatePool.h deleted file mode 100644 index 566dfbbed..000000000 --- a/Source/objects/DelegatePool.h +++ /dev/null @@ -1,75 +0,0 @@ -/* Interface for Objective-C "collection of delegates" object - Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: May 1993 - - This file is part of the GNU Objective C Class 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. -*/ - -/* Using this object, a delegator can have an arbitrary number of - delegates. Send a message to this object and the message will get - forwarded to the delegates on the list. */ - -#ifndef __DelegatePool_h_OBJECTS_INCLUDE -#define __DelegatePool_h_OBJECTS_INCLUDE - -#include -#include - -/* Available sending behaviors */ -enum DelegatePoolSendBehavior {SEND_TO_ALL = 0, - SEND_TO_FIRST_RESPONDER, - SEND_UNTIL_YES, - SEND_UNTIL_NO}; - -@interface DelegatePool -{ - struct objc_class *isa; - @public - unsigned char _send_behavior; - Array *_list; - BOOL _last_message_had_receivers; -} - -// CREATING AND FREEING; -+ alloc; -+ new; -- init; -- (void) dealloc; - -// MANIPULATING COLLECTION OF DELEGATES; -- (void) delegatePoolAddObject: anObject; -- (void) delegatePoolAddObjectIfAbsent: anObject; -- (void) delegatePoolRemoveObject: anObject; -- (BOOL) delegatePoolIncludesObject: anObject; -- delegatePoolCollection; -- (unsigned char) delegatePoolSendBehavior; -- (void) delegatePoolSetSendBehavior: (unsigned char)b; - -// FOR PASSING ALL OTHER MESSAGES TO DELEGATES; -// RETURNS 0 IF NO OBJECTS RESPOND; -- forward:(SEL)aSel :(arglist_t)argFrame; - -// FOR FINDING OUT IF ANY OBJECTS IN THE POOL RESPONDED TO THE LAST MSG; -/* This method is bad because it won't be thread-safe---it may - go away in the future. */ -- (BOOL) delegatePoolLastMessageHadReceivers; - -@end - -#endif /* __DelegatePool_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/Dictionary.h b/Source/objects/Dictionary.h deleted file mode 100644 index 9f6a67cfa..000000000 --- a/Source/objects/Dictionary.h +++ /dev/null @@ -1,41 +0,0 @@ -/* Interface for Objective-C Dictionary collection object - Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __Dictionary_h_INCLUDE_GNU -#define __Dictionary_h_INCLUDE_GNU - -#include -#include -#include - -@interface Dictionary : KeyedCollection -{ - NSMapTable *_contents_hash; -} - -- initWithCapacity: (unsigned)aCapacity; - -@end - -#endif /* __Dictionary_h_INCLUDE_GNU */ - diff --git a/Source/objects/EltNode-h b/Source/objects/EltNode-h deleted file mode 100644 index ce2cdb695..000000000 --- a/Source/objects/EltNode-h +++ /dev/null @@ -1,41 +0,0 @@ -/* Code for interface of Objective-C EltNode objects - Copyright (C) 1993,1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Dept. of Computer Science, U. of Rochester, Rochester, NY 14627 - - This file is part of the GNU Objective-C 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. -*/ - -/* This file gets included in all the ...EltNode.h files - Doing this silly #include stuff is a poor substitute for multiple - inheritance. sigh. - - Pattern: - - @interface FooEltNode : FooNode - #include - @end -*/ - - - -{ - elt _element; - int (*_elt_comparison_function)(elt,elt); -} -- (int(*)(elt,elt)) comparisonFunction; diff --git a/Source/objects/EltNode-m b/Source/objects/EltNode-m deleted file mode 100644 index c8737deed..000000000 --- a/Source/objects/EltNode-m +++ /dev/null @@ -1,110 +0,0 @@ -/* Code for implementation for Objective-C EltNode objects - Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Dept. of Computer Science, U. of Rochester, Rochester, NY 14627 - - This file is part of the GNU Objective-C 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. -*/ - -/* This file gets included in all the ...EltNode.m files. - Doing this silly #include stuff is a poor substitute for multiple - inheritance. sigh. - - Pattern: - - @implementation FooEltNode : FooNode - #include - @end -*/ - -#include -#include - -- initElement: (elt)anElement - encoding: (const char *)eltEncoding -{ - [super init]; - _element = anElement; - _elt_comparison_function = elt_get_comparison_function(eltEncoding); - return self; -} - -/* Archiving must mimic the above designated initializer */ - -- (void) encodeWithCoder: aCoder -{ - const char *encoding; - - [super encodeWithCoder:aCoder]; - encoding = elt_get_encoding(_elt_comparison_function); - [aCoder encodeValueOfCType:@encode(char*) at:&encoding - withName:@"EltNode Content Type Encoding"]; - [aCoder encodeValueOfCType:encoding - at:elt_get_ptr_to_member(encoding, &_element) - withName:@"EltNode Content Element"]; -} - -- (elt*) _elementDataPtr -{ - return &_element; -} - -- (int(**)(elt,elt)) _eltComparisonFunctionPtr -{ - return &_elt_comparison_function; -} - -- initWithCoder: aCoder -{ - char *encoding; - - [super initWithCoder:aCoder]; - [aCoder decodeValueOfCType:@encode(char*) - at:&encoding - withName:NULL]; - *[self _eltComparisonFunctionPtr] = elt_get_comparison_function(encoding); - [aCoder decodeValueOfCType:encoding - at:[self _elementDataPtr] - withName:NULL]; - return self; -} - -- (int(*)(elt,elt)) comparisonFunction -{ - return _elt_comparison_function; -} - -- (elt) elementData -{ - return _element; -} - -- (int) compare: anotherObject -{ - /* perhaps we should do more checking first */ - return _elt_comparison_function(_element, [anotherObject elementData]); -} - -- printForDebugger -{ - elt_fprintf_elt(stdout, - elt_get_encoding(_elt_comparison_function), - _element); - printf("\n"); - return self; -} diff --git a/Source/objects/EltNodeCollector.h b/Source/objects/EltNodeCollector.h deleted file mode 100644 index 4f850574a..000000000 --- a/Source/objects/EltNodeCollector.h +++ /dev/null @@ -1,67 +0,0 @@ -/* Interface for Objective-C EltNodeCollector collection object - Copyright (C) 1993,1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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. -*/ - -/* EltNodeCollector */ - -#ifndef __EltNodeCollector_h_INCLUDE_GNU -#define __EltNodeCollector_h_INCLUDE_GNU - -#include -#include - -/* Protocol for a node that also holds an element */ -@protocol EltHolding -- initElement: (elt)anElement - encoding: (const char *)eltEncoding; -- (elt) elementData; -@end - - -/* It's is a bit unfortunate that we insist that the underlying - collector conform to IndexedCollecting. */ - -@interface EltNodeCollector : IndexedCollection -{ - @private - id _contents_collector; - id _node_class; - int (*_comparison_function)(elt,elt); -} - - -- initWithType: (const char *)contentEncoding - nodeCollector: aNodeCollector - nodeClass: aNodeClass; - -// The class of the autocreated link objects, must conform to ; -- eltNodeClass; - -// Getting the underlying node collector that holds the contents; -- contentsCollector; - -// Finding the node that contains anElement; -- (id ) eltNodeWithElement: (elt)anElement; - -@end - -#endif /* __EltNodeCollector_h_INCLUDE_GNU */ diff --git a/Source/objects/Enumerating.h b/Source/objects/Enumerating.h deleted file mode 100644 index 5fe967e7e..000000000 --- a/Source/objects/Enumerating.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Protocol for GNU Objective C invocations - Copyright (C) 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: February 1996 - - This file is part of the GNU Objective C Class 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 __Enumerating_h__OBJECTS_INCLUDE -#define __Enumerating_h__OBJECTS_INCLUDE - -#include - -@protocol Enumerating - -- initWithCollection: aCollection; -- nextObject; - -@end - -#endif /* __Enumerating_h__OBJECTS_INCLUDE */ - diff --git a/Source/objects/GapArray.h b/Source/objects/GapArray.h deleted file mode 100644 index e39f89cde..000000000 --- a/Source/objects/GapArray.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Interface for Objective-C GapArray collection object - Copyright (C) 1993,1994 Free Software Foundation, Inc. - - Written by: Kresten Krab Thorup - Dept. of Mathematics and Computer Science, Aalborg U., Denmark - - This file is part of the GNU Objective C Class 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 __GapArray_h_INCLUDE_GNU -#define __GapArray_h_INCLUDE_GNU - -#include -#include - -@interface GapArray : Array -{ - @public - unsigned _gap_start; /* start of gap */ - unsigned _gap_size; /* size of gap */ -} - -@end - -#endif /* __GapArray_h_INCLUDE_GNU */ diff --git a/Source/objects/GapArrayPrivate.h b/Source/objects/GapArrayPrivate.h deleted file mode 100644 index 00d8c6a32..000000000 --- a/Source/objects/GapArrayPrivate.h +++ /dev/null @@ -1,89 +0,0 @@ -/* GapArray definitions for the use of subclass implementations - Copyright (C) 1993,1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - Copyright (C) 1993,1994 Kresten Krab Thorup - Dept. of Mathematics and Computer Science, Aalborg U., Denmark - - This file is part of the GNU Objective C Class 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 __GapArrayPrivate_h_INCLUDE_GNU -#define __GapArrayPrivate_h_INCLUDE_GNU - -#include -#include -#include - -#define GAP_TO_BASIC(INDEX) \ - ({ unsigned int __idx = (INDEX); \ - __idx >= self->_gap_start \ - ? __idx+self->_gap_size : __idx; }) - -#define BASIC_TO_GAP(INDEX) \ - ({ unsigned int __idx = (INDEX); \ - __idx < self->_gap_start \ - ? __idx : __idx-self->_gap_size; }) - -static inline void -gapMoveGapTo (GapArray* self, unsigned index) -{ - int i; - assert (index <= self->_capacity); - if (index < self->_gap_start) - { -#ifndef STABLE_MEMCPY - int b = index + self->_gap_size; - for (i = self->_gap_start + self->_gap_size - 1; i >= b; i--) - self->_contents_array[i] = self->_contents_array[i - self->_gap_size]; -#else - memcpy (self->_contents_array + index + self->_gap_size, - self->_contents_array + index, - self->_gap_start - index) -#endif - } - else - { -#ifndef STABLE_MEMCPY - for(i = self->_gap_start; i != index; i++) - self->_contents_array[i] = self->_contents_array[i - self->_gap_size]; -#else - memcpy (self->_contents_array + self->_gap_start, - self->_contents_array + self->_gap_start + self->_gap_size, - index - self->_gap_start); -#endif - } - self->_gap_start = index; -} - -static inline void -gapMakeHoleAt(GapArray *self, unsigned index) -{ - gapMoveGapTo (self, index); - self->_gap_start += 1; - self->_gap_size -= 1; -} - -static inline void -gapFillHoleAt(GapArray *self, unsigned index) -{ - gapMoveGapTo (self, index); - self->_gap_size += 1; -} - -#endif /* __GapArrayPrivate_h_INCLUDE_GNU */ diff --git a/Source/objects/Heap.h b/Source/objects/Heap.h deleted file mode 100644 index 44d427ec4..000000000 --- a/Source/objects/Heap.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Interface for Objective-C Heap collection object - Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: May 1993 - - This file is part of the GNU Objective C Class 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 __Heap_h_INCLUDE_GNU -#define __Heap_h_INCLUDE_GNU - -#include -#include - -@interface Heap : Array - -- (void) heapifyFromIndex: (unsigned)index; -- (void) heapify; - -@end - -#endif /* __Heap_h_INCLUDE_GNU */ diff --git a/Source/objects/IndexedCollecting.h b/Source/objects/IndexedCollecting.h deleted file mode 100644 index 9504b77f5..000000000 --- a/Source/objects/IndexedCollecting.h +++ /dev/null @@ -1,135 +0,0 @@ -/* Protocol for Objective-C objects that hold elements accessible by index - Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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. -*/ - -/* The protocol inherits from the - protocol. - - The protocol defines the interface to a - collection of elements that are accessible by a key that is an index, - where the indeces in a collection are a contiguous series of unsigned - integers beginning at 0. This is the root of the protocol heirarchy - for all collections that hold their elements in some order. Elements - may be accessed, inserted, replaced and removed by their index. -*/ - -#ifndef __IndexedCollecting_h_OBJECTS_INCLUDE -#define __IndexedCollecting_h_OBJECTS_INCLUDE - -#include -#include - -typedef struct _IndexRange { - unsigned location; - unsigned length; -} IndexRange; - -#define IndexRangeInside(RANGE1,RANGE2) \ - ({IndexRange __a=(RANGE1), __b=(RANGE2); \ - __a.start<=__b.start && __a.end>=__b.end;}) - - -@protocol ConstantIndexedCollecting - -// GETTING MEMBERS BY INDEX; -- objectAtIndex: (unsigned)index; -- firstObject; -- lastObject; - -// GETTING MEMBERS BY NEIGHBOR; -- successorOfObject: anObject; -- predecessorOfObject: anObject; - -// GETTING INDICES BY MEMBER; -- (unsigned) indexOfObject: anObject; -- (unsigned) indexOfObject: anObject inRange: (IndexRange)aRange; - -// TESTING; -- (BOOL) contentsEqualInOrder: (id )aColl; -- (int) compareInOrderContentsOf: (id )aCollection; -- (unsigned) indexOfFirstDifference: (id )aColl; -- (unsigned) indexOfFirstIn: (id )aColl; -- (unsigned) indexOfFirstNotIn: (id )aColl; - -// ENUMERATING; -- (id ) reverseObjectEnumerator; -- (void) withObjectsInRange: (IndexRange)aRange - invoke: (id )anInvocation; -- (void) withObjectsInReverseInvoke: (id )anInvocation; -- (void) withObjectsInReverseInvoke: (id )anInvocation - whileTrue:(BOOL *)flag; -- (void) makeObjectsPerformInReverse: (SEL)aSel; -- (void) makeObjectsPerformInReverse: (SEL)aSel withObject: argObject; - -// LOW-LEVEL ENUMERATING; -- prevObjectWithEnumState: (void**)enumState; - -@end - - -@protocol IndexedCollecting - -// REPLACING; -- (void) replaceObjectAtIndex: (unsigned)index with: newObject; - -// REMOVING; -- (void) removeObjectAtIndex: (unsigned)index; -- (void) removeFirstObject; -- (void) removeLastObject; -- (void) removeRange: (IndexRange)aRange; - -// SORTING; -- (void) sortContents; -- (void) sortAddObject: newObject; - -@end - -#define NO_INDEX NSNotFound - -/* xxx Fix this comment: */ - -/* Most methods in the KeyedCollecting protocol that mention a key are - duplicated in the IndexedCollecting protocol, with their names - modified to reflect that the "key" now must be an unsigned integer, - (an "index"). The programmer should be able to use either of the - corresponding method names to the same effect. - - The new methods are provided in the IndexedCollecting protocol for: - 1) Better type checking for when an unsigned int is required. - 2) More intuitive method names. - - IndexedCollecting KeyedCollecting - ---------------------------------------------------------------------- - insertObject:atIndex insertObject:atKey: - replaceObjectAtIndex:with: replaceObjectAtKey:with: - removeObjectAtIndex: removeObjectAtKey: - objectAtIndex: objectAtKey: - includesIndex: includesKey: - - insertElement:atIndex insertElement:atKey: - replaceElementAtIndex:with: replaceElementAtKey:with: - removeElementAtIndex: removeElementAtKey: - elementAtIndex: elementAtKey: - -*/ - -#endif /* __IndexedCollecting_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/IndexedCollection.h b/Source/objects/IndexedCollection.h deleted file mode 100644 index c5df4e78b..000000000 --- a/Source/objects/IndexedCollection.h +++ /dev/null @@ -1,111 +0,0 @@ -/* Interface for Objective-C Sequential Collection object. - Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __IndexedCollection_h_INCLUDE_GNU -#define __IndexedCollection_h_INCLUDE_GNU - -#include -#include -#include - -@interface ConstantIndexedCollection : ConstantCollection -@end - -@interface IndexedCollection : ConstantIndexedCollection -@end - -@interface ReverseEnumerator : Enumerator -@end - -/* Put this on category instead of class to avoid bogus complaint from gcc */ -@interface ConstantIndexedCollection (Protocol) -@end -@interface IndexedCollection (Protocol) -@end - -#define FOR_INDEXED_COLLECTION(ACOLL, ELT) \ -{ \ - void *_es = [ACOLL newEnumState]; \ - while ((ELT = [ACOLL nextObjectWithEnumState: &_es])) \ - { - -#define END_FOR_INDEXED_COLLECTION(ACOLL) \ - } \ - [ACOLL freeEnumState: &_es]; \ -} - -#define FOR_INDEXED_COLLECTION_REVERSE(ACOLL, ELT) \ -{ \ - void *_es = [ACOLL newEnumState]; \ - while ((ELT = [ACOLL prevObjectWithEnumState: &_es])) \ - { - -#define END_FOR_INDEXED_COLLECTION_REVERSE(ACOLL) \ - } \ - [ACOLL freeEnumState: &_es]; \ -} - -#define FOR_INDEXED_COLLECTION_WHILE_TRUE(ACOLL, ELT, FLAG) \ -{ \ - void *_es = [ACOLL newEnumState]; \ - while (FLAG && (ELT = [ACOLL nextObjectWithEnumState: &_es])) \ - { - -#define END_FOR_INDEXED_COLLECTION_WHILE_TRUE(ACOLL) \ - } \ - [ACOLL freeEnumState: &_es]; \ -} - - -/* The only subclassResponsibilities in IndexedCollection are: - - insertElement:atIndex: - removeElementAtIndex: - elementAtIndex: - - but subclass will want to override others as well in order to - increase efficiency. The following are especially important if - the subclass's implementation of "elementAtIndex:" is not efficient: - - replaceElementAtIndex:with: - swapAtIndeces:: - shallowCopyReplaceFrom:to:with: - sortAddElement:byCalling: - removeElement: - firstElement - lastElement - shallowCopyFrom:to: - withElementsCall:whileTrue: - withElementsInReverseCall:whileTrue: - - and perhaps: - - appendElement: - prependElement: - indexOfElement: - withElementsInReverseCall: - -*/ - - -#endif /* __IndexedCollection_h_INCLUDE_GNU */ diff --git a/Source/objects/IndexedCollectionPrivate.h b/Source/objects/IndexedCollectionPrivate.h deleted file mode 100644 index d3412d26d..000000000 --- a/Source/objects/IndexedCollectionPrivate.h +++ /dev/null @@ -1,41 +0,0 @@ -/* IndexedCollection definitions for the use of subclass implementations only - Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: May 1993 - - This file is part of the GNU Objective C Class 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 __IndexedCollectionPrivate_h_INCLUDE_GNU -#define __IndexedCollectionPrivate_h_INCLUDE_GNU - -#include -#include -#include -#include - -/* To be used inside a method for making sure that index - is not above range. -*/ -#define CHECK_INDEX_RANGE_ERROR(INDEX, OVER) \ -if (INDEX >= OVER) \ - [NSException raise: NSRangeException \ - format: @"in %s, index %d is out of range", \ - sel_get_name (_cmd), INDEX] - -#endif /* __IndexedCollectionPrivate_h_INCLUDE_GNU */ diff --git a/Source/objects/InvalidationListening.h b/Source/objects/InvalidationListening.h deleted file mode 100644 index 3748381db..000000000 --- a/Source/objects/InvalidationListening.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Protocol for GNU Objective-C objects that understand an invalidation msg - Copyright (C) 1993,1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: July 1994 - - This file is part of the GNU Objective C Class 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 __InvalidationListening_h_OBJECTS_INCLUDE -#define __InvalidationListening_h_OBJECTS_INCLUDE - -/* This protocol is just temporary. It will disappear when GNU writes - a more general notification system. - It is not recommended that you use it in your code. */ - -@protocol InvalidationListening - -- senderIsInvalid: sender; - -@end - -#endif /* __InvalidationListening_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/Invocation.h b/Source/objects/Invocation.h deleted file mode 100644 index 2294b4708..000000000 --- a/Source/objects/Invocation.h +++ /dev/null @@ -1,99 +0,0 @@ -#ifndef __Invocation_h_OBJECTS_INCLUDE -#define __Invocation_h_OBJECTS_INCLUDE - -/* - Use these for notifications! - Don't forget to make these archivable / transportable. - WARNING: All the (char*) type arguments and return values may - extraneous stuff after the first type. -*/ - -#include -#include -#include - -@interface Invocation : NSObject -{ - char *return_type; /* may actually contain full argframe type */ - unsigned return_size; - void *return_value; -} -- initWithReturnType: (const char *)encoding; -- (const char *) returnType; -- (unsigned) returnSize; -- (void) getReturnValue: (void*) addr; -@end - -@interface ArgframeInvocation : Invocation -{ - arglist_t argframe; - BOOL args_retained; - /* Use return_type to hold full argframe type. */ -} -- initWithArgframe: (arglist_t)frame type: (const char *)e; -- initWithType: (const char *)e; - -- (void) retainArguments; -- (BOOL) argumentsRetained; - -- (const char *) argumentTypeAtIndex: (unsigned)i; -- (unsigned) argumentSizeAtIndex: (unsigned)i; -- (void) getArgument: (void*)addr atIndex: (unsigned)i; -- (void) setArgumentAtIndex: (unsigned)i - toValueAt: (const void*)addr; -@end - -@interface MethodInvocation : ArgframeInvocation -{ - id *target_pointer; - SEL *sel_pointer; -} - -- initWithArgframe: (arglist_t)frame selector: (SEL)s; -- initWithSelector: (SEL)s; -- initWithTarget: target selector: (SEL)s, ...; -- (void) invokeWithTarget: t; -- (SEL) selector; -- (void) setSelector: (SEL)s; -- target; -- (void) setTarget: t; -@end - -/* Same as MethodInvocation, except that when sent - [ -invokeWithObject: anObj], anObj does not become the target - for the invocation's selector, it becomes the first object - argument of the selector. */ -@interface ObjectMethodInvocation : MethodInvocation -{ - id *arg_object_pointer; -} -@end - -@interface VoidFunctionInvocation : Invocation -{ - void (*function)(); -} -- initWithVoidFunction: (void(*)())f; -@end - - -@interface ObjectFunctionInvocation : Invocation -{ - id (*function)(id); -} -- initWithObjectFunction: (id(*)(id))f; -@end - - -#if 0 -@interface FunctionInvocation : ArgframeInvocation -{ - void (*function)(); -} -- initWithFunction: (void(*)())f - argframe: (arglist_t)frame type: (const char *)e; -- initWithFunction: (void(*)())f; -@end -#endif - -#endif /* __Invocation_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/Invoking.h b/Source/objects/Invoking.h deleted file mode 100644 index 594bd7921..000000000 --- a/Source/objects/Invoking.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Protocol for GNU Objective C invocations - Copyright (C) 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: February 1996 - - This file is part of the GNU Objective C Class 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 __Invoking_h__OBJECTS_INCLUDE -#define __Invoking_h__OBJECTS_INCLUDE - -#include - -@protocol Invoking - -- (void) invoke; -- (void) invokeWithObject: anObject; - -- objectReturnValue; -- (int) intReturnValue; - -- (BOOL) returnValueIsTrue; - -@end - -#endif /* __Invoking_h__OBJECTS_INCLUDE */ - diff --git a/Source/objects/KeyedCollecting.h b/Source/objects/KeyedCollecting.h deleted file mode 100644 index f50dbfe2c..000000000 --- a/Source/objects/KeyedCollecting.h +++ /dev/null @@ -1,82 +0,0 @@ -/* Protocol for Objective-C objects holding (keyElement,contentElement) pairs. - Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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. -*/ - -/* The protocol inherits from the protocol. - - The protocol defines the interface to a - collection of elements that are accessible by a key, where the key is - some unique element. Pairs of (key element, content element) may be - added, removed and replaced. The keys and contents may be tested, - enumerated and copied. -*/ - -#ifndef __KeyedCollecting_h_OBJECTS_INCLUDE -#define __KeyedCollecting_h_OBJECTS_INCLUDE - -#include -#include - -@protocol ConstantKeyedCollecting - -// INITIALIZING; -- initWithObjects: (id*)objects forKeys: (id*)keys count: (unsigned)c; - -// GETTING ELEMENTS AND KEYS; -- objectAtKey: aKey; -- keyOfObject: aContentObject; - -// TESTING; -- (BOOL) containsKey: aKey; - -// ENUMERATIONS; -- (id ) keyEnumerator; -- withKeyObjectsInvoke: (id )anInvocation; -- withKeyObjectsInvoke: (id )anInvocation - whileTrue: (BOOL *)flag; - -// LOW-LEVEL ENUMERATING; -- nextObjectAndKey: (id*)keyPtr withEnumState: (void**)enumState; - -// COPYING; -- shallowCopyValuesAs: (Class)aCollectingClass; -- shallowCopyKeysAs: (Class)aCollectingClass; -- copyValuesAs: (Class)aCollectingClass; -- copyKeysAs: (Class)aCollectingClass; - -@end - -@protocol KeyedCollecting - -// ADDING; -- (void) putObject: newContentObject atKey: aKey; - -// REPLACING AND SWAPPING; -- (void) replaceObjectAtKey: aKey with: newContentObject; -- (void) swapObjectsAtKeys: key1 : key2; - -// REMOVING; -- (void) removeObjectAtKey: aKey; - -@end - -#endif /* __KeyedCollecting_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/KeyedCollection.h b/Source/objects/KeyedCollection.h deleted file mode 100644 index a9d6d32ba..000000000 --- a/Source/objects/KeyedCollection.h +++ /dev/null @@ -1,80 +0,0 @@ -/* Interface for Objective-C KeyedCollection collection object - Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __KeyedCollection_h_INCLUDE_GNU -#define __KeyedCollection_h_INCLUDE_GNU - -#include -#include -#include - -@interface ConstantKeyedCollection : Collection -@end - -@interface KeyedCollection : ConstantKeyedCollection -@end - -/* Put this on category instead of class to avoid bogus complaint from gcc */ -@interface ConstantKeyedCollection (Protocol) -@end -@interface KeyedCollection (Protocol) -@end - -@interface KeyEnumerator : Enumerator -@end - -#define FOR_KEYED_COLLECTION(ACOLL, ELT, KEY) \ -{ \ - void *_es = [ACOLL newEnumState]; \ - while ((ELT = [ACOLL nextObjectAndKey: &(KEY) withEnumState: &_es])) \ - { - -#define END_FOR_KEYED_COLLECTION(ACOLL) \ - } \ - [ACOLL freeEnumState: &_es]; \ -} - -#define FOR_KEYED_COLLECTION_WHILE_TRUE(ACOLL, ELT, KEY, FLAG) \ -{ \ - void *_es = [ACOLL newEnumState]; \ - while (FLAG && (ELT = [ACOLL nextObjectAndKey: &(KEY) \ - withEnumState: &_es])) \ - { - -#define END_FOR_KEYED_COLLECTION_WHILE_TRUE(ACOLL) \ - } \ - [ACOLL freeEnumState: &_es]; \ -} - - -/* The only subclassResponsibilities in IndexedCollection are: - - keyDescription - insertElement:atKey: - removeElementAtKey: - elementAtKey: - includesKey: - getNextKey:content:withEnumState: -*/ - -#endif /* __KeyedCollection_h_INCLUDE_GNU */ diff --git a/Source/objects/LibobjectsMain.h b/Source/objects/LibobjectsMain.h deleted file mode 100644 index f27610a84..000000000 --- a/Source/objects/LibobjectsMain.h +++ /dev/null @@ -1,65 +0,0 @@ -/* LibobjectsMain.h for GNUStep - Copyright (C) 1995 Free Software Foundation, Inc. - - Written by: Georg Tuparev, EMBL & Academia Naturalis, - Heidelberg, Germany - Tuparev@EMBL-Heidelberg.de - Last update: 05-aug-1995 - - This file is part of the GNU Objective C Class 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 __LibobjectsMain_h_OBJECTS_INCLUDE -#define __LibobjectsMain_h_OBJECTS_INCLUDE - -/* - Several Foundation classes (NSBundle, NSProcessInfo, ...) need access - to the argc, argv, and env variables of the main() function. The purpose - of this (ugly hack) definition is to give the libobjects library the - oportunity to implement its own main function with private access to the - global vars. The private main() implementation then will call the user - defined (now renamed to LibobjectsMain()) function. The libobjects main() - functions is implemented in NSProcessInfo.m -*/ - -/* Currently this only actually necessary if we don't have ELF. - If we have ELF, we can do something far cleaner. - See src/NSProcessInfo.m [__ELF__]. - Hopefully, in the future, we'll do something cleaner - with non-ELF systems too. - -mccallum -*/ - -#if !defined(__ELF__) && !defined(SYS_AUTOLOAD) -#define main LibobjectsMain -extern int LibobjectsMain(/* int argc, char *argv[] */); -#endif /* __ELF__ */ - -/* - NOTE! This is very dirty and dangerous trick. I spend several hours - on thinking and man pages browsing, but couldn't find better solution. - I know that I will spend 666 years in the Computer Hell for writing - this hack, and the master devil (Bully Boy) will send me to write - Windowz software. - BTW, for writing this hack I got personal congratulations from Dennis - Ritchie and Bjarne Stroustrup sent me a bunch of flowers and asked me - to participate in the standardization committee for C-- v.6.0 as - responsible for the new Tab-Overriding-Operator and Scope-Sensitive- - Comments ... but this makes my situation even worse ;-) -*/ - -#endif /* __LibobjectsMain_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/LinkedList.h b/Source/objects/LinkedList.h deleted file mode 100644 index 198a21b36..000000000 --- a/Source/objects/LinkedList.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Interface for Objective-C LinkedList collection object - Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: May 1993 - - This file is part of the GNU Objective C Class 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 __LinkedList_h_INCLUDE_GNU -#define __LinkedList_h_INCLUDE_GNU - -#include -#include - -/* The protocol defines the interface to an object - that may be an element in a LinkedList. -*/ -@protocol LinkedListComprising -- nextLink; -- prevLink; -- (void) setNextLink: (id )aLink; -- (void) setPrevLink: (id )aLink; -- linkedList; -- (void) setLinkedList: aLinkedList; -@end - -@interface LinkedList : OrderedCollection -{ - id _first_link; - id _last_link; - unsigned int _count; -} - -@end - -#endif /* __LinkedList_h_INCLUDE_GNU */ diff --git a/Source/objects/LinkedListEltNode.h b/Source/objects/LinkedListEltNode.h deleted file mode 100644 index d2d0a153e..000000000 --- a/Source/objects/LinkedListEltNode.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Interface for Objective-C LinkedListEltNode object - Copyright (C) 1993,1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __LinkedListEltNode_h_INCLUDE_GNU -#define __LinkedListEltNode_h_INCLUDE_GNU - -#include -#include -#include - -@interface LinkedListEltNode : LinkedListNode -#include -@end - -#endif /* __LinkedListEltNode_h_INCLUDE_GNU */ diff --git a/Source/objects/LinkedListNode.h b/Source/objects/LinkedListNode.h deleted file mode 100644 index c2b9af08a..000000000 --- a/Source/objects/LinkedListNode.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Interface for Objective-C LinkedListNode object - Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: May 1993 - - This file is part of the GNU Objective C Class 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 __LinkedListNode_h_INCLUDE_GNU -#define __LinkedListNode_h_INCLUDE_GNU - -#include -#include -#include - -@interface LinkedListNode : NSObject -{ - id _next; - id _prev; - id _linked_list; -} -@end - -#endif /* __LinkedListNode_h_INCLUDE_GNU */ diff --git a/Source/objects/Lock.h b/Source/objects/Lock.h deleted file mode 100644 index df4390dd9..000000000 --- a/Source/objects/Lock.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Interface for GNU Objective-C mutex lock - Copyright (C) 1993,1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: July 1994 - - This file is part of the GNU Objective C Class 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 __Lock_h_OBJECTS_INCLUDE -#define __Lock_h_OBJECTS_INCLUDE - -#include -#include - -@interface Lock : NSObject -{ -} -@end - -#endif /* __Lock_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/Locking.h b/Source/objects/Locking.h deleted file mode 100644 index 4dfab0714..000000000 --- a/Source/objects/Locking.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Protocol for GNU Objective-C mutex locks - Copyright (C) 1993,1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: July 1994 - - This file is part of the GNU Objective C Class 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 __Locking_h_INCLUDE_GNU -#define __Locking_h_INCLUDE_GNU - -#include -#include - -@protocol Locking -- (void) lock; -- (void) unlock; -@end - -#endif /* __Locking_h_INCLUDE_GNU */ diff --git a/Source/objects/MachPort.h b/Source/objects/MachPort.h deleted file mode 100644 index b5bceb98d..000000000 --- a/Source/objects/MachPort.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Interface for Mach-port based object for use with Connection - Copyright (C) 1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: July 1994 - - This file is part of the GNU Objective C Class 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 __MachPort_h_INCLUDE_GNU -#define __MachPort_h_INCLUDE_GNU - -#if __mach__ - -#include -#include - -@interface MachInPort : InPort -@end - -@interface MachOutPort : OutPort -@end - -#endif /* __mach__ */ - -#endif /* __MachPort_h_INCLUDE_GNU */ diff --git a/Source/objects/Magnitude.h b/Source/objects/Magnitude.h deleted file mode 100644 index 9c2980f42..000000000 --- a/Source/objects/Magnitude.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Interface for Objective-C Magnitude object - Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: May 1993 - - This file is part of the GNU Objective C Class 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 __Magnitude_h_INCLUDE_GNU -#define __Magnitude_h_INCLUDE_GNU - -#include -#include - -@interface Magnitude : NSObject - -@end - -#endif /* __Magnitude_h_INCLUDE_GNU */ diff --git a/Source/objects/MallocAddress.h b/Source/objects/MallocAddress.h deleted file mode 100644 index 13a5ad730..000000000 --- a/Source/objects/MallocAddress.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Provides autoreleasing of malloc'ed pointers - Copyright (C) 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: January 1995 - - This file is part of the GNU Objective C Class 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 __MallocAddress_h_OBJECTS_INCLUDE -#define __MallocAddress_h_OBJECTS_INCLUDE - -#include - -@interface MallocAddress : NSObject -{ - void *address; -} - -+ autoreleaseMallocAddress: (void*)addr; -+ objectForAddress: (void*)addr; - -- initWithAddress: (void*)addr; -- (void) dealloc; - -@end - -#endif /* __MallocAddress_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/MappedCollector.h b/Source/objects/MappedCollector.h deleted file mode 100644 index 1c7420aac..000000000 --- a/Source/objects/MappedCollector.h +++ /dev/null @@ -1,41 +0,0 @@ -/* Interface for Objective-C MappedCollector collection object - Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __MappedCollector_h_INCLUDE_GNU -#define __MappedCollector_h_INCLUDE_GNU - -#include -#include - -@interface MappedCollector : KeyedCollection -{ - id _map; - id _domain; -} - -- initWithCollection: (id )aDomain - map: (id )aMap; - -@end - -#endif /* __MappedCollector_h_INCLUDE_GNU */ diff --git a/Source/objects/MemoryStream.h b/Source/objects/MemoryStream.h deleted file mode 100644 index 383fad9f8..000000000 --- a/Source/objects/MemoryStream.h +++ /dev/null @@ -1,72 +0,0 @@ -/* Interface for GNU Objective C memory stream - Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: July 1994 - - This file is part of the GNU Objective C Class 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 __MemoryStream_h_OBJECTS_INCLUDE -#define __MemoryStream_h_OBJECTS_INCLUDE - -#include -#include -#include - -/* This protocol is preliminary and may change. - This also may get pulled out into a separate .h file. */ - -@protocol MemoryStreaming - -- initWithCapacity: (unsigned)capacity; - -- (void) setStreamBufferCapacity: (unsigned)s; - -- (char*) streamBuffer; -- (unsigned) streamBufferCapacity; -- (unsigned) streamEofPosition; - -@end - -@interface MemoryStream : Stream -{ - int type; - char *buffer; - int size; - int eofPosition; - int prefix; - int position; -} - -- initWithCapacity: (unsigned)capacity - prefix: (unsigned)prefix; - -- initWithSize: (unsigned)s; /* For backwards compatibility, depricated */ - -- (unsigned) streamBufferPrefix; -- (unsigned) streamBufferLength; /* prefix + eofPosition */ - -/* xxx This interface will change */ -- _initOnMallocBuffer: (char*)b - size: (unsigned)s /* size of malloc'ed buffer */ - eofPosition: (unsigned)l /* length of buffer with data for reading */ - prefix: (unsigned)p /* reset for this position */ - position: (unsigned)i; /* current position for reading/writing */ -@end - -#endif /* __MemoryStream_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/Notification.h b/Source/objects/Notification.h deleted file mode 100644 index 1c8485dfe..000000000 --- a/Source/objects/Notification.h +++ /dev/null @@ -1,58 +0,0 @@ -/* Interface for holding and dispatching notifications - Copyright (C) 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: March 1996 - - This file is part of the GNU Objective C Class 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 __Notification_h_OBJECTS_INCLUDE -#define __Notification_h_OBJECTS_INCLUDE - -#include -#include -#include -#include - -@protocol Notifying -- (id ) name; -- object; -- userInfo; -@end - -@protocol NotificationPosting -- (void) postNotification: (id )notification; -@end - -@interface Notification : NSObject -{ - id _name; - id _object; - id _info; -} - -+ notificationWithName: (id )name - object: object; - -+ notificationWithName: (id )name - object: object - userInfo: info; - -@end - -#endif /* __Notification_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/NotificationDispatcher.h b/Source/objects/NotificationDispatcher.h deleted file mode 100644 index afab0aad0..000000000 --- a/Source/objects/NotificationDispatcher.h +++ /dev/null @@ -1,218 +0,0 @@ -/* Interface to object for broadcasting Notification objects - Copyright (C) 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: March 1996 - - This file is part of the GNU Objective C Class 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 __NotificationDispatcher_h_OBJECTS_INCLUDE -#define __NotificationDispatcher_h_OBJECTS_INCLUDE - -/* A class for posting notifications to observer objects that request - them. - - This implementation has several advantages over OpenStep's - NSNotificationCenter: - - (1) Heavy use of hash tables and the use of LinkedList's make it - faster. Removing from the middle of LinkedList's is much more - efficient than removing from the middle of Array's. - - (2) The way in which notifications are dispatched can be specified as - invocation objects instead of just selectors. Invocation objects - are more flexible than selectors in that they can hold more context - and, if desired, can call C functions instead of sending a message - to an object; (this way you may be able to avoid creating a new - class just to handle certain notifications). - - (3) Instead of sending +defaultCenter, you can simply send +add..., - +remove... and +post... messages directly to the class object. - The class uses a static variable directly, instead of taking - the time for the extra +defaultCenter method call. It's both - easier for the user and more time efficient. - - (4) You can call -addObserver:... with both name and object being - nil. This request will receive postings of *all* notifications. - Wow. - - Although it offers extra features, the implementation has an - OpenStep-style interface also. - - */ - -#include -#include -#include -#include -#include - -@interface NotificationDispatcher : NSObject -{ - /* `nr' stands for Notification Request Object; the interface for - this class is defined in the .m file. One of these is created - for each -add... call. */ - - /* For those observer requests with NAME=nil and OBJECT=nil. */ - LinkedList *_anonymous_nr_list; - /* For those observer requests with NAME=nil and OBJECT!=nil. */ - NSMapTable *_object_2_nr_list; - /* For those observer requests with NAME!=nil, OBJECT may or may not =nil .*/ - NSMapTable *_name_2_nr_list; - - /* The keys are observers; the values are Array's containing all - NotificationInvocation objects associated with the observer key. */ - NSMapTable *_observer_2_nr_array; -} - - -/* Adding new observers. */ - -/* Register INVOCATION to receive future notifictions that match NAME - and OBJECT. A nil passed as either NAME or OBJECT acts as a - wild-card. If NAME is nil, the NotificationDispatcher will send to - the observer all notification pertaining to OBJECT. If OBJECT is - nil, the NotificationDispatcher will send to the observer all - notification pertaining to NAME. If both OBJECT and NAME are nil, - send to the observer all notifications. - - The notification will be posted by sending -invokeWithObject: to - INVOCATION argument. The argument of -invokeWithObject: will be a - Notification object. This use of Invocation objects is more - flexible than using a selector, since Invocation's can be set up - with more arguments, hold more context, and can be C functions. - - OBJECT is not retained; this is done so these objects can tell when - there are no outstanding non-notification references remaining. If - an object may have added itself as an observer, it should call - +removeObserver: in its -dealloc method. - - INVOCATION and NAME, however, are retained. */ - -- (void) addInvocation: (id )invocation - name: (id )name - object: object; - -/* Register OBSERVER to receive future notifications that match NAME - and OBJECT. A nil passed as either NAME or OBJECT acts as a - wild-card. If NAME is nil, the NotificationDispatcher will send to - the observer all notification pertaining to OBJECT. If OBJECT is - nil, the NotificationDispatcher will send to the observer all - notification pertaining to NAME. If both OBJECT and NAME are nil, - send to the observer all notifications. - - The notification will be posted by sending -perform:withObject: - to the observer, with SEL and a Notification object as arguments. - - Neither OBSERVER nor OBJECT are retained; this is done so these - objects can tell when there are no outstanding non-notification - references remaining. If an object may have added itself as an - observer, it should call +removeObserver: in its -dealloc method. - - INVOCATION and NAME, however, are retained. */ - -- (void) addObserver: observer - selector: (SEL)sel - name: (id )name - object: object; - -/* Class versions of the above two methods that send these messages - to the default NotificationDispatcher for the class. */ - -+ (void) addInvocation: (id )invocation - name: (id )name - object: object; -+ (void) addObserver: observer - selector: (SEL)sel - name: (id )name - object: object; - - - -/* Removing observers. */ - -/* Remove all notification requests that would be sent to INVOCATION. */ - -- (void) removeInvocation: invocation; - -/* Remove the notification requests matching NAME and OBJECT that - would be sent to INVOCATION. As with adding an observation - request, nil NAME or OBJECT act as wildcards. */ - -- (void) removeInvocation: invocation - name: (id )name - object: object; - -/* Remove all records pertaining to OBSERVER. For instance, this - should be called before the OBSERVER is -dealloc'ed. */ - -- (void) removeObserver: observer; - -/* Remove the notification requests for the given NAME and OBJECT - parameters. As with adding an observation request, nil NAME or - OBJECT act as wildcards. */ - -- (void) removeObserver: observer - name: (id )name - object: object; - -/* Class versions of the above four methods that send these messages - to the default NotificationDispatcher for the class. */ - -+ (void) removeInvocation: invocation; -+ (void) removeInvocation: invocation - name: (id )name - object: object; -+ (void) removeObserver: observer; -+ (void) removeObserver: observer - name: (id )name - object: object; - - - -/* Post NOTIFICATION to all the observers that match its NAME and OBJECT. - The INFO arguent does not have to be a Dictionary. If there is a single - object that should be associated with the notification, you can simply - pass that single object instead of a Dictionary containing the object. */ - -- (void) postNotification: notification; -- (void) postNotificationName: (id )name - object: object; -- (void) postNotificationName: (id )name - object: object - userInfo: info; - -/* Class versions of the above three methods that send these messages - to the default NotificationDispatcher for the class. */ - -+ (void) postNotification: notification; -+ (void) postNotificationName: (id )name - object: object; -+ (void) postNotificationName: (id )name - object: object - userInfo: info; - -+ defaultInstance; - -@end - -@interface NotificationDispatcher (OpenStepCompat) -+ defaultCenter; -@end - -#endif /* __NotificationDispatcher_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/OrderedCollecting.h b/Source/objects/OrderedCollecting.h deleted file mode 100644 index 972daefc6..000000000 --- a/Source/objects/OrderedCollecting.h +++ /dev/null @@ -1,66 +0,0 @@ -/* Protocol for Objective-C objects that hold elements, user gets to set order - Copyright (C) 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: Feb 1996 - - This file is part of the GNU Objective C Class 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. -*/ - -/* The protocol inherits from the - protocol. - - The protocol defines the interface to a - collection of elements that are accessible by a key that is an index, - where the indeces in a collection are a contiguous series of unsigned - integers beginning at 0. This is the root of the protocol heirarchy - for all collections that hold their elements in some order. Elements - may be accessed, inserted, replaced and removed by their index. -*/ - -#ifndef __OrderedCollecting_h_OBJECTS_INCLUDE -#define __OrderedCollecting_h_OBJECTS_INCLUDE - -#include -#include - -@protocol OrderedCollecting - -// ADDING; -- (void) insertObject: newObject atIndex: (unsigned)index; -- (void) insertObject: newObject before: oldObject; -- (void) insertObject: newObject after: oldObject; -- (void) insertContentsOf: (id )aCollection - atIndex: (unsigned)index; -- (void) appendObject: newObject; -- (void) prependObject: newObject; -- (void) appendContentsOf: (id )aCollection; -- (void) prependContentsOf: (id )aCollection; - -// SWAPPING AND SORTING -- (void) swapAtIndeces: (unsigned)index1 : (unsigned)index2; -- (void) sortContents; - -// REPLACING; -- (void) replaceRange: (IndexRange)aRange - with: (id )aCollection; -- replaceRange: (IndexRange)aRange - using: (id )aCollection; - -@end - -#endif /* __OrderedCollecting_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/OrderedCollection.h b/Source/objects/OrderedCollection.h deleted file mode 100644 index 7913359e8..000000000 --- a/Source/objects/OrderedCollection.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Interface for Objective-C Ordered Collection object. - Copyright (C) 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: February 1996 - - This file is part of the GNU Objective C Class 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 __OrderedCollection_h_INCLUDE_GNU -#define __OrderedCollection_h_INCLUDE_GNU - -#include -#include -#include - -@interface OrderedCollection : IndexedCollection -@end - - -/* Put this on category instead of class to avoid bogus complaint from gcc */ -@interface OrderedCollection (Protocol) -@end - -#endif /* __OrderedCollection_h_INCLUDE_GNU */ diff --git a/Source/objects/Ordering.h b/Source/objects/Ordering.h deleted file mode 100644 index ed34bf333..000000000 --- a/Source/objects/Ordering.h +++ /dev/null @@ -1,47 +0,0 @@ -/* Protocol for Objective-C objects that can be ordered. - Copyright (C) 1993,1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __Ordering_h_INCLUDE_GNU -#define __Ordering_h_INCLUDE_GNU - -#include -#include - -@protocol Ordering - -- (int) compare: anObject; - -- (BOOL) greaterThan: anObject; -- (BOOL) greaterThanOrEqual: anObject; - -- (BOOL) lessThan: anObject; -- (BOOL) lessThanOrEqual: anObject; - -- (BOOL) between: firstObject and: secondObject; - -- maximum: anObject; -- minimum: anObject; - -@end - -#endif /* __Ordering_h_INCLUDE_GNU */ diff --git a/Source/objects/Port.h b/Source/objects/Port.h deleted file mode 100644 index d1a3fdf06..000000000 --- a/Source/objects/Port.h +++ /dev/null @@ -1,125 +0,0 @@ -/* Interface for abstract superclass port for use with Connection - Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: July 1994 - - This file is part of the GNU Objective C Class 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 __Port_h_OBJECTS_INCLUDE -#define __Port_h_OBJECTS_INCLUDE - -#include -#include -#include -#include - -/* xxx Use something like this? */ -@protocol PacketSending -@end - -@interface Port : NSObject -{ - unsigned is_valid:1; - unsigned tcp_port_filler:7; - unsigned retain_count:24; -} -- (void) invalidate; -- (BOOL) isValid; -- (void) close; - -+ (Class) outPacketClass; -- (Class) outPacketClass; - -@end - - -@interface InPort : Port -{ - id _packet_invocation; -} - -+ newForReceiving; -+ newForReceivingFromRegisteredName: (id )name; - -/* Register/Unregister this port for input handling through RunLoop - RUN_LOOP in mode MODE. */ -- (void) addToRunLoop: run_loop forMode: (id )mode; -- (void) removeFromRunLoop: run_loop forMode: (id )mode; - -/* When a RunLoop is handling this InPort, and a new incoming - packet arrives, INVOCATION will be invoked with the new packet - as an argument. The INVOCATION is responsible for releasing - the packet. */ -- (void) setReceivedPacketInvocation: (id )invocation; - -/* An alternative to the above way for receiving packets from this port. - Get a packet from the net and return it. If no packet is received - within MILLISECONDS, then return nil. The caller is responsible - for releasing the packet. */ -- receivePacketWithTimeout: (int)milliseconds; - -@end - - -@interface OutPort : Port - -+ newForSendingToRegisteredName: (id )name - onHost: (id )hostname; -- (BOOL) sendPacket: packet; - -@end - -extern NSString *PortBecameInvalidNotification; - - - -/* Objects for holding incoming/outgoing data to/from ports. */ - -@interface InPacket : MemoryStream -{ - id _receiving_in_port; - id _reply_out_port; -} - -- replyOutPort; -- receivingInPort; - -/* Do not call this method yourself; it is to be called by subclassers. - InPackets are created for you by the InPort object, and are - made available as the argument to the received packet invocation. */ -- initForReceivingWithCapacity: (unsigned)s - receivingInPort: ip - replyOutPort: op; - -@end - -@interface OutPacket : MemoryStream -{ - id _reply_in_port; -} - -- initForSendingWithCapacity: (unsigned)c - replyInPort: p; -- replyInPort; - -+ (unsigned) prefixSize; - -@end - -#endif /* __Port_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/Proxy.h b/Source/objects/Proxy.h deleted file mode 100644 index f826ef98b..000000000 --- a/Source/objects/Proxy.h +++ /dev/null @@ -1,82 +0,0 @@ -/* Interface for GNU Objective-C proxy for remote objects messaging - Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: July 1994 - - This file is part of the GNU Objective C Class 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 __Proxy_h_OBJECTS_INCLUDE -#define __Proxy_h_OBJECTS_INCLUDE - -#include -#include -#include - -@class ConnectedCoder; - -@interface Proxy -{ -@public - struct objc_class *isa; - unsigned _target; - Connection *_connection; - unsigned _retain_count; -#if NeXT_runtime - coll_cache_ptr _method_types; - Protocol *protocol; -#endif -} - -/* xxx Change name to newForTarget:connection: */ -+ newForRemoteTarget: (unsigned)target connection: (Connection*)c; - -- self; -#if NeXT_runtime -+ class; -#else -+ (Class) class; -#endif - -- (void) invalidateProxy; -- (BOOL) isProxy; -- (unsigned) targetForProxy; -- connectionForProxy; - -- forward: (SEL)aSel :(arglist_t)frame; - -- classForConnectedCoder: aRmc; -+ (void) encodeObject: anObject withConnectedCoder: aRmc; - -+ newWithCoder: aCoder; -- (void) encodeWithCoder: aCoder; - -/* Only needed with NeXT runtime. */ -- (const char *) selectorTypeForProxy: (SEL)selector; - -@end - -@interface Object (IsProxy) -- (BOOL) isProxy; -@end - -@interface Protocol (RemoteSelfCoding) -- classForConnectedCoder: aRmc; -@end - -#endif /* __Proxy_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/Queue.h b/Source/objects/Queue.h deleted file mode 100644 index 2ef5a868b..000000000 --- a/Source/objects/Queue.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Interface for Objective-C Queue object - Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: May 1993 - - This file is part of the GNU Objective C Class 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 __Queue_h_INCLUDE_GNU -#define __Queue_h_INCLUDE_GNU - -#include -#include - -@interface Queue : CircularArray - -- (void) enqueueObject: newObject; -- dequeueObject; - -@end - -#endif /* __Queue_h_INCLUDE_GNU */ diff --git a/Source/objects/RBTree.h b/Source/objects/RBTree.h deleted file mode 100644 index 7725baaee..000000000 --- a/Source/objects/RBTree.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Interface for Objective-C Red-Black Tree collection object - Copyright (C) 1993,1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __RBTree_h_INCLUDE_GNU -#define __RBTree_h_INCLUDE_GNU - -#include -#include - -@protocol RBTreeComprising -- (BOOL) isRed; -- setRed; -- setBlack; -@end - -@interface RBTree : BinaryTree - -@end - -#endif /* __RBTree_h_INCLUDE_GNU */ diff --git a/Source/objects/RBTreeEltNode.h b/Source/objects/RBTreeEltNode.h deleted file mode 100644 index 0606a6f71..000000000 --- a/Source/objects/RBTreeEltNode.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Interface for Objective-C RBTreeEltNode object - Copyright (C) 1993,1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __RBTreeEltNode_h_INCLUDE_GNU -#define __RBTreeEltNode_h_INCLUDE_GNU - -#include -#include -#include - -@interface RBTreeEltNode : RBTreeNode -#include -@end - -#endif /* __RBTreeEltNode_h_INCLUDE_GNU */ diff --git a/Source/objects/RBTreeNode.h b/Source/objects/RBTreeNode.h deleted file mode 100644 index e2eb4d6d7..000000000 --- a/Source/objects/RBTreeNode.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Interface for Objective-C RBTreeNode object - Copyright (C) 1993,1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __RBTreeNode_h_INCLUDE_GNU -#define __RBTreeNode_h_INCLUDE_GNU - -#include -#include -#include - -@interface RBTreeNode : BinaryTreeNode -{ - BOOL _red; -} -@end - -#endif /* __RBTreeNode_h_INCLUDE_GNU */ diff --git a/Source/objects/README b/Source/objects/README deleted file mode 100644 index 6f3524f50..000000000 --- a/Source/objects/README +++ /dev/null @@ -1,8 +0,0 @@ -This directory contains header files for the GNU Objective C Class -Library, `libobjects'. - -The complete list of include file directories belonging to libobjects -is: - ../objects - ../objc - ../Foundation diff --git a/Source/objects/RNGAdditiveCongruential.h b/Source/objects/RNGAdditiveCongruential.h deleted file mode 100644 index 26d5f2ee8..000000000 --- a/Source/objects/RNGAdditiveCongruential.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Interface for additive congruential pseudo-random num generating - Copyright (C) 1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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. -*/ - -/* Additive Congruential Method, - from Robert Sedgewick, "Algorithms" */ - -#ifndef __RNGAdditiveCongruential_h_INCLUDE_GNU -#define __RNGAdditiveCongruential_h_INCLUDE_GNU - -#include -#include - -@interface RNGAdditiveCongruential : NSObject -{ - long *table; - int table_size; - int tap1; - int tap2; - int index; -} - -@end - -#endif /* __RNGAdditiveCongruential_h_INCLUDE_GNU */ diff --git a/Source/objects/RNGBerkeley.h b/Source/objects/RNGBerkeley.h deleted file mode 100644 index 851db2211..000000000 --- a/Source/objects/RNGBerkeley.h +++ /dev/null @@ -1,74 +0,0 @@ -/* Interface for Berkeley random()-compatible generation for Objective-C - - Reworked by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __RNGBerkeley_h_INCLUDE_GNU -#define __RNGBerkeley_h_INCLUDE_GNU - -/* - * Copyright (c) 1983 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* - * This is derived from the Berkeley source: - * @(#)random.c 5.5 (Berkeley) 7/6/88 - * It was reworked for the GNU C Library by Roland McGrath. - * It was reworked for the GNU Objective-C Library by R. Andrew McCallum - */ - -#include -#include - -@interface RNGBerkeley : NSObject -{ - int foo[2]; - long int randtbl[32]; /* Size must match DEG_3 + 1 from RNGBerkeley.m */ - long int *fptr; - long int *rptr; - long int *state; - int rand_type; - int rand_deg; - int rand_sep; - long int *end_ptr; -} - -- (void) _srandom: (unsigned int)x; -- (void*) _initstateSeed: (unsigned int)seed - state: (void*)arg_state - size: (size_t)n; -- (void*) _setstate: (void*)arg_state; - -@end - -#endif /* __RNGBerkeley_h_INCLUDE_GNU */ diff --git a/Source/objects/Random.h b/Source/objects/Random.h deleted file mode 100644 index 1e6e71262..000000000 --- a/Source/objects/Random.h +++ /dev/null @@ -1,69 +0,0 @@ -/* Interface for Objective-C object providing randoms in uniform distribution - Copyright (C) 1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __Random_h_INCLUDE_GNU -#define __Random_h_INCLUDE_GNU - -#include -#include - -@interface Random : NSObject -{ - id rng; -} - -+ initialize; -+ (id ) defaultRandomGeneratorClass; -+ setDefaultRandomGeneratorClass: (id )aRNG; - -+ (float) chiSquareOfRandomGenerator: (id )aRNG - iterations: (int)n - range: (long)r; -+ (float) chiSquareOfRandomGenerator: (id )aRNG; - -- init; - -- setRandomSeedFromClock; -- setRandomSeed: (long)seed; - -- (long) randomInt; -- (long) randomIntBetween: (long)lowBound and: (long)highBound; -- (long) randomDie: (long)numSides; /* between 0 and numSides-1 */ - -- (BOOL) randomCoin; -- (BOOL) randomCoinWithProbability: (double)p; - -- (float) randomFloat; -- (float) randomFloatBetween: (float)lowBound and: (float)highBound; -- (float) randomFloatProbability; - -- (double) randomDouble; -- (double) randomDoubleBetween: (double)lowBound and: (double)highBound; -- (double) randomDoubleProbability; - -- read: (TypedStream*)aStream; -- write: (TypedStream*)aStream; - -@end - -#endif /* __Random_h_INCLUDE_GNU */ diff --git a/Source/objects/RandomGenerating.h b/Source/objects/RandomGenerating.h deleted file mode 100644 index d739f45c5..000000000 --- a/Source/objects/RandomGenerating.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Protocol for Objective-C objects that generate random bits - Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: May 1993 - - This file is part of the GNU Objective C Class 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 __RandomGenerating_h_INCLUDE_GNU -#define __RandomGenerating_h_INCLUDE_GNU - -#include - -@protocol RandomGenerating - -- (void) setRandomSeed: (long)seed; -- (long) nextRandom; - -@end - -#endif /* __RandomGenerating_h_INCLUDE_GNU */ diff --git a/Source/objects/RawCStream.h b/Source/objects/RawCStream.h deleted file mode 100644 index dedf320a9..000000000 --- a/Source/objects/RawCStream.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Interface for GNU Objective-C raw stream object for archiving - Copyright (C) 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Written: Jan 1996 - - This file is part of the GNU Objective C Class 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 __RawCStream_h_OBJECTS_INCLUDE -#define __RawCStream_h_OBJECTS_INCLUDE - -#include -#include -#include - -@interface RawCStream : CStream - -+ setDebugging: (BOOL)f; - -@end - -#endif /* __RawCStream_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/Retaining.h b/Source/objects/Retaining.h deleted file mode 100644 index 30b1f9d9d..000000000 --- a/Source/objects/Retaining.h +++ /dev/null @@ -1,100 +0,0 @@ -/* Protocol for GNU Objective-C objects that can keep a retain count. - Copyright (C) 1993,1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: July 1994 - - This file is part of the GNU Objective C Class 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 __Retaining_h_OBJECTS_INCLUDE -#define __Retaining_h_OBJECTS_INCLUDE - -#include - -@protocol Retaining - -- retain; - -/* Use this message when the sender did not allocate the receiving - object, but the sender wants to keep a reference to the receiving - object. It increments a reference count for the object. The - object will not be deallocated until after a matching release - message is sent to this object. - - IMPORTANT PROGRAMMING CONVENTION: There is no need to send this - message to objects that the sender allocated---allocating an object - already implies that the object will not be deallocated until the - sender releases it. Just as "retain" and "release" messages cancel - each other, one "release" message is needed to cancel the original - allocation. */ - - -- (oneway void) release; - -/* Use this message when the sender is done with the receiving object. - If the sender had the last reference to the object, the object will - be deallocated by sending "dealloc" to it. - - IMPORTANT PROGRAMMING CONVENTION: The sender should only send this - to objects that it has allocated or has retain'ed. */ - - -- (void) dealloc; - -/* This method deallocates the memory for this object. You should not - send this message yourself; it is sent for you by the release - method, which properly manages retain counts. Do, however, - override this method to deallocate any memory allocated by this - object during initialization; the overriding method should call - [super dealloc] at the end. */ - - -- (unsigned) retainCount; - -/* This method returns the retain count to this object. It does - not, however, include the decrements due to stackRelease's. Note - that the returned number is not quite a "reference count" in the - traditional sense; it is less by one in that it is actually a count - of the number of unreleased retain messages sent. A retainCount of - zero implies that there is still one more release necessary to - deallocate the receiver. For example, after an object is created, - its retainCount is zero, but another "release" message is still - required before the object will be deallocated. */ - - -- autorelease; - -/* Use this message when the sender is done with this object, but the - sender doesn't want the object to be deallocated immediately - because the function that sends this message will use this object - as its return value. The object will be queued to receive the - actual "release" message later. - - Due to this delayed release, the function that receives the object - as a return value will have the opportunity to retain the object - before the "release" instigated by the "autorelease" actually - takes place. - - For the object to be autoreleased, you must have previously created - a AutoreleasePool or an AutoreleaseStack. If you don't, however, - your program won't crash, the release corresponding to the - autorelease will just never happen. */ - -@end - -#endif /* __Retaining_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/RetainingNotifier.h b/Source/objects/RetainingNotifier.h deleted file mode 100644 index 0a8d2576c..000000000 --- a/Source/objects/RetainingNotifier.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Interface for reference-counted invalidation notifer object - Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: July 1994 - - This file is part of the GNU Objective C Class 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. - */ - -/* Reference Counted object with invalidation notification - This object is just temporary. Eventually, we should separate - reference counting functionality from notification functionality */ - -/* xxx March 1995: Now that we have a root object that handles retaining, - we should create a plain Notifier class. */ - -#ifndef __RetainingNotifier_h -#define __RetainingNotifier_h - -#include -#include -#include -#include - -@interface RetainingNotifier : NSObject -{ - Lock *refGate; - id *notificationList; - BOOL isValid; - int retain_count; -} - -- init; -- (unsigned) retainCount; -- registerForInvalidationNotification: (id )anObject; -- unregisterForInvalidationNotification: (id )anObject; -- (BOOL) isValid; -- invalidate; -- copy; - -@end - -#endif /* __RetainingNotifier_h */ diff --git a/Source/objects/RunLoop.h b/Source/objects/RunLoop.h deleted file mode 100644 index cb61d0f36..000000000 --- a/Source/objects/RunLoop.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __RunLoop_h_OBJECTS_INCLUDE -#define __RunLoop_h_OBJECTS_INCLUDE - -#include -#include -#include -#include -#include - -@interface RunLoop : NSObject -{ - id _current_mode; - NSMapTable *_mode_2_timers; - NSMapTable *_mode_2_in_ports; - NSMapTable *_mode_2_fd_listeners; -} - -- (void) addPort: port - forMode: (id )mode; -- (void) removePort: port - forMode: (id )mode; - -- (void) addTimer: timer forMode: (id )mode; - -- limitDateForMode: (id )mode; -- (void) acceptInputForMode: (id )mode - beforeDate: date; -- (id ) currentMode; - -- (void) run; -- (void) runUntilDate: limit_date; -- (BOOL) runOnceBeforeDate: date; -- (BOOL) runOnceBeforeDate: date forMode: (id )mode; - -+ (void) run; -+ (void) runUntilDate: date; -+ (void) runUntilDate: date forMode: (id )mode; -+ (BOOL) runOnceBeforeDate: date; -+ (BOOL) runOnceBeforeDate: date forMode: (id )mode; - -+ currentInstance; -+ (id ) currentMode; - -@end - -/* Mode strings. */ -extern id RunLoopDefaultMode; - -/* xxx This interface will probably change. */ -@protocol FdListening -- (void) readyForReadingOnFileDescriptor: (int)fd; -@end - -/* xxx This interface will probably change. */ -@interface NSObject (OptionalPortRunLoop) -/* If a InPort object responds to this, it is sent just before we are - about to wait listening for input. - This interface will probably change. */ -- (void) getFds: (int*)fds count: (int*)count; -@end - -#endif /* __RunLoop_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/Set.h b/Source/objects/Set.h deleted file mode 100644 index b433d5936..000000000 --- a/Source/objects/Set.h +++ /dev/null @@ -1,53 +0,0 @@ -/* Interface for Objective-C Set collection object - Copyright (C) 1993,1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __Set_h_OBJECTS_INCLUDE -#define __Set_h_OBJECTS_INCLUDE - -#include -#include -#include - -@interface Set : Collection -{ - NSHashTable *_contents_hash; // a hashtable to hold the contents; -} - -// MANAGING CAPACITY; -+ (unsigned) defaultCapacity; - -// INITIALIZING AND FREEING; -- initWithCapacity: (unsigned)aCapacity; - -// SET OPERATIONS; -- (void) intersectWithCollection: (id )aCollection; -- (void) unionWithCollection: (id )aCollection; -- (void) differenceWithCollection: (id )aCollection; - -- shallowCopyIntersectWithCollection: (id )aCollection; -- shallowCopyUnionWithCollection: (id )aCollection; -- shallowCopyDifferenceWithCollection: (id )aCollection; - -@end - -#endif /* __Set_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/SmallInt.h b/Source/objects/SmallInt.h deleted file mode 100644 index d092af468..000000000 --- a/Source/objects/SmallInt.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Interface for Objective-C efficient small integers - Copyright (C) 1993,1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: Sep 1995 - - This file is part of the GNU Objective C Class 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 __SmallInt_h_INCLUDE_GNU -#define __SmallInt_h_INCLUDE_GNU - -#include - -#define IS_SMALLINT(OBJ) (((void*)OBJ) & 0x1) -#define ID2INT(OBJ) ((IS_SMALLINT(OBJ)) ? (((int)OBJ) >> 1):[OBJ intValue]) -#define INT2ID(I) ((id)((I << 1) & 0x1)) - -@interface SmallInt : NSObject - -- - -@end - -#endif /* __SmallInt_h_INCLUDE_GNU */ diff --git a/Source/objects/SocketPort.h b/Source/objects/SocketPort.h deleted file mode 100644 index 496be443c..000000000 --- a/Source/objects/SocketPort.h +++ /dev/null @@ -1,60 +0,0 @@ -/* Interface for socket-based port object for use with Connection - Copyright (C) 1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: July 1994 - - This file is part of the GNU Objective C Class 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 __SocketPort_h_INCLUDE_GNU -#define __SocketPort_h_INCLUDE_GNU - -#include -#include - -#include - -#ifndef WIN32 -# include -# include -#endif /* !WIN32 */ - -typedef struct sockaddr_in sockport_t; - -@interface SocketPort : Port -{ - sockport_t sockPort; - int sock; /* socket if local, 0 if remote */ - BOOL close_on_dealloc; -} - - -+ newForSockPort: (sockport_t)s close: (BOOL)f; -+ newForSockPort: (sockport_t)s; -+ newLocalWithNumber: (int)n; -+ newLocal; -+ newRemoteWithNumber: (int)n onHost: (id )h; - -- (sockport_t) sockPort; - -- (int) socket; -- (int) socketPortNumber; - -@end - -#endif /* __SocketPort_h_INCLUDE_GNU */ diff --git a/Source/objects/SplayTree.h b/Source/objects/SplayTree.h deleted file mode 100644 index 779afb1af..000000000 --- a/Source/objects/SplayTree.h +++ /dev/null @@ -1,48 +0,0 @@ -/* Interface for Objective-C SplayTree collection object - Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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. -*/ - -/* - Splay Tree. - Sleator and Tarjan. "Self-adjusting binary search trees." - Journal of the ACM, 32(3):652-686, 1985. - - includesObject:, minObject, maxObject, nextObject:, sortAddObject, - and removeObject: operations can all be done in O(lg n) amortized time. -*/ - - -#ifndef __SplayTree_h_INCLUDE_GNU -#define __SplayTree_h_INCLUDE_GNU - -#include -#include - -@interface SplayTree : BinaryTree -{ -} - -- (void) splayNode: aNode; - -@end - -#endif /* __SplayTree_h_INCLUDE_GNU */ diff --git a/Source/objects/Stack.h b/Source/objects/Stack.h deleted file mode 100644 index 2932f9a48..000000000 --- a/Source/objects/Stack.h +++ /dev/null @@ -1,41 +0,0 @@ -/* Interface for Objective-C Stack object - Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: May 1993 - - This file is part of the GNU Objective C Class 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 __Stack_h_INCLUDE_GNU -#define __Stack_h_INCLUDE_GNU - -#include -#include - -@interface Stack : Array - -- (void) pushObject: anObject; -- popObject; -- topObject; -- (void) duplicateTop; -- (void) exchangeTop; - -@end - -#endif /* __Stack_h_INCLUDE_GNU */ - diff --git a/Source/objects/StdioStream.h b/Source/objects/StdioStream.h deleted file mode 100644 index a3b5f28e0..000000000 --- a/Source/objects/StdioStream.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Interface for GNU Objective C stdio stream - Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: July 1994 - - This file is part of the GNU Objective C Class 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 __StdioStream_h__OBJECTS_INCLUDE -#define __StdioStream_h__OBJECTS_INCLUDE - -#include -#include -#include - -@interface StdioStream : Stream -{ - int mode; - FILE *fp; -} - -+ standardIn; -+ standardOut; -+ standardError; - -+ streamWithFilename: (id )name fmode: (const char *)m; -/* xxx Add the others too. */ - -- initWithFilePointer: (FILE*)afp fmode: (const char *)m; -- initWithFilename: (id )name fmode: (const char *)m; -- initWithFileDescriptor: (int)fd fmode: (const char *)m; - -- initWithPipeTo: (id )systemCommand; -- initWithPipeFrom: (id )systemCommand; - -@end - -#endif /* __StdioStream_h__OBJECTS_INCLUDE */ - diff --git a/Source/objects/Stream.h b/Source/objects/Stream.h deleted file mode 100644 index ff58dfbd1..000000000 --- a/Source/objects/Stream.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Interface for GNU Objective C byte stream - Copyright (C) 1994, 1995 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: July 1994 - - This file is part of the GNU Objective C Class 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 __Stream_h__OBJECTS_INCLUDE -#define __Stream_h__OBJECTS_INCLUDE - -#include -#include - -@interface Stream : NSObject - -- init; - -@end - -#endif /* __Stream_h__OBJECTS_INCLUDE */ - diff --git a/Source/objects/Streaming.h b/Source/objects/Streaming.h deleted file mode 100644 index 3a62d9838..000000000 --- a/Source/objects/Streaming.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Protocol for GNU Objective C byte streams - Copyright (C) 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: April 1995 - - This file is part of the GNU Objective C Class 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 __Streaming_h__OBJECTS_INCLUDE -#define __Streaming_h__OBJECTS_INCLUDE - -#include -#include - -@protocol Streaming - -- (int) writeByte: (unsigned char)b; -- (int) readByte: (unsigned char*)b; - -- (int) writeBytes: (const void*)b length: (int)l; -- (int) readBytes: (void*)b length: (int)l; - -- (int) writeFormat: (id )format, ...; -- (int) readFormat: (id )format, ...; -- (int) writeFormat: (id )format arguments: (va_list)arg; -- (int) readFormat: (id )format arguments: (va_list)arg; - -- (void) writeLine: (id )l; -- (id ) readLine; - -- (unsigned) streamPosition; -- (BOOL) isAtEof; -- (void) flushStream; - -/* We must separate the idea of "closing" a stream and "deallocating" a - stream because of delays in deallocation due to -autorelease. */ -- (void) close; -- (BOOL) isClosed; - -- (BOOL) isWritable; - -@end - -@protocol SeekableStreaming - -- (void) rewindStream; -- (void) setStreamPosition: (unsigned)i; - -@end - - -#endif /* __Streaming_h__OBJECTS_INCLUDE */ - diff --git a/Source/objects/String.h b/Source/objects/String.h deleted file mode 100644 index ffe45a1bd..000000000 --- a/Source/objects/String.h +++ /dev/null @@ -1,182 +0,0 @@ -/* Some preliminary ideas about what a String class might look like. - Copyright (C) 1993,1994, 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __String_h_OBJECTS_INCLUDE -#define __String_h_OBJECTS_INCLUDE - -/* xxx These method names need to be fixed because we will get - type conflicts with GNUSTEP. - Perhaps I'll just get rid of the GNU String objects and just - transfer this functionality into NSSTring and friends. */ - -#include -#include -#include -#include -#include - -typedef unsigned short Character; - -@class String; -@class ConstantString; -@class MutableString; - -/* Like in SmallTalk, the String class is a subclass of Collection---a - collection of characters. So, all the collection methods are - available. Nice. */ - -/* Think about changing these names to avoid conflicts with OpenStep? */ - -@protocol String - -// INITIALIZING NEWLY ALLOCATED STRINGS. DON'T FORGET TO RELEASE THEM!; -- init; -- initWithString: (id )aString; -- initWithString: (id )aString range: (IndexRange)aRange; -- initWithFormat: (id )aFormatString, ...; -- initWithFormat: (id )aFormatString arguments: (va_list)arg; -- initWithCString: (const char*)aCharPtr; -- initWithCString: (const char*)aCharPtr range: (IndexRange)aRange; -//- initWithStream: (Stream*)aStream; -//- initWithStream: (Stream*)aStream length: (unsigned)aLength; - -// GETTING NEW, AUTORELEASED STRING OBJECTS, NO NEED TO RELEASE THESE; -+ stringWithString: (id )aString; -+ stringWithString: (id )aString range: (IndexRange)aRange; -+ stringWithFormat: (id )aFormatString, ...; -+ stringWithFormat: (id )aFormatString arguments: (va_list)arg; -+ stringWithCString: (const char*)aCharPtr; -+ stringWithCString: (const char*)aCharPtr range: (IndexRange)aRange; -+ stringWithCStringNoCopy: (const char*)aCharPtr - freeWhenDone: (BOOL) f; -+ stringWithCStringNoCopy: (const char*)aCharPtr; - -- stringByAppendingFormat: (id )aString, ...; -- stringByAppendingFormat: (id )aString arguments: (va_list)arg; -- stringByPrependingFormat: (id )aString, ...; -- stringByPrependingFormat: (id )aString arguments: (va_list)arg; -- stringByAppendingString: (id )aString; -- stringByPrependingString: (id )aString; - -//- substringWithRange: (IndexRange)aRange; -//- substringWithLength: (unsigned)l; -//- substringAfterIndex: (unsigned)i; -//- (id ) substringsSeparatedByString: (id )sep; - -//- capitalizedString; -//- lowercaseString; -//- uppercaseString; - -- mutableCopy; -- copy; - -// QUERYING -- (unsigned) length; -- (IndexRange) range; -- (BOOL) isEqual: anObject; -- (unsigned) hash; -- (int) compare: anObject; -- copy; -- (unsigned) indexOfString: (id )aString; -- (unsigned) indexOfChar: (char)aChar; -- (unsigned) indexOfLastChar: (char)aChar; -//- (unsigned) indexOfCharacter: (Character)aChar; -//- (unsigned) indexOfLastCharacter: (Character)aChar; - -// GETTING C CHARS; -- (char) charAtIndex: (unsigned)index; -- (const char *) cString; -- (const char *) cStringNoCopy; -- (unsigned) cStringLength; -- (void) getCString: (char*)buffer; -- (void) getCString: (char*)buffer range: (IndexRange)aRange; - -// FOR FILE NAMES (don't use the name "path", gnu will not use it for this); -//- (IndexRange) fileRange; -//- (IndexRange) directoriesRange; -//- (IndexRange) extensionRange; -//- (IndexRange) fileWithoutExtensionRange; -//- (BOOL) isAbsolute; -//- (BOOL) isRelative; - -@end - -@protocol MutableString - -+ stringWithCapacity: (unsigned)capacity; -- initWithCapacity: (unsigned)capacity; - -/* This from IndexedCollecting: - removeRange: (IndexRange)range; */ -- (void) insertString: (id )string atIndex: (unsigned)index; - -- (void) setString: (id )string; -- (void) appendString: (id )string; -- (void) replaceRange: (IndexRange)range withString: (id )string; - -@end - -/* Abstract string classes */ - -@interface String : IndexedCollection -@end - -/* To prevent complaints about protocol conformance. */ -@interface String (StringProtocol) -@end - -@interface MutableString : String -@end - -/* To prevent complaints about protocol conformance. */ -@interface MutableString (MutableStringProtocol) -@end - -/* Some concrete string classes */ - -@interface CString : String -{ - char * _contents_chars; - int _count; - BOOL _free_contents; -} -@end - -@interface MutableCString : MutableString -{ - char *_contents_chars; - int _count; - BOOL _free_contents; - int _capacity; -} -@end - -@interface ConstantString : CString -@end - -#if 0 /* Moved to foundation/NSString.h */ -/* The compiler makes @""-strings into NXConstantString's */ -@interface NXConstantString : ConstantString -@end -#endif /* 0 */ - -#endif /* __String_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/TcpPort.h b/Source/objects/TcpPort.h deleted file mode 100644 index 656656aed..000000000 --- a/Source/objects/TcpPort.h +++ /dev/null @@ -1,92 +0,0 @@ -/* Interface for stream based on TCP sockets - Copyright (C) 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: February 1996 - - This file is part of the GNU Objective C Class 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 __TcpPort_h__OBJECTS_INCLUDE -#define __TcpPort_h__OBJECTS_INCLUDE - -#include -#include -#include -#include -#include -#include -#include - -/* A concrete implementation of a Port object implemented on top of - SOCK_STREAM connections. */ - -@interface TcpInPort : InPort -{ - int _socket; - struct sockaddr_in _listening_address; - NSMapTable *_client_sock_2_out_port; - NSMapTable *_client_sock_2_packet; -} - -+ newForReceivingFromPortNumber: (unsigned short)n; - -/* Get a packet from the net and return it. If no packet is received - within MILLISECONDS, then return nil. The caller is responsible - for releasing the packet. */ -- newPacketReceivedBeforeDate: date; - -- (int) portNumber; -- (id ) connectedOutPorts; -- (unsigned) numberOfConnectedOutPorts; - -@end - - -@interface TcpOutPort : OutPort -{ - int _socket; - /* This is actually the address of the listen()'ing socket of the remote - TcpInPort we are connected to, not the address of the _socket ivar. */ - struct sockaddr_in _remote_in_port_address; - /* This is the address of our remote peer socket. */ - struct sockaddr_in _peer_address; - /* The TcpInPort that is polling our _socket with select(). */ - id _polling_in_port; -} - -+ newForSendingToPortNumber: (unsigned short)n - onHost: (id )hostname; -- (int) portNumber; - -@end - - -/* Holders of sent and received data. */ - -@interface TcpInPacket : InPacket -@end -@interface TcpOutPacket : OutPacket -@end - - -/* Notification Strings. */ -extern NSString *InPortClientBecameInvalidNotification; -extern NSString *InPortAcceptedClientNotification; - -#endif /* __TcpPort_h__OBJECTS_INCLUDE */ - diff --git a/Source/objects/TextCStream.h b/Source/objects/TextCStream.h deleted file mode 100644 index 3cc6e30ae..000000000 --- a/Source/objects/TextCStream.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Interface for GNU Objective-C text stream object for use serializing - Copyright (C) 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Written: Jan 1996 - - This file is part of the GNU Objective C Class 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 __TextCStream_h_OBJECTS_INCLUDE -#define __TextCStream_h_OBJECTS_INCLUDE - -#include -#include -#include - -@interface TextCStream : CStream - -@end - -#endif /* __TextCStream_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/Time.h b/Source/objects/Time.h deleted file mode 100644 index b96c30c8c..000000000 --- a/Source/objects/Time.h +++ /dev/null @@ -1,102 +0,0 @@ -/* Interface for Objective-C Time object - Copyright (C) 1993,1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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. -*/ - -/* This is a combination of Smalltalk's Time and Date objects */ - -#ifndef __Time_h_OBJECTS_INCLUDE -#define __Time_h_OBJECTS_INCLUDE - -#include -#include - -#ifndef WIN32 -#include -#include -#endif - -#ifdef _SEQUENT_ -/* Include needed for getclock() in our replacement for gettimeofday() */ -#include - -/* Include needed for tzset() in our replacement for gettimeofday() */ -#include - -/* Sequent does not define struct timezone in any of it's header files */ -struct timezone { - int tz_minuteswest; - int tz_dsttime; -}; -#endif /* _SEQUENT_ */ - -@interface Time : Magnitude -{ - struct timeval tv; /* seconds and useconds */ - struct timezone tz; /* minutes from Greenwich, and correction */ -} - -/* Change these names? */ -+ (long) secondClockValue; -+ getClockValueSeconds: (long *)sec microseconds: (long *)usec; - -+ (long) millisecondsToRun: (void(*)())aFunc; -+ getSeconds: (long *)sec microseconds: (long *)usec toRun: (void(*)())aFunc; - -+ (unsigned) indexOfDayName: (const char *)dayName; -+ (const char *) nameOfDayIndex: (unsigned)dayIndex; -+ (unsigned) indexOfMonthName: (const char *)monthName; -+ (const char *) nameOfMonthIndex: (unsigned)monthIndex; -+ (unsigned) daysInMonthIndex: (unsigned)monthIndex forYear: (unsigned)year; -+ (unsigned) daysInYear: (unsigned)year; -+ (BOOL) leapYear: (unsigned)year; - -- initNow; -- initDayIndex: (unsigned)dayIndex - monthIndex: (unsigned)monthIndex - year: (unsigned)year; -- initSeconds: (long)numSeconds microseconds: (long)numMicroseconds; -- initSeconds: (long)numSeconds; - -- setSeconds: (long)numSeconds microseconds: (long)numMicroseconds; -- setSeconds: (long)numSeconds; - -- (long) days; -- (long) hours; -- (long) minutes; -- (long) seconds; -- (long) microseconds; - -- addTime: (Time*)aTimeObj; -- addDays: (unsigned)num; -- addHours: (unsigned)num; -- addMinutes: (unsigned)num; -- addSeconds: (unsigned)num; - -- subtractTime: (Time*)aTimeObj; -- subtractDays: (unsigned)num; -- subtractHours: (unsigned)num; -- subtractMinutes: (unsigned)num; -- subtractSeconds: (unsigned)num; - -@end - -#endif /* __Time_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/UdpPort.h b/Source/objects/UdpPort.h deleted file mode 100644 index b82ff7e03..000000000 --- a/Source/objects/UdpPort.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Interface for socket-based port object for use with Connection - Copyright (C) 1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: July 1994 - - This file is part of the GNU Objective C Class 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 __UdpPort_h_INCLUDE_GNU -#define __UdpPort_h_INCLUDE_GNU - -#include -#include -#include -#ifndef WIN32 -# include -# include -#endif /* !WIN32 */ - -@interface UdpInPort : InPort -{ - int _socket; - struct sockaddr_in _address; -} - -- (int) portNumber; -- (int) socket; - -@end - -@interface UdpOutPort : OutPort -{ - struct sockaddr_in _address; -} - -- (int) portNumber; -- (id ) hostname; - -@end - -@interface UdpInPacket : InPacket -@end -@interface UdpOutPacket : OutPacket -@end - -#endif /* __UdpPort_h_INCLUDE_GNU */ diff --git a/Source/objects/ValueHolding.h b/Source/objects/ValueHolding.h deleted file mode 100644 index 8b6b2a69c..000000000 --- a/Source/objects/ValueHolding.h +++ /dev/null @@ -1,50 +0,0 @@ -/* Protocol for Objective-C objects that hold numerical and/or string values. - Copyright (C) 1993,1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __ValueHolding_h_INCLUDE_GNU -#define __ValueHolding_h_INCLUDE_GNU - -#include - -/* protocol String; */ - -@protocol ValueGetting -- (int) intValue; -- (float) floatValue; -- (double) doubleValue; -- (const char *) cStringValue; -- /* (id ) */ stringValue; -@end - -@protocol ValueSetting -- (void) setIntValue: (int)anInt; -- (void) setFloatValue: (float)aFloat; -- (void) setDoubleValue: (double)aDouble; -- (void) setCStringValue: (const char *)aCString; -- (void) setStringValue: /* (id ) */ aString; -@end - -@protocol ValueHolding -@end - -#endif /* __ValueHolding_h_INCLUDE_GNU */ diff --git a/Source/objects/abort.h b/Source/objects/abort.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/Source/objects/allocs.h b/Source/objects/allocs.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/Source/objects/array.h b/Source/objects/array.h deleted file mode 100644 index 43dbe29fe..000000000 --- a/Source/objects/array.h +++ /dev/null @@ -1,248 +0,0 @@ -/* A sparse array structure. - * Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. - * - * Author: Albin L. Jones - * Created: Thu Mar 2 02:30:02 EST 1994 - * Updated: Tue Mar 12 02:42:54 EST 1996 - * Serial: 96.03.12.13 - * - * This file is part of the GNU Objective C Class 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 __array_h_OBJECTS_INCLUDE -#define __array_h_OBJECTS_INCLUDE 1 - -/**** Included Headers *******************************************************/ - -#include -#include -#include -#include - -/**** Type, Constant, and Macro Definitions **********************************/ - -typedef struct _objects_array objects_array_t; -typedef struct _objects_array_bucket objects_array_bucket_t; -typedef objects_array_bucket_t *objects_array_slot_t; -typedef struct _objects_array_enumerator objects_array_enumerator_t; - -struct _objects_array_bucket -{ - /* The bucket's real (or external) index */ - size_t index; - - /* The bucket's cargo */ - const void *element; -}; - -struct _objects_array -{ - /* Identifying information. */ - int magic_number; - size_t serial_number; - NSZone *zone; - NSString *name; - const void *extra; - objects_callbacks_t extra_callbacks; - - /* Callbacks for the items in the array. */ - objects_callbacks_t callbacks; - - /* Internal counters */ - size_t slot_count; - size_t element_count; - - /* Databanks */ - objects_array_slot_t *slots; - objects_array_slot_t *sorted_slots; -}; - -struct _objects_array_enumerator -{ - objects_array_t *array; - size_t index; - int is_sorted; - int is_ascending; -}; - -/**** Function Prototypes ****************************************************/ - -/** Basics **/ - -#include -#include - -/** Creating **/ - -objects_array_t * -objects_array_alloc(void); - -objects_array_t * -objects_array_alloc_with_zone(NSZone *zone); - -objects_array_t * -objects_array(void); - -objects_array_t * -objects_array_with_zone(NSZone *zone); - -objects_array_t * -objects_array_with_zone_with_callbacks(NSZone *zone, - objects_callbacks_t callbacks); - -objects_array_t * -objects_array_with_callbacks(objects_callbacks_t callbacks); - -objects_array_t * -objects_array_of_char_p(void); - -objects_array_t * -objects_array_of_non_owned_void_p(void); - -objects_array_t * -objects_array_of_owned_void_p(void); - -objects_array_t * -objects_array_of_int(void); - -objects_array_t * -objects_array_of_id(void); - -/** Initializing **/ - -objects_array_t * -objects_array_init(objects_array_t *array); - -objects_array_t * -objects_array_init_with_callbacks(objects_array_t *array, - objects_callbacks_t callbacks); - -objects_array_t * -objects_array_init_with_array(objects_array_t *array, - objects_array_t *other_array); - -/** Copying **/ - -objects_array_t * -objects_array_copy(objects_array_t *array); - -objects_array_t * -objects_array_copy_with_zone(objects_array_t *array, NSZone *zone); - -/** Destroying **/ - -void -objects_array_dealloc(objects_array_t *array); - -/** Comparing **/ - -int -objects_array_is_equal_to_array(objects_array_t *array, - objects_array_t *other_array); - -/** Adding **/ - -const void * -objects_array_at_index_put_element(objects_array_t *array, - size_t index, - const void *element); - -/** Replacing **/ - -/** Removing **/ - -void -objects_array_remove_element_at_index(objects_array_t *array, size_t index); - -void -objects_array_remove_element(objects_array_t *array, const void *element); - -void -objects_array_remove_element_known_present(objects_array_t *array, - const void *element); - -/** Emptying **/ - -void -objects_array_empty(objects_array_t *array); - -/** Searching **/ - -int -objects_array_contains_element(objects_array_t *array, const void *element); - -const void * -objects_array_element(objects_array_t *array, const void *element); - -size_t -objects_array_index_of_element(objects_array_t *array, const void *element); - -const void * -objects_array_element_at_index(objects_array_t *array, size_t index); - -const void ** -objects_array_all_elements(objects_array_t *array); - -const void ** -objects_array_all_elements_ascending(objects_array_t *array); - -const void ** -objects_array_all_element_descending(objects_array_t *array); - -/** Enumerating **/ - -objects_array_enumerator_t -objects_array_enumerator(objects_array_t *array); - -objects_array_enumerator_t -objects_array_ascending_enumerator(objects_array_t *array); - -objects_array_enumerator_t -objects_array_descending_enumerator(objects_array_t *array); - -int -objects_array_enumerator_next_index_and_element(objects_array_enumerator_t *enumerator, - size_t *index, - const void **element); - -int -objects_array_enumerator_next_element(objects_array_enumerator_t *enumerator, - const void **element); - -int -objects_array_enumerator_next_index(objects_array_enumerator_t *enumerator, - size_t *element); - -/** Statistics **/ - -int -objects_array_is_empty(objects_array_t *array); - -size_t -objects_array_count(objects_array_t *array); - -size_t -objects_array_capacity(objects_array_t *array); - -int -objects_array_check(objects_array_t *array); - -/** Miscellaneous **/ - -objects_hash_t * -objects_hash_init_from_array(objects_hash_t *hash, objects_array_t *array); - -#endif /* __array_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/behavior.h b/Source/objects/behavior.h deleted file mode 100644 index 8559dd2bb..000000000 --- a/Source/objects/behavior.h +++ /dev/null @@ -1,65 +0,0 @@ -/* Interface for behaviors for Obj-C, "for Protocols with implementations". - Copyright (C) 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: March 1995 - - This file is part of the GNU Objective C Class 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 __behavior_h_OBJECTS_INCLUDE -#define __behavior_h_OBJECTS_INCLUDE - -/* Call this method from CLASS's +initialize method to add a behavior - to CLASS. A "behavior" is like a protocol with an implementation. - - This functions adds to CLASS all the instance and factory methods - of BEHAVIOR as well as the instance and factory methods of - BEHAVIOR's superclasses (We stop adding super classes as soon as we - encounter a common ancestor.) CLASS and BEHAVIOR should share the - same instance variable layout. - - We do not yet deal with Protocols; perhaps we should. - - The semantics of this stuff is pretty fragile. I don't recommend - that you use it in code you write. It might go away completely in - future. - -*/ - -void behavior_class_add_class (Class class, - Class behavior); -void behavior_class_add_category (Class class, - struct objc_category *category); -void behavior_class_add_methods (Class class, - struct objc_method_list *methods); - -/* The old deprecated interface */ -void class_add_behavior (Class class, Class behavior); - -/* This macro may go away in future. - Use it carefully, you can really screw yourself up by sending to - a CLASS with a different instance variable layout than "self". */ - -#define CALL_METHOD_IN_CLASS(CLASS, METHOD, ARGS...) \ -((*(get_imp([CLASS class], @selector(METHOD)))) \ - (self, @selector(METHOD), ## ARGS)) - -/* Set to non-zero if you want debugging messages on stderr. */ -void set_behavior_debug(int i); - -#endif /* __behavior_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/bitops.h b/Source/objects/bitops.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/Source/objects/callbacks.h b/Source/objects/callbacks.h deleted file mode 100644 index bcd552132..000000000 --- a/Source/objects/callbacks.h +++ /dev/null @@ -1,179 +0,0 @@ -/* Handling various types in a uniform manner. - * Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. - * - * Author: Albin L. Jones - * Created: Sun Oct 9 13:18:50 EDT 1994 - * Updated: Mon Mar 11 00:31:13 EST 1996 - * Serial: 96.03.11.01 - * - * This file is part of the GNU Objective C Class 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 __callbacks_h_OBJECTS_INCLUDE -#define __callbacks_h_OBJECTS_INCLUDE 1 - -/**** Included Headers *******************************************************/ - -#include -#include - -/**** Type, Constant, and Macro Definitions **********************************/ - -typedef size_t (*objects_hash_func_t)(const void *, void *); -typedef int (*objects_compare_func_t)(const void *, const void *, void *); -typedef int (*objects_is_equal_func_t)(const void *, const void *, void *); -typedef const void *(*objects_retain_func_t)(const void *, void *); -typedef void (*objects_release_func_t)(void *, void *); -typedef NSString *(*objects_describe_func_t)(const void *, void *); - -typedef struct _objects_callbacks objects_callbacks_t; - -struct _objects_callbacks -{ - objects_hash_func_t hash; - objects_compare_func_t compare; - objects_is_equal_func_t is_equal; - objects_retain_func_t retain; - objects_release_func_t release; - objects_describe_func_t describe; - const void *not_an_item_marker; -}; - -/** Callbacks for various types **/ - -extern const objects_callbacks_t objects_callbacks_for_int; -extern const objects_callbacks_t objects_callbacks_for_char_p; -extern const objects_callbacks_t objects_callbacks_for_non_owned_void_p; -extern const objects_callbacks_t objects_callbacks_for_owned_void_p; -extern const objects_callbacks_t objects_callbacks_for_int_p; -extern const objects_callbacks_t objects_callbacks_for_id; - -/* FIXME: I need to figure out what each of these should be. Hmmm? */ -extern const void *objects_not_an_int_marker; -extern const void *objects_not_a_char_p_marker; -extern const void *objects_not_a_void_p_marker; -extern const void *objects_not_an_int_p_marker; -extern const void *objects_not_an_id_marker; - -/* Change this if you need different default callbacks. */ -extern objects_callbacks_t __objects_callbacks_standard; - -/**** Function Prototypes ****************************************************/ - -/** Generic callbacks **/ - -/* Returns the programmer-alterable `__objects_callbacks_standard', - * defined above. */ -objects_callbacks_t -objects_callbacks_standard(void); - -/** Standardizing callbacks **/ - -/* Makes sure that enough of CALLBACKS is defined (i.e., non-zero) - * to be used. This is used, rather than local checks for usability, - * to improve the efficiency of callback use. */ -objects_callbacks_t -objects_callbacks_standardize(objects_callbacks_t callbacks); - -/** Using callbacks **/ - -size_t -objects_hash(objects_callbacks_t callbacks, - const void *thing, - void *user_data); - -int -objects_compare(objects_callbacks_t callbacks, - const void *thing1, - const void *thing2, - void *user_data); - -int -objects_is_equal(objects_callbacks_t callbacks, - const void *thing1, - const void *thing2, - void *user_data); - -const void * -objects_retain(objects_callbacks_t callbacks, - const void *thing, - void *user_data); - -void -objects_release(objects_callbacks_t callbacks, - void *thing, - void *user_data); - -NSString * -objects_describe(objects_callbacks_t callbacks, - const void *thing, - void *user_data); - -const void * -objects_not_an_item_marker(objects_callbacks_t callbacks); - -/** Specific callback functions... **/ - -/* For non-owned `void *' */ -size_t objects_non_owned_void_p_hash(const void *ptr); -int objects_non_owned_void_p_compare(const void *ptr, const void *qtr); -int objects_non_owned_void_p_is_equal(const void *ptr, const void *qtr); -const void *objects_non_owned_void_p_retain(const void *ptr); -void objects_non_owned_void_p_release(void *ptr); -NSString *objects_non_owned_void_p_describe(const void *ptr); - -/* For owned `void *' */ -size_t objects_owned_void_p_hash(const void *ptr); -int objects_owned_void_p_compare(const void *ptr, const void *qtr); -int objects_owned_void_p_is_equal(const void *ptr, const void *qtr); -const void *objects_owned_void_p_retain(const void *ptr); -void objects_owned_void_p_release(void *ptr); -NSString *objects_owned_void_p_describe(const void *ptr); - -/* For `int' */ -size_t objects_int_hash(int i); -int objects_int_compare(int i, int j); -int objects_int_is_equal(int i, int j); -const void *objects_int_retain(int i); -void objects_int_release(int i); -NSString *objects_int_describe(int i); - -/* For `int *' */ -size_t objects_int_p_hash(const int *iptr); -int objects_int_p_compare(const int *iptr, const int *jptr); -int objects_int_p_is_equal(const int *iptr, const int *jptr); -const void *objects_int_p_retain(const int *iptr); -void objects_int_p_release(int *iptr); -NSString *objects_int_p_describe(const int *iptr); - -/* For `char *' */ -size_t objects_char_p_hash(const char *cptr); -int objects_char_p_compare(const char *cptr, const char *dptr); -int objects_char_p_is_equal(const char *cptr, const char *dptr); -const void *objects_char_p_retain(const char *cptr); -void objects_char_p_release(char *cptr); -NSString *objects_char_p_describe(const char *cptr); - -/* For `id' */ -size_t objects_id_hash(id obj); -int objects_id_compare(id obj, id jbo); -int objects_id_is_equal(id obj, id jbo); -const void *objects_id_retain(id obj); -void objects_id_release(id obj); -NSString *objects_id_describe(id obj); - -#endif /* __callbacks_h_OBJECTS_INCLUDE */ - diff --git a/Source/objects/config-nt.h b/Source/objects/config-nt.h deleted file mode 100644 index 4e66ee93d..000000000 --- a/Source/objects/config-nt.h +++ /dev/null @@ -1,13 +0,0 @@ - -/* WIN32 extra config stuff */ - -// -// WIN32 -// -#ifdef WIN32 -# include -# ifndef vm_page_size -# define vm_page_size 4096 -# endif -# define popen _popen -#endif diff --git a/Source/objects/config-nt.sed b/Source/objects/config-nt.sed deleted file mode 100644 index e3fdb834b..000000000 --- a/Source/objects/config-nt.sed +++ /dev/null @@ -1,2 +0,0 @@ -s/@NeXT_runtime@/0/ -s/@NeXT_cc@/0/ diff --git a/Source/objects/config.h.in b/Source/objects/config.h.in deleted file mode 100644 index 3710728a1..000000000 --- a/Source/objects/config.h.in +++ /dev/null @@ -1,30 +0,0 @@ -/* Configuration information for the GNU Objective-C Library. - Copyright (C) 1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: Oct 1994 - - This file is part of the GNU Objective C Class 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 __config_h_OBJECTS_INCLUDE -#define __config_h_OBJECTS_INCLUDE - -#define NeXT_runtime @NeXT_runtime@ -#define NeXT_cc @NeXT_cc@ - -#endif /* __config_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/data.h b/Source/objects/data.h deleted file mode 100644 index d5612a9ae..000000000 --- a/Source/objects/data.h +++ /dev/null @@ -1,239 +0,0 @@ -/* A modular data encapsulator for use with Libobjects. - * Copyright (C) 1995, 1996 Free Software Foundation, Inc. - * - * Author: Albin L. Jones - * Created: Fri Nov 24 21:50:01 EST 1995 - * Updated: Sat Feb 10 15:40:21 EST 1996 - * Serial: 96.02.10.01 - * - * This file is part of the GNU Objective C Class 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 __data_h_OBJECTS_INCLUDE -#define __data_h_OBJECTS_INCLUDE 1 - -/**** Included Headers *******************************************************/ - -#include -#include - -/**** Type, Constant, and Macro Definitions **********************************/ - -typedef enum _objects_data_encoding objects_data_encoding_t; - -enum _objects_data_encoding - { - objects_data_encoding_unknown = -1, - objects_data_encoding_binary, - objects_data_encoding_7bit, - objects_data_encoding_8bit, - objects_data_encoding_base64, - objects_data_encoding_quoted_printable, - objects_data_encoding_x_uuencode - }; - -typedef struct _objects_data objects_data_t; - -struct _objects_data - { - int magic; - size_t number; - const char *name; - const void *extra; - objects_callbacks_t extra_callbacks; - objects_allocs_t allocs; - - /* Necessary information about the data. */ - void *buffer; /* Where the stuff really is. */ - size_t length; /* How much stuff there is. */ - size_t capacity; /* How much room for stuff there is. */ - }; - -/* Creating temporary data. This is *so* cool. GCC is awesome! */ -#define OBJECTS_DATA(P, L) \ - (objects_data_t *(&({OBJECTS_MAGIC_DATA, (size_t) -1, 0, \ - 0, 0, __objects_callbacks_standard, 0, 0, 0, \ - __objects_allocs_standard, (P), (L), (L)}))) - -/**** Function Prototypes ****************************************************/ - -/** Basics **/ - -#include - -/** Hashing **/ - -size_t objects_data_hash (objects_data_t * data); - -/** Creating **/ - -objects_data_t * objects_data_alloc (void); - -objects_data_t * objects_data_alloc_with_allocs (objects_allocs_t allocs); - -objects_data_t * objects_data_new (void); - -objects_data_t * objects_data_new_with_allocs (objects_allocs_t allocs); - -objects_data_t * _objects_data_with_allocs_with_contents_of_file (objects_allocs_t allocs, const char *file); - -objects_data_t * _objects_data_with_contents_of_file (const char *file); - -objects_data_t * objects_data_with_buffer_of_length (void *buffer, size_t length); - -objects_data_t * objects_data_with_allocs_with_buffer_of_length (objects_allocs_t allocs, void *buffer, size_t length); - -/** Initializing **/ - -objects_data_t * objects_data_init (objects_data_t * data); - -objects_data_t * _objects_data_init_with_contents_of_file (objects_data_t * data, const char *file); - -objects_data_t * objects_data_init_with_buffer_of_length (objects_data_t * data, void *buffer, size_t length); - -/** Statistics **/ - -size_t objects_data_capacity (objects_data_t * data); - -/* Obtain DATA's length. */ -size_t objects_data_length (objects_data_t * data); - -/* Obtain a read-only copy of DATA's buffer. */ -const void *objects_data_buffer (objects_data_t * data); - -/* Obtain DATA's capacity through reference. */ -size_t objects_data_get_capacity (objects_data_t * data, size_t * capacity); - -/* Obtain DATA's length through reference. */ -size_t objects_data_get_length (objects_data_t * data, size_t * length); - -/* Copy DATA's buffer into BUFFER. It is assumed that BUFFER is large - * enough to contain DATA's buffer. */ -size_t objects_data_get_buffer (objects_data_t * data, void *buffer); - -/* Copy no more that LENGTH of DATA's buffer into BUFFER. Returns the - * amount actually copied. */ -size_t objects_data_get_buffer_of_length (objects_data_t * data, void *buffer, size_t length); - -/* Copy a subrange of DATA's buffer into BUFFER. As always, it is - * assumed that BUFFER is large enough to contain everything. We - * return the size of the data actually copied into BUFFER. */ -size_t objects_data_get_buffer_of_subrange (objects_data_t * data, void *buffer, size_t location, size_t length); - -size_t objects_data_set_capacity (objects_data_t * data, size_t capacity); - -size_t objects_data_increase_capacity (objects_data_t * data, size_t capacity); - -size_t objects_data_decrease_capacity (objects_data_t * data, size_t capacity); - -size_t objects_data_set_length (objects_data_t * data, size_t length); - -size_t objects_data_set_buffer_of_subrange (objects_data_t * data, void *buffer, size_t location, size_t length); - -size_t objects_data_set_buffer_of_length (objects_data_t * data, void *buffer, size_t length); - -void objects_data_get_md5_checksum (objects_data_t * data, char *buffer); - -/** Copying **/ - -objects_data_t * objects_data_copy (objects_data_t * data); - -objects_data_t * objects_data_copy_of_subrange (objects_data_t * data, size_t location, size_t length); - -objects_data_t * objects_data_copy_with_allocs (objects_data_t * data, objects_allocs_t allocs); - -objects_data_t * objects_data_copy_of_subrange_with_allocs (objects_data_t * data, size_t location, size_t length, objects_allocs_t allocs); - -/** Replacing **/ - -/* Note that we cannot do any bounds checking on BUFFER. */ -objects_data_t * objects_data_replace_subrange_with_subrange_of_buffer (objects_data_t * data, size_t location, size_t length, size_t buf_location, size_t buf_length, void *buffer); - -objects_data_t * objects_data_replace_subrange_with_subrange_of_data (objects_data_t * data, size_t location, size_t length, size_t other_location, size_t other_length, objects_data_t * other_data); - -objects_data_t * objects_data_replace_subrange_with_data (objects_data_t * data, size_t location, size_t length, objects_data_t * other_data); - -/** Appending **/ - -objects_data_t * objects_data_append_data (objects_data_t * data, objects_data_t * other_data); - -objects_data_t * objects_data_append_subrange_of_data (objects_data_t * data, size_t location, size_t length, objects_data_t * other_data); - -objects_data_t * objects_data_append_data_repeatedly (objects_data_t * data, objects_data_t * other_data, size_t num_times); - -objects_data_t * objects_data_append_subrange_of_data_repeatedly (objects_data_t * data, size_t location, size_t length, objects_data_t * other_data, size_t num_times); - -/** Prepending **/ - -objects_data_t * objects_data_prepend_data (objects_data_t * data, objects_data_t * other_data); - -objects_data_t * objects_data_prepend_subrange_of_data (objects_data_t * data, size_t location, size_t length, objects_data_t * other_data); - -objects_data_t * objects_data_prepend_data_repeatedly (objects_data_t * data, objects_data_t * other_data, size_t num_times); - -objects_data_t * objects_data_prepend_subrange_of_data_repeatedly (objects_data_t * data, size_t location, size_t length, objects_data_t * other_data, size_t num_times); - -/** Concatenating **/ - -objects_data_t * objects_data_concatenate_data (objects_data_t * data, objects_data_t * other_data); - -objects_data_t * objects_data_concatenate_data_with_allocs (objects_data_t * data, objects_data_t * other_data, objects_allocs_t allocs); - -objects_data_t * objects_data_concatenate_subrange_of_data (objects_data_t * data, size_t location, size_t length, objects_data_t * other_data); - -objects_data_t * objects_data_concatenate_subrange_of_data_with_allocs (objects_data_t * data, size_t location, size_t length, objects_data_t * other_data, objects_allocs_t allocs); - -/** Reversing **/ - -objects_data_t * objects_data_reverse_with_granularity (objects_data_t * data, size_t granularity); - -objects_data_t * objects_data_reverse_by_int (objects_data_t * data); - -objects_data_t * objects_data_reverse_by_char (objects_data_t * data); - -objects_data_t * objects_data_reverse_by_void_p (objects_data_t * data); - -/** Permuting **/ - -objects_data_t * objects_data_permute_with_granularity (objects_data_t * data, size_t granularity); - -objects_data_t * objects_data_permute_with_no_fixed_points_with_granularity (objects_data_t * data, size_t granularity); - -/** Writing **/ - -int _objects_data_write_to_file (objects_data_t * data, const char *file); - -/** Encoding **/ - -objects_data_encoding_t objects_data_guess_data_encoding (objects_data_t * data); - -objects_data_t * _objects_data_encode_with_base64 (objects_data_t * data); - -objects_data_t * _objects_data_encode_with_quoted_printable (objects_data_t * data); - -objects_data_t * _objects_data_encode_with_x_uuencode (objects_data_t * data); - -objects_data_t * objects_data_encode_with_encoding (objects_data_t * data, objects_data_encoding_t enc); - -objects_data_t * _objects_data_decode_with_base64 (objects_data_t * data); - -objects_data_t * _objects_data_decode_with_quoted_printable (objects_data_t * data); - -objects_data_t * _objects_data_decode_with_x_uuencode (objects_data_t * data); - -objects_data_t * objects_data_decode_with_encoding (objects_data_t * data, objects_data_encoding_t enc); - -#endif /* __data_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/hash.h b/Source/objects/hash.h deleted file mode 100644 index 47862e9ee..000000000 --- a/Source/objects/hash.h +++ /dev/null @@ -1,393 +0,0 @@ -/* A hash table. - * Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. - * - * Author: Albin L. Jones - * Created: ??? ??? ?? ??:??:?? ??? 1993 - * Updated: Tue Mar 19 00:25:34 EST 1996 - * Serial: 96.03.19.05 - * - * This file is part of the GNU Objective C Class 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 __hash_h_OBJECTS_INCLUDE -#define __hash_h_OBJECTS_INCLUDE 1 - -/**** Included Headers *******************************************************/ - -#include -#include -#include - -/**** Type, Constant, and Macro Definitions **********************************/ - -/* Need these up here because of their interdependence. */ -typedef struct _objects_hash objects_hash_t; -typedef struct _objects_hash_enumerator objects_hash_enumerator_t; -typedef struct _objects_hash_node objects_hash_node_t; -typedef struct _objects_hash_bucket objects_hash_bucket_t; - -/* Private type for elemental holding. */ -struct _objects_hash_node -{ - /* The hash table with which the node is associated. */ - objects_hash_t *hash; - - /* The bucket in HASH in which the node sits. */ - objects_hash_bucket_t *bucket; - - /* These hold the BUCKET linked list together. */ - objects_hash_node_t *next_in_bucket; - objects_hash_node_t *prev_in_bucket; - - /* For enumerating over the whole hash table. These make - * enumerating much quicker. They also make it safer. */ - objects_hash_node_t *next_in_hash; - objects_hash_node_t *prev_in_hash; - - /* What the node is holding for us. Its raison d'etre. */ - const void *element; -}; - -/* Private type for holding chains of nodes. */ -struct _objects_hash_bucket -{ - /* The number of nodes in this bucket. For internal consistency checks. */ - size_t node_count; - - /* The number of elements in this bucket. (This had *better* be - * the same as NODE_COUNT, or something's wrong.) */ - size_t element_count; - - /* The head of this bucket's linked list of nodes. */ - objects_hash_node_t *first_node; -}; - -/* The hash table type. */ -struct _objects_hash -{ - /* All structures have these... - * And all structures have them in the same order. */ - int magic_number; - size_t serial_number; - NSZone *zone; - NSString *name; - const void *extra; - objects_callbacks_t extra_callbacks; - - /* Callbacks for the elements of the hash. */ - objects_callbacks_t callbacks; - - /* Internal counters. Mainly for consistency's sake. */ - size_t bucket_count; /* How many types of items? */ - size_t node_count; /* How many items? */ - size_t element_count; /* How many elements? */ - - /* Places to start looking for elements. */ - objects_hash_bucket_t *buckets; /* Organized as a hash. */ - objects_hash_node_t *first_node; /* Organized as a linked list. - * (For enumerating...) */ -}; - -/* Type for enumerating the elements of a hash table. */ -struct _objects_hash_enumerator -{ - objects_hash_t *hash; /* To which hash do I belong? */ - objects_hash_node_t *node; /* Which node is next? */ -}; - -/**** Function Prototypes ****************************************************/ - -/** Basics... **/ - -/* All the structures (hashes, maps, lists, and arrays) have - * the same basic ideas behind them. */ - -#include -#include - -/** Callbacks... **/ - -/* Returns a collection of callbacks for use with hash tables. */ -objects_callbacks_t -objects_callbacks_for_hash(void); - -/** Creating... **/ - -/* Allocate a hash table in the default zone. */ -objects_hash_t * -objects_hash_alloc(void); - -/* Allocate a hash table in the memory block ZONE. */ -objects_hash_t * -objects_hash_alloc_with_zone(NSZone *zone); - -/* Create an empty hash table in the memory block ZONE. The returned - * hash table has a "reasonable" default capacity, but will need to - * be resized to suit your specific needs if more than a couple of - * dozen elements will be placed within it. */ -objects_hash_t * -objects_hash_with_zone_with_callbacks(NSZone *zone, - objects_callbacks_t callbacks); - -/* Like calling 'objects_hash_with_zone_with_callbacks(zone, - * objects_callbacks_standard())'. */ -objects_hash_t * -objects_hash_with_zone(NSZone *zone); - -/* Like calling 'objects_hash_with_zone_with_callbacks(0, callbacks)'. */ -objects_hash_t * -objects_hash_with_callbacks(objects_callbacks_t callbacks); - -/* These are just shortcuts for ease of use. */ -objects_hash_t *objects_hash_of_char_p(void); -objects_hash_t *objects_hash_of_non_owned_void_p(void); -objects_hash_t *objects_hash_of_owned_void_p(void); -objects_hash_t *objects_hash_of_int(void); -objects_hash_t *objects_hash_of_int_p(void); -objects_hash_t *objects_hash_of_id(void); - -/** Initializing... **/ - -/* Initializes HASH with a "reasonable" capacity, with the - * callbacks obtained from 'objects_callbacks_standard()'. */ -objects_hash_t * -objects_hash_init(objects_hash_t *hash); - -/* Initializes HASH with a "reasonable" capacity and - * with element callbacks CALLBACKS. */ -objects_hash_t * -objects_hash_init_with_callbacks(objects_hash_t *hash, - objects_callbacks_t callbacks); - -/* Initializes HASH with the capacity, callbacks, and contents - * of OTHER_HASH. NOTE: This is (as it must be) a "shallow" copying. - * See 'objects_hash_copy_with_zone()', below. */ -objects_hash_t * -objects_hash_init_with_hash(objects_hash_t *hash, - objects_hash_t *other_hash); - -/** Copying... **/ - -/* Creates a (shallow) copy of HASH in the memory block ZONE. WARNING: - * If the elements of HASH are pointers to mutable items, it is the - * programmer's responsibility to deepen the copy returned by this - * function call (using, for example, `objects_hash_map_elements()'). */ -objects_hash_t * -objects_hash_copy_with_zone(objects_hash_t *hash, NSZone *zone); - -/* Create a (shallow) copy of HASH in the default zone. WARNING: See the - * above function for an important caveat about copying. */ -objects_hash_t * -objects_hash_copy(objects_hash_t *old_hash); - -/** Mapping... **/ - -/* WARNING: The mapping function FCN must be one-to-one on elements of - * HASH. I.e., for reasons of efficiency, `objects_hash_map_elements()' - * makes no provision for the possibility that FCN maps two unequal - * elements of HASH to the same (or "equal") elements. The better way - * to handle functions that aren't one-to-one is to create a new hash - * and transform the elements of the first to create the elements of - * the second (by manual enumeration). */ -objects_hash_t * -objects_hash_map_elements(objects_hash_t *hash, - const void *(*fcn)(const void *, const void *), - const void *user_data); - -/** Destroying... **/ - -/* Releases all the elements of HASH, and then frees up the space - * HASH used. HASH is no longer a (pointer to a) valid hash - * table structure after this call. */ -void -objects_hash_dealloc(objects_hash_t *hash); - -/** Comparing... **/ - -/* Returns 'true' if every element of OTHER_HASH is also - * a member of HASH. Otherwise, returns 'false'. */ -int -objects_hash_contains_hash(objects_hash_t *hash, - objects_hash_t *other_hash); - -/* Returns 'true' if some element of HASH is also - * a member of OTHER_HASH. Otherwise, returns 'false'. */ -int -objects_hash_intersects_hash(objects_hash_t *hash, - objects_hash_t *other_hash); - -/* Returns 'true' if HASH and OTHER_HASH have the same number of elements, - * HASH contains OTHER_HASH, and OTHER_HASH contains HASH. Otheraise, returns 'false'. */ -int -objects_hash_is_equal_to_hash(objects_hash_t *hash, - objects_hash_t *other_hash); - -/** Adding... **/ - -/* Adds ELEMENT to HASH. If ELEMENT is "equal" to an item already in HASH, - * then we abort. If ELEMENT is the "not an element marker" for HASH, - * then we abort. [NOTE: This abortive behaviour will be changed in a - * future revision.] */ -const void * -objects_hash_add_element_known_absent(objects_hash_t *hash, - const void *element); - -/* Adds ELEMENT to HASH. If ELEMENT is "equal" to an item already in HASH, - * then that older item is released using the 'release()' callback function - * that was specified when HASH was created. (If ELEMENT is the "not an - * element marker" for HASH, then all bets are off, and we abort. - * [NOTE: This abortive behaviour will be changed in a future revision.]) */ -const void * -objects_hash_add_element(objects_hash_t *hash, const void *element); - -/* If (any item "equal" to) ELEMENT is in HASH, then that member of HASH is - * returned. Otherwise, the "not an element marker" for HASH is returned - * and ELEMENT is added to HASH. If ELEMENT is the "not an element marker" - * for HASH, then we abort. [NOTE: This abortive behaviour will be changed - * in a future revision.] */ -const void * -objects_hash_add_element_if_absent(objects_hash_t *hash, const void *element); - -/** Replacing... **/ - -/* If (some item "equal" to) ELEMENT is an element of HASH, then ELEMENT is - * substituted for it. The old element is released. (This is rather - * like the non-existant but perfectly reasonable function - * 'objects_hash_add_element_if_present()'.) */ -void -objects_hash_replace_element(objects_hash_t *hash, - const void *element); - -/** Removing... **/ - -/* Removes the element (if any) of HASH which is "equal" to ELEMENT, - * according to HASH's element callbacks. It is not an error to - * remove ELEMENT from HASH, if no element of HASH is "equal" to ELEMENT. */ -void -objects_hash_remove_element(objects_hash_t *hash, const void *element); - -/** Emptying... **/ - -/* Empties HASH, releasing all of its elements while retaining - * its current "capacity". */ -void -objects_hash_empty(objects_hash_t *hash); - -/** Searching... **/ - -/* Returns a "random" element of HASH, for your viewing enjoyment. */ -void * -objects_hash_any_element(objects_hash_t *hash); - -/* Returns `true' if some element of HASH is "equal" to ELEMENT, - * according to HASH's element callbacks. */ -int -objects_hash_contains_element(objects_hash_t *hash, const void *element); - -/* Returns the element of HASH (or the appropriate `not an element - * marker' if there is none) which is "equal" to ELEMENT. */ -const void * -objects_hash_element(objects_hash_t *hash, const void *element); - -/* Returns an array with all the elements of HASH, terminated - * by HASH's "not an element marker". It is your responsibility - * to free the returned array. [NOTE: this responsibility may - * shift from your shoulders in a later revision.] */ -const void ** -objects_hash_all_elements(objects_hash_t *hash); - -/** Enumerating... **/ - -/* Returns an enumerator for HASH's elements. WARNING: DO NOT ALTER - * A HASH DURING AN ENUMERATION. DOING SO WILL PROBABLY LEAVE YOUR ENUMERATION - * IN AN INDETERMINATE STATE. If you are hell-bent on ignoring the above - * warning, please check out the source code for some more specific - * information about when and how one can get away with it. */ -objects_hash_enumerator_t -objects_hash_enumerator_for_hash(objects_hash_t *hash); - -/* Returns `false' if the enumeration is complete, `true' otherwise. - * If ELEMENT is non-zero, the next element of ENUMERATOR's hash table - * is returned by reference. */ -int -objects_hash_enumerator_next_element(objects_hash_enumerator_t *enumerator, - const void **element); - -/** Statistics... **/ - -/* Returns `true' if HASH contains no elements. */ -int -objects_hash_is_empty(objects_hash_t *hash); - -/* Returns the number of elements HASH is currently holding. So long as no - * additions or removals occur, you may take this number to be accurate. */ -size_t -objects_hash_count(objects_hash_t *hash); - -/* Returns a number which represents (to some degree) HASH's current ability - * to hold stuff. Do not, however, rely on this for precision. Treat as - * a (reasonable) estimate. */ -size_t -objects_hash_capacity(objects_hash_t *hash); - -/* Performs an internal consistency check on HASH. Useful only - * for debugging. */ -int -objects_hash_check(objects_hash_t *hash); - -/** Resizing... **/ - -/* Resizes HASH to be ready to contain (at least) NEW_CAPACITY many elements. - * However, as far as you are concerned, it is indeterminate what exactly - * this means. After receiving and successfully processing this call, - * you are *not* guaranteed that HASH has actually set aside space for - * NEW_CAPACITY elements, for example. All that you are guaranteed is that, - * to the best of its ability, HASH will incur no loss in efficiency so long - * as it contains no more than NEW_CAPACITY elements. */ -size_t -objects_hash_resize(objects_hash_t *hash, size_t new_capacity); - -/* Shrinks (or grows) HASH to be comfortable with the number of elements - * it contains. In all likelyhood, after this call, HASH is more efficient - * in terms of its speed of search vs. use of space balance. */ -size_t -objects_hash_rightsize(objects_hash_t *hash); - -/** Describing... **/ - -/* Returns a string describing (the contents of) HASH. */ -NSString * -objects_hash_description(objects_hash_t *hash); - -/** Set theoretic operations... **/ - -/* Removes from HASH all of its elements which are not also - * elements of OTHER_HASH. Returns HASH as a courtesy. */ -objects_hash_t * -objects_hash_intersect_hash(objects_hash_t *hash, objects_hash_t *other_hash); - -/* Removes from HASH all of its elements which are also - * elements of OTHER_HASH. Returns HASH as a courtesy. */ -objects_hash_t * -objects_hash_minus_hash(objects_hash_t *hash, objects_hash_t *other_hash); - -/* Adds to HASH all elements of OTHER_HASH which are not - * already members of HASH. Returns HASH as a courtesy. */ -objects_hash_t * -objects_hash_union_hash(objects_hash_t *hash, objects_hash_t *other_hash); - -#endif /* __hash_h_OBJECTS_INCLUDE */ - diff --git a/Source/objects/list.h b/Source/objects/list.h deleted file mode 100644 index 2f3168620..000000000 --- a/Source/objects/list.h +++ /dev/null @@ -1,346 +0,0 @@ -/* A list structure. - * Copyright (C) 1995, 1996 Free Software Foundation, Inc. - * - * Author: Albin L. Jones - * Created: Tue Sep 5 17:25:59 EDT 1995 - * Updated: Sun Mar 10 23:24:49 EST 1996 - * Serial: 96.03.10.02 - * - * This file is part of the GNU Objective C Class 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 __list_h_OBJECTS_INCLUDE -#define __list_h_OBJECTS_INCLUDE 1 - -/**** Included Headers *******************************************************/ - -#include -#include -#include -#include - -/**** Type, Constant, and Macro Definitions **********************************/ - -typedef struct _objects_list objects_list_t; -typedef struct _objects_list_node objects_list_node_t; -typedef struct _objects_list_enumerator objects_list_enumerator_t; - -struct _objects_list_node -{ - objects_list_t *list; - - objects_list_node_t *next_in_list; - objects_list_node_t *prev_in_list; - - const void *element; -}; - -struct _objects_list -{ - /* Container identifiers */ - int magic_number; - size_t serial_number; - NSZone *zone; - NSString *name; - const void *extra; - objects_callbacks_t extra_callbacks; - - /* Element callbacks */ - objects_callbacks_t callbacks; - - /* Internal counters */ - size_t node_count; - size_t element_count; - - /* Databanks */ - objects_list_node_t *first_node; - objects_list_node_t *last_node; -}; - -struct _objects_list_enumerator -{ - objects_list_t *list; - objects_list_node_t *node; - size_t forward; -}; - - -/**** Function Prototypes ****************************************************/ - -/** Basics **/ - -#include -#include - -/** Creating **/ - -objects_list_t * -objects_list_alloc(void); - -objects_list_t * -objects_list_alloc_with_zone(NSZone *zone); - -objects_list_t * -objects_list_with_zone(NSZone *zone); - -objects_list_t * -objects_list_with_callbacks(objects_callbacks_t callbacks); - -objects_list_t * -objects_list_with_zone_with_callbacks(NSZone *zone, - objects_callbacks_t callbacks); - -objects_list_t * -objects_list_of_char_p(void); - -objects_list_t * -objects_list_of_non_owned_void_p(void); - -objects_list_t * -objects_list_of_owned_void_p(void); - -objects_list_t * -objects_list_of_int(void); - -objects_list_t * -objects_list_of_int_p(void); - -objects_list_t * -objects_list_of_id(void); - -/** Initializing **/ - -objects_list_t * -objects_list_init(objects_list_t *list); - -objects_list_t * -objects_list_init_with_callbacks(objects_list_t *list, - objects_callbacks_t callbacks); - -/** Copying **/ - -objects_list_t * -objects_list_copy(objects_list_t *old_list); - -objects_list_t * -objects_list_copy_with_zone(objects_list_t *old_list, - NSZone *zone); - -/** Destroying **/ - -void -objects_list_dealloc(objects_list_t *list); - -/** Comparing **/ - -int -objects_list_is_equal_to_list(objects_list_t *list, - objects_list_t *other_list); - -/** Concatenating **/ - -objects_list_t * -objects_list_append_list(objects_list_t *base_list, - objects_list_t *suffix_list); - -objects_list_t * -objects_list_prepend_list(objects_list_t *base_list, - objects_list_t *prefix_list); - -objects_list_t * -objects_list_at_index_insert_list(objects_list_t *base_list, - long int n, - objects_list_t *infix_list); - -/** Permuting **/ - -objects_list_t * -objects_list_roll_to_nth_element(objects_list_t *list, long int n); - -objects_list_t * -objects_list_roll_to_element(objects_list_t *list, const void *element); - -objects_list_t * -objects_list_roll_to_nth_occurrance_of_element(objects_list_t *list, - long int n, - const void *element); - -objects_list_t * -objects_list_invert(objects_list_t *list); - -objects_list_t * -objects_list_swap_elements_at_indices(objects_list_t *list, - long int m, - long int n); - -/** Adding **/ - -const void * -objects_list_append_element(objects_list_t *list, const void *element); - -const void * -objects_list_append_element_if_absent(objects_list_t *list, - const void *element); - -const void * -objects_list_prepend_element(objects_list_t *list, const void *element); - -const void * -objects_list_prepend_element_if_absent(objects_list_t *list, - const void *element); - -const void * -objects_list_at_index_insert_element(objects_list_t *list, - long int n, - const void *element); - -const void * -objects_list_at_index_insert_element_if_absent(objects_list_t *list, - long int n, - const void *element); - -const void * -objects_list_queue_push_element(objects_list_t *list, const void *element); - -const void * -objects_list_stack_push_element(objects_list_t *list, const void *element); - -/** Replacing **/ - -void -objects_list_replace_nth_occurrance_of_element(objects_list_t *list, - long int n, - const void *old_element, - const void *new_element); - -void -objects_list_replace_element(objects_list_t *list, - const void *old_element, - const void *new_element); - -void -objects_list_replace_nth_element(objects_list_t *list, - long int n, - const void *new_element); - -void -objects_list_replace_first_element(objects_list_t *list, - const void *new_element); - -void -objects_list_replace_last_element(objects_list_t *list, - const void *new_element); - -/** Removing **/ - -void -objects_list_remove_nth_occurrence_of_element(objects_list_t *list, - long int n, - const void *element); - -void -objects_list_remove_element(objects_list_t *list, const void *element); - -void -objects_list_remove_nth_element(objects_list_t *list, long int n); - -void -objects_list_remove_first_element(objects_list_t *list); - -void -objects_list_remove_last_element(objects_list_t *list); - -void -objects_list_queue_pop_element(objects_list_t *list); - -void -objects_list_queue_pop_nth_element(objects_list_t *list, long int n); - -void -objects_list_stack_pop_element(objects_list_t *list); - -void -objects_list_stack_pop_nth_element(objects_list_t *list, long int n); - -/** Emptying **/ - -void -objects_list_empty(objects_list_t *list); - -/** Searching **/ - -int -objects_list_contains_element(objects_list_t *list, const void *element); - -const void * -objects_list_element(objects_list_t *list, const void *element); - -const void * -objects_list_nth_element(objects_list_t *list, long int n); - -const void * -objects_list_first_element(objects_list_t *list); - -const void * -objects_list_last_element(objects_list_t *list); - -const void ** -objects_list_all_elements(objects_list_t *list); - -/** Enumerating **/ - -objects_list_enumerator_t -objects_list_enumerator(objects_list_t *list); - -objects_list_enumerator_t -objects_list_forward_enumerator(objects_list_t *list); - -objects_list_enumerator_t -objects_list_reverse_enumerator(objects_list_t *list); - -int -objects_list_enumerator_next_element(objects_list_enumerator_t *enumerator, - const void **element); - -/** Mapping **/ - -/* NO WARNING: The mapping function FCN need not be one-to-one on the - * elements of LIST. In fact, FCN may do whatever it likes. */ -objects_list_t * -objects_list_map_elements(objects_list_t *list, - const void *(*fcn)(const void *, void *), - void *user_data); - -/** Statistics **/ - -int -objects_list_is_empty(objects_list_t *list); - -size_t -objects_list_count(objects_list_t *list); - -size_t -objects_list_capacity(objects_list_t *list); - -int -objects_list_check(objects_list_t *list); - -/** Miscellaneous **/ - -objects_hash_t * -objects_hash_init_from_list(objects_hash_t *hash, objects_list_t *list); - -#endif /* __list_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/magic.h b/Source/objects/magic.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/Source/objects/map.h b/Source/objects/map.h deleted file mode 100644 index 8f7ebcfd9..000000000 --- a/Source/objects/map.h +++ /dev/null @@ -1,429 +0,0 @@ -/* A map table. - * Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. - * - * Author: Albin L. Jones - * Created: ??? ??? ?? ??:??:?? ??? 1993 - * Updated: Thu Mar 21 00:05:43 EST 1996 - * Serial: 96.03.20.04 - * - * This file is part of the GNU Objective C Class 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 __map_h_OBJECTS_INCLUDE -#define __map_h_OBJECTS_INCLUDE 1 - -/**** Included Headers *******************************************************/ - -#include -#include -#include - -/**** Type, Constant, and Macro Definitions **********************************/ - -/* Need these up here because of their interdependence. */ -typedef struct _objects_map objects_map_t; -typedef struct _objects_map_bucket objects_map_bucket_t; -typedef struct _objects_map_node objects_map_node_t; -typedef struct _objects_map_enumerator objects_map_enumerator_t; - -/* Important structures... */ - -/* Private type for elemental holding. */ -struct _objects_map_node -{ - /* The map table with which the node is associated. */ - objects_map_t *map; - - /* The bucket in MAP in which the node sits. */ - objects_map_bucket_t *bucket; - - /* These hold the BUCKET linked list together. */ - objects_map_node_t *next_in_bucket; - objects_map_node_t *prev_in_bucket; - - /* For enumerating over the whole map table. These make - * enumerating much quicker. They also make it safer. */ - objects_map_node_t *next_in_map; - objects_map_node_t *prev_in_map; - - const void *key; - const void *value; -}; - -/* Private type for holding chains of nodes. */ -struct _objects_map_bucket -{ - /* The number of nodes in this bucket. For internal consistency checks. */ - size_t node_count; - - /* The number of elements in this bucket. (This had *better* be - * the same as NODE_COUNT, or something's wrong.) */ - size_t element_count; - - /* The head of this bucket's linked list of nodes. */ - objects_map_node_t *first_node; -}; - -/* The map table type. */ -struct _objects_map -{ - /* All structures have these... - * And all structures have them in the same order. */ - int magic_number; - size_t serial_number; - NSZone *zone; - NSString *name; - const void *extra; - objects_callbacks_t extra_callbacks; - - /* For keys...And Values. */ - objects_callbacks_t key_callbacks; - objects_callbacks_t value_callbacks; - - /* Internal counters */ - size_t bucket_count; - size_t node_count; - size_t element_count; - - /* Places to start looking for elements. */ - objects_map_bucket_t *buckets; /* Organized as a hash. */ - objects_map_node_t *first_node; /* Organized as a linked list. - * (For enumerating...) */ -}; - -/* Type for enumerating the elements of a map table. */ -struct _objects_map_enumerator -{ - objects_map_t *map; /* To which hash do I belong? */ - objects_map_node_t *node; /* Which node is next? */ -}; - -/**** Function Prototypes ****************************************************/ - -/** Basics... **/ - -/* All the structures (hashes, maps, lists, and arrays) have - * the same basic ideas behind them. */ - -#include -#include - -/** Callbacks... **/ - -/* Returns a collection of callbacks for use with hash tables. */ -objects_callbacks_t -objects_callbacks_for_map(void); - -/** Creating... **/ - -/* Allocate a hash table in the default zone. */ -objects_map_t * -objects_map_alloc(void); - -/* Allocate a hash table in the memory block ZONE. */ -objects_map_t * -objects_map_alloc_with_zone(NSZone *zone); - -/* Create an empty map table in the memory block ZONE. The returned - * hash table has a "reasonable" default capacity, but will need to - * be resized to suit your specific needs if more than a couple of - * dozen key/value pairs will be placed within it. */ -objects_map_t * -objects_map_with_zone_with_callbacks(NSZone *zone, - objects_callbacks_t key_callbacks, - objects_callbacks_t value_callbacks); - -/* Like calling 'objects_map_with_zone_with_callbacks(0, key_callbacks, - * value_callbacks)'. */ -objects_map_t * -objects_map_with_callbacks(objects_callbacks_t key_callbacks, - objects_callbacks_t value_callbacks); - -/* Like calling 'objects_map_with_zone_with_callbacks(0, - * objects_callbacks_standard(), objects_callbacks_standard())'. */ -objects_map_t * -objects_map_with_zone(NSZone *zone); - -/* Shortcuts... */ -objects_map_t *objects_map_of_int(void); -objects_map_t *objects_map_of_int_to_char_p(void); -objects_map_t *objects_map_of_int_to_non_owned_void_p(void); -objects_map_t *objects_map_of_int_to_id(void); -objects_map_t *objects_map_of_char_p(void); -objects_map_t *objects_map_of_char_p_to_int(void); -objects_map_t *objects_map_of_char_p_to_non_owned_void_p(void); -objects_map_t *objects_map_of_char_p_to_id(void); -objects_map_t *objects_map_of_non_owned_void_p(void); -objects_map_t *objects_map_of_non_owned_void_p_to_int(void); -objects_map_t *objects_map_of_non_owned_void_p_to_char_p(void); -objects_map_t *objects_map_of_non_owned_void_p_to_id(void); -objects_map_t *objects_map_of_id(void); - -/** Initializing... **/ - -objects_map_t * -objects_map_init(objects_map_t *map); - -objects_map_t * -objects_map_init_with_callbacks(objects_map_t *map, - objects_callbacks_t key_callbacks, - objects_callbacks_t value_callbacks); - -objects_map_t * -object_map_init_from_map(objects_map_t *map, objects_map_t *old_map); - -/** Destroying... **/ - -/* Releases all the keys and values of MAP, and then - * deallocates MAP itself. */ -void -objects_map_dealloc(objects_map_t *map); - -/** Gathering statistics on a map... **/ - -/* Returns the number of key/value pairs in MAP. */ -size_t -objects_map_count(objects_map_t *map); - -/* Returns some (inexact) measure of how many key/value pairs - * MAP can comfortably hold without resizing. */ -size_t -objects_map_capacity(objects_map_t *map); - -/* Performs an internal consistency check, returns 'true' if - * everything is OK, 'false' otherwise. Really useful only - * for debugging. */ -int -objects_map_check(objects_map_t *map); - -/** Finding elements in a map... **/ - -/* Returns 'true' if and only if some key in MAP is equal - * (in the sense of the key callbacks of MAP) to KEY. */ -int -objects_map_contains_key(objects_map_t *map, const void *key); - -/* Returns 'true' if and only if some value in MAP is equal - * (in the sense of the value callbacks of MAP) to VALUE. */ -/* WARNING: This is rather inefficient. Not to be used lightly. */ -int -objects_map_contains_value(objects_map_t *map, const void *value); - -/* If KEY is in MAP, then the following three things happen: - * (1) 'true' is returned; - * (2) if OLD_KEY is non-zero, then the key in MAP - * equal to KEY is placed there; - * (3) if VALUE is non-zero, then the value in MAP - * mapped to by KEY is placed there. - * If KEY is not in MAP, then the following three things happen: - * (1) 'false' is returned; - * (2) if OLD_KEY is non-zero, then the "not a key marker" - * for MAP is placed there; - * (3) if VALUE is non-zero, then the the "not a value marker" - * for MAP is placed there. */ -int -objects_map_key_and_value_at_key(objects_map_t *map, - const void **old_key, - const void **value, - const void *key); - -/* If KEY is in MAP, then the key of MAP which is equal to KEY - * is returned. Otherwise, the "not a key marker" for MAP is returned. */ -const void * -objects_map_key_at_key(objects_map_t *map, const void *key); - -/* If KEY is in MAP, then the value of MAP which to which KEY maps - * is returned. Otherwise, the "not a value marker" for MAP is returned. */ -const void * -objects_map_value_at_key(objects_map_t *map, const void *key); - -/** Enumerating the nodes and elements of a map... **/ - -objects_map_enumerator_t -objects_map_enumerator_for_map(objects_map_t *map); - -int -objects_map_enumerator_next_key_and_value(objects_map_enumerator_t *enumerator, - const void **key, - const void **value); - -int -objects_map_enumerator_next_key(objects_map_enumerator_t *enumerator, - const void **key); - -int -objects_map_enumerator_next_value(objects_map_enumerator_t *enumerator, - const void **value); - -/** Obtaining an array of the elements of a map... **/ - -const void ** -objects_map_all_keys_and_values(objects_map_t *map); - -const void ** -objects_map_all_keys(objects_map_t *map); - -const void ** -objects_map_all_values(objects_map_t *map); - -/** Removing... **/ - -/* Removes the key/value pair (if any) from MAP whose key is KEY. */ -void -objects_map_remove_key(objects_map_t *map, const void *key); - -/* Releases all of the keys and values of MAP without - * altering MAP's capacity. */ -void -objects_map_empty(objects_map_t *map); - -/** Adding... **/ - -const void * -objects_map_at_key_put_value_known_absent(objects_map_t *map, - const void *key, - const void *value); - -const void * -objects_map_at_key_put_value(objects_map_t *map, - const void *key, - const void *value); - -const void * -objects_map_at_key_put_value_if_absent(objects_map_t *map, - const void *key, - const void *value); - -/** Replacing... **/ - -void -objects_map_replace_key(objects_map_t *map, const void *key); - -/** Comparing... **/ - -/* Returns 'true' if every key/value pair of MAP2 is also a key/value pair - * of MAP1. Otherwise, returns 'false'. */ -int -objects_map_contains_map(objects_map_t *map1, objects_map_t *map2); - -/* Returns 'true' if MAP1 and MAP2 have the same number of key/value pairs, - * MAP1 contains MAP2, and MAP2 contains MAP1. Otherwise, returns 'false'. */ -int -objects_map_is_equal_to_map(objects_map_t *map1, objects_map_t *map2); - -/* Returns 'true' iff every key of MAP2 is a key of MAP1. */ -int -objects_map_keys_contain_keys_of_map(objects_map_t *map1, objects_map_t *map2); - -/* Returns 'true' if MAP1 and MAP2 have the same number of key/value pairs, - * MAP1 contains every key of MAP2, and MAP2 contains every key of MAP1. - * Otherwise, returns 'false'. */ -int -objects_map_keys_are_equal_to_keys_of_map(objects_map_t *map1, - objects_map_t *map2); - -/* Returns 'true' iff some key/value pair of MAP1 if also - * a key/value pair of MAP2. */ -int -objects_map_intersects_map(objects_map_t *map1, objects_map_t *map2); - -/* Returns 'true' iff some key of MAP1 if also a key of MAP2. */ -int -objects_map_keys_intersect_keys_of_map(objects_map_t *map1, - objects_map_t *map2); -/** Copying... **/ - -/* Returns a copy of OLD_MAP in ZONE. Remember that, as far as what - * (if anything) OLD_MAP's keys and values point to, this copy is - * shallow. If, for example, OLD_MAP is a map from int to int, then - * you've got nothing more to worry about. If, however, OLD_MAP is a - * map from id to id, and you want the copy of OLD_MAP to be "deep", - * you'll need to use the mapping functions below to make copies of - * all of the returned map's elements. */ -objects_map_t * -objects_map_copy_with_zone(objects_map_t *old_map, NSZone *zone); - -/* Just like 'objects_map_copy_with_zone()', but returns a copy of - * OLD_MAP in the default zone. */ -objects_map_t * -objects_map_copy(objects_map_t *old_map); - -/** Mapping... **/ - -/* Iterates through MAP, replacing each key with the result of - * '(*kfcn)(key, user_data)'. Useful for deepening copied maps - * and other uniform (and one-to-one) transformations of map keys. */ -/* WARNING: The mapping function KFCN *must* be one-to-one on the - * (equivalence classes of) keys of MAP. I.e., for efficiency's sake, - * `objects_map_map_keys()' makes no provision for the possibility - * that KFCN maps two unequal keys of MAP to the same (or equal) keys. */ -objects_map_t * -objects_map_map_keys(objects_map_t *map, - const void *(*kfcn)(const void *, void *), - void *user_data); - -/* Iterates through MAP, replacing each value with the result of - * '(*vfcn)(value, user_data)'. Useful for deepening copied maps - * and other uniform transformations of map keys. */ -/* NO WARNING: The mapping function VFCN need not be one-to-one on - * (the equivalence classes of) values. */ -objects_map_t * -objects_map_map_values(objects_map_t *map, - const void *(*vfcn)(const void *, void *), - void *user_data); - -/** Resizing... **/ - -/* Resizes MAP to be ready to contain (at least) NEW_CAPACITY many elements. - * However, as far as you are concerned, it is indeterminate what exactly - * this means. After receiving and successfully processing this call, - * you are *not* guaranteed that MAP has actually set aside space for - * NEW_CAPACITY elements, for example. All that you are guaranteed is that, - * to the best of its ability, MAP will incur no loss in efficiency so long - * as it contains no more than NEW_CAPACITY elements. */ -size_t -objects_map_resize(objects_map_t *map, size_t new_capacity); - -/* Shrinks (or grows) MAP to be comfortable with the number of elements - * it contains. In all likelyhood, after this call, MAP is more efficient - * in terms of its speed of search vs. use of space balance. */ -size_t -objects_map_rightsize(objects_map_t *map); - -/** Describing... **/ - -/* Returns a string describing (the contents of) MAP. */ -NSString * -objects_map_description(objects_map_t *map); - -/** Set theoretic operations... **/ - -objects_map_t * -objects_map_intersect_map(objects_map_t *map, objects_map_t *other_map); - -objects_map_t * -objects_map_minus_map(objects_map_t *map, objects_map_t *other_map); - -objects_map_t * -objects_map_union_map(objects_map_t *map, objects_map_t *other_map); - -objects_hash_t * -objects_hash_init_from_map_keys(objects_hash_t *hash, objects_map_t *map); - -objects_hash_t * -objects_hash_init_from_map_values(objects_hash_t *hash, objects_map_t *map); - -#endif /* __map_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/mframe.h b/Source/objects/mframe.h deleted file mode 100644 index f4401e6ca..000000000 --- a/Source/objects/mframe.h +++ /dev/null @@ -1,67 +0,0 @@ -/* Interface for functions that dissect/make method calls - Copyright (C) 1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: Oct 1994 - - This file is part of the GNU Objective C Class 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 __mframe_h_OBJECTS_INCLUDE -#define __mframe_h_OBJECTS_INCLUDE - -#include - -/* These functions are used to pull apart method calls, and put them - back together again. They are useful for things like distributed - objects, and cross-language communication glue between Objective C - and other languages. */ - -/* xxx Currently these function only work with the GNU Objective C - runtime, not the NeXT runtime. */ - - -/* Extract the arguments to a method call, as found in ARGFRAME, - according to type string TYPES, and encode them by calling ENCODER. - Return YES if and only if the method has some pass-by-reference - arguments. */ - -BOOL -mframe_dissect_call (arglist_t argframe, const char *types, - void (*encoder)(int,void*,const char*,int)); - -/* Decode the arguments to a method call by calling DECODER, knowing - what to decode by looking at type string ENCODED_TYPES. Build an - argframe of type arglist_t, and invoke the method. Then encode the - return value and the pass-by-reference values using ENCODER. */ - -void -mframe_do_call (const char *encoded_types, - void(*decoder)(int,void*,const char*), - void(*encoder)(int,void*,const char*,int)); - -/* Decode the return value and pass-by-reference arguments using - DECODER, knowning what to decode by looking at type string TYPES - and OUT_PARAMETERS, and put then into ARGFRAME. Return the - retval_t structure that can be passed to __builtin_return(). */ - -retval_t -mframe_build_return (arglist_t argframe, const char *types, - BOOL out_parameters, - void(*decoder)(int,void*,const char*,int)); - -#endif /* __mframe_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/minmax.h b/Source/objects/minmax.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/Source/objects/number.h b/Source/objects/number.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/Source/objects/numbers.h b/Source/objects/numbers.h deleted file mode 100644 index 5ad2dda8b..000000000 --- a/Source/objects/numbers.h +++ /dev/null @@ -1,85 +0,0 @@ -/* Structure counters and functions for getting at them. - * Copyright (C) 1995, 1996 Free Software Foundation, Inc. - * - * Author: Albin L. Jones - * Created: Sun Dec 3 00:28:01 EST 1995 - * Updated: Mon Mar 18 14:36:49 EST 1996 - * Serial: 96.03.18.03 - * - * This file is part of the GNU Objective C Class 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 __numbers_h_OBJECTS_INCLUDE -#define __numbers_h_OBJECTS_INCLUDE 1 - -/**** Included Headers *******************************************************/ - -#include - -/**** Type, Constant, and Macro Definitions **********************************/ - -/** Magic numbers... **/ - -/* Magic numbers for the different types of structures... */ -#define OBJECTS_MAGIC_ARRAY 0x1b658008 /* Thu Mar 2 02:28:50 EST 1994 */ -#define OBJECTS_MAGIC_DATA 0x1b651971 /* Fri Nov 24 21:46:14 EST 1995 */ -#define OBJECTS_MAGIC_HASH 0x1b653ee5 /* ??? ??? ?? ??:??:?? ??? 1993 */ -#define OBJECTS_MAGIC_HEAP 0x1b65beef /* Tue Sep 5 17:21:34 EDT 1995 */ -#define OBJECTS_MAGIC_LIST 0x1b65600d /* Tue Sep 5 17:23:50 EDT 1995 */ -#define OBJECTS_MAGIC_MAP 0x1b65abba /* ??? ??? ?? ??:??:?? ??? 1993 */ - -/* WARNING: Don't use these. They are not guaranteed to remain in future - * editions of this file. They are here only as a cheap fix for an - * annoying little problem. */ -/* FIXME: Get rid of these. See `x-basics.[ch].in' - * and `x-callbacks.[ch].in'. */ -#define _OBJECTS_MAGIC_array OBJECTS_MAGIC_ARRAY -#define _OBJECTS_MAGIC_data OBJECTS_MAGIC_DATA -#define _OBJECTS_MAGIC_hash OBJECTS_MAGIC_HASH -#define _OBJECTS_MAGIC_heap OBJECTS_MAGIC_HEAP -#define _OBJECTS_MAGIC_list OBJECTS_MAGIC_LIST -#define _OBJECTS_MAGIC_map OBJECTS_MAGIC_MAP - -/* Internal counters for the three functions below. They are placed here - * purely for your viewing pleasure. WARNING: Do not mess with these - * unless you know what you're doing. */ -extern size_t ___objects_number_allocated; -extern size_t ___objects_number_deallocated; -extern size_t ___objects_number_serialized; - -/**** Function Prototypes ****************************************************/ - -/* Returns the number of hash tables, map tables, lists, - * and sparse arrays allocated thus far. */ -size_t -_objects_number_allocated(void); - -/* Returns the number of hash tables, map tables, lists, - * and sparse arrays deallocated thus far. */ -size_t -_objects_number_deallocated(void); - -/* Returns (but does not increment) the number of hash tables, - * map tables, lists, and sparse arrays given serial numbers thus far. */ -size_t -_objects_number_serialized(void); - -/* Returns the least power of two strictly greater than BOUND. */ -size_t -_objects_next_power_of_two(size_t bound); - -#endif /* __numbers_h_OBJECTS_INCLUDE */ - diff --git a/Source/objects/objc-gnu2next.h b/Source/objects/objc-gnu2next.h deleted file mode 100644 index 002faabb9..000000000 --- a/Source/objects/objc-gnu2next.h +++ /dev/null @@ -1,281 +0,0 @@ -/* Definitions to allow compilation of GNU objc code with NeXT runtime - Copyright (C) 1993,1994 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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. -*/ - -/* This file is by no means complete. */ - -#ifndef __objc_gnu2next_h_INCLUDE_GNU -#define __objc_gnu2next_h_INCLUDE_GNU - -#include - -#if NeXT_runtime - -#include - -#define arglist_t marg_list -#define retval_t void* -#define TypedStream NXTypedStream - -#define objc_write_type(STREAM, TYPE, VAR) \ - NXWriteType(STREAM, TYPE, VAR) -#define objc_write_types(STREAM, TYPE, args...) \ - NXWriteTypes(STREAM, TYPE, args) -#define objc_write_object(STREAM, VAR) \ - NXWriteObject(STREAM, VAR) -#define objc_write_object_reference(STREAM, VAR) \ - NXWriteObjectReference(STREAM, VAR) -#define objc_read_type(STREAM, TYPE, VAR) \ - NXReadType(STREAM, TYPE, VAR) -#define objc_read_types(STREAM, TYPE, args...) \ - NXReadTypes(STREAM, TYPE, args) -#define objc_read_object(STREAM, VAR) \ - do { (*(VAR)) = NXReadObject(STREAM); } while (0) -#define objc_write_root_object \ - NXWriteRootObject -#define objc_open_typed_stream_for_file \ - NXOpenTypedStreamForFile -#define objc_close_typed_stream NXCloseTypedStream - -#define class_create_instance(CLASS) class_createInstance(CLASS, 0) -#define sel_get_name(ASEL) sel_getName(ASEL) -#define sel_get_uid(METHODNAME) sel_getUid(METHODNAME) -#define class_get_instance_method(CLASSPOINTER, SEL) \ - class_getInstanceMethod(CLASSPOINTER, SEL) -#define class_get_class_method(CLASSPOINTER, SEL) \ - class_getClassMethod(CLASSPOINTER, SEL) -#define class_get_class_name(CLASSPOINTER) \ - (((struct objc_class*)(CLASSPOINTER))->name) -#define method_get_sizeof_arguments(METHOD) \ - method_getSizeOfArguments(METHOD) -#define objc_lookup_class(CLASSNAME) \ - objc_lookUpClass(CLASSNAME) -#define sel_get_any_uid(SELNAME) \ - sel_getUid(SELNAME) -#define object_get_class(OBJECT) \ - (((struct objc_class*)(OBJECT))->isa) -#define class_get_super_class(CLASSPOINTER) \ - (((struct objc_class*)(CLASSPOINTER))->super_class) -#define objc_get_class(CLASSNAME) \ - objc_lookUpClass(CLASSNAME) /* not exactly right */ -#define class_get_version(CLASSPOINTER) \ - (((struct objc_class*)(CLASSPOINTER))->version) -#define __objc_responds_to(OBJECT,SEL) \ - class_getInstanceMethod(object_get_class(OBJECT), SEL) -#define CLS_ISCLASS(CLASSPOINTER) \ - ((((struct objc_class*)(CLASSPOINTER))->info) & CLS_CLASS) -#define CLS_ISMETA(CLASSPOINTER) \ - ((((struct objc_class*)(CLASSPOINTER))->info) & CLS_META) -#define objc_msg_lookup(OBJ,SEL) \ - (class_getInstanceMethod(object_get_class(OBJ), SEL)->method_imp) - -#if 1 -volatile void objc_fatal(const char* msg); -#else -#define objc_fatal(FMT, args...) \ - do { fprintf (stderr, (FMT), ##args); abort(); } while (0) -#endif - -#define OBJC_READONLY 1 -#define OBJC_WRITEONLY 2 - - -/* Methods defined by the GNU runtime, which libobjects will provide - if the GNU runtime isn't being used. */ - -int objc_sizeof_type(const char* type); -int objc_alignof_type(const char* type); -int objc_aligned_size (const char* type); -int objc_promoted_size (const char* type); -inline const char* objc_skip_type_qualifiers (const char* type); -const char* objc_skip_typespec (const char* type); -inline const char* objc_skip_offset (const char* type); -const char* objc_skip_argspec (const char* type); -unsigned objc_get_type_qualifiers (const char* type); - -/* The following from GNU's objc/objc-api.h */ - -/* For functions which return Method_t */ -#define METHOD_NULL (Method_t)0 - -static inline BOOL -class_is_class(Class* class) -{ - return CLS_ISCLASS(class); -} - -static inline BOOL -class_is_meta_class(Class* class) -{ - return CLS_ISMETA(class); -} - -static inline BOOL -object_is_class(id object) -{ - return CLS_ISCLASS((Class*)object); -} - -static inline BOOL -object_is_instance(id object) -{ - return (object!=nil)&&CLS_ISCLASS(object_get_class(object)); -} - -static inline BOOL -object_is_meta_class(id object) -{ - return CLS_ISMETA((Class*)object); -} - - -/* The following from GNU's objc/list.h */ - -#include -#include - -struct objc_list { - void *head; - struct objc_list *tail; -}; - -/* Return a cons cell produced from (head . tail) */ - -static inline struct objc_list* -list_cons(void* head, struct objc_list* tail) -{ - struct objc_list* cell; - - cell = (struct objc_list*)(*objc_malloc)(sizeof(struct objc_list)); - cell->head = head; - cell->tail = tail; - return cell; -} - -/* Return the length of a list, list_length(NULL) returns zero */ - -static inline int -list_length(struct objc_list* list) -{ - int i = 0; - while(list) - { - i += 1; - list = list->tail; - } - return i; -} - -/* Return the Nth element of LIST, where N count from zero. If N - larger than the list length, NULL is returned */ - -static inline void* -list_nth(int index, struct objc_list* list) -{ - while(index-- != 0) - { - if(list->tail) - list = list->tail; - else - return 0; - } - return list->head; -} - -/* Remove the element at the head by replacing it by its successor */ - -static inline void -list_remove_head(struct objc_list** list) -{ - if ((*list)->tail) - { - struct objc_list* tail = (*list)->tail; /* fetch next */ - *(*list) = *tail;/* copy next to list head */ - (*objc_free)(tail);/* free next */ - } - else/* only one element in list */ - { - (*objc_free)(*list); - (*list) = 0; - } -} - - -/* Remove the element with `car' set to ELEMENT */ - -static inline void -list_remove_elem(struct objc_list** list, void* elem) -{ - while (*list) { - if ((*list)->head == elem) - list_remove_head(list); - list = &((*list)->tail); - } -} - -/* Map FUNCTION over all elements in LIST */ - -static inline void -list_mapcar(struct objc_list* list, void(*function)(void*)) -{ - while(list) - { - (*function)(list->head); - list = list->tail; - } -} - -/* Return element that has ELEM as car */ - -static inline struct objc_list** -list_find(struct objc_list** list, void* elem) -{ - while(*list) - { - if ((*list)->head == elem) - return list; - list = &((*list)->tail); - } - return NULL; -} - -/* Free list (backwards recursive) */ - -static void -list_free(struct objc_list* list) -{ - if(list) - { - list_free(list->tail); - (*objc_free)(list); - } -} - -/* GNU Object.[hm] defines -compare:, NeXT doesn't, libobjects needs it. */ -@interface Object (GNUExtensions) -- (int)compare:anotherObject; -- shouldNotImplement:(SEL)op; -@end - -#endif /* NeXT_runtime */ - -#endif /* __objc_gnu2next_h_INCLUDE_GNU */ diff --git a/Source/objects/objc-malloc.h b/Source/objects/objc-malloc.h deleted file mode 100644 index 3fc88aaa2..000000000 --- a/Source/objects/objc-malloc.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Memory allocation definitions for Objective-C, easy garbage collection. - Copyright (C) 1993,1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __objc_malloc_h_INCLUDE_GNU -#define __objc_malloc_h_INCLUDE_GNU - -/* I do this to make substituting Boehm's Garbage Collection easy. */ -extern void *(*objc_malloc)(size_t); -extern void *(*objc_valloc)(size_t); -extern void *(*objc_atomic_malloc)(size_t); -extern void *(*objc_realloc)(void *, size_t); -extern void *(*objc_calloc)(size_t, size_t); -extern void (*objc_free)(void *); - -#define OBJC_MALLOC(VAR, TYPE, NUM) \ - ((VAR) = (TYPE *) (*objc_malloc)((unsigned)(NUM)*sizeof(TYPE))) -#define OBJC_VALLOC(VAR, TYPE, NUM) \ - ((VAR) = (TYPE *) (*objc_valloc)((unsigned)(NUM)*sizeof(TYPE))) -#define OBJC_ATOMIC_MALLOC(VAR, TYPE, NUM) \ - ((VAR) = (TYPE *) (*objc_atomic_malloc)((unsigned)(NUM)*sizeof(TYPE))) -#define OBJC_REALLOC(VAR, TYPE, NUM) \ - ((VAR) = (TYPE *) (*objc_realloc)((VAR), (unsigned)(NUM)*sizeof(TYPE))) -#define OBJC_CALLOC(VAR, TYPE, NUM) \ - ((VAR) = (TYPE *) (*objc_calloc)((unsigned)(NUM), sizeof(TYPE))) -#define OBJC_FREE(PTR) (*objc_free)((PTR)) - -#ifdef __OBJC__ -extern id MemoryExhaustedException; -#endif - -#endif /* __objc_malloc_h_INCLUDE_GNU */ diff --git a/Source/objects/objects.h b/Source/objects/objects.h deleted file mode 100644 index b6a45e920..000000000 --- a/Source/objects/objects.h +++ /dev/null @@ -1,74 +0,0 @@ -/* Includes interfaces for all concrete objects classes - Copyright (C) 1993,1994, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Date: May 1993 - - This file is part of the GNU Objective C Class 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 __objects_h_OBJECTS_INCLUDE -#define __objects_h_OBJECTS_INCLUDE - -#include - -/* Collection objects */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* Magnitude objects */ -#include -#include -#include - -/* Stream objects */ -#include -#include -#include - -/* Coder objects */ -#include -#include -#include - -/* Port objects */ -#include - -/* Remote messaging support objects */ -#include -#include -#include - -#include - -#endif /* __objects_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/stdobjects.h.in b/Source/objects/stdobjects.h.in deleted file mode 100644 index a7cff6c27..000000000 --- a/Source/objects/stdobjects.h.in +++ /dev/null @@ -1,125 +0,0 @@ -/* General purpose definitions for the GNU Objective-C Library. - Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. - - Written by: R. Andrew McCallum - Created: May 1993 - - This file is part of the GNU Objective C Class 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 __stdobjects_h_OBJECTS_INCLUDE -#define __stdobjects_h_OBJECTS_INCLUDE - -#include -#include -#include -#include -#include - -#if NeXT_runtime - #include - #include - #include - #ifndef _C_ATOM - #define _C_ATOM '%' - #endif - #define _F_CONST 0x01 - #define _F_IN 0x01 - #define _F_OUT 0x02 - #define _F_INOUT 0x03 - #define _F_BYCOPY 0x04 - #define _F_ONEWAY 0x08 - #define _C_CONST 'r' - #define _C_IN 'n' - #define _C_INOUT 'N' - #define _C_OUT 'o' - #define _C_BYCOPY 'O' - #define _C_ONEWAY 'V' -#else /* GNU Objective C Runtime */ - #include - #include - #include - #include - #include -#endif - -#include -#include -@class String; - -/* The following five lines are maintained by the libobjects Makefile */ -#define OBJECTS_VERSION @OBJECTS_VERSION@ -#define OBJECTS_MAJOR_VERSION @OBJECTS_MAJOR_VERSION@ -#define OBJECTS_MINOR_VERSION @OBJECTS_MINOR_VERSION@ -#define OBJECTS_SUBMINOR_VERSION @OBJECTS_SUBMINOR_VERSION@ -#define OBJECTS_GCC_VERSION @OBJECTS_GCC_VERSION@ - -#define OBJECTS_PACKAGE_NAME libobjects - -extern const char objects_version[]; -extern const char objects_gcc_version[]; -#if NeXT_cc -extern const char objects_NeXT_cc_version[]; -#endif - -#define LAMBDA(RETTYPE, ARGS, BODY) \ -({RETTYPE __lambda_func ARGS BODY __lambda_func;}) - -#define LAMBDA_VOID_PERFORM(SELECTOR) \ -LAMBDA(void, (id _o), {[_o perform: SELECTOR];}) - -#define LAMBDA_ID_PERFORM(SELECTOR) \ -LAMBDA(id, (id _o), {return [_o perform: SELECTOR];}) - -#define LAMBDA_BOOL_PERFORM(SELECTOR) \ -LAMBDA(BOOL, (id _o), {if ([_o perform:SELECTOR]) return YES; else return NO;}) - - -#ifndef MAX -#define MAX(a,b) \ - ({typedef _ta = (a), _tb = (b); \ - _ta _a = (a); _tb _b = (b); \ - _a > _b ? _a : _b; }) -#endif - -#ifndef MIN -#define MIN(a,b) \ - ({typedef _ta = (a), _tb = (b); \ - _ta _a = (a); _tb _b = (b); \ - _a < _b ? _a : _b; }) -#endif - -#ifndef ABS -#define ABS(a) \ - ({typedef _ta = (a); \ - _ta _a = (a); \ - _a < 0 ? -_a : _a; }) -#endif - -#ifndef STRINGIFY -#define STRINGIFY(s) XSTRINGIFY(s) -#define XSTRINGIFY(s) #s -#endif - -#ifndef PTR2LONG -#define PTR2LONG(P) (((char*)(P))-(char*)0) -#endif -#ifndef LONG2PTR -#define LONG2PTR(L) (((char*)0)+(L)) -#endif - -#endif /* __stdobjects_h_OBJECTS_INCLUDE */ diff --git a/Source/objects/x-bas.h.in b/Source/objects/x-bas.h.in deleted file mode 100644 index 52998211b..000000000 --- a/Source/objects/x-bas.h.in +++ /dev/null @@ -1,126 +0,0 @@ -/* Basic functions for @XX@ structures. - * Copyright (C) 1995, 1996 Free Software Foundation, Inc. - * - * Author: Albin L. Jones - * Created: Mon Dec 11 01:24:48 EST 1995 - * Updated: Mon Mar 11 00:54:50 EST 1996 - * Serial: 96.03.11.03 - * - * This file is part of the GNU Objective C Class 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 __@XX@_bas_h_OBJECTS_INCLUDE -#define __@XX@_bas_h_OBJECTS_INCLUDE 1 - -/**** Included Headers *******************************************************/ - -#include -#include -#include -#include - -/**** Type, Constant, and Macro Definitions **********************************/ - -#define __@XX@__ 1 - -/**** Function Implementations ***********************************************/ - -/** Magic numbers... **/ - -/* Returns XX's magic number. */ -int -objects_@XX@_magic_number(objects_@XX@_t *xx); - -/** Zones... **/ - -/* Returns the allocs used to create and maintain XX. */ -NSZone * -objects_@XX@_zone(objects_@XX@_t *xx); - -/** Names... **/ - -/* Returns the name that was given to XX. */ -NSString * -objects_@XX@_name(objects_@XX@_t *xx); - -/* Gives XX a name. */ -void -objects_@XX@_set_name(objects_@XX@_t *xx, NSString *name); - -/* Takes away XX's name. */ -void -objects_@XX@_unset_name(objects_@XX@_t *xx); - -/** Serial numbers... **/ - -/* Returns the (process-wide) unique number given to the Libfn - * structure XX. See for more info. */ -size_t -objects_@XX@_serial_number(objects_@XX@_t *xx); - -/* Gives XX a new (process-wide) unique number. Numbers are not - * reused. See for more info. */ -size_t -_objects_@XX@_set_serial_number(objects_@XX@_t *xx); - -/** Extras... **/ - -/* Sets the callbacks associated with XX's ``extra''. NOTE: This must - * be done before calling `objects_@XX@_set_extra()', as these callbacks - * are used in that routine. */ -objects_callbacks_t -objects_@XX@_set_extra_callbacks(objects_@XX@_t *xx, - objects_callbacks_t callbacks); - -/* Returns the callbacks associated with XX's ``extra''. */ -objects_callbacks_t -objects_@XX@_extra_callbacks(objects_@XX@_t *xx); - -/* Returns XX's ``extra'', a little extra space that each - * structure carries around with it. Its use is - * implementation-dependent. */ -const void * -objects_@XX@_extra(objects_@XX@_t *xx); - -/* Sets XX's ``extra'', a little extra space that each structure - * carries around with it. Its use is implementation-dependent. */ -const void * -objects_@XX@_set_extra(objects_@XX@_t *xx, const void *extra); - -/* Resets XX's ``extra''. */ -void -objects_@XX@_unset_extra(objects_@XX@_t *xx); - -/** Low-level Creation and Destruction **/ - -/* Handles the universal, low-level allocation of structures. */ -objects_@XX@_t * -_objects_@XX@_alloc_with_zone(NSZone *zone); - -/* Handles the universal, low-level deallocation of structures. */ -void -_objects_@XX@_dealloc(objects_@XX@_t *xx); - -/* Handles the low-level copying of structures. */ -objects_@XX@_t * -_objects_@XX@_copy_with_zone(objects_@XX@_t *xx, NSZone *zone); - -/* Returns a low-level description of XX. */ -NSString * -_objects_@XX@_description(objects_@XX@_t *xx); - -#endif /* __@XX@_bas_h_OBJECTS_INCLUDE */ - diff --git a/Source/objects/x-basics.h.in b/Source/objects/x-basics.h.in deleted file mode 100644 index e69de29bb..000000000 diff --git a/Source/objects/x-callbacks.h.in b/Source/objects/x-callbacks.h.in deleted file mode 100644 index e69de29bb..000000000 diff --git a/Source/objects/x-cbs.h.in b/Source/objects/x-cbs.h.in deleted file mode 100644 index cf6c9f2af..000000000 --- a/Source/objects/x-cbs.h.in +++ /dev/null @@ -1,69 +0,0 @@ -/* Getting callbacks from @YY@ structures. - * Copyright (C) 1995, 1996 Free Software Foundation, Inc. - * - * Author: Albin L. Jones - * Created: Mon Dec 11 03:41:00 EST 1995 - * Updated: Mon Mar 11 00:54:20 EST 1996 - * Serial: 96.03.11.02 - * - * This file is part of the GNU Objective C Class 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 __@YY@_cbs_h_OBJECTS_INCLUDE -#define __@YY@_cbs_h_OBJECTS_INCLUDE 1 - -/**** Included Headers *******************************************************/ - -#include -#include - -/**** Type, Constant, and Macro Definitions **********************************/ - -#define __@YY@__ 1 - -/**** Function Implementations ***********************************************/ - -#ifdef __map__ - -/** Callbacks **/ - -/* Returns the callbacks associated with YY's keys. */ -objects_callbacks_t objects_@YY@_key_callbacks (objects_@YY@_t *yy); - -/* Returns the ``bogus'' marker associated with YY's keys. */ -const void *objects_@YY@_not_a_key_marker (objects_@YY@_t *yy); - -/* Returns the callbacks associated with YY's values. */ -objects_callbacks_t -objects_@YY@_value_callbacks (objects_@YY@_t *yy); - -/* Returns the ``bogus'' marker associated with YY's values. */ -const void *objects_@YY@_not_a_value_marker (objects_@YY@_t *yy); - -#else /* !__map__ */ - -/** Callbacks **/ - -/* Returns the callbacks associated with YY's elements. */ -objects_callbacks_t objects_@YY@_element_callbacks (objects_@YY@_t *yy); - -/* Returns the ``bogus'' marker associated with YY's elements. */ -const void *objects_@YY@_not_an_element_marker (objects_@YY@_t *yy); - -#endif /* __map__ */ - -#endif /* __@YY@_cbs_h_OBJECTS_INCLUDE */ -