Changes from home. See ChangeLog Aug 5 through Aug 25

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1662 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mccallum 1996-09-02 13:20:20 +00:00
parent f51cb41150
commit 960c6fa4c6
16 changed files with 125 additions and 96 deletions

View file

@ -1,3 +1,63 @@
Sun Aug 25 16:12:49 1996 Andrew McCallum <mccallum@cs.cmu.edu>
* checks/Makefile.in (SRCS): Added nsscanner.m from Eric Norum.
* src/NSScanner.m: Fix indentation.
([NSScanner +scannerWithString:]): Rewrite to avoid unnecessary
local variable.
([NSScanner -initWithString:]): Call [super init].
([NSScanner -_scanCharactersFromSet:intoString:]): Method renamed to
put underscore at the beginning, not in the middle of the method
name. All callers changed.
([NSScanner -_skipToNextField]): Likewise.
([NSScanner +localizedScannerWithString:]): New method, unimplemented.
([NSScanner -scanDouble:]): Initialize `unichar c' to avoid warning.
([NSScanner -scanLongLong:]): Don't compare with -(LONG_LONG_MIN),
this number is out of range since, in two-complement arithmetic,
we have one more negative number than positive numbers.
* src/include/NSScanner.h: Include <gnustep/base/preface.h>. Fix
indentation. Standarize #define wrapper symbol.
* src/NSScanner.m, src/include/NSScanner.h: New files from Eric
Norum.
Sun Aug 11 10:54:49 1996 Andrew McCallum <mccallum@cs.cmu.edu>
* src/NSUser.m (NSHomeDirectory): Use NSHomeDirectoryForUser
instead of the HOME environment variable.
* src/NSUserDefaults.m: #include <Foundation/NSPathUtilities.h> to
get declarations for NSUser* functions.
(NSUserName): Function removed; it can already be found in
NSUser.m.
(NSHomeDirectory): Likewise.
(NSHomeDirectoryForUser): Likewise.
* doc/Makefile.in: Fix typo: properly comment out section.
* doc/gnustep-faq.texi: English fixes, and move NSScanner to
`implemented' list.
* doc/install.texi: English fixes, and mention --enable-shared
with Base Library configure directions.
* README.foundation: Add note about making a soft link, instead of
adding #ifdef's to the code.
* NSBundle.README: Change name from libobjects to GNUstep Base
Library.
* README.first: Likewise.
Wed Aug 7 09:06:10 1996 Andrew McCallum <mccallum@cs.cmu.edu>
* src/mframe.m (mframe_build_return): Remove comment about users
responsibility to free returned char*'s; it's no longer true.
Mon Aug 5 11:25:30 1996 Andrew McCallum <mccallum@cs.cmu.edu>
* src/include/NSArray.h: Remove declaration of NonCore classes;
just the category is sufficient.
Mon Sep 2 09:11:34 1996 Andrew McCallum <mccallum@cs.cmu.edu> Mon Sep 2 09:11:34 1996 Andrew McCallum <mccallum@cs.cmu.edu>
* src/mframe.m: Use gcc's __builtin_return smarts to find location * src/mframe.m: Use gcc's __builtin_return smarts to find location

View file

@ -130,9 +130,8 @@ GNUstep-FAQ.html: gnustep-faq.texi version.texi
> GNUstep-FAQ.texi > GNUstep-FAQ.texi
texi2html -expandinfo $(MAKEINFO_FLAGS) GNUstep-FAQ.texi texi2html -expandinfo $(MAKEINFO_FLAGS) GNUstep-FAQ.texi
# | awk -- '/@item/ { print "@br{}" } /@end itemize/ { print "@br{}" } ; { print }' \ # | awk -- '/@item/ { print "@br{}" } /@end itemize/ { print "@br{}" } ; { print }'
#<A HREF="http://www.cl.cam.ac.uk/texinfodoc/dir.html">GNU "info" manuals</A>
<A HREF="http://www.cl.cam.ac.uk/texinfodoc/dir.html">GNU "info" manuals</A>
TOP_DOC_FILES = README INSTALL NEWS TOP_DOC_FILES = README INSTALL NEWS
RCS_FILES = $(TEXI_FILES) Makefile.in RCS_FILES = $(TEXI_FILES) Makefile.in

