home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update23.zoo / lib / diffc
Encoding:
Text File  |  1992-07-20  |  25.8 KB  |  999 lines

  1. *** 1.77    1992/06/03 14:47:34
  2. --- Changelo    1992/07/20 21:56:31
  3. ***************
  4. *** 3169,3171 ****
  5. --- 3169,3206 ----
  6.       a mistake there.
  7.   
  8.   ---------------------------- Patchlevel 81 ---------------------------
  9. + keycode.h, unistd.h:: michal
  10. +     change #if defined() to #ifdef
  11. + *.h:: ++jrb
  12. +     make all decls for alloca consistent
  13. + getlogin.c, lseek.c, qsort.c, gnulib2.c, stat.c:: ++jrb
  14. +     #include <memory.h> for alloca.
  15. + all over:: ers, ++jrb
  16. +     change unx2dos/dos2unx to _unx2dos/_dos2unx to avoid posix names
  17. +     space corruption in the library. not that there is still a user
  18. +     callable unx2dos/dos2unx.
  19. + atol.c:: ers
  20. +     conditionalize proto
  21. + getuid.c:: ers
  22. +     let default uid/gid be root/bin
  23. + lib.h:: ers
  24. +     adjust protos
  25. + gnulib2.c:: alexander lehmann
  26. +     _fixunssfsi(): I did some investigating and discovered that the
  27. +     function did almost always return 0xffffffff. However the function
  28. +     doesn't look wrong in any sense. I rewrote the function a bit
  29. +     (without really changing anything) and now it works. The problem arises
  30. +     from a bug in GCC, that causes certain negative integer constants to
  31. +     become positive when cast to float. e.g. -2^31 (LONG_MIN) becomes
  32. +     2^31. This constant was used in the _fixunssfsi function and caused the
  33. +     problem.
  34. + ---------------------------- Patchlevel 82 ---------------------------
  35. *** 1.57    1992/06/03 14:46:01
  36. --- PatchLev.h    1992/07/20 21:56:32
  37. ***************
  38. *** 1,5 ****
  39.   
  40. ! #define    PatchLevel "81"
  41.   
  42.   /*
  43.    *
  44. --- 1,5 ----
  45.   
  46. ! #define    PatchLevel "82"
  47.   
  48.   /*
  49.    *
  50. *** 1.1    1991/06/20 02:12:19
  51. --- device.c    1992/07/20 21:56:37
  52. ***************
  53. *** 4,10 ****
  54.   
  55.   /*
  56.    * Pseudo-device interface stuff. New devices can be hooked into the chain
  57. !  * that's rooted at __devices. All unx2dos and low level i/o functions use this
  58.    * chain in determining whether files are devices or disk files, as does stat().
  59.    * The major device number of user-supplied devices must *NOT* be 0 or 0xff,
  60.    * both of which are reserved.
  61. --- 4,10 ----
  62.   
  63.   /*
  64.    * Pseudo-device interface stuff. New devices can be hooked into the chain
  65. !  * that's rooted at __devices. All _unx2dos and low level i/o functions use this
  66.    * chain in determining whether files are devices or disk files, as does stat().
  67.    * The major device number of user-supplied devices must *NOT* be 0 or 0xff,
  68.    * both of which are reserved.
  69. *** 1.13    1991/06/11 23:04:27
  70. --- dirent.c    1992/07/20 21:56:37
  71. ***************
  72. *** 56,62 ****
  73.       short i = 0;
  74.       struct _dta mydta, *olddta;
  75.   
  76. !     unx2dos(_dirname, dirname);
  77.   
  78.   #if 0
  79.   /* we should maybe check to see if we're opening a directory */
  80. --- 56,62 ----
  81.       short i = 0;
  82.       struct _dta mydta, *olddta;
  83.   
  84. !     _unx2dos(_dirname, dirname);
  85.   
  86.   #if 0
  87.   /* we should maybe check to see if we're opening a directory */
  88. *** 1.12    1992/06/01 01:57:48
  89. --- mkdir.c    1992/07/20 21:56:41
  90. ***************
  91. *** 21,32 ****
  92.       char path[FILENAME_MAX];
  93.   
  94.   /*
  95. !  * unx2dos indicates whether the name has been modified in some way
  96.    * in its return value. In this case, we try to create an
  97.    * automatic symbolic link which gives the "real" name, which is put
  98.    * in the global variable __link_name[].
  99.    */
  100. !     name_munged = (unx2dos(_path, path) == _NM_CHANGE);
  101.   
  102.       rv = Fattrib(path, 0, 0);    /* Get file attributes */
  103.       if (rv >= 0) {            /* Does it exist ? */
  104. --- 21,32 ----
  105.       char path[FILENAME_MAX];
  106.   
  107.   /*
  108. !  * _unx2dos indicates whether the name has been modified in some way
  109.    * in its return value. In this case, we try to create an
  110.    * automatic symbolic link which gives the "real" name, which is put
  111.    * in the global variable __link_name[].
  112.    */
  113. !     name_munged = (_unx2dos(_path, path) == _NM_CHANGE);
  114.   
  115.       rv = Fattrib(path, 0, 0);    /* Get file attributes */
  116.       if (rv >= 0) {            /* Does it exist ? */
  117. *** 1.16    1991/09/24 16:44:02
  118. --- open.c    1992/07/20 21:56:42
  119. ***************
  120. *** 51,61 ****
  121.     mode = ((unsigned int)(va_arg(argp, int))) & ~__umask;
  122.   
  123.   /* convert Unix style filename to GEMDOS style */
  124. ! /* if the name gets munged, unx2dos will return _NM_CHANGE,
  125.    * and will copy the original name to the global array __link_name[]
  126.    */
  127.   
  128. !   name_munged = unx2dos(_path, path);
  129.   
  130.     if (name_munged == _NM_DEV && (dev = _dev_dosname(path)) && dev->open) {
  131.       return (*dev->open)(path, flags, mode);
  132. --- 51,61 ----
  133.     mode = ((unsigned int)(va_arg(argp, int))) & ~__umask;
  134.   
  135.   /* convert Unix style filename to GEMDOS style */
  136. ! /* if the name gets munged, _unx2dos will return _NM_CHANGE,
  137.    * and will copy the original name to the global array __link_name[]
  138.    */
  139.   
  140. !   name_munged = _unx2dos(_path, path);
  141.   
  142.     if (name_munged == _NM_DEV && (dev = _dev_dosname(path)) && dev->open) {
  143.       return (*dev->open)(path, flags, mode);
  144. *** 1.14    1991/12/26 15:53:59
  145. --- rename.c    1992/07/20 21:56:42
  146. ***************
  147. *** 29,36 ****
  148.       }
  149.       errno = save_errno;
  150.   
  151. !     rval = unx2dos(_oldname, oldname);
  152. !     /* unx2dos returns _NM_LINK and sets __link_path and __link_name if
  153.            * given a symbolic link
  154.        */
  155.       if (rval == _NM_LINK) {            /* a symbolic link */
  156. --- 29,36 ----
  157.       }
  158.       errno = save_errno;
  159.   
  160. !     rval = _unx2dos(_oldname, oldname);
  161. !     /* _unx2dos returns _NM_LINK and sets __link_path and __link_name if
  162.            * given a symbolic link
  163.        */
  164.       if (rval == _NM_LINK) {            /* a symbolic link */
  165. ***************
  166. *** 60,68 ****
  167.       }
  168.   
  169.   /*
  170. !  * save info about whether or not the name got changed by unx2dos
  171.    */
  172. !     name_munged = (unx2dos(_newname, newname) == _NM_CHANGE);
  173.   /*
  174.    * for a symbolic link, we now have an entry "ent" which points at
  175.    * the old symbolic link. Make a new symbolic link, with the new name,
  176. --- 60,68 ----
  177.       }
  178.   
  179.   /*
  180. !  * save info about whether or not the name got changed by _unx2dos
  181.    */
  182. !     name_munged = (_unx2dos(_newname, newname) == _NM_CHANGE);
  183.   /*
  184.    * for a symbolic link, we now have an entry "ent" which points at
  185.    * the old symbolic link. Make a new symbolic link, with the new name,
  186. *** 1.9    1992/04/13 15:50:45
  187. --- rmdir.c    1992/07/20 21:56:43
  188. ***************
  189. *** 24,32 ****
  190.       char path[FILENAME_MAX], *s;
  191.       int  r, nm_change;
  192.   
  193. !     nm_change = unx2dos(_path, path);
  194.   /*
  195. !  * unx2dos returns _NM_LINK and sets __link_path for symbolic links
  196.    */
  197.   
  198.       if (nm_change == _NM_LINK) {    /* _path was to a symbolic link */
  199. --- 24,32 ----
  200.       char path[FILENAME_MAX], *s;
  201.       int  r, nm_change;
  202.   
  203. !     nm_change = _unx2dos(_path, path);
  204.   /*
  205. !  * _unx2dos returns _NM_LINK and sets __link_path for symbolic links
  206.    */
  207.   
  208.       if (nm_change == _NM_LINK) {    /* _path was to a symbolic link */
  209. *** 1.19    1992/06/01 01:57:48
  210. --- stat.c    1992/07/20 21:56:44
  211. ***************
  212. *** 21,26 ****
  213. --- 21,27 ----
  214.   #include    "symdir.h"
  215.   #include    <time.h>
  216.   #include    "lib.h"
  217. + #include    <memory.h>
  218.   
  219.   #ifndef NAME_MAX
  220.   #  include <limits.h>
  221. ***************
  222. *** 40,46 ****
  223.   #define OLDDATE _unixtime(0,0)
  224.   
  225.   /*
  226. !  * check file cache for the file whose canonical (unx2dos) name is fullname.
  227.    * this is only valid for TOS files, i.e. files that are NOT symbolic
  228.    * links. If file is not found in cache, use Fsfirst to look it up.
  229.    * All open directories (via opendir) are cached (we don't lose much by
  230. --- 41,47 ----
  231.   #define OLDDATE _unixtime(0,0)
  232.   
  233.   /*
  234. !  * check file cache for the file whose canonical (_unx2dos) name is fullname.
  235.    * this is only valid for TOS files, i.e. files that are NOT symbolic
  236.    * links. If file is not found in cache, use Fsfirst to look it up.
  237.    * All open directories (via opendir) are cached (we don't lose much by
  238. ***************
  239. *** 67,76 ****
  240.       strcpy(path, fullname);
  241.       if((tmp = strrchr(path, '\\'))) {
  242.           *tmp++ = 0;
  243. !         dos2unx(tmp, name);
  244.       }
  245.       else {
  246. !         dos2unx(path, name);
  247.           path[0] = 0;
  248.       }
  249.   
  250. --- 68,77 ----
  251.       strcpy(path, fullname);
  252.       if((tmp = strrchr(path, '\\'))) {
  253.           *tmp++ = 0;
  254. !         _dos2unx(tmp, name);
  255.       }
  256.       else {
  257. !         _dos2unx(path, name);
  258.           path[0] = 0;
  259.       }
  260.   
  261. ***************
  262. *** 124,135 ****
  263.       }
  264.   
  265.   /*
  266. !  * NOTE: the new unx2dos gives a complete, canonical TOS pathname
  267.    * (i.e. stripped of . and .., and with a drive letter). It also returns
  268.    * some useful information about what the given filename was (e.g. symlink,
  269.    * or device)
  270.    */
  271. !     nval = unx2dos(_path, path);
  272.       if (nval == _NM_DEV) {
  273.           device = _dev_dosname(path);
  274.           st->st_mode = S_IFCHR | 0600;
  275. --- 125,136 ----
  276.       }
  277.   
  278.   /*
  279. !  * NOTE: the new _unx2dos gives a complete, canonical TOS pathname
  280.    * (i.e. stripped of . and .., and with a drive letter). It also returns
  281.    * some useful information about what the given filename was (e.g. symlink,
  282.    * or device)
  283.    */
  284. !     nval = _unx2dos(_path, path);
  285.       if (nval == _NM_DEV) {
  286.           device = _dev_dosname(path);
  287.           st->st_mode = S_IFCHR | 0600;
  288. ***************
  289. *** 267,273 ****
  290.       {
  291.       if (__open_stat[fd].filename) {
  292.           /* we should turn off links, because the name we're going to give
  293. !          * to 'stat' has already been unx2dos'd
  294.            */
  295.           old = _lOK;
  296.           _lOK = 0;
  297. --- 268,274 ----
  298.       {
  299.       if (__open_stat[fd].filename) {
  300.           /* we should turn off links, because the name we're going to give
  301. !          * to 'stat' has already been _unx2dos'd
  302.            */
  303.           old = _lOK;
  304.           _lOK = 0;
  305. ***************
  306. *** 346,352 ****
  307.   {
  308.       int r;
  309.   
  310. ! /* unx2dos returns _NM_LINK if the last path component was a symbolic link
  311.    * in this case, __link_name and __link_path are set to the name and path
  312.    * of the symbolic link file, __link_to to its contents, and __link_flags
  313.    * its flags.
  314. --- 347,353 ----
  315.   {
  316.       int r;
  317.   
  318. ! /* _unx2dos returns _NM_LINK if the last path component was a symbolic link
  319.    * in this case, __link_name and __link_path are set to the name and path
  320.    * of the symbolic link file, __link_to to its contents, and __link_flags
  321.    * its flags.
  322. *** 1.4    1991/09/24 16:44:02
  323. --- symdir.c    1992/07/20 21:56:44
  324. ***************
  325. *** 54,60 ****
  326.   /*
  327.    * Routines for keeping a cache of recently used symbolic directories.
  328.    * The last 8 directories accessed are kept cached; this really helps
  329. !  * the directory searches in unx2dos, but does eat some memory.
  330.    *
  331.    * entries are added to the cache by _free_symdir, and removed if they
  332.    * fall off the end, or if they're retrieved by a subsequent _read_symdir.
  333. --- 54,60 ----
  334.   /*
  335.    * Routines for keeping a cache of recently used symbolic directories.
  336.    * The last 8 directories accessed are kept cached; this really helps
  337. !  * the directory searches in _unx2dos, but does eat some memory.
  338.    *
  339.    * entries are added to the cache by _free_symdir, and removed if they
  340.    * fall off the end, or if they're retrieved by a subsequent _read_symdir.
  341. ***************
  342. *** 116,124 ****
  343.   }
  344.   
  345.   /*
  346. !  * free a symbolic directory. Note that unx2dos is expecting the entries
  347.    * to be accessible, i.e. it knows that we're caching at least 1 directory.
  348. !  * If this ever changes, change unx2dos.
  349.    */
  350.   
  351.   void _free_symdir(dir)
  352. --- 116,124 ----
  353.   }
  354.   
  355.   /*
  356. !  * free a symbolic directory. Note that _unx2dos is expecting the entries
  357.    * to be accessible, i.e. it knows that we're caching at least 1 directory.
  358. !  * If this ever changes, change _unx2dos.
  359.    */
  360.   
  361.   void _free_symdir(dir)
  362. ***************
  363. *** 320,328 ****
  364.       strcpy(path, dosname);
  365.       if ((p = strrchr(path, '\\'))) {
  366.           *p++ = 0;
  367. !         dos2unx(p, oldname);
  368.       } else {
  369. !         dos2unx(path, oldname);
  370.           path[0] = 0;
  371.       }
  372.   
  373. --- 320,328 ----
  374.       strcpy(path, dosname);
  375.       if ((p = strrchr(path, '\\'))) {
  376.           *p++ = 0;
  377. !         _dos2unx(p, oldname);
  378.       } else {
  379. !         _dos2unx(path, oldname);
  380.           path[0] = 0;
  381.       }
  382.   
  383. *** 1.4    1991/06/11 23:04:27
  384. --- symdir.h    1992/07/20 21:56:44
  385. ***************
  386. *** 60,69 ****
  387.   void _free_symdir(SYMDIR *dir);
  388.   
  389.   void     _set_unixmode(char *mode);
  390. - int    _unx2dos(const char *, char *);
  391. - int    _dos2unx(const char *, char *);
  392. - int    unx2dos(const char *, char *);
  393. - int    dos2unx(const char *, char *);
  394.   
  395.   #else
  396.   
  397. --- 60,65 ----
  398. ***************
  399. *** 71,75 ****
  400. --- 67,73 ----
  401.   extern SYMENTRY *_symdir_lookup();
  402.   
  403.   #endif
  404. + #include "lib.h"
  405.   
  406.   #endif /* _SYMDIR_H */
  407. *** 1.8    1991/12/26 15:53:59
  408. --- symlink.c    1992/07/20 21:56:45
  409. ***************
  410. *** 24,40 ****
  411.       int r, save_errno;
  412.   
  413.   /* Problem: to TOS, "Makefile", "Makefile", and "makefilefoo" are all
  414. !  * identical. Fortunately, unx2dos can distinguish them, and
  415.    * returns _NM_CHANGE for names that are not "canonical" (_NM_OK
  416.    * means a normal file, _NM_LINK means an existing symbolic link).
  417. !  * So if unx2dos returns _NM_OK, and access finds the file, then
  418. !  * it already exists; if unx2dos returns _NM_LINK, the file already
  419.    * exists as a symbolic link (access would work in this case, but
  420.    * is redundant).
  421.    */
  422.   
  423.           save_errno = errno;
  424. !     r = unx2dos(new, linkpath);
  425.       if ((r == _NM_LINK) || (r == _NM_OK) && !access(new, 0)) {
  426.           errno = EEXIST;
  427.           return -1;
  428. --- 24,40 ----
  429.       int r, save_errno;
  430.   
  431.   /* Problem: to TOS, "Makefile", "Makefile", and "makefilefoo" are all
  432. !  * identical. Fortunately, _unx2dos can distinguish them, and
  433.    * returns _NM_CHANGE for names that are not "canonical" (_NM_OK
  434.    * means a normal file, _NM_LINK means an existing symbolic link).
  435. !  * So if _unx2dos returns _NM_OK, and access finds the file, then
  436. !  * it already exists; if _unx2dos returns _NM_LINK, the file already
  437.    * exists as a symbolic link (access would work in this case, but
  438.    * is redundant).
  439.    */
  440.   
  441.           save_errno = errno;
  442. !     r = _unx2dos(new, linkpath);
  443.       if ((r == _NM_LINK) || (r == _NM_OK) && !access(new, 0)) {
  444.           errno = EEXIST;
  445.           return -1;
  446. ***************
  447. *** 43,49 ****
  448.   
  449.   /*
  450.    * find the name (from the original path in "new"), and the canonical form
  451. !  * of the path to it (from what unx2dos just gave us)
  452.    */
  453.   
  454.       name = new;
  455. --- 43,49 ----
  456.   
  457.   /*
  458.    * find the name (from the original path in "new"), and the canonical form
  459. !  * of the path to it (from what _unx2dos just gave us)
  460.    */
  461.   
  462.       name = new;
  463. ***************
  464. *** 110,123 ****
  465.       }
  466.           if (lastslash==tmp) {
  467.               lastslash++;
  468. !             unx2dos("/",linkpath);
  469.           } else if (lastslash) {
  470.           *lastslash++ = 0;
  471. !         unx2dos(tmp, linkpath);
  472.       }
  473.       else {
  474.           lastslash = tmp;
  475. !         unx2dos(".", linkpath);
  476.       }
  477.       if (!(dir = _read_symdir(linkpath))) {
  478.           errno = EPATH;
  479. --- 110,123 ----
  480.       }
  481.           if (lastslash==tmp) {
  482.               lastslash++;
  483. !             _unx2dos("/",linkpath);
  484.           } else if (lastslash) {
  485.           *lastslash++ = 0;
  486. !         _unx2dos(tmp, linkpath);
  487.       }
  488.       else {
  489.           lastslash = tmp;
  490. !         _unx2dos(".", linkpath);
  491.       }
  492.       if (!(dir = _read_symdir(linkpath))) {
  493.           errno = EPATH;
  494. *** 1.18    1991/12/26 15:53:59
  495. --- unlink.c    1992/07/20 21:56:45
  496. ***************
  497. *** 59,69 ****
  498.       SYMDIR *dir = 0;
  499.       SYMENTRY *ent = 0, *old;
  500.   /*
  501. !  * unx2dos returns _NM_LINK if "filename" was a symbolic link,
  502.    * in which case __link_path[] is the path to the directory containing
  503.    * the link, and __link_name[] is the name of the link.
  504.    */
  505. !     nameinfo = unx2dos(filename, name);
  506.   
  507.       if (nameinfo == _NM_LINK) {        /* a symbolic link */
  508.           if (!(dir = _read_symdir(__link_path)))
  509. --- 59,69 ----
  510.       SYMDIR *dir = 0;
  511.       SYMENTRY *ent = 0, *old;
  512.   /*
  513. !  * _unx2dos returns _NM_LINK if "filename" was a symbolic link,
  514.    * in which case __link_path[] is the path to the directory containing
  515.    * the link, and __link_name[] is the name of the link.
  516.    */
  517. !     nameinfo = _unx2dos(filename, name);
  518.   
  519.       if (nameinfo == _NM_LINK) {        /* a symbolic link */
  520.           if (!(dir = _read_symdir(__link_path)))
  521. *** 1.23    1992/06/01 01:57:48
  522. --- unx2dos.c    1992/07/20 21:56:45
  523. ***************
  524. *** 464,470 ****
  525.    */
  526.   
  527.   int
  528. !     _unx2dos(unx, dos)
  529.   const char *unx;
  530.   char *dos;
  531.   {
  532. --- 464,470 ----
  533.    */
  534.   
  535.   int
  536. !     _lib_unx2dos(unx, dos)
  537.   const char *unx;
  538.   char *dos;
  539.   {
  540. ***************
  541. *** 522,528 ****
  542.    */
  543.   
  544.   int
  545. !     _dos2unx(dos, unx)
  546.   const char *dos;
  547.   char *unx;
  548.   {
  549. --- 522,528 ----
  550.    */
  551.   
  552.   int
  553. !     _lib_dos2unx(dos, unx)
  554.   const char *dos;
  555.   char *unx;
  556.   {
  557. ***************
  558. *** 609,616 ****
  559.   
  560.   /* system default file name mapping function pointers */
  561.   
  562. ! static fnmapfunc_t ux2dos = _unx2dos;
  563. ! static fnmapfunc_t dos2ux = _dos2unx;
  564.   
  565.   /* set user specified filename mapping function
  566.    *    NULL => use system default mapping function
  567. --- 609,616 ----
  568.   
  569.   /* system default file name mapping function pointers */
  570.   
  571. ! static fnmapfunc_t ux2dos = _lib_unx2dos;
  572. ! static fnmapfunc_t dos2ux = _lib_dos2unx;
  573.   
  574.   /* set user specified filename mapping function
  575.    *    NULL => use system default mapping function
  576. ***************
  577. *** 618,637 ****
  578.   void fnmapfunc(u2dos, dos2u)
  579.   fnmapfunc_t u2dos, dos2u;
  580.   {
  581. !     ux2dos = (u2dos == NULL) ? _unx2dos : u2dos;
  582. !     dos2ux = (dos2u == NULL) ? _dos2unx : dos2u;
  583.   }
  584.   
  585.   /* mapping functions -- call the mapping functions via pointers */
  586.   
  587. ! int unx2dos(u, d)
  588.   const char *u;
  589.   char *d;
  590.   {
  591.       return (*ux2dos)(u, d);
  592.   }
  593.   
  594. ! int dos2unx(d, u)
  595.   const char *d;
  596.   char *u;
  597.   {
  598. --- 618,659 ----
  599.   void fnmapfunc(u2dos, dos2u)
  600.   fnmapfunc_t u2dos, dos2u;
  601.   {
  602. !     ux2dos = (u2dos == NULL) ? _lib_unx2dos : u2dos;
  603. !     dos2ux = (dos2u == NULL) ? _lib_dos2unx : dos2u;
  604.   }
  605.   
  606.   /* mapping functions -- call the mapping functions via pointers */
  607.   
  608. ! #ifdef __GNUC__
  609. ! asm(".stabs \"_unx2dos\",5,0,0,__unx2dos"); /* dept of clean tricks */
  610. ! #else
  611. ! int __unx2dos(u, d)
  612.   const char *u;
  613.   char *d;
  614.   {
  615.       return (*ux2dos)(u, d);
  616.   }
  617. + #endif
  618. + int _unx2dos(u, d)
  619. + const char *u;
  620. + char *d;
  621. + {
  622. +     return (*ux2dos)(u, d);
  623. + }
  624. + #ifdef __GNUC__
  625. + asm(".stabs \"_dos2unx\",5,0,0,__dos2unx"); /* dept of clean tricks */
  626. + #else
  627. + int __dos2unx(d, u)
  628. + const char *d;
  629. + char *u;
  630. + {
  631. +     return (*dos2ux)(d, u);
  632. + }
  633. + #endif
  634.   
  635. ! int _dos2unx(d, u)
  636.   const char *d;
  637.   char *u;
  638.   {
  639. *** 1.3    1989/03/23 18:24:27
  640. --- atol.c    1992/07/20 22:04:55
  641. ***************
  642. *** 4,14 ****
  643.   #include <stdlib.h>
  644.   #include <assert.h>
  645.   
  646. ! #ifdef __STDC__
  647. ! long    strtol(const char *, char **, int);
  648. ! #else
  649. ! extern long strtol();
  650. ! #endif
  651.   
  652.   int atoi(str)
  653.   const char *str;
  654. --- 4,10 ----
  655.   #include <stdlib.h>
  656.   #include <assert.h>
  657.   
  658. ! __EXTERN long strtol __PROTO((const char *, char **, int));
  659.   
  660.   int atoi(str)
  661.   const char *str;
  662. *** 1.10    1992/06/01 01:54:10
  663. --- chdir.c    1992/07/20 22:04:56
  664. ***************
  665. *** 22,28 ****
  666.   
  667.       assert ((dir != NULL));
  668.   
  669. !     (void)unx2dos(dir, tmp);    /* convert Unix filename to DOS */
  670.       d = tmp;
  671.       old = Dgetdrv();
  672.       if (*d && *(d+1) == ':') {
  673. --- 22,28 ----
  674.   
  675.       assert ((dir != NULL));
  676.   
  677. !     (void)_unx2dos(dir, tmp);    /* convert Unix filename to DOS */
  678.       d = tmp;
  679.       old = Dgetdrv();
  680.       if (*d && *(d+1) == ':') {
  681. *** 1.6    1992/06/01 01:54:10
  682. --- chmod.c    1992/07/20 22:04:56
  683. ***************
  684. *** 21,27 ****
  685.          char path[PATH_MAX];
  686.          struct stat stb;
  687.   
  688. !        (void)unx2dos(_path, path);
  689.   
  690.       if (__mint >= 9) {    /* use MiNT Fchmod function */
  691.           r = Fchmod(path, mode);
  692. --- 21,27 ----
  693.          char path[PATH_MAX];
  694.          struct stat stb;
  695.   
  696. !        (void)_unx2dos(_path, path);
  697.   
  698.       if (__mint >= 9) {    /* use MiNT Fchmod function */
  699.           r = Fchmod(path, mode);
  700. ***************
  701. *** 68,74 ****
  702.       char name[PATH_MAX];
  703.   
  704.       if (__mint >= 9) {
  705. !         (void)unx2dos(_name, name);
  706.           r = Fchown(name, uid, gid);
  707.           if (r) {
  708.               errno = -r;
  709. --- 68,74 ----
  710.       char name[PATH_MAX];
  711.   
  712.       if (__mint >= 9) {
  713. !         (void)_unx2dos(_name, name);
  714.           r = Fchown(name, uid, gid);
  715.           if (r) {
  716.               errno = -r;
  717. *** 1.8    1992/04/13 15:50:45
  718. --- getenv.c    1992/07/20 22:05:04
  719. ***************
  720. *** 1,12 ****
  721.   /* functions for manipulating the environment */
  722.   /* written by Eric R. Smith and placed in the public domain */
  723.   
  724.   #include <stddef.h>
  725.   #include <string.h>
  726.   #include <stdlib.h>
  727. - #ifndef _COMPILER_H
  728. - #include <compiler.h>
  729. - #endif
  730.   
  731.   extern char ** environ;
  732.   
  733. --- 1,10 ----
  734.   /* functions for manipulating the environment */
  735.   /* written by Eric R. Smith and placed in the public domain */
  736. + /* 5/5/92 sb -- separated for efficiency, see also putenv.c */
  737.   
  738.   #include <stddef.h>
  739.   #include <string.h>
  740.   #include <stdlib.h>
  741.   
  742.   extern char ** environ;
  743.   
  744. *** 1.7    1992/06/01 01:54:10
  745. --- getlogin.c    1992/07/20 22:05:04
  746. ***************
  747. *** 8,17 ****
  748.   #include <memory.h>
  749.   #include <unistd.h>
  750.   
  751. - #ifdef __GNUC__
  752. - #define alloca __builtin_alloca
  753. - #endif
  754.   static char *logname = NULL;
  755.   
  756.   char *getlogin()
  757. --- 8,13 ----
  758. *** 1.7    1992/06/01 01:54:10
  759. --- getuid.c    1992/07/20 22:05:06
  760. ***************
  761. *** 6,12 ****
  762.   
  763.   extern int __mint;
  764.   
  765. ! static int __uid = 1, __gid = 1;
  766.   
  767.   uid_t getuid() { return __mint ? Pgetuid() : __uid; }
  768.   gid_t getgid() { return __mint ? Pgetgid() : __gid; }
  769. --- 6,12 ----
  770.   
  771.   extern int __mint;
  772.   
  773. ! static int __uid = 0, __gid = 0;
  774.   
  775.   uid_t getuid() { return __mint ? Pgetuid() : __uid; }
  776.   gid_t getgid() { return __mint ? Pgetgid() : __gid; }
  777. *** 1.10    1992/04/13 15:50:45
  778. --- gnulib2.c    1992/07/20 22:05:07
  779. ***************
  780. *** 1,5 ****
  781. --- 1,6 ----
  782.   /* WARNING: compile this in 32 bit int mode even for short library */
  783.   #include <string.h>
  784. + #include <memory.h>
  785.   #ifndef _COMPILER_H
  786.   #include <compiler.h>
  787.   #endif
  788. ***************
  789. *** 72,85 ****
  790.   #define HOST_BITS_PER_INT 32
  791.   #define HOST_BITS_PER_LONG 32
  792.   
  793. - #ifdef __GNUC__
  794. - #ifndef minix
  795. - #define alloca __builtin_alloca
  796. - #else
  797. -      void *alloca(unsigned long);
  798. - #endif
  799. - #endif
  800.   /* Define this if most significant bit is lowest numbered
  801.      in instructions that operate on numbered bit-fields.
  802.      This is true for 68020 insns such as bfins and bfexts.
  803. --- 73,78 ----
  804. ***************
  805. *** 1636,1642 ****
  806.   unsigned SItype
  807.   __fixunssfsi (float a)
  808.   {
  809. !   if (a >= - (float) LONG_MIN)
  810.       return (SItype) (a + LONG_MIN) - LONG_MIN;
  811.     return (SItype) a;
  812.   }
  813. --- 1629,1635 ----
  814.   unsigned SItype
  815.   __fixunssfsi (float a)
  816.   {
  817. !   if (a >= ((float) LONG_MAX)+1)
  818.       return (SItype) (a + LONG_MIN) - LONG_MIN;
  819.     return (SItype) a;
  820.   }
  821. *** 1.6    1992/06/01 01:54:10
  822. --- lib.h    1992/07/20 22:05:07
  823. ***************
  824. *** 14,41 ****
  825.   /* filename mapping function type */
  826.   #ifndef __FNMAP
  827.   #define __FNMAP
  828. ! #ifdef __STDC__
  829. ! typedef int (*fnmapfunc_t)(const char *, char *);
  830. ! #else
  831. ! typedef int (*fnmapfunc_t)();
  832. ! #endif
  833.   #endif
  834.   
  835.   __EXTERN int        _unx2dos __PROTO((const char *, char *));
  836.   __EXTERN int        _dos2unx __PROTO((const char *, char *));
  837.   __EXTERN int        unx2dos __PROTO((const char *, char *));
  838.   __EXTERN int        dos2unx __PROTO((const char *, char *));
  839.   __EXTERN void        fnmapfunc __PROTO((fnmapfunc_t u2dos, fnmapfunc_t dos2u));
  840. ! __EXTERN int        spawnve __PROTO((int, char *, char **, char **));
  841.   
  842.   __EXTERN long        _write      __PROTO((int, const void *, unsigned long));
  843.   __EXTERN long        _read      __PROTO((int, void *, unsigned long));
  844.   __EXTERN int        console_input_status __PROTO((int));
  845.   __EXTERN unsigned int    console_read_byte __PROTO((int));
  846.   __EXTERN void        console_write_byte __PROTO((int, int));
  847.   
  848. ! __EXTERN time_t        dostime __PROTO((time_t));
  849.   __EXTERN time_t        _unixtime __PROTO((unsigned int, unsigned int));
  850.   
  851.   __EXTERN char *        findfile __PROTO((char *, char *, char **));
  852. --- 14,42 ----
  853.   /* filename mapping function type */
  854.   #ifndef __FNMAP
  855.   #define __FNMAP
  856. ! typedef int (*fnmapfunc_t) __PROTO((const char *, char *));
  857.   #endif
  858.   
  859.   __EXTERN int        _unx2dos __PROTO((const char *, char *));
  860.   __EXTERN int        _dos2unx __PROTO((const char *, char *));
  861. + #ifndef __MINT__
  862.   __EXTERN int        unx2dos __PROTO((const char *, char *));
  863.   __EXTERN int        dos2unx __PROTO((const char *, char *));
  864.   __EXTERN void        fnmapfunc __PROTO((fnmapfunc_t u2dos, fnmapfunc_t dos2u));
  865. ! #endif
  866.   
  867.   __EXTERN long        _write      __PROTO((int, const void *, unsigned long));
  868.   __EXTERN long        _read      __PROTO((int, void *, unsigned long));
  869. + #ifndef __MINT__
  870.   __EXTERN int        console_input_status __PROTO((int));
  871.   __EXTERN unsigned int    console_read_byte __PROTO((int));
  872.   __EXTERN void        console_write_byte __PROTO((int, int));
  873. + #else
  874. + __EXTERN int    _console_read_byte __PROTO((int));
  875. + __EXTERN void    _console_write_byte __PROTO((int, int));
  876. + #endif
  877.   
  878. ! __EXTERN time_t        _dostime __PROTO((time_t));
  879.   __EXTERN time_t        _unixtime __PROTO((unsigned int, unsigned int));
  880.   
  881.   __EXTERN char *        findfile __PROTO((char *, char *, char **));
  882. *** 1.8    1992/06/01 01:54:10
  883. --- lseek.c    1992/07/20 22:05:08
  884. ***************
  885. *** 7,18 ****
  886.   #include <unistd.h>
  887.   #include "lib.h"
  888.   
  889. - #ifdef __GNUC__
  890. - #  ifndef alloca
  891. - #    define alloca __builtin_alloca
  892. - #  endif
  893. - #endif
  894.   static long _real_lseek(h, where, how)
  895.   int h;
  896.   long where;
  897. --- 7,12 ----
  898. *** 1.12    1992/06/01 01:54:10
  899. --- qsort.c    1992/07/20 22:05:10
  900. ***************
  901. *** 19,31 ****
  902.   #  include <stdlib.h>
  903.   #endif
  904.   #include <string.h>
  905.   
  906.   #ifdef __GNUC__
  907.   #  ifdef minix
  908.        void *alloca(unsigned long);
  909.        typedef unsigned long size_t;
  910. - #  else
  911. - #    define alloca __builtin_alloca
  912.   #  endif
  913.   #  define INLINE inline
  914.   #else
  915. --- 19,30 ----
  916.   #  include <stdlib.h>
  917.   #endif
  918.   #include <string.h>
  919. + #include <memory.h>
  920.   
  921.   #ifdef __GNUC__
  922.   #  ifdef minix
  923.        void *alloca(unsigned long);
  924.        typedef unsigned long size_t;
  925.   #  endif
  926.   #  define INLINE inline
  927.   #else
  928. *** 1.17    1992/06/01 01:54:10
  929. --- system.c    1992/07/20 22:05:15
  930. ***************
  931. *** 167,173 ****
  932.   /* now actually run the program */
  933.   
  934.       if (*infile) {
  935. !         (void)unx2dos(infile,path);
  936.           infd = Fopen(path, 0);
  937.           if (infd < __SMALLEST_VALID_HANDLE) {
  938.               perror(infile);
  939. --- 167,173 ----
  940.   /* now actually run the program */
  941.   
  942.       if (*infile) {
  943. !         (void)_unx2dos(infile,path);
  944.           infd = Fopen(path, 0);
  945.           if (infd < __SMALLEST_VALID_HANDLE) {
  946.               perror(infile);
  947. ***************
  948. *** 177,183 ****
  949.           (void)Fforce(0, infd);
  950.       }
  951.       if (*outfile) {
  952. !         (void)unx2dos(outfile,path);
  953.           if (append) {
  954.               outfd = Fopen(path, 2);
  955.               if (outfd < __SMALLEST_VALID_HANDLE)
  956. --- 177,183 ----
  957.           (void)Fforce(0, infd);
  958.       }
  959.       if (*outfile) {
  960. !         (void)_unx2dos(outfile,path);
  961.           if (append) {
  962.               outfd = Fopen(path, 2);
  963.               if (outfd < __SMALLEST_VALID_HANDLE)
  964. *** 1.9    1992/06/01 01:54:10
  965. --- utime.c    1992/07/20 22:05:16
  966. ***************
  967. *** 51,57 ****
  968.       else
  969.           time(&settime);
  970.   
  971. !     (void)unx2dos(_filename, filename);
  972.       dtime = dostime(settime);    /* convert unix time to dos */
  973.       fh = Fopen(filename, 2);
  974.       if (fh < 0) {
  975. --- 51,57 ----
  976.       else
  977.           time(&settime);
  978.   
  979. !     (void)_unx2dos(_filename, filename);
  980.       dtime = dostime(settime);    /* convert unix time to dos */
  981.       fh = Fopen(filename, 2);
  982.       if (fh < 0) {
  983.