diff --git a/ChangeLog b/ChangeLog index 1cb899927..97b63583a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,63 @@ +Sun Aug 25 16:12:49 1996 Andrew McCallum + + * 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 . 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 + + * src/NSUser.m (NSHomeDirectory): Use NSHomeDirectoryForUser + instead of the HOME environment variable. + + * src/NSUserDefaults.m: #include 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 + + * 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 + + * src/include/NSArray.h: Remove declaration of NonCore classes; + just the category is sufficient. + Mon Sep 2 09:11:34 1996 Andrew McCallum * src/mframe.m: Use gcc's __builtin_return smarts to find location diff --git a/Documentation/Makefile.in b/Documentation/Makefile.in index faefdcad5..a1c4aacbe 100644 --- a/Documentation/Makefile.in +++ b/Documentation/Makefile.in @@ -130,9 +130,8 @@ GNUstep-FAQ.html: gnustep-faq.texi version.texi > GNUstep-FAQ.texi texi2html -expandinfo $(MAKEINFO_FLAGS) GNUstep-FAQ.texi -# | awk -- '/@item/ { print "@br{}" } /@end itemize/ { print "@br{}" } ; { print }' \ - -GNU "info" manuals +# | awk -- '/@item/ { print "@br{}" } /@end itemize/ { print "@br{}" } ; { print }' +#GNU "info" manuals TOP_DOC_FILES = README INSTALL NEWS RCS_FILES = $(TEXI_FILES) Makefile.in diff --git a/Documentation/gnustep-faq.texi b/Documentation/gnustep-faq.texi index 8cf33552a..187fa1266 100644 --- a/Documentation/gnustep-faq.texi +++ b/Documentation/gnustep-faq.texi @@ -239,10 +239,11 @@ The short answer is: On whichever platforms volunteers offer port it! The main target platforms is free operating systems, namely Linux and 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 -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 -WindowsNT. 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 few code contributions for OS/2. @@ -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 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 -email to @samp{discussion@gnustep.org} and -@samp{gnu-objc@prep.ai.mit.edu} if you are interesting in pushing this +email to @samp{discussion@@gnustep.org} and +@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 coordinated. @@ -385,8 +386,8 @@ and usable: NSArchiver, NSArray, NSAssertionHandler, NSAutoreleasePool, NSBitmapCharSet, NSBundle, NSCharacterSet, NSCoder, NSCountedSet, NSData, NSDate, NSDictionary, NSEnumerator, NSException, NSInvocation, NSLock, NSMethodSignature, NSNotification, NSNotificationCenter, -NSNumber, NSObject, NSProcessInfo, NSRunLoop, NSSet, NSString, NSThread, -NSTimeZone, NSTimer, NSUserDefaults, NSValue. +NSNumber, NSObject, NSProcessInfo, NSRunLoop, NSScanner, NSSet, +NSString, NSThread, NSTimeZone, NSTimer, NSUserDefaults, NSValue. Most of the C functions are also implemented, including NSHashTable and NSMaptable. @@ -397,7 +398,7 @@ not yet been made. The following classes are unstarted or unusable: NSBTreeBlock, NSBTreeCursor, NSByteStore, NSByteStoreFile, NSCalendarDate, -NSDeserializer, NSScanner, NSSerializer. +NSDeserializer, NSSerializer. @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 has not yet been encoded, but will be encoded later.) by making two 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 using an object decoding method (@samp{-decodeObjectAt:..}) that back-patches @code{id}-pointers when the conditionally encoded objects diff --git a/Documentation/install.texi b/Documentation/install.texi index f6a86412a..870eabff2 100644 --- a/Documentation/install.texi +++ b/Documentation/install.texi @@ -6,8 +6,8 @@ @include version.texi @ifset INSTALL_ONLY -This file documents the installation of the GNU Objective C -Class Library, @samp{libgnustep-base}. Copyright (C) 1993, 1994, 1996 Free Software +This file documents the installation of the GNUstep Base Library, +@samp{libgnustep-base}. Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. You may copy, distribute, and modify it freely as long as you preserve this copyright notice and permission notice. @chapter Installing @samp{libgnustep-base} @@ -18,9 +18,9 @@ To compile and install @samp{libgnustep-base}: @enumerate @item -If you are running Linux, first install pthreads. gnustep-base has been -tested with pthreads-0.9.2. You can just copying the libaries from the -@file{lib} directory of the distribution to /usr/local/lib, and the +If you are running GNU/Linux, first install pthreads. gnustep-base has +been tested with pthreads-0.9.2. You can just copying the libaries from +the @file{lib} directory of the distribution to /usr/local/lib, and the @file{pthreads} directory from the @file{include} directory of the distribution to /usr/local/include. For example: @@ -63,10 +63,10 @@ make make install @end example -If you are running GNU/Linux and have an older version of libc, then the -Objective C runtime will not work unless you pass @samp{-lieee} to the -linker. If you use the pthreads library that will also have to be -linked in. You can do that like this: +Alternatively, if you are running GNU/Linux and have an older version of +libc, then the Objective C runtime will not work unless you pass +@samp{-lieee} to the linker. If you use the pthreads library that will +also have to be linked in. You can do that like this: @example LIBS="-lieee -lpthreads" ./configure --prefix=/usr/local @@ -74,7 +74,11 @@ make make install @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 features that your @code{make} does not support; use GNU make. diff --git a/Headers/gnustep/base/NSArray.h b/Headers/gnustep/base/NSArray.h index 22b116d33..d8127fc4c 100644 --- a/Headers/gnustep/base/NSArray.h +++ b/Headers/gnustep/base/NSArray.h @@ -37,7 +37,6 @@ @end -@class NSArrayNonCore; @interface NSArray (NonCore) + array; @@ -48,7 +47,6 @@ - initWithObjects: firstObj, ...; - initWithArray: (NSArray*)array; - - (unsigned) indexOfObjectIdenticalTo: anObject; - (unsigned) indexOfObject: anObject; - (BOOL) containsObject: anObject; @@ -73,7 +71,6 @@ @end -@class NSMutableArrayNonCore; @interface NSMutableArray : NSArray - initWithCapacity: (unsigned)numItems; - (void) addObject: anObject; diff --git a/NSBundle.README b/NSBundle.README index 5bb97c7a9..710e15f8c 100644 --- a/NSBundle.README +++ b/NSBundle.README @@ -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, without any extension. -The NSBundle class provided with GNU libobjects is meant to run on a -variety of systems. However, some set-up is required to use it. +The NSBundle class provided with GNUstep Base Library is meant to run +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 dynamic linking -- SunOS, Solaris. It configures for HP, but I 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: -To compile NSBundle into your programs, you need to make sure that -libobjects was configured correctly for the dynamic linking system on -your machine. This is done automatically in the configure script that -comes with libobjects, but it is possible that the configuration is -incorrect for your system (especially if it is not one of the systems -listed above). In particular, the Makefile variable DYNAMIC_LINKER is -set to link in the proper header file that prvides the dynamic linking -for the system. +To compile NSBundle into your programs, you need to make sure that the +GNUstep Base Library was configured correctly for the dynamic linking +system on your machine. This is done automatically in the configure +script that comes with the Base Library, but it is possible that the +configuration is incorrect for your system (especially if it is not +one of the systems listed above). In particular, the Makefile variable +DYNAMIC_LINKER is set to link in the proper header file that prvides +the dynamic linking for the system. You also need to configure your own program to take advantage of 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 you can use as a template for configuring your system for compiling so 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. In particular, the example configure script sets the following Makefile variables: @@ -67,8 +67,8 @@ data files within a bundle. If NSBundle does not work on systems that do support dynamic linking, it is likely that the Makefile variable DYNAMIC_BUNDLER_LINKER is not -set-up correctly, or that libobjects did not link in the correct -header file to use dynamic linking. Diagnosing and fixing these -problems is not trivial and requires some knowledge of dynamic +set-up correctly, or that the GNUstep Base Library did not link in the +correct header file to use dynamic linking. Diagnosing and fixing +these problems is not trivial and requires some knowledge of dynamic linking, object file formats and the Objective-C runtime. Contact Adam Fedor for help. diff --git a/README.first b/README.first index 6e1a6ba24..de8e27785 100644 --- a/README.first +++ b/README.first @@ -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 date indicated by the filename. -This release is not intended for casual users of libobjects---it is -meant for libobjects developers. +This release is not intended for casual users of GNUstep---it is meant +for GNUstep developers. IMPORTANT: diff --git a/README.foundation b/README.foundation index 477f80fec..c0450afbc 100644 --- a/README.foundation +++ b/README.foundation @@ -36,3 +36,5 @@ As I said, cumbersome, but it should work with ANY OpenStep complient foundation. +[Alternatively, you could just make a soft link from `foundation' to +`Foundation' -mccallum.] diff --git a/Source/Makefile.in b/Source/Makefile.in index 5caff0aae..83b1f96e3 100644 --- a/Source/Makefile.in +++ b/Source/Makefile.in @@ -386,6 +386,7 @@ NSPage.m \ NSProcessInfo.m \ NSRange.m \ NSRunLoop.m \ +NSScanner.m \ NSSet.m \ NSString.m \ NSThread.m \ @@ -457,6 +458,7 @@ include/NSPathUtilities.h \ include/NSProcessInfo.h \ include/NSRange.h \ include/NSRunLoop.h \ +include/NSScanner.h \ include/NSSerialization.h \ include/NSSet.h \ include/NSString.h \ diff --git a/Source/NSString.m b/Source/NSString.m index 84b0db5f5..401478acf 100644 --- a/Source/NSString.m +++ b/Source/NSString.m @@ -28,7 +28,8 @@ Only supports C Strings. Some implementations will need to be 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 the change doesn't work because some format strings are constant 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 *atsign_pos; char *format_to_go = format_cp_copy; diff --git a/Source/NSUser.m b/Source/NSUser.m index bcb6d4a4c..71305e0ab 100644 --- a/Source/NSUser.m +++ b/Source/NSUser.m @@ -50,7 +50,9 @@ NSUserName () NSString * 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. */ diff --git a/Source/NSUserDefaults.m b/Source/NSUserDefaults.m index 71e850714..cfc918ce4 100644 --- a/Source/NSUserDefaults.m +++ b/Source/NSUserDefaults.m @@ -36,6 +36,7 @@ #ifdef NeXT #include +#include #include #include #include @@ -47,6 +48,7 @@ #include #else #include +#include #include #include #include @@ -93,47 +95,6 @@ NSString *NSCurrencyString = @"NSCurrencyString"; NSString *NSDecimalDigits = @"NSDecimalDigits"; 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 *************************************************************************/ diff --git a/Source/TreeNode.m b/Source/TreeNode.m index 455024146..e0d644274 100644 --- a/Source/TreeNode.m +++ b/Source/TreeNode.m @@ -1,5 +1,5 @@ /* 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 Date: May 1993 @@ -52,6 +52,12 @@ return self; } +- (void) dealloc +{ + [_children release]; + [super dealloc]; +} + - (void) encodeWithCoder: aCoder { [super encodeWithCoder:aCoder]; @@ -79,10 +85,8 @@ - (void) setChildren: (id )kids { - /* xxx [kids retain]; [_children release]; - */ _children = kids; return self; } diff --git a/Source/mframe.m b/Source/mframe.m index 9d9013dae..2d594ac0c 100644 --- a/Source/mframe.m +++ b/Source/mframe.m @@ -774,12 +774,7 @@ mframe_do_call (const char *encoded_types, functions after this one. The memory for the retframe is alloca()'ed, not malloc()'ed, and therefore is on the stack and can 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 mframe_build_return (arglist_t argframe, diff --git a/Testing/Makefile.in b/Testing/Makefile.in index f342d1cbb..d1533d3ee 100644 --- a/Testing/Makefile.in +++ b/Testing/Makefile.in @@ -95,7 +95,8 @@ coder.m \ cstream.m \ fref.m \ basic.m \ -release.m +release.m \ +nsscanner.m tcpport: FORCE (cd ../src; $(MAKE)) diff --git a/Testing/test01.m b/Testing/test01.m index 6dc518c9e..9e087c762 100644 --- a/Testing/test01.m +++ b/Testing/test01.m @@ -77,7 +77,7 @@ int main() [foo removeObject:[foo minObject]]; [foo addObject: [NSNumber numberWithInt: 99]]; - printf("Collections 0 and 9 should mismatch\n"); + printf("Collections 0 and 4 should mismatch\n"); [collections printForDebugger]; checkSameContents([collections delegatePoolCollection]);