View file

@ -239,7 +239,8 @@ The short answer is: On whichever platforms volunteers offer port it!
The main target platforms is free operating systems, namely Linux and The main target platforms is free operating systems, namely Linux and
the Hurd. Much of the code is OS-independent, and should port quite the Hurd. Much of the code is OS-independent, and should port quite
easily to various UNIX-like OS's. There has been interest in a port to easily to various UNIX-like OS's. There has been interest in a port to
Linux on the Apple Macintosh, but I have not heard of any developers. Linux on the Apple Macintosh, but we have not heard from any developers
working on this.
At least one of the current active developers is also working with At least one of the current active developers is also working with
Windows NT. There has been some interest in an OS/2 port, but I've seen Windows NT. There has been some interest in an OS/2 port, but I've seen
@ -343,8 +344,8 @@ No. Unlike NeXT's @samp{cc}, GNU GCC does not support source files
containing both Objective C and C++. People at Cygnus have mentioned containing both Objective C and C++. People at Cygnus have mentioned
that they would be willing to do the work---if they were paid for it, of that they would be willing to do the work---if they were paid for it, of
course. Several people are interested in seeing this happen. Send course. Several people are interested in seeing this happen. Send
email to @samp{discussion@gnustep.org} and email to @samp{discussion@@gnustep.org} and
@samp{gnu-objc@prep.ai.mit.edu} if you are interesting in pushing this @samp{gnu-objc@@prep.ai.mit.edu} if you are interesting in pushing this
issue, so that the efforts of all those people interested can be issue, so that the efforts of all those people interested can be
coordinated. coordinated.
@ -385,8 +386,8 @@ and usable: NSArchiver, NSArray, NSAssertionHandler, NSAutoreleasePool,
NSBitmapCharSet, NSBundle, NSCharacterSet, NSCoder, NSCountedSet, NSBitmapCharSet, NSBundle, NSCharacterSet, NSCoder, NSCountedSet,
NSData, NSDate, NSDictionary, NSEnumerator, NSException, NSInvocation, NSData, NSDate, NSDictionary, NSEnumerator, NSException, NSInvocation,
NSLock, NSMethodSignature, NSNotification, NSNotificationCenter, NSLock, NSMethodSignature, NSNotification, NSNotificationCenter,
NSNumber, NSObject, NSProcessInfo, NSRunLoop, NSSet, NSString, NSThread, NSNumber, NSObject, NSProcessInfo, NSRunLoop, NSScanner, NSSet,
NSTimeZone, NSTimer, NSUserDefaults, NSValue. NSString, NSThread, NSTimeZone, NSTimer, NSUserDefaults, NSValue.
Most of the C functions are also implemented, including NSHashTable and Most of the C functions are also implemented, including NSHashTable and
NSMaptable. NSMaptable.
@ -397,7 +398,7 @@ not yet been made.
The following classes are unstarted or unusable: NSBTreeBlock, The following classes are unstarted or unusable: NSBTreeBlock,
NSBTreeCursor, NSByteStore, NSByteStoreFile, NSCalendarDate, NSBTreeCursor, NSByteStore, NSByteStoreFile, NSCalendarDate,
NSDeserializer, NSScanner, NSSerializer. NSDeserializer, NSSerializer.
@item @b{In what ways is the Base Library different from OpenStep's FoundationKit?} @item @b{In what ways is the Base Library different from OpenStep's FoundationKit?}
@ -455,7 +456,7 @@ OpenStep's archiving system implements forward references, (that is,
calls to @samp{encodeConditionalObject:} for which the object argument calls to @samp{encodeConditionalObject:} for which the object argument
has not yet been encoded, but will be encoded later.) by making two has not yet been encoded, but will be encoded later.) by making two
passes through all the -encodeWithCoder: methods of the objects to be passes through all the -encodeWithCoder: methods of the objects to be
encoded GNU's archiving system, on the other hand, implements forward encoded. GNU's archiving system, on the other hand, implements forward
references efficiently, without making two passes. It does this by references efficiently, without making two passes. It does this by
using an object decoding method (@samp{-decodeObjectAt:..}) that using an object decoding method (@samp{-decodeObjectAt:..}) that
back-patches @code{id}-pointers when the conditionally encoded objects back-patches @code{id}-pointers when the conditionally encoded objects

