home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / STORM2.DMS / in.adf / Includes.LHA / dos.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-24  |  4.7 KB  |  161 lines

  1. /* Copyright (c) 1995 HAAGE & PARTNER GmbH */
  2. /* All Rights Reserved */
  3.  
  4.  
  5. #ifndef _DOS_H
  6. #define _DOS_H 1
  7.  
  8. #ifndef EXEC_TYPES_H
  9. #include <exec/types.h>
  10. #endif
  11.  
  12. #ifndef EXEC_PORTS_H
  13. #include <exec/ports.h>
  14. #endif
  15.  
  16. #ifndef EXEC_LISTS_H
  17. #include <exec/lists.h>
  18. #endif
  19.  
  20. #ifndef LIBRARIES_DOS_H
  21. #include <libraries/dos.h>
  22. #endif
  23.  
  24. #ifndef LIBRARIES_DOSEXTENS_H
  25. #include <libraries/dosextens.h>
  26. #endif
  27.  
  28. typedef unsigned char byte;
  29.  
  30.  
  31. #define SECSIZ 512        /* disk sector size */
  32.  
  33.  
  34. #define FNSIZE 108    /* maximum file node size      - DOS limit */
  35. #define FMSIZE 256    /* maximum file name size      - DOS limit */
  36. #define FESIZE 32    /* maximum file extension size - arbitrary */
  37.  
  38.  
  39. struct MELT {
  40.     struct MELT *fwd;            /* points to next free block */
  41.     long size;                /* number of MELTs in this block */
  42. };
  43.  
  44. #define MELTSIZE sizeof(struct MELT)
  45.  
  46.  
  47. struct MELT2 {
  48.     struct MELT2 *fwd;            /* points to next block */
  49.     struct MELT2 *bwd;            /* points to previous block */
  50.     unsigned long size;            /* size of this block */
  51. };
  52.  
  53. #define MELT2SIZE sizeof(struct MELT2)
  54.  
  55.  
  56. struct ProcID {                /* packet returned from fork()  */
  57.     struct ProcID *nextID;        /* link to next packet        */
  58.     struct Message *process;            /* startup message to child     */
  59.     int UserPortFlag;
  60.     struct MsgPort *parent;        /* termination msg destination    */
  61.     struct MsgPort *child;        /* child process' task msg port    */
  62.     BPTR seglist;            /* child process' segment list    */
  63. };
  64.  
  65. struct FORKENV {
  66.     long priority;            /* new process priority        */
  67.     long stack;                    /* stack size for new process    */
  68.     BPTR std_in;            /* stdin for new process    */
  69.     BPTR std_out;            /* stdout for new process    */
  70.     BPTR console;            /* console window for new process */
  71.     struct MsgPort *msgport;            /* msg port to receive termination */
  72. };                      /* message from child        */
  73.  
  74. struct TermMsg {            /* termination message from child */
  75.     struct Message msg;
  76.     long _class;                    /* class == 0            */
  77.     short type;                    /* message type == 0        */
  78.     struct Process *process;            /* process ID of sending task    */
  79.     long ret;                    /* return value            */
  80. };
  81.  
  82.  
  83. extern int forkl(char *, char *, ...);
  84. extern int forkv(char *, char **, struct FORKENV *, struct ProcID *);
  85. extern int wait(struct ProcID *);
  86. extern struct ProcID *waitm(struct ProcID **);
  87.  
  88. extern int dfind(struct FileInfoBlock *, const char *, int);
  89. extern int dnext(struct FileInfoBlock *);
  90.  
  91. extern int           _dclose(long);
  92. extern long          _dcreat(const char *, int);
  93. extern long          _dcreatx(const char *, int);
  94. extern long          _dopen(const char *, int);
  95. extern unsigned int  _dread(long, char *, unsigned int);
  96. extern long          _dseek(long, long, int);
  97. extern unsigned int  _dwrite(long, char *, unsigned int);
  98.  
  99. extern int getcd(int, char *);
  100. extern int chdir(const char *);
  101. extern char *getcwd(char *, int);
  102. extern int mkdir(const char *);
  103. extern int rmdir(const char *);
  104.  
  105. extern int getfnl(const char *, char *, size_t, int);
  106. extern int getdfs(const char *, struct InfoData *);
  107. extern int getfa(const char *);
  108. extern long getft(const char *);
  109.  
  110. extern int getpath(BPTR, char *);
  111. extern BPTR findpath(const char *);
  112.  
  113. extern long _BackGroundIO;   /* Declare and init to 1 to get stdout */
  114.                              /* in a cback program                  */
  115. extern BPTR _Backstdout;     /* Points to stdout in a cback program */
  116.                              /* If _BackGroundIO was set.  You are  */
  117.                              /* responsible for closing this!       */
  118. extern long __priority;      /* Default priority of cback programs  */
  119. extern char *__procname;     /* Default process name for cback progs*/                             
  120. #ifdef _M68881
  121. extern char __near __stdiowin[];  /* stdio window specification */
  122. #else
  123. extern char __stdiowin[];    /* stdio window specification */
  124. #endif
  125. extern char __stdiov37[];    /* Modifiers for stdio window, V37+ */
  126. extern long __oslibversion;  /* Minimum OS version for autoopen libs */
  127. extern long __stack;         /* Minimum stack size for program */
  128. extern long __STKNEED;       /* Minimum stack size for function */
  129.  
  130. extern int datecmp(const struct DateStamp *, const struct DateStamp *);
  131. extern int chgclk(const unsigned char *);
  132. extern void getclk(unsigned char *);
  133. extern int onbreak(int (*)(void));
  134. extern int poserr(const char *);
  135.  
  136. #define REG_D0 0
  137. #define REG_D1 1
  138. #define REG_D2 2
  139. #define REG_D3 3
  140. #define REG_D4 4
  141. #define REG_D5 5
  142. #define REG_D6 6
  143. #define REG_D7 7
  144. #define REG_A0 8
  145. #define REG_A1 9
  146. #define REG_A2 10
  147. #define REG_A3 11
  148. #define REG_A4 12
  149. #define REG_A5 13
  150. #define REG_A6 14
  151. #define REG_A7 15
  152. #define REG_FP0 16
  153. #define REG_FP1 17
  154. #define REG_FP2 18
  155. #define REG_FP3 19
  156. #define REG_FP4 20
  157. #define REG_FP5 21
  158. #define REG_FP6 22
  159. #define REG_FP7 23
  160. #endif
  161.