home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / at-inc-bin.lha / os-include / clib / dos_protos.h < prev    next >
C/C++ Source or Header  |  1993-10-15  |  10KB  |  246 lines

  1. #ifndef  CLIB_DOS_PROTOS_H
  2. #define  CLIB_DOS_PROTOS_H
  3.  
  4. /*
  5. **    $VER: dos_protos.h 36.31 (17.12.92)
  6. **    Includes Release 40.15
  7. **
  8. **    C prototypes. For use with 32 bit integers only.
  9. **
  10. **    (C) Copyright 1990-1993 Commodore-Amiga, Inc.
  11. **        All Rights Reserved
  12. */
  13.  
  14. #ifndef  DOS_DOS_H
  15. #include <dos/dos.h>
  16. #endif
  17. #ifndef  DOS_DOSEXTENS_H
  18. #include <dos/dosextens.h>
  19. #endif
  20. #ifndef  DOS_RECORD_H
  21. #include <dos/record.h>
  22. #endif
  23. #ifndef  DOS_RDARGS_H
  24. #include <dos/rdargs.h>
  25. #endif
  26. #ifndef  DOS_DOSASL_H
  27. #include <dos/dosasl.h>
  28. #endif
  29. #ifndef  DOS_VAR_H
  30. #include <dos/var.h>
  31. #endif
  32. #ifndef  DOS_NOTIFY_H
  33. #include <dos/notify.h>
  34. #endif
  35. #ifndef  DOS_DATETIME_H
  36. #include <dos/datetime.h>
  37. #endif
  38. BPTR Open( STRPTR name, long accessMode );
  39. LONG Close( BPTR file );
  40. LONG Read( BPTR file, APTR buffer, long length );
  41. LONG Write( BPTR file, APTR buffer, long length );
  42. BPTR Input( void );
  43. BPTR Output( void );
  44. LONG Seek( BPTR file, long position, long offset );
  45. LONG DeleteFile( STRPTR name );
  46. LONG Rename( STRPTR oldName, STRPTR newName );
  47. BPTR Lock( STRPTR name, long type );
  48. void UnLock( BPTR lock );
  49. BPTR DupLock( BPTR lock );
  50. LONG Examine( BPTR lock, struct FileInfoBlock *fileInfoBlock );
  51. LONG ExNext( BPTR lock, struct FileInfoBlock *fileInfoBlock );
  52. LONG Info( BPTR lock, struct InfoData *parameterBlock );
  53. BPTR CreateDir( STRPTR name );
  54. BPTR CurrentDir( BPTR lock );
  55. LONG IoErr( void );
  56. struct MsgPort *CreateProc( STRPTR name, long pri, BPTR segList,
  57.     long stackSize );
  58. void Exit( long returnCode );
  59. BPTR LoadSeg( STRPTR name );
  60. void UnLoadSeg( BPTR seglist );
  61. struct MsgPort *DeviceProc( STRPTR name );
  62. LONG SetComment( STRPTR name, STRPTR comment );
  63. LONG SetProtection( STRPTR name, long protect );
  64. struct DateStamp *DateStamp( struct DateStamp *date );
  65. void Delay( long timeout );
  66. LONG WaitForChar( BPTR file, long timeout );
  67. BPTR ParentDir( BPTR lock );
  68. LONG IsInteractive( BPTR file );
  69. LONG Execute( STRPTR string, BPTR file, BPTR file2 );
  70. /*--- functions in V36 or higher (Release 2.0) ---*/
  71. /*    DOS Object creation/deletion */
  72. APTR AllocDosObject( unsigned long type, struct TagItem *tags );
  73. APTR AllocDosObjectTagList( unsigned long type, struct TagItem *tags );
  74. APTR AllocDosObjectTags( unsigned long type, unsigned long tag1type, ... );
  75. void FreeDosObject( unsigned long type, APTR ptr );
  76. /*    Packet Level routines */
  77. LONG DoPkt( struct MsgPort *port, long action, long arg1, long arg2, long arg3,
  78.     long arg4, long arg5 );
  79. LONG DoPkt0( struct MsgPort *port, long action );
  80. LONG DoPkt1( struct MsgPort *port, long action, long arg1 );
  81. LONG DoPkt2( struct MsgPort *port, long action, long arg1, long arg2 );
  82. LONG DoPkt3( struct MsgPort *port, long action, long arg1, long arg2,
  83.     long arg3 );
  84. LONG DoPkt4( struct MsgPort *port, long action, long arg1, long arg2,
  85.     long arg3, long arg4 );
  86. void SendPkt( struct DosPacket *dp, struct MsgPort *port,
  87.     struct MsgPort *replyport );
  88. struct DosPacket *WaitPkt( void );
  89. void ReplyPkt( struct DosPacket *dp, long res1, long res2 );
  90. void AbortPkt( struct MsgPort *port, struct DosPacket *pkt );
  91. /*    Record Locking */
  92. BOOL LockRecord( BPTR fh, unsigned long offset, unsigned long length,
  93.     unsigned long mode, unsigned long timeout );
  94. BOOL LockRecords( struct RecordLock *recArray, unsigned long timeout );
  95. BOOL UnLockRecord( BPTR fh, unsigned long offset, unsigned long length );
  96. BOOL UnLockRecords( struct RecordLock *recArray );
  97. /*    Buffered File I/O */
  98. BPTR SelectInput( BPTR fh );
  99. BPTR SelectOutput( BPTR fh );
  100. LONG FGetC( BPTR fh );
  101. LONG FPutC( BPTR fh, long ch );
  102. LONG UnGetC( BPTR fh, long character );
  103. LONG FRead( BPTR fh, APTR block, unsigned long blocklen,
  104.     unsigned long number );
  105. LONG FWrite( BPTR fh, APTR block, unsigned long blocklen,
  106.     unsigned long number );
  107. STRPTR FGets( BPTR fh, STRPTR buf, unsigned long buflen );
  108. LONG FPuts( BPTR fh, STRPTR str );
  109. void VFWritef( BPTR fh, STRPTR format, LONG *argarray );
  110. void FWritef( BPTR fh, STRPTR format, ... );
  111. LONG VFPrintf( BPTR fh, STRPTR format, APTR argarray );
  112. LONG FPrintf( BPTR fh, STRPTR format, ... );
  113. LONG Flush( BPTR fh );
  114. LONG SetVBuf( BPTR fh, STRPTR buff, long type, long size );
  115. /*    DOS Object Management */
  116. BPTR DupLockFromFH( BPTR fh );
  117. BPTR OpenFromLock( BPTR lock );
  118. BPTR ParentOfFH( BPTR fh );
  119. BOOL ExamineFH( BPTR fh, struct FileInfoBlock *fib );
  120. LONG SetFileDate( STRPTR name, struct DateStamp *date );
  121. LONG NameFromLock( BPTR lock, STRPTR buffer, long len );
  122. LONG NameFromFH( BPTR fh, STRPTR buffer, long len );
  123. WORD SplitName( STRPTR name, unsigned long seperator, STRPTR buf, long oldpos,
  124.     long size );
  125. LONG SameLock( BPTR lock1, BPTR lock2 );
  126. LONG SetMode( BPTR fh, long mode );
  127. LONG ExAll( BPTR lock, struct ExAllData *buffer, long size, long data,
  128.     struct ExAllControl *control );
  129. LONG ReadLink( struct MsgPort *port, BPTR lock, STRPTR path, STRPTR buffer,
  130.     unsigned long size );
  131. LONG MakeLink( STRPTR name, long dest, long soft );
  132. LONG ChangeMode( long type, BPTR fh, long newmode );
  133. LONG SetFileSize( BPTR fh, long pos, long mode );
  134. /*    Error Handling */
  135. LONG SetIoErr( long result );
  136. BOOL Fault( long code, STRPTR header, STRPTR buffer, long len );
  137. BOOL PrintFault( long code, STRPTR header );
  138. LONG ErrorReport( long code, long type, unsigned long arg1,
  139.     struct MsgPort *device );
  140. /*    Process Management */
  141. struct CommandLineInterface *Cli( void );
  142. struct Process *CreateNewProc( struct TagItem *tags );
  143. struct Process *CreateNewProcTagList( struct TagItem *tags );
  144. struct Process *CreateNewProcTags( unsigned long tag1type, ... );
  145. LONG RunCommand( BPTR seg, long stack, STRPTR paramptr, long paramlen );
  146. struct MsgPort *GetConsoleTask( void );
  147. struct MsgPort *SetConsoleTask( struct MsgPort *task );
  148. struct MsgPort *GetFileSysTask( void );
  149. struct MsgPort *SetFileSysTask( struct MsgPort *task );
  150. STRPTR GetArgStr( void );
  151. BOOL SetArgStr( STRPTR string );
  152. struct Process *FindCliProc( unsigned long num );
  153. ULONG MaxCli( void );
  154. BOOL SetCurrentDirName( STRPTR name );
  155. BOOL GetCurrentDirName( STRPTR buf, long len );
  156. BOOL SetProgramName( STRPTR name );
  157. BOOL GetProgramName( STRPTR buf, long len );
  158. BOOL SetPrompt( STRPTR name );
  159. BOOL GetPrompt( STRPTR buf, long len );
  160. BPTR SetProgramDir( BPTR lock );
  161. BPTR GetProgramDir( void );
  162. /*    Device List Management */
  163. LONG SystemTagList( STRPTR command, struct TagItem *tags );
  164. LONG System( STRPTR command, struct TagItem *tags );
  165. LONG SystemTags( STRPTR command, unsigned long tag1type, ... );
  166. LONG AssignLock( STRPTR name, BPTR lock );
  167. BOOL AssignLate( STRPTR name, STRPTR path );
  168. BOOL AssignPath( STRPTR name, STRPTR path );
  169. BOOL AssignAdd( STRPTR name, BPTR lock );
  170. LONG RemAssignList( STRPTR name, BPTR lock );
  171. struct DevProc *GetDeviceProc( STRPTR name, struct DevProc *dp );
  172. void FreeDeviceProc( struct DevProc *dp );
  173. struct DosList *LockDosList( unsigned long flags );
  174. void UnLockDosList( unsigned long flags );
  175. struct DosList *AttemptLockDosList( unsigned long flags );
  176. BOOL RemDosEntry( struct DosList *dlist );
  177. LONG AddDosEntry( struct DosList *dlist );
  178. struct DosList *FindDosEntry( struct DosList *dlist, STRPTR name,
  179.     unsigned long flags );
  180. struct DosList *NextDosEntry( struct DosList *dlist, unsigned long flags );
  181. struct DosList *MakeDosEntry( STRPTR name, long type );
  182. void FreeDosEntry( struct DosList *dlist );
  183. BOOL IsFileSystem( STRPTR name );
  184. /*    Handler Interface */
  185. BOOL Format( STRPTR filesystem, STRPTR volumename, unsigned long dostype );
  186. LONG Relabel( STRPTR drive, STRPTR newname );
  187. LONG Inhibit( STRPTR name, long onoff );
  188. LONG AddBuffers( STRPTR name, long number );
  189. /*    Date, Time Routines */
  190. LONG CompareDates( struct DateStamp *date1, struct DateStamp *date2 );
  191. LONG DateToStr( struct DateTime *datetime );
  192. LONG StrToDate( struct DateTime *datetime );
  193. /*    Image Management */
  194. BPTR InternalLoadSeg( BPTR fh, BPTR table, LONG *funcarray, LONG *stack );
  195. BOOL InternalUnLoadSeg( BPTR seglist, void (*freefunc)() );
  196. BPTR NewLoadSeg( STRPTR file, struct TagItem *tags );
  197. BPTR NewLoadSegTagList( STRPTR file, struct TagItem *tags );
  198. BPTR NewLoadSegTags( STRPTR file, unsigned long tag1type, ... );
  199. LONG AddSegment( STRPTR name, BPTR seg, long system );
  200. struct Segment *FindSegment( STRPTR name, struct Segment *seg, long system );
  201. LONG RemSegment( struct Segment *seg );
  202. /*    Command Support */
  203. LONG CheckSignal( long mask );
  204. struct RDArgs *ReadArgs( STRPTR arg_template, LONG *array,
  205.     struct RDArgs *args );
  206. LONG FindArg( STRPTR keyword, STRPTR arg_template );
  207. LONG ReadItem( STRPTR name, long maxchars, struct CSource *cSource );
  208. LONG StrToLong( STRPTR string, LONG *value );
  209. LONG MatchFirst( STRPTR pat, struct AnchorPath *anchor );
  210. LONG MatchNext( struct AnchorPath *anchor );
  211. void MatchEnd( struct AnchorPath *anchor );
  212. LONG ParsePattern( STRPTR pat, STRPTR buf, long buflen );
  213. BOOL MatchPattern( STRPTR pat, STRPTR str );
  214. void FreeArgs( struct RDArgs *args );
  215. STRPTR FilePart( STRPTR path );
  216. STRPTR PathPart( STRPTR path );
  217. BOOL AddPart( STRPTR dirname, STRPTR filename, unsigned long size );
  218. /*    Notification */
  219. BOOL StartNotify( struct NotifyRequest *notify );
  220. void EndNotify( struct NotifyRequest *notify );
  221. /*    Environment Variable functions */
  222. BOOL SetVar( STRPTR name, STRPTR buffer, long size, long flags );
  223. LONG GetVar( STRPTR name, STRPTR buffer, long size, long flags );
  224. LONG DeleteVar( STRPTR name, unsigned long flags );
  225. struct LocalVar *FindVar( STRPTR name, unsigned long type );
  226. LONG CliInitNewcli( struct DosPacket *dp );
  227. LONG CliInitRun( struct DosPacket *dp );
  228. LONG WriteChars( STRPTR buf, unsigned long buflen );
  229. LONG PutStr( STRPTR str );
  230. LONG VPrintf( STRPTR format, APTR argarray );
  231. LONG Printf( STRPTR format, ... );
  232. /* these were unimplemented until dos 36.147 */
  233. LONG ParsePatternNoCase( STRPTR pat, STRPTR buf, long buflen );
  234. BOOL MatchPatternNoCase( STRPTR pat, STRPTR str );
  235. /* this was added for V37 dos, returned 0 before then. */
  236. BOOL SameDevice( BPTR lock1, BPTR lock2 );
  237.  
  238. /* NOTE: the following entries did NOT exist before ks 36.303 (2.02) */
  239. /* If you are going to use them, open dos.library with version 37 */
  240.  
  241. /* These calls were added for V39 dos: */
  242. void ExAllEnd( BPTR lock, struct ExAllData *buffer, long size, long data,
  243.     struct ExAllControl *control );
  244. BOOL SetOwner( STRPTR name, long owner_info );
  245. #endif     /* CLIB_DOS_PROTOS_H */
  246.