View file

@ -6,8 +6,8 @@
@include version.texi @include version.texi
@ifset INSTALL_ONLY @ifset INSTALL_ONLY
This file documents the installation of the GNU Objective C This file documents the installation of the GNUstep Base Library,
Class Library, @samp{libgnustep-base}. Copyright (C) 1993, 1994, 1996 Free Software @samp{libgnustep-base}. Copyright (C) 1993, 1994, 1996 Free Software
Foundation, Inc. You may copy, distribute, and modify it freely as long Foundation, Inc. You may copy, distribute, and modify it freely as long
as you preserve this copyright notice and permission notice. as you preserve this copyright notice and permission notice.
@chapter Installing @samp{libgnustep-base} @chapter Installing @samp{libgnustep-base}
@ -18,9 +18,9 @@ To compile and install @samp{libgnustep-base}:
@enumerate @enumerate
@item @item
If you are running Linux, first install pthreads. gnustep-base has been If you are running GNU/Linux, first install pthreads. gnustep-base has
tested with pthreads-0.9.2. You can just copying the libaries from the been tested with pthreads-0.9.2. You can just copying the libaries from
@file{lib} directory of the distribution to /usr/local/lib, and the the @file{lib} directory of the distribution to /usr/local/lib, and the
@file{pthreads} directory from the @file{include} directory of the @file{pthreads} directory from the @file{include} directory of the
distribution to /usr/local/include. For example: distribution to /usr/local/include. For example:
@ -63,10 +63,10 @@ make
make install make install
@end example @end example
If you are running GNU/Linux and have an older version of libc, then the Alternatively, if you are running GNU/Linux and have an older version of
Objective C runtime will not work unless you pass @samp{-lieee} to the libc, then the Objective C runtime will not work unless you pass
linker. If you use the pthreads library that will also have to be @samp{-lieee} to the linker. If you use the pthreads library that will
linked in. You can do that like this: also have to be linked in. You can do that like this:
@example @example
LIBS="-lieee -lpthreads" ./configure --prefix=/usr/local LIBS="-lieee -lpthreads" ./configure --prefix=/usr/local
@ -74,7 +74,11 @@ make
make install make install
@end example @end example
@item If your system supports dynamically loaded shared libraries, you can
request the building and installation of a @samp{.so} version of the
library by passing @samp{--enable-shared} to @samp{configure}. If in
doubt, do not include this option.
If you have trouble with the Makefile, it may be that our makefiles use If you have trouble with the Makefile, it may be that our makefiles use
features that your @code{make} does not support; use GNU make. features that your @code{make} does not support; use GNU make.

View file

@ -37,7 +37,6 @@
@end @end
@class NSArrayNonCore;
@interface NSArray (NonCore) <NSCopying, NSMutableCopying> @interface NSArray (NonCore) <NSCopying, NSMutableCopying>
+ array; + array;
@ -48,7 +47,6 @@
- initWithObjects: firstObj, ...; - initWithObjects: firstObj, ...;
- initWithArray: (NSArray*)array; - initWithArray: (NSArray*)array;
- (unsigned) indexOfObjectIdenticalTo: anObject; - (unsigned) indexOfObjectIdenticalTo: anObject;
- (unsigned) indexOfObject: anObject; - (unsigned) indexOfObject: anObject;
- (BOOL) containsObject: anObject; - (BOOL) containsObject: anObject;
@ -73,7 +71,6 @@
@end @end
@class NSMutableArrayNonCore;
@interface NSMutableArray : NSArray @interface NSMutableArray : NSArray
- initWithCapacity: (unsigned)numItems; - initWithCapacity: (unsigned)numItems;
- (void) addObject: anObject; - (void) addObject: anObject;

