home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_progs
/
fileutil
/
diff.lzh
/
DIFF
/
AMIGA1.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-08-16
|
1KB
|
74 lines
/*
** Glue functions for the RCS system needed for the Amiga
*/
#include <stdio.h>
#include <errno.h>
#include <proto/exec.h>
#include <exec/tasks.h>
#include <ios1.h>
#include <dos.h>
#include <fcntl.h>
#include <exec/exec.h>
#include <libraries/dosextens.h>
#include "stat.h"
#include <stdarg.h>
umask(mode)
{
return mode;
}
/*
** This function is used in place of the lattice library function of
** the same name. It handles all modes, not just "rwed".
*/
chmod(name,mode)
char *name;
int mode;
{
long amigamode;
int success;
amigamode = mode;
success = SetProtection(name,amigamode);
if (success)
return(0);
errno = ENOENT;
return(-1);
}
int stat(name,buf)
char *name;
struct stat *buf;
{
long l;
struct FileInfoBlock *fp,*malloc();
if ((l=Lock(name, ACCESS_READ)) == 0)
return(-1);
fp = malloc(sizeof(struct FileInfoBlock));
Examine(l, fp);
buf->st_attr = fp->fib_Protection;
buf->st_size = fp->fib_Size;
buf->st_type = fp->fib_DirEntryType;
UnLock(l);
free(fp);
buf->st_mtime = getft(name);
return 0;
}
isatty(fd)
int fd;
{
long IsInteractive();
struct UFB *ufb;
ufb = chkufb(fd);
if (ufb == NULL)
return(-1);
return(IsInteractive(ufb->ufbfh) != 0);
}