home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Assembler / TFF-AOC.DMS / in.adf / Release3.1 / AutoDocs3.1.lha / doc / dos.doc < prev    next >
Encoding:
Text File  |  1993-08-12  |  167.1 KB  |  5,680 lines

  1. TABLE OF CONTENTS
  2.  
  3. dos.library/AbortPkt
  4. dos.library/AddBuffers
  5. dos.library/AddDosEntry
  6. dos.library/AddPart
  7. dos.library/AddSegment
  8. dos.library/AllocDosObject
  9. dos.library/AssignAdd
  10. dos.library/AssignLate
  11. dos.library/AssignLock
  12. dos.library/AssignPath
  13. dos.library/AttemptLockDosList
  14. dos.library/ChangeMode
  15. dos.library/CheckSignal
  16. dos.library/Cli
  17. dos.library/CliInitNewcli
  18. dos.library/CliInitRun
  19. dos.library/Close
  20. dos.library/CompareDates
  21. dos.library/CreateDir
  22. dos.library/CreateNewProc
  23. dos.library/CreateProc
  24. dos.library/CurrentDir
  25. dos.library/DateStamp
  26. dos.library/DateToStr
  27. dos.library/Delay
  28. dos.library/DeleteFile
  29. dos.library/DeleteVar
  30. dos.library/DeviceProc
  31. dos.library/DoPkt
  32. dos.library/DupLock
  33. dos.library/DupLockFromFH
  34. dos.library/EndNotify
  35. dos.library/ErrorReport
  36. dos.library/ExAll
  37. dos.library/ExAllEnd
  38. dos.library/Examine
  39. dos.library/ExamineFH
  40. dos.library/Execute
  41. dos.library/Exit
  42. dos.library/ExNext
  43. dos.library/Fault
  44. dos.library/FGetC
  45. dos.library/FGets
  46. dos.library/FilePart
  47. dos.library/FindArg
  48. dos.library/FindCliProc
  49. dos.library/FindDosEntry
  50. dos.library/FindSegment
  51. dos.library/FindVar
  52. dos.library/Flush
  53. dos.library/Format
  54. dos.library/FPutC
  55. dos.library/FPuts
  56. dos.library/FRead
  57. dos.library/FreeArgs
  58. dos.library/FreeDeviceProc
  59. dos.library/FreeDosEntry
  60. dos.library/FreeDosObject
  61. dos.library/FWrite
  62. dos.library/GetArgStr
  63. dos.library/GetConsoleTask
  64. dos.library/GetCurrentDirName
  65. dos.library/GetDeviceProc
  66. dos.library/GetFileSysTask
  67. dos.library/GetProgramDir
  68. dos.library/GetProgramName
  69. dos.library/GetPrompt
  70. dos.library/GetVar
  71. dos.library/Info
  72. dos.library/Inhibit
  73. dos.library/Input
  74. dos.library/InternalLoadSeg
  75. dos.library/InternalUnLoadSeg
  76. dos.library/IoErr
  77. dos.library/IsFileSystem
  78. dos.library/IsInteractive
  79. dos.library/LoadSeg
  80. dos.library/Lock
  81. dos.library/LockDosList
  82. dos.library/LockRecord
  83. dos.library/LockRecords
  84. dos.library/MakeDosEntry
  85. dos.library/MakeLink
  86. dos.library/MatchEnd
  87. dos.library/MatchFirst
  88. dos.library/MatchNext
  89. dos.library/MatchPattern
  90. dos.library/MatchPatternNoCase
  91. dos.library/MaxCli
  92. dos.library/NameFromFH
  93. dos.library/NameFromLock
  94. dos.library/NewLoadSeg
  95. dos.library/NextDosEntry
  96. dos.library/Open
  97. dos.library/OpenFromLock
  98. dos.library/Output
  99. dos.library/ParentDir
  100. dos.library/ParentOfFH
  101. dos.library/ParsePattern
  102. dos.library/ParsePatternNoCase
  103. dos.library/PathPart
  104. dos.library/PrintFault
  105. dos.library/PutStr
  106. dos.library/Read
  107. dos.library/ReadArgs
  108. dos.library/ReadItem
  109. dos.library/ReadLink
  110. dos.library/Relabel
  111. dos.library/RemAssignList
  112. dos.library/RemDosEntry
  113. dos.library/RemSegment
  114. dos.library/Rename
  115. dos.library/ReplyPkt
  116. dos.library/RunCommand
  117. dos.library/SameDevice
  118. dos.library/SameLock
  119. dos.library/Seek
  120. dos.library/SelectInput
  121. dos.library/SelectOutput
  122. dos.library/SendPkt
  123. dos.library/SetArgStr
  124. dos.library/SetComment
  125. dos.library/SetConsoleTask
  126. dos.library/SetCurrentDirName
  127. dos.library/SetFileDate
  128. dos.library/SetFileSize
  129. dos.library/SetFileSysTask
  130. dos.library/SetIoErr
  131. dos.library/SetMode
  132. dos.library/SetOwner
  133. dos.library/SetProgramDir
  134. dos.library/SetProgramName
  135. dos.library/SetPrompt
  136. dos.library/SetProtection
  137. dos.library/SetVar
  138. dos.library/SetVBuf
  139. dos.library/SplitName
  140. dos.library/StartNotify
  141. dos.library/StrToDate
  142. dos.library/StrToLong
  143. dos.library/SystemTagList
  144. dos.library/UnGetC
  145. dos.library/UnLoadSeg
  146. dos.library/UnLock
  147. dos.library/UnLockDosList
  148. dos.library/UnLockRecord
  149. dos.library/UnLockRecords
  150. dos.library/VFPrintf
  151. dos.library/VFWritef
  152. dos.library/VPrintf
  153. dos.library/WaitForChar
  154. dos.library/WaitPkt
  155. dos.library/Write
  156. dos.library/WriteChars
  157. dos.library/AbortPkt                                     dos.library/AbortPkt
  158.  
  159.    NAME
  160.     AbortPkt -- Aborts an asynchronous packet, if possible. (V36)
  161.  
  162.    SYNOPSIS
  163.     AbortPkt(port, pkt)
  164.           D1    D2
  165.  
  166.     void AbortPkt(struct MsgPort *, struct DosPacket *)
  167.  
  168.    FUNCTION
  169.     This attempts to abort a packet sent earlier with SendPkt to a
  170.     handler.  There is no guarantee that any given handler will allow
  171.     a packet to be aborted, or if it is aborted whether function
  172.     requested completed first or completely.  After calling AbortPkt(),
  173.     you must wait for the packet to return before reusing it or
  174.     deallocating it.
  175.  
  176.    INPUTS
  177.     port - port the packet was sent to
  178.     pkt  - the packet you wish aborted
  179.  
  180.    BUGS
  181.     As of V37, this function does nothing.
  182.  
  183.    SEE ALSO
  184.     SendPkt(), DoPkt(), WaitPkt()
  185.  
  186. dos.library/AddBuffers                                 dos.library/AddBuffers
  187.  
  188.    NAME
  189.     AddBuffers -- Changes the number of buffers for a filesystem (V36)
  190.  
  191.    SYNOPSIS
  192.     success = AddBuffers(filesystem, number)
  193.     D0               D1          D2
  194.  
  195.     BOOL AddBuffers(STRPTR, LONG)
  196.  
  197.    FUNCTION
  198.     Adds buffers to a filesystem.  If it succeeds, the number of current
  199.     buffers is returned in IoErr().  Note that "number" may be negative.
  200.     The amount of memory used per buffer, and any limits on the number of
  201.     buffers, are dependant on the filesystem in question.
  202.     If the call succeeds, the number of buffers in use on the filesystem
  203.     will be returned by IoErr().
  204.  
  205.    INPUTS
  206.     filesystem - Name of device to add buffers to (with ':').
  207.     number     - Number of buffers to add.  May be negative.
  208.  
  209.    RESULT
  210.     success    - Success or failure of command.
  211.  
  212.    BUGS
  213.     The V36 ROM filesystem (FFS/OFS) doesn't return the right number of
  214.     buffers unless preceded by an AddBuffers(fs,-1) (in-use buffers aren't
  215.     counted).  This is fixed in V37.
  216.  
  217.     The V37 and before ROM filesystem doesn't return success, it returns
  218.     the number of buffers.  The best way to test for this is to consider
  219.     0 (FALSE) failure, -1 (DOSTRUE) to mean that IoErr() will have the
  220.     number of buffers, and any other positive value to be the number of
  221.     buffers.  It may be fixed in some future ROM revision.
  222.  
  223.    SEE ALSO
  224.     IoErr()
  225.  
  226. dos.library/AddDosEntry                               dos.library/AddDosEntry
  227.  
  228.    NAME
  229.     AddDosEntry -- Add a Dos List entry to the lists (V36)
  230.  
  231.    SYNOPSIS
  232.     success = AddDosEntry(dlist)
  233.     D0                     D1
  234.  
  235.     LONG AddDosEntry(struct DosList *)
  236.  
  237.    FUNCTION
  238.     Adds a device, volume or assign to the dos devicelist.  Can fail if it 
  239.     conflicts with an existing entry (such as another assign to the same
  240.     name or another device of the same name).  Volume nodes with different
  241.     dates and the same name CAN be added, or with names that conflict with
  242.     devices or assigns.  Note: the dos list does NOT have to be locked to
  243.     call this.  Do not access dlist after adding unless you have locked the
  244.     Dos Device list.
  245.  
  246.     An additional note concerning calling this from within a handler:
  247.     in order to avoid deadlocks, your handler must either be multi-
  248.     threaded, or it must attempt to lock the list before calling this
  249.     function.  The code would look something like this:
  250.  
  251.     if (AttemptLockDosList(LDF_xxx|LDF_WRITE))
  252.     {
  253.         rc = AddDosEntry(...);
  254.         UnLockDosList(LDF_xxx|LDF_WRITE);
  255.     }
  256.  
  257.     If AttemptLockDosList() fails (i.e. it's locked already), check for
  258.     messages at your filesystem port (don't wait!) and try the
  259.     AttemptLockDosList() again.
  260.  
  261.    INPUTS
  262.     dlist   - Device list entry to be added.
  263.  
  264.    RESULT
  265.     success - Success/Failure indicator
  266.  
  267.    SEE ALSO
  268.     RemDosEntry(), FindDosEntry(), NextDosEntry(), LockDosList(),
  269.     MakeDosEntry(), FreeDosEntry(), AttemptLockDosList()
  270.  
  271. dos.library/AddPart                                       dos.library/AddPart
  272.  
  273.    NAME
  274.     AddPart -- Appends a file/dir to the end of a path (V36)
  275.  
  276.    SYNOPSIS
  277.     success = AddPart( dirname, filename, size )
  278.     D0                   D1        D2      D3
  279.  
  280.     BOOL AddPart( STRPTR, STRPTR, ULONG )
  281.  
  282.    FUNCTION
  283.     This function adds a file, directory, or subpath name to a directory
  284.     path name taking into account any required separator characters.  If
  285.     filename is a fully-qualified path it will totally replace the current
  286.     value of dirname.
  287.  
  288.    INPUTS
  289.     dirname  - the path to add a file/directory name to.
  290.     filename - the filename or directory name to add.  May be a relative
  291.            pathname from the current directory (example: foo/bar).
  292.            Can deal with leading '/'(s), indicating one directory up
  293.            per '/', or with a ':', indicating it's relative to the
  294.            root of the appropriate volume.
  295.     size     - size in bytes of the space allocated for dirname.  Must
  296.            not be 0.
  297.  
  298.    RESULT
  299.     success - non-zero for ok, FALSE if the buffer would have overflowed.
  300.           If an overflow would have occured, dirname will not be
  301.           changed.
  302.  
  303.    BUGS
  304.     Doesn't check if a subpath is legal (i.e. doesn't check for ':'s) and
  305.     doesn't handle leading '/'s in 2.0 through 2.02 (V36).  V37 fixes
  306.     this, allowing filename to be any path, including absolute.
  307.  
  308.    SEE ALSO
  309.     Filepart(), PathPart()
  310.  
  311. dos.library/AddSegment                                 dos.library/AddSegment
  312.  
  313.    NAME
  314.     AddSegment - Adds a resident segment to the resident list (V36)
  315.  
  316.    SYNOPSIS
  317.     success = AddSegment(name, seglist, type)
  318.     D0              D1     D2      D3
  319.  
  320.     BOOL AddSegment(STRPTR, BPTR, LONG)
  321.  
  322.    FUNCTION
  323.     Adds a segment to the Dos resident list, with the specified Seglist
  324.     and type (stored in seg_UC - normally 0).  NOTE: currently unused
  325.     types may cause it to interpret other registers (d4-?) as additional
  326.     parameters in the future.
  327.  
  328.     Do NOT build Segment structures yourself!
  329.  
  330.    INPUTS
  331.     name    - name for the segment
  332.     seglist - Dos seglist of code for segment
  333.     type    - initial usecount, normally 0
  334.  
  335.    RESULT
  336.     success - success or failure
  337.  
  338.    SEE ALSO
  339.     FindSegment(), RemSegment(), LoadSeg()
  340.  
  341. dos.library/AllocDosObject                         dos.library/AllocDosObject
  342.  
  343.    NAME
  344.     AllocDosObject -- Creates a dos object (V36)
  345.  
  346.    SYNOPSIS
  347.     ptr = AllocDosObject(type, tags)
  348.     D0                    D1    D2
  349.  
  350.     void *AllocDosObject(ULONG, struct TagItem *)
  351.  
  352.     ptr = AllocDosObjectTagList(type, tags)
  353.     D0                          D1    D2
  354.  
  355.     void *AllocDosObjectTagList(ULONG, struct TagItem *)
  356.  
  357.     ptr = AllocDosObjectTags(type, Tag1, ...)
  358.  
  359.     void *AllocDosObjectTags(ULONG, ULONG, ...)
  360.  
  361.    FUNCTION
  362.     Create one of several dos objects, initializes it, and returns it
  363.     to you.  Note the DOS_STDPKT returns a pointer to the sp_Pkt of the
  364.     structure.
  365.  
  366.     This function may be called by a task for all types and tags defined
  367.     in the V37 includes (DOS_FILEHANDLE through DOS_RDARGS and ADO_FH_Mode
  368.     through ADO_PromptLen, respectively).  Any future types or tags
  369.     will be documented as to whether a task may use them.
  370.  
  371.    INPUTS
  372.     type - type of object requested
  373.     tags - pointer to taglist with additional information
  374.  
  375.    RESULT
  376.     packet - pointer to the object or NULL
  377.  
  378.    BUGS
  379.     Before V39, DOS_CLI should be used with care since FreeDosObject()
  380.     can't free it.
  381.  
  382.    SEE ALSO
  383.     FreeDosObject(), <dos/dostags.h>, <dos/dos.h>
  384.  
  385. dos.library/AssignAdd                                   dos.library/AssignAdd
  386.  
  387.    NAME
  388.     AssignAdd -- Adds a lock to an assign for multi-directory assigns (V36)
  389.  
  390.    SYNOPSIS
  391.     success = AssignAdd(name,lock)
  392.     D0                   D1   D2
  393.  
  394.     BOOL AssignAdd(STRPTR,BPTR)
  395.  
  396.    FUNCTION
  397.     Adds a lock to an assign, making or adding to a multi-directory
  398.     assign.  Note that this only will succeed on an assign created with
  399.     AssignLock(), or an assign created with AssignLate() which has been
  400.     resolved (converted into a AssignLock()-assign).
  401.  
  402.     NOTE: you should not use the lock in any way after making this call
  403.     successfully.  It becomes the part of the assign, and will be unlocked
  404.     by the system when the assign is removed.  If you need to keep the
  405.     lock, pass a lock from DupLock() to AssignLock().
  406.  
  407.    INPUTS
  408.     name - Name of device to assign lock to (without trailing ':')
  409.     lock - Lock associated with the assigned name
  410.  
  411.    RESULT
  412.     success - Success/failure indicator.  On failure, the lock is not
  413.           unlocked.
  414.  
  415.    SEE ALSO
  416.     Lock(), AssignLock(), AssignPath(), AssignLate(), DupLock(),
  417.     RemAssignList()
  418.  
  419. dos.library/AssignLate                                 dos.library/AssignLate
  420.  
  421.    NAME
  422.     AssignLate -- Creates an assignment to a specified path later (V36)
  423.  
  424.    SYNOPSIS
  425.     success = AssignLate(name,path)
  426.     D0                    D1   D2
  427.  
  428.     BOOL AssignLate(STRPTR,STRPTR)
  429.  
  430.    FUNCTION
  431.     Sets up a assignment that is expanded upon the FIRST reference to the
  432.     name.  The path (a string) would be attached to the node.  When
  433.     the name is referenced (Open("FOO:xyzzy"...), the string will be used
  434.     to determine where to set the assign to, and if the directory can be
  435.     locked, the assign will act from that point on as if it had been
  436.     created by AssignLock().
  437.  
  438.     A major advantage is assigning things to unmounted volumes, which
  439.     will be requested upon access (useful in startup sequences).
  440.  
  441.    INPUTS
  442.     name - Name of device to be assigned (without trailing ':')
  443.     path - Name of late assignment to be resolved on the first reference.
  444.  
  445.    RESULT
  446.     success - Success/failure indicator of the operation
  447.  
  448.    SEE ALSO
  449.     Lock(), AssignAdd(), AssignPath(), AssignLock(),
  450.  
  451. dos.library/AssignLock                                 dos.library/AssignLock
  452.  
  453.    NAME
  454.     AssignLock -- Creates an assignment to a locked object (V36)
  455.  
  456.    SYNOPSIS
  457.     success = AssignLock(name,lock)
  458.     D0                    D1   D2
  459.  
  460.     BOOL AssignLock(STRPTR,BPTR)
  461.  
  462.    FUNCTION
  463.     Sets up an assign of a name to a given lock.  Passing NULL for a lock 
  464.     cancels any outstanding assign to that name.  If an assign entry of
  465.     that name is already on the list, this routine replaces that entry.  If
  466.     an entry is on the list that conflicts with the new assign, then a
  467.     failure code is returned.
  468.  
  469.     NOTE: you should not use the lock in any way after making this call
  470.     successfully.  It becomes the assign, and will be unlocked by the
  471.     system when the assign is removed.  If you need to keep the lock,
  472.     pass a lock from DupLock() to AssignLock().
  473.  
  474.    INPUTS
  475.     name - Name of device to assign lock to (without trailing ':')
  476.     lock - Lock associated with the assigned name
  477.  
  478.    RESULT
  479.     success - Success/failure indicator.  On failure, the lock is not
  480.           unlocked.
  481.  
  482.    SEE ALSO
  483.     Lock(), AssignAdd(), AssignPath(), AssignLate(), DupLock(),
  484.     RemAssignList()
  485.  
  486. dos.library/AssignPath                                 dos.library/AssignPath
  487.  
  488.    NAME
  489.     AssignPath -- Creates an assignment to a specified path (V36)
  490.  
  491.    SYNOPSIS
  492.     success = AssignPath(name,path)
  493.     D0                    D1   D2
  494.  
  495.     BOOL AssignPath(STRPTR,STRPTR)
  496.  
  497.    FUNCTION
  498.     Sets up a assignment that is expanded upon EACH reference to the name.
  499.     This is implemented through a new device list type (DLT_ASSIGNPATH, or
  500.     some such).  The path (a string) would be attached to the node.  When
  501.     the name is referenced (Open("FOO:xyzzy"...), the string will be used
  502.     to determine where to do the open.  No permanent lock will be part of
  503.     it.  For example, you could AssignPath() c2: to df2:c, and references
  504.     to c2: would go to df2:c, even if you change disks.
  505.  
  506.     The other major advantage is assigning things to unmounted volumes,
  507.     which will be requested upon access (useful in startup sequences).
  508.  
  509.    INPUTS
  510.     name - Name of device to be assigned (without trailing ':')
  511.     path - Name of late assignment to be resolved at each reference
  512.  
  513.    RESULT
  514.     success - Success/failure indicator of the operation
  515.  
  516.    SEE ALSO
  517.     AssignAdd(), AssignLock(), AssignLate(), Open()
  518.  
  519. dos.library/AttemptLockDosList                 dos.library/AttemptLockDosList
  520.  
  521.    NAME
  522.     AttemptLockDosList -- Attempt to lock the Dos Lists for use (V36)
  523.  
  524.    SYNOPSIS
  525.     dlist = AttemptLockDosList(flags)
  526.     D0                D1
  527.  
  528.     struct DosList *AttemptLockDosList(ULONG)
  529.  
  530.    FUNCTION
  531.     Locks the dos device list in preparation to walk the list.  If the
  532.     list is 'busy' then this routine will return NULL.  See LockDosList()
  533.     for more information.
  534.  
  535.    INPUTS
  536.     flags - Flags stating which types of nodes you want to lock.
  537.  
  538.    RESULT
  539.     dlist - Pointer to the beginning of the list or NULL.  Not a valid
  540.         node!
  541.  
  542.    BUGS
  543.     In V36 through V39.23 dos, this would return NULL or 0x00000001 for
  544.     failure.  Fixed in V39.24 dos (after kickstart 39.106).
  545.  
  546.    SEE ALSO
  547.     LockDosList(), UnLockDosList(), Forbid(), NextDosEntry()
  548.  
  549. dos.library/ChangeMode                                 dos.library/ChangeMode
  550.  
  551.    NAME
  552.     ChangeMode - Change the current mode of a lock or filehandle (V36)
  553.  
  554.    SYNOPSIS
  555.     success = ChangeMode(type, object, newmode)
  556.     D0                    D1     D2      D3
  557.  
  558.     BOOL ChangeMode(ULONG, BPTR, ULONG)
  559.  
  560.    FUNCTION
  561.     This allows you to attempt to change the mode in use by a lock or
  562.     filehandle.  For example, you could attempt to turn a shared lock
  563.     into an exclusive lock.  The handler may well reject this request.
  564.     Warning: if you use the wrong type for the object, the system may
  565.     crash.
  566.  
  567.    INPUTS
  568.     type    - Either CHANGE_FH or CHANGE_LOCK
  569.     object  - A lock or filehandle
  570.     newmode - The new mode you want
  571.  
  572.    RESULT
  573.     success - Boolean
  574.  
  575.    BUGS
  576.     Did not work in 2.02 or before (V36).  Works in V37.  In the
  577.     earlier versions, it can crash the machine.
  578.  
  579.    SEE ALSO
  580.     Lock(), Open()
  581.  
  582. dos.library/CheckSignal                               dos.library/CheckSignal
  583.  
  584.    NAME
  585.     CheckSignal -- Checks for break signals (V36)
  586.  
  587.    SYNOPSIS
  588.     signals = CheckSignal(mask)
  589.     D0              D1
  590.  
  591.     ULONG CheckSignal(ULONG)
  592.  
  593.    FUNCTION
  594.     This function checks to see if any signals specified in the mask have
  595.     been set and if so, returns them.  Otherwise it returns FALSE.
  596.     All signals specified in mask will be cleared.
  597.  
  598.    INPUTS
  599.     mask    - Signals to check for.
  600.  
  601.    RESULT
  602.     signals - Signals specified in mask that were set.
  603.  
  604.    SEE ALSO
  605.  
  606. dos.library/Cli                                               dos.library/Cli
  607.  
  608.    NAME
  609.     Cli -- Returns a pointer to the CLI structure of the process (V36)
  610.  
  611.    SYNOPSIS
  612.     cli_ptr = Cli()
  613.     D0
  614.  
  615.     struct CommandLineInterface *Cli(void)
  616.  
  617.    FUNCTION
  618.     Returns a pointer to the CLI structure of the current process, or NULL
  619.     if the process has no CLI structure.
  620.  
  621.    RESULT
  622.     cli_ptr - pointer to the CLI structure, or NULL.
  623.  
  624.    SEE ALSO
  625.  
  626. dos.library/CliInitNewcli                           dos.library/CliInitNewcli
  627.  
  628.    NAME
  629.     CliInitNewcli -- Set up a process to be a shell from initial packet
  630.  
  631.    SYNOPSIS
  632.     flags = CliInitNewcli( packet )
  633.     D0                 A0
  634.  
  635.     LONG CliInitNewcli( struct DosPacket * )
  636.  
  637.    FUNCTION
  638.     This function initializes a process and CLI structure for a new
  639.     shell, from parameters in an initial packet passed by the system
  640.     (NewShell or NewCLI, etc).  The format of the data in the packet
  641.     is purposely not defined.  The setup includes all the normal fields
  642.     in the structures that are required for proper operation (current
  643.     directory, paths, input streams, etc).
  644.  
  645.     It returns a set of flags containing information about what type
  646.     of shell invocation this is.
  647.  
  648.     Definitions for the values of fn:
  649.         Bit 31     Set to indicate flags are valid
  650.         Bit  3     Set to indicate asynch system call
  651.         Bit  2     Set if this is a System() call
  652.         Bit  1     Set if user provided input stream
  653.         Bit  0     Set if RUN provided output stream
  654.  
  655.     If Bit 31 is 0, then you must check IoErr() to determine if an error
  656.     occurred.  If IoErr() returns a pointer to your process, there has
  657.     been an error, and you should clean up and exit.  The packet will
  658.     have already been returned by CliInitNewcli().  If it isn't a pointer
  659.     to your process and Bit 31 is 0, reply the packet immediately.
  660.     (Note: this is different from what you do for CliInitRun().)
  661.  
  662.     This function is very similar to CliInitRun().
  663.  
  664.    INPUTS
  665.     packet - the initial packet sent to your process MsgPort
  666.  
  667.    RESULT
  668.     fn - flags or a pointer
  669.  
  670.    SEE ALSO
  671.     CliInitRun(), ReplyPkt(), WaitPkt(), IoErr()
  672.  
  673. dos.library/CliInitRun                                 dos.library/CliInitRun
  674.  
  675.    NAME
  676.     CliInitRun -- Set up a process to be a shell from initial packet
  677.  
  678.    SYNOPSIS
  679.     flags = CliInitRun( packet )
  680.     D0              A0
  681.  
  682.     LONG CliInitRun( struct DosPacket * )
  683.  
  684.    FUNCTION
  685.     This function initializes a process and CLI structure for a new
  686.     shell, from parameters in an initial packet passed by the system
  687.     (Run, System(), Execute()).  The format of the data in the packet
  688.     is purposely not defined.  The setup includes all the normal fields
  689.     in the structures that are required for proper operation (current
  690.     directory, paths, input streams, etc).
  691.  
  692.     It returns a set of flags containing information about what type
  693.     of shell invocation this is.
  694.  
  695.     Definitions for the values of fn:
  696.         Bit 31     Set to indicate flags are valid
  697.         Bit  3     Set to indicate asynch system call
  698.         Bit  2     Set if this is a System() call
  699.         Bit  1     Set if user provided input stream
  700.         Bit  0     Set if RUN provided output stream
  701.  
  702.     If Bit 31 is 0, then you must check IoErr() to determine if an error
  703.     occurred.  If IoErr() returns a pointer to your process, there has
  704.     been an error, and you should clean up and exit.  The packet will
  705.     have already been returned by CliInitNewcli().  If it isn't a pointer
  706.     to your process and Bit 31 is 0, you should wait before replying
  707.     the packet until after you've loaded the first command (or when you
  708.     exit).  This helps avoid disk "gronking" with the Run command.
  709.     (Note: this is different from what you do for CliInitNewcli().)
  710.  
  711.     If Bit 31 is 1, then if Bit 3 is one, ReplyPkt() the packet
  712.     immediately (Asynch System()), otherwise wait until your shell exits
  713.     (Sync System(), Execute()).
  714.     (Note: this is different from what you do for CliInitNewcli().)
  715.     
  716.     This function is very similar to CliInitNewcli().
  717.  
  718.    INPUTS
  719.     packet - the initial packet sent to your process MsgPort
  720.  
  721.    RESULT
  722.     fn - flags or a pointer
  723.  
  724.    SEE ALSO
  725.     CliInitNewcli(), ReplyPkt(), WaitPkt(), System(), Execute(), IoErr()
  726.  
  727. dos.library/Close                                           dos.library/Close
  728.  
  729.     NAME
  730.     Close -- Close an open file
  731.  
  732.     SYNOPSIS
  733.     success = Close( file )
  734.        D0             D1
  735.  
  736.     BOOL Close(BPTR)
  737.  
  738.     FUNCTION
  739.     The file specified by the file handle is closed. You must close all
  740.     files you explicitly opened, but you must not close inherited file
  741.     handles that are passed to you (each filehandle must be closed once
  742.     and ONLY once).  If Close() fails, the file handle is still
  743.     deallocated and should not be used.
  744.  
  745.     INPUTS
  746.     file - BCPL pointer to a file handle
  747.  
  748.     RESULTS
  749.     success - returns if Close() succeeded.  Note that it might fail
  750.           depending on buffering and whatever IO must be done to
  751.           close a file being written to.  NOTE: this return value
  752.           did not exist before V36! 
  753.  
  754.     SEE ALSO
  755.     Open(), OpenFromLock()
  756.  
  757. dos.library/CompareDates                             dos.library/CompareDates
  758.  
  759.    NAME
  760.     CompareDates -- Compares two datestamps (V36)
  761.  
  762.    SYNOPSIS
  763.     result = CompareDates(date1,date2)
  764.     D0                     D1     D2
  765.  
  766.     LONG CompareDates(struct DateStamp *,struct DateStamp *)
  767.  
  768.    FUNCTION
  769.     Compares two times for relative magnitide.  <0 is returned if date1 is
  770.     later than date2, 0 if they are equal, or >0 if date2 is later than
  771.     date1.  NOTE: this is NOT the same ordering as strcmp!
  772.  
  773.    INPUTS
  774.     date1, date2 - DateStamps to compare
  775.  
  776.    RESULT
  777.     result -  <0, 0, or >0 based on comparison of two date stamps
  778.  
  779.    SEE ALSO
  780.     DateStamp(), DateToStr(), StrToDate()
  781.  
  782. dos.library/CreateDir                                   dos.library/CreateDir
  783.  
  784.     NAME
  785.     CreateDir -- Create a new directory
  786.  
  787.     SYNOPSIS
  788.     lock = CreateDir( name )
  789.     D0          D1
  790.  
  791.     BPTR CreateDir(STRPTR)
  792.  
  793.     FUNCTION
  794.     CreateDir creates a new directory with the specified name. An error
  795.     is returned if it fails.  Directories can only be created on
  796.     devices which support them, e.g. disks.  CreateDir returns an
  797.     exclusive lock on the new directory if it succeeds.
  798.  
  799.     INPUTS
  800.     name - pointer to a null-terminated string
  801.  
  802.     RESULTS
  803.     lock - BCPL pointer to a lock or NULL for failure.
  804.  
  805.     SEE ALSO
  806.     Lock(), UnLock()
  807.  
  808. dos.library/CreateNewProc                           dos.library/CreateNewProc
  809.  
  810.    NAME
  811.     CreateNewProc -- Create a new process (V36)
  812.  
  813.    SYNOPSIS
  814.     process = CreateNewProc(tags)
  815.     D0                       D1
  816.  
  817.     struct Process *CreateNewProc(struct TagItem *)
  818.  
  819.     process = CreateNewProcTagList(tags)
  820.     D0                           D1
  821.  
  822.     struct Process *CreateNewProcTagList(struct TagItem *)
  823.  
  824.     process = CreateNewProcTags(Tag1, ...)
  825.  
  826.     struct Process *CreateNewProcTags(ULONG, ...)
  827.  
  828.    FUNCTION
  829.     This creates a new process according to the tags passed in.  See
  830.     dos/dostags.h for the tags.
  831.  
  832.     You must specify one of NP_Seglist or NP_Entry.  NP_Seglist takes a
  833.     seglist (as returned by LoadSeg()).  NP_Entry takes a function
  834.     pointer for the routine to call.
  835.  
  836.     There are many options, as you can see by examining dos/dostags.h.
  837.     The defaults are for a non-CLI process, with copies of your
  838.     CurrentDir, HomeDir (used for PROGDIR:), priority, consoletask,
  839.     windowptr, and variables.  The input and output filehandles default
  840.     to opens of NIL:, stack to 4000, and others as shown in dostags.h.
  841.     This is a fairly reasonable default setting for creating threads,
  842.     though you may wish to modify it (for example, to give a descriptive
  843.     name to the process.)
  844.  
  845.     CreateNewProc() is callable from a task, though any actions that
  846.     require doing Dos I/O (DupLock() of currentdir, for example) will not
  847.     occur.
  848.  
  849.     NOTE: if you call CreateNewProc() with both NP_Arguments, you must
  850.     not specify an NP_Input of NULL.  When NP_Arguments is specified, it
  851.     needs to modify the input filehandle to make ReadArgs() work properly.
  852.  
  853.    INPUTS
  854.     tags - a pointer to a TagItem array.
  855.  
  856.    RESULT
  857.     process - The created process, or NULL.  Note that if it returns
  858.           NULL, you must free any items that were passed in via
  859.           tags, such as if you passed in a new current directory
  860.           with NP_CurrentDir.
  861.  
  862.    BUGS
  863.     In V36, NP_Arguments was broken in a number of ways, and probably
  864.     should be avoided (instead you should start a small piece of your
  865.     own code, which calls RunCommand() to run the actual code you wish
  866.     to run).  In V37, NP_Arguments works, though see the note above.
  867.  
  868.    SEE ALSO
  869.     LoadSeg(), CreateProc(), ReadArgs(), RunCommand(), <dos/dostags.h>
  870.  
  871. dos.library/CreateProc                                 dos.library/CreateProc
  872.  
  873.     NAME
  874.  
  875.     CreateProc -- Create a new process
  876.  
  877.     SYNOPSIS
  878.     process = CreateProc( name, pri, seglist, stackSize )
  879.     D0              D1    D2     D3      D4
  880.  
  881.     struct MsgPort *CreateProc(STRPTR, LONG, BPTR, LONG)
  882.  
  883.     FUNCTION
  884.     CreateProc() creates a new AmigaDOS process of name 'name'.  AmigaDOS
  885.     processes are a superset of exec tasks.
  886.  
  887.     A seglist, as returned by LoadSeg(), is passed as 'seglist'.
  888.     This represents a section of code which is to be run as a new
  889.     process. The code is entered at the first hunk in the segment list,
  890.     which should contain suitable initialization code or a jump to
  891.     such.  A process control structure is allocated from memory and
  892.     initialized.  If you wish to fake a seglist (that will never
  893.     have DOS UnLoadSeg() called on it), use this code:
  894.  
  895.             DS.L    0    ;Align to longword
  896.             DC.L    16    ;Segment "length" (faked)
  897.             DC.L    0    ;Pointer to next segment
  898.             ...start of code...
  899.  
  900.     The size of the root stack upon activation is passed as
  901.     'stackSize'.  'pri' specifies the required priority of the new
  902.     process.  The result will be the process msgport address of the new
  903.     process, or zero if the routine failed.  The argument 'name'
  904.     specifies the new process name.  A zero return code indicates
  905.     error.
  906.  
  907.     The seglist passed to CreateProc() is not freed when it exits; it
  908.     is up to the parent process to free it, or for the code to unload
  909.     itself.
  910.  
  911.     Under V36 and later, you probably should use CreateNewProc() instead.
  912.  
  913.     INPUTS
  914.     name      - pointer to a null-terminated string
  915.     pri       - signed long (range -128 to +127)
  916.     seglist   - BCPL pointer to a seglist
  917.     stackSize - integer (must be a multiple of 4 bytes)
  918.  
  919.     RESULTS
  920.     process   - pointer to new process msgport
  921.  
  922.     SEE ALSO
  923.     CreateNewProc(), LoadSeg(), UnLoadSeg()
  924.  
  925. dos.library/CurrentDir                                 dos.library/CurrentDir
  926.  
  927.     NAME
  928.     CurrentDir -- Make a directory lock the current directory
  929.  
  930.     SYNOPSIS
  931.     oldLock = CurrentDir( lock )
  932.     D0              D1
  933.  
  934.     BPTR CurrentDir(BPTR)
  935.  
  936.     FUNCTION
  937.     CurrentDir() causes a directory associated with a lock to be made
  938.     the current directory.    The old current directory lock is returned.
  939.  
  940.     A value of zero is a valid result here, this 0 lock represents the
  941.     root of file system that you booted from.
  942.  
  943.     Any call that has to Open() or Lock() files (etc) requires that
  944.     the current directory be a valid lock or 0.
  945.  
  946.     INPUTS
  947.     lock - BCPL pointer to a lock
  948.  
  949.     RESULTS
  950.     oldLock - BCPL pointer to a lock
  951.  
  952.     SEE ALSO
  953.     Lock(), UnLock(), Open(), DupLock()
  954.  
  955. dos.library/DateStamp                                   dos.library/DateStamp
  956.  
  957.     NAME
  958.     DateStamp -- Obtain the date and time in internal format
  959.  
  960.     SYNOPSIS
  961.     ds = DateStamp( ds );
  962.     D0        D1
  963.  
  964.     struct DateStamp *DateStamp(struct DateStamp *)
  965.  
  966.     FUNCTION
  967.     DateStamp() takes a structure of three longwords that is set to the
  968.     current time.  The first element in the vector is a count of the
  969.     number of days.  The second element is the number of minutes elapsed
  970.     in the day.  The third is the number of ticks elapsed in the current
  971.     minute.  A tick happens 50 times a second.  DateStamp() ensures that
  972.     the day and minute are consistent.  All three elements are zero if
  973.     the date is unset. DateStamp() currently only returns even
  974.     multiples of 50 ticks.  Therefore the time you get is always an even
  975.     number of ticks.
  976.  
  977.     Time is measured from Jan 1, 1978.
  978.  
  979.     INPUTS
  980.     ds - pointer a struct DateStamp
  981.  
  982.     RESULTS
  983.     The array is filled as described and returned (for pre-V36 
  984.     compabability).
  985.  
  986.     SEE ALSO
  987.     DateToStr(), StrToDate(), SetFileDate(), CompareDates()
  988.  
  989. dos.library/DateToStr                                   dos.library/DateToStr
  990.  
  991.    NAME
  992.     DateToStr -- Converts a DateStamp to a string (V36)
  993.  
  994.    SYNOPSIS
  995.     success = DateToStr( datetime )
  996.     D0                      D1
  997.  
  998.     BOOL DateToStr(struct DateTime *)
  999.  
  1000.    FUNCTION
  1001.     StamptoStr converts an AmigaDOS DateStamp to a human
  1002.     readable ASCII string as requested by your settings in the
  1003.     DateTime structure.
  1004.  
  1005.    INPUTS
  1006.     DateTime - a pointer to an initialized DateTime structure.
  1007.  
  1008.     The DateTime structure should be initialized as follows:
  1009.  
  1010.     dat_Stamp - a copy of the datestamp you wish to convert to
  1011.           ascii.
  1012.  
  1013.     dat_Format - a format    byte which specifies the format    of the
  1014.           dat_StrDate.    This can be any    of the following
  1015.           (note: If value used is something other than those
  1016.           below, the default of    FORMAT_DOS is used):
  1017.  
  1018.           FORMAT_DOS:      AmigaDOS format (dd-mmm-yy).
  1019.  
  1020.           FORMAT_INT:      International    format (yy-mmm-dd).
  1021.  
  1022.           FORMAT_USA:      American format (mm-dd-yy).
  1023.  
  1024.           FORMAT_CDN:      Canadian format (dd-mm-yy).
  1025.  
  1026.           FORMAT_DEF:      default format for locale.
  1027.  
  1028.     dat_Flags - a    flags byte.  The only flag which affects this
  1029.           function is:
  1030.  
  1031.           DTF_SUBST:      If set, a string such    as Today,
  1032.                   Monday, etc.,    will be    used instead
  1033.                   of the dat_Format specification if
  1034.                   possible.
  1035.           DTF_FUTURE:      Ignored by this function.
  1036.  
  1037.     dat_StrDay - pointer to a buffer to receive the day of the
  1038.           week string.    (Monday, Tuesday, etc.). If null, this
  1039.           string will not be generated.
  1040.  
  1041.     dat_StrDate -    pointer    to a buffer to receive the date
  1042.           string, in the format    requested by dat_Format,
  1043.           subject to possible modifications by DTF_SUBST.  If
  1044.           null,    this string will not be    generated.
  1045.  
  1046.     dat_StrTime -    pointer    to a buffer to receive the time    of day
  1047.           string. If NULL, this    will not be generated.
  1048.  
  1049.    RESULT
  1050.     success    - a zero return indicates that the DateStamp was
  1051.           invalid, and could not be converted.    Non-zero
  1052.           indicates that the call succeeded.
  1053.  
  1054.    SEE ALSO
  1055.     DateStamp(), StrtoDate(), <dos/datetime.h>
  1056.  
  1057. dos.library/Delay                                           dos.library/Delay
  1058.  
  1059.     NAME
  1060.     Delay -- Delay a process for a specified time
  1061.  
  1062.     SYNOPSIS
  1063.     Delay( ticks )
  1064.            D1
  1065.  
  1066.     void Delay(ULONG)
  1067.  
  1068.     FUNCTION
  1069.     The argument 'ticks' specifies how many ticks (50 per second) to
  1070.     wait before returning control.
  1071.  
  1072.     INPUTS
  1073.     ticks - integer
  1074.  
  1075.     BUGS
  1076.     Due to a bug in the timer.device in V1.2/V1.3, specifying a timeout
  1077.     of zero for Delay() can cause the unreliable timer & floppy disk
  1078.     operation.  This is fixed in V36 and later.
  1079.  
  1080.     SEE ALSO
  1081.  
  1082. dos.library/DeleteFile                                 dos.library/DeleteFile
  1083.  
  1084.     NAME
  1085.     DeleteFile -- Delete a file or directory
  1086.  
  1087.     SYNOPSIS
  1088.     success = DeleteFile( name )
  1089.     D0              D1
  1090.  
  1091.     BOOL DeleteFile(STRPTR)
  1092.  
  1093.     FUNCTION
  1094.     This attempts to delete the file or directory specified by 'name'.
  1095.     An error is returned if the deletion fails. Note that all the files
  1096.     within a directory must be deleted before the directory itself can
  1097.     be deleted.
  1098.  
  1099.     INPUTS
  1100.     name - pointer to a null-terminated string
  1101.  
  1102.     RESULTS
  1103.     success - boolean
  1104.  
  1105.     SEE ALSO
  1106.  
  1107. dos.library/DeleteVar                                   dos.library/DeleteVar
  1108.  
  1109.    NAME
  1110.     DeleteVar -- Deletes a local or environment variable (V36)
  1111.  
  1112.    SYNOPSIS
  1113.     success = DeleteVar( name, flags ) 
  1114.     D0              D1    D2
  1115.  
  1116.     BOOL DeleteVar(STRPTR, ULONG ) 
  1117.  
  1118.    FUNCTION
  1119.     Deletes a local or environment variable.
  1120.  
  1121.    INPUTS
  1122.     name   - pointer to an variable name.  Note variable names follow
  1123.          filesystem syntax and semantics.
  1124.     flags  - combination of type of var to delete (low 8 bits), and
  1125.          flags to control the behavior of this routine.  Currently
  1126.          defined flags include:
  1127.  
  1128.          GVF_LOCAL_ONLY  - delete a local (to your process) variable.
  1129.          GVF_GLOBAL_ONLY - delete a global environment variable.
  1130.  
  1131.          The default is to delete a local variable if found, otherwise
  1132.          a global environment variable if found (only for LV_VAR).
  1133.  
  1134.    RESULT
  1135.     success - If non-zero, the variable was sucessfully deleted, FALSE
  1136.           indicates failure.
  1137.  
  1138.    BUGS
  1139.     LV_VAR is the only type that can be global
  1140.  
  1141.    SEE ALSO
  1142.     GetVar(), SetVar(), FindVar(), DeleteFile(), <dos/var.h>
  1143.  
  1144. dos.library/DeviceProc                                 dos.library/DeviceProc
  1145.  
  1146.     NAME
  1147.     DeviceProc -- Return the process MsgPort of specific I/O handler
  1148.  
  1149.     SYNOPSIS
  1150.     process = DeviceProc( name )
  1151.     D0              D1
  1152.  
  1153.     struct MsgPort *DeviceProc (STRPTR)
  1154.  
  1155.     FUNCTION
  1156.     DeviceProc() returns the process identifier of the process which
  1157.     handles the device associated with the specified name. If no
  1158.     process handler can be found then the result is zero. If the name
  1159.     refers to an assign then a directory lock is returned in IoErr().
  1160.     This lock should not be UnLock()ed or Examine()ed (if you wish to do
  1161.     so, DupLock() it first).
  1162.  
  1163.     BUGS
  1164.     In V36, if you try to DeviceProc() something relative to an assign
  1165.     made with AssignPath(), it will fail.  This is because there's no
  1166.     way to know when to unlock the lock.  If you're writing code for
  1167.     V36 or later, it is highly advised you use GetDeviceProc() instead,
  1168.     or make your code conditional on V36 to use GetDeviceProc()/
  1169.     FreeDeviceProc().
  1170.  
  1171.     SEE ALSO
  1172.     GetDeviceProc(), FreeDeviceProc(), DupLock(), UnLock(), Examine()
  1173.  
  1174. dos.library/DoPkt                                           dos.library/DoPkt
  1175.  
  1176.    NAME
  1177.     DoPkt -- Send a dos packet and wait for reply (V36)
  1178.  
  1179.    SYNOPSIS
  1180.     result1 = DoPkt(port,action,arg1,arg2,arg3,arg4,arg5)
  1181.     D0               D1    D2    D3   D4   D5   D6   D7
  1182.  
  1183.     LONG DoPkt(struct MsgPort *,LONG,LONG,LONG,LONG,LONG,LONG)
  1184.  
  1185.    FUNCTION
  1186.     Sends a packet to a handler and waits for it to return.  Any secondary
  1187.     return will be available in D1 AND from IoErr().  DoPkt() will work
  1188.     even if the caller is an exec task and not a process; however it will
  1189.     be slower, and may fail for some additional reasons, such as being
  1190.     unable to allocate a signal.  DoPkt() uses your pr_MsgPort for the
  1191.     reply, and will call pr_PktWait.  (See BUGS regarding tasks, though).
  1192.  
  1193.     Only allows 5 arguments to be specified.  For more arguments (packets
  1194.     support a maximum of 7) create a packet and use SendPkt()/WaitPkt().
  1195.  
  1196.    INPUTS
  1197.     port    - pr_MsgPort of the handler process to send to.
  1198.     action  - the action requested of the filesystem/handler
  1199.     arg1, arg2, arg3, arg4,arg5 - arguments, depend on the action, may not
  1200.            be required.
  1201.  
  1202.    RESULT
  1203.     result1 - the value returned in dp_Res1, or FALSE if there was some
  1204.           problem in sending the packet or recieving it.
  1205.     result2 - Available from IoErr() AND in register D1.
  1206.  
  1207.    BUGS
  1208.     Using DoPkt() from tasks doesn't work in V36. Use AllocDosObject(),
  1209.     PutMsg(), and WaitPort()/GetMsg() for a workaround, or you can call
  1210.     CreateNewProc() to start a process to do Dos I/O for you.  In V37,
  1211.     DoPkt() will allocate, use, and free the MsgPort required.
  1212.  
  1213.    NOTES
  1214.     Callable from a task (under V37 and above).
  1215.  
  1216.    SEE ALSO
  1217.     AllocDosObject(), FreeDosObject(), SendPkt(), WaitPkt(),
  1218.     CreateNewProc(), AbortPkt()
  1219.  
  1220. dos.library/DupLock                                       dos.library/DupLock
  1221.  
  1222.     NAME
  1223.     DupLock -- Duplicate a lock
  1224.  
  1225.     SYNOPSIS
  1226.     lock = DupLock( lock )
  1227.     D0        D1
  1228.  
  1229.     BPTR DupLock(BPTR)
  1230.  
  1231.     FUNCTION
  1232.     DupLock() is passed a shared filing system lock.  This is the ONLY
  1233.     way to obtain a duplicate of a lock... simply copying is not
  1234.     allowed.
  1235.  
  1236.     Another lock to the same object is then returned.  It is not
  1237.     possible to create a copy of a exclusive lock.
  1238.  
  1239.     A zero return indicates failure.
  1240.  
  1241.     INPUTS
  1242.     lock - BCPL pointer to a lock
  1243.  
  1244.     RESULTS
  1245.     newLock - BCPL pointer to a lock
  1246.  
  1247.     SEE ALSO
  1248.     Lock(), UnLock(), DupLockFromFH(), ParentOfFH()
  1249.  
  1250. dos.library/DupLockFromFH                           dos.library/DupLockFromFH
  1251.  
  1252.    NAME
  1253.     DupLockFromFH -- Gets a lock on an open file (V36)
  1254.  
  1255.    SYNOPSIS
  1256.     lock = DupLockFromFH(fh)
  1257.     D0                   D1
  1258.  
  1259.     BPTR DupLockFromFH(BPTR)
  1260.  
  1261.    FUNCTION
  1262.     Obtain a lock on the object associated with fh.  Only works if the
  1263.     file was opened using a non-exclusive mode.  Other restrictions may be
  1264.     placed on success by the filesystem.
  1265.  
  1266.    INPUTS
  1267.     fh   - Opened file for which to obtain the lock
  1268.  
  1269.    RESULT
  1270.     lock - Obtained lock or NULL for failure
  1271.  
  1272.    SEE ALSO
  1273.     DupLock(), Lock(), UnLock()
  1274.  
  1275. dos.library/EndNotify                                   dos.library/EndNotify
  1276.  
  1277.    NAME
  1278.     EndNotify -- Ends a notification request (V36)
  1279.  
  1280.    SYNOPSIS
  1281.     EndNotify(notifystructure)
  1282.             D1
  1283.  
  1284.     VOID EndNotify(struct NotifyRequest *)
  1285.  
  1286.    FUNCTION
  1287.     Removes a notification request.  Safe to call even if StartNotify()
  1288.     failed.  For NRF_SEND_MESSAGE, it searches your port for any messages
  1289.     about the object in question and removes and replies them before
  1290.     returning.
  1291.  
  1292.    INPUTS
  1293.     notifystructure - a structure passed to StartNotify()
  1294.  
  1295.    SEE ALSO
  1296.     StartNotify(), <dos/notify.h>
  1297.  
  1298. dos.library/ErrorReport                               dos.library/ErrorReport
  1299.  
  1300.    NAME
  1301.     ErrorReport -- Displays a Retry/Cancel requester for an error (V36)
  1302.  
  1303.    SYNOPSIS
  1304.     status = ErrorReport(code, type, arg1, device)
  1305.     D0                    D1    D2    D3     D4
  1306.  
  1307.     BOOL ErrorReport(LONG, LONG, ULONG, struct MsgPort *)
  1308.  
  1309.    FUNCTION
  1310.     Based on the request type, this routine formats the appropriate
  1311.     requester to be displayed.  If the code is not understood, it returns
  1312.     DOS_TRUE immediately.  Returns DOS_TRUE if the user selects CANCEL or
  1313.     if the attempt to put up the requester fails, or if the process
  1314.     pr_WindowPtr is -1.  Returns FALSE if the user selects Retry.  The
  1315.     routine will retry on DISKINSERTED for appropriate error codes.
  1316.     These return values are the opposite of what AutoRequest returns.
  1317.  
  1318.     Note: this routine sets IoErr() to code before returning.
  1319.  
  1320.    INPUTS
  1321.     code   - Error code to put a requester up for.
  1322.        Current valid error codes are:
  1323.         ERROR_DISK_NOT_VALIDATED
  1324.         ERROR_DISK_WRITE_PROTECTED
  1325.         ERROR_DISK_FULL
  1326.         ERROR_DEVICE_NOT_MOUNTED
  1327.         ERROR_NOT_A_DOS_DISK
  1328.         ERROR_NO_DISK
  1329.         ABORT_DISK_ERROR    /* read/write error */
  1330.         ABORT_BUSY        /* you MUST replace... */
  1331.     type   - Request type:
  1332.                        REPORT_LOCK   - arg1 is a lock (BPTR).
  1333.                        REPORT_FH     - arg1 is a filehandle (BPTR).
  1334.             REPORT_VOLUME - arg1 is a volumenode (C pointer).
  1335.             REPORT_INSERT - arg1 is the string for the volumename
  1336.                     (will be split on a ':').
  1337.                     With ERROR_DEVICE_NOT_MOUNTED puts
  1338.                     up the "Please insert..." requester.
  1339.     arg1   - variable parameter (see type)
  1340.     device - (Optional) Address of handler task for which report is to be 
  1341.                 made.  Only required for REPORT_LOCK, and only if arg1==NULL.
  1342.  
  1343.    RESULT
  1344.     status - Cancel/Retry indicator (0 means Retry)
  1345.  
  1346.    SEE ALSO
  1347.     Fault(), IoErr()
  1348.  
  1349. dos.library/ExAll                                           dos.library/ExAll
  1350.  
  1351.    NAME
  1352.     ExAll -- Examine an entire directory (V36)
  1353.  
  1354.    SYNOPSIS
  1355.     continue = ExAll(lock, buffer, size, type, control)
  1356.     D0               D1     D2     D3    D4     D5
  1357.  
  1358.     BOOL ExAll(BPTR,STRPTR,LONG,LONG,struct ExAllControl *)
  1359.  
  1360.    FUNCTION
  1361.     Examines an entire directory.  
  1362.  
  1363.  Lock must be on a directory.  Size is the size of the buffer supplied.
  1364.  The buffer will be filled with (partial) ExAllData structures, as
  1365.  specified by the type field.
  1366.  
  1367.  Type is a value from those shown below that determines which information is
  1368.  to be stored in the buffer.  Each higher value adds a new thing to the list
  1369.  as described in the table below:-
  1370.  
  1371.     ED_NAME        FileName
  1372.     ED_TYPE        Type
  1373.     ED_SIZE        Size in bytes
  1374.     ED_PROTECTION    Protection bits
  1375.     ED_DATE        3 longwords of date
  1376.     ED_COMMENT    Comment (will be NULL if no comment)
  1377.     ED_OWNER    owner user-id and group-id (if supported)  (V39)
  1378.  
  1379.  Thus, ED_NAME gives only filenames, and ED_OWNER gives everything.
  1380.  
  1381.  NOTE: V37 dos.library, when doing ExAll() emulation, and V37 filesystems
  1382.  will return an error if passed ED_OWNER.  If you get ERROR_BAD_NUMBER,
  1383.  retry with ED_COMMENT to get everything but owner info.  All filesystems
  1384.  supporting ExAll() must support through ED_COMMENT, and must check Type
  1385.  and return ERROR_BAD_NUMBER if they don't support the type.
  1386.  
  1387.  The ead_Next entry gives a pointer to the next entry in the buffer.  The
  1388.  last entry will have NULL in ead_Next.
  1389.  
  1390.  The control structure is required so that FFS can keep track if more than
  1391.  one call to ExAll is required.  This happens when there are more names in
  1392.  a directory than will fit into the buffer.  The format of the control
  1393.  structure is as follows:-
  1394.  
  1395.  NOTE: the control structure MUST be allocated by AllocDosObject!!!
  1396.  
  1397.  Entries:  This field tells the calling application how many entries are
  1398.         in the buffer after calling ExAll.  Note: make sure your code
  1399.         handles the 0 entries case, including 0 entries with continue
  1400.         non-zero.
  1401.  
  1402.  LastKey:  This field ABSOLUTELY MUST be initialised to 0 before calling
  1403.         ExAll for the first time.  Any other value will cause nasty
  1404.         things to happen.  If ExAll returns non-zero, then this field
  1405.         should not be touched before making the second and subsequent
  1406.         calls to ExAll.  Whenever ExAll returns non-zero, there are more
  1407.         calls required before all names have been received.
  1408.  
  1409.         As soon as a FALSE return is received then ExAll has completed
  1410.         (if IoErr() returns ERROR_NO_MORE_ENTRIES - otherwise it returns
  1411.         the error that occured, similar to ExNext.)
  1412.  
  1413.  MatchString
  1414.         If this field is NULL then all filenames will be returned.  If
  1415.         this field is non-null then it is interpreted as a pointer to
  1416.         a string that is used to pattern match all file names before
  1417.         accepting them and putting them into the buffer.  The default
  1418.         AmigaDOS caseless pattern match routine is used.  This string
  1419.         MUST have been parsed by ParsePatternNoCase()!
  1420.  
  1421.  MatchFunc: 
  1422.         Contains a pointer to a hook for a routine to decide if the entry
  1423.         will be included in the returned list of entries.  The entry is
  1424.         filled out first, and then passed to the hook.  If no MatchFunc is
  1425.         to be called then this entry should be NULL.  The hook is
  1426.         called with the following parameters (as is standard for hooks):
  1427.  
  1428.         BOOL = MatchFunc( hookptr, data, typeptr )
  1429.                 a0    a1    a2
  1430.         (a0 = ptr to hook, a1 = ptr to filled in ExAllData, a2 = ptr
  1431.          to longword of type).
  1432.  
  1433.         MatchFunc should return FALSE if the entry is not to be
  1434.         accepted, otherwise return TRUE.
  1435.  
  1436.     Note that Dos will emulate ExAll() using Examine() and ExNext()
  1437.     if the handler in question doesn't support the ExAll() packet.
  1438.  
  1439.    INPUTS
  1440.     lock    - Lock on directory to be examined.
  1441.     buffer  - Buffer for data returned (MUST be at least word-aligned,
  1442.           preferably long-word aligned).
  1443.     size    - Size in bytes of 'buffer'.
  1444.     type    - Type of data to be returned.
  1445.     control - Control data structure (see notes above).  MUST have been
  1446.           allocated by AllocDosObject!
  1447.  
  1448.    RESULT
  1449.     continue - Whether or not ExAll is done.  If FALSE is returned, either
  1450.            ExAll has completed (IoErr() == ERROR_NO_MORE_ENTRIES), or
  1451.            an error occurred (check IoErr()).  If non-zero is returned,
  1452.            you MUST call ExAll again until it returns FALSE.
  1453.  
  1454.    EXAMPLE
  1455.  
  1456.    eac = AllocDosObject(DOS_EXALLCONTROL,NULL);
  1457.    if (!eac) ...
  1458.    ...
  1459.    eac->eac_LastKey = 0;
  1460.    do {
  1461.        more = ExAll(lock, EAData, sizeof(EAData), ED_FOO, eac);
  1462.        if ((!more) && (IoErr() != ERROR_NO_MORE_ENTRIES)) {
  1463.            \* ExAll failed abnormally *\
  1464.            break;
  1465.        }
  1466.        if (eac->eac_Entries == 0) {
  1467.            \* ExAll failed normally with no entries *\
  1468.            continue;                   \* ("more" is *usually* zero) *\
  1469.        }
  1470.        ead = (struct ExAllData *) EAData;
  1471.        do {
  1472.            \* use ead here *\
  1473.            ...
  1474.            \* get next ead *\
  1475.            ead = ead->ed_Next;
  1476.        } while (ead);
  1477.  
  1478.    } while (more);
  1479.    ...
  1480.    FreeDosObject(DOS_EXALLCONTROL,eac);
  1481.  
  1482.    BUGS
  1483.     In V36, there were problems with ExAll (particularily with
  1484.     eac_MatchString, and ed_Next with the ramdisk and the emulation
  1485.     of it in Dos for handlers that do not support the packet.  It is
  1486.     advised you only use this under V37 and later.
  1487.  
  1488.     See note above regarding extensions to the Type parameter.
  1489.  
  1490.    SEE ALSO
  1491.     Examine(), ExNext(), ExamineFH(), MatchPatternNoCase(),
  1492.     ParsePatternNoCase(), AllocDosObject(), ExAllEnd()
  1493.  
  1494. dos.library/ExAllEnd                                     dos.library/ExAllEnd
  1495.  
  1496.    NAME
  1497.     ExAllEnd -- Stop an ExAll() (V39)
  1498.  
  1499.    SYNOPSIS
  1500.     ExAllEnd(lock, buffer, size, type, control)
  1501.               D1     D2     D3    D4     D5
  1502.  
  1503.     ExAllEnd(BPTR,STRPTR,LONG,LONG,struct ExAllControl *)
  1504.  
  1505.    FUNCTION
  1506.     Stops an ExAll() on a directory before it hits NO_MORE_ENTRIES.
  1507.     The full set of arguments that had been passed to ExAll() must be
  1508.     passed to ExAllEnd(), so it can handle filesystems that can't abort
  1509.     an ExAll() directly.
  1510.  
  1511.    INPUTS
  1512.     lock    - Lock on directory to be examined.
  1513.     buffer  - Buffer for data returned (MUST be at least word-aligned,
  1514.           preferably long-word aligned).
  1515.     size    - Size in bytes of 'buffer'.
  1516.     type    - Type of data to be returned.
  1517.     control - Control data structure (see notes above).  MUST have been
  1518.           allocated by AllocDosObject!
  1519.  
  1520.    SEE ALSO
  1521.     ExAll(), AllocDosObject()
  1522.  
  1523. dos.library/Examine                                       dos.library/Examine
  1524.  
  1525.     NAME
  1526.     Examine -- Examine a directory or file associated with a lock
  1527.  
  1528.     SYNOPSIS
  1529.     success = Examine( lock, FileInfoBlock )
  1530.     D0            D1          D2
  1531.  
  1532.     BOOL Examine(BPTR,struct FileInfoBlock *)
  1533.  
  1534.     FUNCTION
  1535.     Examine() fills in information in the FileInfoBlock concerning the
  1536.     file or directory associated with the lock. This information
  1537.     includes the name, size, creation date and whether it is a file or
  1538.     directory.  FileInfoBlock must be longword aligned.  Examine() gives
  1539.     a return code of zero if it fails.
  1540.  
  1541.     You may make a local copy of the FileInfoBlock, as long as it is
  1542.     never passed to ExNext().
  1543.  
  1544.     INPUTS
  1545.     lock      - BCPL pointer to a lock
  1546.     infoBlock - pointer to a FileInfoBlock (MUST be longword aligned)
  1547.  
  1548.     RESULTS
  1549.     success - boolean
  1550.  
  1551.     SPECIAL NOTE
  1552.     FileInfoBlock must be longword-aligned.  AllocDosObject() will
  1553.     allocate them correctly for you.
  1554.  
  1555.     SEE ALSO
  1556.     Lock(), UnLock(), ExNext(), ExamineFH(), <dos/dos.h>, AllocDosObject(),
  1557.     ExAll()
  1558.  
  1559. dos.library/ExamineFH                                   dos.library/ExamineFH
  1560.  
  1561.    NAME
  1562.     ExamineFH -- Gets information on an open file (V36)
  1563.  
  1564.    SYNOPSIS
  1565.     success = ExamineFH(fh, fib)
  1566.     D0                  D1  D2
  1567.  
  1568.     BOOL ExamineFH(BPTR, struct FileInfoBlock *)
  1569.  
  1570.    FUNCTION
  1571.     Examines a filehandle and returns information about the file in the
  1572.     FileInfoBlock.  There are no guarantees as to whether the fib_Size
  1573.     field will reflect any changes made to the file size it was opened,
  1574.     though filesystems should attempt to provide up-to-date information
  1575.     for it.
  1576.  
  1577.    INPUTS
  1578.     fh  - Filehandle you wish to examine
  1579.     fib - FileInfoBlock, must be longword aligned.
  1580.  
  1581.    RESULT
  1582.     success - Success/failure indication
  1583.  
  1584.    SEE ALSO
  1585.     Examine(), ExNext(), ExAll(), Open(), AllocDosObject()
  1586.  
  1587. dos.library/Execute                                       dos.library/Execute
  1588.  
  1589.     NAME
  1590.     Execute -- Execute a CLI command
  1591.  
  1592.     SYNOPSIS
  1593.     success = Execute( commandString, input, output )
  1594.     D0           D1          D2     D3
  1595.  
  1596.     BOOL Execute(STRPTR, BPTR, BPTR)
  1597.  
  1598.     FUNCTION
  1599.     This function attempts to execute the string commandString as a
  1600.     Shell command and arguments. The string can contain any valid input
  1601.     that you could type directly in a Shell, including input and output
  1602.     redirection using < and >.  Note that Execute() doesn't return until
  1603.     the command(s) in commandstring have returned.
  1604.  
  1605.     The input file handle will normally be zero, and in this case
  1606.     Execute() will perform whatever was requested in the commandString
  1607.     and then return. If the input file handle is nonzero then after the
  1608.     (possibly empty) commandString is performed subsequent input is read
  1609.     from the specified input file handle until end of that file is
  1610.     reached.
  1611.  
  1612.     In most cases the output file handle must be provided, and is used
  1613.     by the Shell commands as their output stream unless output
  1614.     redirection was specified. If the output file handle is set to zero
  1615.     then the current window, normally specified as *, is used. Note
  1616.     that programs running under the Workbench do not normally have a
  1617.     current window.
  1618.  
  1619.     Execute() may also be used to create a new interactive Shell process
  1620.     just like those created with the NewShell command. In order to do
  1621.     this you would call Execute() with an empty commandString, and pass
  1622.     a file handle relating to a new window as the input file handle.
  1623.     The output file handle would be set to zero. The Shell will read
  1624.     commands from the new window, and will use the same window for
  1625.     output. This new Shell window can only be terminated by using the
  1626.     EndCLI command.
  1627.  
  1628.     Under V37, if an input filehandle is passed, and it's either
  1629.     interactive or a NIL: filehandle, the pr_ConsoleTask of the new
  1630.     process will be set to that filehandle's process (the same applies
  1631.     to SystemTagList()).
  1632.  
  1633.     For this command to work the program Run must be present in C: in
  1634.     versions before V36 (except that in 1.3.2 and any later 1.3 versions,
  1635.     the system first checks the resident list for Run).
  1636.  
  1637.     INPUTS
  1638.     commandString - pointer to a null-terminated string
  1639.     input          - BCPL pointer to a file handle
  1640.     output          - BCPL pointer to a file handle
  1641.  
  1642.     RESULTS
  1643.     success - BOOLEAN indicating whether Execute was successful
  1644.           in finding and starting the specified program.  Note this
  1645.           is NOT the return code of the command(s).
  1646.     SEE ALSO
  1647.     SystemTagList(), NewShell, EndCLI, Run
  1648.  
  1649. dos.library/Exit                                             dos.library/Exit
  1650.  
  1651.     NAME
  1652.     Exit -- Exit from a program
  1653.  
  1654.     SYNOPSIS
  1655.     Exit( returnCode )
  1656.           D1
  1657.  
  1658.     void Exit(LONG)
  1659.  
  1660.     FUNCTION
  1661.     Exit() is currently for use with programs written as if they
  1662.     were BCPL programs.  This function is not normally useful for
  1663.     other purposes.
  1664.  
  1665.     In general, therefore, please DO NOT CALL THIS FUNCTION!
  1666.  
  1667.     In order to exit, C programs should use the C language exit()
  1668.     function (note the lower case letter "e").  Assembly programs should
  1669.     place a return code in D0, and execute an RTS instruction with
  1670.     their original stack ptr.
  1671.  
  1672.     IMPLEMENTATION
  1673.     The action of Exit() depends on whether the program which called it
  1674.     is running as a command under a CLI or not. If the program is
  1675.     running under the CLI the command finishes and control reverts to
  1676.     the CLI. In this case, returnCode is interpreted as the return code
  1677.     from the program.
  1678.  
  1679.     If the program is running as a distinct process, Exit() deletes the
  1680.     process and release the space associated with the stack, segment
  1681.     list and process structure.
  1682.  
  1683.     INPUTS
  1684.     returnCode - integer
  1685.  
  1686.     SEE ALSO
  1687.     CreateProc(), CreateNewProc()
  1688.  
  1689. dos.library/ExNext                                         dos.library/ExNext
  1690.  
  1691.     NAME
  1692.     ExNext -- Examine the next entry in a directory
  1693.  
  1694.     SYNOPSIS
  1695.     success = ExNext( lock, FileInfoBlock )
  1696.     D0           D1         D2
  1697.  
  1698.     BOOL ExNext(BPTR, struct FileInfoBlock *)
  1699.  
  1700.     FUNCTION
  1701.     This routine is passed a directory lock and a FileInfoBlock that
  1702.     have been initialized by a previous call to Examine(), or updated
  1703.     by a previous call to ExNext().  ExNext() gives a return code of zero
  1704.     on failure.  The most common cause of failure is reaching the end
  1705.     of the list of files in the owning directory.  In this case, IoErr
  1706.     will return ERROR_NO_MORE_ENTRIES and a good exit is appropriate.
  1707.  
  1708.     So, follow these steps to examine a directory:
  1709.     1) Pass a Lock and a FileInfoBlock to Examine().  The lock must
  1710.        be on the directory you wish to examine.
  1711.     2) Pass ExNext() the same lock and FileInfoBlock.
  1712.     3) Do something with the information returned in the FileInfoBlock.
  1713.        Note that the fib_DirEntryType field is positive for directories,
  1714.        negative for files.
  1715.     4) Keep calling ExNext() until it returns FALSE.  Check IoErr()
  1716.        to ensure that the reason for failure was ERROR_NO_MORE_ENTRIES.
  1717.  
  1718.     Note: if you wish to recursively scan the file tree and you find
  1719.     another directory while ExNext()ing you must Lock that directory and
  1720.     Examine() it using a new FileInfoBlock.  Use of the same
  1721.     FileInfoBlock to enter a directory would lose important state
  1722.     information such that it will be impossible to continue scanning
  1723.     the parent directory.  While it is permissible to UnLock() and Lock()
  1724.     the parent directory between ExNext() calls, this is NOT recommended.
  1725.     Important state information is associated with the parent lock, so
  1726.     if it is freed between ExNext() calls this information has to be
  1727.     rebuilt on each new ExNext() call, and will significantly slow down
  1728.     directory scanning.
  1729.  
  1730.     It is NOT legal to Examine() a file, and then to ExNext() from that
  1731.     FileInfoBlock.    You may make a local copy of the FileInfoBlock, as
  1732.     long as it is never passed back to the operating system.
  1733.  
  1734.     INPUTS
  1735.     lock - BCPL pointer to a lock originally used for the Examine() call
  1736.     infoBlock - pointer to a FileInfoBlock used on the previous Examine()
  1737.             or ExNext() call.
  1738.  
  1739.     RESULTS
  1740.     success - boolean
  1741.  
  1742.     SPECIAL NOTE
  1743.     FileInfoBlock must be longword-aligned.  AllocDosObject() will
  1744.     allocate them correctly for you.
  1745.  
  1746.     SEE ALSO
  1747.     Examine(), Lock(), UnLock(), IoErr(), ExamineFH(), AllocDosObject(),
  1748.     ExAll()
  1749.  
  1750. dos.library/Fault                                           dos.library/Fault
  1751.  
  1752.    NAME
  1753.     Fault -- Returns the text associated with a DOS error code (V36)
  1754.  
  1755.    SYNOPSIS
  1756.     len = Fault(code, header, buffer, len)
  1757.     D0           D1     D2      D3    D4
  1758.  
  1759.     LONG Fault(LONG, STRPTR, STRPTR, LONG)
  1760.  
  1761.    FUNCTION
  1762.     This routine obtains the error message text for the given error code.
  1763.     The header is prepended to the text of the error message, followed
  1764.     by a colon.  Puts a null-terminated string for the error message into
  1765.     the buffer.  By convention, error messages should be no longer than 80
  1766.     characters (+1 for termination), and preferably no more than 60.
  1767.     The value returned by IoErr() is set to the code passed in.  If there
  1768.     is no message for the error code, the message will be "Error code
  1769.     <number>\n".
  1770.  
  1771.     The number of characters put into the buffer is returned, which will
  1772.     be 0 if the code passed in was 0.
  1773.  
  1774.    INPUTS
  1775.     code   - Error code
  1776.     header - header to output before error text
  1777.     buffer - Buffer to receive error message.
  1778.     len    - Length of the buffer.
  1779.  
  1780.    RESULT
  1781.     len    - number of characters put into buffer (may be 0)
  1782.  
  1783.    SEE ALSO
  1784.     IoErr(), SetIoErr(), PrintFault()
  1785.  
  1786.    BUGS
  1787.     In older documentation, the return was shown as BOOL success.  This
  1788.     was incorrect, it has always returned the length.
  1789.  
  1790. dos.library/FGetC                                           dos.library/FGetC
  1791.  
  1792.    NAME
  1793.     FGetC -- Read a character from the specified input (buffered) (V36)
  1794.  
  1795.    SYNOPSIS
  1796.     char = FGetC(fh)
  1797.     D0         D1
  1798.  
  1799.     LONG FGetC(BPTR)
  1800.  
  1801.    FUNCTION
  1802.     Reads the next character from the input stream.  A -1 is
  1803.     returned when EOF or an error is encountered.  This call is buffered.
  1804.     Use Flush() between buffered and unbuffered I/O on a filehandle.
  1805.  
  1806.    INPUTS
  1807.     fh - filehandle to use for buffered I/O
  1808.  
  1809.    RESULT
  1810.     char - character read (0-255) or -1
  1811.  
  1812.    BUGS
  1813.     In V36, after an EOF was read, EOF would always be returned from
  1814.     FGetC() from then on.  Starting in V37, it tries to read from the
  1815.     handler again each time (unless UnGetC(fh,-1) was called).
  1816.  
  1817.    SEE ALSO
  1818.     FPutC(), UnGetC(), Flush()
  1819.  
  1820. dos.library/FGets                                           dos.library/FGets
  1821.  
  1822.    NAME
  1823.     FGets -- Reads a line from the specified input (buffered) (V36)
  1824.  
  1825.    SYNOPSIS
  1826.     buffer = FGets(fh, buf, len)
  1827.     D0             D1  D2   D3
  1828.  
  1829.     STRPTR FGets(BPTR, STRPTR, ULONG)
  1830.  
  1831.    FUNCTION
  1832.     This routine reads in a single line from the specified input stopping
  1833.     at a NEWLINE character or EOF.  In either event, UP TO the number of
  1834.     len specified bytes minus 1 will be copied into the buffer.  Hence if
  1835.     a length of 50 is passed and the input line is longer than 49 bytes,
  1836.     it will return 49 characters.  It returns the buffer pointer normally,
  1837.     or NULL if EOF is the first thing read.
  1838.  
  1839.     If terminated by a newline, the newline WILL be the last character in
  1840.     the buffer.  This is a buffered read routine.  The string read in IS
  1841.     null-terminated.
  1842.  
  1843.    INPUTS
  1844.     fh  - filehandle to use for buffered I/O
  1845.     buf - Area to read bytes into.
  1846.     len - Number of bytes to read, must be > 0.
  1847.  
  1848.    RESULT
  1849.     buffer - Pointer to buffer passed in, or NULL for immediate EOF or for
  1850.          an error.  If NULL is returnd for an EOF, IoErr() will return
  1851.          0.
  1852.  
  1853.    BUGS
  1854.     In V36 and V37, it copies one more byte than it should if it doesn't
  1855.     hit an EOF or newline.  In the example above, it would copy 50 bytes
  1856.     and put a null in the 51st.  This is fixed in dos V39.  Workaround
  1857.     for V36/V37: pass in buffersize-1.
  1858.  
  1859.    SEE ALSO
  1860.     FRead(), FPuts(), FGetC()
  1861.  
  1862. dos.library/FilePart                                     dos.library/FilePart
  1863.  
  1864.    NAME
  1865.     FilePart -- Returns the last component of a path (V36)
  1866.  
  1867.    SYNOPSIS
  1868.     fileptr = FilePart( path )
  1869.     D0             D1
  1870.  
  1871.     STRPTR FilePart( STRPTR )
  1872.  
  1873.    FUNCTION
  1874.     This function returns a pointer to the last component of a string path
  1875.     specification, which will normally be the file name.  If there is only
  1876.     one component, it returns a pointer to the beginning of the string.
  1877.  
  1878.    INPUTS
  1879.     path - pointer to an path string.  May be relative to the current
  1880.            directory or the current disk.
  1881.  
  1882.    RESULT
  1883.     fileptr - pointer to the last component of the path.
  1884.  
  1885.    EXAMPLE
  1886.     FilePart("xxx:yyy/zzz/qqq") would return a pointer to the first 'q'.
  1887.     FilePart("xxx:yyy") would return a pointer to the first 'y').
  1888.  
  1889.    SEE ALSO
  1890.     PathPart(), AddPart()
  1891.  
  1892. dos.library/FindArg                                       dos.library/FindArg
  1893.  
  1894.    NAME
  1895.     FindArg - find a keyword in a template (V36)
  1896.  
  1897.    SYNOPSIS
  1898.     index = FindArg(template, keyword)
  1899.     D0                D1        D2
  1900.  
  1901.     LONG FindArg(STRPTR, STRPTR)
  1902.  
  1903.    FUNCTION
  1904.     Returns the argument number of the keyword, or -1 if it is not a
  1905.     keyword for the template.  Abbreviations are handled.
  1906.  
  1907.    INPUTS
  1908.     keyword  - keyword to search for in template
  1909.     template - template string to search
  1910.  
  1911.    RESULT
  1912.     index - number of entry in template, or -1 if not found
  1913.  
  1914.    BUGS
  1915.     In earlier published versions of the autodoc, keyword and template
  1916.     were backwards.
  1917.  
  1918.    SEE ALSO
  1919.     ReadArgs(), ReadItem(), FreeArgs()
  1920.  
  1921. dos.library/FindCliProc                               dos.library/FindCliProc
  1922.  
  1923.    NAME
  1924.     FindCliProc -- returns a pointer to the requested CLI process (V36)
  1925.  
  1926.    SYNOPSIS
  1927.     proc = FindCliProc(num)
  1928.     D0             D1
  1929.  
  1930.     struct Process *FindCliProc(ULONG)
  1931.  
  1932.    FUNCTION
  1933.     This routine returns a pointer to the CLI process associated with the 
  1934.     given CLI number.  If the process isn't an active CLI process, NULL is
  1935.     returned.  NOTE: should normally be called inside a Forbid(), if you
  1936.     must use this function at all.
  1937.  
  1938.    INPUTS
  1939.     num  - Task number of CLI process (range 1-N)
  1940.  
  1941.    RESULT
  1942.     proc - Pointer to given CLI process
  1943.  
  1944.    SEE ALSO
  1945.     Cli(), Forbid(), MaxCli()
  1946.  
  1947. dos.library/FindDosEntry                             dos.library/FindDosEntry
  1948.  
  1949.    NAME
  1950.     FindDosEntry -- Finds a specific Dos List entry (V36)
  1951.  
  1952.    SYNOPSIS
  1953.     newdlist = FindDosEntry(dlist,name,flags)
  1954.     D0                       D1    D2   D3
  1955.  
  1956.     struct DosList *FindDosEntry(struct DosList *,STRPTR,ULONG)
  1957.  
  1958.    FUNCTION
  1959.     Locates an entry on the device list.  Starts with the entry dlist.
  1960.     NOTE: must be called with the device list locked, no references may be
  1961.     made to dlist after unlocking.
  1962.  
  1963.    INPUTS
  1964.     dlist    - The device entry to start with.
  1965.     name     - Name of device entry (without ':') to locate.
  1966.     flags    - Search control flags.  Use the flags you passed to
  1967.            LockDosList, or a subset of them.  LDF_READ/LDF_WRITE are
  1968.            not required for this call.
  1969.  
  1970.    RESULT
  1971.     newdlist - The device entry or NULL
  1972.  
  1973.    SEE ALSO
  1974.     AddDosEntry(), RemDosEntry(), NextDosEntry(), LockDosList(),
  1975.     MakeDosEntry(), FreeDosEntry()
  1976.  
  1977. dos.library/FindSegment                               dos.library/FindSegment
  1978.  
  1979.    NAME
  1980.     FindSegment - Finds a segment on the resident list (V36)
  1981.  
  1982.    SYNOPSIS
  1983.     segment = FindSegment(name, start, system)
  1984.     D0               D1     D2     D3
  1985.  
  1986.     struct Segment *FindSegment(STRPTR, struct Segment *, LONG)
  1987.  
  1988.    FUNCTION
  1989.     Finds a segment on the Dos resident list by name and type, starting
  1990.     at the segment AFTER 'start', or at the beginning if start is NULL.
  1991.     If system is zero, it will only return nodes with a seg_UC of 0
  1992.     or more.  It does NOT increment the seg_UC, and it does NOT do any
  1993.     locking of the list.  You must Forbid() lock the list to use this
  1994.     call.
  1995.  
  1996.     To use an entry you have found, you must: if the seg_UC is 0 or more,
  1997.     increment it, and decrement it (under Forbid()!) when you're done
  1998.     the the seglist.
  1999.  
  2000.     The other values for seg_UC are:
  2001.         -1   - system module, such as a filesystem or shell
  2002.         -2   - resident shell command
  2003.         -999 - disabled internal command, ignore
  2004.     Negative values should never be modified.  All other negative
  2005.     values between 0 and -32767 are reserved to AmigaDos and should not
  2006.     be used.
  2007.  
  2008.    INPUTS
  2009.     name   - name of segment to find
  2010.     start  - segment to start the search after
  2011.     system - true for system segment, false for normal segments
  2012.  
  2013.    RESULT
  2014.     segment - the segment found or NULL
  2015.  
  2016.    SEE ALSO
  2017.     AddSegment(), RemSegment(), Forbid()
  2018.  
  2019. dos.library/FindVar                                       dos.library/FindVar
  2020.  
  2021.    NAME
  2022.     FindVar -- Finds a local variable (V36)
  2023.  
  2024.    SYNOPSIS
  2025.     var = FindVar( name, type ) 
  2026.     D0        D1    D2
  2027.  
  2028.     struct LocalVar * FindVar(STRPTR, ULONG ) 
  2029.  
  2030.    FUNCTION
  2031.     Finds a local variable structure.
  2032.  
  2033.    INPUTS
  2034.     name - pointer to an variable name.  Note variable names follow
  2035.            filesystem syntax and semantics.
  2036.  
  2037.     type - type of variable to be found (see <dos/var.h>)
  2038.  
  2039.    RESULT
  2040.  
  2041.     var  - pointer to a LocalVar structure or NULL
  2042.  
  2043.    SEE ALSO
  2044.     GetVar(), SetVar(), DeleteVar(), <dos/var.h>
  2045.  
  2046. dos.library/Flush                                           dos.library/Flush
  2047.  
  2048.    NAME
  2049.     Flush -- Flushes buffers for a buffered filehandle (V36)
  2050.  
  2051.    SYNOPSIS
  2052.     success = Flush(fh)
  2053.     D0        D1
  2054.  
  2055.     LONG Flush(BPTR)
  2056.  
  2057.    FUNCTION
  2058.     Flushes any pending buffered writes to the filehandle.  All buffered
  2059.     writes will also be flushed on Close().  If the filehandle was being
  2060.     used for input, it drops the buffer, and tries to Seek() back to the
  2061.     last read position  (so subsequent reads or writes will occur at the
  2062.     expected position in the file).
  2063.  
  2064.    INPUTS
  2065.     fh    - Filehandle to flush.
  2066.  
  2067.    RESULT
  2068.     success - Success or failure.
  2069.  
  2070.    BUGS
  2071.     Before V37 release, Flush() returned a random value.  As of V37,
  2072.     it always returns success (this will be fixed in some future
  2073.     release).
  2074.  
  2075.     The V36 and V37 releases didn't properly flush filehandles which
  2076.     have never had a buffered IO done on them.  This commonly occurs
  2077.     on redirection of input of a command, or when opening a file for
  2078.     input and then calling CreateNewProc() with NP_Arguments, or when
  2079.     using a new filehandle with SelectInput() and then calling
  2080.     RunCommand().  This is fixed in V39.  A workaround would be to
  2081.     do FGetC(), then UnGetC(), then Flush().
  2082.  
  2083.    SEE ALSO
  2084.     FputC(), FGetC(), UnGetC(), Seek(), Close(), CreateNewProc(),
  2085.     SelectInput(), RunCommand()
  2086.  
  2087. dos.library/Format                                         dos.library/Format
  2088.  
  2089.    NAME
  2090.     Format -- Causes a filesystem to initialize itself (V36)
  2091.  
  2092.    SYNOPSIS
  2093.     success = Format(filesystem, volumename, dostype)
  2094.     D0                   D1          D2         D3
  2095.  
  2096.     BOOL Format(STRPTR, STRPTR, ULONG)
  2097.  
  2098.    FUNCTION
  2099.     Interface for initializing new media on a device.  This causes the
  2100.     filesystem to write out an empty disk structure to the media, which
  2101.     should then be ready for use.  This assumes the media has been low-
  2102.     level formatted and verified already.
  2103.  
  2104.     The filesystem should be inhibited before calling Format() to make
  2105.     sure you don't get an ERROR_OBJECT_IN_USE.
  2106.  
  2107.    INPUTS
  2108.     filesystem - Name of device to be formatted.  ':' must be supplied.
  2109.     volumename - Name for volume (if supported).  No ':'.
  2110.     dostype    - Type of format, if filesystem supports multiple types.
  2111.  
  2112.    RESULT
  2113.     success - Success/failure indicator.
  2114.  
  2115.    BUGS
  2116.     Existed, but was non-functional in V36 dos.  (The volumename wasn't
  2117.     converted to a BSTR.)  Workaround: require V37, or under V36
  2118.     convert volumename to a BPTR to a BSTR before calling Format().
  2119.     Note: a number of printed packet docs for ACTION_FORMAT are wrong
  2120.     as to the arguments.
  2121.  
  2122.    SEE ALSO
  2123.  
  2124. dos.library/FPutC                                           dos.library/FPutC
  2125.  
  2126.    NAME
  2127.     FPutC -- Write a character to the specified output (buffered) (V36)
  2128.  
  2129.    SYNOPSIS
  2130.     char = FPutC(fh, char)
  2131.     D0           D1   D2
  2132.  
  2133.     LONG FPutC(BPTR, LONG)
  2134.  
  2135.    FUNCTION
  2136.     Writes a single character to the output stream.  This call is
  2137.     buffered.  Use Flush() between buffered and unbuffered I/O on a
  2138.     filehandle.  Interactive filehandles are flushed automatically
  2139.     on a newline, return, '\0', or line feed.
  2140.  
  2141.    INPUTS
  2142.     fh   - filehandle to use for buffered I/O
  2143.     char - character to write
  2144.  
  2145.    RESULT
  2146.     char - either the character written, or EOF for an error.
  2147.  
  2148.    BUGS
  2149.     Older autodocs indicated that you should pass a UBYTE.  The
  2150.     correct usage is to pass a LONG in the range 0-255.
  2151.  
  2152.    SEE ALSO
  2153.     FGetC(), UnGetC(), Flush()
  2154.  
  2155. dos.library/FPuts                                           dos.library/FPuts
  2156.  
  2157.    NAME
  2158.     FPuts -- Writes a string the the specified output (buffered) (V36)
  2159.  
  2160.    SYNOPSIS
  2161.     error = FPuts(fh, str)
  2162.     D0            D1  D2
  2163.  
  2164.     LONG FPuts(BPTR, STRPTR)
  2165.  
  2166.    FUNCTION
  2167.     This routine writes an unformatted string to the filehandle.  No 
  2168.     newline is appended to the string.  This routine is buffered.
  2169.  
  2170.    INPUTS
  2171.     fh    - filehandle to use for buffered I/O
  2172.     str   - Null-terminated string to be written to default output
  2173.  
  2174.    RESULT
  2175.     error - 0 normally, otherwise -1.  Note that this is opposite of
  2176.         most other Dos functions, which return success.
  2177.  
  2178.    SEE ALSO
  2179.     FGets(), FPutC(), FWrite(), PutStr()
  2180.  
  2181. dos.library/FRead                                           dos.library/FRead
  2182.  
  2183.    NAME
  2184.     FRead -- Reads a number of blocks from an input (buffered) (V36)
  2185.  
  2186.    SYNOPSIS
  2187.     count = FRead(fh, buf, blocklen, blocks)
  2188.     D0          D1  D2     D3        D4
  2189.  
  2190.     LONG FRead(BPTR, STRPTR, ULONG, ULONG)
  2191.  
  2192.    FUNCTION
  2193.     Attempts to read a number of blocks, each blocklen long, into the
  2194.     specified buffer from the input stream.  May return less than
  2195.     the number of blocks requested, either due to EOF or read errors.
  2196.     This call is buffered.
  2197.  
  2198.    INPUTS
  2199.     fh     - filehandle to use for buffered I/O
  2200.     buf      - Area to read bytes into.
  2201.     blocklen - number of bytes per block.  Must be > 0.
  2202.     blocks     - number of blocks to read.  Must be > 0.
  2203.  
  2204.    RESULT
  2205.     count - Number of _blocks_ read, or 0 for EOF.  On an error, the
  2206.         number of blocks actually read is returned.
  2207.  
  2208.    BUGS
  2209.     Doesn't clear IoErr() before starting.  If you want to find out
  2210.     about errors, use SetIoErr(0L) before calling.
  2211.  
  2212.    SEE ALSO
  2213.     FGetC(), FWrite(), FGets()
  2214.  
  2215. dos.library/FreeArgs                                     dos.library/FreeArgs
  2216.  
  2217.    NAME
  2218.     FreeArgs - Free allocated memory after ReadArgs() (V36)
  2219.  
  2220.    SYNOPSIS
  2221.     FreeArgs(rdargs)
  2222.                D1
  2223.  
  2224.     void FreeArgs(struct RDArgs *)
  2225.  
  2226.    FUNCTION
  2227.     Frees memory allocated to return arguments in from ReadArgs().  If
  2228.     ReadArgs allocated the RDArgs structure it will be freed.  If NULL
  2229.     is passed in this function does nothing.
  2230.  
  2231.    INPUTS
  2232.     rdargs - structure returned from ReadArgs() or NULL.
  2233.  
  2234.    SEE ALSO
  2235.     ReadArgs(), ReadItem(), FindArg()
  2236.  
  2237. dos.library/FreeDeviceProc                         dos.library/FreeDeviceProc
  2238.  
  2239.    NAME
  2240.     FreeDeviceProc -- Releases port returned by GetDeviceProc() (V36)
  2241.  
  2242.    SYNOPSIS
  2243.     FreeDeviceProc(devproc)
  2244.              D1
  2245.  
  2246.     void FreeDeviceProc(struct DevProc *)
  2247.  
  2248.    FUNCTION
  2249.     Frees up the structure created by GetDeviceProc(), and any associated
  2250.     temporary locks.
  2251.  
  2252.     Decrements the counter incremented by GetDeviceProc().  The counter
  2253.     is in an extension to the 1.3 process structure.  After calling
  2254.     FreeDeviceProc(), do not use the port or lock again!  It is safe to
  2255.     call FreeDeviceProc(NULL).
  2256.  
  2257.    INPUTS
  2258.     devproc - A value returned by GetDeviceProc()
  2259.  
  2260.    BUGS
  2261.     Counter not currently active in 2.0.
  2262.  
  2263.    SEE ALSO
  2264.     GetDeviceProc(), DeviceProc(), AssignLock(), AssignLate(),
  2265.     AssignPath()
  2266.  
  2267. dos.library/FreeDosEntry                             dos.library/FreeDosEntry
  2268.  
  2269.    NAME
  2270.     FreeDosEntry -- Frees an entry created by MakeDosEntry (V36)
  2271.  
  2272.    SYNOPSIS
  2273.     FreeDosEntry(dlist)
  2274.                    D1
  2275.  
  2276.     void FreeDosEntry(struct DosList *)
  2277.  
  2278.    FUNCTION
  2279.     Frees an entry created by MakeDosEntry().  This routine should be
  2280.     eliminated and replaced by a value passed to FreeDosObject()!
  2281.  
  2282.    INPUTS
  2283.     dlist - DosList to free.
  2284.  
  2285.    SEE ALSO
  2286.     AddDosEntry(), RemDosEntry(), FindDosEntry(), LockDosList(),
  2287.     NextDosEntry(), MakeDosEntry()
  2288.  
  2289. dos.library/FreeDosObject                           dos.library/FreeDosObject
  2290.  
  2291.    NAME
  2292.     FreeDosObject -- Frees an object allocated by AllocDosObject() (V36)
  2293.  
  2294.    SYNOPSIS
  2295.     FreeDosObject(type, ptr)
  2296.                D1   D2
  2297.  
  2298.     void FreeDosObject(ULONG, void *)
  2299.  
  2300.    FUNCTION
  2301.     Frees an object allocated by AllocDosObject().  Do NOT call for
  2302.     objects allocated in any other way.
  2303.  
  2304.    INPUTS
  2305.     type - type passed to AllocDosObject()
  2306.     ptr  - ptr returned by AllocDosObject()
  2307.  
  2308.    BUGS
  2309.     Before V39, DOS_CLI objects will only have the struct
  2310.     CommandLineInterface freed, not the strings it points to.  This
  2311.     is fixed in V39 dos.  Before V39, you can workaround this bug by
  2312.     using FreeVec() on cli_SetName, cli_CommandFile, cli_CommandName,
  2313.     and cli_Prompt, and then setting them all to NULL.  In V39 or
  2314.     above, do NOT use the workaround.
  2315.  
  2316.    SEE ALSO
  2317.     AllocDosObject(), FreeVec(), <dos/dos.h>
  2318.  
  2319. dos.library/FWrite                                         dos.library/FWrite
  2320.  
  2321.    NAME
  2322.     FWrite -- Writes a number of blocks to an output (buffered) (V36)
  2323.  
  2324.    SYNOPSIS
  2325.     count = FWrite(fh, buf, blocklen, blocks)
  2326.     D0           D1  D2     D3        D4
  2327.  
  2328.     LONG FWrite(BPTR, STRPTR, ULONG, ULONG)
  2329.  
  2330.    FUNCTION
  2331.     Attempts to write a number of blocks, each blocklen long, from the
  2332.     specified buffer to the output stream.  May return less than the
  2333.     number of blocks requested, if there is some error such as a full
  2334.     disk or r/w error.  This call is buffered.
  2335.  
  2336.    INPUTS
  2337.     fh     - filehandle to use for buffered I/O
  2338.     buf      - Area to write bytes from.
  2339.     blocklen - number of bytes per block.  Must be > 0.
  2340.     blocks     - number of blocks to read.  Must be > 0.
  2341.  
  2342.    RESULT
  2343.     count - Number of _blocks_ written.  On an error, the number of
  2344.         blocks actually written is returned.
  2345.  
  2346.    BUGS
  2347.     Doesn't clear IoErr() before starting.  If you want to find out
  2348.     about errors, use SetIoErr(0L) before calling.
  2349.  
  2350.    SEE ALSO
  2351.     FPutC(), FRead(), FPuts()
  2352.  
  2353. dos.library/GetArgStr                                   dos.library/GetArgStr
  2354.  
  2355.    NAME
  2356.     GetArgStr -- Returns the arguments for the process (V36)
  2357.  
  2358.    SYNOPSIS
  2359.     ptr = GetArgStr()
  2360.     D0
  2361.  
  2362.     STRPTR GetArgStr(void)
  2363.  
  2364.    FUNCTION
  2365.     Returns a pointer to the (null-terminated) arguments for the program
  2366.     (process).  This is the same string passed in a0 on startup from CLI.
  2367.  
  2368.    RESULT
  2369.     ptr - pointer to arguments
  2370.  
  2371.    SEE ALSO
  2372.     SetArgStr(), RunCommand()
  2373.  
  2374. dos.library/GetConsoleTask                         dos.library/GetConsoleTask
  2375.  
  2376.    NAME
  2377.     GetConsoleTask -- Returns the default console for the process (V36)
  2378.  
  2379.    SYNOPSIS
  2380.     port = GetConsoleTask()
  2381.     D0
  2382.  
  2383.     struct MsgPort *GetConsoleTask(void)
  2384.  
  2385.    FUNCTION
  2386.     Returns the default console task's port (pr_ConsoleTask) for the
  2387.     current process.
  2388.  
  2389.    RESULT
  2390.     port - The pr_MsgPort of the console handler, or NULL.
  2391.  
  2392.    SEE ALSO
  2393.     SetConsoleTask(), Open()
  2394.  
  2395. dos.library/GetCurrentDirName                   dos.library/GetCurrentDirName
  2396.  
  2397.    NAME
  2398.     GetCurrentDirName -- returns the current directory name (V36)
  2399.  
  2400.    SYNOPSIS
  2401.     success = GetCurrentDirName(buf, len)
  2402.     D0                          D1   D2
  2403.  
  2404.     BOOL GetCurrentDirName(STRPTR, LONG)
  2405.  
  2406.    FUNCTION
  2407.     Extracts the current directory name from the CLI structure and puts it 
  2408.     into the buffer.  If the buffer is too small, the name is truncated 
  2409.     appropriately and a failure code returned.  If no CLI structure is 
  2410.     present, a null string is returned in the buffer, and failure from
  2411.     the call (with IoErr() == ERROR_OBJECT_WRONG_TYPE);
  2412.  
  2413.    INPUTS
  2414.     buf     - Buffer to hold extracted name
  2415.     len     - Number of bytes of space in buffer
  2416.  
  2417.    RESULT
  2418.     success - Success/failure indicator
  2419.  
  2420.    BUGS
  2421.     In V36, this routine didn't handle 0-length buffers correctly.
  2422.  
  2423.    SEE ALSO
  2424.     SetCurrentDirName()
  2425.  
  2426. dos.library/GetDeviceProc                           dos.library/GetDeviceProc
  2427.  
  2428.    NAME
  2429.     GetDeviceProc -- Finds a handler to send a message to (V36)
  2430.  
  2431.    SYNOPSIS
  2432.     devproc = GetDeviceProc(name, devproc)
  2433.       D0             D1     D2
  2434.  
  2435.     struct DevProc *GetDeviceProc(STRPTR, struct DevProc *)
  2436.  
  2437.    FUNCTION
  2438.     Finds the handler/filesystem to send packets regarding 'name' to.
  2439.     This may involve getting temporary locks.  It returns a structure
  2440.     that includes a lock and msgport to send to to attempt your operation.
  2441.     It also includes information on how to handle multiple-directory
  2442.     assigns (by passing the DevProc back to GetDeviceProc() until it
  2443.     returns NULL).
  2444.  
  2445.     The initial call to GetDeviceProc() should pass NULL for devproc.  If
  2446.     after using the returned DevProc, you get an ERROR_OBJECT_NOT_FOUND,
  2447.     and (devproc->dvp_Flags & DVPF_ASSIGN) is true, you should call
  2448.     GetDeviceProc() again, passing it the devproc structure.  It will
  2449.     either return a modified devproc structure, or NULL (with
  2450.     ERROR_NO_MORE_ENTRIES in IoErr()).  Continue until it returns NULL.
  2451.  
  2452.     This call also increments the counter that locks a handler/fs into
  2453.     memory.  After calling FreeDeviceProc(), do not use the port or lock
  2454.     again!
  2455.  
  2456.    INPUTS
  2457.     name    - name of the object you wish to access.  This can be a
  2458.           relative path ("foo/bar"), relative to the current volume
  2459.           (":foo/bar"), or relative to a device/volume/assign
  2460.           ("foo:bar").
  2461.     devproc - A value returned by GetDeviceProc() before, or NULL
  2462.  
  2463.    RESULT
  2464.     devproc - a pointer to a DevProc structure or NULL
  2465.  
  2466.    BUGS
  2467.     Counter not currently active in 2.0.
  2468.     In 2.0 and 2.01, you HAD to check DVPF_ASSIGN before calling it again.
  2469.     This was fixed for the 2.02 release of V36.
  2470.  
  2471.    SEE ALSO
  2472.     FreeDeviceProc(), DeviceProc(), AssignLock(), AssignLate(),
  2473.     AssignPath()
  2474.  
  2475. dos.library/GetFileSysTask                         dos.library/GetFileSysTask
  2476.  
  2477.    NAME
  2478.     GetFileSysTask -- Returns the default filesystem for the process (V36)
  2479.  
  2480.    SYNOPSIS
  2481.     port = GetFileSysTask()
  2482.     D0
  2483.  
  2484.     struct MsgPort *GetFileSysTask(void)
  2485.  
  2486.    FUNCTION
  2487.     Returns the default filesystem task's port (pr_FileSystemTask) for the
  2488.     current process.
  2489.  
  2490.    RESULT
  2491.     port - The pr_MsgPort of the filesystem, or NULL.
  2492.  
  2493.    SEE ALSO
  2494.     SetFileSysTask(), Open()
  2495.  
  2496. dos.library/GetProgramDir                           dos.library/GetProgramDir
  2497.  
  2498.    NAME
  2499.     GetProgramDir -- Returns a lock on the directory the program was loaded
  2500.              from (V36)
  2501.  
  2502.    SYNOPSIS
  2503.     lock = GetProgramDir()
  2504.     D0
  2505.  
  2506.     BPTR GetProgramDir(void)
  2507.  
  2508.    FUNCTION
  2509.     Returns a shared lock on the directory the program was loaded from.
  2510.     This can be used for a program to find data files, etc, that are stored
  2511.     with the program, or to find the program file itself.  NULL returns are
  2512.     valid, and may occur, for example, when running a program from the
  2513.     resident list.  You should NOT unlock the lock.
  2514.  
  2515.    RESULT
  2516.     lock - A lock on the directory the current program was loaded from,
  2517.            or NULL if loaded from resident list, etc.
  2518.  
  2519.    BUGS
  2520.     Should return a lock for things loaded via resident.  Perhaps should
  2521.     return currentdir if NULL.
  2522.  
  2523.    SEE ALSO
  2524.     SetProgramDir(), Open()
  2525.  
  2526. dos.library/GetProgramName                         dos.library/GetProgramName
  2527.  
  2528.    NAME
  2529.     GetProgramName -- Returns the current program name (V36)
  2530.  
  2531.    SYNOPSIS
  2532.     success = GetProgramName(buf, len)
  2533.     D0                       D1   D2
  2534.  
  2535.     BOOL GetProgramName(STRPTR, LONG)
  2536.  
  2537.    FUNCTION
  2538.     Extracts the program name from the CLI structure and puts it 
  2539.     into the buffer.  If the buffer is too small, the name is truncated.
  2540.     If no CLI structure is present, a null string is returned in the
  2541.     buffer, and failure from the call (with IoErr() ==
  2542.     ERROR_OBJECT_WRONG_TYPE);
  2543.  
  2544.    INPUTS
  2545.     buf     - Buffer to hold extracted name
  2546.     len     - Number of bytes of space in buffer
  2547.  
  2548.    RESULT
  2549.     success - Success/failure indicator
  2550.  
  2551.    SEE ALSO
  2552.     SetProgramName()
  2553.  
  2554. dos.library/GetPrompt                                   dos.library/GetPrompt
  2555.  
  2556.    NAME
  2557.     GetPrompt -- Returns the prompt for the current process (V36)
  2558.  
  2559.    SYNOPSIS
  2560.     success = GetPrompt(buf, len)
  2561.     D0                  D1   D2
  2562.  
  2563.     BOOL GetPrompt(STRPTR, LONG)
  2564.  
  2565.    FUNCTION
  2566.     Extracts the prompt string from the CLI structure and puts it 
  2567.     into the buffer.  If the buffer is too small, the string is truncated 
  2568.     appropriately and a failure code returned.  If no CLI structure is 
  2569.     present, a null string is returned in the buffer, and failure from
  2570.     the call (with IoErr() == ERROR_OBJECT_WRONG_TYPE);
  2571.  
  2572.    INPUTS
  2573.     buf     - Buffer to hold extracted prompt
  2574.     len     - Number of bytes of space in buffer
  2575.  
  2576.    RESULT
  2577.     success - Success/failure indicator
  2578.  
  2579.    SEE ALSO
  2580.     SetPrompt()
  2581.  
  2582. dos.library/GetVar                                         dos.library/GetVar
  2583.  
  2584.    NAME
  2585.     GetVar -- Returns the value of a local or global variable (V36)
  2586.  
  2587.    SYNOPSIS
  2588.     len = GetVar( name, buffer, size, flags ) 
  2589.     D0           D1     D2     D3    D4
  2590.  
  2591.     LONG GetVar( STRPTR, STRPTR, LONG, ULONG ) 
  2592.  
  2593.    FUNCTION
  2594.     Gets the value of a local or environment variable.  It is advised to
  2595.      only use ASCII strings inside variables, but not required.  This stops
  2596.     putting characters into the destination when a \n is hit, unless
  2597.     GVF_BINARY_VAR is specified.  (The \n is not stored in the buffer.)
  2598.  
  2599.    INPUTS
  2600.     name   - pointer to a variable name.
  2601.     buffer - a user allocated area which will be used to store
  2602.          the value associated with the variable.
  2603.     size   - length of the buffer region in bytes.
  2604.     flags  - combination of type of var to get value of (low 8 bits), and
  2605.          flags to control the behavior of this routine.  Currently
  2606.          defined flags include:
  2607.  
  2608.             GVF_GLOBAL_ONLY - tries to get a global env variable.
  2609.             GVF_LOCAL_ONLY  - tries to get a local variable.
  2610.             GVF_BINARY_VAR  - don't stop at \n
  2611.             GVF_DONT_NULL_TERM - no null termination (only valid
  2612.                       for binary variables). (V37)
  2613.  
  2614.          The default is to try to get a local variable first, then
  2615.          to try to get a global environment variable.
  2616.  
  2617.    RESULT
  2618.     len -   Size of environment variable.  -1 indicates that the
  2619.         variable was not defined (if IoErr() returns
  2620.         ERROR_OBJECT_NOT_FOUND - it returns ERROR_BAD_NUMBER if
  2621.         you specify a size of 0).  If the value would overflow
  2622.         the user buffer, the buffer is truncated.  The buffer
  2623.         returned is null-terminated (even if GVF_BINARY_VAR is
  2624.         used, unless GVF_DONT_NULL_TERM is in effect).  The number
  2625.         of characters put in the buffer (not including null
  2626.         termination) is returned, and IoErr() will return the
  2627.         the size of the variable on success.
  2628.  
  2629.    BUGS
  2630.     LV_VAR is the only type that can be global.
  2631.     Under V36, we documented (and it returned) the size of the variable,
  2632.     not the number of characters transferred.  For V37 this was changed
  2633.     to the number of characters put in the buffer, and the total size
  2634.     of the variable is put in IoErr().
  2635.     GVF_DONT_NULL_TERM only works for local variables under V37.  For
  2636.     V39, it also works for globals.
  2637.  
  2638.    SEE ALSO
  2639.     SetVar(), DeleteVar(), FindVar(), <dos/var.h>
  2640.  
  2641. dos.library/Info                                             dos.library/Info
  2642.  
  2643.     NAME
  2644.     Info -- Returns information about the disk
  2645.  
  2646.     SYNOPSIS
  2647.     success = Info( lock, parameterBlock )
  2648.     D0        D1    D2
  2649.  
  2650.     BOOL Info(BPTR, struct InfoData *)
  2651.  
  2652.     FUNCTION
  2653.     Info() can be used to find information about any disk in use.
  2654.     'lock' refers to the disk, or any file on the disk. The parameter
  2655.     block is returned with information about the size of the disk,
  2656.     number of free blocks and any soft errors.
  2657.  
  2658.     INPUTS
  2659.     lock           - BCPL pointer to a lock
  2660.     parameterBlock - pointer to an InfoData structure
  2661.              (longword aligned)
  2662.  
  2663.     RESULTS
  2664.     success - boolean
  2665.  
  2666.     SPECIAL NOTE:
  2667.     Note that InfoData structure must be longword aligned.
  2668.  
  2669. dos.library/Inhibit                                       dos.library/Inhibit
  2670.  
  2671.    NAME
  2672.     Inhibit -- Inhibits access to a filesystem (V36)
  2673.  
  2674.    SYNOPSIS
  2675.     success = Inhibit(filesystem, flag)
  2676.     D0                    D1       D2
  2677.  
  2678.     BOOL Inhibit(STRPTR,LONG)
  2679.  
  2680.    FUNCTION
  2681.     Sends an ACTION_INHIBIT packet to the indicated handler.  This stops
  2682.     all activity by the handler until uninhibited.  When uninhibited,
  2683.     anything may have happened to the disk in the drive, or there may no
  2684.     longer be one.
  2685.  
  2686.    INPUTS
  2687.     filesystem - Name of device to inhibit (with ':')
  2688.     flag       - New status.  DOSTRUE = inhibited, FALSE = uninhibited
  2689.  
  2690.    RESULT
  2691.     success    - Success/failure indicator
  2692.  
  2693.    SEE ALSO
  2694.  
  2695. dos.library/Input                                           dos.library/Input
  2696.  
  2697.     NAME
  2698.     Input -- Identify the program's initial input file handle
  2699.  
  2700.     SYNOPSIS
  2701.     file = Input()
  2702.     D0
  2703.  
  2704.     BPTR Input(void)
  2705.  
  2706.     FUNCTION
  2707.     Input() is used to identify the initial input stream allocated when
  2708.     the program was initiated.  Never close the filehandle returned by
  2709.     Input!
  2710.  
  2711.     RESULTS
  2712.     file - BCPL pointer to a file handle
  2713.  
  2714.     SEE ALSO
  2715.     Output(), SelectInput()
  2716.  
  2717. dos.library/InternalLoadSeg                       dos.library/InternalLoadSeg
  2718.  
  2719.    NAME
  2720.     InternalLoadSeg -- Low-level load routine (V36)
  2721.  
  2722.    SYNOPSIS
  2723.     seglist = InternalLoadSeg(fh,table,functionarray,stack)
  2724.     D0              D0  A0        A1      A2
  2725.  
  2726.     BPTR InternalLoadSeg(BPTR,BPTR,LONG *,LONG *)
  2727.  
  2728.    FUNCTION
  2729.     Loads from fh.  Table is used when loading an overlay, otherwise
  2730.     should be NULL.  Functionarray is a pointer to an array of functions.
  2731.     Note that the current Seek position after loading may be at any point
  2732.     after the last hunk loaded.  The filehandle will not be closed.  If a
  2733.     stacksize is encoded in the file, the size will be stuffed in the
  2734.     LONG pointed to by stack.  This LONG should be initialized to your
  2735.     default value: InternalLoadSeg() will not change it if no stacksize
  2736.     is found. Clears unused portions of Code and Data hunks (as well as
  2737.     BSS hunks).  (This also applies to LoadSeg() and NewLoadSeg()).
  2738.  
  2739.     If the file being loaded is an overlaid file, this will return
  2740.     -(seglist).  All other results will be positive.
  2741.  
  2742.     NOTE to overlay users: InternalLoadSeg() does NOT return seglist in
  2743.     both D0 and D1, as LoadSeg does.  The current ovs.asm uses LoadSeg(),
  2744.     and assumes returns are in D1.  We will support this for LoadSeg()
  2745.     ONLY.
  2746.  
  2747.    INPUTS
  2748.     fh          - Filehandle to load from.
  2749.     table          - When loading an overlay, otherwise ignored.
  2750.     functionarray - Array of function to be used for read, alloc, and free.
  2751.        FuncTable[0] ->  Actual = ReadFunc(readhandle,buffer,length),DOSBase
  2752.                     D0                D1         A0     D0      A6
  2753.        FuncTable[1] ->  Memory = AllocFunc(size,flags), Execbase
  2754.                     D0                 D0   D1      a6
  2755.        FuncTable[2] ->  FreeFunc(memory,size), Execbase
  2756.                              A1     D0     a6
  2757.     stack         - Pointer to storage (ULONG) for stacksize.
  2758.  
  2759.    RESULT
  2760.     seglist          - Seglist loaded or NULL.  NOT returned in D1!
  2761.  
  2762.    BUGS
  2763.     Really should use tags.
  2764.  
  2765.    SEE ALSO
  2766.     LoadSeg(), UnLoadSeg(), NewLoadSeg(), InternalUnLoadSeg()
  2767.  
  2768. dos.library/InternalUnLoadSeg                   dos.library/InternalUnLoadSeg
  2769.  
  2770.    NAME
  2771.     InternalUnLoadSeg -- Unloads a seglist loaded with InternalLoadSeg() (V36)
  2772.  
  2773.    SYNOPSIS
  2774.     success = InternalUnLoadSeg(seglist,FreeFunc)
  2775.       D0                  D1       A1
  2776.  
  2777.     BOOL InternalUnLoadSeg(BPTR,void (*)(STRPTR,ULONG))
  2778.  
  2779.    FUNCTION
  2780.     Unloads a seglist using freefunc to free segments.  Freefunc is called
  2781.     as for InternalLoadSeg.  NOTE: will call Close() for overlaid
  2782.     seglists.
  2783.  
  2784.    INPUTS
  2785.     seglist  - Seglist to be unloaded
  2786.     FreeFunc - Function called to free memory
  2787.  
  2788.    RESULT
  2789.     success - returns whether everything went OK (since this may close
  2790.           files).  Also returns FALSE if seglist was NULL.
  2791.  
  2792.    BUGS
  2793.     Really should use tags
  2794.  
  2795.    SEE ALSO
  2796.     LoadSeg(), UnLoadSeg(), InternalLoadSeg(), NewUnLoadSeg(), Close()
  2797.  
  2798. dos.library/IoErr                                           dos.library/IoErr
  2799.  
  2800.     NAME
  2801.     IoErr -- Return extra information from the system
  2802.  
  2803.     SYNOPSIS
  2804.     error = IoErr()
  2805.       D0
  2806.  
  2807.     LONG IoErr(void)
  2808.  
  2809.     FUNCTION
  2810.     Most I/O routines return zero to indicate an error. When this 
  2811.     happens (or whatever the defined error return for the routine)
  2812.     this routine may be called to determine more information. It is
  2813.     also used in some routines to pass back a secondary result.
  2814.  
  2815.     Note: there is no guarantee as to the value returned from IoErr()
  2816.     after a successful operation, unless to specified by the routine.
  2817.  
  2818.     RESULTS
  2819.     error - integer
  2820.  
  2821.     SEE ALSO
  2822.     Fault(), PrintFault(), SetIoErr()
  2823.  
  2824. dos.library/IsFileSystem                             dos.library/IsFileSystem
  2825.  
  2826.    NAME
  2827.     IsFileSystem -- returns whether a Dos handler is a filesystem (V36)
  2828.  
  2829.    SYNOPSIS
  2830.     result = IsFileSystem(name)
  2831.     D0                     D1
  2832.  
  2833.     BOOL IsFileSystem(STRPTR)
  2834.  
  2835.    FUNCTION
  2836.     Returns whether the device is a filesystem or not.  A filesystem
  2837.     supports seperate files storing information.  It may also support
  2838.     sub-directories, but is not required to.  If the filesystem doesn't
  2839.     support this new packet, IsFileSystem() will use Lock(":",...) as
  2840.     an indicator.
  2841.  
  2842.    INPUTS
  2843.     name   - Name of device in question, with trailing ':'.
  2844.  
  2845.    RESULT
  2846.     result - Flag to indicate if device is a file system
  2847.  
  2848.    SEE ALSO
  2849.     Lock()
  2850.  
  2851. dos.library/IsInteractive                           dos.library/IsInteractive
  2852.  
  2853.     NAME
  2854.     IsInteractive -- Discover whether a file is "interactive"
  2855.  
  2856.     SYNOPSIS
  2857.     status = IsInteractive( file )
  2858.     D0            D1
  2859.  
  2860.     BOOL IsInteractive(BPTR)
  2861.  
  2862.     FUNCTION
  2863.     The return value 'status' indicates whether the file associated
  2864.     with the file handle 'file' is connected to a virtual terminal.
  2865.  
  2866.     INPUTS
  2867.     file - BCPL pointer to a file handle
  2868.  
  2869.     RESULTS
  2870.     status - boolean
  2871.  
  2872.     SEE ALSO
  2873.  
  2874. dos.library/LoadSeg                                       dos.library/LoadSeg
  2875.  
  2876.     NAME
  2877.     LoadSeg -- Scatterload a loadable file into memory
  2878.  
  2879.     SYNOPSIS
  2880.     seglist = LoadSeg( name )
  2881.     D0           D1
  2882.  
  2883.     BPTR LoadSeg(STRPTR)
  2884.  
  2885.     FUNCTION
  2886.     The file 'name' should be a load module produced by the linker.
  2887.     LoadSeg() scatterloads the CODE, DATA and BSS segments into memory,
  2888.     chaining together the segments with BPTR's on their first words.
  2889.     The end of the chain is indicated by a zero.  There can be any number
  2890.     of segments in a file.  All necessary relocation is handled by
  2891.     LoadSeg().
  2892.  
  2893.     In the event of an error any blocks loaded will be unloaded and a
  2894.     NULL result returned.
  2895.  
  2896.     If the module is correctly loaded then the output will be a pointer
  2897.     at the beginning of the list of blocks. Loaded code is unloaded via
  2898.     a call to UnLoadSeg().
  2899.  
  2900.     INPUTS
  2901.     name - pointer to a null-terminated string
  2902.  
  2903.     RESULTS
  2904.     seglist - BCPL pointer to a seglist
  2905.  
  2906.     SEE ALSO
  2907.     UnLoadSeg(), InternalLoadSeg(), InternalUnLoadSeg(), CreateProc(),
  2908.     CreateNewProc(), NewLoadSeg().
  2909.  
  2910. dos.library/Lock                                             dos.library/Lock
  2911.  
  2912.     NAME
  2913.     Lock -- Lock a directory or file
  2914.  
  2915.     SYNOPSIS
  2916.     lock  = Lock( name, accessMode )
  2917.     D0          D1    D2
  2918.  
  2919.     BPTR Lock(STRPTR, LONG)
  2920.  
  2921.     FUNCTION
  2922.     A filing system lock on the file or directory 'name' is returned if
  2923.     possible.
  2924.  
  2925.     If the accessMode is ACCESS_READ, the lock is a shared read lock;
  2926.     if the accessMode is ACCESS_WRITE then it is an exclusive write
  2927.     lock.  Do not use random values for mode.
  2928.  
  2929.     If Lock() fails (that is, if it cannot obtain a filing system lock
  2930.     on the file or directory) it returns a zero.
  2931.  
  2932.     Tricky assumptions about the internal format of a lock are unwise,
  2933.     as are any attempts to use the fl_Link or fl_Access fields.
  2934.  
  2935.     INPUTS
  2936.     name       - pointer to a null-terminated string
  2937.     accessMode - integer
  2938.  
  2939.     RESULTS
  2940.     lock - BCPL pointer to a lock
  2941.  
  2942.     SEE ALSO
  2943.     UnLock(), DupLock(), ChangeMode(), NameFromLock(), DupLockFromFH()
  2944.  
  2945. dos.library/LockDosList                               dos.library/LockDosList
  2946.  
  2947.    NAME
  2948.     LockDosList -- Locks the specified Dos Lists for use (V36)
  2949.  
  2950.    SYNOPSIS
  2951.     dlist = LockDosList(flags)
  2952.     D0             D1
  2953.  
  2954.     struct DosList *LockDosList(ULONG)
  2955.  
  2956.    FUNCTION
  2957.     Locks the dos device list in preparation to walk the list.
  2958.     If the list is 'busy' then this routine will not return until it is 
  2959.     available.  This routine "nests": you can call it multiple times, and
  2960.     then must unlock it the same number of times.  The dlist
  2961.     returned is NOT a valid entry: it is a special value.  Note that
  2962.     for 1.3 compatibility, it also does a Forbid() - this will probably
  2963.     be removed at some future time.  The 1.3 Forbid() locking of this
  2964.     list had some race conditions.  The pointer returned by this is NOT
  2965.     an actual DosList pointer - you should use on of the other DosEntry
  2966.     calls to get actual pointers to DosList structures (such as
  2967.     NextDosEntry()), passing the value returned by LockDosList()
  2968.     as the dlist value.
  2969.  
  2970.     Note for handler writers: you should never call this function with
  2971.     LDF_WRITE, since it can deadlock you (if someone has it read-locked
  2972.     and they're trying to send you a packet).  Use AttemptLockDosList()
  2973.     instead, and effectively busy-wait with delays for the list to be
  2974.     available.  The other option is that you can spawn a process to
  2975.     add the entry safely.
  2976.  
  2977.     As an example, here's how you can search for all volumes of a specific
  2978.     name and do something with them:
  2979.  
  2980.     2.0 way:
  2981.  
  2982.         dl = LockDosList(LDF_VOLUMES|LDF_READ);
  2983.         while (dl = FindDosEntry(dl,name,LDF_VOLUMES))
  2984.         {
  2985.             Add to list of volumes to process or break out of
  2986.             the while loop.
  2987.             (You could try using it here, but I advise
  2988.             against it for compatability reasons if you
  2989.             are planning on continuing to examine the list.)
  2990.         }
  2991.         
  2992.         process list of volumes saved above, or current entry if
  2993.         you're only interested in the first one of that name.
  2994.  
  2995.         UnLockDosList(LDF_VOLUMES|LDF_READ);
  2996.                   \* must not use dl after this! *\
  2997.  
  2998.     1.3/2.0 way:
  2999.  
  3000.         if (version >= 36)
  3001.             dl = LockDosList(LDF_VOLUMES|LDF_READ);
  3002.         else {
  3003.             Forbid();
  3004.             /* tricky! note dol_Next is at offset 0! */
  3005.             dl = &(...->di_DeviceList);
  3006.         }
  3007.  
  3008.         while (version >= 36 ?
  3009.                 dl = FindDosEntry(dl,name,LDF_VOLUMES) :
  3010.                     dl = yourfindentry(dl,name,DLT_VOLUME))
  3011.         {
  3012.             Add to list of volumes to process, or break out of
  3013.             the while loop.
  3014.             Do NOT lock foo1/foo2 here if you will continue
  3015.             to examine the list - it breaks the forbid
  3016.             and the list may change on you.
  3017.         }
  3018.         
  3019.         process list of volumes saved above, or current entry if
  3020.         you're only interested in the first one of that name.
  3021.  
  3022.         if (version >= 36)
  3023.             UnLockDosList(LDF_VOLUMES|LDF_READ);
  3024.         else
  3025.             Permit();
  3026.         \* must not use dl after this! *\
  3027.         ...
  3028.  
  3029.         struct DosList *
  3030.         yourfindentry (struct DosList *dl, STRPTRname, type)
  3031.         {
  3032.         \* tricky - depends on dol_Next being at offset 0,
  3033.            and the initial ptr being a ptr to di_DeviceList! *\
  3034.             while (dl = dl->dol_Next)
  3035.             {
  3036.                 if (dl->dol_Type == type &&
  3037.                 stricmp(name,BADDR(dl->dol_Name)+1) == 0)
  3038.                 {
  3039.                 break;
  3040.                 }
  3041.             }
  3042.             return dl;
  3043.         }
  3044.  
  3045.    INPUTS
  3046.     flags - Flags stating which types of nodes you want to lock.
  3047.  
  3048.    RESULT
  3049.     dlist - Pointer to the head of the list.  NOT a valid node!
  3050.  
  3051.    SEE ALSO
  3052.     AttemptLockDosList(), UnLockDosList(), Forbid(), NextDosEntry()
  3053.  
  3054. dos.library/LockRecord                                 dos.library/LockRecord
  3055.  
  3056.    NAME
  3057.     LockRecord -- Locks a portion of a file (V36)
  3058.  
  3059.    SYNOPSIS
  3060.     success = LockRecord(fh,offset,length,mode,timeout)
  3061.     D0                   D1   D2     D3    D4    D5
  3062.  
  3063.     BOOL LockRecord(BPTR,ULONG,ULONG,ULONG,ULONG)
  3064.  
  3065.    FUNCTION
  3066.     This locks a portion of a file for exclusive access.  Timeout is how
  3067.     long to wait in ticks (1/50 sec) for the record to be available.
  3068.  
  3069.     Valid modes are:
  3070.         REC_EXCLUSIVE
  3071.         REC_EXCLUSIVE_IMMED
  3072.         REC_SHARED
  3073.         REC_SHARED_IMMED
  3074.     For the IMMED modes, the timeout is ignored.
  3075.  
  3076.     Record locks are tied to the filehandle used to create them.  The
  3077.     same filehandle can get any number of exclusive locks on the same
  3078.     record, for example.  These are cooperative locks, they only
  3079.     affect other people calling LockRecord().
  3080.  
  3081.    INPUTS
  3082.     fh      - File handle for which to lock the record
  3083.     offset  - Record start position
  3084.     length  - Length of record in bytes
  3085.     mode    - Type of lock requester
  3086.     timeout - Timeout interval in ticks.  0 is legal.
  3087.  
  3088.    RESULT
  3089.     success - Success or failure
  3090.  
  3091.    BUGS
  3092.     In 2.0 through 2.02 (V36), LockRecord() only worked in the ramdisk.
  3093.     Attempting to lock records on the disk filesystem causes a crash.
  3094.     This was fixed for V37.
  3095.  
  3096.    SEE ALSO
  3097.     LockRecords(), UnLockRecord(), UnLockRecords()
  3098.  
  3099. dos.library/LockRecords                               dos.library/LockRecords
  3100.  
  3101.    NAME
  3102.     LockRecords -- Lock a series of records (V36)
  3103.  
  3104.    SYNOPSIS
  3105.     success = LockRecords(record_array,timeout)
  3106.     D0                       D1           D2
  3107.  
  3108.     BOOL LockRecords(struct RecordLock *,ULONG)
  3109.  
  3110.    FUNCTION
  3111.     This locks several records within a file for exclusive access.
  3112.     Timeout is how long to wait in ticks for the records to be available.
  3113.     The wait is applied to each attempt to lock each record in the list.
  3114.     It is recommended that you always lock a set of records in the same
  3115.     order to reduce possibilities of deadlock.
  3116.  
  3117.     The array of RecordLock structures is terminated by an entry with
  3118.     rec_FH of NULL.
  3119.  
  3120.    INPUTS
  3121.     record_array - List of records to be locked
  3122.     timeout      - Timeout interval.  0 is legal
  3123.  
  3124.    RESULT
  3125.     success      - Success or failure
  3126.  
  3127.    BUGS
  3128.     See LockRecord()
  3129.  
  3130.    SEE ALSO
  3131.     LockRecord(), UnLockRecord(), UnLockRecords()
  3132.  
  3133. dos.library/MakeDosEntry                             dos.library/MakeDosEntry
  3134.  
  3135.    NAME
  3136.     MakeDosEntry -- Creates a DosList structure (V36)
  3137.  
  3138.    SYNOPSIS
  3139.     newdlist = MakeDosEntry(name, type)
  3140.     D0                       D1    D2
  3141.  
  3142.     struct DosList *MakeDosEntry(STRPTR, LONG)
  3143.  
  3144.    FUNCTION
  3145.     Create a DosList structure, including allocating a name and correctly
  3146.     null-terminating the BSTR.  It also sets the dol_Type field, and sets
  3147.     all other fields to 0.  This routine should be eliminated and replaced
  3148.     by a value passed to AllocDosObject()!
  3149.  
  3150.    INPUTS
  3151.     name - name for the device/volume/assign node.
  3152.     type - type of node.
  3153.  
  3154.    RESULT
  3155.     newdlist - The new device entry or NULL.
  3156.  
  3157.    SEE ALSO
  3158.     AddDosEntry(), RemDosEntry(), FindDosEntry(), LockDosList(),
  3159.     NextDosEntry(), FreeDosEntry()
  3160.  
  3161. dos.library/MakeLink                                     dos.library/MakeLink
  3162.  
  3163.    NAME
  3164.     MakeLink -- Creates a filesystem link (V36)
  3165.  
  3166.    SYNOPSIS
  3167.     success = MakeLink( name, dest, soft )
  3168.     D0             D1    D2    D3
  3169.  
  3170.     BOOL MakeLink( STRPTR, LONG, LONG )
  3171.  
  3172.    FUNCTION
  3173.     Create a filesystem link from 'name' to dest.  For "soft-links",
  3174.     dest is a pointer to a null-terminated path string.  For "hard-
  3175.     links", dest is a lock (BPTR).  'soft' is FALSE for hard-links,
  3176.     non-zero otherwise.
  3177.  
  3178.     Soft-links are resolved at access time by a combination of the
  3179.     filesystem (by returning ERROR_IS_SOFT_LINK to dos), and by
  3180.     Dos (using ReadLink() to resolve any links that are hit).
  3181.  
  3182.     Hard-links are resolved by the filesystem in question.  A series
  3183.     of hard-links to a file are all equivalent to the file itself.
  3184.     If one of the links (or the original entry for the file) is 
  3185.     deleted, the data remains until there are no links left.
  3186.  
  3187.    INPUTS
  3188.     name - Name of the link to create
  3189.     dest - CPTR to path string, or BPTR lock
  3190.     soft - FALSE for hard-links, non-zero for soft-links
  3191.  
  3192.    RESULT
  3193.     Success - boolean
  3194.  
  3195.    BUGS
  3196.     In V36, soft-links didn't work in the ROM filesystem.  This was
  3197.     fixed for V37.
  3198.  
  3199.    SEE ALSO
  3200.     ReadLink(), Open(), Lock()
  3201.  
  3202. dos.library/MatchEnd                                     dos.library/MatchEnd
  3203.  
  3204.    NAME
  3205.     MatchEnd -- Free storage allocated for MatchFirst()/MatchNext() (V36)
  3206.  
  3207.    SYNOPSIS
  3208.     MatchEnd(AnchorPath)
  3209.                  D1
  3210.  
  3211.     VOID MatchEnd(struct AnchorPath *)
  3212.  
  3213.    FUNCTION
  3214.     Return all storage associated with a given search.
  3215.  
  3216.    INPUTS
  3217.     AnchorPath - Anchor used for MatchFirst()/MatchNext()
  3218.              MUST be longword aligned!
  3219.  
  3220.    SEE ALSO
  3221.     MatchFirst(), ParsePattern(), Examine(), CurrentDir(), Examine(),
  3222.     MatchNext(), ExNext(), <dos/dosasl.h>
  3223.  
  3224. dos.library/MatchFirst                                 dos.library/MatchFirst
  3225.  
  3226.    NAME
  3227.     MatchFirst -- Finds file that matches pattern (V36)
  3228.  
  3229.    SYNOPSIS
  3230.     error = MatchFirst(pat, AnchorPath)
  3231.     D0                 D1       D2
  3232.  
  3233.     LONG MatchFirst(STRPTR, struct AnchorPath *)
  3234.  
  3235.    FUNCTION
  3236.     Locates the first file or directory that matches a given pattern.
  3237.     MatchFirst() is passed your pattern (you do not pass it through
  3238.     ParsePattern() - MatchFirst() does that for you), and the control
  3239.     structure.  MatchFirst() normally initializes your AnchorPath
  3240.     structure for you, and returns the first file that matched your
  3241.     pattern, or an error.  Note that MatchFirst()/MatchNext() are unusual
  3242.     for Dos in that they return 0 for success, or the error code (see
  3243.     <dos/dos.h>), instead of the application getting the error code
  3244.     from IoErr().
  3245.  
  3246.     When looking at the result of MatchFirst()/MatchNext(), the ap_Info
  3247.     field of your AnchorPath has the results of an Examine() of the object.
  3248.     You normally get the name of the object from fib_FileName, and the
  3249.     directory it's in from ap_Current->an_Lock.  To access this object,
  3250.     normally you would temporarily CurrentDir() to the lock, do an action
  3251.     to the file/dir, and then CurrentDir() back to your original directory.
  3252.     This makes certain you affect the right object even when two volumes
  3253.     of the same name are in the system.  You can use ap_Buf (with
  3254.     ap_Strlen) to get a name to report to the user.
  3255.  
  3256.     To initialize the AnchorPath structure (particularily when reusing
  3257.     it), set ap_BreakBits to the signal bits (CDEF) that you want to take
  3258.     a break on, or NULL, if you don't want to convenience the user.
  3259.     ap_Flags should be set to any flags you need or all 0's otherwise.
  3260.     ap_FoundBreak should be cleared if you'll be using breaks.
  3261.  
  3262.     If you want to have the FULL PATH NAME of the files you found,
  3263.     allocate a buffer at the END of this structure, and put the size of
  3264.     it into ap_Strlen.  If you don't want the full path name, make sure
  3265.     you set ap_Strlen to zero.  In this case, the name of the file, and
  3266.     stats are available in the ap_Info, as per usual.
  3267.  
  3268.     Then call MatchFirst() and then afterwards, MatchNext() with this
  3269.     structure.  You should check the return value each time (see below)
  3270.     and take the appropriate action, ultimately calling MatchEnd() when
  3271.     there are no more files or you are done.  You can tell when you are
  3272.     done by checking for the normal AmigaDOS return code
  3273.     ERROR_NO_MORE_ENTRIES.
  3274.  
  3275.     Note: patterns with trailing slashes may cause MatchFirst()/MatchNext()
  3276.     to return with an ap_Current->an_Lock on the object, and a filename
  3277.     of the empty string ("").
  3278.  
  3279.     See ParsePattern() for more information on the patterns.
  3280.  
  3281.    INPUTS
  3282.     pat        - Pattern to search for
  3283.     AnchorPath - Place holder for search.  MUST be longword aligned!
  3284.  
  3285.    RESULT
  3286.     error - 0 for success or error code.  (Opposite of most Dos calls!)
  3287.  
  3288.    BUGS
  3289.     In V36, there were a number of bugs with MatchFirst()/MatchNext().
  3290.     One was that if you entered a directory with a name like "df0:l"
  3291.     using DODIR, it would re-lock the full string "df0:l", which can
  3292.     cause problems if the disk has changed.  It also had problems
  3293.     with patterns such as #?/abc/def - the ap_Current->an_Lock would
  3294.     not be on the directory def is found in.  ap_Buf would be correct,
  3295.     however.  It had similar problems with patterns with trailing
  3296.     slashes.  These have been fixed for V37 and later.
  3297.  
  3298.     A bug that has not been fixed for V37 concerns a pattern of a
  3299.     single directory name (such as "l").  If you enter such a directory
  3300.     via DODIR, it re-locks l relative to the current directory.  Thus
  3301.     you must not change the current directory before calling MatchNext()
  3302.     with DODIR in that situation.  If you aren't using DODIR to enter
  3303.     directories you can ignore this.  This may be fixed in some upcoming
  3304.     release.
  3305.  
  3306.    SEE ALSO
  3307.     MatchNext(), ParsePattern(), Examine(), CurrentDir(), Examine(),
  3308.     MatchEnd(), ExNext(), <dos/dosasl.h>
  3309.  
  3310. dos.library/MatchNext                                   dos.library/MatchNext
  3311.  
  3312.    NAME
  3313.     MatchNext - Finds the next file or directory that matches pattern (V36)
  3314.  
  3315.    SYNOPSIS
  3316.     error = MatchNext(AnchorPath)
  3317.     D0                    D1
  3318.  
  3319.     LONG MatchNext(struct AnchorPath *)
  3320.  
  3321.    FUNCTION
  3322.     Locates the next file or directory that matches a given pattern.
  3323.     See <dos/dosasl.h> for more information.  Various bits in the flags
  3324.     allow the application to control the operation of MatchNext().
  3325.  
  3326.     See MatchFirst() for other notes.
  3327.  
  3328.    INPUTS
  3329.     AnchorPath - Place holder for search.  MUST be longword aligned!
  3330.  
  3331.    RESULT
  3332.     error - 0 for success or error code.  (Opposite of most Dos calls)
  3333.  
  3334.    BUGS
  3335.     See MatchFirst().
  3336.  
  3337.    SEE ALSO
  3338.     MatchFirst(), ParsePattern(), Examine(), CurrentDir(), Examine(),
  3339.     MatchEnd(), ExNext(), <dos/dosasl.h>
  3340.  
  3341. dos.library/MatchPattern                             dos.library/MatchPattern
  3342.  
  3343.    NAME
  3344.     MatchPattern --  Checks for a pattern match with a string (V36)
  3345.  
  3346.    SYNOPSIS
  3347.     match = MatchPattern(pat, str)
  3348.     D0                   D1   D2
  3349.  
  3350.     BOOL MatchPattern(STRPTR, STRPTR)
  3351.  
  3352.    FUNCTION
  3353.     Checks for a pattern match with a string.  The pattern must be a
  3354.     tokenized string output by ParsePattern().  This routine is
  3355.     case-sensitive.
  3356.  
  3357.     NOTE: this routine is highly recursive.  You must have at least
  3358.     1500 free bytes of stack to call this (it will cut off it's
  3359.     recursion before going any deeper than that and return failure).
  3360.     That's _currently_ enough for about 100 levels deep of #, (, ~, etc.
  3361.  
  3362.    INPUTS
  3363.     pat - Special pattern string to match as returned by ParsePattern()
  3364.     str - String to match against given pattern
  3365.  
  3366.    RESULT
  3367.     match - success or failure of pattern match.  On failure,
  3368.         IoErr() will return 0 or ERROR_TOO_MANY_LEVELS (starting
  3369.         with V37 - before that there was no stack checking).
  3370.  
  3371.    SEE ALSO
  3372.     ParsePattern(), MatchPatternNoCase(), MatchFirst(), MatchNext()
  3373.  
  3374. dos.library/MatchPatternNoCase                 dos.library/MatchPatternNoCase
  3375.  
  3376.    NAME
  3377.     MatchPatternNoCase --  Checks for a pattern match with a string (V37)
  3378.  
  3379.    SYNOPSIS
  3380.     match = MatchPatternNoCase(pat, str)
  3381.     D0                         D1   D2
  3382.  
  3383.     BOOL MatchPatternNoCase(STRPTR, STRPTR)
  3384.  
  3385.    FUNCTION
  3386.     Checks for a pattern match with a string.  The pattern must be a
  3387.     tokenized string output by ParsePatternNoCase().  This routine is
  3388.     case-insensitive.
  3389.  
  3390.     NOTE: this routine is highly recursive.  You must have at least
  3391.     1500 free bytes of stack to call this (it will cut off it's
  3392.     recursion before going any deeper than that and return failure).
  3393.     That's _currently_ enough for about 100 levels deep of #, (, ~, etc.
  3394.  
  3395.    INPUTS
  3396.     pat - Special pattern string to match as returned by ParsePatternNoCase()
  3397.     str - String to match against given pattern
  3398.  
  3399.    RESULT
  3400.     match - success or failure of pattern match.  On failure,
  3401.         IoErr() will return 0 or ERROR_TOO_MANY_LEVELS (starting
  3402.         with V37 - before that there was no stack checking).
  3403.  
  3404.    BUGS
  3405.     See ParsePatternNoCase().
  3406.  
  3407.    SEE ALSO
  3408.     ParsePatternNoCase(), MatchPattern(), MatchFirst(), MatchNext()
  3409.  
  3410. dos.library/MaxCli                                         dos.library/MaxCli
  3411.  
  3412.    NAME
  3413.     MaxCli -- returns the highest CLI process number possibly in use (V36)
  3414.  
  3415.    SYNOPSIS
  3416.     number = MaxCli()
  3417.     D0
  3418.  
  3419.     LONG MaxCli(void)
  3420.  
  3421.    FUNCTION
  3422.     Returns the highest CLI number that may be in use.  CLI numbers are
  3423.     reused, and are usually as small as possible.  To find all CLIs, scan
  3424.     using FindCliProc() from 1 to MaxCLI().  The number returned by
  3425.     MaxCli() may change as processes are created and destroyed.
  3426.  
  3427.    RESULT
  3428.     number - The highest CLI number that _may_ be in use.
  3429.  
  3430.    SEE ALSO
  3431.     FindCliProc(), Cli()
  3432.  
  3433. dos.library/NameFromFH                                 dos.library/NameFromFH
  3434.  
  3435.    NAME
  3436.     NameFromFH -- Get the name of an open filehandle (V36)
  3437.  
  3438.    SYNOPSIS
  3439.     success = NameFromFH(fh, buffer, len)
  3440.     D0                   D1    D2    D3
  3441.  
  3442.     BOOL NameFromFH(BPTR, STRPTR, LONG)
  3443.  
  3444.    FUNCTION
  3445.     Returns a fully qualified path for the filehandle.  This routine is
  3446.     guaranteed not to write more than len characters into the buffer.  The
  3447.     name will be null-terminated.  See NameFromLock() for more information.
  3448.  
  3449.    INPUTS
  3450.     fh     - Lock of object to be examined.
  3451.     buffer - Buffer to store name.
  3452.     len    - Length of buffer.
  3453.  
  3454.    RESULT
  3455.     success - Success/failure indicator.
  3456.  
  3457.    SEE ALSO
  3458.     NameFromLock()
  3459.  
  3460. dos.library/NameFromLock                             dos.library/NameFromLock
  3461.  
  3462.    NAME
  3463.     NameFromLock -- Returns the name of a locked object (V36)
  3464.  
  3465.    SYNOPSIS
  3466.     success = NameFromLock(lock, buffer, len)
  3467.     D0                      D1     D2    D3
  3468.  
  3469.     BOOL NameFromLock(BPTR, STRPTR, LONG)
  3470.  
  3471.    FUNCTION
  3472.     Returns a fully qualified path for the lock.  This routine is
  3473.     guaranteed not to write more than len characters into the buffer.  The
  3474.     name will be null-terminated.  NOTE: if the volume is not mounted,
  3475.     the system will request it (unless of course you set pr_WindowPtr to
  3476.     -1).  If the volume is not mounted or inserted, it will return an
  3477.     error.  If the lock passed in is NULL, "SYS:" will be returned. If
  3478.     the buffer is too short, an error will be returned, and IoErr() will
  3479.     return ERROR_LINE_TOO_LONG.
  3480.  
  3481.    INPUTS
  3482.     lock   - Lock of object to be examined.
  3483.     buffer - Buffer to store name.
  3484.     len    - Length of buffer.
  3485.  
  3486.    RESULT
  3487.     success - Success/failure indicator.
  3488.  
  3489.    BUGS
  3490.     Should return the name of the boot volume instead of SYS: for a NULL
  3491.     lock.
  3492.  
  3493.    SEE ALSO
  3494.     NameFromFH(), Lock()
  3495.  
  3496. dos.library/NewLoadSeg                                 dos.library/NewLoadSeg
  3497.  
  3498.    NAME
  3499.     NewLoadSeg -- Improved version of LoadSeg for stacksizes (V36)
  3500.  
  3501.    SYNOPSIS
  3502.     seglist = NewLoadSeg(file, tags)
  3503.     D0              D1    D2
  3504.  
  3505.     BPTR NewLoadSeg(STRPTR, struct TagItem *)
  3506.  
  3507.     seglist = NewLoadSegTagList(file, tags)
  3508.     D0                 D1    D2
  3509.  
  3510.     BPTR NewLoadSegTagList(STRPTR, struct TagItem *)
  3511.  
  3512.     seglist = NewLoadSegTags(file, ...)
  3513.  
  3514.     BPTR NewLoadSegTags(STRPTR, ...)
  3515.  
  3516.    FUNCTION
  3517.     Does a LoadSeg on a file, and takes additional actions based on the
  3518.     tags supplied.
  3519.  
  3520.     Clears unused portions of Code and Data hunks (as well as BSS hunks).
  3521.     (This also applies to InternalLoadSeg() and LoadSeg()).
  3522.  
  3523.     NOTE to overlay users: NewLoadSeg() does NOT return seglist in
  3524.     both D0 and D1, as LoadSeg does.  The current ovs.asm uses LoadSeg(),
  3525.     and assumes returns are in D1.  We will support this for LoadSeg()
  3526.     ONLY.
  3527.  
  3528.    INPUTS
  3529.     file - Filename of file to load
  3530.     tags - pointer to tagitem array
  3531.  
  3532.    RESULT
  3533.     seglist - Seglist loaded, or NULL
  3534.  
  3535.    BUGS
  3536.     No tags are currently defined.
  3537.  
  3538.    SEE ALSO
  3539.     LoadSeg(), UnLoadSeg(), InternalLoadSeg(), InternalUnLoadSeg()
  3540.  
  3541. dos.library/NextDosEntry                             dos.library/NextDosEntry
  3542.  
  3543.    NAME
  3544.     NextDosEntry -- Get the next Dos List entry (V36)
  3545.  
  3546.    SYNOPSIS
  3547.     newdlist = NextDosEntry(dlist,flags)
  3548.     D0                       D1    D2
  3549.  
  3550.     struct DosList *NextDosEntry(struct DosList *,ULONG)
  3551.  
  3552.    FUNCTION
  3553.     Find the next Dos List entry of the right type.  You MUST have locked
  3554.     the types you're looking for.  Returns NULL if there are no more of
  3555.     that type in the list.
  3556.  
  3557.    INPUTS
  3558.     dlist    - The current device entry.
  3559.     flags     - What type of entries to look for.
  3560.  
  3561.    RESULT
  3562.     newdlist - The next device entry of the right type or NULL.
  3563.  
  3564.    SEE ALSO
  3565.     AddDosEntry(), RemDosEntry(), FindDosEntry(), LockDosList(),
  3566.     MakeDosEntry(), FreeDosEntry()
  3567.  
  3568. dos.library/Open                                             dos.library/Open
  3569.  
  3570.     NAME
  3571.     Open -- Open a file for input or output
  3572.  
  3573.     SYNOPSIS
  3574.     file = Open( name, accessMode )
  3575.     D0         D1    D2
  3576.  
  3577.     BPTR Open(STRPTR, LONG)
  3578.  
  3579.     FUNCTION
  3580.     The named file is opened and a file handle returned.  If the
  3581.     accessMode is MODE_OLDFILE, an existing file is opened for reading
  3582.     or writing. If the value is MODE_NEWFILE, a new file is created for
  3583.     writing. MODE_READWRITE opens a file with an shared lock, but
  3584.     creates it if it didn't exist.  Open types are documented in the
  3585.     <dos/dos.h> or <libraries/dos.h> include file.
  3586.  
  3587.     The 'name' can be a filename (optionally prefaced by a device
  3588.     name), a simple device such as NIL:, a window specification such as
  3589.     CON: or RAW: followed by window parameters, or "*", representing the
  3590.     current window.  Note that as of V36, "*" is obsolete, and CONSOLE:
  3591.     should be used instead.
  3592.  
  3593.     If the file cannot be opened for any reason, the value returned
  3594.     will be zero, and a secondary error code will be available by
  3595.     calling the routine IoErr().
  3596.  
  3597.     INPUTS
  3598.     name       - pointer to a null-terminated string
  3599.     accessMode - integer
  3600.  
  3601.     RESULTS
  3602.     file - BCPL pointer to a file handle
  3603.  
  3604.     SEE ALSO
  3605.     Close(), ChangeMode(), NameFromFH(), ParentOfFH(), ExamineFH()
  3606.  
  3607. dos.library/OpenFromLock                             dos.library/OpenFromLock
  3608.  
  3609.    NAME
  3610.     OpenFromLock -- Opens a file you have a lock on (V36)
  3611.  
  3612.    SYNOPSIS
  3613.     fh = OpenFromLock(lock)
  3614.     D0                 D1
  3615.  
  3616.     BPTR OpenFromLock(BPTR)
  3617.  
  3618.    FUNCTION
  3619.     Given a lock, this routine performs an open on that lock.  If the open
  3620.     succeeds, the lock is (effectively) relinquished, and should not be
  3621.     UnLock()ed or used.  If the open fails, the lock is still usable.
  3622.     The lock associated with the file internally is of the same access
  3623.     mode as the lock you gave up - shared is similar to MODE_OLDFILE,
  3624.     exclusive is similar to MODE_NEWFILE.
  3625.  
  3626.    INPUTS
  3627.     lock - Lock on object to be opened.
  3628.  
  3629.    RESULT
  3630.     fh   - Newly opened file handle or NULL for failure
  3631.  
  3632.    BUGS
  3633.     In the original V36 autodocs, this was shown (incorrectly) as
  3634.     taking a Mode parameter as well.  The prototypes and pragmas were
  3635.     also wrong.
  3636.  
  3637.    SEE ALSO
  3638.     Open(), Close(), Lock(), UnLock()
  3639.  
  3640. dos.library/Output                                         dos.library/Output
  3641.  
  3642.     NAME
  3643.     Output -- Identify the programs' initial output file handle
  3644.  
  3645.     SYNOPSIS
  3646.     file = Output()
  3647.     D0
  3648.  
  3649.     BPTR Output(void)
  3650.  
  3651.     FUNCTION
  3652.     Output() is used to identify the initial output stream allocated
  3653.     when the program was initiated.  Never close the filehandle returned
  3654.     by Output().
  3655.  
  3656.     RESULTS
  3657.     file - BCPL pointer to a file handle
  3658.  
  3659.     SEE ALSO
  3660.     Input()
  3661.  
  3662. dos.library/ParentDir                                   dos.library/ParentDir
  3663.  
  3664.     NAME
  3665.     ParentDir -- Obtain the parent of a directory or file
  3666.  
  3667.     SYNOPSIS
  3668.     newlock = ParentDir( lock )
  3669.     D0             D1
  3670.  
  3671.     BPTR ParentDir(BPTR)
  3672.  
  3673.     FUNCTION
  3674.     The argument 'lock' is associated with a given file or directory.
  3675.     ParentDir() returns 'newlock' which is associated the parent
  3676.     directory of 'lock'.
  3677.  
  3678.     Taking the ParentDir() of the root of the current filing system
  3679.     returns a NULL (0) lock.  Note this 0 lock represents the root of
  3680.     file system that you booted from (which is, in effect, the parent
  3681.     of all other file system roots.)
  3682.  
  3683.     INPUTS
  3684.     lock - BCPL pointer to a lock
  3685.  
  3686.     RESULTS
  3687.     newlock - BCPL pointer to a lock
  3688.  
  3689.     SEE ALSO
  3690.     Lock(), DupLock(), UnLock(), ParentOfFH(), DupLockFromFH()
  3691.  
  3692. dos.library/ParentOfFH                                 dos.library/ParentOfFH
  3693.  
  3694.    NAME
  3695.     ParentOfFH -- returns a lock on the parent directory of a file (V36)
  3696.  
  3697.    SYNOPSIS
  3698.     lock = ParentOfFH(fh)
  3699.     D0               D1
  3700.  
  3701.     BPTR ParentOfFH(BPTR)
  3702.  
  3703.    FUNCTION
  3704.     Returns a shared lock on the parent directory of the filehandle.
  3705.  
  3706.    INPUTS
  3707.     fh   - Filehandle you want the parent of.
  3708.  
  3709.    RESULT
  3710.     lock - Lock on parent directory of the filehandle or NULL for failure.
  3711.  
  3712.    SEE ALSO
  3713.     Parent(), Lock(), UnLock() DupLockFromFH()
  3714.  
  3715. dos.library/ParsePattern                             dos.library/ParsePattern
  3716.  
  3717.    NAME
  3718.     ParsePattern -- Create a tokenized string for MatchPattern() (V36)
  3719.  
  3720.    SYNOPSIS
  3721.     IsWild = ParsePattern(Source, Dest, DestLength)
  3722.     d0                      D1     D2      D3
  3723.  
  3724.     LONG ParsePattern(STRPTR, STRPTR, LONG)
  3725.  
  3726.    FUNCTION
  3727.     Tokenizes a pattern, for use by MatchPattern().  Also indicates if
  3728.     there are any wildcards in the pattern (i.e. whether it might match
  3729.     more than one item).  Note that Dest must be at least 2 times as
  3730.     large as Source plus bytes to be (almost) 100% certain of no
  3731.     buffer overflow.  This is because each input character can currently
  3732.     expand to 2 tokens (with one exception that can expand to 3, but
  3733.     only once per string).  Note: this implementation may change in
  3734.     the future, so you should handle error returns in all cases, but
  3735.     the size above should still be a reasonable upper bound for a buffer
  3736.     allocation.
  3737.  
  3738.     The patterns are fairly extensive, and approximate some of the ability
  3739.     of Unix/grep "regular expression" patterns.  Here are the available
  3740.     tokens:
  3741.  
  3742.     ?    Matches a single character.
  3743.     #    Matches the following expression 0 or more times.
  3744.     (ab|cd)    Matches any one of the items seperated by '|'.
  3745.     ~    Negates the following expression.  It matches all strings
  3746.         that do not match the expression (aka ~(foo) matches all
  3747.         strings that are not exactly "foo").
  3748.     [abc]    Character class: matches any of the characters in the class.
  3749.     [~bc]    Character class: matches any of the characters not in the
  3750.         class.
  3751.     a-z    Character range (only within character classes). 
  3752.     %    Matches 0 characters always (useful in "(foo|bar|%)").
  3753.     *    Synonym for "#?", not available by default in 2.0.  Available
  3754.         as an option that can be turned on.
  3755.  
  3756.     "Expression" in the above table means either a single character
  3757.     (ex: "#?"), or an alternation (ex: "#(ab|cd|ef)"), or a character
  3758.     class (ex: "#[a-zA-Z]").
  3759.  
  3760.    INPUTS
  3761.     source     - unparsed wildcard string to search for.
  3762.        dest       - output string, gets tokenized version of input.
  3763.     DestLength - length available in destination (should be at least as
  3764.              twice as large as source + 2 bytes).
  3765.  
  3766.    RESULT
  3767.     IsWild - 1 means there were wildcards in the pattern,
  3768.          0 means there were no wildcards in the pattern,
  3769.         -1 means there was a buffer overflow or other error
  3770.  
  3771.    BUGS
  3772.     Should set IoErr() to something useful (not currently set) on an
  3773.     error.
  3774.  
  3775.    SEE ALSO
  3776.     ParsePatternNoCase(), MatchPattern(), MatchFirst(), MatchNext()
  3777.  
  3778. dos.library/ParsePatternNoCase                 dos.library/ParsePatternNoCase
  3779.  
  3780.    NAME
  3781.     ParsePatternNoCase -- Create a tokenized string for
  3782.                         MatchPatternNoCase() (V37)
  3783.  
  3784.    SYNOPSIS
  3785.     IsWild = ParsePatternNoCase(Source, Dest, DestLength)
  3786.     d0                            D1     D2      D3
  3787.  
  3788.     LONG ParsePatternNoCase(STRPTR, STRPTR, LONG)
  3789.  
  3790.    FUNCTION
  3791.     Tokenizes a pattern, for use by MatchPatternNoCase().  Also indicates
  3792.     if there are any wildcards in the pattern (i.e. whether it might match
  3793.     more than one item).  Note that Dest must be at least 2 times as
  3794.     large as Source plus 2 bytes.
  3795.  
  3796.     For a description of the wildcards, see ParsePattern().
  3797.  
  3798.    INPUTS
  3799.     source     - unparsed wildcard string to search for.
  3800.        dest       - output string, gets tokenized version of input.
  3801.     DestLength - length available in destination (should be at least as
  3802.              twice as large as source + 2 bytes).
  3803.  
  3804.    RESULT
  3805.     IsWild - 1 means there were wildcards in the pattern,
  3806.          0 means there were no wildcards in the pattern,
  3807.         -1 means there was a buffer overflow or other error
  3808.  
  3809.    BUGS
  3810.     Should set IoErr() to something useful (not currently set) on an
  3811.     error.
  3812.     In V37, it didn't properly convert character-classes ([x-y]) to
  3813.     upper case.  Workaround: convert the input pattern to upper case
  3814.     using ToUpper() from utility.library before calling
  3815.     ParsePatternNoCase().  Fixed in V39 dos.
  3816.  
  3817.    SEE ALSO
  3818.     ParsePattern(), MatchPatternNoCase(), MatchFirst(), MatchNext(),
  3819.     utility.library/ToUpper()
  3820.  
  3821. dos.library/PathPart                                     dos.library/PathPart
  3822.  
  3823.    NAME
  3824.     PathPart -- Returns a pointer to the end of the next-to-last (V36)
  3825.             component of a path.
  3826.  
  3827.    SYNOPSIS
  3828.     fileptr = PathPart( path )
  3829.     D0             D1
  3830.  
  3831.     STRPTR PathPart( STRPTR )
  3832.  
  3833.    FUNCTION
  3834.     This function returns a pointer to the character after the next-to-last
  3835.     component of a path specification, which will normally be the directory
  3836.     name.  If there is only one component, it returns a pointer to the
  3837.     beginning of the string.  The only real difference between this and
  3838.     FilePart() is the handling of '/'.
  3839.  
  3840.    INPUTS
  3841.     path - pointer to an path string.  May be relative to the current
  3842.            directory or the current disk.
  3843.  
  3844.    RESULT
  3845.     fileptr - pointer to the end of the next-to-last component of the path.
  3846.  
  3847.    EXAMPLE
  3848.     PathPart("xxx:yyy/zzz/qqq") would return a pointer to the last '/'.
  3849.     PathPart("xxx:yyy") would return a pointer to the first 'y').
  3850.  
  3851.    SEE ALSO
  3852.     FilePart(), AddPart()
  3853.  
  3854. dos.library/PrintFault                                 dos.library/PrintFault
  3855.  
  3856.    NAME
  3857.     PrintFault -- Returns the text associated with a DOS error code (V36)
  3858.  
  3859.    SYNOPSIS
  3860.     success = PrintFault(code, header)
  3861.     D0                    D1     D2   
  3862.  
  3863.     BOOL PrintFault(LONG, STRPTR)
  3864.  
  3865.    FUNCTION
  3866.     This routine obtains the error message text for the given error code.
  3867.     This is similar to the Fault() function, except that the output is
  3868.     written to the default output channel with buffered output.
  3869.     The value returned by IoErr() is set to the code passed in.
  3870.  
  3871.    INPUTS
  3872.     code   - Error code
  3873.     header - header to output before error text
  3874.  
  3875.    RESULT
  3876.     success - Success/failure code.
  3877.  
  3878.    SEE ALSO
  3879.     IoErr(), Fault(), SetIoErr(), Output(), FPuts()
  3880.  
  3881. dos.library/PutStr                                         dos.library/PutStr
  3882.  
  3883.    NAME
  3884.     PutStr -- Writes a string the the default output (buffered) (V36)
  3885.  
  3886.    SYNOPSIS
  3887.     error = PutStr(str)
  3888.     D0             D1
  3889.  
  3890.     LONG PutStr(STRPTR)
  3891.  
  3892.    FUNCTION
  3893.     This routine writes an unformatted string to the default output.  No 
  3894.     newline is appended to the string and any error is returned.  This
  3895.     routine is buffered.
  3896.  
  3897.    INPUTS
  3898.     str   - Null-terminated string to be written to default output
  3899.  
  3900.    RESULT
  3901.     error - 0 for success, -1 for any error.  NOTE: this is opposite
  3902.         most Dos function returns!
  3903.  
  3904.    SEE ALSO
  3905.     FPuts(), FPutC(), FWrite(), WriteChars()
  3906.  
  3907. dos.library/Read                                             dos.library/Read
  3908.  
  3909.     NAME
  3910.     Read -- Read bytes of data from a file
  3911.  
  3912.     SYNOPSIS
  3913.     actualLength = Read( file, buffer, length )
  3914.     D0             D1    D2       D3
  3915.  
  3916.     LONG Read(BPTR, void *, LONG)
  3917.  
  3918.     FUNCTION
  3919.     Data can be copied using a combination of Read() and Write().
  3920.     Read() reads bytes of information from an opened file (represented
  3921.     here by the argument 'file') into the buffer given. The argument
  3922.     'length' is the length of the buffer given.
  3923.  
  3924.     The value returned is the length of the information actually read.
  3925.     So, when 'actualLength' is greater than zero, the value of
  3926.     'actualLength' is the the number of characters read. Usually Read
  3927.     will try to fill up your buffer before returning. A value of zero
  3928.     means that end-of-file has been reached. Errors are indicated by a
  3929.     value of -1.
  3930.  
  3931.     Note: this is an unbuffered routine (the request is passed directly
  3932.     to the filesystem.)  Buffered I/O is more efficient for small
  3933.     reads and writes; see FGetC().
  3934.  
  3935.     INPUTS
  3936.     file - BCPL pointer to a file handle
  3937.     buffer - pointer to buffer
  3938.     length - integer
  3939.  
  3940.     RESULTS
  3941.     actualLength - integer
  3942.  
  3943.     SEE ALSO
  3944.     Open(), Close(), Write(), Seek(), FGetC()
  3945.  
  3946. dos.library/ReadArgs                                     dos.library/ReadArgs
  3947.  
  3948.    NAME
  3949.     ReadArgs - Parse the command line input (V36)
  3950.  
  3951.    SYNOPSIS
  3952.     result = ReadArgs(template, array, rdargs)
  3953.     D0                   D1      D2      D3
  3954.  
  3955.     struct RDArgs * ReadArgs(STRPTR, LONG *, struct RDArgs *)
  3956.  
  3957.    FUNCTION
  3958.     Parses and argument string according to a template.  Normally gets
  3959.     the arguments by reading buffered IO from Input(), but also can be
  3960.     made to parse a string.  MUST be matched by a call to FreeArgs().
  3961.  
  3962.     ReadArgs() parses the commandline according to a template that is
  3963.     passed to it.  This specifies the different command-line options and
  3964.     their types.  A template consists of a list of options.  Options are
  3965.     named in "full" names where possible (for example, "Quick" instead of
  3966.     "Q").  Abbreviations can also be specified by using "abbrev=option"
  3967.     (for example, "Q=Quick").
  3968.  
  3969.     Options in the template are separated by commas.  To get the results
  3970.     of ReadArgs(), you examine the array of longwords you passed to it
  3971.     (one entry per option in the template).  This array should be cleared
  3972.     (or initialized to your default values) before passing to ReadArgs().
  3973.     Exactly what is put in a given entry by ReadArgs() depends on the type
  3974.     of option.  The default is a string (a sequence of non-whitespace
  3975.     characters, or delimited by quotes, which will be stripped by
  3976.     ReadArgs()), in which case the entry will be a pointer.
  3977.  
  3978.     Options can be followed by modifiers, which specify things such as
  3979.     the type of the option.  Modifiers are specified by following the
  3980.     option with a '/' and a single character modifier.  Multiple modifiers
  3981.     can be specified by using multiple '/'s.  Valid modifiers are:
  3982.  
  3983.     /S - Switch.  This is considered a boolean variable, and will be
  3984.          set if the option name appears in the command-line.  The entry
  3985.          is the boolean (0 for not set, non-zero for set).
  3986.  
  3987.     /K - Keyword.  This means that the option will not be filled unless
  3988.          the keyword appears.  For example if the template is "Name/K",
  3989.          then unless "Name=<string>" or "Name <string>" appears in the
  3990.          command line, Name will not be filled.
  3991.  
  3992.     /N - Number.  This parameter is considered a decimal number, and will
  3993.          be converted by ReadArgs.  If an invalid number is specified,
  3994.          an error will be returned.  The entry will be a pointer to the
  3995.          longword number (this is how you know if a number was specified).
  3996.  
  3997.     /T - Toggle.  This is similar to a switch, but when specified causes
  3998.          the boolean value to "toggle".  Similar to /S.
  3999.  
  4000.     /A - Required.  This keyword must be given a value during command-line
  4001.          processing, or an error is returned.
  4002.  
  4003.     /F - Rest of line.  If this is specified, the entire rest of the line
  4004.          is taken as the parameter for the option, even if other option
  4005.          keywords appear in it.
  4006.  
  4007.     /M - Multiple strings.  This means the argument will take any number
  4008.          of strings, returning them as an array of strings.  Any arguments
  4009.          not considered to be part of another option will be added to this
  4010.          option.  Only one /M should be specified in a template.  Example:
  4011.          for a template "Dir/M,All/S" the command-line "foo bar all qwe"
  4012.          will set the boolean "all", and return an array consisting of
  4013.          "foo", "bar", and "qwe".  The entry in the array will be a pointer
  4014.          to an array of string pointers, the last of which will be NULL.
  4015.  
  4016.          There is an interaction between /M parameters and /A parameters.
  4017.          If there are unfilled /A parameters after parsing, it will grab
  4018.          strings from the end of a previous /M parameter list to fill the
  4019.          /A's.  This is used for things like Copy ("From/A/M,To/A").
  4020.  
  4021.     ReadArgs() returns a struct RDArgs if it succeeds.  This serves as an
  4022.     "anchor" to allow FreeArgs() to free the associated memory.  You can
  4023.     also pass in a struct RDArgs to control the operation of ReadArgs()
  4024.     (normally you pass NULL for the parameter, and ReadArgs() allocates
  4025.     one for you).  This allows providing different sources for the
  4026.     arguments, providing your own string buffer space for temporary
  4027.     storage, and extended help text.  See <dos/rdargs.h> for more
  4028.     information on this.  Note: if you pass in a struct RDArgs, you must
  4029.     still call FreeArgs() to release storage that gets attached to it,
  4030.     but you are responsible for freeing the RDArgs yourself.
  4031.  
  4032.     If you pass in a RDArgs structure, you MUST reset (clear or set)
  4033.     RDA_Buffer for each new call to RDArgs.  The exact behavior if you
  4034.     don't do this varies from release to release and case to case; don't
  4035.     count on the behavior!
  4036.  
  4037.     See BUGS regarding passing in strings.
  4038.     
  4039.    INPUTS
  4040.     template - formatting string
  4041.     array    - array of longwords for results, 1 per template entry
  4042.     rdargs   - optional rdargs structure for options.  AllocDosObject
  4043.            should be used for allocating them if you pass one in.
  4044.  
  4045.    RESULT
  4046.     result   - a struct RDArgs or NULL for failure.
  4047.  
  4048.    BUGS
  4049.     In V36, there were a couple of minor bugs with certain argument
  4050.     combinations (/M/N returned strings, /T didn't work, and /K and
  4051.     /F interacted).  Also, a template with a /K before any non-switch
  4052.     parameter will require the argument name to be given in order for
  4053.     line to be accepted (i.e. "parm/K,xyzzy/A" would require
  4054.     "xyzzy=xxxxx" in order to work - "xxxxx" would not work).  If you
  4055.     need to avoid this for V36, put /K parameters after all non-switch
  4056.     parameters.  These problems should be fixed for V37.
  4057.  
  4058.     Currently (V37 and before) it requires any strings passed in to have
  4059.     newlines at the end of the string.  This may or may not be fixed in
  4060.     the future.
  4061.  
  4062.    SEE ALSO
  4063.     FindArg(), ReadItem(), FreeArgs(), AllocDosObject()
  4064.  
  4065. dos.library/ReadItem                                     dos.library/ReadItem
  4066.  
  4067.    NAME
  4068.     ReadItem - reads a single argument/name from command line (V36)
  4069.  
  4070.    SYNOPSIS
  4071.     value = ReadItem(buffer, maxchars, input)
  4072.     D0                D1        D2      D3
  4073.  
  4074.     LONG ReadItem(STRPTR, LONG, struct CSource *)
  4075.  
  4076.    FUNCTION
  4077.     Reads a "word" from either Input() (buffered), or via CSource, if it
  4078.     is non-NULL (see <dos/rdargs.h> for more information).  Handles
  4079.     quoting and some '*' substitutions (*e and *n) inside quotes (only).
  4080.     See dos/dos.h for a listing of values returned by ReadItem()
  4081.     (ITEM_XXXX).  A "word" is delimited by whitespace, quotes, '=', or
  4082.     an EOF.
  4083.  
  4084.     ReadItem always unreads the last thing read (UnGetC(fh,-1)) so the
  4085.     caller can find out what the terminator was.
  4086.  
  4087.    INPUTS
  4088.     buffer   - buffer to store word in.
  4089.     maxchars - size of the buffer
  4090.     input    - CSource input or NULL (uses FGetC(Input()))
  4091.  
  4092.    RESULT
  4093.     value - See <dos/dos.h> for return values.
  4094.  
  4095.    BUGS
  4096.     Doesn't actually unread the terminator.
  4097.  
  4098.    SEE ALSO
  4099.     ReadArgs(), FindArg(), UnGetC(), FGetC(), Input(), <dos/dos.h>,
  4100.     <dos/rdargs.h>, FreeArgs()
  4101.  
  4102. dos.library/ReadLink                                     dos.library/ReadLink
  4103.  
  4104.    NAME
  4105.     ReadLink -- Reads the path for a soft filesystem link (V36)
  4106.  
  4107.    SYNOPSIS
  4108.     success = ReadLink( port, lock, path, buffer, size)
  4109.     D0             D1    D2    D3     D4     D5
  4110.  
  4111.     BOOL ReadLink( struct MsgPort *, BPTR, STRPTR, STRPTR, ULONG)
  4112.  
  4113.    FUNCTION
  4114.     ReadLink() takes a lock/name pair (usually from a failed attempt
  4115.     to use them to access an object with packets), and asks the
  4116.     filesystem to find the softlink and fill buffer with the modified
  4117.     path string.  You then start the resolution process again by
  4118.     calling GetDeviceProc() with the new string from ReadLink().
  4119.  
  4120.     Soft-links are resolved at access time by a combination of the
  4121.     filesystem (by returning ERROR_IS_SOFT_LINK to dos), and by
  4122.     Dos (using ReadLink() to resolve any links that are hit).
  4123.  
  4124.    INPUTS
  4125.     port - msgport of the filesystem
  4126.     lock - lock this path is relative to on the filesystem
  4127.     path - path that caused the ERROR_IS_SOFT_LINK
  4128.     buffer - pointer to buffer for new path from handler.
  4129.     size - size of buffer.
  4130.  
  4131.    RESULT
  4132.     Success - boolean
  4133.  
  4134.    BUGS
  4135.     In V36, soft-links didn't work in the ROM filesystem.  This was
  4136.     fixed for V37.
  4137.  
  4138.    SEE ALSO
  4139.     MakeLink(), Open(), Lock(), GetDeviceProc()
  4140.  
  4141. dos.library/Relabel                                       dos.library/Relabel
  4142.  
  4143.    NAME
  4144.     Relabel -- Change the volume name of a volume (V36)
  4145.  
  4146.    SYNOPSIS
  4147.     success = Relabel(volumename,name)
  4148.     D0                    D1      D2
  4149.  
  4150.     BOOL Relabel(STRPTR,STRPTR)
  4151.  
  4152.    FUNCTION
  4153.     Changes the volumename of a volume, if supported by the filesystem.
  4154.  
  4155.    INPUTS
  4156.     volumename - Full name of device to rename (with ':')
  4157.     newname    - New name to apply to device (without ':')
  4158.  
  4159.    RESULT
  4160.     success    - Success/failure indicator
  4161.  
  4162.    SEE ALSO
  4163.  
  4164. dos.library/RemAssignList                           dos.library/RemAssignList
  4165.  
  4166.    NAME
  4167.     RemAssignList -- Remove an entry from a multi-dir assign (V36)
  4168.  
  4169.    SYNOPSIS
  4170.     success = RemAssignList(name,lock)
  4171.     D0                       D1   D2
  4172.  
  4173.     BOOL RemAssignList(STRPTR,BPTR)
  4174.  
  4175.    FUNCTION
  4176.     Removes an entry from a multi-directory assign.  The entry removed is
  4177.     the first one for which SameLock with 'lock' returns that they are on
  4178.     the same object.  The lock for the entry in the list is unlocked (not
  4179.     the entry passed in).
  4180.  
  4181.    INPUTS
  4182.     name - Name of device to remove lock from (without trailing ':')
  4183.     lock - Lock associated with the object to remove from the list
  4184.  
  4185.    RESULT
  4186.     success - Success/failure indicator.
  4187.  
  4188.    BUGS
  4189.     In V36 through V39.23 dos, it would fail to remove the first lock
  4190.     in the assign.  Fixed in V39.24 dos (after the V39.106 kickstart).
  4191.  
  4192.    SEE ALSO
  4193.     Lock(), AssignLock(), AssignPath(), AssignLate(), DupLock(),
  4194.     AssignAdd(), UnLock()
  4195.  
  4196. dos.library/RemDosEntry                               dos.library/RemDosEntry
  4197.  
  4198.    NAME
  4199.     RemDosEntry -- Removes a Dos List entry from it's list (V36)
  4200.  
  4201.    SYNOPSIS
  4202.     success = RemDosEntry(dlist)
  4203.     D0                     D1
  4204.  
  4205.     BOOL RemDosEntry(struct DosList *)
  4206.  
  4207.    FUNCTION
  4208.     This removes an entry from the Dos Device list.  The memory associated
  4209.     with the entry is NOT freed.  NOTE: you must have locked the Dos List
  4210.     with the appropriate flags before calling this routine.  Handler
  4211.     writers should see the AddDosEntry() caveats about locking and use
  4212.     a similar workaround to avoid deadlocks.
  4213.  
  4214.    INPUTS
  4215.     dlist   - Device list entry to be removed.
  4216.  
  4217.    RESULT
  4218.     success - Success/failure indicator
  4219.  
  4220.    SEE ALSO
  4221.     AddDosEntry(), FindDosEntry(), NextDosEntry(), LockDosList(),
  4222.     MakeDosEntry(), FreeDosEntry()
  4223.  
  4224. dos.library/RemSegment                                 dos.library/RemSegment
  4225.  
  4226.    NAME
  4227.     RemSegment - Removes a resident segment from the resident list (V36)
  4228.  
  4229.    SYNOPSIS
  4230.     success = RemSegment(segment)
  4231.     D0                D1
  4232.  
  4233.     BOOL RemSegment(struct Segment *)
  4234.  
  4235.    FUNCTION
  4236.     Removes a resident segment from the Dos resident segment list,
  4237.     unloads it, and does any other cleanup required.  Will only succeed
  4238.     if the seg_UC (usecount) is 0.
  4239.  
  4240.    INPUTS
  4241.     segment - the segment to be removed
  4242.  
  4243.    RESULT
  4244.     success - success or failure.
  4245.  
  4246.    SEE ALSO
  4247.     FindSegment(), AddSegment()
  4248.  
  4249. dos.library/Rename                                         dos.library/Rename
  4250.  
  4251.     NAME
  4252.     Rename -- Rename a directory or file
  4253.  
  4254.     SYNOPSIS
  4255.     success = Rename( oldName, newName )
  4256.     D0          D1       D2
  4257.  
  4258.     BOOL Rename(STRPTR, STRPTR)
  4259.  
  4260.     FUNCTION
  4261.     Rename() attempts to rename the file or directory specified as
  4262.     'oldName' with the name 'newName'. If the file or directory
  4263.     'newName' exists, Rename() fails and returns an error. Both
  4264.     'oldName' and the 'newName' can contain a directory specification.
  4265.     In this case, the file will be moved from one directory to another.
  4266.  
  4267.     Note: it is impossible to Rename() a file from one volume to
  4268.     another.
  4269.  
  4270.     INPUTS
  4271.     oldName - pointer to a null-terminated string
  4272.     newName - pointer to a null-terminated string
  4273.  
  4274.     RESULTS
  4275.     success - boolean
  4276.  
  4277.     SEE ALSO
  4278.     Relabel()
  4279.  
  4280. dos.library/ReplyPkt                                     dos.library/ReplyPkt
  4281.  
  4282.    NAME
  4283.     ReplyPkt -- replies a packet to the person who sent it to you (V36)
  4284.  
  4285.    SYNOPSIS
  4286.     ReplyPkt(packet, result1, result2)
  4287.            D1      D2       D3
  4288.  
  4289.     void ReplyPkt(struct DosPacket *, LONG, LONG)
  4290.  
  4291.    FUNCTION
  4292.     This returns a packet to the process which sent it to you.  In
  4293.     addition, puts your pr_MsgPort address in dp_Port, so using ReplyPkt()
  4294.     again will send the message to you.  (This is used in "ping-ponging"
  4295.     packets between two processes).  It uses result 1 & 2 to set the
  4296.     dp_Res1 and dp_Res2 fields of the packet.
  4297.  
  4298.    INPUTS
  4299.     packet  - packet to reply, assumed to set up correctly.
  4300.     result1 - first result
  4301.     result2 - secondary result
  4302.  
  4303.    SEE ALSO
  4304.     DoPkt(), SendPkt(), WaitPkt(), IoErr()
  4305.  
  4306. dos.library/RunCommand                                 dos.library/RunCommand
  4307.  
  4308.    NAME
  4309.     RunCommand -- Runs a program using the current process (V36)
  4310.  
  4311.    SYNOPSIS
  4312.     rc = RunCommand(seglist, stacksize, argptr, argsize)
  4313.     D0                D1         D2       D3      D4
  4314.  
  4315.     LONG RunCommand(BPTR, ULONG, STRPTR, ULONG)
  4316.  
  4317.    FUNCTION
  4318.     Runs a command on your process/cli.  Seglist may be any language,
  4319.     including BCPL programs.  Stacksize is in bytes.  argptr is a null-
  4320.     terminated string, argsize is its length.  Returns the returncode the
  4321.     program exited with in d0. Returns -1 if the stack couldn't be
  4322.     allocated.
  4323.  
  4324.     NOTE: the argument string MUST be terminated with a newline to work
  4325.     properly with ReadArgs() and other argument parsers.
  4326.  
  4327.     RunCommand also takes care of setting up the current input filehandle
  4328.     in such a way that ReadArgs() can be used in the program, and restores
  4329.     the state of the buffering before returning.  It also sets the value
  4330.     returned by GetArgStr(), and restores it before returning.  NOTE:
  4331.     the setting of the argument string in the filehandle was added in V37.
  4332.  
  4333.     It's usually appropriate to set the command name (via
  4334.     SetProgramName()) before calling RunCommand().  RunCommand() sets
  4335.     the value returned by GetArgStr() while the command is running.
  4336.  
  4337.    INPUTS
  4338.     seglist   - Seglist of command to run.
  4339.     stacksize - Number of bytes to allocate for stack space
  4340.     argptr    - Pointer to argument command string.
  4341.     argsize   - Number of bytes in argument command.
  4342.  
  4343.    RESULT
  4344.     rc        - Return code from executed command. -1 indicates failure 
  4345.  
  4346.    SEE ALSO
  4347.     CreateNewProc(), SystemTagList(), Execute(), GetArgStr(),
  4348.     SetProgramName(), ReadArgs()
  4349.  
  4350. dos.library/SameDevice                                 dos.library/SameDevice
  4351.  
  4352.    NAME
  4353.     SameDevice -- Are two locks are on partitions of the device? (V37)
  4354.  
  4355.    SYNOPSIS
  4356.     same = SameDevice(lock1, lock2)
  4357.     D0           D1     D2
  4358.  
  4359.     BOOL SameDevice( BPTR, BPTR )
  4360.  
  4361.    FUNCTION
  4362.     SameDevice() returns whether two locks refer to partitions that
  4363.     are on the same physical device (if it can figure it out).  This
  4364.     may be useful in writing copy routines to take advantage of
  4365.     asynchronous multi-device copies.
  4366.  
  4367.     Entry existed in V36 and always returned 0.
  4368.  
  4369.    INPUTS
  4370.     lock1,lock2 - locks
  4371.  
  4372.    RESULT
  4373.     same - whether they're on the same device as far as Dos can determine.
  4374.  
  4375. dos.library/SameLock                                     dos.library/SameLock
  4376.  
  4377.    NAME
  4378.     SameLock -- returns whether two locks are on the same object (V36)
  4379.  
  4380.    SYNOPSIS
  4381.     value = SameLock(lock1, lock2)
  4382.     D0          D1     D2
  4383.  
  4384.     LONG SameLock(BPTR, BPTR)
  4385.  
  4386.    FUNCTION
  4387.     Compares two locks.  Returns LOCK_SAME if they are on the same object,
  4388.     LOCK_SAME_VOLUME if on different objects on the same volume, and
  4389.     LOCK_DIFFERENT if they are on different volumes.  Always compare
  4390.     for equality or non-equality with the results, in case new return
  4391.     values are added.
  4392.  
  4393.    INPUTS
  4394.     lock1 - 1st lock for comparison
  4395.     lock2 - 2nd lock for comparison
  4396.  
  4397.    RESULT
  4398.     value -    LOCK_SAME, LOCK_SAME_VOLUME, or LOCK_DIFFERENT
  4399.  
  4400.    BUGS
  4401.     Should do more extensive checks for NULL against a real lock, checking
  4402.     to see if the real lock is a lock on the root of the boot volume.
  4403.  
  4404.     In V36, it would return LOCK_SAME_VOLUME for different volumes on the
  4405.     same handler.  Also, LOCK_SAME_VOLUME was LOCK_SAME_HANDLER (now
  4406.     an obsolete define, see <dos/dos.h>).
  4407.  
  4408.    SEE ALSO
  4409.     <dos/dos.h>
  4410.  
  4411. dos.library/Seek                                             dos.library/Seek
  4412.  
  4413.     NAME
  4414.     Seek -- Set the current position for reading and writing
  4415.  
  4416.     SYNOPSIS
  4417.     oldPosition = Seek( file, position, mode )
  4418.     D0            D1      D2        D3
  4419.  
  4420.     LONG Seek(BPTR, LONG, LONG)
  4421.  
  4422.     FUNCTION
  4423.     Seek() sets the read/write cursor for the file 'file' to the
  4424.     position 'position'. This position is used by both Read() and
  4425.     Write() as a place to start reading or writing. The result is the
  4426.     current absolute position in the file, or -1 if an error occurs, in
  4427.     which case IoErr() can be used to find more information. 'mode' can
  4428.     be OFFSET_BEGINNING, OFFSET_CURRENT or OFFSET_END. It is used to
  4429.     specify the relative start position. For example, 20 from current
  4430.     is a position 20 bytes forward from current, -20 is 20 bytes back
  4431.     from current.
  4432.  
  4433.     So that to find out where you are, seek zero from current. The end
  4434.     of the file is a Seek() positioned by zero from end. You cannot
  4435.     Seek() beyond the end of a file.
  4436.  
  4437.     INPUTS
  4438.     file - BCPL pointer to a file handle
  4439.     position - integer
  4440.     mode - integer
  4441.  
  4442.     RESULTS
  4443.     oldPosition - integer
  4444.  
  4445.     BUGS
  4446.     The V36 and V37 ROM filesystem (and V36/V37 l:fastfilesystem)
  4447.     returns the current position instead of -1 on an error.  It sets
  4448.     IoErr() to 0 on success, and an error code on an error.  This bug
  4449.     was fixed in the V39 filesystem.
  4450.  
  4451.     SEE ALSO
  4452.     Read(), Write(), SetFileSize()
  4453.  
  4454. dos.library/SelectInput                               dos.library/SelectInput
  4455.  
  4456.    NAME
  4457.     SelectInput -- Select a filehandle as the default input channel (V36)
  4458.  
  4459.    SYNOPSIS
  4460.     old_fh = SelectInput(fh)
  4461.     D0                   D1
  4462.  
  4463.     BPTR SelectInput(BPTR)
  4464.  
  4465.    FUNCTION
  4466.     Set the current input as the default input for the process.
  4467.     This changes the value returned by Input().  old_fh should
  4468.     be closed or saved as needed.
  4469.  
  4470.    INPUTS
  4471.     fh     - Newly default input handle
  4472.  
  4473.    RESULT
  4474.     old_fh - Previous default input filehandle
  4475.  
  4476.    SEE ALSO
  4477.     Input(), SelectOutput(), Output()
  4478.  
  4479. dos.library/SelectOutput                             dos.library/SelectOutput
  4480.  
  4481.    NAME
  4482.     SelectOutput -- Select a filehandle as the default output channel (V36)
  4483.  
  4484.    SYNOPSIS
  4485.     old_fh = SelectOutput(fh)
  4486.     D0                    D1
  4487.  
  4488.     BPTR SelectOutput(BPTR)
  4489.  
  4490.    FUNCTION
  4491.     Set the current output as the default output for the process.
  4492.     This changes the value returned by Output().  old_fh should
  4493.     be closed or saved as needed.
  4494.  
  4495.    INPUTS
  4496.     fh     - Newly desired output handle
  4497.  
  4498.    RESULT
  4499.     old_fh - Previous current output
  4500.  
  4501.    SEE ALSO
  4502.     Output(), SelectInput(), Input()
  4503.  
  4504. dos.library/SendPkt                                       dos.library/SendPkt
  4505.  
  4506.    NAME
  4507.     SendPkt -- Sends a packet to a handler (V36)
  4508.  
  4509.    SYNOPSIS
  4510.     SendPkt(packet, port, replyport)
  4511.          D1     D2    D3
  4512.  
  4513.     void SendPkt(struct DosPacket *,struct MsgPort *,struct MsgPort *)
  4514.  
  4515.    FUNCTION
  4516.     Sends a packet to a handler and does not wait.  All fields in the
  4517.     packet must be initialized before calling this routine.  The packet
  4518.     will be returned to replyport.  If you wish to use this with
  4519.     WaitPkt(), use the address of your pr_MsgPort for replyport.
  4520.  
  4521.    INPUTS
  4522.     packet - packet to send, must be initialized and have a message.
  4523.     port   - pr_MsgPort of handler process to send to.
  4524.     replyport - MsgPort for the packet to come back to.
  4525.  
  4526.    NOTES
  4527.     Callable from a task.
  4528.  
  4529.    SEE ALSO
  4530.     DoPkt(), WaitPkt(), AllocDosObject(), FreeDosObject(), AbortPkt()
  4531.  
  4532. dos.library/SetArgStr                                   dos.library/SetArgStr
  4533.  
  4534.    NAME
  4535.     SetArgStr -- Sets the arguments for the current process (V36)
  4536.  
  4537.    SYNOPSIS
  4538.     oldptr = SetArgStr(ptr)
  4539.     D0           D1
  4540.  
  4541.     STRPTR SetArgStr(STRPTR)
  4542.  
  4543.    FUNCTION
  4544.     Sets the arguments for the current program.  The ptr MUST be reset
  4545.     to it's original value before process exit.
  4546.  
  4547.    INPUTS
  4548.     ptr - pointer to new argument string.
  4549.  
  4550.    RESULT
  4551.     oldptr - the previous argument string
  4552.  
  4553.    SEE ALSO
  4554.     GetArgStr(), RunCommand()
  4555.  
  4556. dos.library/SetComment                                 dos.library/SetComment
  4557.  
  4558.     NAME
  4559.     SetComment -- Change a files' comment string
  4560.  
  4561.     SYNOPSIS
  4562.     success = SetComment( name, comment )
  4563.     D0              D1    D2
  4564.  
  4565.     BOOL SetComment(STRPTR, STRPTR)
  4566.  
  4567.     FUNCTION
  4568.     SetComment() sets a comment on a file or directory. The comment is
  4569.     a pointer to a null-terminated string of up to 80 characters in the
  4570.     current ROM filesystem (and RAM:).  Note that not all filesystems
  4571.     will support comments (for example, NFS usually will not), or the
  4572.     size of comment supported may vary.
  4573.  
  4574.     INPUTS
  4575.     name    - pointer to a null-terminated string
  4576.     comment - pointer to a null-terminated string
  4577.  
  4578.     RESULTS
  4579.     success - boolean
  4580.  
  4581.     SEE ALSO
  4582.     Examine(), ExNext(), SetProtection()
  4583.  
  4584. dos.library/SetConsoleTask                         dos.library/SetConsoleTask
  4585.  
  4586.    NAME
  4587.     SetConsoleTask -- Sets the default console for the process (V36)
  4588.  
  4589.    SYNOPSIS
  4590.     oldport = SetConsoleTask(port)
  4591.     D0              D1
  4592.  
  4593.     struct MsgPort *SetConsoleTask(struct MsgPort *)
  4594.  
  4595.    FUNCTION
  4596.     Sets the default console task's port (pr_ConsoleTask) for the
  4597.     current process.
  4598.  
  4599.    INPUTS
  4600.     port - The pr_MsgPort of the default console handler for the process
  4601.  
  4602.    RESULT
  4603.     oldport - The previous ConsoleTask value.
  4604.  
  4605.    SEE ALSO
  4606.     GetConsoleTask(), Open()
  4607.  
  4608. dos.library/SetCurrentDirName                   dos.library/SetCurrentDirName
  4609.  
  4610.    NAME
  4611.     SetCurrentDirName -- Sets the directory name for the process (V36)
  4612.  
  4613.    SYNOPSIS
  4614.     success = SetCurrentDirName(name)
  4615.     D0                        D1
  4616.  
  4617.     BOOL SetCurrentDirName(STRPTR)
  4618.  
  4619.    FUNCTION
  4620.     Sets the name for the current dir in the cli structure.  If the name
  4621.     is too long to fit, a failure is returned, and the old value is left
  4622.     intact.  It is advised that you inform the user of this condition.
  4623.     This routine is safe to call even if there is no CLI structure.
  4624.  
  4625.    INPUTS
  4626.     name    - Name of directory to be set.
  4627.  
  4628.    RESULT
  4629.     success - Success/failure indicator
  4630.  
  4631.    BUGS
  4632.     This clips to a fixed (1.3 compatible) size.
  4633.  
  4634.    SEE ALSO
  4635.     GetCurrentDirName()
  4636.  
  4637. dos.library/SetFileDate                               dos.library/SetFileDate
  4638.  
  4639.    NAME
  4640.     SetFileDate -- Sets the modification date for a file or dir (V36)
  4641.  
  4642.    SYNOPSIS
  4643.     success = SetFileDate(name, date)
  4644.     D0                     D1    D2
  4645.  
  4646.     BOOL SetFileDate(STRPTR, struct DateStamp *)
  4647.  
  4648.    FUNCTION
  4649.     Sets the file date for a file or directory.  Note that for the Old
  4650.     File System and the Fast File System, the date of the root directory
  4651.     cannot be set.  Other filesystems may not support setting the date
  4652.     for all files/directories.
  4653.  
  4654.    INPUTS
  4655.     name - Name of object
  4656.     date - New modification date
  4657.  
  4658.    RESULT
  4659.     success - Success/failure indication
  4660.  
  4661.    SEE ALSO
  4662.     DateStamp(), Examine(), ExNext(), ExAll()
  4663.  
  4664. dos.library/SetFileSize                               dos.library/SetFileSize
  4665.  
  4666.    NAME
  4667.     SetFileSize -- Sets the size of a file (V36)
  4668.  
  4669.    SYNOPSIS
  4670.     newsize = SetFileSize(fh, offset, mode)
  4671.     D0                    D1    D2     D3
  4672.  
  4673.     LONG SetFileSize(BPTR, LONG, LONG)
  4674.  
  4675.    FUNCTION
  4676.     Changes the file size, truncating or extending as needed.  Not all
  4677.     handlers may support this; be careful and check the return code.  If
  4678.     the file is extended, no values should be assumed for the new bytes.
  4679.     If the new position would be before the filehandle's current position
  4680.     in the file, the filehandle will end with a position at the
  4681.     end-of-file.  If there are other filehandles open onto the file, the
  4682.     new size will not leave any filehandle pointing past the end-of-file.
  4683.     You can check for this by looking at the new size.
  4684.  
  4685.     Do NOT count on any specific values to be in the extended area.
  4686.  
  4687.    INPUTS
  4688.     fh     - File to be truncated/extended.
  4689.     offset - Offset from position determined by mode.
  4690.     mode   - One of OFFSET_BEGINNING, OFFSET_CURRENT, or OFFSET_END.
  4691.  
  4692.    RESULT
  4693.     newsize - position of new end-of-file or -1 for error.
  4694.  
  4695.    SEE ALSO
  4696.     Seek()
  4697.  
  4698. dos.library/SetFileSysTask                         dos.library/SetFileSysTask
  4699.  
  4700.    NAME
  4701.     SetFileSysTask -- Sets the default filesystem for the process (V36)
  4702.  
  4703.    SYNOPSIS
  4704.     oldport = SetFileSysTask(port)
  4705.     D0              D1
  4706.  
  4707.     struct MsgPort *SetFileSysTask(struct MsgPort *)
  4708.  
  4709.    FUNCTION
  4710.     Sets the default filesystem task's port (pr_FileSystemTask) for the
  4711.     current process.
  4712.  
  4713.    INPUTS
  4714.     port - The pr_MsgPort of the default filesystem for the process
  4715.  
  4716.    RESULT
  4717.     oldport - The previous FileSysTask value
  4718.  
  4719.    SEE ALSO
  4720.     GetFileSysTask(), Open()
  4721.  
  4722. dos.library/SetIoErr                                     dos.library/SetIoErr
  4723.  
  4724.    NAME
  4725.     SetIoErr -- Sets the value returned by IoErr() (V36)
  4726.  
  4727.    SYNOPSIS
  4728.     oldcode = SetIoErr(code)
  4729.     D0            D1
  4730.  
  4731.     LONG SetIoErr(LONG);
  4732.  
  4733.    FUNCTION
  4734.     This routine sets up the secondary result (pr_Result2) return code 
  4735.     (returned by the IoErr() function).
  4736.  
  4737.    INPUTS
  4738.     code - Code to be returned by a call to IoErr.
  4739.  
  4740.    RESULT
  4741.     oldcode - The previous error code.
  4742.  
  4743.    SEE ALSO
  4744.     IoErr(), Fault(), PrintFault()
  4745.  
  4746. dos.library/SetMode                                       dos.library/SetMode
  4747.  
  4748.    NAME
  4749.     SetMode - Set the current behavior of a handler (V36)
  4750.  
  4751.    SYNOPSIS
  4752.     success = SetMode(fh, mode)
  4753.     D0                D1  D2
  4754.  
  4755.     BOOL SetMode(BPTR, LONG)
  4756.  
  4757.    FUNCTION
  4758.     SetMode() sends an ACTION_SCREEN_MODE packet to the handler in
  4759.     question, normally for changing a CON: handler to raw mode or
  4760.     vice-versa.  For CON:, use 1 to go to RAW: mode, 0 for CON: mode.
  4761.  
  4762.    INPUTS
  4763.     fh   - filehandle
  4764.     mode - The new mode you want
  4765.  
  4766.    RESULT
  4767.     success - Boolean
  4768.  
  4769.    SEE ALSO
  4770.  
  4771. dos.library/SetOwner                                     dos.library/SetOwner
  4772.  
  4773.     NAME
  4774.     SetOwner -- Set owner information for a file or directory (V39)
  4775.  
  4776.     SYNOPSIS
  4777.     success = SetOwner( name, owner_info )
  4778.     D0             D1       D2
  4779.  
  4780.     BOOL SetOwner (STRPTR, LONG)
  4781.  
  4782.     FUNCTION
  4783.     SetOwner() sets the owner information for the file or directory.
  4784.     This value is a 32-bit value that is normally split into 16 bits
  4785.     of owner user id (bits 31-16), and 16 bits of owner group id (bits
  4786.     15-0).  However, other than returning them as shown by Examine()/
  4787.     ExNext()/ExAll(), the filesystem take no interest in the values.
  4788.     These are primarily for use by networking software (clients and
  4789.     hosts), in conjunction with the FIBF_OTR_xxx and FIBF_GRP_xxx
  4790.     protection bits.
  4791.  
  4792.     This entrypoint did not exist in V36, so you must open at least V37
  4793.     dos.library to use it.  V37 dos.library will return FALSE to this
  4794.     call.
  4795.  
  4796.     INPUTS
  4797.     name       - pointer to a null-terminated string
  4798.     owner_info - owner uid (31:16) and group id (15:0)
  4799.  
  4800.     RESULTS
  4801.     success - boolean
  4802.  
  4803.     SEE ALSO
  4804.     SetProtect(), Examine(), ExNext(), ExAll(), <dos/dos.h>
  4805.  
  4806. dos.library/SetProgramDir                           dos.library/SetProgramDir
  4807.  
  4808.    NAME
  4809.     SetProgramDir -- Sets the directory returned by GetProgramDir (V36)
  4810.  
  4811.    SYNOPSIS
  4812.     oldlock = SetProgramDir(lock)
  4813.     D0                 D1
  4814.  
  4815.     BPTR SetProgramDir(BPTR)
  4816.  
  4817.    FUNCTION
  4818.     Sets a shared lock on the directory the program was loaded from.
  4819.     This can be used for a program to find data files, etc, that are
  4820.     stored with the program, or to find the program file itself.  NULL
  4821.     is a valid input.  This can be accessed via GetProgramDir() or
  4822.     by using paths relative to PROGDIR:.
  4823.  
  4824.    INPUTS
  4825.     lock - A lock on the directory the current program was loaded from
  4826.  
  4827.    RESULT
  4828.     oldlock - The previous ProgramDir.
  4829.  
  4830.    SEE ALSO
  4831.     GetProgramDir(), Open()
  4832.  
  4833. dos.library/SetProgramName                         dos.library/SetProgramName
  4834.  
  4835.    NAME
  4836.     SetProgramName -- Sets the name of the program being run (V36)
  4837.  
  4838.    SYNOPSIS
  4839.     success = SetProgramName(name)
  4840.     D0                        D1
  4841.  
  4842.     BOOL SetProgramName(STRPTR)
  4843.  
  4844.    FUNCTION
  4845.     Sets the name for the program in the cli structure.  If the name is 
  4846.     too long to fit, a failure is returned, and the old value is left
  4847.     intact.  It is advised that you inform the user if possible of this
  4848.     condition, and/or set the program name to an empty string.
  4849.     This routine is safe to call even if there is no CLI structure.
  4850.  
  4851.    INPUTS
  4852.     name    - Name of program to use.
  4853.  
  4854.    RESULT
  4855.     success - Success/failure indicator.
  4856.  
  4857.    BUGS
  4858.     This clips to a fixed (1.3 compatible) size.
  4859.  
  4860.    SEE ALSO
  4861.     GetProgramName()
  4862.  
  4863. dos.library/SetPrompt                                   dos.library/SetPrompt
  4864.  
  4865.    NAME
  4866.     SetPrompt -- Sets the CLI/shell prompt for the current process (V36)
  4867.  
  4868.    SYNOPSIS
  4869.     success = SetPrompt(name)
  4870.     D0                D1
  4871.  
  4872.     BOOL SetPrompt(STRPTR)
  4873.  
  4874.    FUNCTION
  4875.     Sets the text for the prompt in the cli structure.  If the prompt is 
  4876.     too long to fit, a failure is returned, and the old value is left
  4877.     intact.  It is advised that you inform the user of this condition.
  4878.     This routine is safe to call even if there is no CLI structure.
  4879.  
  4880.    INPUTS
  4881.     name    - Name of prompt to be set.
  4882.  
  4883.    RESULT
  4884.     success - Success/failure indicator.
  4885.  
  4886.    BUGS
  4887.     This clips to a fixed (1.3 compatible) size.
  4888.  
  4889.    SEE ALSO
  4890.     GetPrompt()
  4891.  
  4892. dos.library/SetProtection                           dos.library/SetProtection
  4893.  
  4894.     NAME
  4895.     SetProtection -- Set protection for a file or directory
  4896.  
  4897.     SYNOPSIS
  4898.     success = SetProtection( name, mask )
  4899.     D0             D1    D2
  4900.  
  4901.     BOOL SetProtection (STRPTR, LONG)
  4902.  
  4903.     FUNCTION
  4904.     SetProtection() sets the protection attributes on a file or
  4905.     directory.  See <dos/dos.h> for a listing of protection bits.
  4906.  
  4907.     Before V36, the ROM filesystem didn't respect the Read and Write
  4908.     bits.  In V36 or later and in the FFS, the Read and Write
  4909.     bits are respected.
  4910.  
  4911.     The archive bit should be cleared by the filesystem whenever the file
  4912.     is changed.  Backup utilities will generally set the bit after
  4913.     backing up each file.
  4914.  
  4915.     The V36 Shell looks at the execute bit, and will refuse to execute
  4916.     a file if it is set.
  4917.  
  4918.     Other bits will be defined in the <dos/dos.h> include files.  Rather
  4919.     than referring to bits by number you should use the definitions in
  4920.     <dos/dos.h>.
  4921.  
  4922.     INPUTS
  4923.     name - pointer to a null-terminated string
  4924.     mask - the protection mask required
  4925.  
  4926.     RESULTS
  4927.     success - boolean
  4928.  
  4929.     SEE ALSO
  4930.     SetComment(), Examine(), ExNext(), <dos/dos.h>
  4931.  
  4932. dos.library/SetVar                                         dos.library/SetVar
  4933.  
  4934.    NAME
  4935.     SetVar -- Sets a local or environment variable (V36)
  4936.  
  4937.    SYNOPSIS
  4938.     success = SetVar( name, buffer, size, flags ) 
  4939.     D0               D1     D2     D3    D4
  4940.  
  4941.     BOOL SetVar(STRPTR, STRPTR, LONG, ULONG ) 
  4942.  
  4943.    FUNCTION
  4944.     Sets a local or environment variable.  It is advised to only use
  4945.     ASCII strings inside variables, but not required.
  4946.  
  4947.    INPUTS
  4948.     name   - pointer to an variable name.  Note variable names follow
  4949.          filesystem syntax and semantics.
  4950.     buffer - a user allocated area which contains a string that is the
  4951.          value to be associated with this variable.
  4952.     size   - length of the buffer region in bytes.  -1 means buffer
  4953.          contains a null-terminated string.
  4954.     flags  - combination of type of var to set (low 8 bits), and
  4955.          flags to control the behavior of this routine.  Currently
  4956.          defined flags include:
  4957.  
  4958.         GVF_LOCAL_ONLY - set a local (to your process) variable.
  4959.         GVF_GLOBAL_ONLY - set a global environment variable.
  4960.  
  4961.         The default is to set a local environment variable.
  4962.  
  4963.    RESULT
  4964.     success - If non-zero, the variable was sucessfully set, FALSE
  4965.            indicates failure.
  4966.  
  4967.    BUGS
  4968.     LV_VAR is the only type that can be global
  4969.  
  4970.    SEE ALSO
  4971.     GetVar(), DeleteVar(), FindVar(), <dos/var.h>
  4972.  
  4973. dos.library/SetVBuf                                       dos.library/SetVBuf
  4974.  
  4975.    NAME
  4976.     SetVBuf -- set buffering modes and size (V39)
  4977.  
  4978.    SYNOPSIS
  4979.     error = SetVBuf(fh, buff, type, size)
  4980.     D0        D1   D2    D3    D4
  4981.  
  4982.     LONG SetVBuf(BPTR, STRPTR, LONG, LONG)
  4983.  
  4984.    FUNCTION
  4985.     Changes the buffering modes and buffer size for a filehandle.
  4986.     With buff == NULL, the current buffer will be deallocated and a
  4987.     new one of (approximately) size will be allocated.  If buffer is
  4988.     non-NULL, it will be used for buffering and must be at least
  4989.     max(size,208) bytes long, and MUST be longword aligned.  If size
  4990.     is -1, then only the buffering mode will be changed.
  4991.  
  4992.     Note that a user-supplied buffer will not be freed if it is later
  4993.     replaced by another SetVBuf() call, nor will it be freed if the
  4994.     filehandle is closed.
  4995.  
  4996.     Has no effect on the buffersize of filehandles that were not created
  4997.     by AllocDosObject().
  4998.  
  4999.    INPUTS
  5000.     fh   - Filehandle
  5001.     buff - buffer pointer for buffered I/O or NULL.  MUST be LONG-aligned!
  5002.     type - buffering mode (see <dos/stdio.h>)
  5003.     size - size of buffer for buffered I/O (sizes less than 208 bytes
  5004.            will be rounded up to 208), or -1.
  5005.  
  5006.    RESULT
  5007.     error - 0 if successful.  NOTE: opposite of most dos functions!
  5008.         NOTE: fails if someone has replaced the buffer without
  5009.         using SetVBuf() - RunCommand() does this.  Remember to
  5010.         check error before freeing user-supplied buffers!
  5011.  
  5012.    BUGS
  5013.     Not implemented until after V39.  From V36 up to V39, always
  5014.     returned 0.
  5015.  
  5016.    SEE ALSO
  5017.     FputC(), FGetC(), UnGetC(), Flush(), FRead(), FWrite(), FGets(),
  5018.     FPuts(), AllocDosObject()
  5019.  
  5020. dos.library/SplitName                                   dos.library/SplitName
  5021.  
  5022.    NAME
  5023.     SplitName -- splits out a component of a pathname into a buffer (V36)
  5024.  
  5025.    SYNOPSIS
  5026.     newpos = SplitName(name, separator, buf, oldpos, size)
  5027.     D0                  D1      D2      D3     D4     D5
  5028.  
  5029.     WORD SplitName(STRPTR, UBYTE, STRPTR, WORD, LONG)
  5030.  
  5031.    FUNCTION
  5032.     This routine splits out the next piece of a name from a given file
  5033.     name.  Each piece is copied into the buffer, truncating at size-1
  5034.     characters.  The new position is then returned so that it may be
  5035.     passed in to the next call to splitname.  If the separator is not
  5036.     found within 'size' characters, then size-1 characters plus a null will
  5037.     be put into the buffer, and the position of the next separator will
  5038.     be returned.
  5039.  
  5040.     If a a separator cannot be found, -1 is returned (but the characters
  5041.     from the old position to the end of the string are copied into the
  5042.     buffer, up to a maximum of size-1 characters).  Both strings are
  5043.     null-terminated.
  5044.  
  5045.     This function is mainly intended to support handlers.
  5046.  
  5047.    INPUTS
  5048.     name      - Filename being parsed.
  5049.     separator - Separator charactor to split by.
  5050.     buf       - Buffer to hold separated name.
  5051.     oldpos    - Current position in the file.
  5052.     size       - Size of buf in bytes (including null termination).
  5053.  
  5054.    RESULT
  5055.     newpos    - New position for next call to splitname.  -1 for last one.
  5056.  
  5057.    BUGS
  5058.     In V36 and V37, path portions greater than or equal to 'size' caused
  5059.     the last character of the portion to be lost when followed by a
  5060.     separator.  Fixed for V39 dos.  For V36 and V37, the suggested work-
  5061.     around is to call SplitName() with a buffer one larger than normal
  5062.     (for example, 32 bytes), and then set buf[size-2] to '0' (for example,
  5063.     buf[30] = '\0';).
  5064.  
  5065.    SEE ALSO
  5066.     FilePart(), PathPart(), AddPart()
  5067.  
  5068. dos.library/StartNotify                               dos.library/StartNotify
  5069.  
  5070.    NAME
  5071.     StartNotify -- Starts notification on a file or directory (V36)
  5072.  
  5073.    SYNOPSIS
  5074.     success = StartNotify(notifystructure)
  5075.     D0                          D1
  5076.  
  5077.     BOOL StartNotify(struct NotifyRequest *)
  5078.  
  5079.    FUNCTION
  5080.     Posts a notification request.  Do not modify the notify structure while
  5081.     it is active.  You will be notified when the file or directory changes.
  5082.     For files, you will be notified after the file is closed.  Not all
  5083.     filesystems will support this: applications should NOT require it.  In
  5084.     particular, most network filesystems won't support it.
  5085.  
  5086.    INPUTS
  5087.     notifystructure - A filled-in NotifyRequest structure
  5088.  
  5089.    RESULT
  5090.     success - Success/failure of request
  5091.  
  5092.    BUGS
  5093.     The V36 floppy/HD filesystem doesn't actually send notifications.  The
  5094.     V36 ram handler (ram:) does.  This has been fixed for V37.
  5095.  
  5096.    SEE ALSO
  5097.     EndNotify(), <dos/notify.h>
  5098.  
  5099. dos.library/StrToDate                                   dos.library/StrToDate
  5100.  
  5101.    NAME
  5102.     StrToDate -- Converts a string to a DateStamp (V36)
  5103.  
  5104.    SYNOPSIS
  5105.     success = StrToDate( datetime )
  5106.     D0                      D1
  5107.  
  5108.     BOOL StrToDate( struct DateTime * )
  5109.  
  5110.    FUNCTION
  5111.     Converts a human readable ASCII string into an AmigaDOS
  5112.     DateStamp.
  5113.  
  5114.    INPUTS
  5115.     DateTime - a pointer to an initialized DateTime structure.
  5116.  
  5117.     The DateTime structure should    be initialized as follows:
  5118.  
  5119.     dat_Stamp  - ignored on input.
  5120.  
  5121.     dat_Format - a format    byte which specifies the format    of the
  5122.         dat_StrDat.  This can    be any of the following    (note:
  5123.         If value used    is something other than    those below,
  5124.         the default of FORMAT_DOS is used):
  5125.  
  5126.         FORMAT_DOS:      AmigaDOS format (dd-mmm-yy).
  5127.  
  5128.         FORMAT_INT:      International    format (yy-mmm-dd).
  5129.  
  5130.         FORMAT_USA:      American format (mm-dd-yy).
  5131.  
  5132.         FORMAT_CDN:      Canadian format (dd-mm-yy).
  5133.  
  5134.         FORMAT_DEF:      default format for locale.
  5135.  
  5136.     dat_Flags - a flags byte.  The only flag which affects this
  5137.           function is:
  5138.  
  5139.         DTF_SUBST:    ignored by this function
  5140.         DTF_FUTURE:      If set, indicates that strings such
  5141.                   as (stored in    dat_StrDate) "Monday"
  5142.                   refer    to "next" monday. Otherwise,
  5143.                   if clear, strings like "Monday"
  5144.                   refer    to "last" monday.
  5145.  
  5146.     dat_StrDay - ignored bythis function.
  5147.  
  5148.     dat_StrDate -    pointer    to valid string    representing the date.
  5149.           This can be a    "DTF_SUBST" style string such as
  5150.           "Today" "Tomorrow" "Monday", or it may be a string
  5151.           as specified by the dat_Format byte.    This will be
  5152.           converted to the ds_Days portion of the DateStamp.
  5153.           If this pointer is NULL, DateStamp->ds_Days will not
  5154.           be affected.
  5155.  
  5156.     dat_StrTime -    Pointer    to a buffer which contains the time in
  5157.           the ASCII format hh:mm:ss.  This will    be converted
  5158.           to the ds_Minutes and    ds_Ticks portions of the
  5159.           DateStamp.  If this pointer is NULL, ds_Minutes and
  5160.           ds_Ticks will    be unchanged.
  5161.  
  5162.    RESULT
  5163.     success    - a zero return indicates that a conversion could
  5164.         not be performed. A non-zero return indicates that the
  5165.         DateTime.dat_Stamp variable contains the converted
  5166.         values.
  5167.  
  5168.    SEE ALSO
  5169.     DateStamp(), DateToStr(), <dos/datetime.h>
  5170.  
  5171. dos.library/StrToLong                                   dos.library/StrToLong
  5172.  
  5173.    NAME
  5174.     StrToLong -- string to long value (decimal) (V36)
  5175.  
  5176.    SYNOPSIS
  5177.     characters = StrToLong(string,value)
  5178.     D0                       D1    D2
  5179.  
  5180.     LONG StrToLong(STRPTR, LONG *)
  5181.  
  5182.    FUNCTION
  5183.     Converts decimal string into LONG value.  Returns number of characters
  5184.     converted.  Skips over leading spaces & tabs (included in count).  If
  5185.     no decimal digits are found (after skipping leading spaces & tabs),
  5186.     StrToLong returns -1 for characters converted, and puts 0 into value.
  5187.  
  5188.    INPUTS
  5189.     string - Input string.
  5190.     value  - Pointer to long value.  Set to 0 if no digits are converted.
  5191.  
  5192.    RESULT
  5193.     result - Number of characters converted or -1.
  5194.  
  5195.    BUGS
  5196.     Before V39, if there were no convertible characters it returned the
  5197.     number of leading white-space characters (space and tab in this case).
  5198.  
  5199. dos.library/SystemTagList                           dos.library/SystemTagList
  5200.  
  5201.    NAME
  5202.     SystemTagList -- Have a shell execute a command line (V36)
  5203.  
  5204.    SYNOPSIS
  5205.     error = SystemTagList(command, tags)
  5206.     D0                D1      D2 
  5207.  
  5208.     LONG SystemTagList(STRPTR, struct TagItem *)
  5209.  
  5210.     error = System(command, tags)
  5211.     D0         D1      D2 
  5212.  
  5213.     LONG System(STRPTR, struct TagItem *)
  5214.  
  5215.     error = SystemTags(command, Tag1, ...)
  5216.  
  5217.     LONG SystemTags(STRPTR, ULONG, ...)
  5218.  
  5219.    FUNCTION
  5220.     Similar to Execute(), but does not read commands from the input
  5221.     filehandle.  Spawns a Shell process to execute the command, and
  5222.     returns the returncode the command produced, or -1 if the command
  5223.     could not be run for any reason.  The input and output filehandles
  5224.     will not be closed by System, you must close them (if needed) after
  5225.     System returns, if you specified them via SYS_Input or SYS_Output.
  5226.  
  5227.     By default the new process will use your current Input() and Output()
  5228.     filehandles.  Normal Shell command-line parsing will be done
  5229.     including redirection on 'command'.  The current directory and path
  5230.     will be inherited from your process.  Your path will be used to find
  5231.     the command (if no path is specified).
  5232.  
  5233.     Note that you may NOT pass the same filehandle for both SYS_Input
  5234.     and SYS_Output.
  5235.  
  5236.     If used with the SYS_Asynch flag, it WILL close both it's input and
  5237.     output filehandles after running the command (even if these were
  5238.     your Input() and Output()!)
  5239.  
  5240.     Normally uses the boot (ROM) shell, but other shells can be specified
  5241.     via SYS_UserShell and SYS_CustomShell.  Normally, you should send
  5242.     things written by the user to the UserShell.  The UserShell defaults
  5243.     to the same shell as the boot shell.
  5244.  
  5245.     The tags are passed through to CreateNewProc() (tags that conflict
  5246.     with SystemTagList() will be filtered out).  This allows setting
  5247.     things like priority, etc for the new process.
  5248.  
  5249.    INPUTS
  5250.     command - Program and arguments
  5251.     tags    - see <dos/dostags.h>.  Note that both SystemTagList()-
  5252.           specific tags and tags from CreateNewProc() may be passed.
  5253.  
  5254.    RESULT
  5255.     error    - 0 for success, result from command, or -1.  Note that on
  5256.           error, the caller is responsible for any filehandles or other
  5257.           things passed in via tags.
  5258.  
  5259.    SEE ALSO
  5260.     Execute(), CreateNewProc(), <dos/dostags.h>, Input(), Output()
  5261.  
  5262. dos.library/UnGetC                                         dos.library/UnGetC
  5263.  
  5264.    NAME
  5265.     UnGetC -- Makes a char available for reading again. (buffered) (V36)
  5266.  
  5267.    SYNOPSIS
  5268.     value = UnGetC(fh, character)
  5269.     D0           D1      D2
  5270.  
  5271.     LONG UnGetC(BPTR, LONG)
  5272.  
  5273.    FUNCTION
  5274.     Pushes the character specified back into the input buffer.  Every
  5275.     time you use a buffered read routine, you can always push back 1
  5276.     character.  You may be able to push back more, though it is not
  5277.     recommended, since there is no guarantee on how many can be
  5278.     pushed back at a given moment.
  5279.  
  5280.     Passing -1 for the character will cause the last character read to
  5281.     be pushed back.  If the last character read was an EOF, the next
  5282.     character read will be an EOF.
  5283.  
  5284.     Note: UnGetC can be used to make sure that a filehandle is set up
  5285.     as a read filehandle.  This is only of importance if you are writing
  5286.     a shell, and must manipulate the filehandle's buffer.
  5287.  
  5288.    INPUTS
  5289.     fh      - filehandle to use for buffered I/O
  5290.     character - character to push back or -1
  5291.  
  5292.    RESULT
  5293.     value     - character pushed back, or FALSE if the character cannot
  5294.             be pushed back.
  5295.  
  5296.    BUGS
  5297.     In V36, UnGetC(fh,-1) after an EOF would not cause the next character
  5298.     read to be an EOF.  This was fixed for V37.
  5299.  
  5300.    SEE ALSO
  5301.     FGetC(), FPutC(), Flush()
  5302.  
  5303. dos.library/UnLoadSeg                                   dos.library/UnLoadSeg
  5304.  
  5305.     NAME
  5306.     UnLoadSeg -- Unload a seglist previously loaded by LoadSeg()
  5307.  
  5308.     SYNOPSIS
  5309.     success = UnLoadSeg( seglist )
  5310.     D0               D1
  5311.  
  5312.     BOOL UnLoadSeg(BPTR)
  5313.  
  5314.     FUNCTION
  5315.     Unload a seglist loaded by LoadSeg().  'seglist' may be zero.
  5316.     Overlaid segments will have all needed cleanup done, including
  5317.     closing files.
  5318.  
  5319.     INPUTS
  5320.     seglist - BCPL pointer to a segment identifier
  5321.  
  5322.     RESULTS
  5323.     success - returns 0 if a NULL seglist was passed or if it failed
  5324.           to close an overlay file.  NOTE: this function returned
  5325.           a random value before V36!
  5326.  
  5327.     SEE ALSO
  5328.     LoadSeg(), InternalLoadSeg(), InternalUnLoadSeg()
  5329.  
  5330. dos.library/UnLock                                         dos.library/UnLock
  5331.  
  5332.     NAME
  5333.     UnLock -- Unlock a directory or file
  5334.  
  5335.     SYNOPSIS
  5336.     UnLock( lock )
  5337.         D1
  5338.  
  5339.     void UnLock(BPTR)
  5340.  
  5341.     FUNCTION
  5342.     The filing system lock (obtained from Lock(), DupLock(), or
  5343.     CreateDir()) is removed and deallocated.
  5344.  
  5345.     INPUTS
  5346.     lock - BCPL pointer to a lock
  5347.  
  5348.     NOTE
  5349.     passing zero to UnLock() is harmless
  5350.  
  5351.     SEE ALSO
  5352.     Lock(), DupLock(), ParentOfFH(), DupLockFromFH()
  5353.  
  5354. dos.library/UnLockDosList                           dos.library/UnLockDosList
  5355.  
  5356.    NAME
  5357.     UnLockDosList -- Unlocks the Dos List (V36)
  5358.  
  5359.    SYNOPSIS
  5360.     UnLockDosList(flags)
  5361.             D1
  5362.  
  5363.     void UnLockDosList(ULONG)
  5364.  
  5365.    FUNCTION
  5366.     Unlocks the access on the Dos Device List.  You MUST pass the same
  5367.     flags you used to lock the list.
  5368.  
  5369.    INPUTS
  5370.     flags - MUST be the same flags passed to (Attempt)LockDosList()
  5371.  
  5372.    SEE ALSO
  5373.     AttemptLockDosList(), LockDosList(), Permit()
  5374.  
  5375. dos.library/UnLockRecord                             dos.library/UnLockRecord
  5376.  
  5377.    NAME
  5378.     UnLockRecord -- Unlock a record (V36)
  5379.  
  5380.    SYNOPSIS
  5381.     success = UnLockRecord(fh,offset,length)
  5382.     D0               D1   D2     D3
  5383.  
  5384.     BOOL UnLockRecord(BPTR,ULONG,ULONG)
  5385.  
  5386.    FUNCTION
  5387.     This releases the specified lock on a file.  Note that you must use
  5388.     the same filehandle you used to lock the record, and offset and length
  5389.     must be the same values used to lock it.  Every LockRecord() call must
  5390.     be balanced with an UnLockRecord() call.
  5391.  
  5392.    INPUTS
  5393.     fh      - File handle of locked file
  5394.     offset  - Record start position
  5395.     length  - Length of record in bytes
  5396.  
  5397.    RESULT
  5398.     success - Success or failure.
  5399.  
  5400.    BUGS
  5401.     See LockRecord()
  5402.  
  5403.    SEE ALSO
  5404.     LockRecords(), LockRecord(), UnLockRecords()
  5405.  
  5406. dos.library/UnLockRecords                           dos.library/UnLockRecords
  5407.  
  5408.    NAME
  5409.     UnLockRecords -- Unlock a list of records (V36)
  5410.  
  5411.    SYNOPSIS
  5412.     success = UnLockRecords(record_array)
  5413.     D0                     D1
  5414.  
  5415.     BOOL UnLockRecords(struct RecordLock *)
  5416.  
  5417.    FUNCTION
  5418.     This releases an array of record locks obtained using LockRecords.
  5419.     You should NOT modify the record_array while you have the records
  5420.     locked.  Every LockRecords() call must be balanced with an
  5421.     UnLockRecords() call.
  5422.  
  5423.    INPUTS
  5424.     record_array - List of records to be unlocked
  5425.  
  5426.    RESULT
  5427.     success      - Success or failure.
  5428.  
  5429.    BUGS
  5430.     See LockRecord()
  5431.  
  5432.    SEE ALSO
  5433.     LockRecords(), LockRecord(), UnLockRecord()
  5434.  
  5435. dos.library/VFPrintf                                     dos.library/VFPrintf
  5436.  
  5437.    NAME
  5438.     VFPrintf -- format and print a string to a file (buffered) (V36)
  5439.  
  5440.    SYNOPSIS
  5441.     count = VFPrintf(fh, fmt, argv)
  5442.     D0               D1  D2    D3
  5443.  
  5444.     LONG VFPrintf(BPTR, STRPTR, LONG *)
  5445.  
  5446.     count = FPrintf(fh, fmt, ...)
  5447.  
  5448.     LONG FPrintf(BPTR, STRPTR, ...)
  5449.  
  5450.    FUNCTION
  5451.     Writes the formatted string and values to the given file.  This
  5452.     routine is assumed to handle all internal buffering so that the
  5453.     formatting string and resultant formatted values can be arbitrarily
  5454.     long.  Any secondary error code is returned in IoErr().  This routine
  5455.     is buffered.
  5456.  
  5457.    INPUTS
  5458.     fh    - Filehandle to write to
  5459.     fmt   - RawDoFmt() style formatting string
  5460.     argv  - Pointer to array of formatting values
  5461.  
  5462.    RESULT
  5463.     count - Number of bytes written or -1 (EOF) for an error
  5464.  
  5465.    BUGS
  5466.     The prototype for FPrintf() currently forces you to cast the first
  5467.     varargs parameter to LONG due to a deficiency in the program
  5468.     that generates fds, prototypes, and amiga.lib stubs.
  5469.  
  5470.    SEE ALSO
  5471.     VPrintf(), VFWritef(), RawDoFmt(), FPutC()
  5472.  
  5473. dos.library/VFWritef                                     dos.library/VFWritef
  5474.  
  5475.    NAME
  5476.     VFWritef - write a BCPL formatted string to a file (buffered) (V36)
  5477.  
  5478.    SYNOPSIS
  5479.     count = VFWritef(fh, fmt, argv)
  5480.     D0               D1  D2    D3
  5481.  
  5482.     LONG VFWritef(BPTR, STRPTR, LONG *)
  5483.  
  5484.     count = FWritef(fh, fmt, ...)
  5485.  
  5486.     LONG FWritef(BPTR, STRPTR, ...)
  5487.  
  5488.    FUNCTION
  5489.     Writes the formatted string and values to the specified file.  This
  5490.     routine is assumed to handle all internal buffering so that the
  5491.     formatting string and resultant formatted values can be arbitrarily
  5492.     long.  The formats are in BCPL form.  This routine is buffered.
  5493.  
  5494.     Supported formats are:  (Note x is in base 36!)
  5495.         %S  - string (CSTR)
  5496.         %Tx - writes a left-justified string in a field at least
  5497.               x bytes long.
  5498.         %C  - writes a single character
  5499.         %Ox - writes a number in octal, maximum x characters wide
  5500.         %Xx - writes a number in hex, maximum x characters wide
  5501.         %Ix - writes a number in decimal, maximum x characters wide
  5502.         %N  - writes a number in decimal, any length
  5503.         %Ux - writes an unsigned number, maximum x characters wide
  5504.         %$  - ignore parameter
  5505.  
  5506.     Note: 'x' above is actually the character value - '0'.
  5507.  
  5508.    INPUTS
  5509.     fh    - filehandle to write to
  5510.     fmt   - BCPL style formatting string
  5511.     argv  - Pointer to array of formatting values
  5512.  
  5513.    RESULT
  5514.     count - Number of bytes written or -1 for error
  5515.  
  5516.    BUGS
  5517.     As of V37, VFWritef() does NOT return a valid return value.  In
  5518.     order to reduce possible errors, the prototypes supplied for the
  5519.     system as of V37 have it typed as VOID.
  5520.  
  5521.    SEE ALSO
  5522.     VFPrintf(), VFPrintf(), FPutC()
  5523.  
  5524. dos.library/VPrintf                                       dos.library/VPrintf
  5525.  
  5526.    NAME
  5527.     VPrintf -- format and print string (buffered) (V36)
  5528.  
  5529.    SYNOPSIS
  5530.     count = VPrintf(fmt, argv)
  5531.       D0            D1   D2
  5532.  
  5533.     LONG VPrintf(STRPTR, LONG *)
  5534.  
  5535.     count = Printf(fmt, ...)
  5536.  
  5537.     LONG Printf(STRPTR, ...)
  5538.  
  5539.    FUNCTION
  5540.     Writes the formatted string and values to Output().  This routine is 
  5541.     assumed to handle all internal buffering so that the formatting string
  5542.     and resultant formatted values can be arbitrarily long.  Any secondary
  5543.     error code is returned in IoErr().  This routine is buffered.
  5544.  
  5545.     Note: RawDoFmt assumes 16 bit ints, so you will usually need 'l's in
  5546.     your formats (ex: %ld versus %d).
  5547.  
  5548.    INPUTS
  5549.     fmt   - exec.library RawDoFmt() style formatting string
  5550.     argv  - Pointer to array of formatting values
  5551.    
  5552.    RESULT
  5553.     count - Number of bytes written or -1 (EOF) for an error
  5554.  
  5555.    BUGS
  5556.     The prototype for Printf() currently forces you to cast the first
  5557.     varargs parameter to LONG due to a deficiency in the program
  5558.     that generates fds, prototypes, and amiga.lib stubs.
  5559.  
  5560.    SEE ALSO
  5561.     VFPrintf(), VFWritef(), RawDoFmt(), FPutC()
  5562.  
  5563. dos.library/WaitForChar                               dos.library/WaitForChar
  5564.  
  5565.     NAME
  5566.     WaitForChar -- Determine if chars arrive within a time limit
  5567.  
  5568.     SYNOPSIS
  5569.     status = WaitForChar( file, timeout )
  5570.     D0              D1    D2
  5571.  
  5572.     BOOL WaitForChar(BPTR, LONG)
  5573.  
  5574.     FUNCTION
  5575.     If a character is available to be read from 'file' within the
  5576.     time (in microseconds) indicated by 'timeout', WaitForChar()
  5577.     returns -1 (TRUE). If a character is available, you can use Read()
  5578.     to read it.  Note that WaitForChar() is only valid when the I/O
  5579.     stream is connected to a virtual terminal device. If a character is
  5580.     not available within 'timeout', a 0 (FALSE) is returned.
  5581.  
  5582.     BUGS
  5583.     Due to a bug in the timer.device in V1.2/V1.3, specifying a timeout
  5584.     of zero for WaitForChar() can cause the unreliable timer & floppy
  5585.     disk operation.
  5586.  
  5587.     INPUTS
  5588.     file - BCPL pointer to a file handle
  5589.     timeout - integer
  5590.  
  5591.     RESULTS
  5592.     status - boolean
  5593.  
  5594.     SEE ALSO
  5595.     Read(), FGetC()
  5596.  
  5597. dos.library/WaitPkt                                       dos.library/WaitPkt
  5598.  
  5599.    NAME
  5600.     WaitPkt -- Waits for a packet to arrive at your pr_MsgPort (V36)
  5601.  
  5602.    SYNOPSIS
  5603.     packet = WaitPkt()
  5604.     D0
  5605.  
  5606.     struct DosPacket *WaitPkt(void);
  5607.  
  5608.    FUNCTION
  5609.     Waits for a packet to arrive at your pr_MsgPort.  If anyone has
  5610.     installed a packet wait function in pr_PktWait, it will be called.
  5611.     The message will be automatically GetMsg()ed so that it is no longer
  5612.     on the port.  It assumes the message is a dos packet.  It is NOT
  5613.     guaranteed to clear the signal for the port.
  5614.  
  5615.    RESULT
  5616.     packet - the packet that arrived at the port (from ln_Name of message).
  5617.  
  5618.    SEE ALSO
  5619.     SendPkt(), DoPkt(), AbortPkt()
  5620.  
  5621. dos.library/Write                                           dos.library/Write
  5622.  
  5623.     NAME
  5624.     Write -- Write bytes of data to a file
  5625.  
  5626.     SYNOPSIS
  5627.     returnedLength =  Write( file, buffer, length )
  5628.     D0             D1    D2      D3
  5629.  
  5630.     LONG Write (BPTR, void *, LONG)
  5631.  
  5632.     FUNCTION
  5633.     Write() writes bytes of data to the opened file 'file'. 'length'
  5634.     indicates the length of data to be transferred; 'buffer' is a
  5635.     pointer to the buffer. The value returned is the length of
  5636.     information actually written. So, when 'length' is greater than
  5637.     zero, the value of 'length' is the number of characters written.
  5638.     Errors are indicated by a value of -1.
  5639.  
  5640.     Note: this is an unbuffered routine (the request is passed directly
  5641.     to the filesystem.)  Buffered I/O is more efficient for small
  5642.     reads and writes; see FPutC().
  5643.  
  5644.     INPUTS
  5645.     file - BCPL pointer to a file handle
  5646.     buffer - pointer to the buffer
  5647.     length - integer
  5648.  
  5649.     RESULTS
  5650.     returnedLength - integer
  5651.  
  5652.     SEE ALSO
  5653.     Read(), Seek(), Open(), Close(), FPutC
  5654.  
  5655. dos.library/WriteChars                                 dos.library/WriteChars
  5656.  
  5657.    NAME
  5658.     WriteChars -- Writes bytes to the the default output (buffered) (V36)
  5659.  
  5660.    SYNOPSIS
  5661.     count = WriteChars(buf, buflen)
  5662.     D0                 D1
  5663.  
  5664.     LONG WriteChars(STRPTR, LONG)
  5665.  
  5666.    FUNCTION
  5667.     This routine writes a number of bytes to the default output.  The
  5668.     length is returned.  This routine is buffered.
  5669.  
  5670.    INPUTS
  5671.     buf    - buffer of characters to write
  5672.     buflen - number of characters to write
  5673.  
  5674.    RESULT
  5675.     count - Number of bytes written.  -1 (EOF) indicates an error
  5676.  
  5677.    SEE ALSO
  5678.     FPuts(), FPutC(), FWrite(), PutStr()
  5679.  
  5680.