home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip52.zip / acorn / riscos.h < prev    next >
C/C++ Source or Header  |  1996-01-06  |  3KB  |  119 lines

  1. /* riscos.h */
  2.  
  3. #ifndef __riscos_h
  4. #define __riscos_h
  5.  
  6. #include <time.h>
  7.  
  8. typedef struct {
  9.   int errnum;
  10.   char errmess[252];
  11. } os_error;
  12.  
  13. #ifndef __swiven_h
  14. #  include "swiven.h"
  15. #endif
  16.  
  17. #define MAXPATHLEN 256
  18. #define MAXFILENAMELEN 64  /* should be 11 for ADFS, 13 for DOS, 64 seems a sensible value... */
  19. #define DIR_BUFSIZE 1024   /* this should be enough to read a whole E-Format directory */
  20.  
  21. struct stat {
  22.   unsigned int st_dev;
  23.   int st_ino;
  24.   unsigned int st_mode;
  25.   int st_nlink;
  26.   unsigned short st_uid;
  27.   unsigned short st_gid;
  28.   unsigned int st_rdev;
  29.   unsigned int st_size;
  30.   unsigned int st_blksize;
  31.   time_t st_atime;
  32.   time_t st_mtime;
  33.   time_t st_ctime;
  34. };
  35.  
  36. typedef struct {
  37.   char *dirname;
  38.   void *buf;
  39.   int size;
  40.   char *act;
  41.   int offset;
  42.   int read;
  43. } DIR;
  44.  
  45.  
  46. struct dirent {
  47.   unsigned int d_off;          /* offset of next disk directory entry */
  48.   int d_fileno;                /* file number of entry */
  49.   size_t d_reclen;             /* length of this record */
  50.   size_t d_namlen;             /* length of d_name */
  51.   char d_name[MAXFILENAMELEN]; /* name */
  52. };
  53.  
  54. typedef struct {
  55.   int load_addr;
  56.   int exec_addr;
  57.   int lenght;
  58.   int attrib;
  59.   int objtype;
  60.   char name[13];
  61. } riscos_direntry;
  62.  
  63. #define SPARKID   0x4341        /* = "AC" */
  64. #define SPARKID_2 0x30435241    /* = "ARC0" */
  65.  
  66. typedef struct {
  67.   short ID;
  68.   short size;
  69.   int   ID_2;
  70.   int   loadaddr;
  71.   int   execaddr;
  72.   int   attr;
  73.   int   zero;
  74. } extra_block;
  75.  
  76.  
  77. #define S_IFMT 0770000
  78.  
  79. #define S_IFDIR 0040000
  80. #define S_IFREG 0100000  /* 0200000 in UnixLib !?!?!?!? */
  81.  
  82. #ifndef S_IEXEC
  83. #  define S_IEXEC  0000100
  84. #  define S_IWRITE 0000200
  85. #  define S_IREAD  0000400
  86. #endif
  87.  
  88. #ifndef NO_UNZIPH_STUFF
  89. #  include <time.h>
  90. #  define DATE_FORMAT DF_DMY
  91. #  define lenEOL 1
  92. #  define PutNativeEOL  *q++ = native(LF);
  93. #  define USE_STRM_INPUT
  94. #  define USE_FWRITE
  95. #  define PIPE_ERROR (errno == 9999)    /* always false */
  96. #  define isatty(x) (TRUE)   /* used in funzip.c to find if stdin redirected:
  97.      should find a better way, now just work as if stdin never redirected */
  98. #endif /* !NO_UNZIPH_STUFF */
  99.  
  100. #define _raw_getc() SWI_OS_ReadC()
  101.  
  102. extern char *exts2swap; /* Extesions to swap */
  103.  
  104. int stat(char *filename,struct stat *res);
  105. DIR *opendir(char *dirname);
  106. struct dirent *readdir(DIR *d);
  107. void closedir(DIR *d);
  108. int unlink(char *f);
  109. int rmdir(char *d);
  110. int chmod(char *file, int mode);
  111. void setfiletype(char *fname,int ftype);
  112. void getRISCOSexts(char *envstr);
  113. int checkext(char *suff);
  114. void swapext(char *name, char *exptr);
  115. void remove_prefix(void);
  116. void set_prefix(void);
  117.  
  118. #endif
  119.