home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update33.zoo / lib / diffc next >
Encoding:
Text File  |  1993-10-26  |  68.4 KB  |  2,766 lines

  1. ===================================================================
  2. RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/Changelo,v
  3. retrieving revision 1.98
  4. diff -c -r1.98 Changelo
  5. *** 1.98    1993/07/13 17:07:21
  6. --- Changelo    1993/10/26 23:51:25
  7. ***************
  8. *** 3980,3982 ****
  9. --- 3980,4284 ----
  10.       take out setlinebuf proto, it does'nt really belong here.
  11.   
  12.   ---------------------------- Patchlevel 93 ---------------------------
  13. + falcon.h:: howard
  14. +     corrections from howard
  15. + math-68881.h:: ++jrb
  16. +     -- Put extern "C" around file when __cplusplus
  17. +     -- Make hypot use internal version of sqrt (because signature
  18. +        clash in libg++:xfix )
  19. +     -- Define internal version (_sqrt) of sqrt.
  20. + osbind.h: Robert.Wilhelm@Physik.TU-Muenchen.DE
  21. +     chand addw #n,sp to lea n(s),sp which is 4 cycles shorter
  22. + dirent.c::  Christoph Koerner (christof@wowbagger.pc-labor.uni-bremen.de)
  23. +     sync up dirent.c with changes in dirent.h (DIRENTSIZ -> __DIRENTSIZ)
  24. + fprintf.c:: ++jrb
  25. +     break out vfprintf, printf and vprintf into their own .o's. that
  26. +     way the user can replace any of them.
  27. + printf.c, vfprintf.c, vprintf.c:: ++jrb
  28. +     NEW files
  29. + mincl:: ++jrb
  30. +     add targets for above
  31. + gnulib2.c:: Steven Ourada (sourada@iastate.edu)
  32. +     #define WORD_BIG_ENDIAN for long long.
  33. + sync with mntlib35:
  34. + doprnt.c: ++Bjarne_Pohlers@ms2.maus.de
  35. +     Add support for printing/scanning long longs.
  36. + div.c: ++pvt1-117
  37. +     Add div functions for compilers other than GCC.
  38. + bsearch.c: ++dsb
  39. +     Fix bug reported by Thorsten Roskowetz: the order arguments to
  40. +     bsearch()'s comparison function was reversed.
  41. + ioctl.h: ++Jan-Hinrich_Fessel@un.maus.ruhr.de (Jan-Hinrich Fessel)
  42. +     Make it possible to include both ioctl.h and filesys.h.
  43. + pgrp.c: ++schwab
  44. +     Correctly check the MiNT version in _bsd_getpgrp().
  45. + doprnt.c: ++pvt1-117
  46. +     Changes to keep Lattice C from generating annoying warnings.
  47. + math.h, process.h, support.h, unistd.h, findfile.c, textio.c: ++schwab
  48. +     Add 'const' to declarations where appropriate.
  49. + malloc.c:  ++schwab
  50. +     Make malloc() round all memory requests to the page size to be able
  51. +     to use all the available memory.
  52. + setjmp.cpp, setjmp.h: ++schwab
  53. +     Some cleanup; one element of jmp_buf[] can be saved by using the
  54. +     fact that signal 0 cannot be masked; why was the type char*[] insead
  55. +     of long[]?
  56. + fopen.c: ++schwab
  57. +     Make fopen() use 0666 as the default file mask (use umask() if you
  58. +     want something else); make mkdir() respect the umask setting.
  59. + utime.c: ++shenson@nyx.cs.du.edu
  60. +     Pass through a NULL tset argument unchanged to the filesystem
  61. +     so that it can determine permissions correctly.
  62. + falcon.h: ++hyc@hanauma.Jpl.Nasa.Gov, ++Markus_Kilbinger@ac.maus.de
  63. +     Change several erroneous macros to correctly cast return to short.
  64. + errno.h: ++Ole_Arndt
  65. +     Add errors ENOTDIR and ELOOP.
  66. + signal.h: ++Ole_Arndt@f.maus.de (Ole Arndt)
  67. +     Fix definition of _SIGSET_MAX_INDEX to correct several bugs
  68. +     in the POSIX signal mask functions.
  69. + stdio.h:
  70. +     Add vsscanf() and _getbuf() protos (yech).
  71. + dirent.h:
  72. +     Add alphasort() proto (excluded by _POSIX_SOURCE).
  73. + utmp.h:
  74. +     Rename write_utmp() to _write_utmp().  Rename write_wtmp() to
  75. +     _write_wtmp().  Add protos (and other cleanups) to utmp.h.
  76. + atof.c, fdopen.c, fputs.c:
  77. +     Move 'register' to beginning of declarations (shuts up gcc -Wall).
  78. + fwrite.c: ++michal
  79. +         With unbuffered IO fwrite miscounts number of characters written.
  80. + findfile.c: ++michal
  81. +     Try to accomodate tos style paths PATH=e:\bin,c:\bin,...
  82. + unistd.h: ++jrb
  83. +     Take out setlinebuf, doesn't really belong here.
  84. + ffs.c: ++NTOMCZAK@vm.ucs.UAlberta.CA (Michal Jaegermann)
  85. +     An even faster algorithm.  Yow!  Are we optimized yet?
  86. + support.h:
  87. +     Added _exit() and gethostname() protos. Removed write_utmp() and
  88. +     write_wtmp() protos.
  89. + lib.h, crtinit.c:
  90. +     Moved prototypes from crtinit.c to lib.h, and added more to lib.h.
  91. + abort.c, lib.h:
  92. +     Make abort() close file handles in exactly the same manner
  93. +     as exit().
  94. + signal.h: ++nox@jelal.north.de, ++Oskar, ++entropy
  95. +     Fix type of sa_mask in struct sigaction (sigset_t, not long).
  96. + falcon.h: ++Markus_Kilbinger@ac.maus.de, ++entropy
  97. +     Add missing traps.
  98. + unistd.h, support.h:
  99. +     Cleaned unistd.h for easier reading.  Moved back the link(),
  100. +     symlink(), and readlink() protos from support.h (sorry if I seem
  101. +     really indecisive on where some of these protos belong).
  102. + doprnt.c, open.c, putenv.c, utime.c:
  103. +     Include appropriate headers for protos (and fixed mknod() proto).
  104. + sys/statfs.h:
  105. +     Add statfs() proto.
  106. + sys/errno.h, sys/ioctl.h, sys/resource.h, sys/signal.h, sys/wait.h:
  107. +     Fix multiple-include protection to hopefully prevent possible
  108. +     infinite include loops (see Bugs file).
  109. + getpw.c, pwd.h: ++Jan-Hinrich_Fessel@un.maus.de (Oskar)
  110. +     Use uid_t (_UID_T) for getpwuid() instead of int (POSIX).
  111. + === end of merge
  112. + symlink.c, spawnve.c, spawnvp.c, exec.c: ++jrb
  113. +     adjust args to meet new protos in process.h, unistd.h
  114. + getpage.c:: ++jrb
  115. +     NEW file. defines getpagesize() (for use with malloc.c etc)
  116. + mincl:: ++jrb
  117. +     add proto for above
  118. + == merge with mintlib 36
  119. + _addsubs.cpp: ++nox
  120. +     Correct an inverted branch.
  121. + utime.c: ++schwab
  122. +     utime(NULL) uses time() to convert the current time to Unix format
  123. +     and immediately converts it back to GEMDOS format. Instead it should
  124. +     use the GEMDOS format directly.
  125. +     stime() must be changed because Tset{date,time} can now return a
  126. +     real error number. This depends on Tset{date,time} returning -1 if
  127. +     args are bad, which is true for all TOS versions, i think.
  128. + falcon.h: ++Markus_Kilbinger@ac.maus.de
  129. +     Add two omitted backslashes to fix new trap definitions.
  130. + chmod.c: ++schwab@ls5.informatik.uni-dortmund.de
  131. +     chmod() unnecessarily calls stat() to check if the file is a
  132. +     directory; this information is already available through Fattrib().
  133. + nlist.c, nlist.h: ++shenson@nyx.cs.du.edu
  134. +     NEW files nlist.c, nlist.h.  A version of nlist() for mntlib/toslib.
  135. +     Works OK with my binary config program but your milage may vary.
  136. + wcmb.c, stdlib.h: ++pvt1-117@nada.kth.se
  137. +     NEW file wcmb.c for ANSI wide char functions.
  138. + ctype.h: ++dsb@cs.duke.edu
  139. +     The toint() macro in ctype.h was translating hex digits wrong.
  140. + == end merge
  141. + mincl:: ++jrb
  142. +     add tagets for nlist and wcmb
  143. + == merge with mntlib 37
  144. + bzero.cpp, mincl: ++entropy
  145. +     Break bzero and memset into separate .o's (reduce drag).
  146. + string.h, strcmp.c: ++pvt1-117
  147. +     Allow use of builtin string functions.
  148. + file.h: ++entropy
  149. +     Add FREAD and FWRITE macros for TIOCFLUSH flushing modes (not yet
  150. +     implemented in MiNT).
  151. + unistd.h: ++entropy
  152. +     Add tcgetpgrp() and tcsetpgrp() protos.
  153. + ioctl.h: ++entropy
  154. +     Changes to account for definitions in common with termios.h,
  155. +     also add _RTSCTS flag definition.
  156. + termios.h: ++entropy
  157. +     NEW files, partially implementing the POSIX termios functions (in
  158. +     the MiNT library).
  159. + wait.h: ++entropy
  160. +     Add WSTOPSIG() macro (POSIX).
  161. + utime.c: ++entropy
  162. +     Add a kludge so that we pretend the utime() worked for directories.
  163. + stat.h: ++entropy
  164. +     Mode argument is now mode_t instead of unsigned (POSIX).
  165. + mkfifo.c, stat.h: ++entropy
  166. +     NEW file providing a fake mkfifo(), and a prototype for it.
  167. + resource.h: ++entropy
  168. +     Add BSD-compatible struct rusage members with 0 values for
  169. +     minimal compatibility.
  170. + errno.h: ++entropy
  171. +     Added EOPNOTSUPP as (temporary) alias for EINVAL.
  172. +     Added ECHILD as alias for ENOENT (POSIX).
  173. + doprnt.c, fprintf.c, printf.c, sprintf.c, 
  174. + vfprintf.c, vfprintf.c, lib.h: ++schwab
  175. +     Change the interface of _doprnt to also pass a putchar function
  176. +     similar to _scanf.  This allows use of sprintf in a program which
  177. +     doesn't use stdio and it simplifies the implementation of sprintf a
  178. +     bit.
  179. + lseek.c: ++schwab@ls5.informatik.uni-dortmund.de
  180. +     Make lseek() and tell() always return -1 on errors.  Make lseek()
  181. +     work better with unseekable devices.  Don't modify errno
  182. +     when no error has occurred.  General cleanup.
  183. + nlist.c: ++pvt1-117
  184. +     Add some typecasts to keep Lattice happy.
  185. + mintbind.h: ++pvt1-117@nada.kth.se
  186. +     Add some casts in the Lattice C inlines.
  187. + frexp.cpp: ++Cristof_Stadler@s2.maus.de
  188. +     Bug fix: add a missing @.
  189. + ctime.c, doprnt.c, findfile.c, getpass.c, 
  190. + localtim.c, strftime.c, strncat.c: ++pvt1-117@nada.kth.se
  191. +     Removed some dead assignments and increments.
  192. + stdlib.h: ++entropy
  193. +     Added NULL (POSIX).
  194. + == end merge
  195. + mincl:: ++jrb
  196. +     add new rules for bzero/memset
  197. +     new target for (dummy) mkfifo
  198. + == merge with mntlib 38
  199. + compiler.h: ++pvt1-117
  200. +     Make LCC do the right thing in limits.h.
  201. + termios.h: ++entropy
  202. +     Add VLNEXT and VWERASE control chars.
  203. + types.h: ++roemer@hera.rbi.informatik.uni-frankfurt.de.uni-frankfurt.de
  204. +     Add fd_set type and related macros.
  205. + falcon.h: ++Markus_Kilbinger@ac.maus.de
  206. +     Change return types of VsetMask() and Dsp_Reserve() from
  207. +     void to short.
  208. + _mulsi3.s, _umulsi3.s: ++schwab
  209. +     .lmul and .ulmul aren't equivalent.
  210. + wait.h: ++schwab@ls5.informatik.uni-dortmund.de
  211. +     Make the wait prototype indirection more robust.  Also fix the
  212. +     definition of WIFSIGNALED().
  213. + falcon.h: ++pvt1-117
  214. +     Inline traps for Lattice.
  215. + wcmb.c: ++pvt1-117
  216. +     Use _wnull from wnull.c instead of a local variable.
  217. + wcscat.c, wcscmp.c, wcscpy.c, wcslen.c, wnull.c: ++pvt1-117
  218. +     NEW files for ISO wide char support.
  219. + stdlib.h: ++pvt1-117@nada.kth.se
  220. +     Add prototypes for new ISO widechar functions.
  221. + == end merge
  222. + mincl:: ++jrb
  223. +     add targets for wcscat.o, wcscmp.o, wcscpy.o, wcslen.o, wnull.o
  224. + abort.c:: ++jrb
  225. +     rid of redundant fclose_all_files(), exit() should do all that.
  226. + limits.h:: ++jrb at suggestion of michal
  227. +     make groups limit 0 for non-MiNT
  228. + ---------------------------- Patchlevel 94 ---------------------------
  229. ===================================================================
  230. RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/Makefile,v
  231. retrieving revision 1.19
  232. diff -c -r1.19 Makefile
  233. *** 1.19    1993/07/13 17:07:24
  234. --- Makefile    1993/10/26 23:48:24
  235. ***************
  236. *** 41,49 ****
  237.   
  238.   endif
  239.   
  240.   # Additional options for compiling C code
  241.   
  242. ! XFLAGS := -I../co
  243.   
  244.   # Dynamic selection of options for each target library...
  245.   
  246. --- 41,52 ----
  247.   
  248.   endif
  249.   
  250. + # Flags for extra 'long long' support under newer gcc's
  251. + #LONGLONG=-DPRINTF_LONGLONG
  252.   # Additional options for compiling C code
  253.   
  254. ! XFLAGS := -I../co -Wall -Wmissing-prototypes -Wstrict-prototypes
  255.   
  256.   # Dynamic selection of options for each target library...
  257.   
  258. ***************
  259. *** 87,93 ****
  260.   CFFLAGS = $(SHORT) $(COPTS)
  261.   
  262.   # normal CFLAGS including int size and omit-frame-pointer
  263. ! CFLAGS= $(CFFLAGS) $(FRAME)
  264.   
  265.   # cflags for stuff that needs to be compiled with 32 bit ints
  266.   CLFLAGS= $(COPTS) $(FRAME) $(DSHORT)
  267. --- 90,96 ----
  268.   CFFLAGS = $(SHORT) $(COPTS)
  269.   
  270.   # normal CFLAGS including int size and omit-frame-pointer
  271. ! CFLAGS= $(CFFLAGS) $(FRAME) $(LONGLONG)
  272.   
  273.   # cflags for stuff that needs to be compiled with 32 bit ints
  274.   CLFLAGS= $(COPTS) $(FRAME) $(DSHORT)
  275. ===================================================================
  276. RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/PatchLev.h,v
  277. retrieving revision 1.69
  278. diff -c -r1.69 PatchLev.h
  279. *** 1.69    1993/07/13 17:07:26
  280. --- PatchLev.h    1993/10/26 23:48:28
  281. ***************
  282. *** 1,5 ****
  283.   
  284. ! #define    PatchLevel "93"
  285.   
  286.   /*
  287.    *
  288. --- 1,5 ----
  289.   
  290. ! #define    PatchLevel "94"
  291.   
  292.   /*
  293.    *
  294. ===================================================================
  295. RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/dirent.c,v
  296. retrieving revision 1.14
  297. diff -c -r1.14 dirent.c
  298. *** 1.14    1992/06/24 17:27:09
  299. --- dirent.c    1993/09/15 15:31:20
  300. ***************
  301. *** 95,101 ****
  302.       lent = ldir->s_dir;
  303.   
  304.       while (lent) {
  305. !         x = malloc((size_t)(DIRENTSIZ(strlen(lent->linkname))));
  306.           if (!x) {
  307.               errno = ENOMEM;
  308.               free(dd->D_path);
  309. --- 95,101 ----
  310.       lent = ldir->s_dir;
  311.   
  312.       while (lent) {
  313. !         x = malloc((size_t)(__DIRENTSIZ(strlen(lent->linkname))));
  314.           if (!x) {
  315.               errno = ENOMEM;
  316.               free(dd->D_path);
  317. ***************
  318. *** 155,161 ****
  319.           /* put the real file's info in the structure */
  320.                   goto tos_fill;
  321.               }
  322. !             x = malloc((size_t)(DIRENTSIZ(strlen(tmpnam))));
  323.                   if (!x) {
  324.                   errno = ENOMEM;
  325.                   while (d) {
  326. --- 155,161 ----
  327.           /* put the real file's info in the structure */
  328.                   goto tos_fill;
  329.               }
  330. !             x = malloc((size_t)(__DIRENTSIZ(strlen(tmpnam))));
  331.                   if (!x) {
  332.                   errno = ENOMEM;
  333.                   while (d) {
  334. ===================================================================
  335. RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/exec.c,v
  336. retrieving revision 1.3
  337. diff -c -r1.3 exec.c
  338. *** 1.3    1991/05/23 14:43:17
  339. --- exec.c    1993/10/26 23:48:31
  340. ***************
  341. *** 8,13 ****
  342. --- 8,14 ----
  343.    * the real work is done in spawnve.c.
  344.    */
  345.   
  346. + #include <compiler.h>
  347.   #include <osbind.h>
  348.   #include <basepage.h>
  349.   #include <process.h>
  350. ***************
  351. *** 19,25 ****
  352.   
  353.   int
  354.   execve(path, argv, envp)
  355. !     char *path, **argv, **envp;
  356.   {
  357.       int savex = _x_Bit_set_in_stat;
  358.   
  359. --- 20,28 ----
  360.   
  361.   int
  362.   execve(path, argv, envp)
  363. !     const char *path;
  364. !     char * const *argv;
  365. !     char * const *envp;
  366.   {
  367.       int savex = _x_Bit_set_in_stat;
  368.   
  369. ***************
  370. *** 41,55 ****
  371.   
  372.   int
  373.   execv(path, argv)
  374. !     char *path, **argv;
  375.   {
  376.       return execve(path, argv, (char **)0);
  377.   }
  378.   
  379.   int
  380.   execvp(name, argv)
  381. !     char *name;
  382. !     char **argv;
  383.   {
  384.       /* note: we cannot check x bit here as we dont know the full path.
  385.        * we flag spawnvp to do this by passing it -ve mode
  386. --- 44,59 ----
  387.   
  388.   int
  389.   execv(path, argv)
  390. !     const char *path;
  391. !     char * const *argv;
  392.   {
  393.       return execve(path, argv, (char **)0);
  394.   }
  395.   
  396.   int
  397.   execvp(name, argv)
  398. !     const char *name;
  399. !     char * const *argv;
  400.   {
  401.       /* note: we cannot check x bit here as we dont know the full path.
  402.        * we flag spawnvp to do this by passing it -ve mode
  403. ***************
  404. *** 58,64 ****
  405.   }
  406.   
  407.   #ifdef __STDC__
  408. ! int execl(char *path, ...)
  409.   #else
  410.   int execl(path)
  411.       char    *path;
  412. --- 62,68 ----
  413.   }
  414.   
  415.   #ifdef __STDC__
  416. ! int execl(const char *path, ...)
  417.   #else
  418.   int execl(path)
  419.       char    *path;
  420. ===================================================================
  421. RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/mincl,v
  422. retrieving revision 1.30
  423. diff -c -r1.30 mincl
  424. *** 1.30    1993/07/10 16:41:35
  425. --- mincl    1993/10/26 23:48:33
  426. ***************
  427. *** 25,31 ****
  428.       calloc.o clock.o ctime.o ctype.o difftime.o \
  429.       fopen.o fclose.o fdopen.o fflush.o fgetc.o fgets.o \
  430.       fputc.o fputs.o fread.o fwrite.o fseek.o fsetpos.o \
  431. !     fprintf.o eprintf.o sprintf.o \
  432.       fscanf.o scanf.o sscanf.o \
  433.       getenv.o putenv.o gets.o getw.o localtim.o \
  434.       malloc.o qsort.o raise.o rand.o realloc.o \
  435. --- 25,31 ----
  436.       calloc.o clock.o ctime.o ctype.o difftime.o \
  437.       fopen.o fclose.o fdopen.o fflush.o fgetc.o fgets.o \
  438.       fputc.o fputs.o fread.o fwrite.o fseek.o fsetpos.o \
  439. !     fprintf.o vfprintf.o printf.o vprintf.o eprintf.o sprintf.o \
  440.       fscanf.o scanf.o sscanf.o \
  441.       getenv.o putenv.o gets.o getw.o localtim.o \
  442.       malloc.o qsort.o raise.o rand.o realloc.o \
  443. ***************
  444. *** 33,46 ****
  445.       setlocal.o strftime.o strtol.o system.o \
  446.       tmpnam.o tmpfile.o \
  447.       ltoa.o main.o doprnt.o div.o \
  448. !     strtoul.o fungetc.o filbuf.o getbuf.o toxxx.o
  449.   
  450.   #
  451.   # other portable stuff
  452.   PORT =  a64l.o alphasor.o abs.o catch.o dirent.o findfile.o ftw.o getpw.o \
  453.       getlogin.o getopt.o getpass.o ident.o mktemp.o putpwent.o scandir.o strlwr.o \
  454.       strrev.o strupr.o regexp.o regsup.o textio.o random.o obstack.o \
  455. !     il.o ic.o iw.o ig.o ip.o frwbin.o ctermid.o cuserid.o ffs.o
  456.   #
  457.   # the string library
  458.   
  459. --- 33,47 ----
  460.       setlocal.o strftime.o strtol.o system.o \
  461.       tmpnam.o tmpfile.o \
  462.       ltoa.o main.o doprnt.o div.o \
  463. !     strtoul.o fungetc.o filbuf.o getbuf.o toxxx.o \
  464. !     wcmb.o wcscat.o wcscmp.o wcscpy.o wcslen.o wnull.o
  465.   
  466.   #
  467.   # other portable stuff
  468.   PORT =  a64l.o alphasor.o abs.o catch.o dirent.o findfile.o ftw.o getpw.o \
  469.       getlogin.o getopt.o getpass.o ident.o mktemp.o putpwent.o scandir.o strlwr.o \
  470.       strrev.o strupr.o regexp.o regsup.o textio.o random.o obstack.o \
  471. !     il.o ic.o iw.o ig.o ip.o frwbin.o ctermid.o cuserid.o ffs.o nlist.o
  472.   #
  473.   # the string library
  474.   
  475. ***************
  476. *** 53,60 ****
  477.   # stuff to fake unix system calls 
  478.   
  479.   UNIX=   access.o chdir.o chmod.o close.o console.o device.o dup.o exec.o fcntl.o \
  480. !     fhandle.o fork.o getcwd.o getpid.o getuid.o grp.o ioctl.o isatty.o \
  481. !     link.o lseek.o mkdir.o null.o open.o perror.o pgrp.o pipe.o popen.o psignal.o \
  482.       read.o rename.o rmdir.o \
  483.       sbrk.o sgtty.o signal.o siglist.o sleep.o spawnve.o spawnvp.o stat.o \
  484.       symdir.o symlink.o tchars.o time.o timeoday.o times.o \
  485. --- 54,61 ----
  486.   # stuff to fake unix system calls 
  487.   
  488.   UNIX=   access.o chdir.o chmod.o close.o console.o device.o dup.o exec.o fcntl.o \
  489. !     fhandle.o fork.o getcwd.o getpage.o getpid.o getuid.o grp.o ioctl.o isatty.o \
  490. !     link.o lseek.o mkdir.o mkfifo.o null.o open.o perror.o pgrp.o pipe.o popen.o psignal.o \
  491.       read.o rename.o rmdir.o \
  492.       sbrk.o sgtty.o signal.o siglist.o sleep.o spawnve.o spawnvp.o stat.o \
  493.       symdir.o symlink.o tchars.o time.o timeoday.o times.o \
  494. ***************
  495. *** 95,100 ****
  496. --- 96,107 ----
  497.   $(FCOMPS): %.o: _cmpsf2.cpp
  498.       $(CC) $(PPFLAGS) -DL$* -c $< -o $@
  499.   
  500. + bzero.o: %.o: bzero.cpp
  501. +     $(CC) $(PPFLAGS) -DL$* -c $< -o $@
  502. + memset.o: %.o: bzero.cpp
  503. +     $(CC) $(PPFLAGS) -DL$* -c $< -o $@
  504.   %.o : %.cpp
  505.       $(CC) $(PPFLAGS) -c $<
  506.   
  507. ===================================================================
  508. RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/spawnve.c,v
  509. retrieving revision 1.17
  510. diff -c -r1.17 spawnve.c
  511. *** 1.17    1992/10/09 20:32:44
  512. --- spawnve.c    1993/10/26 23:48:35
  513. ***************
  514. *** 40,49 ****
  515.   
  516.   int
  517.   spawnve(mode, _path, argv, envp)
  518. !     int    mode;
  519. !     char    *_path;
  520. !     char    **argv;
  521. !     char    **envp;
  522.   {
  523.       void        __exit(long);
  524.       static char    path[MAXPATHLEN];
  525. --- 40,49 ----
  526.   
  527.   int
  528.   spawnve(mode, _path, argv, envp)
  529. !     int        mode;
  530. !     const char    *_path;
  531. !     char * const    *argv;
  532. !     char * const    *envp;
  533.   {
  534.       void        __exit(long);
  535.       static char    path[MAXPATHLEN];
  536. ***************
  537. *** 169,187 ****
  538.   
  539.   int
  540.   spawnv(mode, path, argv)
  541. !     int mode;
  542. !     char *path;
  543. !     char **argv;
  544.   {
  545.       return spawnve(mode, path, argv, environ);
  546.   }
  547.   
  548.   #ifdef __STDC__
  549. ! int spawnle(int mode, char *path, ...)
  550.   #else
  551.   int spawnle(mode, path)
  552. !     int    mode;
  553. !     char    *path;
  554.   #endif
  555.   {
  556.       va_list args;
  557. --- 169,187 ----
  558.   
  559.   int
  560.   spawnv(mode, path, argv)
  561. !     int         mode;
  562. !     const char     *path;
  563. !     char * const    *argv;
  564.   {
  565.       return spawnve(mode, path, argv, environ);
  566.   }
  567.   
  568.   #ifdef __STDC__
  569. ! int spawnle(int mode, const char *path, ...)
  570.   #else
  571.   int spawnle(mode, path)
  572. !     int        mode;
  573. !     const char    *path;
  574.   #endif
  575.   {
  576.       va_list args;
  577. ***************
  578. *** 195,205 ****
  579.   }
  580.   
  581.   #ifdef __STDC__
  582. ! int spawnl(int mode, char *path, ...)
  583.   #else
  584.   int spawnl(mode, path)
  585. !     int    mode;
  586. !     char    *path;
  587.   #endif
  588.   {
  589.       va_list args;
  590. --- 195,205 ----
  591.   }
  592.   
  593.   #ifdef __STDC__
  594. ! int spawnl(int mode, const char *path, ...)
  595.   #else
  596.   int spawnl(mode, path)
  597. !     int        mode;
  598. !     const char    *path;
  599.   #endif
  600.   {
  601.       va_list args;
  602. ===================================================================
  603. RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/spawnvp.c,v
  604. retrieving revision 1.7
  605. diff -c -r1.7 spawnvp.c
  606. *** 1.7    1993/03/01 17:29:46
  607. --- spawnvp.c    1993/10/26 23:48:37
  608. ***************
  609. *** 22,29 ****
  610.   int
  611.   spawnvp(mode, name, argv)
  612.       int mode;
  613. !     char *name;
  614. !     char **argv;
  615.   {
  616.       char *execname;
  617.   
  618. --- 22,29 ----
  619.   int
  620.   spawnvp(mode, name, argv)
  621.       int mode;
  622. !     const char      *name;
  623. !     char * const    *argv;
  624.   {
  625.       char *execname;
  626.   
  627. ***************
  628. *** 55,65 ****
  629.   }
  630.   
  631.   #ifdef __STDC__
  632. ! int spawnlp(int mode, char *name, ...)
  633.   #else
  634.   int spawnlp(mode, name)
  635. !     int    mode;
  636. !     char    *name;
  637.   #endif
  638.   {
  639.       va_list args;
  640. --- 55,65 ----
  641.   }
  642.   
  643.   #ifdef __STDC__
  644. ! int spawnlp(int mode, const char *name, ...)
  645.   #else
  646.   int spawnlp(mode, name)
  647. !     int            mode;
  648. !     const char    *name;
  649.   #endif
  650.   {
  651.       va_list args;
  652. ===================================================================
  653. RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/symlink.c,v
  654. retrieving revision 1.9
  655. diff -c -r1.9 symlink.c
  656. *** 1.9    1992/06/24 17:27:09
  657. --- symlink.c    1993/10/26 23:48:39
  658. ***************
  659. *** 14,20 ****
  660.   
  661.   int
  662.   symlink(old, new)
  663. !     char *old, *new;
  664.   {
  665.       char linkpath[FILENAME_MAX];
  666.       char *name;
  667. --- 14,20 ----
  668.   
  669.   int
  670.   symlink(old, new)
  671. !     const char *old, *new;
  672.   {
  673.       char linkpath[FILENAME_MAX];
  674.       char *name;
  675. ===================================================================
  676. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_addsubs.cpp,v
  677. retrieving revision 1.8
  678. diff -c -r1.8 _addsubs.cpp
  679. *** 1.8    1993/06/04 15:22:08
  680. --- _addsubs.cpp    1993/10/26 23:52:08
  681. ***************
  682. *** 83,89 ****
  683.       bclr    d3,d1        | kill sign bit u.exp
  684.       bclr    d3,d0        | kill sign bit u.exp
  685.       btst    d3,d2        | same sign for u and v?
  686. !     bne    0f
  687.       cmpl    d0,d1        | different signs - maybe x - x ?
  688.       seq    d2        | set 'cancellation' flag
  689.   0:
  690. --- 83,89 ----
  691.       bclr    d3,d1        | kill sign bit u.exp
  692.       bclr    d3,d0        | kill sign bit u.exp
  693.       btst    d3,d2        | same sign for u and v?
  694. !     beq    0f
  695.       cmpl    d0,d1        | different signs - maybe x - x ?
  696.       seq    d2        | set 'cancellation' flag
  697.   0:
  698. ===================================================================
  699. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_mulsi3.s,v
  700. retrieving revision 1.2
  701. diff -c -r1.2 _mulsi3.s
  702. *** 1.2    1992/11/24 04:14:47
  703. --- _mulsi3.s    1993/10/26 23:52:10
  704. ***************
  705. *** 11,20 ****
  706.   
  707.       .text
  708.       .even
  709. !     .globl    __mulsi3, ___mulsi3, .lmul, .ulmul
  710.   
  711.   .lmul:
  712. - .ulmul:
  713.   __mulsi3:
  714.   ___mulsi3:
  715.       movel    d2,a0        | save registers
  716. --- 11,19 ----
  717.   
  718.       .text
  719.       .even
  720. !     .globl    __mulsi3, ___mulsi3, .lmul
  721.   
  722.   .lmul:
  723.   __mulsi3:
  724.   ___mulsi3:
  725.       movel    d2,a0        | save registers
  726. ===================================================================
  727. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_umulsi3.s,v
  728. retrieving revision 1.1
  729. diff -c -r1.1 _umulsi3.s
  730. *** 1.1    1990/03/26 17:37:22
  731. --- _umulsi3.s    1993/10/26 23:52:12
  732. ***************
  733. *** 11,18 ****
  734.   
  735.       .text
  736.       .even
  737. !     .globl    __umulsi3, ___umulsi3
  738.   
  739.   __umulsi3:
  740.   ___umulsi3:
  741.       movel    d2,a0        | save registers
  742. --- 11,19 ----
  743.   
  744.       .text
  745.       .even
  746. !     .globl    __umulsi3, ___umulsi3, .ulmul
  747.   
  748. + .ulmul:
  749.   __umulsi3:
  750.   ___umulsi3:
  751.       movel    d2,a0        | save registers
  752. ===================================================================
  753. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/abort.c,v
  754. retrieving revision 1.5
  755. diff -c -r1.5 abort.c
  756. *** 1.5    1992/06/01 01:54:10
  757. --- abort.c    1993/10/26 23:52:14
  758. ***************
  759. *** 3,8 ****
  760. --- 3,9 ----
  761.   #include <signal.h>
  762.   #include <stdlib.h>
  763.   #include <unistd.h>
  764. + #include "lib.h"
  765.   
  766.   #ifndef SIGABRT
  767.   #define SIGABRT SIGIOT
  768. ===================================================================
  769. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/atof.c,v
  770. retrieving revision 1.25
  771. diff -c -r1.25 atof.c
  772. *** 1.25    1993/03/01 17:34:19
  773. --- atof.c    1993/10/26 23:52:16
  774. ***************
  775. *** 241,247 ****
  776.   #define CONVF    0x08
  777.   
  778.   double strtod (s, endptr)
  779. ! const register char *s;
  780.   char **endptr;
  781.   {
  782.       double         accum = 0.0;
  783. --- 241,247 ----
  784.   #define CONVF    0x08
  785.   
  786.   double strtod (s, endptr)
  787. ! register const char *s;
  788.   char **endptr;
  789.   {
  790.       double         accum = 0.0;
  791. ===================================================================
  792. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/bsearch.c,v
  793. retrieving revision 1.9
  794. diff -c -r1.9 bsearch.c
  795. *** 1.9    1992/09/14 14:56:40
  796. --- bsearch.c    1993/10/26 23:52:17
  797. ***************
  798. *** 30,44 ****
  799.       while(a <= b)
  800.           {
  801.           c = (a + b) >> 1;    /* == ((a + b) / 2) */
  802. !         if ((dir = (*cmp)((void *)((char *)base + (c * size)), key)) != 0)
  803.               {
  804. !             if (dir > 0)
  805.               {
  806.                   if (c == 0)
  807.                   return(NULL);
  808.                   b = c - 1;
  809.               }
  810. !             else /* (dir < 0) */
  811.                   a = c + 1;
  812.               }
  813.           else
  814. --- 30,44 ----
  815.       while(a <= b)
  816.           {
  817.           c = (a + b) >> 1;    /* == ((a + b) / 2) */
  818. !         if ((dir = (*cmp)(key, (void *)((char *)base + (c * size)))) != 0)
  819.               {
  820. !             if (dir < 0)
  821.               {
  822.                   if (c == 0)
  823.                   return(NULL);
  824.                   b = c - 1;
  825.               }
  826. !             else /* (dir > 0) */
  827.                   a = c + 1;
  828.               }
  829.           else
  830. ===================================================================
  831. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/bzero.cpp,v
  832. retrieving revision 1.4
  833. diff -c -r1.4 bzero.cpp
  834. *** 1.4    1993/02/18 00:00:10
  835. --- bzero.cpp    1993/10/26 23:52:19
  836. ***************
  837. *** 6,13 ****
  838.   
  839.       .text
  840.       .even
  841. !     .globl _bzero
  842. !     .globl __bzero
  843.       .globl _memset
  844.   
  845.   |    void *memset( void *dest, int val, size_t len );
  846. --- 6,13 ----
  847.   
  848.       .text
  849.       .even
  850. ! #ifdef Lmemset
  851.       .globl _memset
  852.   
  853.   |    void *memset( void *dest, int val, size_t len );
  854. ***************
  855. *** 30,35 ****
  856. --- 30,40 ----
  857.   #endif
  858.       jeq    exit        | length==0? (size_t)
  859.       jra    do_set
  860. + #endif /* Lmemset */
  861. + #ifdef Lbzero
  862. +     .globl _bzero
  863. +     .globl __bzero
  864.   
  865.   |    void bzero( void *dest, size_t length );
  866.   |    void _bzero( void *dest, unsigned long length );
  867. ***************
  868. *** 50,55 ****
  869. --- 55,61 ----
  870.   scommon:
  871.       jeq    exit        | length==0? (size_t)
  872.       clrb    d0        | value
  873. + #endif /* Lbzero */
  874.   
  875.   do_set:             | a0 dest, d0.b byte, d1.l length
  876.       movel    d2,sp@-
  877. ===================================================================
  878. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/chmod.c,v
  879. retrieving revision 1.9
  880. diff -c -r1.9 chmod.c
  881. *** 1.9    1993/07/10 16:36:37
  882. --- chmod.c    1993/10/26 23:52:20
  883. ***************
  884. *** 19,25 ****
  885.   {
  886.          int  dosattrib = 0, r;
  887.          char path[PATH_MAX];
  888. -        struct stat stb;
  889.   
  890.          (void)_unx2dos(_path, path);
  891.   
  892. --- 19,24 ----
  893. ***************
  894. *** 33,42 ****
  895.       }
  896.   
  897.   /* The following lines ensure that the archive bit isn't cleared */
  898. !     r = Fattrib(path, 0, dosattrib);
  899. !      if (r > 0 && (r & FA_CHANGED))
  900.           dosattrib |= FA_CHANGED;
  901.   
  902.   #if 0
  903.          if (!(mode & S_IREAD))
  904.                  dosattrib |= FA_HIDDEN;
  905. --- 32,48 ----
  906.       }
  907.   
  908.   /* The following lines ensure that the archive bit isn't cleared */
  909. !     r = Fattrib(path, 0, 0);
  910. !     if (r < 0)
  911. !       {
  912. !         errno = -r;
  913. !         return -1;
  914. !       }
  915. !      if (r & FA_CHANGED)
  916.           dosattrib |= FA_CHANGED;
  917.   
  918. +     if (r & FA_DIR)
  919. +       dosattrib |= FA_DIR;
  920.   #if 0
  921.          if (!(mode & S_IREAD))
  922.                  dosattrib |= FA_HIDDEN;
  923. ***************
  924. *** 46,55 ****
  925.          r = Fattrib(path, 1, dosattrib);
  926.          if (r < 0) {
  927.   /* GEMDOS doesn't allow chmod on a directory, so pretend it worked */
  928. !                if (!stat(_path, &stb)) {
  929. !                 if ( (stb.st_mode & S_IFMT) == S_IFDIR )
  930. !             return 0;
  931. !                }
  932.                  errno = -r;
  933.                  return -1;
  934.          }
  935. --- 52,59 ----
  936.          r = Fattrib(path, 1, dosattrib);
  937.          if (r < 0) {
  938.   /* GEMDOS doesn't allow chmod on a directory, so pretend it worked */
  939. !         if (dosattrib & FA_DIR)
  940. !           return 0;
  941.                  errno = -r;
  942.                  return -1;
  943.          }
  944. ===================================================================
  945. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/ctime.c,v
  946. retrieving revision 1.10
  947. diff -c -r1.10 ctime.c
  948. *** 1.10    1993/03/01 17:34:21
  949. --- ctime.c    1993/10/26 23:52:22
  950. ***************
  951. *** 91,97 ****
  952.   #ifdef __GNUC__
  953.           _TWODIG(ptr, *valp);
  954.   #else
  955. !         ptr = two_dig(ptr, *valp);
  956.   #endif /* __GNUC__ */
  957.           if ('0' == timebuf[8])
  958.           timebuf[8] = ' ';    /* blank out leading zero on a day */
  959. --- 91,97 ----
  960.   #ifdef __GNUC__
  961.           _TWODIG(ptr, *valp);
  962.   #else
  963. !         two_dig(ptr, *valp);
  964.   #endif /* __GNUC__ */
  965.           if ('0' == timebuf[8])
  966.           timebuf[8] = ' ';    /* blank out leading zero on a day */
  967. ===================================================================
  968. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/div.c,v
  969. retrieving revision 1.4
  970. diff -c -r1.4 div.c
  971. *** 1.4    1992/04/06 19:33:32
  972. --- div.c    1993/10/26 23:52:23
  973. ***************
  974. *** 6,11 ****
  975. --- 6,13 ----
  976.    */
  977.   #include <stdlib.h>
  978.   
  979. + #ifdef __GNUC__
  980.   long __divsi3(long, long);    /* returns: quot in d0.l  remainder in d1.l */
  981.   
  982.   #ifdef __MSHORT__
  983. ***************
  984. *** 44,46 ****
  985. --- 46,76 ----
  986.           ); /* compiler dependency, dont tell gcc about d0,d1 clobb */
  987.       return result;
  988.   }
  989. + #else /* !__GNUC__ */
  990. + div_t
  991. + div(num, denom)
  992. + int num, denom;
  993. + {
  994. +     div_t res;
  995. +     
  996. +     res.quot = num / denom;
  997. +     res.rem = num % denom;
  998. +     
  999. +     return res;
  1000. + }
  1001. + ldiv_t
  1002. + ldiv(num, denom)
  1003. + long num, denom;
  1004. + {
  1005. +     ldiv_t res;
  1006. +     
  1007. +     res.quot = num / denom;
  1008. +     res.rem = num % denom;
  1009. +     
  1010. +     return res;
  1011. + }
  1012. + #endif /* !__GNUC__ */
  1013. ===================================================================
  1014. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/doprnt.c,v
  1015. retrieving revision 1.24
  1016. diff -c -r1.24 doprnt.c
  1017. *** 1.24    1993/07/10 16:36:38
  1018. --- doprnt.c    1993/10/26 23:52:25
  1019. ***************
  1020. *** 59,65 ****
  1021.   #include <ctype.h>
  1022.   #include <string.h>
  1023.   #include <limits.h>
  1024. ! #include    <math.h>    /* mjr++    */
  1025.   
  1026.   #ifndef __GNUC__    /* gcc lib has these typedefs in sys/types.h */
  1027.   #ifndef __MINT__    /* as does the MiNT library */
  1028. --- 59,66 ----
  1029.   #include <ctype.h>
  1030.   #include <string.h>
  1031.   #include <limits.h>
  1032. ! #include <math.h>    /* mjr++ */
  1033. ! #include "lib.h"
  1034.   
  1035.   #ifndef __GNUC__    /* gcc lib has these typedefs in sys/types.h */
  1036.   #ifndef __MINT__    /* as does the MiNT library */
  1037. ***************
  1038. *** 77,91 ****
  1039.   
  1040.   #if defined (__M68881__) && !defined (sfp004)
  1041.   #  include <math-68881.h>    /* mjr: use the inline functions    */
  1042. ! #endif    __M68881__
  1043.   
  1044.   #define    DEFPREC        6
  1045.   
  1046.   #define    BUF        (MAXEXP+MAXFRACT+1)    /* + decimal point */
  1047.   
  1048. ! #define    PUTC(ch)     if( fputc(ch, fp) == EOF ) return EOF;
  1049.   
  1050.   #define ARG(signtag) \
  1051.       _ulong = \
  1052.           flags&LONGINT ? \
  1053. --- 78,107 ----
  1054.   
  1055.   #if defined (__M68881__) && !defined (sfp004)
  1056.   #  include <math-68881.h>    /* mjr: use the inline functions    */
  1057. ! #endif    /* __M68881__ */
  1058.   
  1059.   #define    DEFPREC        6
  1060.   
  1061.   #define    BUF        (MAXEXP+MAXFRACT+1)    /* + decimal point */
  1062.   
  1063. ! #define    PUTC(ch)     if( (*putfunc)(ch, fp) == EOF ) return EOF;
  1064.   
  1065. ! #ifdef PRINTF_LONGLONG
  1066. ! #define ARG(signtag) (\
  1067. !     (flags&LONGLONG ? \
  1068. !     (_ulonglong = (unsigned long long)va_arg(argp, signtag long long)) : 0 ) ,\
  1069. !     _ulong = \
  1070. !         flags&LONGLONG ? \
  1071. !             _ulonglong != 0ll : \
  1072. !         flags&LONGINT ? \
  1073. !             (unsigned long long)va_arg(argp, signtag long) : \
  1074. !         (flags&SHORTINT ? \
  1075. !             (unsigned long long)(signtag short)va_arg(argp, signtag int) : \
  1076. !              (unsigned long long)va_arg(argp, signtag int)) )
  1077. !      /* shorts are always promoted to ints; thus, it's `va_arg(... int)'
  1078. !       * for `flags&SHORTINT'!
  1079. !       */
  1080. ! #else
  1081.   #define ARG(signtag) \
  1082.       _ulong = \
  1083.           flags&LONGINT ? \
  1084. ***************
  1085. *** 96,101 ****
  1086. --- 112,118 ----
  1087.        /* shorts are always promoted to ints; thus, it's `va_arg(... int)'
  1088.         * for `flags&SHORTINT'!
  1089.         */
  1090. + #endif
  1091.   
  1092.   #define TEN_MUL(X)    ((((X) << 2) + (X)) << 1)
  1093.   
  1094. ***************
  1095. *** 103,114 ****
  1096.   #define    tochar(n)    ((n) + '0')
  1097.   
  1098.   #define    LONGINT        0x01        /* long integer */
  1099. ! #define    LONGDBL        0x02        /* long double; unimplemented */
  1100. ! #define    SHORTINT    0x04        /* short integer */
  1101. ! #define    ALT        0x08        /* alternate form */
  1102. ! #define    LADJUST        0x10        /* left adjustment */
  1103. ! #define    ZEROPAD        0x20        /* zero (as opposed to blank) pad */
  1104. ! #define    HEXPREFIX    0x40        /* add 0x or 0X prefix */
  1105.   
  1106.   #ifndef __NO_FLOAT__
  1107.   #define __FLOATS__ 1
  1108. --- 120,132 ----
  1109.   #define    tochar(n)    ((n) + '0')
  1110.   
  1111.   #define    LONGINT        0x01        /* long integer */
  1112. ! #define    LONGLONG    0x02        /* long long integer (8 bytes) */
  1113. ! #define    LONGDBL        0x04        /* long double; unimplemented */
  1114. ! #define    SHORTINT    0x08        /* short integer */
  1115. ! #define    ALT        0x10        /* alternate form */
  1116. ! #define    LADJUST        0x20        /* left adjustment */
  1117. ! #define    ZEROPAD        0x40        /* zero (as opposed to blank) pad */
  1118. ! #define    HEXPREFIX    0x80        /* add 0x or 0X prefix */
  1119.   
  1120.   #ifndef __NO_FLOAT__
  1121.   #define __FLOATS__ 1
  1122. ***************
  1123. *** 197,205 ****
  1124.   
  1125.   #endif /* __GNUC__ */
  1126.   
  1127.   
  1128. ! int _doprnt(fp, fmt0, argp)
  1129. !     register FILE *fp;
  1130.       const char *fmt0;
  1131.       va_list argp;
  1132.   {
  1133. --- 215,231 ----
  1134.   
  1135.   #endif /* __GNUC__ */
  1136.   
  1137. + #ifdef PRINTF_LONGLONG
  1138. + #define _ICONVLL(NUMBER, BASE, BUF)                 \
  1139. +   do {                                \
  1140. +     *--(BUF) = digs[(NUMBER) % (BASE)];                \
  1141. +     (NUMBER) /= (BASE);                        \
  1142. +   } while (NUMBER);
  1143. + #endif
  1144.   
  1145. ! int _doprnt(putfunc, fp, fmt0, argp)
  1146. !     int (*putfunc) __PROTO ((int, FILE *));
  1147. !     FILE *fp;
  1148.       const char *fmt0;
  1149.       va_list argp;
  1150.   {
  1151. ***************
  1152. *** 212,219 ****
  1153.   /*    double _double;        *//* double precision arguments %[eEfgG] */
  1154.       union double_di _dd;    /* _double is #defined to be _dd later on */
  1155.       char softsign;        /* temporary negative sign for floats */
  1156. ! #endif    __FLOATS__
  1157. !     u_long _ulong;        /* integer arguments %[diouxX] */
  1158.       short base;        /* base for [diouxX] conversion */
  1159.       short dprec;        /* decimal precision in [diouxX] */
  1160.       short fieldsz;        /* field size expanded by sign, etc */
  1161. --- 238,252 ----
  1162.   /*    double _double;        *//* double precision arguments %[eEfgG] */
  1163.       union double_di _dd;    /* _double is #defined to be _dd later on */
  1164.       char softsign;        /* temporary negative sign for floats */
  1165. ! #endif    /* __FLOATS__ */
  1166. ! #ifdef PRINTF_LONGLONG
  1167. !     typedef unsigned long long _ulonglongtype;
  1168. !     typedef long long _ulonglongsignedtype;
  1169. !     _ulonglongtype _ulonglong;
  1170. ! #endif
  1171. !     typedef u_long _ulongtype;
  1172. !     typedef long _ulongsignedtype;
  1173. !     _ulongtype _ulong;        /* integer arguments %[diouxX] */
  1174.       short base;        /* base for [diouxX] conversion */
  1175.       short dprec;        /* decimal precision in [diouxX] */
  1176.       short fieldsz;        /* field size expanded by sign, etc */
  1177. ***************
  1178. *** 227,233 ****
  1179.       char *digs;        /* digits for [diouxX] conversion */
  1180.       char buf[BUF];        /* space for %c, %[diouxX], %[eEfgG] */
  1181.   
  1182. -         t = buf;
  1183.       fmt = (const u_char *) fmt0;
  1184.       digs = "0123456789abcdef";
  1185.       for (cnt = 0;; ++fmt) {
  1186. --- 260,265 ----
  1187. ***************
  1188. *** 307,313 ****
  1189.               flags |= SHORTINT;
  1190.               goto rflag;
  1191.           case 'l':
  1192. !             flags |= LONGINT;
  1193.               goto rflag;
  1194.           case 'c':
  1195.               *(t = buf) = va_arg(argp, int);
  1196. --- 339,350 ----
  1197.               flags |= SHORTINT;
  1198.               goto rflag;
  1199.           case 'l':
  1200. ! #ifdef PRINTF_LONGLONG
  1201. !             if (flags & (LONGINT|LONGLONG))
  1202. !                 flags &= -1-LONGINT, flags |= LONGLONG;
  1203. !             else
  1204. ! #endif
  1205. !                 flags |= LONGINT;
  1206.               goto rflag;
  1207.           case 'c':
  1208.               *(t = buf) = va_arg(argp, int);
  1209. ***************
  1210. *** 315,329 ****
  1211.               sign = '\0';
  1212.               goto pforw;
  1213.           case 'D':
  1214. !             flags |= LONGINT;
  1215.               /*FALLTHROUGH*/
  1216.           case 'd':
  1217.           case 'i':
  1218.               ARG(signed);
  1219. !             if ((long)_ulong < 0) {
  1220. !                 _ulong = -_ulong;
  1221. !                 sign = '-';
  1222.               }
  1223.               base = 10;
  1224.               goto number;
  1225.   #ifdef __FLOATS__
  1226. --- 352,380 ----
  1227.               sign = '\0';
  1228.               goto pforw;
  1229.           case 'D':
  1230. ! #ifdef PRINTF_LONGLONG
  1231. !             if (flags & (LONGINT|LONGLONG))
  1232. !                 flags &= -1-LONGINT, flags |= LONGLONG;
  1233. !             else
  1234. ! #endif
  1235. !                 flags |= LONGINT;
  1236.               /*FALLTHROUGH*/
  1237.           case 'd':
  1238.           case 'i':
  1239.               ARG(signed);
  1240. ! #ifdef PRINTF_LONGLONG
  1241. !             if (flags & LONGLONG) {
  1242. !                 if ((_ulonglongsignedtype)_ulonglong < 0ll) {
  1243. !                     _ulonglong = -_ulonglong;
  1244. !                     sign = '-';
  1245. !                 }
  1246.               }
  1247. +             else
  1248. + #endif
  1249. +                 if ((_ulongsignedtype)_ulong < 0) {
  1250. +                     _ulong = -(long)_ulong;
  1251. +                     sign = '-';
  1252. +                 }
  1253.               base = 10;
  1254.               goto number;
  1255.   #ifdef __FLOATS__
  1256. ***************
  1257. *** 411,416 ****
  1258. --- 462,472 ----
  1259.               goto pforw;
  1260.   #endif /* __FLOATS__ */
  1261.           case 'n':
  1262. + #ifdef PRINTF_LONGLONG
  1263. +             if (flags & LONGLONG)
  1264. +                 *va_arg(argp, long long *) = cnt;
  1265. +             else
  1266. + #endif
  1267.               if (flags & LONGINT)
  1268.                   *va_arg(argp, long *) = cnt;
  1269.               else if (flags & SHORTINT)
  1270. ***************
  1271. *** 419,425 ****
  1272.                   *va_arg(argp, int *) = cnt;
  1273.               break;
  1274.           case 'O':
  1275. !             flags |= LONGINT;
  1276.               /*FALLTHROUGH*/
  1277.           case 'o':
  1278.               ARG(unsigned);
  1279. --- 475,486 ----
  1280.                   *va_arg(argp, int *) = cnt;
  1281.               break;
  1282.           case 'O':
  1283. ! #ifdef PRINTF_LONGLONG
  1284. !             if (flags & (LONGINT|LONGLONG))
  1285. !                 flags &= -1-LONGINT, flags |= LONGLONG;
  1286. !             else
  1287. ! #endif
  1288. !                 flags |= LONGINT;
  1289.               /*FALLTHROUGH*/
  1290.           case 'o':
  1291.               ARG(unsigned);
  1292. ***************
  1293. *** 434,440 ****
  1294.                *    -- ANSI X3J11
  1295.                */
  1296.               /* NOSTRICT */
  1297. !             _ulong = (u_long)va_arg(argp, void *);
  1298.               base = 16;
  1299.               goto nosign;
  1300.           case 's':
  1301. --- 495,504 ----
  1302.                *    -- ANSI X3J11
  1303.                */
  1304.               /* NOSTRICT */
  1305. !             _ulong = (_ulongtype)va_arg(argp, void *);
  1306. ! #ifdef PRINTF_LONGLONG
  1307. !             flags &= -1-LONGLONG;
  1308. ! #endif
  1309.               base = 16;
  1310.               goto nosign;
  1311.           case 's':
  1312. ***************
  1313. *** 454,460 ****
  1314.   #endif
  1315.   
  1316.                   if ((p = (char *)memchr(t, 0, (size_t)prec)) != NULL) {
  1317. !                     size = p - t;
  1318.                       if (size > prec)
  1319.                           size = prec;
  1320.                   } else
  1321. --- 518,524 ----
  1322.   #endif
  1323.   
  1324.                   if ((p = (char *)memchr(t, 0, (size_t)prec)) != NULL) {
  1325. !                     size = (short)(p - t);
  1326.                       if (size > prec)
  1327.                           size = prec;
  1328.                   } else
  1329. ***************
  1330. *** 464,470 ****
  1331.               sign = '\0';
  1332.               goto pforw;
  1333.           case 'U':
  1334. !             flags |= LONGINT;
  1335.               /*FALLTHROUGH*/
  1336.           case 'u':
  1337.               ARG(unsigned);
  1338. --- 528,539 ----
  1339.               sign = '\0';
  1340.               goto pforw;
  1341.           case 'U':
  1342. ! #ifdef PRINTF_LONGLONG
  1343. !             if (flags & (LONGINT|LONGLONG))
  1344. !                 flags &= -1-LONGINT, flags |= LONGLONG;
  1345. !             else
  1346. ! #endif
  1347. !                 flags |= LONGINT;
  1348.               /*FALLTHROUGH*/
  1349.           case 'u':
  1350.               ARG(unsigned);
  1351. ***************
  1352. *** 477,482 ****
  1353. --- 546,553 ----
  1354.               ARG(unsigned);
  1355.               base = 16;
  1356.               /* leading 0x/X only if non-zero */
  1357. +             /* Note: this does also work with _ulonglong, as we set
  1358. +                _ulong = 0 iff _ulonglong==0  --bjarne */
  1359.               if (flags & ALT && _ulong != 0)
  1360.                   flags |= HEXPREFIX;
  1361.   
  1362. ***************
  1363. *** 496,508 ****
  1364.                *    -- ANSI X3J11
  1365.                */
  1366.               t = buf + BUF;
  1367.               if (_ulong != 0 || prec != 0) {
  1368. !                 _ICONV(_ulong, base, t);
  1369.                   digs = "0123456789abcdef";
  1370.                   if (flags & ALT && base == 8 && *t != '0')
  1371.                       *--t = '0'; /* octal leading 0 */
  1372.               }
  1373. !             size = buf + BUF - t;
  1374.   
  1375.   pforw:
  1376.               /*
  1377. --- 567,591 ----
  1378.                *    -- ANSI X3J11
  1379.                */
  1380.               t = buf + BUF;
  1381. +             /* Note: this does also work with _ulonglong, as we set
  1382. +                _ulong = 0 iff _ulonglong==0  --bjarne */
  1383.               if (_ulong != 0 || prec != 0) {
  1384. ! #ifdef PRINTF_LONGLONG
  1385. !                 if (flags & LONGLONG) {
  1386. !                     _ICONVLL(_ulonglong, base, t);
  1387. !                 }
  1388. !                 /* As _ICONVLL might be a macro, we better put it in braces */
  1389. !                 else
  1390. ! #endif
  1391. !                 {
  1392. !                     _ICONV(_ulong, base, t);
  1393. !                 }
  1394. !                 /* As _ICONV might be a macro, we better put it in braces */
  1395.                   digs = "0123456789abcdef";
  1396.                   if (flags & ALT && base == 8 && *t != '0')
  1397.                       *--t = '0'; /* octal leading 0 */
  1398.               }
  1399. !             size = (short)(buf + BUF - t);
  1400.   
  1401.   pforw:
  1402.               /*
  1403. ===================================================================
  1404. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/fdopen.c,v
  1405. retrieving revision 1.12
  1406. diff -c -r1.12 fdopen.c
  1407. *** 1.12    1992/08/14 14:48:29
  1408. --- fdopen.c    1993/10/26 23:52:27
  1409. ***************
  1410. *** 7,13 ****
  1411.   
  1412.   FILE *fdopen(h, mode)
  1413.       register int h;
  1414. !     const register char *mode;
  1415.   {
  1416.       extern int __default_mode__;    /* see defmode.c */
  1417.       register int i, iomode = 0, f = __default_mode__;
  1418. --- 7,13 ----
  1419.   
  1420.   FILE *fdopen(h, mode)
  1421.       register int h;
  1422. !     register const char *mode;
  1423.   {
  1424.       extern int __default_mode__;    /* see defmode.c */
  1425.       register int i, iomode = 0, f = __default_mode__;
  1426. ===================================================================
  1427. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/ffs.c,v
  1428. retrieving revision 1.2
  1429. diff -c -r1.2 ffs.c
  1430. *** 1.2    1993/07/13 17:03:40
  1431. --- ffs.c    1993/10/26 23:52:28
  1432. ***************
  1433. *** 1,8 ****
  1434.   /*
  1435. !   ffs.c - find first set bit
  1436. !   Carmine T. Guida
  1437. !   7 - 7 - 93 Public Domain
  1438. ! */
  1439.   
  1440.   #include <support.h>
  1441.   
  1442. --- 1,10 ----
  1443.   /*
  1444. !  *  ffs.c - find the lowest bit set
  1445. !  *  Returns a 2-exponent of position + 1 and 0 for 0
  1446. !  *  Michal Jaegermann, <ntomczak@vm.ucs.ualberta.ca>
  1447. !  *  10 July 1993
  1448. !  *  This piece of code is in a Public Domain
  1449. !  */
  1450.   
  1451.   #include <support.h>
  1452.   
  1453. ***************
  1454. *** 10,47 ****
  1455.   ffs(bits)
  1456.     int bits;
  1457.   {
  1458. !   register int i;
  1459.   
  1460. !   if (!bits)
  1461. !     return 0;
  1462.   
  1463. !   i = 1;
  1464.   #ifndef __MSHORT__
  1465. !   if (!(bits & 0x0000FFFF))    /* Check word */
  1466. !   {
  1467. !     bits >>= 16;
  1468. !     i += 16;
  1469. !   }
  1470. ! #endif
  1471. !   if (!(bits & 0x00FF))        /* Check byte */
  1472. !   {
  1473. !     bits >>= 8;
  1474. !     i += 8;
  1475. !   }
  1476. !   if (!(bits & 0x0F))        /* Check nybble */
  1477. !   {
  1478. !     bits >>= 4;
  1479. !     i += 4;
  1480. !   }
  1481. !   if (!(bits & 0x3))        /* Check 2 bits */
  1482. !   {
  1483. !     bits >>= 2;
  1484. !     i += 2;
  1485. !   }
  1486. !   if (!(bits & 0x1))        /* Check bit */
  1487. !     i += 1;
  1488. !   return i;
  1489.   }
  1490. --- 12,41 ----
  1491.   ffs(bits)
  1492.     int bits;
  1493.   {
  1494. !     register int count;
  1495.   
  1496. !     if (0 == bits)
  1497. !     return 0;
  1498.   
  1499. !     bits &= -bits;
  1500.   #ifndef __MSHORT__
  1501. !     count = (bits & 0x0000ffff ? 16 : 32);
  1502. !     if (bits & 0x00ff00ff)
  1503. !     count -= 8;
  1504. !     if (bits & 0x0f0f0f0f)
  1505. !     count -= 4;
  1506. !     if (bits & 0x33333333)
  1507. !     count -= 2;
  1508. !     if (bits & 0x55555555)
  1509. !     count -= 1;
  1510. ! #else
  1511. !     count = (bits & 0x00ff ? 8 : 16);
  1512. !     if (bits & 0x0f0f)
  1513. !     count -= 4;
  1514. !     if (bits & 0x3333)
  1515. !     count -= 2;
  1516. !     if (bits & 0x5555)
  1517. !     count -= 1;
  1518. ! #endif /* __MSHORT__ */
  1519. !     return count;
  1520.   }
  1521. ===================================================================
  1522. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/findfile.c,v
  1523. retrieving revision 1.13
  1524. diff -c -r1.13 findfile.c
  1525. *** 1.13    1993/07/13 17:03:43
  1526. --- findfile.c    1993/10/26 23:52:30
  1527. ***************
  1528. *** 27,39 ****
  1529.   #define DIRSEP1         '\\'    /* native OS directory separator */
  1530.   #define DIRSEP2         '/'     /* for emulating another OS */
  1531.   
  1532. ! static char *nullext[] = { NULL };
  1533.   
  1534. ! static int EXISTS __PROTO((char *));
  1535.   
  1536.   static int
  1537.   EXISTS(name)
  1538. !     char *name;
  1539.   {
  1540.       struct stat dummy;
  1541.   
  1542. --- 27,39 ----
  1543.   #define DIRSEP1         '\\'    /* native OS directory separator */
  1544.   #define DIRSEP2         '/'     /* for emulating another OS */
  1545.   
  1546. ! static char *const nullext[] = { NULL };
  1547.   
  1548. ! static int EXISTS __PROTO((const char *));
  1549.   
  1550.   static int
  1551.   EXISTS(name)
  1552. !     const char *name;
  1553.   {
  1554.       struct stat dummy;
  1555.   
  1556. ***************
  1557. *** 47,53 ****
  1558.   
  1559.   char *
  1560.   findfile(fname, fpath, fext)
  1561. !         char *fname, *fpath, **fext;
  1562.   {
  1563.         /* simply calls buffindfile */
  1564.         static char try[PATH_MAX];
  1565. --- 47,54 ----
  1566.   
  1567.   char *
  1568.   findfile(fname, fpath, fext)
  1569. !         const char *fname, *fpath;
  1570. !     char *const *fext;
  1571.   {
  1572.         /* simply calls buffindfile */
  1573.         static char try[PATH_MAX];
  1574. ***************
  1575. *** 57,65 ****
  1576.   
  1577.   char *
  1578.   buffindfile(fname, fpath, fext, try)
  1579. !       char *fname, *fpath, **fext, *try;
  1580.   {
  1581. !       char *s, *t, *extplace, **nextext, c;
  1582.         int  hasext = 0, haspath = 0;
  1583.   
  1584.       if (!fname || !*fname)
  1585. --- 58,68 ----
  1586.   
  1587.   char *
  1588.   buffindfile(fname, fpath, fext, try)
  1589. !       const char *fname, *fpath;
  1590. !       char *const *fext, *try;
  1591.   {
  1592. !       char *s, *extplace, *const *nextext, c;
  1593. !       const char *t;
  1594.         int  hasext = 0, haspath = 0;
  1595.   
  1596.       if (!fname || !*fname)
  1597. ***************
  1598. *** 82,88 ****
  1599.                 *s++ = c;
  1600.         }
  1601.         extplace = s;
  1602. !       *s++ = 0;
  1603.   
  1604.         if (haspath || !fpath)
  1605.                 fpath = "";
  1606. --- 85,91 ----
  1607.                 *s++ = c;
  1608.         }
  1609.         extplace = s;
  1610. !       *s = 0;
  1611.   
  1612.         if (haspath || !fpath)
  1613.                 fpath = "";
  1614. ===================================================================
  1615. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/fopen.c,v
  1616. retrieving revision 1.20
  1617. diff -c -r1.20 fopen.c
  1618. *** 1.20    1993/07/10 16:36:41
  1619. --- fopen.c    1993/10/26 23:52:31
  1620. ***************
  1621. *** 65,71 ****
  1622.       else
  1623.           iomode |= O_RDWR;
  1624.       iomode |= O_NOCTTY;
  1625. !     h = open(filename, iomode, 0644);
  1626.       if(h < __SMALLEST_VALID_HANDLE)
  1627.           {
  1628.           return(NULL);        /* file open/create error */
  1629. --- 65,71 ----
  1630.       else
  1631.           iomode |= O_RDWR;
  1632.       iomode |= O_NOCTTY;
  1633. !     h = open(filename, iomode, 0666);
  1634.       if(h < __SMALLEST_VALID_HANDLE)
  1635.           {
  1636.           return(NULL);        /* file open/create error */
  1637. ===================================================================
  1638. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/fprintf.c,v
  1639. retrieving revision 1.15
  1640. diff -c -r1.15 fprintf.c
  1641. *** 1.15    1992/06/01 01:54:10
  1642. --- fprintf.c    1993/10/26 23:52:33
  1643. ***************
  1644. *** 15,53 ****
  1645.       va_list args;
  1646.   
  1647.       va_start(args, fmt);
  1648. !     r = _doprnt(fp, fmt, args);
  1649.       va_end(args);
  1650.       return r;
  1651.   }
  1652. - int
  1653. - vfprintf(fp, fmt, args)
  1654. -     FILE *fp;
  1655. -     const char *fmt;
  1656. -     va_list args;
  1657. - {
  1658. -     return(_doprnt(fp, fmt, args));
  1659. - }
  1660. - #if __STDC__
  1661. - int printf(const char *fmt, ...)
  1662. - #else
  1663. - int printf(fmt) const char *fmt;
  1664. - #endif
  1665. - {
  1666. -     va_list args;
  1667. -     int r;
  1668. -     va_start(args, fmt);
  1669. -     r = _doprnt(stdout, fmt, args);
  1670. -     va_end(args);
  1671. -     return r;
  1672. - }
  1673. - int
  1674. - vprintf(fmt, args)
  1675. -     const char *fmt;
  1676. -     va_list args;
  1677. - {
  1678. -     return(_doprnt(stdout, fmt, args));
  1679. - }
  1680. --- 15,21 ----
  1681.       va_list args;
  1682.   
  1683.       va_start(args, fmt);
  1684. !     r = _doprnt(fputc, fp, fmt, args);
  1685.       va_end(args);
  1686.       return r;
  1687.   }
  1688. ===================================================================
  1689. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/fputs.c,v
  1690. retrieving revision 1.4
  1691. diff -c -r1.4 fputs.c
  1692. *** 1.4    1989/03/25 04:18:02
  1693. --- fputs.c    1993/10/26 23:52:34
  1694. ***************
  1695. *** 5,11 ****
  1696.   #include <assert.h>
  1697.   
  1698.   int fputs(data, fp)
  1699. !     const register char *data;
  1700.       register FILE *fp;
  1701.       {
  1702.       register int n = 0;
  1703. --- 5,11 ----
  1704.   #include <assert.h>
  1705.   
  1706.   int fputs(data, fp)
  1707. !     register const char *data;
  1708.       register FILE *fp;
  1709.       {
  1710.       register int n = 0;
  1711. ===================================================================
  1712. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/frexp.cpp,v
  1713. retrieving revision 1.8
  1714. diff -c -r1.8 frexp.cpp
  1715. *** 1.8    1993/07/13 17:03:44
  1716. --- frexp.cpp    1993/10/26 23:52:36
  1717. ***************
  1718. *** 63,69 ****
  1719.                   | sign of zero is correct
  1720.       subw    #BIAS8,d0    | remove bias
  1721.   #ifdef __MSHORT__
  1722. !     addw    d0,a0        | add current exponent in
  1723.   #else
  1724.       extl    d0
  1725.       addl    d0,a0@        | add current exponent in
  1726. --- 63,69 ----
  1727.                   | sign of zero is correct
  1728.       subw    #BIAS8,d0    | remove bias
  1729.   #ifdef __MSHORT__
  1730. !     addw    d0,a0@        | add current exponent in
  1731.   #else
  1732.       extl    d0
  1733.       addl    d0,a0@        | add current exponent in
  1734. ===================================================================
  1735. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/getpass.c,v
  1736. retrieving revision 1.4
  1737. diff -c -r1.4 getpass.c
  1738. *** 1.4    1993/02/22 06:15:12
  1739. --- getpass.c    1993/10/26 23:52:37
  1740. ***************
  1741. *** 14,20 ****
  1742.           char *ret;
  1743.       struct sgttyb oldsb, newsb;
  1744.       FILE *tty;
  1745. !     int ttyfd = 0;
  1746.   
  1747.       fflush(stdin);
  1748.       tty = stdin;
  1749. --- 14,20 ----
  1750.           char *ret;
  1751.       struct sgttyb oldsb, newsb;
  1752.       FILE *tty;
  1753. !     int ttyfd;
  1754.   
  1755.       fflush(stdin);
  1756.       tty = stdin;
  1757. ===================================================================
  1758. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/getpw.c,v
  1759. retrieving revision 1.13
  1760. diff -c -r1.13 getpw.c
  1761. *** 1.13    1993/07/10 16:36:45
  1762. --- getpw.c    1993/10/26 23:52:39
  1763. ***************
  1764. *** 205,210 ****
  1765. --- 205,211 ----
  1766.   #include <unistd.h>
  1767.   #include <string.h>
  1768.   #include <stdlib.h>
  1769. + #include <types.h>
  1770.   
  1771.   static char *pwdfile = "/etc/passwd"; /* default passwd file */
  1772.   
  1773. ***************
  1774. *** 289,296 ****
  1775.   } /* End of getpwent() */
  1776.   
  1777.   /* Get first passwd entry from file with pw_uid matching uid */
  1778.   struct passwd *getpwuid(uid)
  1779. ! int uid;
  1780.   {
  1781.     setpwent();
  1782.     while (nextent(fp) != 0)
  1783. --- 290,301 ----
  1784.   } /* End of getpwent() */
  1785.   
  1786.   /* Get first passwd entry from file with pw_uid matching uid */
  1787. + #ifdef __STDC__
  1788. + struct passwd *getpwuid(uid_t uid)
  1789. + #else
  1790.   struct passwd *getpwuid(uid)
  1791. ! uid_t uid;
  1792. ! #endif
  1793.   {
  1794.     setpwent();
  1795.     while (nextent(fp) != 0)
  1796. ===================================================================
  1797. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/gnulib2.c,v
  1798. retrieving revision 1.14
  1799. diff -c -r1.14 gnulib2.c
  1800. *** 1.14    1992/11/08 00:02:51
  1801. --- gnulib2.c    1993/09/15 16:12:53
  1802. ***************
  1803. *** 88,94 ****
  1804.   /* Define this if most significant word of a multiword number is numbered.  */
  1805.   /* For 68000 we can decide arbitrarily
  1806.      since there are no machine instructions for them.  */
  1807. ! /* #define WORDS_BIG_ENDIAN */
  1808.   
  1809.   /* number of bits in an addressible storage unit */
  1810.   #define BITS_PER_UNIT 8
  1811. --- 88,94 ----
  1812.   /* Define this if most significant word of a multiword number is numbered.  */
  1813.   /* For 68000 we can decide arbitrarily
  1814.      since there are no machine instructions for them.  */
  1815. ! #define WORDS_BIG_ENDIAN
  1816.   
  1817.   /* number of bits in an addressible storage unit */
  1818.   #define BITS_PER_UNIT 8
  1819. ===================================================================
  1820. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/lib.h,v
  1821. retrieving revision 1.10
  1822. diff -c -r1.10 lib.h
  1823. *** 1.10    1993/07/10 16:36:48
  1824. --- lib.h    1993/10/26 23:52:40
  1825. ***************
  1826. *** 43,61 ****
  1827.   __EXTERN char *        _ltoa __PROTO((long, char *, int));
  1828.   __EXTERN char *        _ultoa __PROTO((unsigned long, char *, int));
  1829.   
  1830. ! __EXTERN int        _doprnt __PROTO((FILE *, const char *, __VA_LIST__));
  1831.   
  1832.   #ifdef __MINT__
  1833. ! __EXTERN int    _scanf __PROTO((void *, int (*)(void *),
  1834. !             int (*)(int, void *), unsigned char *, __VA_LIST__));
  1835.   #endif
  1836.   
  1837.   __EXTERN long        get_sysvar __PROTO((void *var));
  1838.   __EXTERN void        set_sysvar_to_long __PROTO((void *var, long val));
  1839.   
  1840. ! __EXTERN void        _setstack __PROTO((char *));
  1841. ! __EXTERN __EXITING     __exit __PROTO((long status));
  1842.   
  1843.   /* from the TOS GCC library */
  1844.   /* 5/5/92 sb -- definitions needed in malloc.c and realloc.c */
  1845.   
  1846. --- 43,69 ----
  1847.   __EXTERN char *        _ltoa __PROTO((long, char *, int));
  1848.   __EXTERN char *        _ultoa __PROTO((unsigned long, char *, int));
  1849.   
  1850. ! __EXTERN int        _doprnt __PROTO((int (*)(int, FILE *), FILE *, const char *, __VA_LIST__));
  1851.   
  1852.   #ifdef __MINT__
  1853. ! __EXTERN int    _scanf __PROTO((FILE *, int (*)(FILE *),
  1854. !             int (*)(int, FILE *), const char *, __VA_LIST__));
  1855.   #endif
  1856.   
  1857.   __EXTERN long        get_sysvar __PROTO((void *var));
  1858.   __EXTERN void        set_sysvar_to_long __PROTO((void *var, long val));
  1859.   
  1860. ! __EXTERN void    _main        __PROTO((long, char **, char **));
  1861. ! __EXTERN void    _init_signal    __PROTO((void));
  1862. ! __EXTERN void     _monstartup    __PROTO((void *lowpc, void *highpc));
  1863. ! __EXTERN void    __mcleanup    __PROTO((void));
  1864. ! __EXTERN void    _moncontrol    __PROTO((long));
  1865. ! __EXTERN void    _setstack    __PROTO((char *));
  1866. ! __EXTERN void    _crtinit    __PROTO((void));
  1867. ! __EXTERN void    _acc_main    __PROTO((void));
  1868. ! __EXTERN __EXITING    __exit    __PROTO((long status));
  1869.   
  1870. + __EXTERN void    _fclose_all_files __PROTO((void));
  1871.   /* from the TOS GCC library */
  1872.   /* 5/5/92 sb -- definitions needed in malloc.c and realloc.c */
  1873.   
  1874. ===================================================================
  1875. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/localtim.c,v
  1876. retrieving revision 1.15
  1877. diff -c -r1.15 localtim.c
  1878. *** 1.15    1992/09/14 14:56:40
  1879. --- localtim.c    1993/10/26 23:52:42
  1880. ***************
  1881. *** 228,234 ****
  1882.           char *s;
  1883.           int  *hasdst;
  1884.   {
  1885. !         time_t off = 0;
  1886.           int x, sgn = 1;
  1887.       static char stdname[TZNAMLEN+1], dstname[TZNAMLEN+1];
  1888.       static char unknwn[4] = "???";
  1889. --- 228,234 ----
  1890.           char *s;
  1891.           int  *hasdst;
  1892.   {
  1893. !         time_t off;
  1894.           int x, sgn = 1;
  1895.       static char stdname[TZNAMLEN+1], dstname[TZNAMLEN+1];
  1896.       static char unknwn[4] = "???";
  1897. ***************
  1898. *** 245,251 ****
  1899.           while (*s && isalpha(*s)) {
  1900.           *n++ = *s++;        /* skip name */
  1901.       }
  1902. !     *n++ = 0;
  1903.   
  1904.   /* now figure out the offset */
  1905.   
  1906. --- 245,251 ----
  1907.           while (*s && isalpha(*s)) {
  1908.           *n++ = *s++;        /* skip name */
  1909.       }
  1910. !     *n = 0;
  1911.   
  1912.   /* now figure out the offset */
  1913.   
  1914. ***************
  1915. *** 274,280 ****
  1916.                   *hasdst = 1;
  1917.           while (*s && isalpha(*s)) *n++ = *s++;
  1918.       }
  1919. !     *n++ = 0;
  1920.   
  1921.       if (stdname[0])
  1922.           tzname[0] = stdname;
  1923. --- 274,280 ----
  1924.                   *hasdst = 1;
  1925.           while (*s && isalpha(*s)) *n++ = *s++;
  1926.       }
  1927. !     *n = 0;
  1928.   
  1929.       if (stdname[0])
  1930.           tzname[0] = stdname;
  1931. ===================================================================
  1932. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/lseek.c,v
  1933. retrieving revision 1.10
  1934. diff -c -r1.10 lseek.c
  1935. *** 1.10    1992/09/14 14:56:40
  1936. --- lseek.c    1993/10/26 23:52:45
  1937. ***************
  1938. *** 8,28 ****
  1939.   #include <unistd.h>
  1940.   #include "lib.h"
  1941.   
  1942. - static long _real_lseek __PROTO((int, long, int));
  1943. - static long _real_lseek(h, where, how)
  1944. - int h;
  1945. - long where;
  1946. - int how;
  1947. - {
  1948. -     register long rv;
  1949. -     
  1950. -     rv = Fseek(where, h, how);
  1951. -     if(rv < 0)
  1952. -     errno = ((int) -rv);
  1953. -     return(rv);
  1954. - }
  1955.   /*
  1956.    * emulate berzerkly lseek too
  1957.    */
  1958. --- 8,13 ----
  1959. ***************
  1960. *** 38,58 ****
  1961.       
  1962.       if ( (mode == SEEK_END) || (offset <= 0) )
  1963.       /* do it the usual way */
  1964. !     return(_real_lseek(handle, offset, mode));
  1965.       
  1966. !     current_pos = _real_lseek(handle, 0L, SEEK_CUR); /* find out where we are */
  1967.       if (mode == SEEK_SET)
  1968.       expected_pos = offset;
  1969.       else
  1970.       expected_pos = offset + current_pos;
  1971. !     new_pos = _real_lseek(handle, offset, mode);
  1972.       if (new_pos == expected_pos)
  1973.       return(new_pos);
  1974.       
  1975.       /* otherwise extend file -- zero filling the hole */
  1976.       if (new_pos < 0)        /* error? */
  1977.       {
  1978. !     new_pos = _real_lseek(handle, 0L, SEEK_END);    /* go to eof */
  1979.       }    
  1980.       
  1981.       bzero(buf, (size_t)256);
  1982. --- 23,58 ----
  1983.       
  1984.       if ( (mode == SEEK_END) || (offset <= 0) )
  1985.       /* do it the usual way */
  1986. !       {
  1987. !     current_pos = Fseek (offset, handle, mode);
  1988. !     if (current_pos < 0)
  1989. !       {
  1990. !         errno = (int) -current_pos;
  1991. !         return -1L;
  1992. !       }
  1993. !     return current_pos;
  1994. !       }
  1995.       
  1996. !     current_pos = Fseek (0L, handle, SEEK_CUR); /* find out where we are */
  1997. !     if (current_pos < 0)
  1998. !       {
  1999. !     /* a real error, e.g. an unseekable device */
  2000. !     errno = (int) -current_pos;
  2001. !     return -1L;
  2002. !       }
  2003.       if (mode == SEEK_SET)
  2004.       expected_pos = offset;
  2005.       else
  2006.       expected_pos = offset + current_pos;
  2007. !     new_pos = Fseek (offset, handle, mode);
  2008.       if (new_pos == expected_pos)
  2009.       return(new_pos);
  2010.       
  2011.       /* otherwise extend file -- zero filling the hole */
  2012.       if (new_pos < 0)        /* error? */
  2013.       {
  2014. !     new_pos = Fseek (0L, handle, SEEK_END);    /* go to eof */
  2015.       }    
  2016.       
  2017.       bzero(buf, (size_t)256);
  2018. ***************
  2019. *** 63,69 ****
  2020.           offset = 256;
  2021.       if((current_pos = _write(handle, buf, offset)) != offset)
  2022.           return((current_pos > 0) ? (new_pos + current_pos) :
  2023. !            new_pos);    /* errno set by write */
  2024.       new_pos += offset;
  2025.       }
  2026.       return(new_pos);  
  2027. --- 63,69 ----
  2028.           offset = 256;
  2029.       if((current_pos = _write(handle, buf, offset)) != offset)
  2030.           return((current_pos > 0) ? (new_pos + current_pos) :
  2031. !            -1L);    /* errno set by write */
  2032.       new_pos += offset;
  2033.       }
  2034.       return(new_pos);  
  2035. ***************
  2036. *** 72,76 ****
  2037.   long tell(h)
  2038.   int h;
  2039.   {
  2040. !     return(_real_lseek(h, 0L, SEEK_CUR));
  2041.   }
  2042. --- 72,84 ----
  2043.   long tell(h)
  2044.   int h;
  2045.   {
  2046. !     register long rv;
  2047. !     
  2048. !     rv = Fseek(0L, h, SEEK_CUR);
  2049. !     if(rv < 0)
  2050. !       {
  2051. !     errno = ((int) -rv);
  2052. !     return -1L;
  2053. !       }
  2054. !     return(rv);
  2055.   }
  2056. ===================================================================
  2057. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/malloc.c,v
  2058. retrieving revision 1.23
  2059. diff -c -r1.23 malloc.c
  2060. *** 1.23    1992/10/09 20:35:29
  2061. --- malloc.c    1993/10/26 23:52:46
  2062. ***************
  2063. *** 70,75 ****
  2064. --- 70,82 ----
  2065.           if (MINHUNK < MAXHUNK)
  2066.               MINHUNK *= 2;
  2067.       }
  2068. +     if (_split_mem || _heapbase == NULL)
  2069. +       {
  2070. +         static int page_size = 0;
  2071. +         if (!page_size)
  2072. +           page_size = getpagesize ();
  2073. +         sz = (sz + page_size - 1) & -page_size;
  2074. +       }
  2075.       q = (struct mem_chunk * )_sbrk(sz);
  2076.   
  2077.       if (((long)q) == -1)         /* can't alloc any more? */
  2078. ===================================================================
  2079. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/mktemp.c,v
  2080. retrieving revision 1.13
  2081. diff -c -r1.13 mktemp.c
  2082. *** 1.13    1992/06/01 01:54:10
  2083. --- mktemp.c    1993/10/26 23:52:48
  2084. ***************
  2085. *** 27,36 ****
  2086.   
  2087.     /* scan back over X's */
  2088.     for(p = pattern; *p; p++) ;
  2089. !   for(q = --p; *q == 'X'; --q) ;
  2090.     if((nx = p - q) == 0)  /* # of X's */
  2091.       return NULL;
  2092. -   q++;
  2093.   
  2094.     /* if MiNT is active and there's room, put in the pid */
  2095.     /* we need 5 X's for this: up to 3 for the pid, and up to 2 for the
  2096. --- 27,35 ----
  2097.   
  2098.     /* scan back over X's */
  2099.     for(p = pattern; *p; p++) ;
  2100. !   for(q = p; q[-1] == 'X'; --q) ;
  2101.     if((nx = p - q) == 0)  /* # of X's */
  2102.       return NULL;
  2103.   
  2104.     /* if MiNT is active and there's room, put in the pid */
  2105.     /* we need 5 X's for this: up to 3 for the pid, and up to 2 for the
  2106. ***************
  2107. *** 38,44 ****
  2108. --- 37,47 ----
  2109.     if (__mint && nx > 4 && startat < 256) {
  2110.       (void) _itoa(getpid(), q, 10);
  2111.       while (*q) q++;
  2112. +     /* be sure to generate each name only once */
  2113. +     if (startat < 16) *q++ = '0';
  2114.       (void) _itoa(startat++, q, 16);
  2115. +     while (*q) q++;
  2116. +     while (q < p) *q++ = '0'; /* fill with zeros */
  2117.       return pattern;
  2118.     }
  2119.   
  2120. ===================================================================
  2121. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/pgrp.c,v
  2122. retrieving revision 1.2
  2123. diff -c -r1.2 pgrp.c
  2124. *** 1.2    1993/07/10 16:36:50
  2125. --- pgrp.c    1993/10/26 23:52:51
  2126. ***************
  2127. *** 45,51 ****
  2128.   _bsd_getpgrp(pid)
  2129.     int pid;
  2130.   {
  2131. !   if (__mint >= 103) return _bsd_setpgrp(pid, -1);
  2132.     return 0;
  2133.   }
  2134.   
  2135. --- 45,51 ----
  2136.   _bsd_getpgrp(pid)
  2137.     int pid;
  2138.   {
  2139. !   if (__mint >= 0x103) return _bsd_setpgrp(pid, -1);
  2140.     return 0;
  2141.   }
  2142.   
  2143. ===================================================================
  2144. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/putenv.c,v
  2145. retrieving revision 1.3
  2146. diff -c -r1.3 putenv.c
  2147. *** 1.3    1993/07/10 16:36:53
  2148. --- putenv.c    1993/10/26 23:52:54
  2149. ***************
  2150. *** 7,12 ****
  2151. --- 7,13 ----
  2152.   #ifndef _COMPILER_H
  2153.   #include <compiler.h>
  2154.   #endif
  2155. + #include <support.h>
  2156.   
  2157.   extern char ** environ;
  2158.   
  2159. ===================================================================
  2160. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/qsort.c,v
  2161. retrieving revision 1.14
  2162. diff -c -r1.14 qsort.c
  2163. *** 1.14    1992/09/14 14:56:40
  2164. --- qsort.c    1993/10/26 23:52:55
  2165. ***************
  2166. *** 21,38 ****
  2167.   #include <string.h>
  2168.   #include <memory.h>
  2169.   
  2170.   #ifdef __GNUC__
  2171.   #  ifdef minix
  2172.        void *alloca(unsigned long);
  2173.        typedef unsigned long size_t;
  2174.   #  endif
  2175. ! #  define INLINE inline
  2176.   #else
  2177.   #  define INLINE /* */
  2178.   #endif
  2179. - #ifndef _COMPILER_H
  2180. - #include <compiler.h>
  2181. - #endif
  2182.   
  2183.   /* macros for incrementing/decrementing void pointers */
  2184.   #define INC(v, size) v = (void *)(((char *)v) + size)
  2185. --- 21,43 ----
  2186.   #include <string.h>
  2187.   #include <memory.h>
  2188.   
  2189. + #ifndef _COMPILER_H
  2190. + #include <compiler.h>
  2191. + #endif
  2192.   #ifdef __GNUC__
  2193.   #  ifdef minix
  2194.        void *alloca(unsigned long);
  2195.        typedef unsigned long size_t;
  2196.   #  endif
  2197. ! #  ifdef __GNUC_INLINE__
  2198. ! #    define INLINE    inline
  2199. ! #  else
  2200. ! #    define INLINE    /* */
  2201. ! #  endif
  2202.   #else
  2203.   #  define INLINE /* */
  2204.   #endif
  2205.   
  2206.   /* macros for incrementing/decrementing void pointers */
  2207.   #define INC(v, size) v = (void *)(((char *)v) + size)
  2208. ===================================================================
  2209. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/setjmp.cpp,v
  2210. retrieving revision 1.6
  2211. diff -c -r1.6 setjmp.cpp
  2212. *** 1.6    1993/07/10 16:37:02
  2213. --- setjmp.cpp    1993/10/26 23:52:57
  2214. ***************
  2215. *** 18,48 ****
  2216.   _sigsetjmp:
  2217.       movel    sp@(4), a0        | address of sigjmp_buf[]
  2218.   #ifdef __MSHORT__
  2219. !     movew    sp@(8), d0
  2220. !     extl    d0
  2221.   #else
  2222. !     movel    sp@(8), d0
  2223.   #endif
  2224. !     movel    d0, a0@(56)        | save sigmask for siglongjmp?
  2225.       beq    SETJMP            | no -- call common code
  2226. !     movel    Sigmask, a0@(52)    | save tos emulation signal mask
  2227.   #ifdef __MSHORT__
  2228.       tstw    Mint            | see if MiNT is active
  2229.   #else
  2230.       tstl    Mint
  2231.   #endif
  2232. !     beq    SETJMP            | no -- call common code
  2233. !     movel    #0, sp@-        | add no signals to sigmask
  2234.       movew    #0x116, sp@-        | Psigblock() system call
  2235.       trap    #1            |
  2236.       addqw    #6, sp
  2237. !     movel    d0, a0@(52)        | save MiNT signal mask
  2238. !     jmp    SETJMP            | call common code
  2239.   
  2240.       .globl _setjmp
  2241.   _setjmp:
  2242.       movel    sp@(4),a0        | address of jmp_buf[]
  2243. !     movel    #0, a0@(56)        | do not restore sigmask on longjmp
  2244.   SETJMP:
  2245.       movel    sp@,a0@            | save return address
  2246.       moveml    d2-d7/a2-a7,a0@(4)    | save registers d2-d7/a2-a7
  2247. --- 18,49 ----
  2248.   _sigsetjmp:
  2249.       movel    sp@(4), a0        | address of sigjmp_buf[]
  2250.   #ifdef __MSHORT__
  2251. !     movew    sp@(8), a1
  2252.   #else
  2253. !     movel    sp@(8), a1
  2254.   #endif
  2255. !     movel    a1, a0@(52)        | save sigmask for siglongjmp?
  2256.       beq    SETJMP            | no -- call common code
  2257. !     movel    Sigmask, d0        | save tos emulation signal mask
  2258.   #ifdef __MSHORT__
  2259.       tstw    Mint            | see if MiNT is active
  2260.   #else
  2261.       tstl    Mint
  2262.   #endif
  2263. !     beq    nomint            | no -- call common code
  2264. !     clrl    sp@-            | add no signals to sigmask
  2265.       movew    #0x116, sp@-        | Psigblock() system call
  2266.       trap    #1            |
  2267.       addqw    #6, sp
  2268. ! nomint:
  2269. !     orw    #1,d0            | make it != 0 (SIGNULL is unmaskable)
  2270. !     movel    d0, a0@(52)        | save signal mask
  2271. !     bra    SETJMP            | call common code
  2272.   
  2273.       .globl _setjmp
  2274.   _setjmp:
  2275.       movel    sp@(4),a0        | address of jmp_buf[]
  2276. !     clrl    a0@(52)            | do not restore sigmask on longjmp
  2277.   SETJMP:
  2278.       movel    sp@,a0@            | save return address
  2279.       moveml    d2-d7/a2-a7,a0@(4)    | save registers d2-d7/a2-a7
  2280. ***************
  2281. *** 64,79 ****
  2282.       addqw    #2, sp
  2283.   NOMINT:
  2284.       movel    sp@(4),a0        | address of jmp_buf[]
  2285. !     tstl    a0@(56)            | want to restore sigmask?
  2286.       beq    NORESTORE        | no -- skip restore code
  2287. !     movel    a0@(52), Sigmask    | restore tos emulation signal mask
  2288.   #ifdef __MSHORT__
  2289.       tstw    Mint            | see if MiNT is active
  2290.   #else
  2291.       tstl    Mint
  2292.   #endif
  2293.       beq    NORESTORE        | no -- do not call sigsetmask
  2294. !     movel    a0@(52), sp@-        | restore signal mask
  2295.       movew    #0x117, sp@-        | Psigsetmask() system call
  2296.       trap    #1            |
  2297.       addqw    #6, sp
  2298. --- 65,81 ----
  2299.       addqw    #2, sp
  2300.   NOMINT:
  2301.       movel    sp@(4),a0        | address of jmp_buf[]
  2302. !     movel    a0@(52),d0        | want to restore sigmask?
  2303.       beq    NORESTORE        | no -- skip restore code
  2304. !     andw    #-2,d0
  2305. !     movel    d0, Sigmask        | restore tos emulation signal mask
  2306.   #ifdef __MSHORT__
  2307.       tstw    Mint            | see if MiNT is active
  2308.   #else
  2309.       tstl    Mint
  2310.   #endif
  2311.       beq    NORESTORE        | no -- do not call sigsetmask
  2312. !     movel    d0, sp@-        | restore signal mask
  2313.       movew    #0x117, sp@-        | Psigsetmask() system call
  2314.       trap    #1            |
  2315.       addqw    #6, sp
  2316. ***************
  2317. *** 84,90 ****
  2318.       movel    sp@(8),d0        | value to return
  2319.   #endif
  2320.       bne    L1            | may not be 0
  2321. !     movl    #1, d0
  2322.   L1:
  2323.       moveml    a0@(4),d2-d7/a2-a7    | restore saved reggies
  2324.       movl    a0@,sp@            | and the saved return address
  2325. --- 86,92 ----
  2326.       movel    sp@(8),d0        | value to return
  2327.   #endif
  2328.       bne    L1            | may not be 0
  2329. !     movql    #1, d0
  2330.   L1:
  2331.       moveml    a0@(4),d2-d7/a2-a7    | restore saved reggies
  2332.       movl    a0@,sp@            | and the saved return address
  2333. ===================================================================
  2334. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/sprintf.c,v
  2335. retrieving revision 1.9
  2336. diff -c -r1.9 sprintf.c
  2337. *** 1.9    1992/09/14 14:56:40
  2338. --- sprintf.c    1993/10/26 23:52:58
  2339. ***************
  2340. *** 3,15 ****
  2341.   #include <limits.h>
  2342.   #include "lib.h"
  2343.   
  2344. ! #ifndef __GNUC__
  2345. ! static FILE dummyf =
  2346. !     {0L, (unsigned char *)0, (unsigned char *)0,
  2347. !          _IOWRT|_IOBIN|_IOSTRING|_IOFBF, 0, LONG_MAX, '\0'};
  2348. ! #endif
  2349.   
  2350. ! __EXTERN int _doprnt __PROTO((FILE *file, const char *fmt, va_list argp));
  2351.   
  2352.   #ifdef __STDC__
  2353.   int sprintf(char *buf, const char *fmt, ...)
  2354. --- 3,19 ----
  2355.   #include <limits.h>
  2356.   #include "lib.h"
  2357.   
  2358. ! static int sputc __PROTO((int ch, FILE *fp));
  2359.   
  2360. ! static int
  2361. ! sputc (ch, fp)
  2362. !      int ch;
  2363. !      FILE *fp;
  2364. ! {
  2365. !   char **bufp = (char **) fp;
  2366. !   *(*bufp)++ = ch;
  2367. !   return ch;
  2368. ! }
  2369.   
  2370.   #ifdef __STDC__
  2371.   int sprintf(char *buf, const char *fmt, ...)
  2372. ***************
  2373. *** 21,40 ****
  2374.       {
  2375.       register int n;
  2376.       va_list argp;
  2377. ! #ifdef __GNUC__
  2378. !     FILE sf = 
  2379. !     {0L, (unsigned char *)buf, (unsigned char *)buf,
  2380. !          _IOWRT|_IOBIN|_IOSTRING|_IOFBF, 0, LONG_MAX,'\0'};
  2381. ! #else
  2382. !     FILE sf;
  2383. !  
  2384. !     sf = dummyf;
  2385. !     sf._ptr = sf._base = (unsigned char *)buf;
  2386. ! #endif
  2387. !     
  2388.       va_start(argp, fmt);
  2389. !     n = _doprnt(&sf, fmt, argp);
  2390. !     *(sf._ptr) = '\0';        /* always tie of the string */
  2391.       return(n);
  2392.       }
  2393.   
  2394. --- 25,34 ----
  2395.       {
  2396.       register int n;
  2397.       va_list argp;
  2398.       va_start(argp, fmt);
  2399. !     n = _doprnt(sputc, (FILE *) &buf, fmt, argp);
  2400. !     *buf = '\0';        /* always tie of the string */
  2401.       return(n);
  2402.       }
  2403.   
  2404. ***************
  2405. *** 44,60 ****
  2406.       va_list args;
  2407.       {
  2408.       register int n;
  2409. ! #ifdef __GNUC__    
  2410. !     FILE sf = 
  2411. !     {0L, (unsigned char *)buf, (unsigned char *)buf,
  2412. !          _IOWRT|_IOBIN|_IOSTRING|_IOFBF, 0, LONG_MAX,'\0'};
  2413. ! #else
  2414. !     FILE sf;
  2415. !     sf = dummyf;
  2416. !     sf._ptr = sf._base = (unsigned char *)buf;
  2417. ! #endif
  2418. !     n = _doprnt(&sf, fmt, args);
  2419. !     *(sf._ptr) = '\0';        /* always tie of the string */
  2420.       return(n);
  2421.       }
  2422. --- 38,44 ----
  2423.       va_list args;
  2424.       {
  2425.       register int n;
  2426. !     n = _doprnt(sputc, (FILE *) &buf, fmt, args);
  2427. !     *buf = '\0';        /* always tie of the string */
  2428.       return(n);
  2429.       }
  2430. ===================================================================
  2431. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/strcmp.c,v
  2432. retrieving revision 1.3
  2433. diff -c -r1.3 strcmp.c
  2434. *** 1.3    1990/02/27 21:25:15
  2435. --- strcmp.c    1993/10/26 23:53:00
  2436. ***************
  2437. *** 2,7 ****
  2438. --- 2,10 ----
  2439.   /* modified by ERS */
  2440.   
  2441.   #include <string.h>
  2442. + #ifdef __LATTICE__
  2443. + #undef strcmp
  2444. + #endif
  2445.   
  2446.   /*
  2447.    * strcmp - compare string s1 to s2
  2448. ===================================================================
  2449. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/strftime.c,v
  2450. retrieving revision 1.8
  2451. diff -c -r1.8 strftime.c
  2452. *** 1.8    1993/03/01 17:34:40
  2453. --- strftime.c    1993/10/26 23:53:02
  2454. ***************
  2455. *** 38,44 ****
  2456.           const struct tm *ts;
  2457.   {
  2458.           long    num = 0;
  2459. !         long    len = 0;
  2460.       int n;
  2461.           char    q;
  2462.           char    buf[BIG_LEN], *putstr, *s;
  2463. --- 38,44 ----
  2464.           const struct tm *ts;
  2465.   {
  2466.           long    num = 0;
  2467. !         long    len;
  2468.       int n;
  2469.           char    q;
  2470.           char    buf[BIG_LEN], *putstr, *s;
  2471. ***************
  2472. *** 165,171 ****
  2473.                   s = putstr;
  2474.                   while (*s && isalpha(*s))
  2475.                           s++;
  2476. !                 *s++ = 0;
  2477.               }
  2478.               else
  2479.                       buf[0] = '\0'; /* empty string */
  2480. --- 165,171 ----
  2481.                   s = putstr;
  2482.                   while (*s && isalpha(*s))
  2483.                           s++;
  2484. !                 *s = 0;
  2485.               }
  2486.               else
  2487.                       buf[0] = '\0'; /* empty string */
  2488. ===================================================================
  2489. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/strncat.c,v
  2490. retrieving revision 1.5
  2491. diff -c -r1.5 strncat.c
  2492. *** 1.5    1992/09/14 14:56:40
  2493. --- strncat.c    1993/10/26 23:53:03
  2494. ***************
  2495. *** 21,27 ****
  2496.           count = n;
  2497.           while ((c = *sscan++) != '\0' && --count >= 0)
  2498.           *dscan++ = c;
  2499. !         *dscan++ = '\0';
  2500.       }
  2501.       return(dst);
  2502.   }
  2503. --- 21,27 ----
  2504.           count = n;
  2505.           while ((c = *sscan++) != '\0' && --count >= 0)
  2506.           *dscan++ = c;
  2507. !         *dscan = '\0';
  2508.       }
  2509.       return(dst);
  2510.   }
  2511. ===================================================================
  2512. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/utime.c,v
  2513. retrieving revision 1.12
  2514. diff -c -r1.12 utime.c
  2515. *** 1.12    1993/06/04 19:55:54
  2516. --- utime.c    1993/10/26 23:53:05
  2517. ***************
  2518. *** 25,30 ****
  2519. --- 25,31 ----
  2520.   #  include <ioctl.h>
  2521.   #endif
  2522.   #include <assert.h>
  2523. + #include <unistd.h>
  2524.   #ifdef __TURBOC__
  2525.   #include <sys\types.h>
  2526.   #else
  2527. ***************
  2528. *** 60,66 ****
  2529.         const struct utimbuf *tset;
  2530.   {
  2531.       int fh;
  2532. !     time_t actime, modtime;
  2533.       unsigned long dtime;    /* dos time equivalent */
  2534.       
  2535.       char filename[PATH_MAX];
  2536. --- 61,67 ----
  2537.         const struct utimbuf *tset;
  2538.   {
  2539.       int fh;
  2540. !     unsigned long actime, modtime;
  2541.       unsigned long dtime;    /* dos time equivalent */
  2542.       
  2543.       char filename[PATH_MAX];
  2544. ***************
  2545. *** 69,103 ****
  2546.   
  2547.       if (tset)
  2548.       {
  2549. !         modtime = tset->modtime;
  2550. !         actime = tset->actime;
  2551.       }
  2552.       else
  2553.       {
  2554. !         time(&actime);
  2555.           modtime = actime;
  2556.       }
  2557.   
  2558.       (void)_unx2dos(_filename, filename);
  2559.   
  2560. !     dtime = _dostime(actime);
  2561. !     settime.actime = (unsigned short) ((dtime >> 16) & 0xFFFF);
  2562. !     settime.acdate = (unsigned short) (dtime & 0xFFFF);
  2563. !     dtime = _dostime(modtime);
  2564. !     settime.modtime = (unsigned short) ((dtime >> 16) & 0xFFFF);
  2565. !     settime.moddate = (unsigned short) (dtime & 0xFFFF);
  2566.       fh = (int) Fopen(filename, 2);
  2567.       if (fh < 0) {
  2568.           errno = -fh;
  2569.           return -1;
  2570.       }
  2571.   
  2572.       res = -EINVAL;
  2573. !     if (__mint > 90)
  2574. !         res = Fcntl(fh, (long)&settime, FUTIME);
  2575.       if (res == -EINVAL)
  2576.           (void)Fdatime((_DOSTIME *) &dtime, fh, 1);
  2577.   
  2578.       if ((fh = Fclose(fh)) != 0) {
  2579.           errno = -fh;
  2580. --- 70,111 ----
  2581.   
  2582.       if (tset)
  2583.       {
  2584. !         modtime = _dostime (tset->modtime);
  2585. !         actime = _dostime (tset->actime);
  2586.       }
  2587.       else
  2588.       {
  2589. !         actime = ((long) Tgettime () << 16) | (Tgetdate () & 0xFFFF);
  2590.           modtime = actime;
  2591.       }
  2592.   
  2593.       (void)_unx2dos(_filename, filename);
  2594.   
  2595. !     settime.actime = (unsigned short) ((actime >> 16) & 0xFFFF);
  2596. !     settime.acdate = (unsigned short) (actime & 0xFFFF);
  2597. !     settime.modtime = (unsigned short) ((modtime >> 16) & 0xFFFF);
  2598. !     settime.moddate = (unsigned short) (modtime & 0xFFFF);
  2599.       fh = (int) Fopen(filename, 2);
  2600.       if (fh < 0) {
  2601. +         /* Kludge:  return success for dirs even though we failed */
  2602. +         if ((fh == -ENOENT) && (Fattrib(filename, 0, 0) == FA_DIR))
  2603. +             return 0;
  2604.           errno = -fh;
  2605.           return -1;
  2606.       }
  2607.   
  2608.       res = -EINVAL;
  2609. !     if (__mint > 90) {
  2610. !         if (tset)
  2611. !             res = Fcntl(fh, (long)&settime, FUTIME);
  2612. !         else
  2613. !             res = Fcntl(fh, (long)0, FUTIME);
  2614. !     }
  2615.       if (res == -EINVAL)
  2616. +           {
  2617. +         dtime = modtime;
  2618.           (void)Fdatime((_DOSTIME *) &dtime, fh, 1);
  2619. +           }
  2620.   
  2621.       if ((fh = Fclose(fh)) != 0) {
  2622.           errno = -fh;
  2623. ***************
  2624. *** 111,124 ****
  2625.   {
  2626.       unsigned long dtime;
  2627.       unsigned date, time;
  2628.   
  2629.       assert(t != 0);
  2630.       dtime = _dostime(*t);
  2631.       date = (int) (dtime & 0xffff);
  2632.       time = (int) (dtime >> 16) & 0xffff;
  2633.   
  2634. !     if (Tsetdate(date) || Tsettime(time)) {
  2635. !         errno = EBADARG;
  2636.           return -1;
  2637.       }
  2638.       return 0;
  2639. --- 119,133 ----
  2640.   {
  2641.       unsigned long dtime;
  2642.       unsigned date, time;
  2643. +     long r;
  2644.   
  2645.       assert(t != 0);
  2646.       dtime = _dostime(*t);
  2647.       date = (int) (dtime & 0xffff);
  2648.       time = (int) (dtime >> 16) & 0xffff;
  2649.   
  2650. !     if ((r = Tsetdate(date)) || (r = Tsettime(time))) {
  2651. !         errno = r == -1 ? EBADARG : (int) -r;
  2652.           return -1;
  2653.       }
  2654.       return 0;
  2655.