home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff281.lzh / Diff / amiga1.c < prev    next >
C/C++ Source or Header  |  1989-11-20  |  1KB  |  74 lines

  1. /*
  2. **  Glue functions for the RCS system needed for the Amiga
  3. */
  4.  
  5. #include <stdio.h>
  6. #include <errno.h>
  7. #include <proto/exec.h>
  8. #include <exec/tasks.h>
  9. #include <ios1.h>
  10. #include <dos.h>
  11. #include <fcntl.h>
  12. #include <exec/exec.h>
  13. #include <libraries/dosextens.h>
  14. #include "stat.h"
  15. #include <stdarg.h>
  16.  
  17.  
  18.  
  19. umask(mode)
  20. {
  21.     return mode;
  22. }
  23.  
  24. /*
  25. ** This function is used in place of the lattice library function of
  26. ** the same name.  It handles all modes, not just "rwed".
  27. */
  28. chmod(name,mode)
  29. char    *name;
  30. int    mode;
  31. {
  32.     long    amigamode;
  33.     int    success;
  34.  
  35.     amigamode = mode;
  36.     success = SetProtection(name,amigamode);
  37.     if (success)
  38.         return(0);
  39.     errno = ENOENT;
  40.     return(-1);
  41. }
  42.  
  43. int stat(name,buf)
  44. char    *name;
  45. struct stat *buf;
  46. {
  47.     long l;
  48.     struct FileInfoBlock *fp,*malloc();
  49.  
  50.     if ((l=Lock(name, ACCESS_READ)) == 0)
  51.         return(-1);
  52.     fp = malloc(sizeof(struct FileInfoBlock));
  53.     Examine(l, fp);
  54.     buf->st_attr = fp->fib_Protection;
  55.     buf->st_size = fp->fib_Size;
  56.     buf->st_type = fp->fib_DirEntryType;
  57.     UnLock(l);
  58.     free(fp);
  59.     buf->st_mtime = getft(name);
  60.     return 0;
  61. }
  62.  
  63. isatty(fd)
  64. int        fd;
  65. {
  66.     long IsInteractive();
  67.     struct UFB    *ufb;
  68.  
  69.     ufb = chkufb(fd);
  70.     if (ufb == NULL)
  71.         return(-1);
  72.     return(IsInteractive(ufb->ufbfh) != 0);
  73. }
  74.