mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Minor fixes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2620 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5f7871270a
commit
514b1ee838
5 changed files with 34 additions and 23 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
Thu Nov 6 10:14:39 1997 Adam Fedor <fedor@doc.com>
|
||||||
|
|
||||||
|
* src/GNUmakefile (DEFS): Remove PLATFORM_OS.
|
||||||
|
* src/NSBundle.m: Change platform to gnustep_target_os.
|
||||||
|
|
||||||
|
* src/ostream.m (ostream_getc, ostream_read, ostream_vscanf):
|
||||||
|
Return EOF if stream_obj returned 0.
|
||||||
|
|
||||||
Wed Nov 5 16:10:32 1997 Scott Christley <scottc@speedy.net-community.com>
|
Wed Nov 5 16:10:32 1997 Scott Christley <scottc@speedy.net-community.com>
|
||||||
|
|
||||||
* src/Invocation.m (-setArgument:atIndex:): Add OpenStep method.
|
* src/Invocation.m (-setArgument:atIndex:): Add OpenStep method.
|
||||||
|
|
|
@ -182,7 +182,7 @@ running configure:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
LIBS=-lthread; ./configure --prefix=/usr/local/GNUstep
|
LIBS=-lthread; ./configure --prefix=/usr/local/GNUstep
|
||||||
@end
|
@end example
|
||||||
|
|
||||||
After this you should add the shell script @file{GNUstep.sh} in the makefile
|
After this you should add the shell script @file{GNUstep.sh} in the makefile
|
||||||
package to you initialization file (such as @file{.profile}). For instance:
|
package to you initialization file (such as @file{.profile}). For instance:
|
||||||
|
|
|
@ -40,7 +40,6 @@ LIBRARY_NAME=libgnustep-base
|
||||||
# GNUSTEP_INSTALL_PREFIX must be defined here and not in config.h because
|
# GNUSTEP_INSTALL_PREFIX must be defined here and not in config.h because
|
||||||
# the installing person may set it on the `make' command line.
|
# the installing person may set it on the `make' command line.
|
||||||
DEFS= -DGNUSTEP_INSTALL_PREFIX=$(GNUSTEP_SYSTEM_ROOT) \
|
DEFS= -DGNUSTEP_INSTALL_PREFIX=$(GNUSTEP_SYSTEM_ROOT) \
|
||||||
-DPLATFORM_OS=\"$(GNUSTEP_TARGET_OS)\" \
|
|
||||||
-DGNUSTEP_TARGET_DIR=\"$(GNUSTEP_TARGET_DIR)\" \
|
-DGNUSTEP_TARGET_DIR=\"$(GNUSTEP_TARGET_DIR)\" \
|
||||||
-DGNUSTEP_TARGET_CPU=\"$(GNUSTEP_TARGET_CPU)\" \
|
-DGNUSTEP_TARGET_CPU=\"$(GNUSTEP_TARGET_CPU)\" \
|
||||||
-DGNUSTEP_TARGET_OS=\"$(GNUSTEP_TARGET_OS)\" \
|
-DGNUSTEP_TARGET_OS=\"$(GNUSTEP_TARGET_OS)\" \
|
||||||
|
|
|
@ -105,12 +105,6 @@ static NSBundle* _loadingBundle = nil;
|
||||||
static NSLock* load_lock = nil;
|
static NSLock* load_lock = nil;
|
||||||
static BOOL _strip_after_loading = NO;
|
static BOOL _strip_after_loading = NO;
|
||||||
|
|
||||||
static NSString* platform =
|
|
||||||
#ifdef PLATFORM_OS
|
|
||||||
@PLATFORM_OS;
|
|
||||||
#else
|
|
||||||
nil;
|
|
||||||
#endif
|
|
||||||
static NSString* gnustep_target_dir =
|
static NSString* gnustep_target_dir =
|
||||||
#ifdef GNUSTEP_TARGET_DIR
|
#ifdef GNUSTEP_TARGET_DIR
|
||||||
@GNUSTEP_TARGET_DIR;
|
@GNUSTEP_TARGET_DIR;
|
||||||
|
@ -582,12 +576,12 @@ _bundle_load_callback(Class theClass, Category *theCategory)
|
||||||
[NSString stringWithFormat: @"%@.%@", name, ext]];
|
[NSString stringWithFormat: @"%@.%@", name, ext]];
|
||||||
if ( stat([fullpath cString], &statbuf) == 0)
|
if ( stat([fullpath cString], &statbuf) == 0)
|
||||||
{
|
{
|
||||||
if (platform)
|
if (gnustep_target_os)
|
||||||
{
|
{
|
||||||
NSString* platpath;
|
NSString* platpath;
|
||||||
platpath = [path stringByAppendingPathComponent:
|
platpath = [path stringByAppendingPathComponent:
|
||||||
[NSString stringWithFormat: @"%@-%@.%@",
|
[NSString stringWithFormat: @"%@-%@.%@",
|
||||||
name, platform, ext]];
|
name, gnustep_target_os, ext]];
|
||||||
if ( stat([platpath cString], &statbuf) == 0)
|
if ( stat([platpath cString], &statbuf) == 0)
|
||||||
fullpath = platpath;
|
fullpath = platpath;
|
||||||
}
|
}
|
||||||
|
@ -602,12 +596,12 @@ _bundle_load_callback(Class theClass, Category *theCategory)
|
||||||
[NSString stringWithFormat: @"%@", name]];
|
[NSString stringWithFormat: @"%@", name]];
|
||||||
if ( stat([fullpath cString], &statbuf) == 0)
|
if ( stat([fullpath cString], &statbuf) == 0)
|
||||||
{
|
{
|
||||||
if (platform)
|
if (gnustep_target_os)
|
||||||
{
|
{
|
||||||
NSString* platpath;
|
NSString* platpath;
|
||||||
platpath = [path stringByAppendingPathComponent:
|
platpath = [path stringByAppendingPathComponent:
|
||||||
[NSString stringWithFormat: @"%@-%@",
|
[NSString stringWithFormat: @"%@-%@",
|
||||||
name, platform]];
|
name, gnustep_target_os]];
|
||||||
if ( stat([platpath cString], &statbuf) == 0)
|
if ( stat([platpath cString], &statbuf) == 0)
|
||||||
fullpath = platpath;
|
fullpath = platpath;
|
||||||
}
|
}
|
||||||
|
@ -615,12 +609,12 @@ _bundle_load_callback(Class theClass, Category *theCategory)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fullpath = _bundle_path_for_name(path, name);
|
fullpath = _bundle_path_for_name(path, name);
|
||||||
if (fullpath && platform)
|
if (fullpath && gnustep_target_os)
|
||||||
{
|
{
|
||||||
NSString* platpath;
|
NSString* platpath;
|
||||||
platpath = _bundle_path_for_name(path,
|
platpath = _bundle_path_for_name(path,
|
||||||
[NSString stringWithFormat: @"%@-%@",
|
[NSString stringWithFormat: @"%@-%@",
|
||||||
name, platform]);
|
name, gnustep_target_os]);
|
||||||
if (platpath)
|
if (platpath)
|
||||||
fullpath = platpath;
|
fullpath = platpath;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,10 +41,11 @@ _ostream_error (const char* message)
|
||||||
int
|
int
|
||||||
ostream_getc (ostream* s)
|
ostream_getc (ostream* s)
|
||||||
{
|
{
|
||||||
char c = 0;
|
char r, c;
|
||||||
|
r = c = 0;
|
||||||
if (s->flags & OSTREAM_READFLAG)
|
if (s->flags & OSTREAM_READFLAG)
|
||||||
[(id <Streaming>)s->stream_obj readByte: &c];
|
r = [(id <Streaming>)s->stream_obj readByte: &c];
|
||||||
else
|
if (r == 0)
|
||||||
c = OSTREAM_EOF;
|
c = OSTREAM_EOF;
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
@ -105,23 +106,26 @@ ostream_tell (ostream *s)
|
||||||
int
|
int
|
||||||
ostream_read (ostream* s, void* buf, int count)
|
ostream_read (ostream* s, void* buf, int count)
|
||||||
{
|
{
|
||||||
|
int r = 0;
|
||||||
assert(buf); /* xxxFIXME: should be an exception ? */
|
assert(buf); /* xxxFIXME: should be an exception ? */
|
||||||
if (s->flags & OSTREAM_READFLAG)
|
if (s->flags & OSTREAM_READFLAG)
|
||||||
return [(id <Streaming>)s->stream_obj readBytes: buf length: count];
|
r = [(id <Streaming>)s->stream_obj readBytes: buf length: count];
|
||||||
return OSTREAM_EOF;
|
if (r == 0)
|
||||||
|
r = OSTREAM_EOF;
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* ostream_gets (ostream* s, char* buf, int count)
|
char* ostream_gets (ostream* s, char* buf, int count)
|
||||||
{
|
{
|
||||||
char c;
|
char r, c;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
assert(buf); /* xxxFIXME: should be an exception ? */
|
assert(buf); /* xxxFIXME: should be an exception ? */
|
||||||
if (!(s->flags & OSTREAM_READFLAG))
|
if (!(s->flags & OSTREAM_READFLAG))
|
||||||
return NULL;
|
return NULL;
|
||||||
while (i < count-1) {
|
while (i < count-1) {
|
||||||
[(id <Streaming>)s->stream_obj readByte: &c];
|
r = [(id <Streaming>)s->stream_obj readByte: &c];
|
||||||
if (c == -1)
|
if (r <= 0)
|
||||||
break;
|
break;
|
||||||
buf[i++] = c;
|
buf[i++] = c;
|
||||||
if (c == '\n')
|
if (c == '\n')
|
||||||
|
@ -177,8 +181,14 @@ ostream_vscanf (ostream *s, const char *format, va_list argList)
|
||||||
{
|
{
|
||||||
id str = [[NSString alloc] stringWithCString: format];
|
id str = [[NSString alloc] stringWithCString: format];
|
||||||
if (s->flags & OSTREAM_READFLAG)
|
if (s->flags & OSTREAM_READFLAG)
|
||||||
return [(id <Streaming>)s->stream_obj readFormat: str
|
{
|
||||||
|
int r = 0;
|
||||||
|
r = [(id <Streaming>)s->stream_obj readFormat: str
|
||||||
arguments: argList];
|
arguments: argList];
|
||||||
|
if (r == 0)
|
||||||
|
r = OSTREAM_EOF;
|
||||||
|
return r;
|
||||||
|
}
|
||||||
_ostream_error("Tried to read from non-readable stream");
|
_ostream_error("Tried to read from non-readable stream");
|
||||||
[str release];
|
[str release];
|
||||||
return OSTREAM_EOF;
|
return OSTREAM_EOF;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue