home *** CD-ROM | disk | FTP | other *** search
- *** 1.77 1992/06/03 14:47:34
- --- Changelo 1992/07/20 21:56:31
- ***************
- *** 3169,3171 ****
- --- 3169,3206 ----
- a mistake there.
-
- ---------------------------- Patchlevel 81 ---------------------------
- +
- + keycode.h, unistd.h:: michal
- + change #if defined() to #ifdef
- +
- + *.h:: ++jrb
- + make all decls for alloca consistent
- +
- + getlogin.c, lseek.c, qsort.c, gnulib2.c, stat.c:: ++jrb
- + #include <memory.h> for alloca.
- +
- + all over:: ers, ++jrb
- + change unx2dos/dos2unx to _unx2dos/_dos2unx to avoid posix names
- + space corruption in the library. not that there is still a user
- + callable unx2dos/dos2unx.
- +
- + atol.c:: ers
- + conditionalize proto
- +
- + getuid.c:: ers
- + let default uid/gid be root/bin
- +
- + lib.h:: ers
- + adjust protos
- +
- + gnulib2.c:: alexander lehmann
- + _fixunssfsi(): I did some investigating and discovered that the
- + function did almost always return 0xffffffff. However the function
- + doesn't look wrong in any sense. I rewrote the function a bit
- + (without really changing anything) and now it works. The problem arises
- + from a bug in GCC, that causes certain negative integer constants to
- + become positive when cast to float. e.g. -2^31 (LONG_MIN) becomes
- + 2^31. This constant was used in the _fixunssfsi function and caused the
- + problem.
- +
- + ---------------------------- Patchlevel 82 ---------------------------
- *** 1.57 1992/06/03 14:46:01
- --- PatchLev.h 1992/07/20 21:56:32
- ***************
- *** 1,5 ****
-
- ! #define PatchLevel "81"
-
- /*
- *
- --- 1,5 ----
-
- ! #define PatchLevel "82"
-
- /*
- *
- *** 1.1 1991/06/20 02:12:19
- --- device.c 1992/07/20 21:56:37
- ***************
- *** 4,10 ****
-
- /*
- * Pseudo-device interface stuff. New devices can be hooked into the chain
- ! * that's rooted at __devices. All unx2dos and low level i/o functions use this
- * chain in determining whether files are devices or disk files, as does stat().
- * The major device number of user-supplied devices must *NOT* be 0 or 0xff,
- * both of which are reserved.
- --- 4,10 ----
-
- /*
- * Pseudo-device interface stuff. New devices can be hooked into the chain
- ! * that's rooted at __devices. All _unx2dos and low level i/o functions use this
- * chain in determining whether files are devices or disk files, as does stat().
- * The major device number of user-supplied devices must *NOT* be 0 or 0xff,
- * both of which are reserved.
- *** 1.13 1991/06/11 23:04:27
- --- dirent.c 1992/07/20 21:56:37
- ***************
- *** 56,62 ****
- short i = 0;
- struct _dta mydta, *olddta;
-
- ! unx2dos(_dirname, dirname);
-
- #if 0
- /* we should maybe check to see if we're opening a directory */
- --- 56,62 ----
- short i = 0;
- struct _dta mydta, *olddta;
-
- ! _unx2dos(_dirname, dirname);
-
- #if 0
- /* we should maybe check to see if we're opening a directory */
- *** 1.12 1992/06/01 01:57:48
- --- mkdir.c 1992/07/20 21:56:41
- ***************
- *** 21,32 ****
- char path[FILENAME_MAX];
-
- /*
- ! * unx2dos indicates whether the name has been modified in some way
- * in its return value. In this case, we try to create an
- * automatic symbolic link which gives the "real" name, which is put
- * in the global variable __link_name[].
- */
- ! name_munged = (unx2dos(_path, path) == _NM_CHANGE);
-
- rv = Fattrib(path, 0, 0); /* Get file attributes */
- if (rv >= 0) { /* Does it exist ? */
- --- 21,32 ----
- char path[FILENAME_MAX];
-
- /*
- ! * _unx2dos indicates whether the name has been modified in some way
- * in its return value. In this case, we try to create an
- * automatic symbolic link which gives the "real" name, which is put
- * in the global variable __link_name[].
- */
- ! name_munged = (_unx2dos(_path, path) == _NM_CHANGE);
-
- rv = Fattrib(path, 0, 0); /* Get file attributes */
- if (rv >= 0) { /* Does it exist ? */
- *** 1.16 1991/09/24 16:44:02
- --- open.c 1992/07/20 21:56:42
- ***************
- *** 51,61 ****
- mode = ((unsigned int)(va_arg(argp, int))) & ~__umask;
-
- /* convert Unix style filename to GEMDOS style */
- ! /* if the name gets munged, unx2dos will return _NM_CHANGE,
- * and will copy the original name to the global array __link_name[]
- */
-
- ! name_munged = unx2dos(_path, path);
-
- if (name_munged == _NM_DEV && (dev = _dev_dosname(path)) && dev->open) {
- return (*dev->open)(path, flags, mode);
- --- 51,61 ----
- mode = ((unsigned int)(va_arg(argp, int))) & ~__umask;
-
- /* convert Unix style filename to GEMDOS style */
- ! /* if the name gets munged, _unx2dos will return _NM_CHANGE,
- * and will copy the original name to the global array __link_name[]
- */
-
- ! name_munged = _unx2dos(_path, path);
-
- if (name_munged == _NM_DEV && (dev = _dev_dosname(path)) && dev->open) {
- return (*dev->open)(path, flags, mode);
- *** 1.14 1991/12/26 15:53:59
- --- rename.c 1992/07/20 21:56:42
- ***************
- *** 29,36 ****
- }
- errno = save_errno;
-
- ! rval = unx2dos(_oldname, oldname);
- ! /* unx2dos returns _NM_LINK and sets __link_path and __link_name if
- * given a symbolic link
- */
- if (rval == _NM_LINK) { /* a symbolic link */
- --- 29,36 ----
- }
- errno = save_errno;
-
- ! rval = _unx2dos(_oldname, oldname);
- ! /* _unx2dos returns _NM_LINK and sets __link_path and __link_name if
- * given a symbolic link
- */
- if (rval == _NM_LINK) { /* a symbolic link */
- ***************
- *** 60,68 ****
- }
-
- /*
- ! * save info about whether or not the name got changed by unx2dos
- */
- ! name_munged = (unx2dos(_newname, newname) == _NM_CHANGE);
- /*
- * for a symbolic link, we now have an entry "ent" which points at
- * the old symbolic link. Make a new symbolic link, with the new name,
- --- 60,68 ----
- }
-
- /*
- ! * save info about whether or not the name got changed by _unx2dos
- */
- ! name_munged = (_unx2dos(_newname, newname) == _NM_CHANGE);
- /*
- * for a symbolic link, we now have an entry "ent" which points at
- * the old symbolic link. Make a new symbolic link, with the new name,
- *** 1.9 1992/04/13 15:50:45
- --- rmdir.c 1992/07/20 21:56:43
- ***************
- *** 24,32 ****
- char path[FILENAME_MAX], *s;
- int r, nm_change;
-
- ! nm_change = unx2dos(_path, path);
- /*
- ! * unx2dos returns _NM_LINK and sets __link_path for symbolic links
- */
-
- if (nm_change == _NM_LINK) { /* _path was to a symbolic link */
- --- 24,32 ----
- char path[FILENAME_MAX], *s;
- int r, nm_change;
-
- ! nm_change = _unx2dos(_path, path);
- /*
- ! * _unx2dos returns _NM_LINK and sets __link_path for symbolic links
- */
-
- if (nm_change == _NM_LINK) { /* _path was to a symbolic link */
- *** 1.19 1992/06/01 01:57:48
- --- stat.c 1992/07/20 21:56:44
- ***************
- *** 21,26 ****
- --- 21,27 ----
- #include "symdir.h"
- #include <time.h>
- #include "lib.h"
- + #include <memory.h>
-
- #ifndef NAME_MAX
- # include <limits.h>
- ***************
- *** 40,46 ****
- #define OLDDATE _unixtime(0,0)
-
- /*
- ! * check file cache for the file whose canonical (unx2dos) name is fullname.
- * this is only valid for TOS files, i.e. files that are NOT symbolic
- * links. If file is not found in cache, use Fsfirst to look it up.
- * All open directories (via opendir) are cached (we don't lose much by
- --- 41,47 ----
- #define OLDDATE _unixtime(0,0)
-
- /*
- ! * check file cache for the file whose canonical (_unx2dos) name is fullname.
- * this is only valid for TOS files, i.e. files that are NOT symbolic
- * links. If file is not found in cache, use Fsfirst to look it up.
- * All open directories (via opendir) are cached (we don't lose much by
- ***************
- *** 67,76 ****
- strcpy(path, fullname);
- if((tmp = strrchr(path, '\\'))) {
- *tmp++ = 0;
- ! dos2unx(tmp, name);
- }
- else {
- ! dos2unx(path, name);
- path[0] = 0;
- }
-
- --- 68,77 ----
- strcpy(path, fullname);
- if((tmp = strrchr(path, '\\'))) {
- *tmp++ = 0;
- ! _dos2unx(tmp, name);
- }
- else {
- ! _dos2unx(path, name);
- path[0] = 0;
- }
-
- ***************
- *** 124,135 ****
- }
-
- /*
- ! * NOTE: the new unx2dos gives a complete, canonical TOS pathname
- * (i.e. stripped of . and .., and with a drive letter). It also returns
- * some useful information about what the given filename was (e.g. symlink,
- * or device)
- */
- ! nval = unx2dos(_path, path);
- if (nval == _NM_DEV) {
- device = _dev_dosname(path);
- st->st_mode = S_IFCHR | 0600;
- --- 125,136 ----
- }
-
- /*
- ! * NOTE: the new _unx2dos gives a complete, canonical TOS pathname
- * (i.e. stripped of . and .., and with a drive letter). It also returns
- * some useful information about what the given filename was (e.g. symlink,
- * or device)
- */
- ! nval = _unx2dos(_path, path);
- if (nval == _NM_DEV) {
- device = _dev_dosname(path);
- st->st_mode = S_IFCHR | 0600;
- ***************
- *** 267,273 ****
- {
- if (__open_stat[fd].filename) {
- /* we should turn off links, because the name we're going to give
- ! * to 'stat' has already been unx2dos'd
- */
- old = _lOK;
- _lOK = 0;
- --- 268,274 ----
- {
- if (__open_stat[fd].filename) {
- /* we should turn off links, because the name we're going to give
- ! * to 'stat' has already been _unx2dos'd
- */
- old = _lOK;
- _lOK = 0;
- ***************
- *** 346,352 ****
- {
- int r;
-
- ! /* unx2dos returns _NM_LINK if the last path component was a symbolic link
- * in this case, __link_name and __link_path are set to the name and path
- * of the symbolic link file, __link_to to its contents, and __link_flags
- * its flags.
- --- 347,353 ----
- {
- int r;
-
- ! /* _unx2dos returns _NM_LINK if the last path component was a symbolic link
- * in this case, __link_name and __link_path are set to the name and path
- * of the symbolic link file, __link_to to its contents, and __link_flags
- * its flags.
- *** 1.4 1991/09/24 16:44:02
- --- symdir.c 1992/07/20 21:56:44
- ***************
- *** 54,60 ****
- /*
- * Routines for keeping a cache of recently used symbolic directories.
- * The last 8 directories accessed are kept cached; this really helps
- ! * the directory searches in unx2dos, but does eat some memory.
- *
- * entries are added to the cache by _free_symdir, and removed if they
- * fall off the end, or if they're retrieved by a subsequent _read_symdir.
- --- 54,60 ----
- /*
- * Routines for keeping a cache of recently used symbolic directories.
- * The last 8 directories accessed are kept cached; this really helps
- ! * the directory searches in _unx2dos, but does eat some memory.
- *
- * entries are added to the cache by _free_symdir, and removed if they
- * fall off the end, or if they're retrieved by a subsequent _read_symdir.
- ***************
- *** 116,124 ****
- }
-
- /*
- ! * free a symbolic directory. Note that unx2dos is expecting the entries
- * to be accessible, i.e. it knows that we're caching at least 1 directory.
- ! * If this ever changes, change unx2dos.
- */
-
- void _free_symdir(dir)
- --- 116,124 ----
- }
-
- /*
- ! * free a symbolic directory. Note that _unx2dos is expecting the entries
- * to be accessible, i.e. it knows that we're caching at least 1 directory.
- ! * If this ever changes, change _unx2dos.
- */
-
- void _free_symdir(dir)
- ***************
- *** 320,328 ****
- strcpy(path, dosname);
- if ((p = strrchr(path, '\\'))) {
- *p++ = 0;
- ! dos2unx(p, oldname);
- } else {
- ! dos2unx(path, oldname);
- path[0] = 0;
- }
-
- --- 320,328 ----
- strcpy(path, dosname);
- if ((p = strrchr(path, '\\'))) {
- *p++ = 0;
- ! _dos2unx(p, oldname);
- } else {
- ! _dos2unx(path, oldname);
- path[0] = 0;
- }
-
- *** 1.4 1991/06/11 23:04:27
- --- symdir.h 1992/07/20 21:56:44
- ***************
- *** 60,69 ****
- void _free_symdir(SYMDIR *dir);
-
- void _set_unixmode(char *mode);
- - int _unx2dos(const char *, char *);
- - int _dos2unx(const char *, char *);
- - int unx2dos(const char *, char *);
- - int dos2unx(const char *, char *);
-
- #else
-
- --- 60,65 ----
- ***************
- *** 71,75 ****
- --- 67,73 ----
- extern SYMENTRY *_symdir_lookup();
-
- #endif
- +
- + #include "lib.h"
-
- #endif /* _SYMDIR_H */
- *** 1.8 1991/12/26 15:53:59
- --- symlink.c 1992/07/20 21:56:45
- ***************
- *** 24,40 ****
- int r, save_errno;
-
- /* Problem: to TOS, "Makefile", "Makefile", and "makefilefoo" are all
- ! * identical. Fortunately, unx2dos can distinguish them, and
- * returns _NM_CHANGE for names that are not "canonical" (_NM_OK
- * means a normal file, _NM_LINK means an existing symbolic link).
- ! * So if unx2dos returns _NM_OK, and access finds the file, then
- ! * it already exists; if unx2dos returns _NM_LINK, the file already
- * exists as a symbolic link (access would work in this case, but
- * is redundant).
- */
-
- save_errno = errno;
- ! r = unx2dos(new, linkpath);
- if ((r == _NM_LINK) || (r == _NM_OK) && !access(new, 0)) {
- errno = EEXIST;
- return -1;
- --- 24,40 ----
- int r, save_errno;
-
- /* Problem: to TOS, "Makefile", "Makefile", and "makefilefoo" are all
- ! * identical. Fortunately, _unx2dos can distinguish them, and
- * returns _NM_CHANGE for names that are not "canonical" (_NM_OK
- * means a normal file, _NM_LINK means an existing symbolic link).
- ! * So if _unx2dos returns _NM_OK, and access finds the file, then
- ! * it already exists; if _unx2dos returns _NM_LINK, the file already
- * exists as a symbolic link (access would work in this case, but
- * is redundant).
- */
-
- save_errno = errno;
- ! r = _unx2dos(new, linkpath);
- if ((r == _NM_LINK) || (r == _NM_OK) && !access(new, 0)) {
- errno = EEXIST;
- return -1;
- ***************
- *** 43,49 ****
-
- /*
- * find the name (from the original path in "new"), and the canonical form
- ! * of the path to it (from what unx2dos just gave us)
- */
-
- name = new;
- --- 43,49 ----
-
- /*
- * find the name (from the original path in "new"), and the canonical form
- ! * of the path to it (from what _unx2dos just gave us)
- */
-
- name = new;
- ***************
- *** 110,123 ****
- }
- if (lastslash==tmp) {
- lastslash++;
- ! unx2dos("/",linkpath);
- } else if (lastslash) {
- *lastslash++ = 0;
- ! unx2dos(tmp, linkpath);
- }
- else {
- lastslash = tmp;
- ! unx2dos(".", linkpath);
- }
- if (!(dir = _read_symdir(linkpath))) {
- errno = EPATH;
- --- 110,123 ----
- }
- if (lastslash==tmp) {
- lastslash++;
- ! _unx2dos("/",linkpath);
- } else if (lastslash) {
- *lastslash++ = 0;
- ! _unx2dos(tmp, linkpath);
- }
- else {
- lastslash = tmp;
- ! _unx2dos(".", linkpath);
- }
- if (!(dir = _read_symdir(linkpath))) {
- errno = EPATH;
- *** 1.18 1991/12/26 15:53:59
- --- unlink.c 1992/07/20 21:56:45
- ***************
- *** 59,69 ****
- SYMDIR *dir = 0;
- SYMENTRY *ent = 0, *old;
- /*
- ! * unx2dos returns _NM_LINK if "filename" was a symbolic link,
- * in which case __link_path[] is the path to the directory containing
- * the link, and __link_name[] is the name of the link.
- */
- ! nameinfo = unx2dos(filename, name);
-
- if (nameinfo == _NM_LINK) { /* a symbolic link */
- if (!(dir = _read_symdir(__link_path)))
- --- 59,69 ----
- SYMDIR *dir = 0;
- SYMENTRY *ent = 0, *old;
- /*
- ! * _unx2dos returns _NM_LINK if "filename" was a symbolic link,
- * in which case __link_path[] is the path to the directory containing
- * the link, and __link_name[] is the name of the link.
- */
- ! nameinfo = _unx2dos(filename, name);
-
- if (nameinfo == _NM_LINK) { /* a symbolic link */
- if (!(dir = _read_symdir(__link_path)))
- *** 1.23 1992/06/01 01:57:48
- --- unx2dos.c 1992/07/20 21:56:45
- ***************
- *** 464,470 ****
- */
-
- int
- ! _unx2dos(unx, dos)
- const char *unx;
- char *dos;
- {
- --- 464,470 ----
- */
-
- int
- ! _lib_unx2dos(unx, dos)
- const char *unx;
- char *dos;
- {
- ***************
- *** 522,528 ****
- */
-
- int
- ! _dos2unx(dos, unx)
- const char *dos;
- char *unx;
- {
- --- 522,528 ----
- */
-
- int
- ! _lib_dos2unx(dos, unx)
- const char *dos;
- char *unx;
- {
- ***************
- *** 609,616 ****
-
- /* system default file name mapping function pointers */
-
- ! static fnmapfunc_t ux2dos = _unx2dos;
- ! static fnmapfunc_t dos2ux = _dos2unx;
-
- /* set user specified filename mapping function
- * NULL => use system default mapping function
- --- 609,616 ----
-
- /* system default file name mapping function pointers */
-
- ! static fnmapfunc_t ux2dos = _lib_unx2dos;
- ! static fnmapfunc_t dos2ux = _lib_dos2unx;
-
- /* set user specified filename mapping function
- * NULL => use system default mapping function
- ***************
- *** 618,637 ****
- void fnmapfunc(u2dos, dos2u)
- fnmapfunc_t u2dos, dos2u;
- {
- ! ux2dos = (u2dos == NULL) ? _unx2dos : u2dos;
- ! dos2ux = (dos2u == NULL) ? _dos2unx : dos2u;
- }
-
- /* mapping functions -- call the mapping functions via pointers */
-
- ! int unx2dos(u, d)
- const char *u;
- char *d;
- {
- return (*ux2dos)(u, d);
- }
-
- ! int dos2unx(d, u)
- const char *d;
- char *u;
- {
- --- 618,659 ----
- void fnmapfunc(u2dos, dos2u)
- fnmapfunc_t u2dos, dos2u;
- {
- ! ux2dos = (u2dos == NULL) ? _lib_unx2dos : u2dos;
- ! dos2ux = (dos2u == NULL) ? _lib_dos2unx : dos2u;
- }
-
- /* mapping functions -- call the mapping functions via pointers */
-
- ! #ifdef __GNUC__
- ! asm(".stabs \"_unx2dos\",5,0,0,__unx2dos"); /* dept of clean tricks */
- ! #else
- ! int __unx2dos(u, d)
- const char *u;
- char *d;
- {
- return (*ux2dos)(u, d);
- }
- + #endif
- +
- + int _unx2dos(u, d)
- + const char *u;
- + char *d;
- + {
- + return (*ux2dos)(u, d);
- + }
- +
- + #ifdef __GNUC__
- + asm(".stabs \"_dos2unx\",5,0,0,__dos2unx"); /* dept of clean tricks */
- + #else
- + int __dos2unx(d, u)
- + const char *d;
- + char *u;
- + {
- + return (*dos2ux)(d, u);
- + }
- + #endif
-
- ! int _dos2unx(d, u)
- const char *d;
- char *u;
- {
- *** 1.3 1989/03/23 18:24:27
- --- atol.c 1992/07/20 22:04:55
- ***************
- *** 4,14 ****
- #include <stdlib.h>
- #include <assert.h>
-
- ! #ifdef __STDC__
- ! long strtol(const char *, char **, int);
- ! #else
- ! extern long strtol();
- ! #endif
-
- int atoi(str)
- const char *str;
- --- 4,10 ----
- #include <stdlib.h>
- #include <assert.h>
-
- ! __EXTERN long strtol __PROTO((const char *, char **, int));
-
- int atoi(str)
- const char *str;
- *** 1.10 1992/06/01 01:54:10
- --- chdir.c 1992/07/20 22:04:56
- ***************
- *** 22,28 ****
-
- assert ((dir != NULL));
-
- ! (void)unx2dos(dir, tmp); /* convert Unix filename to DOS */
- d = tmp;
- old = Dgetdrv();
- if (*d && *(d+1) == ':') {
- --- 22,28 ----
-
- assert ((dir != NULL));
-
- ! (void)_unx2dos(dir, tmp); /* convert Unix filename to DOS */
- d = tmp;
- old = Dgetdrv();
- if (*d && *(d+1) == ':') {
- *** 1.6 1992/06/01 01:54:10
- --- chmod.c 1992/07/20 22:04:56
- ***************
- *** 21,27 ****
- char path[PATH_MAX];
- struct stat stb;
-
- ! (void)unx2dos(_path, path);
-
- if (__mint >= 9) { /* use MiNT Fchmod function */
- r = Fchmod(path, mode);
- --- 21,27 ----
- char path[PATH_MAX];
- struct stat stb;
-
- ! (void)_unx2dos(_path, path);
-
- if (__mint >= 9) { /* use MiNT Fchmod function */
- r = Fchmod(path, mode);
- ***************
- *** 68,74 ****
- char name[PATH_MAX];
-
- if (__mint >= 9) {
- ! (void)unx2dos(_name, name);
- r = Fchown(name, uid, gid);
- if (r) {
- errno = -r;
- --- 68,74 ----
- char name[PATH_MAX];
-
- if (__mint >= 9) {
- ! (void)_unx2dos(_name, name);
- r = Fchown(name, uid, gid);
- if (r) {
- errno = -r;
- *** 1.8 1992/04/13 15:50:45
- --- getenv.c 1992/07/20 22:05:04
- ***************
- *** 1,12 ****
- /* functions for manipulating the environment */
- /* written by Eric R. Smith and placed in the public domain */
-
- #include <stddef.h>
- #include <string.h>
- #include <stdlib.h>
- - #ifndef _COMPILER_H
- - #include <compiler.h>
- - #endif
-
- extern char ** environ;
-
- --- 1,10 ----
- /* functions for manipulating the environment */
- /* written by Eric R. Smith and placed in the public domain */
- + /* 5/5/92 sb -- separated for efficiency, see also putenv.c */
-
- #include <stddef.h>
- #include <string.h>
- #include <stdlib.h>
-
- extern char ** environ;
-
- *** 1.7 1992/06/01 01:54:10
- --- getlogin.c 1992/07/20 22:05:04
- ***************
- *** 8,17 ****
- #include <memory.h>
- #include <unistd.h>
-
- - #ifdef __GNUC__
- - #define alloca __builtin_alloca
- - #endif
- -
- static char *logname = NULL;
-
- char *getlogin()
- --- 8,13 ----
- *** 1.7 1992/06/01 01:54:10
- --- getuid.c 1992/07/20 22:05:06
- ***************
- *** 6,12 ****
-
- extern int __mint;
-
- ! static int __uid = 1, __gid = 1;
-
- uid_t getuid() { return __mint ? Pgetuid() : __uid; }
- gid_t getgid() { return __mint ? Pgetgid() : __gid; }
- --- 6,12 ----
-
- extern int __mint;
-
- ! static int __uid = 0, __gid = 0;
-
- uid_t getuid() { return __mint ? Pgetuid() : __uid; }
- gid_t getgid() { return __mint ? Pgetgid() : __gid; }
- *** 1.10 1992/04/13 15:50:45
- --- gnulib2.c 1992/07/20 22:05:07
- ***************
- *** 1,5 ****
- --- 1,6 ----
- /* WARNING: compile this in 32 bit int mode even for short library */
- #include <string.h>
- + #include <memory.h>
- #ifndef _COMPILER_H
- #include <compiler.h>
- #endif
- ***************
- *** 72,85 ****
- #define HOST_BITS_PER_INT 32
- #define HOST_BITS_PER_LONG 32
-
- - #ifdef __GNUC__
- - #ifndef minix
- - #define alloca __builtin_alloca
- - #else
- - void *alloca(unsigned long);
- - #endif
- - #endif
- -
- /* Define this if most significant bit is lowest numbered
- in instructions that operate on numbered bit-fields.
- This is true for 68020 insns such as bfins and bfexts.
- --- 73,78 ----
- ***************
- *** 1636,1642 ****
- unsigned SItype
- __fixunssfsi (float a)
- {
- ! if (a >= - (float) LONG_MIN)
- return (SItype) (a + LONG_MIN) - LONG_MIN;
- return (SItype) a;
- }
- --- 1629,1635 ----
- unsigned SItype
- __fixunssfsi (float a)
- {
- ! if (a >= ((float) LONG_MAX)+1)
- return (SItype) (a + LONG_MIN) - LONG_MIN;
- return (SItype) a;
- }
- *** 1.6 1992/06/01 01:54:10
- --- lib.h 1992/07/20 22:05:07
- ***************
- *** 14,41 ****
- /* filename mapping function type */
- #ifndef __FNMAP
- #define __FNMAP
- ! #ifdef __STDC__
- ! typedef int (*fnmapfunc_t)(const char *, char *);
- ! #else
- ! typedef int (*fnmapfunc_t)();
- ! #endif
- #endif
-
- __EXTERN int _unx2dos __PROTO((const char *, char *));
- __EXTERN int _dos2unx __PROTO((const char *, char *));
- __EXTERN int unx2dos __PROTO((const char *, char *));
- __EXTERN int dos2unx __PROTO((const char *, char *));
- __EXTERN void fnmapfunc __PROTO((fnmapfunc_t u2dos, fnmapfunc_t dos2u));
- !
- ! __EXTERN int spawnve __PROTO((int, char *, char **, char **));
-
- __EXTERN long _write __PROTO((int, const void *, unsigned long));
- __EXTERN long _read __PROTO((int, void *, unsigned long));
- __EXTERN int console_input_status __PROTO((int));
- __EXTERN unsigned int console_read_byte __PROTO((int));
- __EXTERN void console_write_byte __PROTO((int, int));
-
- ! __EXTERN time_t dostime __PROTO((time_t));
- __EXTERN time_t _unixtime __PROTO((unsigned int, unsigned int));
-
- __EXTERN char * findfile __PROTO((char *, char *, char **));
- --- 14,42 ----
- /* filename mapping function type */
- #ifndef __FNMAP
- #define __FNMAP
- ! typedef int (*fnmapfunc_t) __PROTO((const char *, char *));
- #endif
-
- __EXTERN int _unx2dos __PROTO((const char *, char *));
- __EXTERN int _dos2unx __PROTO((const char *, char *));
- + #ifndef __MINT__
- __EXTERN int unx2dos __PROTO((const char *, char *));
- __EXTERN int dos2unx __PROTO((const char *, char *));
- __EXTERN void fnmapfunc __PROTO((fnmapfunc_t u2dos, fnmapfunc_t dos2u));
- ! #endif
-
- __EXTERN long _write __PROTO((int, const void *, unsigned long));
- __EXTERN long _read __PROTO((int, void *, unsigned long));
- + #ifndef __MINT__
- __EXTERN int console_input_status __PROTO((int));
- __EXTERN unsigned int console_read_byte __PROTO((int));
- __EXTERN void console_write_byte __PROTO((int, int));
- + #else
- + __EXTERN int _console_read_byte __PROTO((int));
- + __EXTERN void _console_write_byte __PROTO((int, int));
- + #endif
-
- ! __EXTERN time_t _dostime __PROTO((time_t));
- __EXTERN time_t _unixtime __PROTO((unsigned int, unsigned int));
-
- __EXTERN char * findfile __PROTO((char *, char *, char **));
- *** 1.8 1992/06/01 01:54:10
- --- lseek.c 1992/07/20 22:05:08
- ***************
- *** 7,18 ****
- #include <unistd.h>
- #include "lib.h"
-
- - #ifdef __GNUC__
- - # ifndef alloca
- - # define alloca __builtin_alloca
- - # endif
- - #endif
- -
- static long _real_lseek(h, where, how)
- int h;
- long where;
- --- 7,12 ----
- *** 1.12 1992/06/01 01:54:10
- --- qsort.c 1992/07/20 22:05:10
- ***************
- *** 19,31 ****
- # include <stdlib.h>
- #endif
- #include <string.h>
-
- #ifdef __GNUC__
- # ifdef minix
- void *alloca(unsigned long);
- typedef unsigned long size_t;
- - # else
- - # define alloca __builtin_alloca
- # endif
- # define INLINE inline
- #else
- --- 19,30 ----
- # include <stdlib.h>
- #endif
- #include <string.h>
- + #include <memory.h>
-
- #ifdef __GNUC__
- # ifdef minix
- void *alloca(unsigned long);
- typedef unsigned long size_t;
- # endif
- # define INLINE inline
- #else
- *** 1.17 1992/06/01 01:54:10
- --- system.c 1992/07/20 22:05:15
- ***************
- *** 167,173 ****
- /* now actually run the program */
-
- if (*infile) {
- ! (void)unx2dos(infile,path);
- infd = Fopen(path, 0);
- if (infd < __SMALLEST_VALID_HANDLE) {
- perror(infile);
- --- 167,173 ----
- /* now actually run the program */
-
- if (*infile) {
- ! (void)_unx2dos(infile,path);
- infd = Fopen(path, 0);
- if (infd < __SMALLEST_VALID_HANDLE) {
- perror(infile);
- ***************
- *** 177,183 ****
- (void)Fforce(0, infd);
- }
- if (*outfile) {
- ! (void)unx2dos(outfile,path);
- if (append) {
- outfd = Fopen(path, 2);
- if (outfd < __SMALLEST_VALID_HANDLE)
- --- 177,183 ----
- (void)Fforce(0, infd);
- }
- if (*outfile) {
- ! (void)_unx2dos(outfile,path);
- if (append) {
- outfd = Fopen(path, 2);
- if (outfd < __SMALLEST_VALID_HANDLE)
- *** 1.9 1992/06/01 01:54:10
- --- utime.c 1992/07/20 22:05:16
- ***************
- *** 51,57 ****
- else
- time(&settime);
-
- ! (void)unx2dos(_filename, filename);
- dtime = dostime(settime); /* convert unix time to dos */
- fh = Fopen(filename, 2);
- if (fh < 0) {
- --- 51,57 ----
- else
- time(&settime);
-
- ! (void)_unx2dos(_filename, filename);
- dtime = dostime(settime); /* convert unix time to dos */
- fh = Fopen(filename, 2);
- if (fh < 0) {
-