preparation for avoiding the duplication of these methods in Coder.m.
([NSCoder +initialize]): New method.
(NSCoderNonCore): New class.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1510 72102866-910b-0410-8b05-ffd578937521
assertion to inside conditional for FREF being true.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1502 72102866-910b-0410-8b05-ffd578937521
Use ${OEXT}, not $(OEXT).
(ALL_INCLUDE_FLAGS): Look in ./include, not $(srcdir).
(GNU_HEADERS): Remove duplicate NS*.h files.
(gnustep/base): Make soft links to the $(srcdir) include files inside
./include.
(include/preface.h): Get preface.h.in from the $(srcdir)!
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1499 72102866-910b-0410-8b05-ffd578937521
(arginfo_func): New function.
(handle_printf_atsign): Get the string object without va_arg().
([NSString +initialize]): Use new function.
(Reported and fixed by Kai-Uwe Sattler
<sattler@volker.cs.Uni-Magdeburg.DE>.)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1492 72102866-910b-0410-8b05-ffd578937521
(NSGArchiverNullCStream): New class, interface and implementation.
([NSGArchiverNullCStream -decodeValueOfCType:at:withName:]): New method.
([NSGArchiverNullCStream -decodeValueOfCType:at:withName:]): New method.
([NSGArchiver -encodeRootObject:withName:]): New method.
([NSGArchiver -encodeConditionalObject:]): New method.
([NSGArchiver -_coderCreateReferenceForObject:]): New method.
([NSGArchiver -_coderCreateForwardReferenceForObject:]): New method.
([NSGArchiver -_coderForwardReferenceForObject:]): New method.
([NSGArchiver -_objectWillBeInProgress:]): New method.
([NSGArchiver -_objectNoLongerInProgress:]): New method.
([NSGArchiver -defaultDecoderClassname]): New method.
([NSGUnarchiver -_createReferenceBeforeInit]): New method.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1483 72102866-910b-0410-8b05-ffd578937521
([Encoder -_objectWillBeInProgress:]): New method.
([Encoder -_objectNoLongerInProgress:]): New method. Depending on
whether we are doing GNU or OpenStep style forward references one of
these two methods will create a backward reference to the object by
calling -_coderInternalCreateReferenceForObject:. This will effect
whether encoding make forward or backward references to objects in
progress. GNU uses forward references, which is robust even when the
object's -initWithCoder substitutes another object for self.
([Encoder -_encodeObject:withName:isBycopy:isForwardReference:]): Use
new methods. Don't call -_coderInternalCreateReferenceForObject here,
let one of the ...InProgress methods do it.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1481 72102866-910b-0410-8b05-ffd578937521
([Decoder -_coderCreateReferenceForObject:]): Add a debugging message.
([Decoder -_coderCreateReferenceForInterconnectedObject:]):
Autorelease the placeholder object.
([Decoder -_createReferenceBeforeInit]): New method. By default
return NO, for the GNU-style forward references.
([Decoder -decodeObjectAt:anObjPtr:name]): [CODER_OBJECT]: Use new
method; if it returns true, then we are using non-GNU, OpenStep-style
forward references. In this case: (1) don't try to decode the object by
sending +newWithCoder:, in fact, raise an error if the object wanted
to be decoded that way; (2) call _coderInternalCreateReferenceForObject
before sending -initWithCoder, not after; unfortunately this means
that -initWithCoder methods cannot substitute another object for self.
If it returns false, use the more robust GNU style forward references.
The NSGUnarchiver overrides this method to use the OpenStep style.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1480 72102866-910b-0410-8b05-ffd578937521
([Coder +archivedDataWithRootObject:]): Use Archiver class, not
NSArchiver, it matters because now the two classes handle forward
references differently.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1479 72102866-910b-0410-8b05-ffd578937521
(main): Use gnustep_base_user_main, not LibobjectsMain.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1431 72102866-910b-0410-8b05-ffd578937521
Rename all occurrences of `Foundation/' to `include/'.
Rename all occurrences of `libobjects' to `$(LIBRARY_NAME)'.
Rename all occurrences of `OBJECTS_*VERSION' to `*VERSION'.
(GNU_NEXT_INCLUDES): Renamed from OBJECTS_NEXT_INCLUDES.
(gnustep/base): New target; make symbolic link to `include'.
(all): Added dependancy on gnustep/base.
(install): Put the include files in gnustep/base. Make a link from
$(includedir)/Foundation to $(includedir)/gnustep/base.
(installdirs): Make $(includedir)/gnustep/base, not objects and
Foundation include directories.
(GNU_MFILES): stdobjects.m renamed to preface.m.
(GNU_HEADERS): LibobjectsMain.h renamed to fake-main.h. objects.h
renamed to all.h.
(HEADERS_INSTALL): stdobjects.h renamed to preface.h.
(maintainer-clean): Likewise.
(DIST_FILES): stdobjects.h.in renamed to preface.h.in.
(RCS_FILES): Likewise.
(include/preface.h): Target renamed from stdobjects.h.
(preface$(OEXT)): Likewise.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1409 72102866-910b-0410-8b05-ffd578937521
(o_vscanf$(OEXT), o_vscanf_pic$(OEXT)): New rules that turn off
warnings for o_vscanf.c, it generates a bunch of unimportant ones.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1381 72102866-910b-0410-8b05-ffd578937521
allows <objects/objc-malloc.h> to be include in non-ObjC files, i.e. C
files.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1380 72102866-910b-0410-8b05-ffd578937521
firstObject is minimum instead of maximum object.
([Heap -addObject:]): Likewise.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1371 72102866-910b-0410-8b05-ffd578937521
object.
([NSGDictionary -objectForKey:]): Method moved from
NSGMutableDictionary.
([NSGMutableDictionary +initialize]): Don't use static variable in
test.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1370 72102866-910b-0410-8b05-ffd578937521
name to see if object has already been encoded.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1365 72102866-910b-0410-8b05-ffd578937521
ANOBJPTR is NULL, and deal with it using a DUMMY_OBJECT local variable.
Remove CODER_OBJECT_FORWARD_SATISFIER case. In the CODER_OBJECT case,
decode the forward reference number, and deal with it appropriately.
See the ChangeLog comments for the Encoder changes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1359 72102866-910b-0410-8b05-ffd578937521
if object satisfies a forward reference *after* encoding it. This is
necessary because the encoding of subobjects may generate forward
references. (In a sense, this undoes the last change, but it is
significantly different in that we test whether the object is in the
object_2_fref table *after* encoding the object; before we looked in
the table before encoding the object.) As a consequence,
the CODER_OBJECT_FORWARD_SATISFIER tag is no longer necessary; this
was used to tag an object before it was encoded, but now we understand
that we cannot know whether this object satisfies a forward reference
until after it has been encoded. Thus, for all objects we encode an
unsigned int after encoding the object itself. This unsigned int is
either the forward reference number of zero, depending on whether this
object satisfies any forward references.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1358 72102866-910b-0410-8b05-ffd578937521
longer needed. Note: decoders built after this change will not be
able to read data files encoded before this change.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1357 72102866-910b-0410-8b05-ffd578937521
this object satisfies a forward reference, remove it from the
object_2_fref table before encoding the object, since, in the process
of encoding the object, we may generate more references to this
object, and we don't want to interpret this as another forward
reference satisfier; previously an object could get encoded as a
forward reference satisfier more than once.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1355 72102866-910b-0410-8b05-ffd578937521
references have unique names. Previous use of the MapTable count
for this purpose didn't work because we occasionally removed elements
from the table, and thus had aliased forward reference numbers.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1354 72102866-910b-0410-8b05-ffd578937521
and send -setLinkedList:, otherwise the links don't properly know
about their parent LinkedList.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1352 72102866-910b-0410-8b05-ffd578937521
:cStreamFormatVersion:]): Initialize new ivar.
([Encoder -_coderCreateForwardReferenceForObject:]): Use new ivar to
`gensym' a new forward reference.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1351 72102866-910b-0410-8b05-ffd578937521
fref_2_object with NSNonOwnedPointerMapValueCallBacks, not
NSObjectMapValueCallBacks.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1350 72102866-910b-0410-8b05-ffd578937521
now objc-malloc.h cannot be included in .c files, only .m files.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1348 72102866-910b-0410-8b05-ffd578937521
current pool, and setting our parent to be the current pool, be sure
to set our parent's _CHILD ivar to nil.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1340 72102866-910b-0410-8b05-ffd578937521
class_get_instance_method() to get the selector type.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1339 72102866-910b-0410-8b05-ffd578937521
object->class_pointer, not object_get_class(), because
object_get_class() of a class will return the argument, not the
metaclass---we want the metaclass.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1337 72102866-910b-0410-8b05-ffd578937521
INADDR_ANY, (not the host's address), so that others can connect using
any of the host's interfaces, including localhost. Add the host's
address to _LISTENING_ADDRESS after the bind().
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1336 72102866-910b-0410-8b05-ffd578937521
(Reported by Robert Quillen <rquillen@csugrad.cs.vt.edu>).
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1335 72102866-910b-0410-8b05-ffd578937521
Add more explanation to NSCAssert().
(class_add_behavior): New function, calling above function.
(behavior_class_add_category): New function.
(behavior_class_add_methods): Function renamed from
class_add_methods_if_not_there.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1325 72102866-910b-0410-8b05-ffd578937521
once and for all, avoid the need for those odd [super ...] calls, and
can remove many methods.
([NSGArray -initWithObjects:count:]): Method removed.
([NSGArray -indexOfObject:]): Method removed.
([NSGArray -objectAtIndex:]): Method removed.
([NSGMutableArray +initialize]): Add the NSMutableArrayNonCore
behavior, as above.
([NSGMutableArray -replaceObjectAtIndex:withObject:]): Method removed.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1324 72102866-910b-0410-8b05-ffd578937521
NSArrayNonCore behavior to NSArray.
Divide methods between NSMutableArray and NSMutableArrayNonCore
classes. Add NSArrayNonCore behavior to NSArray.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1323 72102866-910b-0410-8b05-ffd578937521
(class_add_behavior): Use NSCAssert() to make sure that we don't try
to increase the instance size of a class that has been subclassed;
(hopeless ivar layout confusion would result).
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1319 72102866-910b-0410-8b05-ffd578937521
leaks. Also improve efficiency by using a linked list of arrays
instead of realloc when more space is needed, and by using a cache of
pools that helps avoid the allocation/deallocation of pools.
(push_pool_to_cache): New function.
(pop_pool_from_cache): New function.
([NSAutoreleasePool +initialize]): New method.
([NSAutoreleasePool +allocWithZone:]): New method.
([NSAutoreleasePool -init]): Method overhauled to initialize new ivar
for handling exceptions, _child; also use pool cache.
(total_autoreleased_objects_count): New static variable.
(BEGINNING_POOL_SIZE): Macro renamed from DEFAULT_SIZE.
(autorelease_pool_cache, autorelease_pool_cache_size,
autorelease_pool_cache_count): New static variables.
([NSAutoreleasePool -_setChildPool:]): New method, handling stack and
dealing with exceptions.
([NSAutoreleasePool -addObject:]): Deal with linked list of arrays.
([NSAutoreleasePool -dealloc]): Deal with exceptions by releasing
child pools. Place self into the pool cache instead of deallocating.
([NSAutoreleasePool +resetTotalAutoreleasedObjects]): New method.
([NSAutoreleasePool +totalAutoreleasedObjects]): New method.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1311 72102866-910b-0410-8b05-ffd578937521
([NSArray -arrayByAddingObject:]): New function, from Scott
Christley.
([NSArray -arrayByAddingObjectsFromArray:]): Likewise.
([NSArray -subarrayWithRange:]): Implemented by Scott Christely.
([NSMutableArray -removeObjectIdenticalTo:]): Don't fail if the object
is not present.
([NSMutableArray -removeObject:]): Likewise.
([NSMutableArray -removeAllObjects]): Implemented by Scott Christley.
([NSMutableArray -setArray:]): New function, from Scott Christley.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1304 72102866-910b-0410-8b05-ffd578937521
ANOBJECT, not just one.
([IndexedCollection -replaceObject:withObject:]): Now replaces *all*
instances of OLDOBJECT, not just one.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1303 72102866-910b-0410-8b05-ffd578937521
grows by -_grow_factor, but never shrinks.
(incrementCount): Use the ABS() of _grow_factor.
(decrementCount): Only shrink the array if _grow_factor is > 0.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1298 72102866-910b-0410-8b05-ffd578937521
fixes.
(MFRAME_STRUCTURES_PASSED_BY_REFERENCE): Renamed from
CONNECTION_STRUCTURES_PASSED_BY_REFERENCE.
(mframe_dissect_call): Function renamed from dissect_method_call.
Remove some redundant if()-else clauses. Clarify case in which
OUT_PARAMETERS is true. Use switch statement instead of if-else's.
(mframe_do_call): Function renamed from make_method_call. Get the
local selector type from the target's Method, not from the selector
type; this will more reliably give the correct type string. Don't
bother to set OBJECT twice. Remove some redundant if()-else clauses.
Use NSParameterAssert, not assert, so we can catch problems, (and not
crash the D.O. server). Change the way memory management for decoded
arguments is handled to remove memory leaks; use new scheme for
DECODER functions that are responsonsible for making sure allocated
memory is eventually freed. Use alloca() to allocate space for _C_PTR
values, struct's and arrays. Overhaul the way floats and doubles are
extracted from the RETFRAME; use functions with __builtin_return,
instead of fishing around the RETFRAME. Use switch statement intead
of if-else's. Separate cases for char's and short's. Change some
local variable names for clarity.
(mframe_build_return): Function renamed from dissect_method_return.
Remove some redundant if()-else clauses. Use NSParameterAssert, not
assert. Change the way memory management for decoded arguments is
handled to remove memory leaks; use new scheme for DECODER functions
that are responsonsible for making sure allocated memory is eventually
freed. Use alloca() to allocate space for _C_PTR values, struct's and
arrays.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1292 72102866-910b-0410-8b05-ffd578937521
exponent as a short, not an int.
([BinaryCStream -decodeValueOfCType:at:withName:]): Likewise, decoding.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1291 72102866-910b-0410-8b05-ffd578937521
interface. In the nested function DECODER, autorelease any char*'s
that we decode, as required by the new memory reference scheme.
([Connection -_service_forwardForProxy:]): Likewise, for both.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1290 72102866-910b-0410-8b05-ffd578937521
Don't autorelease the malloc'ed pointer here; thus the behavior is
analogous to decoding an object: it gives you a reference, it is the
callers responsibility to free it.
([BinaryCStream -decodeValueOfCType:at:withName:]): [_C_DBL]: Fix
typo. Use mantissa1, not mantissa2 twice.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1289 72102866-910b-0410-8b05-ffd578937521
(FLOAT_FACTOR): New macro.
(WRITE_SIGNED_TYPE): Take new first argument, the pointer for the
data.
(READ_SIGNED_TYPE): Likewise.
(WRITE_UNSIGNED_TYPE): Likewise.
(READ_UNSIGNED_TYPE): Likewise.
([BinaryCStream -encodeValueOfCType:at:withName:]): [_C_FLT]: Use new
scheme, based on frexp() to turn a float into a series of ints.
[_C_DBL]: Likewise.
([BinaryCStream -decodeValueOfCType:at:withName:]): [_C_FLT]: Likewise
to match.
[_C_DBL]: Likewise.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1286 72102866-910b-0410-8b05-ffd578937521
NSNonRetainedObjectMapValueCallBacks, not NSObjectMapValueCallBacks,
because otherwise the object will never get dealloc'ed.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1282 72102866-910b-0410-8b05-ffd578937521
it raises an NSException, and doesn't abort().
([Connection -forwardForProxy:selector:argFrame:]): Decode the flag
that indicates whether the return packet hold an exception or the
return values. If it holds an exception, decode it and raise it.
([Connection -_service_forwardForProxy:]): Surround the processing of
the method request packet with NS_DURING...NS_ENDHANDLER. If an
exception is raised, catch it, encode in in a specially flagged
packet, and send the packet back to the client.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1278 72102866-910b-0410-8b05-ffd578937521
Autorelease the malloc'ed char pointer. Before memory was leaking.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1277 72102866-910b-0410-8b05-ffd578937521
changed to better use IPPORT_USERRESERVED.
([UdpInPort +newForReceivingFromPortNumber:]): Overhauled and
commented.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1260 72102866-910b-0410-8b05-ffd578937521
not NSNonRetainedObjectsMapKeyCallBacks; keying on addresses, and
avoiding a call to -isEqual is better.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1258 72102866-910b-0410-8b05-ffd578937521
Write the string with the host LENGTH, not the network LENGTH!
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1256 72102866-910b-0410-8b05-ffd578937521
isEqual:]. I did this to prevent an infinite loop while running
checks/nsarchiver.m, but I have a feeling that the bug might be in
map.c, not here. Look at this again!
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1254 72102866-910b-0410-8b05-ffd578937521
mirrors the earlier change to [NSGSet -nextObject].
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1253 72102866-910b-0410-8b05-ffd578937521
of objects and keys, to match _encodeContentsWithCoder:.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1252 72102866-910b-0410-8b05-ffd578937521
([TcpInPort -encodeWithCoder:]): Use encodeBytes:.., not
encodeValue..; the data is already in network byte-order.
([TcpOutPort -encodeWithCoder:]): Likewise.
([TcpOutPort +newWithCoder:]): Likewise.
([TcpOutPort
+newForSendingToSockaddr:withAcceptedSocket:pollingInPort:]): Set
entirety of _REMOTE_IN_PORT_ADDRESS to zero.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1227 72102866-910b-0410-8b05-ffd578937521
Specify object class in arg type for nested function.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1226 72102866-910b-0410-8b05-ffd578937521
(Coding -decodeBytes:count:withName:): Likewise, and pass COUNT, not
pointer to COUNT.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1223 72102866-910b-0410-8b05-ffd578937521
poll the inputs, but don't wait if there is nothing available
immediately. Check to make sure that the LIMIT_DATE hasn't already
past; if it has, return immediately, before polling input sources.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1220 72102866-910b-0410-8b05-ffd578937521
Use OBJC_MALLOC and friends, instead of NX_MALLOC.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1211 72102866-910b-0410-8b05-ffd578937521
the use of invalid Connections.
([Proxy +encodeObject:withConnectedCoder:]): Likewise.
([Proxy -forward::]): Likewise.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1208 72102866-910b-0410-8b05-ffd578937521
which we handle a request immediately. Before it inappropriately
queued call backs from the server on which we were waiting, causing us
to wait forever.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1204 72102866-910b-0410-8b05-ffd578937521
already autoreleased. Too many autoreleases were causing crashes.
(NSAllMapTableValues): Likewise.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1198 72102866-910b-0410-8b05-ffd578937521
PARENT is nil. This is correct behavior. Old behavior could cause
infinite loops in the PARENT pointers.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1197 72102866-910b-0410-8b05-ffd578937521
to RunLoopDefaultMode, not nil.
([NSTimer
+scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:]):
Likewise.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1195 72102866-910b-0410-8b05-ffd578937521
RunLoop in RunLoopConnectionReplyMode, not nil mode.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1194 72102866-910b-0410-8b05-ffd578937521
port to the RunLoop in new RunLoop style.
([Connection -addToRunLoop:forMode:]): Method removed.
([Connection -removeFromRunLoop:forMode:]): Method removed.
([Connection -_getReceivedReplyRmcWithSequenceNumber:]): Use new class
method for RunLoop.
([Connection -invalidate]): Remove comment about removing from
RunLoop. RunLoop's now automatically remove invalid ports.
(RunLoopConnectionReplyMode): New run loop mode string.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1192 72102866-910b-0410-8b05-ffd578937521
been added to; now the RunLoop manages this.
([TcpInPort +newForReceivingFromPortNumber:]): Don't initialize the
the removed ivar ACTIVE_FD_SET. Likewise with _RUN_LOOPS.
([TcpInPort -newPacketReceivedBeforeDate:]): Don't use removed
_RUN_LOOPS.
([TcpInPort -old_receivePacketWithTimeout:]): Remove old deprecated
method.
([TcpInPort -invokeWithObject:]): Method removed.
([TcpInPort -newPacketReceivedBeforeDate:]): Overhauled to use new
RunLoop mechanism.
([TcpInPort -getFds:count:]): New method, called by RunLoop.
([TcpInPort -readyForReadingOnFileDescriptor:]): Likewise.
([TcpInPort -_addClientOutPort:]): Updated for new scheme.
([TcpInPort -_connectedOutPortInvalidated:]): Likewise.
([TcpInPort -addToRunLoop:forMode:]): Method removed.
([TcpInPort -removeFromRunLoop:forMode:]): Method removed.
([TcpInPort -dealloc]): Don't release _RUN_LOOPS.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1189 72102866-910b-0410-8b05-ffd578937521
([RunLoop -init]): Initialize new ivars.
([RunLoop -currentMode]): New method.
([RunLoop -addFileDescriptor:object:forMode:]): Method replaces
-addFileDescriptor:invocation:forMode:, and re-implemented. Not yet
functional.
([RunLoop -removeFileDescriptor:forMode:]): Likewise.
([RunLoop -addPort:forMode:]): New method.
([RunLoop -removePort:forMode:]): New method.
([RunLoop -addTimer:forMode:]): Overhauled to do the right thing with
the MODE argument.
([RunLoop -acceptInputForMode:beforeDate:]): Method overhauled to ask
port objects for their FD's, create FD_2_OBJECT map table on the fly,
and initialize FDS on the fly. Now properly removed invalidated ports
from the MODE.
([RunLoop -runOnceBeforeDate:forMode:]): New method.
([RunLoop -runOnceBeforeDate:]): New method.
([RunLoop -runUntilDate:forMode:]): New method.
([RunLoop -runUntilDate:]): New method.
([RunLoop +runUntilDate:forMode:]): New method.
([RunLoop +runOnceBeforeDate:]): New method.
([RunLoop +runOnceBeforeDate:forMode:]): New method.
([RunLoop +currentMode]): New method.
(RunLoopDefaultMode): New global variable.
([NSObject -performSelector:afterDelay:]): Not implemented.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1187 72102866-910b-0410-8b05-ffd578937521
(RunLoop _mode_2_timers): New ivar.
(RunLoop _mode_2_in_ports): New ivar.
(RunLoop _mode_2_fd_listeners): New ivar.
(RunLoopDefaultMode): New extern variable.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1186 72102866-910b-0410-8b05-ffd578937521
assignment, not equality test for setting enumState to -1.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1156 72102866-910b-0410-8b05-ffd578937521
nil to avoid warning.
([ConstantCollection -maxObject]): Initialize MAX to nil.
([ConstantCollection -minObject]): Initialize MIN to nil.
([Collection -uniqueContents]): Iterate over CP, not SELF.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1152 72102866-910b-0410-8b05-ffd578937521
([ConstantIndexedCollection -lastObject]): Likewise.
([ConstantIndexedCollection -prevObjectWithEnumState:]): Use -1 to
deal with reversals at extremes.
([ConstantIndexedCollection -nextObjectWithEnumState:]): Use [self
count] to deal with reversals at extremes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1132 72102866-910b-0410-8b05-ffd578937521
([Connection +initialize]): Initialize it.
([Connection +newForInPort:outPort:ancestorConnection:]): Use new
static variable to handle ancestor; (ignore ancestor argument; the
method name will be changed later). Set the in-port's packet
invocation to the Connection class. Don't call -addToRunLoop.. here,
the mechanics of it were already done above.
([Connection -addToRunLoop:forMode:]): Mark it as not implemented, for
now.
([Connection -runConnectionUntilDate:]): Don't add to run loop here.
([Connection +invokeWithObject:]): Make it a class method instead of
an instance method; alter contents appropriately for this.
([Connection -portIsInvalid:]): Look at in_port_2_ancestor and remove
ourselves if necessary.
([Connection -invalidate]): Don't remove ourselves from the run loop
here, because we may not be the only one listening. This still needs
fixing.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1131 72102866-910b-0410-8b05-ffd578937521
new methods that use RunLoop. All callers changed.
([Connection -addToRunLoop:forMode:]): New method.
([Connection -removeFromRunLoop:forMode:]): New method.
([Connection -runConnectionUntilDate:]): New method.
([Connection -runConnection]): Method changed to call above method.
([Connection -_handleRmc:]): New method.
([Connection -_handleQueuedRmcRequests]): New method.
([Connection -_getReceivedReplyRmcFromQueueWithSequenceNumber:]): New
method.
([Connection -_getReceivedReplyRmcWithSequenceNumber:]): New method.
([Connection -invokeWithObject:]): New method.
([Connection +newForInPort:outPort:ancestorConnection:]): Set
reply_depth ivar.
([Connection -_encoderCreateReferenceForConstPtr:]): Return the xref!
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1117 72102866-910b-0410-8b05-ffd578937521
implementation that uses the RunLoop.
([TcpInPort -old_receivePacketWithTimeout:]): New method, holding old
implementation.
([TcpInPort -invokeWithObject:]): New method, called by RunLoop.
([TcpInPort -_tryToGetPacketFromReadableFD:]): New private method.
([TcpInPort -_addClientOutPort:toRunLoop:forMode:]): New method.
([TcpInPort -addToRunLoop:forMode:]): New method.
([TcpInPort -_removeClientOutPort:fromRunLoop:forMode:]): New method.
([TcpInPort -removeFromRunLoop:forMode:]): New method.
([TcpInPort -_addClientOutPort:]): Add it to the RunLoop.
([TcpInPort -_connectedOutPortInvalidated:]): Remove it from the
RunLoop.
([TcpInPort -_addClientOutPort:]): Method renamed from _addOutPort:.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1107 72102866-910b-0410-8b05-ffd578937521
([InPort -setPacketInvocation:]): New method.
([InPort -addToRunLoop:forMode:]): New method.
([InPort -removeFromRunLoop:forMode:]): New method.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1106 72102866-910b-0410-8b05-ffd578937521
select_timeout to inside loop since Linux select() modifies
*select_timeout.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1095 72102866-910b-0410-8b05-ffd578937521
([TcpInPort +newForReceivingFromPortNumber:]): Get the address of the
host, not localhost=127.0.0.1.
([TcpInPort -invalidate]): Remove ourselves from socket_2_port and
port_number_2_port here instead of in -dealloc.
([TcpInPort -description]): Indicate whether we are valid or not in
string.
([TcpOutPort -description]): Likewise.
([TcpOutPort -invalidate]): Assert is_valid, don't just conditionally
execute body. Remove ourselves from out_port_bag and socket_2_port
here, not in -dealloc.
([TcpPacket +_getPacketSize:andReplyPort:fromSocket:inPort:]): If we
don't read() full prefix, don't abort(), just return EOF.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1091 72102866-910b-0410-8b05-ffd578937521
([Connection +newForInPort:outPort:ancestorConnection:]): Set is_valid
to 1. Only ask for notification of out port death if out port is non-nil.
([Connection -portIsInvalid:]): Properly get the port from the
notification object.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1089 72102866-910b-0410-8b05-ffd578937521
this method, don't test it and skip the body of this method. Force
users to be careful about calling -invalidate more than once.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1088 72102866-910b-0410-8b05-ffd578937521
(NotificationInvocation): Likewise.
(NotificationPerformer): Likewise.
([NotificationDispatcher
-_addObserver:notificationRequest:name:object:]): Insist that observer
be non-nil; (in the case of Invocation's, the invocation is now the
observer).
([NotificationDispatcher -addInvocation:name:object:]): Method renamed
from -addObserver:invocation:... Pass the invocation as the
observer. Release the NR after it has been added.
([NotificationDispatcher -addObserver:selector:name:object:]): Release
the NR after it has been added.
([NotificationDispatcher -_removeFromLinkedListNotificationRequest:]):
New method.
([NotificationDispatcher -removeInvocation:]): New method.
([NotificationDispatcher -removeInvocation:name:object:]): New method.
([NotificationDispatcher -removeObserver:]): Use
_removeFromLinkedListNotificationRequest:.
([NotificationDispatcher -removeObserver:name:object:]): Likewise.
([NotificationDispatcher +addInvocation:name:object:]): New method.
([NotificationDispatcher +removeInvocation:]): New method.
([NotificationDispatcher +removeInvocation:name:object:]): New method.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1082 72102866-910b-0410-8b05-ffd578937521
([Connection -addLocalObject:]): Put it in all_connections_local_targets
also.
([Connection -removeLocalObject:]): Remove it from
all_connections_local_targets also.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1081 72102866-910b-0410-8b05-ffd578937521
changes to TcpPort.h. Overhaul of how TcpOutPort's track their remote
address. Previously they used the address of their local peer; this
is no good when encoding a TcpOutPort on the wire for D.O.; the
D.O. reciever needs a way to contact the listen'ing socket of the
TcpInPort in order to form a new connection. _remote_in_port_address
is now the address of the remote listen'ing socket. Added many
comments throughout. All perror() calls changes to be more
informative.
(debug_tcp_port): Make this a static variable instead of a macro.
(init_socket_2_port): Check pre-existance of socket_2_port here
instead of callers.
([TcpInPort +newForReceivingFromPortNumber:]): Method overhauled.
Don't bind socket to INADDR_ANY because we need to be able to encode
our unique host address on the wire for D.O.
([TcpInPort -_listeningSockaddr]): New method.
([TcpInPort -receivePacketWithTimeout:]): Method overhauled. Get the
reply port for an incoming packet from the packet prefix.
([TcpInPort -_connectedOutPortInvalidated:]): Add debugging message.
([TcpInPort -classForConnectedCoder:]): Return the TcpOutPort class,
not [self class] because we always encode a "send right" (ala Mach),
not a "recieve right".
([TcpOutPort
+newForSendingToSockaddr:withAcceptedSocket:pollingInPort:]): Method
renamed, and majorly overhauled. Now many different combinations of
NULL argument do different things. This is now the single designated
initializer. We now check both the SOCKADDR and the SOCK argument to
find previously-created TcpOutPort's. This method is also used to set
the remote_in_port_address of an already-created TcpOutPort. There is
more error checking.
([TcpOutPort +newForSendingToPortNumber:onHost:]): Overhauled.
([TcpOutPort +_newWithAcceptedSocket:peeraddr:inPort:]): Overhauled to
work with new designated initalizer.
([TcpOutPort -sendPacket:withTimeout:]): Use new low-level Packet
interface that deals with reply ports.
([TcpOutPort +packetClass]): New method.
(PREFIX_LENGTH_TYPE): New macro.
(PREFIX_LENGTH_SIZE): New macro.
(PREFIX_ADDRESS_TYPE): New macro.
(PREFIX_ADDRESS_SIZE): New macro.
(PREFIX_SIZE): New macro.
([TcpPacket -_initForReceivingWithSize:replyPort:]): Use 0 prefix,
because the separate +_getPacketSize... method reads those bytes.
([TcpPacket -_writeToSocket:withReplySockaddr:]): Now the prefix
includes the sockaddr of the reply port. If ADDR is non-null, set the
reply port address portion of the prefix.
([TcpPacket +_getPacketSize:andReplyPort:fromSocket:inPort:]): New
method, replacing +readPacketSizeFromSocket:.
([TcpPacket -_fillFromSocket:]): Set Stream's eofPosition properly.
Leave Stream's position at zero.
(InPortAcceptedClientNotification): New notification string.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1063 72102866-910b-0410-8b05-ffd578937521
(debug_proxy): Temporarily set to 1.
([Proxy +newForRemoteTarget:connection:]): Set new ivar names.
Embellish debugging message to include connection.
([Proxy -invalidateProxy]): Return void instead of self.
([Proxy +encodeObject:withConnectedCoder:]): Overhauled, encode tag,
and change order of encoding for more efficient encoding. Added many
comments.
([Proxy +newWithCoder:]): Likewise, to match. Also added a check to
make sure we don't return a bogus pointer for a local object; do this
by checking with connection's +includesLocalObject; if it's not
there, raise an exception.
([Proxy -forward::]): Call the new forwarding method name in Connection.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1062 72102866-910b-0410-8b05-ffd578937521
object_2_xref, not const_ptr_2_xref.
([Encoder -_encodeObject:withName:isBycopy:isForwardReference:]):
Create the in_progress_table with NSNonOwnedPointerMapKeyCallBacks,
not NSObject..; needed by distributed objects so we don't get infinite
loop with proxy objects.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1059 72102866-910b-0410-8b05-ffd578937521
Compare got with 6, not 2.
([Decoder -_coderCreateReferenceForObject:]): Add warning comment
about a -retain we don't want. Fix this eventually!
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1058 72102866-910b-0410-8b05-ffd578937521
replacing default_port_class.
(all_connections_local_targets): New map table; not used yet, though.
(debug_connection): Temporarily set to 1.
([Connection +initialize]): Set new static vars.
([Connection +setDefaultInPortClass:]): New method.
([Connection +defaultInPortClass]): New method.
([Connection +setDefaultOutPortClass:]): New method.
([Connection +defaultOutPortClass]): New method.
([Connection -init]): Use new default_in_port_class.
([Connection +new]): Likewise.
([Connection +newWithRootObject:]): Likewise.
([Connection +newRegisteringAtName:withRootObject:]): Likewise.
([Connection +rootProxyAtName:onHost:]): Likewise.
([Connection +rootProxyAtPort:]): Likewise.
([Connection +newForInPort:outPort:ancestorConnection:]): Assert the
in port. Embellish the debugging message to print the in port and
out port. Set the new connection's in port and out port ivars.
Register ourselves as observers of port invalidation with the
NotificationDispatcher. Post a notification that a new connection was
created.
([Connection -runConnectionWithTimeout:]): Use
_serviceReceivedRequestsWithTimeout:.
([Connection -_newReceivedRmcWithTimeout:]): Use decodingClass, not
encodingClass.
([Connection -_serviceReceivedRequestsWithTimeout:]): Method name
changed from -newReceivedReplyRmcWithSequenceNumber:.
([Connection +includesLocalObject:]): New method; still needs more
infrastructure to work, though.
([Connection -inPortClass]): New method.
([Connection -outPortClass]): New method.
([Connection -setInPortClass:aPortClass]): New method.
([Connection -setOutPortClass:aPortClass]): New method.
([Connection -_encoderCreateReferenceForConstPtr:]): Add 1 to map
table count to get xref.
([Connection -_decoderCreateReferenceForConstPtr:]): Likewise.
([Connection -dealloc]): Remove ourselves from the NotificationDispatcher.
(ConnectionWasCreatedNotification): New notification string.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1057 72102866-910b-0410-8b05-ffd578937521
([ConnectedEncoder
-_initForWritingWithConnection:sequenceNumber:identifier:]): Get
packetClass from the connection's outPort, not the outPortClass.
Return self.
([ConnectedDecoder
+readSignatureFromCStream:getClassname:formatVersion:]): Fill in name
and version.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1056 72102866-910b-0410-8b05-ffd578937521
([TcpInPort -_connectedOutPortInvalidated:]): Post an
InPortClientBecameInvalidNotification.
([TcpInPort -portNumber]): New method.
([TcpInPort -description]): New method.
([TcpOutPort +newWithAcceptedSocket:inPort:]): Fill in the _address
ivar.
([TcpOutPort -portNumber]): New method.
([TcpOutPort -description]): New method.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1039 72102866-910b-0410-8b05-ffd578937521
-subclassResponsibililty.
([MethodInvocation -initWithArgframe:selector:]): Raise an exception
if we are unable to get a non-null selector type string.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1038 72102866-910b-0410-8b05-ffd578937521
([Enumerator -dealloc]): Likewise.
([ConstantCollection -detectObjectByInvoking:]): Use -returnValueIsTrue.
([ConstantCollection -printForDebugger]): Use object_get_class_name
instead of -name because -name is now ambiguously typed.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1032 72102866-910b-0410-8b05-ffd578937521
([Invocation -setReturnValue:]): Retain return value if necessary.
([ArgframeInvocation -_retainArguments]): Add missing local var.
([MethodInvocation -initWithArgframe:type:]): New method.
([MethodInvocation -initWithArgframe:selector:]): Use new method. Set
selector using sel_pointer.
([ObjectFunctionInvocation -invokeWithObject:]): Use return_retained,
not args_retained.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@999 72102866-910b-0410-8b05-ffd578937521
instead of malloc.
([Invocation -encodeWithCoder:]): New method.
([Invocation -initWithCoder:]): New method.
([Invocation -classForConnectedCoder:]): New method.
([Invocation -returnType]): Use new ivar name.
([Invocation -setReturnValue:]): New method.
([Invocation -objectReturnValue]): Method implemented.
([Invocation -intReturnValue]): Method implemented.
([Invocation -returnValueIsTrue]): Method implementation finished.
([Invocation -dealloc]): Use new ivar name. Release return type if
necessary.
([ArgframeInvocation -_retainArguments]): New method.
([ArgframeInvocation -_initArgframeFrom:withType:retainArgs:]): Method
overhauled.
([ArgframeInvocation -initWithArgframe:type:]): Use new method.
([ArgframeInvocation -encodeWithCoder:]): New method.
([ArgframeInvocation -initWithCoder:]): New method.
([ArgframeInvocation -argumentTypeAtIndex:]): Use new ivar name.
([ArgframeInvocation -retainArguments]): New method.
([ArgframeInvocation -argumentsRetained]): New method.
([ArgframeInvocation -_deallocArgframe]): New method.
([ArgframeInvocation -dealloc]): Use new method. Release args if
necessary.
([MethodInvocation -_initTargetAndSelPointers]): New method.
([MethodInvocation -initWithArgframe:selector:]): Use new method.
([MethodInvocation -initWithCoder:]): New method.
([MethodInvocation -initWithTarget:selector:...]): Retain args if
necessary.
([MethodInvocation -invoke]): Use new ivars.
([MethodInvocation -invokeWithTarget:]): Use -setTarget:.
([MethodInvocation -selector]): Use new ivar.
([MethodInvocation -setSelector:]): Likewise.
([MethodInvocation -target]): Likewise.
([MethodInvocation -setTarget:]): Likewise.
([ObjectMethodInvocation -_initArgObjectPointer]): New method.
([ObjectMethodInvocation -initWithArgframe:selector:]): Use new method.
([ObjectMethodInvocation -initWithCoder:]): New method.
([ObjectMethodInvocation -invokeWithObject:]): New method.
(VoidFunctionInvocation): New class implementation.
(ObjectFunctionInvocation): New class implementation.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@998 72102866-910b-0410-8b05-ffd578937521
(return_type): ivar renamed from encoding.
(ArgframeInvocation args_retained): new ivar.
(MethodInvocation target_pointer): new ivar.
(MethodInvocation sel_pointer): new ivar.
(VoidFunctionInvocation): New class.
(ObjectFunctionInvocation): New class.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@997 72102866-910b-0410-8b05-ffd578937521