View file

@ -12,8 +12,8 @@ directory has the extension "bundle" and the main object file that
resides in the directory has the same name as the bundle directory, resides in the directory has the same name as the bundle directory,
without any extension. without any extension.
The NSBundle class provided with GNU libobjects is meant to run on a The NSBundle class provided with GNUstep Base Library is meant to run
variety of systems. However, some set-up is required to use it. on a variety of systems. However, some set-up is required to use it.
Currently it has been tested on only a few systems that support Currently it has been tested on only a few systems that support
dynamic linking -- SunOS, Solaris. It configures for HP, but I dynamic linking -- SunOS, Solaris. It configures for HP, but I
haven't been able to get it to work yet. There are unconfirmed reports haven't been able to get it to work yet. There are unconfirmed reports
@ -21,14 +21,14 @@ it work on Linux systems.
NSBundle set-up: NSBundle set-up:
To compile NSBundle into your programs, you need to make sure that To compile NSBundle into your programs, you need to make sure that the
libobjects was configured correctly for the dynamic linking system on GNUstep Base Library was configured correctly for the dynamic linking
your machine. This is done automatically in the configure script that system on your machine. This is done automatically in the configure
comes with libobjects, but it is possible that the configuration is script that comes with the Base Library, but it is possible that the
incorrect for your system (especially if it is not one of the systems configuration is incorrect for your system (especially if it is not
listed above). In particular, the Makefile variable DYNAMIC_LINKER is one of the systems listed above). In particular, the Makefile variable
set to link in the proper header file that prvides the dynamic linking DYNAMIC_LINKER is set to link in the proper header file that prvides
for the system. the dynamic linking for the system.
You also need to configure your own program to take advantage of You also need to configure your own program to take advantage of
NSBundle, and also configure the compilation of any "bundles" you want NSBundle, and also configure the compilation of any "bundles" you want
@ -37,7 +37,7 @@ through you own customized configure script. The examples directory
contains an example configure.example.in and Makefile.example.in which contains an example configure.example.in and Makefile.example.in which
you can use as a template for configuring your system for compiling so you can use as a template for configuring your system for compiling so
that you can dynamically load object files into your running program. that you can dynamically load object files into your running program.
You will need the file aclocal.m4 that comes with the libobjects You will need the file aclocal.m4 that comes with the Base Library
distribution in order to use configure.example.in in your system. distribution in order to use configure.example.in in your system.
In particular, the example configure script sets the following In particular, the example configure script sets the following
Makefile variables: Makefile variables:
@ -67,8 +67,8 @@ data files within a bundle.
If NSBundle does not work on systems that do support dynamic linking, If NSBundle does not work on systems that do support dynamic linking,
it is likely that the Makefile variable DYNAMIC_BUNDLER_LINKER is not it is likely that the Makefile variable DYNAMIC_BUNDLER_LINKER is not
set-up correctly, or that libobjects did not link in the correct set-up correctly, or that the GNUstep Base Library did not link in the
header file to use dynamic linking. Diagnosing and fixing these correct header file to use dynamic linking. Diagnosing and fixing
problems is not trivial and requires some knowledge of dynamic these problems is not trivial and requires some knowledge of dynamic
linking, object file formats and the Objective-C runtime. Contact Adam linking, object file formats and the Objective-C runtime. Contact Adam
Fedor <fedor@boulder.colorado.edu> for help. Fedor <fedor@boulder.colorado.edu> for help.

View file

