Ignore:
Timestamp:
Oct 7, 2007, 5:40:04 PM (18 years ago)
Author:
bird
Message:

some more.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/shfile.h

    r1199 r1206  
    2929
    3030#include "shtypes.h"
     31#include <fcntl.h>
     32#include <sys/stat.h>
     33#ifndef _MSC_VER
     34# include <sys/fcntl.h>
     35# include <unistd.h>
     36# ifndef O_BINARY
     37#  define O_BINARY  0
     38# endif
     39# ifndef O_TEXT
     40#  define O_TEXT    0
     41# endif
     42
     43#else
     44# include <io.h>
     45# include <direct.h>
     46
     47# define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
     48# define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
     49# define S_ISLNK(m) 0
     50# define S_IRWXU    (_S_IREAD | _S_IWRITE | _S_IEXEC)
     51# define S_IXUSR    _S_IEXEC
     52# define S_IWUSR    _S_IWRITE
     53# define S_IRUSR    _S_IREAD
     54# define S_IRWXG    0000070
     55# define S_IRGRP    0000040
     56# define S_IWGRP    0000020
     57# define S_IXGRP    0000010
     58# define S_IRWXO    0000007
     59# define S_IROTH    0000004
     60# define S_IWOTH    0000002
     61# define S_IXOTH    0000001
     62# define S_ISUID    0004000
     63# define S_ISGID    0002000
     64# define ALLPERMS   0000777
     65
     66# define F_DUPFD    0
     67# define F_GETFD    1
     68# define F_SETFD    2
     69# define F_GETFL    3
     70# define F_SETFL    4
     71# define FD_CLOEXEC 1
     72
     73# define F_OK       0
     74# define X_OK       1
     75# define W_OK       2
     76# define R_OK       4
     77
     78#endif
     79
    3180
    3281/**
     
    51100} shfdtab;
    52101
    53 
    54102int shfile_open(shfdtab *, const char *, unsigned);
    55103int shfile_pipe(shfdtab *, int [2]);
     
    59107long shfile_lseek(shfdtab *, int, long, int);
    60108int shfile_fcntl(shfdtab *, int fd, int cmd, int arg);
    61 #ifdef _MSC_VER
    62 # define F_DUPFD    0
    63 # define F_GETFD    1
    64 # define F_SETFD    2
    65 # define F_GETFL    3
    66 # define F_SETFL    4
    67 # define FD_CLOEXEC 1
    68 #else
    69 # include <sys/fcntl.h>
    70 #endif
    71109
    72110int shfile_stat(shfdtab *, const char *, struct stat *);
     
    75113char *shfile_getcwd(shfdtab *, char *, int);
    76114int shfile_isatty(shfdtab *, int);
    77 /*int shfile_ioctl(shfdtab *, int, unsigned long, char *);*/
     115int shfile_ioctl(shfdtab *, int, unsigned long, char *);
     116int shfile_access(shfdtab *, const char *, int);
    78117
    79118#endif
Note: See TracChangeset for help on using the changeset viewer.