| 1 |
/* |
| 2 |
Copyright (c) 1990-1999 Info-ZIP. All rights reserved. |
| 3 |
|
| 4 |
See the accompanying file LICENSE, version 1999-Oct-05 or later |
| 5 |
(the contents of which are also included in zip.h) for terms of use. |
| 6 |
If, for some reason, both of these files are missing, the Info-ZIP license |
| 7 |
also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html |
| 8 |
*/ |
| 9 |
/* |
| 10 |
* Directory Operations for Mac based on BSD 4.3 <macdir.h> |
| 11 |
* By Jason Linhart, January 1997 |
| 12 |
*/ |
| 13 |
|
| 14 |
#ifndef _UNIXLIKE_H |
| 15 |
#define _UNIXLIKE_H 1 |
| 16 |
|
| 17 |
#include <stat.h> |
| 18 |
|
| 19 |
#ifndef NAME_MAX |
| 20 |
#define NAME_MAX 2048 |
| 21 |
#endif |
| 22 |
|
| 23 |
#define UNX_IFMT 0170000 /* Unix file type mask */ |
| 24 |
#define UNX_IFSOCK 0140000 /* Unix socket (BSD, not SysV or Amiga) */ |
| 25 |
#define UNX_IFLNK 0120000 /* Unix symbolic link (not SysV, Amiga) */ |
| 26 |
#define UNX_IFREG 0100000 /* Unix regular file */ |
| 27 |
#define UNX_IFBLK 0060000 /* Unix block special (not Amiga) */ |
| 28 |
#define UNX_IFDIR 0040000 /* Unix directory */ |
| 29 |
#define UNX_IFCHR 0020000 /* Unix character special (not Amiga) */ |
| 30 |
#define UNX_IFIFO 0010000 /* Unix fifo (BCC, not MSC or Amiga) */ |
| 31 |
|
| 32 |
#define UNX_ISUID 04000 /* Unix set user id on execution */ |
| 33 |
#define UNX_ISGID 02000 /* Unix set group id on execution */ |
| 34 |
#define UNX_ISVTX 01000 /* Unix directory permissions control */ |
| 35 |
#define UNX_ENFMT UNX_ISGID /* Unix record locking enforcement flag */ |
| 36 |
|
| 37 |
#define UNX_IRWXU 00700 /* Unix read, write, execute: owner */ |
| 38 |
#define UNX_IRUSR 00400 /* Unix read permission: owner */ |
| 39 |
#define UNX_IWUSR 00200 /* Unix write permission: owner */ |
| 40 |
#define UNX_IXUSR 00100 /* Unix execute permission: owner */ |
| 41 |
|
| 42 |
#define UNX_IRWXG 00070 /* Unix read, write, execute: group */ |
| 43 |
#define UNX_IRGRP 00040 /* Unix read permission: group */ |
| 44 |
#define UNX_IWGRP 00020 /* Unix write permission: group */ |
| 45 |
#define UNX_IXGRP 00010 /* Unix execute permission: group */ |
| 46 |
|
| 47 |
#define UNX_IRWXO 00007 /* Unix read, write, execute: other */ |
| 48 |
#define UNX_IROTH 00004 /* Unix read permission: other */ |
| 49 |
#define UNX_IWOTH 00002 /* Unix write permission: other */ |
| 50 |
#define UNX_IXOTH 00001 /* Unix execute permission: other */ |
| 51 |
|
| 52 |
/* historical file modes */ |
| 53 |
#define S_IREAD 0x100 |
| 54 |
#define S_IWRITE 0x80 |
| 55 |
#define S_IEXEC 0x40 |
| 56 |
|
| 57 |
|
| 58 |
#define isatty(arg) 1 |
| 59 |
|
| 60 |
|
| 61 |
#define EINVAL 22 /* Invalid argument */ |
| 62 |
#define ENAMETOOLONG 63 /* File name too long */ |
| 63 |
|
| 64 |
|
| 65 |
struct dirent { |
| 66 |
char d_name[NAME_MAX]; |
| 67 |
}; |
| 68 |
|
| 69 |
/* |
| 70 |
* The following definitions are usually found in fcntl.h. |
| 71 |
* However, MetroWerks has screwed that file up a couple of times |
| 72 |
* and all we need are the defines. |
| 73 |
*/ |
| 74 |
#define O_APPEND 0x0100 /* open the file in append mode */ |
| 75 |
#define O_CREAT 0x0200 /* create the file if it doesn't exist */ |
| 76 |
#define O_EXCL 0x0400 /* if the file exists don't create it again */ |
| 77 |
#define O_TRUNC 0x0800 /* truncate the file after opening it */ |
| 78 |
|
| 79 |
|
| 80 |
int Zmacstat (const char *path, struct stat *buf); |
| 81 |
int chmod(char *path, int mode); |
| 82 |
|
| 83 |
|
| 84 |
#include "macstuff.h" |
| 85 |
|
| 86 |
#endif /* _UNIXLIKE_H */ |