home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / jËzyki_programowania / ace_basic / ace / include / dos / dos.h < prev    next >
C/C++ Source or Header  |  1977-12-31  |  11KB  |  287 lines

  1. #ifndef DOS_DOS_H
  2. #define DOS_DOS_H 1
  3. /*
  4. ** dos.h for ACE Basic
  5. **
  6. ** Note: Translated to ACE by ConvertC2ACE
  7. **       @ MapMeadow Software, Nils Sjoholm
  8. **
  9. **
  10. ** Date: 09/02/95
  11. **
  12. **
  13. */
  14.  
  15. /*
  16. ** This are the StructPointer defines for dos.h
  17. */
  18. #ifndef DateStampPtr
  19. #define DateStampPtr ADDRESS
  20. #endif
  21. #ifndef FileInfoBlockPtr
  22. #define FileInfoBlockPtr ADDRESS
  23. #endif
  24. #ifndef InfoDataPtr
  25. #define InfoDataPtr ADDRESS
  26. #endif
  27. /*
  28. ** End of StructPointer defines for dos.h
  29. */
  30.        
  31. #ifndef EXEC_TYPES_H
  32. #include <exec/types.h>
  33. #endif
  34.  
  35.  
  36.  
  37. #define  DOSNAME  "dos.library"
  38.  
  39. /* Predefined Amiga DOS global constants */
  40.  
  41. #define DOSTRUE (-1&)
  42. #define DOSFALSE (0&)
  43.  
  44. /* Mode parameter to Open() */
  45. #define MODE_OLDFILE         1005   /* Open existing file read/write
  46.                      * positioned at beginning of file. */
  47. #define MODE_NEWFILE         1006   /* Open freshly created file (delete
  48.                      * old file) read/write,  exclusive lock. */
  49. #define MODE_READWRITE       1004   /* Open old file w/shared lock, 
  50.                      * creates file if doesn't exist. */
  51.  
  52. /* Relative position to Seek() */
  53. #define OFFSET_BEGINNING    -1      /* relative to Begining Of File */
  54. #define OFFSET_CURRENT       0      /* relative to Current file position */
  55. #define OFFSET_END       1      /* relative to End Of File    */
  56.  
  57. #define OFFSET_BEGINING     OFFSET_BEGINNING  /* ancient compatibility */
  58.  
  59. #define BITSPERBYTE      8
  60. #define BYTESPERLONG         4
  61. #define BITSPERLONG      32
  62. #define MAXINT           &H7FFFFFFF
  63. #define MININT           &H80000000
  64.  
  65. /* Passed as type to Lock() */
  66. #define SHARED_LOCK      -2     /* File is readable by others */
  67. #define ACCESS_READ      -2     /* Synonym */
  68. #define EXCLUSIVE_LOCK       -1     /* No other access allowed    */
  69. #define ACCESS_WRITE         -1     /* Synonym */
  70.  
  71. STRUCT DateStamp  
  72.    LONGINT  ds_Days          /* Number of days since Jan. 1,  1978 */
  73.    LONGINT  ds_Minute        /* Number of minutes past midnight */
  74.    LONGINT  ds_Tick          /* Number of ticks past minute */
  75. END STRUCT  /* DateStamp */
  76.  
  77. #define TICKS_PER_SECOND      50   /* Number of ticks in one second */
  78.  
  79. /* Returned by Examine() and ExNext(),  must be on a 4 byte boundary */
  80. STRUCT FileInfoBlock  
  81.    LONGINT   fib_DiskKey 
  82.    LONGINT   fib_DirEntryType   /* Type of Directory. If < 0,  then a plain file.
  83.                   * If > 0 a directory */
  84.    STRING fib_FileName SIZE 108   /* Null terminated. Max 30 chars used for now */
  85.    LONGINT   fib_Protection     /* bit mask of protection,  rwxd are 3-0.      */
  86.    LONGINT   fib_EntryType 
  87.    LONGINT   fib_Size       /* Number of bytes in file */
  88.    LONGINT   fib_NumBlocks      /* Number of blocks in file */
  89.    DateStamp fib_Date           /* Date file last changed */
  90.    STRING fib_Comment SIZE 80    /* Null terminated comment associated with file */
  91.  
  92.    /* Note: the following fields are not supported by all filesystems.  */
  93.    /* They should be initialized to 0 sending an ACTION_EXAMINE packet. */
  94.    /* When Examine() is called,  these are set to 0 for you.     */
  95.    /* AllocDosObject() also initializes them to 0.          */
  96.    SHORTINT  fib_OwnerUID      /* owner's UID */
  97.    SHORTINT  fib_OwnerGID      /* owner's GID */
  98.  
  99.    STRING fib_Reserved SIZE 32  
  100. END STRUCT  /* FileInfoBlock */
  101.  
  102. /* FIB stands for FileInfoBlock */
  103.  
  104. /* FIBB are bit definitions,  FIBF are field definitions */
  105. /* Regular RWED bits are 0 == allowed. */
  106. /* NOTE: GRP and OTR RWED permissions are 0 == not allowed! */
  107. /* Group and Other permissions are not directly handled by the filesystem */
  108. #define FIBB_OTR_READ      15   /* Other: file is readable */
  109. #define FIBB_OTR_WRITE     14   /* Other: file is writable */
  110. #define FIBB_OTR_EXECUTE   13   /* Other: file is executable */
  111. #define FIBB_OTR_DELETE    12   /* Other: prevent file from being deleted */
  112. #define FIBB_GRP_READ      11   /* Group: file is readable */
  113. #define FIBB_GRP_WRITE     10   /* Group: file is writable */
  114. #define FIBB_GRP_EXECUTE   9    /* Group: file is executable */
  115. #define FIBB_GRP_DELETE    8    /* Group: prevent file from being deleted */
  116.  
  117. #define FIBB_SCRIPT    6    /* program is a script (execute) file */
  118. #define FIBB_PURE      5    /* program is reentrant and rexecutable */
  119. #define FIBB_ARCHIVE   4    /* cleared whenever file is changed */
  120. #define FIBB_READ      3    /* ignored by old filesystem */
  121. #define FIBB_WRITE     2    /* ignored by old filesystem */
  122. #define FIBB_EXECUTE   1    /* ignored by system,  used by Shell */
  123. #define FIBB_DELETE    0    /* prevent file from being deleted */
  124.  
  125. #define FIBF_OTR_READ      (32768)
  126. #define FIBF_OTR_WRITE     (16384)
  127. #define FIBF_OTR_EXECUTE   (8192)
  128. #define FIBF_OTR_DELETE    (4096)
  129. #define FIBF_GRP_READ      (2048)
  130. #define FIBF_GRP_WRITE     (1024)
  131. #define FIBF_GRP_EXECUTE   (512)
  132. #define FIBF_GRP_DELETE    (256)
  133.  
  134. #define FIBF_SCRIPT    (64)
  135. #define FIBF_PURE      (32)
  136. #define FIBF_ARCHIVE   (16)
  137. #define FIBF_READ      (8)
  138. #define FIBF_WRITE     (4)
  139. #define FIBF_EXECUTE   (2)
  140. #define FIBF_DELETE    (1)
  141.  
  142. /* Standard maximum length for an error string from fault.  However,  most */
  143. /* error strings should be kept under 60 characters if possible.  Don't   */
  144. /* forget space for the header you pass in. */
  145. #define FAULT_MAX   82
  146.  
  147.  
  148. /* BCPL strings have a length in the first byte and then the characters.
  149.  * For example:  s[0]=3 s[1]=S s[2]=Y s[3]=S                 */
  150.  
  151. /* returned by Info(),  must be on a 4 byte boundary */
  152. STRUCT InfoData  
  153.    LONGINT   id_NumSoftErrors  /* number of soft errors on disk */
  154.    LONGINT   id_UnitNumber     /* Which unit disk is (was) mounted on */
  155.    LONGINT   id_DiskState      /* See defines below */
  156.    LONGINT   id_NumBlocks      /* Number of blocks on disk */
  157.    LONGINT   id_NumBlocksUsed  /* Number of block in use */
  158.    LONGINT   id_BytesPerBlock 
  159.    LONGINT   id_DiskType       /* Disk Type code */
  160.    ADDRESS   id_VolumeNode     /* BCPL pointer to volume node */
  161.    LONGINT   id_InUse      /* Flag,  zero if not in use */
  162. END STRUCT  /* InfoData */
  163.  
  164. /* ID stands for InfoData */
  165.     /* Disk states */
  166. #define ID_WRITE_PROTECTED 80    /* Disk is write protected */
  167. #define ID_VALIDATING      81    /* Disk is currently being validated */
  168. #define ID_VALIDATED       82    /* Disk is consistent and writeable */
  169.  
  170.     /* Disk types */
  171. /* ID_INTER_* use international case comparison routines for hashing */
  172. /* Any other new filesystems should also,  if possible. */
  173. #define ID_NO_DISK_PRESENT  (-1)
  174. #define ID_UNREADABLE_DISK  (&H42414400&)   /* 'BAD\0' */
  175. #define ID_DOS_DISK     (&H444F5300&)   /* 'DOS\0' */
  176. #define ID_FFS_DISK     (&H444F5301&)   /* 'DOS\1' */
  177. #define ID_INTER_DOS_DISK   (&H444F5302&)   /* 'DOS\2' */
  178. #define ID_INTER_FFS_DISK   (&H444F5303&)   /* 'DOS\3' */
  179. #define ID_FASTDIR_DOS_DISK (&H444F5304&)   /* 'DOS\4' */
  180. #define ID_FASTDIR_FFS_DISK (&H444F5305&)   /* 'DOS\5' */
  181. #define ID_NOT_REALLY_DOS   (&H4E444F53&)   /* 'NDOS'  */
  182. #define ID_KICKSTART_DISK   (&H4B49434B&)   /* 'KICK'  */
  183. #define ID_MSDOS_DISK       (&H4d534400&)   /* 'MSD\0' */
  184.  
  185. /* Errors from IoErr(),  etc. */
  186. #define ERROR_NO_FREE_STORE       103
  187. #define ERROR_TASK_TABLE_FULL         105
  188. #define ERROR_BAD_TEMPLATE        114
  189. #define ERROR_BAD_NUMBER          115
  190. #define ERROR_REQUIRED_ARG_MISSING    116
  191. #define ERROR_KEY_NEEDS_ARG       117
  192. #define ERROR_TOO_MANY_ARGS       118
  193. #define ERROR_UNMATCHED_QUOTES        119
  194. #define ERROR_LINE_TOO_LONG       120
  195. #define ERROR_FILE_NOT_OBJECT         121
  196. #define ERROR_INVALID_RESIDENT_LIBRARY    122
  197. #define ERROR_NO_DEFAULT_DIR          201
  198. #define ERROR_OBJECT_IN_USE       202
  199. #define ERROR_OBJECT_EXISTS       203
  200. #define ERROR_DIR_NOT_FOUND       204
  201. #define ERROR_OBJECT_NOT_FOUND        205
  202. #define ERROR_BAD_STREAM_NAME         206
  203. #define ERROR_OBJECT_TOO_LARGE        207
  204. #define ERROR_ACTION_NOT_KNOWN        209
  205. #define ERROR_INVALID_COMPONENT_NAME      210
  206. #define ERROR_INVALID_LOCK        211
  207. #define ERROR_OBJECT_WRONG_TYPE       212
  208. #define ERROR_DISK_NOT_VALIDATED      213
  209. #define ERROR_DISK_WRITE_PROTECTED    214
  210. #define ERROR_RENAME_ACROSS_DEVICES   215
  211. #define ERROR_DIRECTORY_NOT_EMPTY     216
  212. #define ERROR_TOO_MANY_LEVELS         217
  213. #define ERROR_DEVICE_NOT_MOUNTED      218
  214. #define ERROR_SEEK_ERROR          219
  215. #define ERROR_COMMENT_TOO_BIG         220
  216. #define ERROR_DISK_FULL           221
  217. #define ERROR_DELETE_PROTECTED        222
  218. #define ERROR_WRITE_PROTECTED         223
  219. #define ERROR_READ_PROTECTED          224
  220. #define ERROR_NOT_A_DOS_DISK          225
  221. #define ERROR_NO_DISK             226
  222. #define ERROR_NO_MORE_ENTRIES         232
  223. /* added for 1.4 */
  224. #define ERROR_IS_SOFT_LINK        233
  225. #define ERROR_OBJECT_LINKED       234
  226. #define ERROR_BAD_HUNK            235
  227. #define ERROR_NOT_IMPLEMENTED         236
  228. #define ERROR_RECORD_NOT_LOCKED       240
  229. #define ERROR_LOCK_COLLISION          241
  230. #define ERROR_LOCK_TIMEOUT        242
  231. #define ERROR_UNLOCK_ERROR        243
  232.  
  233. /* error codes 303-305 are defined in dosasl.h */
  234.  
  235. /* These are the return codes used by convention by AmigaDOS commands */
  236. /* See FAILAT and IF for relvance to EXECUTE files            */
  237. #define RETURN_OK               0  /* No problems,  success */
  238. #define RETURN_WARN             5  /* A warning only */
  239. #define RETURN_ERROR               10  /* Something wrong */
  240. #define RETURN_FAIL            20  /* Complete or severe failure*/
  241.  
  242. /* Bit numbers that signal you that a user has issued a break */
  243. #define SIGBREAKB_CTRL_C   12
  244. #define SIGBREAKB_CTRL_D   13
  245. #define SIGBREAKB_CTRL_E   14
  246. #define SIGBREAKB_CTRL_F   15
  247.  
  248. /* Bit fields that signal you that a user has issued a break */
  249. /* for example:  if (SetSignal(0, 0) & SIGBREAKF_CTRL_C) cleanup_and_exit()  */
  250. #define SIGBREAKF_CTRL_C   (4096)
  251. #define SIGBREAKF_CTRL_D   (8192)
  252. #define SIGBREAKF_CTRL_E   (16384)
  253. #define SIGBREAKF_CTRL_F   (32768)
  254.  
  255. /* Values returned by SameLock() */
  256. #define LOCK_DIFFERENT      -1
  257. #define LOCK_SAME       0
  258. #define LOCK_SAME_VOLUME    1   /* locks are on same volume */
  259. #define LOCK_SAME_HANDLER   LOCK_SAME_VOLUME
  260. /* LOCK_SAME_HANDLER was a misleading name,  def kept for src compatibility */
  261.  
  262. /* types for ChangeMode() */
  263. #define CHANGE_LOCK 0
  264. #define CHANGE_FH   1
  265.  
  266. /* Values for MakeLink() */
  267. #define LINK_HARD   0
  268. #define LINK_SOFT   1   /* softlinks are not fully supported yet */
  269.  
  270. /* values returned by ReadItem */
  271. #define ITEM_EQUAL  -2      /* "=" Symbol */
  272. #define ITEM_ERROR  -1      /* error */
  273. #define ITEM_NOTHING    0       /* *N,   ,  endstreamch */
  274. #define ITEM_UNQUOTED   1       /* unquoted item */
  275. #define ITEM_QUOTED 2       /* quoted item */
  276.  
  277. /* types for AllocDosObject/FreeDosObject */
  278. #define DOS_FILEHANDLE      0   /* few people should use this */
  279. #define DOS_EXALLCONTROL    1   /* Must be used to allocate this! */
  280. #define DOS_FIB         2   /* useful */
  281. #define DOS_STDPKT      3   /* for doing packet-level I/O */
  282. #define DOS_CLI         4   /* for shell-writers,  etc */
  283. #define DOS_RDARGS      5   /* for ReadArgs if you pass it in */
  284.  
  285. #endif  /* DOS_DOS_H */
  286.  
  287.