@ -1,10 +1,10 @@
This is a snapshot distribution of libobjects. This is a snapshot distribution of the GNUstep Base Library.
It is a totally untested "snapshot" of the source tree made on the It is a totally untested "snapshot" of the source tree made on the
date indicated by the filename. date indicated by the filename.
This release is not intended for casual users of libobjects---it is This release is not intended for casual users of GNUstep---it is meant
meant for libobjects developers. for GNUstep developers.
IMPORTANT: IMPORTANT:

View file

@ -36,3 +36,5 @@ As I said, cumbersome, but it should work with ANY OpenStep complient
foundation. foundation.
[Alternatively, you could just make a soft link from `foundation' to
`Foundation' -mccallum.]

View file

@ -386,6 +386,7 @@ NSPage.m \
NSProcessInfo.m \ NSProcessInfo.m \
NSRange.m \ NSRange.m \
NSRunLoop.m \ NSRunLoop.m \
NSScanner.m \
NSSet.m \ NSSet.m \
NSString.m \ NSString.m \
NSThread.m \ NSThread.m \
@ -457,6 +458,7 @@ include/NSPathUtilities.h \
include/NSProcessInfo.h \ include/NSProcessInfo.h \
include/NSRange.h \ include/NSRange.h \
include/NSRunLoop.h \ include/NSRunLoop.h \
include/NSScanner.h \
include/NSSerialization.h \ include/NSSerialization.h \
include/NSSet.h \ include/NSSet.h \
include/NSString.h \ include/NSString.h \

View file

@ -28,7 +28,8 @@
Only supports C Strings. Some implementations will need to be Only supports C Strings. Some implementations will need to be
changed when we get other string backing classes. changed when we get other string backing classes.
Does not support %@ in format strings on non-GNU-libc systems. Does not support all justification directives for `%@' in format strings
on non-GNU-libc systems.
*/ */
@ -320,7 +321,7 @@ handle_printf_atsign (FILE *stream,
/* We need a local copy since we change it. (Changing and undoing /* We need a local copy since we change it. (Changing and undoing
the change doesn't work because some format strings are constant the change doesn't work because some format strings are constant
strings, placed in a non-writable section of the executable, and strings, placed in a non-writable section of the executable, and
can't be written to.) */ writing to them will cause a segfault.) */
char format_cp_copy[format_len+1]; char format_cp_copy[format_len+1];
char *atsign_pos; char *atsign_pos;
char *format_to_go = format_cp_copy; char *format_to_go = format_cp_copy;

View file

@ -50,7 +50,9 @@ NSUserName ()
NSString * NSString *
NSHomeDirectory () NSHomeDirectory ()
{ {
return [NSString stringWithCString: getenv ("HOME")]; return NSHomeDirectoryForUser (NSUserName ());
/* xxx Was using this. Is there a reason to prefer it?
return [NSString stringWithCString: getenv ("HOME")]; */
} }
/* Return LOGIN_NAME's home directory as an NSString object. */ /* Return LOGIN_NAME's home directory as an NSString object. */

View file

@ -36,6 +36,7 @@
#ifdef NeXT #ifdef NeXT
#include <foundation/NSUserDefaults.h> #include <foundation/NSUserDefaults.h>
#include <foundation/NSPathUtilities.h>
#include <foundation/NSDictionary.h> #include <foundation/NSDictionary.h>
#include <foundation/NSArray.h> #include <foundation/NSArray.h>
#include <foundation/NSDate.h> #include <foundation/NSDate.h>
@ -47,6 +48,7 @@
#include <foundation/NSProcessInfo.h> #include <foundation/NSProcessInfo.h>
#else #else
#include <Foundation/NSUserDefaults.h> #include <Foundation/NSUserDefaults.h>
#include <Foundation/NSPathUtilities.h>
#include <Foundation/NSDictionary.h> #include <Foundation/NSDictionary.h>
#include <Foundation/NSArray.h> #include <Foundation/NSArray.h>
#include <Foundation/NSDate.h> #include <Foundation/NSDate.h>
@ -93,47 +95,6 @@ NSString *NSCurrencyString = @"NSCurrencyString";
NSString *NSDecimalDigits = @"NSDecimalDigits"; NSString *NSDecimalDigits = @"NSDecimalDigits";
NSString *NSAMPMDesignation = @"NSAMPMDesignation"; NSString *NSAMPMDesignation = @"NSAMPMDesignation";
/*************************************************************************
*** Get Information about a User
*************************************************************************/
#ifndef NeXT
// The functions used below showld work with /etc/passwd file,
// YP and NetInfo. I have no idea how this should be implemented
// for Win-NT and I know that this cannot be implemented fow Win95
NSString *NSUserName(void)
{
NSString* processOwner = [NSString stringWithCString: getlogin()];
return processOwner;
}
NSString *NSHomeDirectory(void)
{
return NSHomeDirectoryForUser (NSUserName());
}
NSString *NSHomeDirectoryForUser (NSString * userName)
{
struct passwd *pwd;
if (!userName)
return nil;
setpwent(); // Start scanning the password file
while ((pwd = getpwent ()))
{
if (strcmp(pwd->pw_name,[userName cString]) == 0)
break;
}
endpwent(); // Finish scanning the password file
if (!pwd)
return nil;
return [NSString stringWithCString:pwd->pw_dir];
}
#endif
/************************************************************************* /*************************************************************************
*** Local method definitions *** Local method definitions
*************************************************************************/ *************************************************************************/

View file

@ -1,5 +1,5 @@
/* Implementation for Objective-C TreeNode object /* Implementation for Objective-C TreeNode object
Copyright (C) 1993,1994, 1995 Free Software Foundation, Inc. Copyright (C) 1993,1994, 1995, 1996 Free Software Foundation, Inc.
Written by: Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu> Written by: Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu>
Date: May 1993 Date: May 1993
@ -52,6 +52,12 @@
return self; return self;
} }
- (void) dealloc
{
[_children release];
[super dealloc];
}
- (void) encodeWithCoder: aCoder - (void) encodeWithCoder: aCoder
{ {
[super encodeWithCoder:aCoder]; [super encodeWithCoder:aCoder];
@ -79,10 +85,8 @@
- (void) setChildren: (id <IndexedCollecting>)kids - (void) setChildren: (id <IndexedCollecting>)kids
{ {
/* xxx
[kids retain]; [kids retain];
[_children release]; [_children release];
*/
_children = kids; _children = kids;
return self; return self;
} }

View file

@ -774,12 +774,7 @@ mframe_do_call (const char *encoded_types,
functions after this one. The memory for the retframe is functions after this one. The memory for the retframe is
alloca()'ed, not malloc()'ed, and therefore is on the stack and can alloca()'ed, not malloc()'ed, and therefore is on the stack and can
be tromped-on by future function calls. be tromped-on by future function calls.
*/
xxx Pointer values returned by the method or non-const strings
passed in will now point to newly malloc'ed memory. It is your
responsibility to free it. This is thoroughly disgusting, and will
be fixed as soon as we get rid of the -free method and replace it
with something better. */
retval_t retval_t
mframe_build_return (arglist_t argframe, mframe_build_return (arglist_t argframe,

View file

@ -95,7 +95,8 @@ coder.m \
cstream.m \ cstream.m \
fref.m \ fref.m \
basic.m \ basic.m \
release.m release.m \
nsscanner.m
tcpport: FORCE tcpport: FORCE
(cd ../src; $(MAKE)) (cd ../src; $(MAKE))

View file

@ -77,7 +77,7 @@ int main()
[foo removeObject:[foo minObject]]; [foo removeObject:[foo minObject]];
[foo addObject: [NSNumber numberWithInt: 99]]; [foo addObject: [NSNumber numberWithInt: 99]];
printf("Collections 0 and 9 should mismatch\n"); printf("Collections 0 and 4 should mismatch\n");
[collections printForDebugger]; [collections printForDebugger];
checkSameContents([collections delegatePoolCollection]); checkSameContents([collections delegatePoolCollection]);