unixlike.h 3.1 KB

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