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 / amiga_lib.doc < prev    next >
Encoding:
Text File  |  1993-08-12  |  62.8 KB  |  2,120 lines

  1. TABLE OF CONTENTS
  2.  
  3. amiga.lib/ACrypt
  4. amiga.lib/AddTOF
  5. amiga.lib/afp
  6. amiga.lib/ArgArrayDone
  7. amiga.lib/ArgArrayInit
  8. amiga.lib/ArgInt
  9. amiga.lib/ArgString
  10. amiga.lib/arnd
  11. amiga.lib/BeginIO
  12. amiga.lib/CallHook
  13. amiga.lib/CallHookA
  14. amiga.lib/CheckRexxMsg
  15. amiga.lib/CoerceMethod
  16. amiga.lib/CoerceMethodA
  17. amiga.lib/CreateExtIO
  18. amiga.lib/CreatePort
  19. amiga.lib/CreateStdIO
  20. amiga.lib/CreateTask
  21. amiga.lib/CxCustom
  22. amiga.lib/CxDebug
  23. amiga.lib/CxFilter
  24. amiga.lib/CxSender
  25. amiga.lib/CxSignal
  26. amiga.lib/CxTranslate
  27. amiga.lib/dbf
  28. amiga.lib/DeleteExtIO
  29. amiga.lib/DeletePort
  30. amiga.lib/DeleteStdIO
  31. amiga.lib/DeleteTask
  32. amiga.lib/DoMethod
  33. amiga.lib/DoMethodA
  34. amiga.lib/DoSuperMethod
  35. amiga.lib/DoSuperMethodA
  36. amiga.lib/FastRand
  37. amiga.lib/fpa
  38. amiga.lib/FreeIEvents
  39. amiga.lib/GetRexxVar
  40. amiga.lib/HookEntry
  41. amiga.lib/HotKey
  42. amiga.lib/InvertString
  43. amiga.lib/NewList
  44. amiga.lib/printf
  45. amiga.lib/RangeRand
  46. amiga.lib/RemTOF
  47. amiga.lib/SetRexxVar
  48. amiga.lib/SetSuperAttrs
  49. amiga.lib/sprintf
  50. amiga.lib/stdio
  51. amiga.lib/TimeDelay
  52. pools.lib/LibAllocPooled
  53. pools.lib/LibCreatePool
  54. pools.lib/LibDeletePool
  55. pools.lib/LibFreePooled
  56. amiga.lib/ACrypt                                             amiga.lib/ACrypt
  57.  
  58.    NAME
  59.     ACrypt -- Encrypt a password (V37)
  60.  
  61.    SYNOPSIS
  62.     newpass = ACcrypt( buffer, password, username )
  63.  
  64.     STRPTR ACrypt( STRPTR, STRPTR, STRPTR);
  65.  
  66.    FUNCTION
  67.     This function takes a buffer of at least 12 characters in length,
  68.     an unencrypted password and the user's name (as known to the host
  69.     system) and returns an encrypted password in the passed buffer. 
  70.     This is a one-way encryption. Normally, the user's encrypted 
  71.     password is stored in a file for future password comparison.
  72.  
  73.    INPUTS
  74.     buffer     - a pointer to a buffer at least 12 bytes in length.
  75.     password   - a pointer to an unencrypted password string.
  76.     username   - a pointer to the user's name.
  77.  
  78.    RESULT
  79.     newpass    - a pointer to the passed buffer if successful, NULL
  80.                  upon failure. The encrypted password placed in the
  81.                  buffer will be be eleven (11) characters in length
  82.                  and will be NULL-terminated.
  83.  
  84.    EXAMPLE
  85.  
  86.     UBYTE *pw, *getpassword() ;
  87.     UBYTE *user = "alf"
  88.     UBYTE *newpass ;
  89.     UBYTE buffer[16] ;         /* size >= 12 */
  90.  
  91.     pw = getpassword() ;   /* your own function */
  92.  
  93.     if((newpass = ACrypt(buffer, pw, user)) != NULL)
  94.     {
  95.         printf("pw = %s\n", newpass) ; /* newpass = &buffer[0] */
  96.     }
  97.     else
  98.     {
  99.         printf("ACrypt failed\n") ;
  100.     }
  101.  
  102.    NOTES
  103.     This function first appeared in later V39 versions of amiga.lib,
  104.     but works under V37 and up.
  105.  
  106. amiga.lib/AddTOF                                             amiga.lib/AddTOF
  107.  
  108.    NAME
  109.     AddTOF - add a task to the VBlank interrupt server chain.
  110.  
  111.    SYNOPSIS
  112.     AddTOF(i,p,a);
  113.  
  114.     VOID AddTOF(struct Isrvstr *, APTR, APTR);
  115.  
  116.    FUNCTION
  117.     Adds a task to the vertical-blanking interval interrupt server
  118.     chain. This prevents C programmers from needing to write an
  119.     assembly language stub to do this function.
  120.  
  121.    INPUTS
  122.     i - pointer to an initialized Isrvstr structure
  123.     p - pointer to the C-code routine that this server is to call each
  124.         time TOF happens
  125.     a - pointer to the first longword in an array of longwords that
  126.         is to be used as the arguments passed to your routine
  127.         pointed to by p.
  128.  
  129.    SEE ALSO
  130.     RemTOF(), <graphics/graphint.h>
  131.  
  132. amiga.lib/afp                                                   amiga.lib/afp
  133.  
  134.    NAME
  135.     afp - Convert ASCII string variable into fast floating point
  136.  
  137.    SYNOPSIS
  138.     ffp_value = afp(string);
  139.  
  140.     FUNCTION
  141.     Accepts the address of the ASCII string in C format that is
  142.     converted into an FFP floating point number.
  143.  
  144.     The string is expected in this Format:
  145.     {S}{digits}{'.'}{digits}{'E'}{S}{digits}
  146.     <*******MANTISSA*******><***EXPONENT***>
  147.  
  148.  
  149.     Syntax rules:
  150.     Both signs are optional and are '+' or '-'. The mantissa must be
  151.     present. The exponent need not be present. The mantissa may lead
  152.     with a decimal point. The mantissa need not have a decimal point.
  153.     Examples: All of these values represent the number fourty-two.
  154.              42        .042e3
  155.              42.      +.042e+03
  156.             +42.      0.000042e6
  157.         0000042.00     420000e-4
  158.                  420000.00e-0004
  159.  
  160.     Floating point range:
  161.     Fast floating point supports the value zero and non-zero values
  162.     within the following bounds -
  163.             18                   20
  164.      9.22337177 x 10   > +number >    5.42101070 x 10
  165.             18                   -20
  166.     -9.22337177 x 10   > -number > -2.71050535 x 10
  167.  
  168.     Precision:
  169.     This conversion results in a 24 bit precision with guaranteed
  170.     error less than or equal to one-half least significant bit.
  171.  
  172.     INPUTS
  173.     string - Pointer to the ASCII string to be converted.
  174.  
  175.  
  176.     OUTPUTS
  177.     string - points to the character which terminated the scan
  178.     equ - fast floating point equivalent
  179. amiga.lib/ArgArrayDone                                 amiga.lib/ArgArrayDone
  180.  
  181.    NAME
  182.     ArgArrayDone -- release the memory allocated by a previous call
  183.             to ArgArrayInit(). (V36)
  184.  
  185.    SYNOPSIS
  186.     ArgArrayDone();
  187.  
  188.     VOID ArgArrayDone(VOID);
  189.  
  190.    FUNCTION
  191.     This function frees memory and does cleanup required after a
  192.     call to ArgArrayInit(). Don't call this until you are done using
  193.     the ToolTypes argument strings.
  194.  
  195.    SEE ALSO
  196.     ArgArrayInit()
  197.  
  198. amiga.lib/ArgArrayInit                                 amiga.lib/ArgArrayInit
  199.  
  200.    NAME
  201.     ArgArrayInit -- allocate and initialize a tooltype array. (V36)
  202.  
  203.    SYNOPSIS
  204.     ttypes = ArgArrayInit(argc,argv);
  205.  
  206.     UBYTE **ArgArrayInit(LONG,UBYTE **);
  207.  
  208.    FUNCTION
  209.     This function returns a null-terminated array of strings
  210.     suitable for sending to icon.library/FindToolType(). This array will
  211.     be the ToolTypes array of the program's icon, if it was started from
  212.     Workbench. It will just be 'argv' if the program was started from
  213.     a shell.
  214.  
  215.     Pass ArgArrayInit() your startup arguments received by main().
  216.  
  217.     ArgArrayInit() requires that icon.library be open (even if the caller
  218.     was started from a shell, so that the function FindToolType() can be
  219.     used) and may call GetDiskObject(), so clean up is necessary when
  220.     the strings are no longer needed. The function ArgArrayDone() does
  221.     just that.
  222.  
  223.    INPUTS
  224.     argc - the number of arguments in argv, 0 when started from Workbench
  225.     argv - an array of pointers to the program's arguments, or the
  226.            Workbench startup message when started from WB.
  227.  
  228.    RESULTS
  229.     ttypes - the initialized argument array or NULL if it could not be
  230.              allocated
  231.  
  232.    EXAMPLE
  233.     Use of these routines facilitates the use of ToolTypes or command-
  234.     line arguments to control end-user parameters in Commodities
  235.     applications. For example, a filter used to trap a keystroke for
  236.     popping up a window might be created by something like this:
  237.  
  238.             char   *ttypes  = ArgArrayInit(argc, argv);
  239.             CxObj   *filter = UserFilter(ttypes, "POPWINDOW", "alt f1");
  240.  
  241.                ... with ...
  242.  
  243.                CxObj *UserFilter(char **tt, char *action_name,
  244.                   char *default_descr)
  245.         {
  246.         char *desc;
  247.  
  248.             desc = FindToolType(tt,action_name);
  249.  
  250.             return(CxFilter((ULONG)(desc? desc: default_descr)));
  251.         }
  252.  
  253.     In this way the user can assign "alt f2" to the action by
  254.     entering a tooltype in the program's icon of the form:
  255.  
  256.         POPWINDOW=alt f2
  257.  
  258.     or by starting the program from the CLI like so:
  259.  
  260.         myprogram "POPWINDOW=alt f2"
  261.  
  262.    NOTE
  263.     Your program must open icon.library and set up IconBase before calling
  264.     this routine. In addition IconBase must remain valid until after
  265.     ArgArrayDone() has been called!
  266.  
  267.    SEE ALSO
  268.     ArgArrayDone(), ArgString(), ArgInt(), icon.library/FindToolType()
  269.  
  270. amiga.lib/ArgInt                                             amiga.lib/ArgInt
  271.  
  272.    NAME
  273.     ArgInt -- return an integer value from a ToolTypes array. (V36)
  274.  
  275.    SYNOPSIS
  276.     value = ArgInt(tt,entry,defaultval)
  277.  
  278.     LONG ArgInt(UBYTE **,STRPTR,LONG);
  279.  
  280.    FUNCTION
  281.     This function looks in the ToolTypes array 'tt' returned
  282.     by ArgArrayInit() for 'entry' and returns the value associated
  283.     with it. 'tt' is in standard ToolTypes format such as:
  284.  
  285.         ENTRY=Value
  286.  
  287.     The Value string is passed to atoi() and the result is returned by
  288.     this function.
  289.  
  290.     If 'entry' is not found, the integer 'defaultval' is returned.
  291.  
  292.    INPUTS
  293.     tt - a ToolTypes array as returned by ArgArrayInit()
  294.     entry - the entry in the ToolTypes array to search for
  295.     defaultval - the value to return in case 'entry' is not found within
  296.              the ToolTypes array
  297.  
  298.    RESULTS
  299.     value - the value associated with 'entry', or defaultval if 'entry'
  300.         is not in the ToolTypes array
  301.  
  302.    NOTES
  303.     This function requires that dos.library V36 or higher be opened.
  304.  
  305.    SEE ALSO
  306.     ArgArrayInit()
  307.  
  308. amiga.lib/ArgString                                       amiga.lib/ArgString
  309.  
  310.    NAME
  311.     ArgString -- return a string pointer from a ToolTypes array. (V36)
  312.  
  313.    SYNOPSIS
  314.     string = ArgString(tt,entry,defaultstring)
  315.  
  316.     STRPTR ArgString(UBYTE **,STRPTR,STRPTR);
  317.  
  318.    FUNCTION
  319.     This function looks in the ToolTypes array 'tt' returned
  320.     by ArgArrayInit() for 'entry' and returns the value associated
  321.     with it. 'tt' is in standard ToolTypes format such as:
  322.  
  323.         ENTRY=Value
  324.  
  325.     This function returns a pointer to the Value string.
  326.  
  327.     If 'entry' is not found, 'defaultstring' is returned.
  328.  
  329.    INPUTS
  330.     tt - a ToolTypes array as returned by ArgArrayInit()
  331.     entry - the entry in the ToolTypes array to search for
  332.     defaultstring - the value to return in case 'entry' is not found within
  333.                 the ToolTypes array
  334.  
  335.    RESULTS
  336.     value - the value associated with 'entry', or defaultstring if 'entry'
  337.         is not in the ToolTypes array
  338.  
  339.    SEE ALSO
  340.     ArgArrayInit()
  341.  
  342. amiga.lib/arnd                                                 amiga.lib/arnd
  343.  
  344.   NAME
  345.     arnd - ASCII round of the provided floating point string
  346.  
  347.    SYNOPSIS
  348.     arnd(place, exp, &string[0]);
  349.  
  350.    FUNCTION
  351.     Accepts an ASCII string representing an FFP floating point
  352.     number, the binary representation of the exponent of said
  353.     floating point number and the number of places to round to.
  354.     A rounding process is initiated, either to the left or right
  355.     of the decimal place and the result placed back at the
  356.     input address defined by &string[0].
  357.  
  358.    INPUTS
  359.     place - integer representing number of decimal places to round to
  360.     exp - integer representing exponent value of the ASCII string
  361.     &string[0] - address where rounded ASCII string is to be placed
  362.              (16 bytes)
  363.  
  364.    RESULT
  365.     &string[0] - rounded ASCII string
  366.  
  367.    BUGS
  368.     None
  369. amiga.lib/BeginIO                                           amiga.lib/BeginIO
  370.  
  371.    NAME
  372.     BeginIO -- initiate asynchronous device I/O
  373.  
  374.    SYNOPSIS
  375.     BeginIO(ioReq)
  376.  
  377.     VOID BeginIO(struct IORequest *);
  378.  
  379.    FUNCTION
  380.     This function takes an IORequest, and passes it directly to the
  381.     "BeginIO" vector of the proper device.  This is equivalent to
  382.     SendIO(), except that io_Flags is not cleared. A good understanding
  383.     of Exec device I/O is required to properly use this function.
  384.  
  385.     This function does not wait for the I/O to complete.
  386.  
  387.    INPUTS
  388.     ioReq - an initialized and opened IORequest structure with the
  389.             io_Flags field set to a reasonable value (set to 0 if you do
  390.         not require io_Flags).
  391.  
  392.    SEE ALSO
  393.     exec.library/DoIO(), exec.library/SendIO(), exec.library/WaitIO()
  394.  
  395. amiga.lib/CallHook                                         amiga.lib/CallHook
  396.  
  397.    NAME
  398.     CallHook -- Invoke a hook given a message on the stack.
  399.  
  400.    SYNOPSIS
  401.     result = CallHook( hookPtr, obj, ... )
  402.  
  403.     ULONG CallHook( struct Hook *, Object *, ... );
  404.  
  405.    FUNCTION
  406.     Like CallHookA(), CallHook() invoke a hook on the supplied
  407.     hook-specific data (an "object") and a parameter packet ("message").
  408.     However, CallHook() allows you to build the message on your stack.
  409.  
  410.    INPUTS
  411.     hookPtr - A system-standard hook
  412.     obj - hook-specific data object
  413.     ... - The hook-specific message you wish to send.  The hook is
  414.         expecting a pointer to the message, so a pointer into your
  415.         stack will be sent.
  416.  
  417.    RESULT
  418.     result - a hook-specific result.
  419.  
  420.    NOTES
  421.     This function first appeared in the V37 release of amiga.lib.
  422.     However, it does not depend on any particular version of the OS,
  423.     and works fine even in V34.
  424.  
  425.    EXAMPLE
  426.     If your hook's message was
  427.  
  428.         struct myMessage
  429.         {
  430.         ULONG mm_FirstGuy;
  431.         ULONG mm_SecondGuy;
  432.         ULONG mm_ThirdGuy;
  433.         };
  434.  
  435.     You could write:
  436.  
  437.         result = CallHook( hook, obj, firstguy, secondguy, thirdguy );
  438.  
  439.     as a shorthand for:
  440.  
  441.         struct myMessage msg;
  442.  
  443.         msg.mm_FirstGuy = firstguy;
  444.         msg.mm_SecondGuy = secondguy;
  445.         msg.mm_ThirdGuy = thirdguy;
  446.  
  447.         result = CallHookA( hook, obj, &msg );
  448.  
  449.    SEE ALSO
  450.     CallHookA(), utility.library/CallHookPkt(), <utility/hooks.h>
  451.  
  452. amiga.lib/CallHookA                                       amiga.lib/CallHookA
  453.  
  454.    NAME
  455.     CallHookA -- Invoke a hook given a pointer to a message.
  456.  
  457.    SYNOPSIS
  458.     result = CallHookA( hookPtr, obj, message )
  459.  
  460.     ULONG CallHook( struct Hook *, Object *, APTR );
  461.  
  462.    FUNCTION
  463.     Invoke a hook on the supplied hook-specific data (an "object")
  464.     and a parameter packet ("message").  This function is equivalent
  465.     to utility.library/CallHookPkt().
  466.  
  467.    INPUTS
  468.     hookPtr - A system-standard hook
  469.     obj - hook-specific data object
  470.     message - The hook-specific message you wish to send
  471.  
  472.    RESULT
  473.     result - a hook-specific result.
  474.  
  475.    NOTES
  476.     This function first appeared in the V37 release of amiga.lib.
  477.     However, it does not depend on any particular version of the OS,
  478.     and works fine even in V34.
  479.  
  480.    SEE ALSO
  481.     CallHook(), utility.library/CallHookPkt(), <utility/hooks.h>
  482.  
  483. amiga.lib/CheckRexxMsg                                 amiga.lib/CheckRexxMsg
  484.  
  485.    NAME
  486.     CheckRexxMsg - Check if a RexxMsg is from ARexx
  487.  
  488.    SYNOPSIS
  489.     result = CheckRexxMsg(message)
  490.     D0                    A0
  491.  
  492.     BOOL CheckRexxMsg(struct RexxMsg *);
  493.  
  494.    FUNCTION
  495.     This function checks to make sure that the message is from ARexx
  496.     directly.  It is required when using the Rexx Variable Interface
  497.     routines (RVI) that the message be from ARexx.
  498.  
  499.     While this function is new in the V37 amiga.lib, it is safe to
  500.     call it in all versions of the operating system.  It is also
  501.     PURE code, thus usable in resident/pure executables.
  502.  
  503.    NOTE
  504.     This is a stub in amiga.lib.  It is only available via amiga.lib.
  505.     The stub has two labels.  One, _CheckRexxMsg, takes the arguments
  506.     from the stack.  The other, CheckRexxMsg, takes the arguments in
  507.     registers.
  508.  
  509.    EXAMPLE
  510.     if (CheckRexxMsg(rxmsg))
  511.     {
  512.         /* Message is one from ARexx */
  513.     }
  514.  
  515.    INPUTS
  516.     message        A pointer to the RexxMsg in question
  517.  
  518.    RESULTS
  519.     result        A boolean - TRUE if message is from ARexx.
  520.  
  521.    SEE ALSO
  522.     GetRexxVar(), SetRexxVar()
  523.  
  524. amiga.lib/CoerceMethod                                 amiga.lib/CoerceMethod
  525.  
  526.    NAME
  527.     CoerceMethod -- Perform method on coerced object.
  528.  
  529.    SYNOPSIS
  530.     result = CoerceMethod( cl, obj, MethodID, ... )
  531.  
  532.     ULONG CoerceMethod( struct IClass *, Object *, ULONG, ... );
  533.  
  534.    FUNCTION
  535.     Boopsi support function that invokes the supplied message
  536.     on the specified object, as though it were the specified
  537.     class.  Equivalent to CoerceMethodA(), but allows you to
  538.     build the message on the stack.
  539.  
  540.    INPUTS
  541.     cl - pointer to boopsi class to receive the message
  542.     obj - pointer to boopsi object
  543.     ... - method-specific message built on the stack
  544.  
  545.    RESULT
  546.     result - class and message-specific result.
  547.  
  548.    NOTES
  549.     This function first appears in the V37 release of amiga.lib.
  550.     While it intrinsically does not require any particular release
  551.     of the system software to operate, it is designed to work with
  552.     the boopsi subsystem of Intuition, which was only introduced
  553.     in V36.
  554.  
  555.    SEE ALSO
  556.     CoerceMethodA(), DoMethodA(), DoSuperMethodA(), <intuition/classusr.h>
  557.     ROM Kernel Manual boopsi section
  558.  
  559. amiga.lib/CoerceMethodA                               amiga.lib/CoerceMethodA
  560.  
  561.    NAME
  562.     CoerceMethodA -- Perform method on coerced object.
  563.  
  564.    SYNOPSIS
  565.     result = CoerceMethodA( cl, obj, msg )
  566.  
  567.     ULONG CoerceMethodA( struct IClass *, Object *, Msg );
  568.  
  569.    FUNCTION
  570.     Boopsi support function that invokes the supplied message
  571.     on the specified object, as though it were the specified
  572.     class.
  573.  
  574.    INPUTS
  575.     cl - pointer to boopsi class to receive the message
  576.     obj - pointer to boopsi object
  577.     msg - pointer to method-specific message to send
  578.  
  579.    RESULT
  580.     result - class and message-specific result.
  581.  
  582.    NOTES
  583.     This function first appears in the V37 release of amiga.lib.
  584.     While it intrinsically does not require any particular release
  585.     of the system software to operate, it is designed to work with
  586.     the boopsi subsystem of Intuition, which was only introduced
  587.     in V36.
  588.     Some early example code may refer to this function as CM().
  589.  
  590.    SEE ALSO
  591.     CoerceMethod(), DoMethodA(), DoSuperMethodA(), <intuition/classusr.h>
  592.     ROM Kernel Manual boopsi section
  593.  
  594. amiga.lib/CreateExtIO                                   amiga.lib/CreateExtIO
  595.  
  596.    NAME
  597.     CreateExtIO -- create an IORequest structure
  598.  
  599.    SYNOPSIS
  600.     ioReq = CreateExtIO(port,ioSize);
  601.  
  602.     struct IORequest *CreateExtIO(struct MsgPort *, ULONG);
  603.  
  604.    FUNCTION
  605.     Allocates memory for and initializes a new IO request block
  606.     of a user-specified number of bytes. The number of bytes
  607.     MUST be the size of a legal IORequest (or extended IORequest)
  608.     or very nasty things will happen.
  609.  
  610.    INPUTS
  611.     port - an already initialized message port to be used for this IO
  612.            request's reply port. If this is NULL this function fails.
  613.     ioSize - the size of the IO request to be created.
  614.  
  615.    RESULT
  616.     ioReq - a new IO Request block, or NULL if there was not enough memory
  617.  
  618.    EXAMPLE
  619.     if (ioReq = CreateExtIO(CreatePort(NULL,0),sizeof(struct IOExtTD)))
  620.  
  621.    SEE ALSO
  622.     DeleteExtIO(), CreatePort(), exec.library/CreateMsgPort()
  623.  
  624. amiga.lib/CreatePort                                     amiga.lib/CreatePort
  625.  
  626.    NAME
  627.     CreatePort - Allocate and initialize a new message port
  628.  
  629.    SYNOPSIS
  630.     port = CreatePort(name,pri)
  631.  
  632.     struct MsgPort *CreatePort(STRPTR,LONG);
  633.  
  634.    FUNCTION
  635.     Allocates and initializes a new message port. The message list
  636.     of the new port will be prepared for use (via NewList).  A signal
  637.     bit will be allocated, and the port will be set to signal your
  638.     task when a message arrives (PA_SIGNAL).
  639.  
  640.     You *must* use DeletePort() to delete ports created with
  641.     CreatePort()!
  642.  
  643.    INPUTS
  644.     name - public name of the port, or NULL if the port is not named.
  645.            The name string is not copied. Most ports do not need names,
  646.            see notes below on this.
  647.     pri  - Priority used for insertion into the public port list,
  648.            normally 0.
  649.  
  650.    RESULT
  651.     port - a new MsgPort structure ready for use, or NULL if the port
  652.            could not be created due to not enough memory or no available
  653.            signal bit.
  654.  
  655.    NOTE
  656.     In most cases, ports should not be named. Named ports are used for
  657.     rendez-vous between tasks. Everytime a named port needs to be located,
  658.     the list of all named ports must be traversed. The more named
  659.     ports there are, the longer this list traversal takes. Thus, unless
  660.     you really need to, do not name your ports, which will keep them off
  661.     of the named port list and improve system performance.
  662.  
  663.    BUGS
  664.     With versions of amiga.lib prior to V37.14, this function would
  665.     not fail even though it couldn't allocate a signal bit. The port
  666.     would be returned with no signal allocated.
  667.  
  668.    SEE ALSO
  669.     DeletePort(), exec.library/FindPort(), <exec/ports.h>,
  670.     exec.library/CreateMsgPort()
  671.  
  672. amiga.lib/CreateStdIO                                   amiga.lib/CreateStdIO
  673.  
  674.    NAME
  675.     CreateStdIO -- create an IOStdReq structure
  676.  
  677.    SYNOPSIS
  678.     ioReq = CreateStdIO(port);
  679.  
  680.     struct IOStdReq *CreateStdIO(struct MsgPort *)
  681.  
  682.    FUNCTION
  683.     Allocates memory for and initializes a new IOStdReq structure.
  684.  
  685.    INPUTS
  686.     port - an already initialized message port to be used for this IO
  687.            request's reply port. If this is NULL this function fails.
  688.  
  689.    RESULT
  690.     ioReq - a new IOStdReq structure, or NULL if there was not enough
  691.         memory
  692.  
  693.    SEE ALSO
  694.     DeleteStdIO(), CreateExtIO(), exec.library/CreateIORequest()
  695.  
  696. amiga.lib/CreateTask                                     amiga.lib/CreateTask
  697.  
  698.    NAME
  699.     CreateTask -- Create task with given name, priority, stacksize
  700.  
  701.    SYNOPSIS
  702.     task = CreateTask(name,pri,initPC,stackSize)
  703.  
  704.     struct Task *CreateTask(STRPTR,LONG,funcEntry,ULONG);
  705.  
  706.    FUNCTION
  707.     This function simplifies program creation of sub-tasks by
  708.     dynamically allocating and initializing required structures
  709.     and stack space, and adding the task to Exec's task list
  710.     with the given name and priority. A tc_MemEntry list is provided
  711.     so that all stack and structure memory allocated by CreateTask()
  712.     is automatically deallocated when the task is removed.
  713.  
  714.     An Exec task may not call dos.library functions or any function
  715.     which might cause the loading of a disk-resident library, device,
  716.     or file (since such functions are indirectly calls to dos.library).
  717.     Only AmigaDOS Processes may call AmigaDOS; see the
  718.     dos.library/CreateProc() or the dos.library/CreateNewProc()
  719.     functions for more information.
  720.  
  721.     If other tasks or processes will need to find this task by name,
  722.     provide a complex and unique name to avoid conflicts.
  723.  
  724.     If your compiler provides automatic insertion of stack-checking
  725.     code, you may need to disable this feature when compiling sub-task
  726.     code since the stack for the subtask is at a dynamically allocated
  727.     location.  If your compiler requires 68000 registers to contain
  728.     particular values for base relative addressing, you may need to
  729.     save these registers from your main process, and restore them
  730.     in your initial subtask code.
  731.  
  732.     The function entry initPC is generally provided as follows:
  733.  
  734.     In C:
  735.     extern void functionName();
  736.     char *tname = "unique name";
  737.     task = CreateTask(tname, 0L, functionName, 4000L);
  738.  
  739.     In assembler:
  740.         PEA    startLabel
  741.  
  742.    INPUTS
  743.     name - a null-terminated name string
  744.     pri - an Exec task priority between -128 and 127, normally 0
  745.     funcEntry - the address of the first executable instruction
  746.             of the subtask code
  747.     stackSize - size in bytes of stack for the subtask. Don't cut it
  748.             too close - system function stack usage may change.
  749.  
  750.    RESULT
  751.     task - a pointer to the newly created task, or NULL if there was not
  752.            enough memory.
  753.  
  754.    BUGS
  755.     Under exec.library V37 or beyond, the AddTask() function used
  756.     internally by CreateTask() can fail whereas it couldn't fail in
  757.     previous versions of Exec. Prior to amiga.lib V37.14, this function
  758.     did not check for failure of AddTask() and thus might return a
  759.     pointer to a task structure even though the task was not actually
  760.     added to the system.
  761.  
  762.    SEE ALSO
  763.     DeleteTask(), exec/FindTask()
  764.  
  765. amiga.lib/CxCustom                                         amiga.lib/CxCustom
  766.  
  767.    NAME
  768.     CxCustom -- create a custom commodity object. (V36)
  769.  
  770.    SYNOPSIS
  771.     customObj = CxCustom(action,id);
  772.  
  773.     CxObj *CxCustom(LONG(*)(),LONG);
  774.  
  775.    FUNCTION
  776.     This function creates a custom commodity object. The action
  777.     of this object on receiving a commodity message is to call a
  778.     function of the application programmer's choice.
  779.  
  780.     The function provided ('action') will be passed a pointer to
  781.     the actual commodities message (in commodities private data
  782.     space), and will actually execute as part of the input handler
  783.     system task. Among other things, the value of 'id' can be
  784.     recovered from the message by using the function CxMsgID().
  785.  
  786.     The purpose of this function is two-fold. First, it allows
  787.     programmers to create Commodities Exchange objects with
  788.     functionality that was not imagined or chosen for inclusion
  789.     by the designers. Secondly, this is the only way to act
  790.     synchronously with Commodities.
  791.  
  792.     This function is a C-language macro for CreateCxObj(), defined
  793.     in <libraries/commodities.h>.
  794.  
  795.    INPUTS
  796.     action - a function to call whenever a message reaches the object
  797.     id - a message id to assign to the object
  798.  
  799.    RESULTS
  800.     customObj - a pointer to the new custom object, or NULL if it could
  801.             not be created.
  802.  
  803.   SEE ALSO
  804.     commodities.library/CreateCxObj(), commodities.library/CxMsgID()
  805.  
  806. amiga.lib/CxDebug                                           amiga.lib/CxDebug
  807.  
  808.    NAME
  809.     CxDebug -- create a commodity debug object. (V36)
  810.  
  811.    SYNOPSIS
  812.     debugObj = CxDebug(id);
  813.  
  814.     CxObj *CxDebug(LONG);
  815.  
  816.    FUNCTION
  817.     This function creates a Commodities debug object. The action of this
  818.     object on receiving a Commodities message is to print out information
  819.     about the Commodities message through the serial port (using the
  820.     kprintf() routine). The value of 'id' will also be displayed.
  821.  
  822.     Note that this is a synchronous occurrence (the printing is done by
  823.     the input device task). If screen or file output is desired, using a
  824.     sender object instead of a debug object is necessary, since such
  825.     output is best done by your application process.
  826.  
  827.     This function is a C-language macro for CreateCxObj(), defined
  828.     in <libraries/commodities.h>.
  829.  
  830.    INPUTS
  831.     id - the id to assign to the debug object, this value is output
  832.          whenever the debug object sends data to the serial port.
  833.  
  834.    RESULTS
  835.     debugObj - a pointer to the debug object, or NULL if it could
  836.            not be created.
  837.  
  838.    SEE ALSO
  839.     commodities.library/CreateCxObj(), CxSender(), debug.lib/kprintf()
  840.  
  841. amiga.lib/CxFilter                                         amiga.lib/CxFilter
  842.  
  843.    NAME
  844.     CxFilter -- create a commodity filter object. (V36)
  845.  
  846.    SYNOPSIS
  847.     filterObj = CxFilter(description);
  848.  
  849.     CxObj *CxFilter(STRPTR)
  850.  
  851.    FUNCTION
  852.     Creates an input event filter object that matches the
  853.     'description' string. If 'description' is NULL, the filter will not
  854.     match any messages.
  855.  
  856.     A filter may be modified by the functions SetFilter(), using
  857.     a description string, and SetFilterIX(), which takes a
  858.     binary Input Expression as a parameter.
  859.  
  860.     This function is a C-language macro for CreateCxObj(), defined
  861.     in <libraries/commodities.h>.
  862.  
  863.    INPUTS
  864.     description - the description string in the same format as strings
  865.               expected by commodities.library/SetFilter()
  866.  
  867.    RESULTS
  868.     filterObj - a pointer to the filter object, or NULL if there
  869.             was not enough memory. If there is a problem in the
  870.             description string, the internal error code of the filter
  871.             object will be set to so indicate. This error code may be
  872.             interrogated using the function CxObjError().
  873.  
  874.    SEE ALSO
  875.     commodities.library/CreateCxObj(), commodities.library/SetFilter(),
  876.     commodities.library/SetFilterIX(), commodities.library/CxObjError()
  877.  
  878. amiga.lib/CxSender                                         amiga.lib/CxSender
  879.  
  880.    NAME
  881.     CxSender -- create a commodity sender object. (V36)
  882.  
  883.    SYNOPSIS
  884.     senderObj = CxSender(port,id)
  885.  
  886.     CxObj *CxSender(struct MsgPort *,LONG);
  887.  
  888.    FUNCTION
  889.     This function creates a Commodities sender object. The action
  890.     of this object on receiving a Commodities message is to copy the
  891.     Commodities message into a standard Exec Message, to put the value
  892.     'id' in the message as well, and to send the message off to the
  893.     message port 'port'.
  894.  
  895.     The value 'id' is used so that an application can monitor
  896.     messages from several senders at a single port. It can be retrieved
  897.     from the Exec message by using the function CxMsgID(). The value can
  898.     be a simple integer ID, or a pointer to some application data
  899.     structure.
  900.  
  901.     Note that Exec messages sent by sender objects arrive
  902.     asynchronously at the destination port. Do not assume anything about
  903.     the status of the Commodities message which was copied into the Exec
  904.     message you received.
  905.  
  906.     All Exec messages sent to your ports must be replied. Messages may be
  907.     replied after the sender object has been deleted.
  908.  
  909.     This function is a C-language macro for CreateCxObj(), defined
  910.     in <libraries/commodities.h>.
  911.  
  912.    INPUTS
  913.     port - the port for the sender to send messages to
  914.     id - the id of the messages sent by the sender
  915.  
  916.    RESULTS
  917.     senderObj - a pointer to the sender object, or NULL if it could
  918.             not be created.
  919.  
  920.    SEE ALSO
  921.     commodities.library/CreateCxObj(), commodities.library/CxMsgID(),
  922.     exec.library/PutMsg(), exec.library/ReplyMsg()
  923.  
  924. amiga.lib/CxSignal                                         amiga.lib/CxSignal
  925.  
  926.    NAME
  927.     CxSignal -- create a commodity signaller object. (V36)
  928.  
  929.    SYNOPSIS
  930.     signalerObj = CxSignal(task,signal);
  931.  
  932.     CxObj *CxSignal(struct Task *,LONG);
  933.  
  934.    FUNCTION
  935.     This function creates a Commodities signal object. The action
  936.     of this object on receiving a Commodities message is to
  937.     send the 'signal' to the 'task'. The caller is responsible
  938.     for allocating the signal and determining the proper task ID.
  939.  
  940.     Note that 'signal' is the signal value as returned by AllocSignal(),
  941.     not the mask made from that value.
  942.  
  943.     This function is a C-language macro for CreateCxObj(), defined
  944.     in <libraries/commodities.h>.
  945.  
  946.    INPUTS
  947.     task - the task for the signaller to signal
  948.     signal - the signal bit number for the signaller to send
  949.  
  950.    RESULTS
  951.     signallerObj - a pointer to the signaller object, or NULL if it could
  952.                not be created.
  953.  
  954.    SEE ALSO
  955.     commodities.library/CreateCxObj(), exec.library/FindTask()
  956.     exec.library/Signal(), exec.library/AllocSignal(),
  957.  
  958. amiga.lib/CxTranslate                                   amiga.lib/CxTranslate
  959.  
  960.    NAME
  961.     CxTranslate -- create a commodity translator object. (V36)
  962.  
  963.    SYNOPSIS
  964.     translatorObj = CxTranslate(ie);
  965.  
  966.     CxObj *CxTranslate(struct InputEvent *);
  967.  
  968.    FUNCTION
  969.     This function creates a Commodities 'translator' object.
  970.     The action of this object on receiving a Commodities message is to
  971.     replace that message in the commodities network with a chain of
  972.     Commodities input messages.
  973.  
  974.     There is one new Commodities input message generated for each input
  975.     event in the linked list starting at 'ie' (and NULL terminated). The
  976.     routing information of the new input messages is copied from the input
  977.     message they replace.
  978.  
  979.     The linked list of input events associated with a translator object
  980.     can be changed using the SetTranslate() function.
  981.  
  982.     If 'ie' is NULL, the null translation occurs: that is, the original
  983.     commodities input message is disposed, and no others are created to
  984.     take its place.
  985.  
  986.     This function is a C-language macro for CreateCxObj(), defined
  987.     in <libraries/commodities.h>.
  988.  
  989.    INPUTS
  990.     ie - the input event list used as replacement by the translator
  991.  
  992.    RESULTS
  993.     translatorObj - a pointer to the translator object, or NULL if it could
  994.                 not be created.
  995.  
  996.    SEE ALSO
  997.     commodities.library/CreateCxObj(), commodities.library/SetTranslate()
  998.  
  999. amiga.lib/dbf                                                   amiga.lib/dbf
  1000.  
  1001.    NAME
  1002.     dbf - convert FFP dual-binary number to FFP format
  1003.  
  1004.    SYNOPSIS
  1005.     fnum = dbf(exp, mant);
  1006.  
  1007.    FUNCTION
  1008.     Accepts a dual-binary format (described below) floating point
  1009.     number and converts it to an FFP format floating point number.
  1010.     The dual-binary format is defined as:
  1011.  
  1012.         exp bit  16    = sign (0=>positive, 1=>negative)
  1013.         exp bits 15-0    = binary integer representing the base
  1014.                       ten (10) exponent
  1015.         man        = binary integer mantissa
  1016.  
  1017.    INPUTS
  1018.     exp - binary integer representing sign and exponent
  1019.     mant - binary integer representing the mantissa
  1020.  
  1021.    RESULT
  1022.     fnum - converted FFP floating point format number
  1023.  
  1024.    BUGS
  1025.     None
  1026. amiga.lib/DeleteExtIO                                   amiga.lib/DeleteExtIO
  1027.  
  1028.    NAME
  1029.     DeleteExtIO - return memory allocated for extended IO request
  1030.  
  1031.    SYNOPSIS
  1032.     DeleteExtIO(ioReq);
  1033.  
  1034.     VOID DeleteExtIO(struct IORequest *);
  1035.  
  1036.    FUNCTION
  1037.     Frees up an IO request as allocated by CreateExtIO().
  1038.  
  1039.    INPUTS
  1040.     ioReq - the IORequest block to be freed, or NULL.
  1041.  
  1042.    SEE ALSO
  1043.     CreateExtIO()
  1044.  
  1045. amiga.lib/DeletePort                                     amiga.lib/DeletePort
  1046.  
  1047.    NAME
  1048.     DeletePort - free a message port created by CreatePort()
  1049.  
  1050.    SYNOPSIS
  1051.     DeletePort(port)
  1052.  
  1053.     VOID DeletePort(struct MsgPort *);
  1054.  
  1055.    FUNCTION
  1056.     Frees a message port created by CreatePort. All messages that
  1057.     may have been attached to this port must have already been
  1058.     replied before this function is called.
  1059.  
  1060.    INPUTS
  1061.     port - message port to delete
  1062.  
  1063.    SEE ALSO
  1064.     CreatePort()
  1065.  
  1066. amiga.lib/DeleteStdIO                                   amiga.lib/DeleteStdIO
  1067.  
  1068.    NAME
  1069.     DeleteStdIO - return memory allocated for IOStdReq
  1070.  
  1071.    SYNOPSIS
  1072.     DeleteStdIO(ioReq);
  1073.  
  1074.     VOID DeleteStdIO(struct IOStdReq *);
  1075.  
  1076.    FUNCTION
  1077.     Frees up an IOStdReq as allocated by CreateStdIO().
  1078.  
  1079.    INPUTS
  1080.     ioReq - the IORequest block to be freed, or NULL.
  1081.  
  1082.    SEE ALSO
  1083.     CreateStdIO(), DeleteExtIO(), exec.library/CreateIORequest()
  1084.  
  1085. amiga.lib/DeleteTask                                     amiga.lib/DeleteTask
  1086.  
  1087.    NAME
  1088.     DeleteTask -- delete a task created with CreateTask()
  1089.  
  1090.    SYNOPSIS
  1091.     DeleteTask(task)
  1092.  
  1093.     VOID DeleteTask(struct Task *);
  1094.  
  1095.    FUNCTION
  1096.     This function simply calls exec.library/RemTask(), deleting a task
  1097.     from the Exec task lists and automatically freeing any stack and
  1098.     structure memory allocated for it by CreateTask().
  1099.  
  1100.     Before deleting a task, you must first make sure that the task is
  1101.     not currently executing any system code which might try to signal
  1102.     the task after it is gone.
  1103.  
  1104.     This can be accomplished by stopping all sources that might reference
  1105.     the doomed task, then causing the subtask to execute a Wait(0L).
  1106.     Another option is to have the task call DeleteTask()/RemTask() on
  1107.     itself.
  1108.  
  1109.    INPUTS
  1110.     task - task to remove from the system
  1111.  
  1112.    NOTE
  1113.     This function simply calls exec.library/RemTask(), so you can call
  1114.     RemTask() directly instead of calling this function.
  1115.  
  1116.    SEE ALSO
  1117.     CreateTask(), exec.library/RemTask()
  1118.  
  1119. amiga.lib/DoMethod                                         amiga.lib/DoMethod
  1120.  
  1121.    NAME
  1122.     DoMethod -- Perform method on object.
  1123.  
  1124.    SYNOPSIS
  1125.     result = DoMethod( obj, MethodID, ... )
  1126.  
  1127.     ULONG DoMethod( Object *, ULONG, ... );
  1128.  
  1129.    FUNCTION
  1130.     Boopsi support function that invokes the supplied message
  1131.     on the specified object.  The message is invoked on the
  1132.     object's true class.  Equivalent to DoMethodA(), but allows
  1133.     you to build the message on the stack.
  1134.  
  1135.    INPUTS
  1136.     obj - pointer to boopsi object
  1137.     MethodID - which method to send (see <intuition/classusr.h>)
  1138.     ... - method-specific message built on the stack
  1139.  
  1140.    RESULT
  1141.     result - specific to the message and the object's class.
  1142.  
  1143.    NOTES
  1144.     This function first appears in the V37 release of amiga.lib.
  1145.     While it intrinsically does not require any particular release
  1146.     of the system software to operate, it is designed to work with
  1147.     the boopsi subsystem of Intuition, which was only introduced
  1148.     in V36.
  1149.  
  1150.    SEE ALSO
  1151.     DoMethodA(), CoerceMethodA(), DoSuperMethodA(), <intuition/classusr.h>
  1152.     ROM Kernel Manual boopsi section
  1153.  
  1154. amiga.lib/DoMethodA                                       amiga.lib/DoMethodA
  1155.  
  1156.    NAME
  1157.     DoMethodA -- Perform method on object.
  1158.  
  1159.    SYNOPSIS
  1160.     result = DoMethodA( obj, msg )
  1161.  
  1162.     ULONG DoMethodA( Object *, Msg );
  1163.  
  1164.    FUNCTION
  1165.     Boopsi support function that invokes the supplied message
  1166.     on the specified object.  The message is invoked on the
  1167.     object's true class.
  1168.  
  1169.    INPUTS
  1170.     obj - pointer to boopsi object
  1171.     msg - pointer to method-specific message to send
  1172.  
  1173.    RESULT
  1174.     result - specific to the message and the object's class.
  1175.  
  1176.    NOTES
  1177.     This function first appears in the V37 release of amiga.lib.
  1178.     While it intrinsically does not require any particular release
  1179.     of the system software to operate, it is designed to work with
  1180.     the boopsi subsystem of Intuition, which was only introduced
  1181.     in V36.
  1182.     Some early example code may refer to this function as DM().
  1183.  
  1184.    SEE ALSO
  1185.     DoMethod(), CoerceMethodA(), DoSuperMethodA(), <intuition/classusr.h>
  1186.     ROM Kernel Manual boopsi section
  1187.  
  1188. amiga.lib/DoSuperMethod                               amiga.lib/DoSuperMethod
  1189.  
  1190.    NAME
  1191.     DoSuperMethod -- Perform method on object coerced to superclass.
  1192.  
  1193.    SYNOPSIS
  1194.     result = DoSuperMethod( cl, obj, MethodID, ... )
  1195.  
  1196.     ULONG DoSuperMethod( struct IClass *, Object *, ULONG, ... );
  1197.  
  1198.    FUNCTION
  1199.     Boopsi support function that invokes the supplied message
  1200.     on the specified object, as though it were the superclass
  1201.     of the specified class.  Equivalent to DoSuperMethodA(),
  1202.     but allows you to build the message on the stack.
  1203.  
  1204.    INPUTS
  1205.     cl - pointer to boopsi class whose superclass is to
  1206.         receive the message
  1207.     obj - pointer to boopsi object
  1208.     ... - method-specific message built on the stack
  1209.  
  1210.    RESULT
  1211.     result - class and message-specific result.
  1212.  
  1213.    NOTES
  1214.     This function first appears in the V37 release of amiga.lib.
  1215.     While it intrinsically does not require any particular release
  1216.     of the system software to operate, it is designed to work with
  1217.     the boopsi subsystem of Intuition, which was only introduced
  1218.     in V36.
  1219.  
  1220.    SEE ALSO
  1221.     CoerceMethodA(), DoMethodA(), DoSuperMethodA(), <intuition/classusr.h>
  1222.     ROM Kernel Manual boopsi section
  1223.  
  1224. amiga.lib/DoSuperMethodA                             amiga.lib/DoSuperMethodA
  1225.  
  1226.    NAME
  1227.     DoSuperMethodA -- Perform method on object coerced to superclass.
  1228.  
  1229.    SYNOPSIS
  1230.     result = DoSuperMethodA( cl, obj, msg )
  1231.  
  1232.     ULONG DoSuperMethodA( struct IClass *, Object *, Msg );
  1233.  
  1234.    FUNCTION
  1235.     Boopsi support function that invokes the supplied message
  1236.     on the specified object, as though it were the superclass
  1237.     of the specified class.
  1238.  
  1239.    INPUTS
  1240.     cl - pointer to boopsi class whose superclass is to
  1241.         receive the message
  1242.     obj - pointer to boopsi object
  1243.     msg - pointer to method-specific message to send
  1244.  
  1245.    RESULT
  1246.     result - class and message-specific result.
  1247.  
  1248.    NOTES
  1249.     This function first appears in the V37 release of amiga.lib.
  1250.     While it intrinsically does not require any particular release
  1251.     of the system software to operate, it is designed to work with
  1252.     the boopsi subsystem of Intuition, which was only introduced
  1253.     in V36.
  1254.     Some early example code may refer to this function as DSM().
  1255.  
  1256.    SEE ALSO
  1257.     CoerceMethodA(), DoMethodA(), DoSuperMethod(), <intuition/classusr.h>
  1258.     ROM Kernel Manual boopsi section
  1259.  
  1260. amiga.lib/FastRand                                         amiga.lib/FastRand
  1261.  
  1262.    NAME
  1263.     FastRand - quickly generate a somewhat random integer
  1264.  
  1265.    SYNOPSIS
  1266.     number = FastRand(seed);
  1267.  
  1268.     ULONG FastRand(ULONG);
  1269.  
  1270.    FUNCTION
  1271.     Seed value is taken from stack, shifted left one position,
  1272.     exclusive-or'ed with hex value $1D872B41 and returned.
  1273.  
  1274.    INPUTS
  1275.     seed - a 32-bit integer
  1276.  
  1277.    RESULT
  1278.     number - new random seed, a 32-bit value
  1279.  
  1280.    SEE ALSO
  1281.     RangeRand()
  1282.  
  1283. amiga.lib/fpa                                                   amiga.lib/fpa
  1284.  
  1285.    NAME
  1286.     fpa - convert fast floating point into ASCII string equivalent
  1287.  
  1288.    SYNOPSIS
  1289.     exp = fpa(fnum, &string[0]);
  1290.  
  1291.    FUNCTION
  1292.     Accepts an FFP number and the address of the ASCII string where it's
  1293.     converted output is to be stored.  The number is converted to a NULL
  1294.     terminated ASCII string in and stored at the address provided.
  1295.     Additionally, the base ten (10) exponent in binary form is returned.
  1296.  
  1297.    INPUTS
  1298.     fnum       - Motorola Fast Floating Point number
  1299.     &string[0] - address for output of converted ASCII character string
  1300.              (16 bytes)
  1301.  
  1302.    RESULT
  1303.     &string[0] - converted ASCII character string
  1304.     exp       - integer exponent value in binary form
  1305.  
  1306.    BUGS
  1307.     None
  1308. amiga.lib/FreeIEvents                                   amiga.lib/FreeIEvents
  1309.  
  1310.    NAME
  1311.     FreeIEvents -- free a chain of input events allocated by
  1312.                InvertString(). (V36)
  1313.  
  1314.    SYNOPSIS
  1315.     FreeIEvents(events)
  1316.  
  1317.     VOID FreeIEvents(struct InputEvent *);
  1318.  
  1319.    FUNCTION
  1320.     This function frees a linked list of input events as obtained from
  1321.     InvertString().
  1322.  
  1323.    INPUTS
  1324.        events - the list of input events to free, may be NULL.
  1325.  
  1326.    SEE ALSO
  1327.     InvertString()
  1328.  
  1329. amiga.lib/GetRexxVar                                     amiga.lib/GetRexxVar
  1330.  
  1331.    NAME
  1332.     GetRexxVar - Gets the value of a variable from a running ARexx program
  1333.  
  1334.    SYNOPSIS
  1335.     error = GetRexxVar(message,varname,bufpointer)
  1336.     D0,A1              A0      A1      (C-only)
  1337.  
  1338.     LONG GetRexxVar(struct RexxMsg *,char *,char **);
  1339.  
  1340.    FUNCTION
  1341.     This function will attempt to extract the value of the symbol
  1342.     varname from the ARexx script that sent the message.  When called
  1343.     from C, a pointer to the extracted value will be placed in the
  1344.     pointer pointed to by bufpointer.  (*bufpointer will be the pointer
  1345.     to the value)
  1346.  
  1347.     When called from assembly, the pointer will be returned in A1.
  1348.  
  1349.     The value string returned *MUST* *NOT* be modified.
  1350.  
  1351.     While this function is new in the V37 amiga.lib, it is safe to
  1352.     call it in all versions of the operating system.  It is also
  1353.     PURE code, thus usable in resident/pure executables.
  1354.  
  1355.    NOTE
  1356.     This is a stub in amiga.lib.  It is only available via amiga.lib.
  1357.     The stub has two labels.  One, _GetRexxVar, takes the arguments
  1358.     from the stack.  The other, GetRexxVar, takes the arguments in
  1359.     registers.
  1360.  
  1361.     This routine does a CheckRexxMsg() on the message.
  1362.  
  1363.    EXAMPLE
  1364.  
  1365.     char    *value;
  1366.  
  1367.     /* Message is one from ARexx */
  1368.     if (!GetRexxVar(rxmsg,"TheVar",&value))
  1369.     {
  1370.         /* The value was gotten and now is pointed to by value */
  1371.         printf("Value of TheVar is %s\n",value);
  1372.     }
  1373.  
  1374.    INPUTS
  1375.     message        A message gotten from an ARexx script
  1376.     varname        The name of the variable to extract
  1377.     bufpointer    (For C only) A pointer to a string pointer.
  1378.  
  1379.    RESULTS
  1380.     error        0 for success, otherwise an error code.
  1381.             (Other codes may exists, these are documented)
  1382.             3  == Insufficient Storage
  1383.             9  == String too long
  1384.             10 == invalid message
  1385.  
  1386.     A1        (Assembly only)  Pointer to the string.
  1387.  
  1388.    SEE ALSO
  1389.     SetRexxVar(), CheckRexxMsg()
  1390.  
  1391. amiga.lib/HookEntry                                       amiga.lib/HookEntry
  1392.  
  1393.    NAME
  1394.     HookEntry -- Assembler to HLL conversion stub for hook entry.
  1395.  
  1396.    SYNOPSIS
  1397.     result = HookEntry( struct Hook *, Object *, APTR )
  1398.     D0                  A0             A2        A1
  1399.  
  1400.    FUNCTION
  1401.     By definition, a standard hook entry-point must receive the
  1402.     hook in A0, the object in A2, and the message in A1.  If your
  1403.     hook entry-point is written in a high-level language and is
  1404.     expecting its parameters on the stack, then HookEntry() will
  1405.     put the three parameters on the stack and invoke the function
  1406.     stored in the hook h_SubEntry field.
  1407.  
  1408.     This function is only useful to hook implementers, and is
  1409.     never called from C.
  1410.  
  1411.    INPUTS
  1412.     hook - pointer to hook being invoked
  1413.     object - pointer to hook-specific data
  1414.     msg - pointer to hook-specific message
  1415.  
  1416.    RESULT
  1417.     result - a hook-specific result.
  1418.  
  1419.    NOTES
  1420.     This function first appeared in the V37 release of amiga.lib.
  1421.     However, it does not depend on any particular version of the OS,
  1422.     and works fine even in V34.
  1423.  
  1424.    EXAMPLE
  1425.     If your hook dispatcher is this:
  1426.  
  1427.     dispatch( struct Hook *hookPtr, Object *obj, APTR msg )
  1428.     {
  1429.         ...
  1430.     }
  1431.  
  1432.     Then when you initialize your hook, you would say:
  1433.  
  1434.     myhook.h_Entry = HookEntry;    /* amiga.lib stub */
  1435.     myhook.h_SubEntry = dispatch;    /* HLL entry */
  1436.  
  1437.    SEE ALSO
  1438.     CallHook(), CallHookA(), <utility/hooks.h>
  1439.     
  1440. amiga.lib/HotKey                                             amiga.lib/HotKey
  1441.  
  1442.    NAME
  1443.     HotKey -- create a commodity triad. (V36)
  1444.  
  1445.    SYNOPSIS
  1446.     filterObj = Hotkey(description,port,id);
  1447.  
  1448.     CxObj *HotKey(STRPTR,struct MsgPort *,LONG);
  1449.  
  1450.    FUNCTION
  1451.     This function creates a triad of commodity objects to accomplish a
  1452.     high-level function.
  1453.  
  1454.     The three objects are a filter, which is created to match by the call
  1455.     CxFilter(description), a sender created by the call CxSender(port,id),
  1456.     and a translator which is created by CxTranslate(NULL), so that it
  1457.     swallows any commodity input event messages that are passed down by
  1458.     the filter.
  1459.  
  1460.     This is the simple way to get a message sent to your program when the
  1461.     user performs a particular input action.
  1462.  
  1463.     It is strongly recommended that the ToolTypes environment be used to
  1464.     allow the user to specify the input descriptions for your application's
  1465.     hotkeys.
  1466.  
  1467.    INPUTS
  1468.     description - the description string to use for the filter in the same
  1469.               format as accepted by commodities.library/SetFilter()
  1470.     port - port for the sender to send messages to.
  1471.     id - id of the messages sent by the sender
  1472.  
  1473.    RESULTS
  1474.     filterObj - a pointer to a filter object, or NULL if it could
  1475.             not be created.
  1476.  
  1477.    SEE ALSO
  1478.     CxFilter(), CxSender(), CxTranslate(),
  1479.     commodities.library/CxObjError(), commodities.library/SetFilter()
  1480.  
  1481. amiga.lib/InvertString                                 amiga.lib/InvertString
  1482.  
  1483.    NAME
  1484.     InvertString -- produce input events that would generate the
  1485.             given string. (V36)
  1486.  
  1487.    SYNOPSIS
  1488.     events = InvertString(str,km)
  1489.  
  1490.     struct InputEvent *InvertString(STRPTR,struct KeyMap *);
  1491.  
  1492.    FUNCTION
  1493.     This function returns a linked list of input events which would
  1494.     translate into the string using the supplied keymap (or the system
  1495.     default keymap if 'km' is NULL).
  1496.  
  1497.     'str' is null-terminated and may contain:
  1498.        - ANSI character codes
  1499.        - backslash escaped characters:
  1500.         \n   -   CR
  1501.         \r   -   CR
  1502.         \t   -   TAB
  1503.         \0   -   illegal, do not use!
  1504.         \\   -   backslash
  1505.        - a text description of an input event as used by ParseIX(),
  1506.          enclosed in angle brackets.
  1507.  
  1508.     An example is:
  1509.           abc<alt f1>\nhi there.
  1510.  
  1511.    INPUTS
  1512.     str - null-terminated string to convert to input events
  1513.     km - keymap to use for the conversion, or NULL to use the default
  1514.          keymap.
  1515.  
  1516.    RESULTS
  1517.     events - a chain of input events, or NULL if there was a problem. The
  1518.          most likely cause of failure is an illegal description
  1519.          enclosed in angled brackets.
  1520.  
  1521.          This chain should eventually be freed using FreeIEvents().
  1522.  
  1523.    SEE ALSO
  1524.     commodities.library/ParseIX(), FreeIEvents()
  1525.  
  1526. amiga.lib/NewList                                           amiga.lib/NewList
  1527.  
  1528.    NAME
  1529.     NewList -- prepare a list structure for use
  1530.  
  1531.    SYNOPSIS
  1532.     NewList(list)
  1533.  
  1534.     VOID NewList(struct List *);
  1535.     VOID NewList(struct MinList *);
  1536.  
  1537.    FUNCTION
  1538.     Perform the magic needed to prepare a List header structure for
  1539.     use; the list will be empty and ready to use.  (If the list is the
  1540.     full featured type, you may need to initialize lh_Type afterwards)
  1541.  
  1542.     Assembly programmers may want to use the NEWLIST macro instead.
  1543.  
  1544.    INPUTS
  1545.     list - pointer to a List or MinList.
  1546.  
  1547.    SEE ALSO
  1548.     <exec/lists.h>
  1549.  
  1550. amiga.lib/printf                                             amiga.lib/printf
  1551.  
  1552.    NAME
  1553.     printf - print a formatted output line to the standard output.
  1554.  
  1555.    SYNOPSIS
  1556.     printf(formatstring [,value [,values] ] );
  1557.  
  1558.    FUNCTION
  1559.     Format the output in accordance with specifications in the format
  1560.     string.
  1561.  
  1562.    INPUTS
  1563.     formatString - a C-language-like NULL-terminated format string,
  1564.                with the following supported % options:
  1565.  
  1566.       %[flags][width][.limit][length]type
  1567.  
  1568.         $     - must follow the arg_pos value, if specified
  1569.       flags   - only one allowed. '-' specifies left justification.
  1570.       width   - field width. If the first character is a '0', the
  1571.                 field is padded with leading 0s.
  1572.         .     - must precede the field width value, if specified
  1573.       limit   - maximum number of characters to output from a string.
  1574.                 (only valid for %s or %b).
  1575.       length  - size of input data defaults to word (16-bit) for types c,
  1576.             d, u and x, 'l' changes this to long (32-bit).
  1577.       type    - supported types are:
  1578.                       b - BSTR, data is 32-bit BPTR to byte count followed
  1579.                           by a byte string. A NULL BPTR is treated as an
  1580.                   empty string. (V36)
  1581.                       d - signed decimal
  1582.               u - unsigned decimal
  1583.                       x - hexadecimal with hex digits in uppercase
  1584.               X - hexadecimal with hex digits in lowercase
  1585.                       s - string, a 32-bit pointer to a NULL-terminated
  1586.                           byte string. A NULL pointer is treated
  1587.                           as an empty string.
  1588.                       c - character
  1589.  
  1590.     value(s) - numeric variables or addresses of null-terminated strings
  1591.                to be added to the format information.
  1592.  
  1593.    NOTE
  1594.     The global "_stdout" must be defined, and contain a pointer to
  1595.     a legal AmigaDOS file handle. Using the standard Amiga startup
  1596.     module sets this up. In other cases you will need to define
  1597.     stdout, and assign it to some reasonable value (like what the
  1598.     dos.library/Output() call returns). This code would set it up:
  1599.  
  1600.         ULONG stdout;
  1601.         stdout=Output();
  1602.  
  1603.    BUGS
  1604.     This function will crash if the resulting stream after
  1605.     parameter substitution is longer than 140 bytes.
  1606.  
  1607. amiga.lib/RangeRand                                       amiga.lib/RangeRand
  1608.  
  1609.    NAME
  1610.     RangeRand - generate a random number within a specific integer range
  1611.  
  1612.    SYNOPSIS
  1613.     number = RangeRand(maxValue);
  1614.  
  1615.     UWORD RangeRand(UWORD);
  1616.  
  1617.    FUNCTION
  1618.     RangeRand() accepts a value from 0 to 65535, and returns a value
  1619.     within that range.
  1620.  
  1621.     maxValue is passed on stack as a 32-bit integer but used as though
  1622.     it is only a 16-bit integer. Variable named RangeSeed is available
  1623.     beginning with V33 that contains the global seed value passed from
  1624.     call to call and thus can be changed in a program by declaring:
  1625.  
  1626.       extern ULONG RangeSeed;
  1627.  
  1628.    INPUTS
  1629.     maxValue - the returned random number will be in the range
  1630.                [0..maxValue-1]
  1631.  
  1632.    RESULT
  1633.     number - pseudo random number in the range of [0..maxValue-1].
  1634.  
  1635.    SEE ALSO
  1636.     FastRand()
  1637.  
  1638. amiga.lib/RemTOF                                             amiga.lib/RemTOF
  1639.  
  1640.    NAME
  1641.     RemTOF - remove a task from the VBlank interrupt server chain.
  1642.  
  1643.    SYNOPSIS
  1644.     RemTOF(i);
  1645.  
  1646.     VOID RemTOF(struct Isrvstr *);
  1647.  
  1648.    FUNCTION
  1649.     Removes a task from the vertical-blanking interval interrupt server
  1650.     chain.
  1651.  
  1652.    INPUTS
  1653.     i - pointer to an Isrvstr structure
  1654.  
  1655.    SEE ALSO
  1656.     AddTOF(), <graphics/graphint.h>
  1657.  
  1658. amiga.lib/SetRexxVar                                     amiga.lib/SetRexxVar
  1659.  
  1660.    NAME
  1661.     SetRexxVar - Sets the value of a variable of a running ARexx program
  1662.  
  1663.    SYNOPSIS
  1664.     error = SetRexxVar(message,varname,value,length)
  1665.     D0                 A0      A1      D0    D1
  1666.  
  1667.     LONG SetRexxVar(struct RexxMsg *,char *,char *,ULONG);
  1668.  
  1669.    FUNCTION
  1670.     This function will attempt to the the value of the symbol
  1671.     varname in the ARexx script that sent the message.
  1672.  
  1673.     While this function is new in the V37 amiga.lib, it is safe to
  1674.     call it in all versions of the operating system.  It is also
  1675.     PURE code, thus usable in resident/pure executables.
  1676.  
  1677.    NOTE
  1678.     This is a stub in amiga.lib.  It is only available via amiga.lib.
  1679.     The stub has two labels.  One, _SetRexxVar, takes the arguments
  1680.     from the stack.  The other, SetRexxVar, takes the arguments in
  1681.     registers.
  1682.  
  1683.     This routine does a CheckRexxMsg() on the message.
  1684.  
  1685.    EXAMPLE
  1686.  
  1687.     char    *value;
  1688.  
  1689.     /* Message is one from ARexx */
  1690.     if (!SetRexxVar(rxmsg,"TheVar","25 Dollars",10))
  1691.     {
  1692.         /* The value of TheVar will now be "25 Dollars" */
  1693.     }
  1694.  
  1695.    INPUTS
  1696.     message        A message gotten from an ARexx script
  1697.     varname        The name of the variable to set
  1698.     value        A string that will be the new value of the variable
  1699.     length        The length of the value string
  1700.  
  1701.  
  1702.    RESULTS
  1703.     error        0 for success, otherwise an error code.
  1704.             (Other codes may exists, these are documented)
  1705.             3  == Insufficient Storage
  1706.             9  == String too long
  1707.             10 == invalid message
  1708.  
  1709.    SEE ALSO
  1710.     SetRexxVar(), CheckRexxMsg()
  1711.  
  1712. amiga.lib/SetSuperAttrs                               amiga.lib/SetSuperAttrs
  1713.  
  1714.    NAME
  1715.     SetSuperAttrs -- Invoke OM_SET method on superclass with varargs.
  1716.  
  1717.    SYNOPSIS
  1718.     result = SetSuperAttrs( cl, obj, tag, ... )
  1719.  
  1720.     ULONG SetSuperAttrs( struct IClass *, Object *, ULONG, ... );
  1721.  
  1722.    FUNCTION
  1723.     Boopsi support function which invokes the OM_SET method on the
  1724.     superclass of the supplied class for the supplied object.  Allows
  1725.     the ops_AttrList to be supplied on the stack (i.e. in a varargs
  1726.     way).  The equivalent non-varargs function would simply be
  1727.  
  1728.         DoSuperMethod( cl, obj, OM_SET, taglist, NULL );
  1729.  
  1730.    INPUTS
  1731.     cl - pointer to boopsi class whose superclass is to
  1732.         receive the OM_SET message
  1733.     obj - pointer to boopsi object
  1734.     tag - list of tag-attribute pairs, ending in TAG_DONE
  1735.  
  1736.    RESULT
  1737.     result - class and message-specific result.
  1738.  
  1739.    NOTES
  1740.     This function first appears in the V37 release of amiga.lib.
  1741.     While it intrinsically does not require any particular release
  1742.     of the system software to operate, it is designed to work with
  1743.     the boopsi subsystem of Intuition, which was only introduced
  1744.     in V36.
  1745.  
  1746.    SEE ALSO
  1747.     CoerceMethodA(), DoMethodA(), DoSuperMethodA(), <intuition/classusr.h>
  1748.     ROM Kernel Manual boopsi section
  1749.  
  1750. amiga.lib/sprintf                                           amiga.lib/sprintf
  1751.  
  1752.    NAME
  1753.     sprintf - format a C-like string into a string buffer.
  1754.  
  1755.    SYNOPSIS
  1756.     sprintf(destination formatstring [,value [, values] ] );
  1757.  
  1758.    FUNCTION
  1759.     Performs string formatting identical to printf, but directs the output
  1760.     into a specific destination in memory. This uses the ROM version
  1761.     of printf (exec.library/RawDoFmt()), so it is very small.
  1762.  
  1763.     Assembly programmers can call this by placing values on the
  1764.     stack, followed by a pointer to the formatstring, followed
  1765.     by a pointer to the destination string.
  1766.  
  1767.    INPUTS
  1768.     destination - the address of an area in memory into which the
  1769.               formatted output is to be placed.
  1770.     formatstring - pointer to a null terminated string describing the
  1771.                    desired output formatting (see printf() for a
  1772.                description of this string).
  1773.     value(s) - numeric information to be formatted into the output
  1774.            stream.
  1775.  
  1776.    SEE ALSO
  1777.      printf(), exec.library/RawDoFmt()
  1778.  
  1779. amiga.lib/stdio                                               amiga.lib/stdio
  1780.  
  1781.    NAMES
  1782.     fclose    - close a file
  1783.     fgetc    - get a character from a file
  1784.     fprintf    - format data to file (see printf())
  1785.     fputc    - put character to file
  1786.     fputs    - write string to file
  1787.     getchar    - get a character from stdin
  1788.     printf    - put format data to stdout (see exec.library/RawDoFmt)
  1789.     putchar    - put character to stdout
  1790.     puts    - put string to stdout, followed by newline
  1791.  
  1792.    FUNCTION
  1793.     These functions work much like the standard C functions of the same
  1794.     names. The file I/O functions all use non-buffered AmigaDOS
  1795.     files, and must not be mixed with the file I/O of any C
  1796.     compiler. The names of these functions match those found in many
  1797.     standard C libraries, when a name conflict occurs, the function is
  1798.     generally taken from the FIRST library that was specified on the
  1799.     linker's command line.  Thus to use these functions, specify
  1800.     the amiga.lib library first.
  1801.  
  1802.     To get a suitable AmigaDOS FileHandle, the dos.library/Open() or
  1803.     dos.library/Output() functions must be used.
  1804.  
  1805.     All of the functions that write to stdout expect an appropriate
  1806.     FileHandle to have been set up ahead of time. Depending on
  1807.     your C compiler and options, this may have been done by the
  1808.     startup code.  Or it can be done manually
  1809.  
  1810.     From C:
  1811.         extern ULONG stdout;
  1812.         /* Remove the extern if startup code did not define stdout */
  1813.         stdout=Output();
  1814.  
  1815.     From assembly:
  1816.         XDEF    _stdout
  1817.         DC.L    _stdout    ;<- Place result of dos.library/Output() here.
  1818.  
  1819. amiga.lib/TimeDelay                                       amiga.lib/TimeDelay
  1820.  
  1821.    NAME
  1822.     TimeDelay -- Return after a period of time has elapsed.
  1823.  
  1824.    SYNOPSIS
  1825.     Error = TimeDelay( Unit, Seconds, MicroSeconds )
  1826.     D0                 D0    D1       D2
  1827.  
  1828.     LONG TimeDelay( LONG, ULONG, ULONG );
  1829.  
  1830.    FUNCTION
  1831.     Waits for the period of time specified before returning to the
  1832.     the caller.
  1833.  
  1834.    INPUTS
  1835.     Unit -- timer.device unit to open for this command.
  1836.     Seconds -- The seconds field of a timerequest is filled with
  1837.         this value. Check the documentation for what a particular
  1838.         timer.device unit expects there.
  1839.     MicroSeconds -- The microseconds field of a timerequest is
  1840.         filled with this value. Check the documentation for what
  1841.         a particular timer.device units expects there.
  1842.  
  1843.    RESULTS
  1844.     Error -- will be zero if all went well; otherwise, non-zero.
  1845.  
  1846.    NOTES
  1847.     Two likely reasons for failures are invalid unit numbers or
  1848.     no more free signal bits for this task.
  1849.  
  1850.     While this function first appears in V37 amiga.lib, it works
  1851.     on Kickstart V33 and higher.
  1852.  
  1853.    SEE ALSO
  1854.     timer.device/TR_ADDREQUEST,
  1855.     timer.device/TR_WAITUNTIL,
  1856.     timer.device/WaitUnitl()
  1857.  
  1858.    BUGS
  1859.  
  1860. pools.lib/LibAllocPooled                             pools.lib/LibAllocPooled
  1861.  
  1862.     NAME
  1863.     LibAllocPooled -- Allocate memory with the pool manager (V33)
  1864.  
  1865.     SYNOPSIS
  1866.     memory=LibAllocPooled(poolHeader,memSize)
  1867.     d0                    a0         d0
  1868.  
  1869.     void *LibAllocPooled(void *,ULONG);
  1870.  
  1871.     FUNCTION
  1872.     This function is a copy of the pool functions in V39 and up of
  1873.     EXEC.  In fact, if you are running in V39, this function will
  1874.     notice and call the EXEC function.  This function works in
  1875.     V33 and up (1.2) Amiga system.
  1876.  
  1877.     The C code interface is _LibAllocPooled() and takes its arguments
  1878.     from the stack just like the C code interface for AllocPooled()
  1879.     in amiga.lib.  The assembly code interface is with the symbol
  1880.     _AsmAllocPooled: and takes the parameters in registers with the
  1881.     additional parameter of ExecBase being in a6 which can be used
  1882.     from SAS/C 6 by a prototype of:
  1883.  
  1884.     void * __asm AsmAllocPooled(register __a0 void *,
  1885.                                 register __d0 ULONG,
  1886.                                 register __a6 struct ExecBase *);
  1887.  
  1888.     Allocate memSize bytes of memory, and return a pointer. NULL is
  1889.     returned if the allocation fails.
  1890.  
  1891.     Doing a LibDeletePool() on the pool will free all of the puddles
  1892.     and thus all of the allocations done with LibAllocPooled() in that
  1893.     pool.  (No need to LibFreePooled() each allocation)
  1894.  
  1895.     INPUTS
  1896.     memSize - the number of bytes to allocate
  1897.     poolHeader - a specific private pool header.
  1898.  
  1899.     RESULT
  1900.     A pointer to the memory, or NULL.
  1901.     The memory block returned is long word aligned.
  1902.  
  1903.     NOTES
  1904.     The pool function do not protect an individual pool from
  1905.     multiple accesses.  The reason is that in most cases the pools
  1906.     will be used by a single task.  If your pool is going to
  1907.     be used by more than one task you must Semaphore protect
  1908.     the pool from having more than one task trying to allocate
  1909.     within the same pool at the same time.  Warning:  Forbid()
  1910.     protection *will not work* in the future.  *Do NOT* assume
  1911.     that we will be able to make it work in the future.  LibAllocPooled()
  1912.     may well break a Forbid() and as such can only be protected
  1913.     by a semaphore.
  1914.  
  1915.     To track sizes yourself, the following code can be used:
  1916.     *Assumes a6=ExecBase*
  1917.  
  1918.     ;
  1919.     ; Function to do AllocVecPooled(Pool,memSize)
  1920.     ;
  1921.     AllocVecPooled:    addq.l    #4,d0        ; Get space for tracking
  1922.             move.l    d0,-(sp)    ; Save the size
  1923.             jsr    LibAllocPooled    ; Call pool...
  1924.             move.l    (sp)+,d1    ; Get size back...
  1925.             tst.l    d0        ; Check for error
  1926.             beq.s    avp_fail    ; If NULL, failed!
  1927.             move.l    d0,a0        ; Get pointer...
  1928.             move.l    d1,(a0)+    ; Store size
  1929.             move.l    a0,d0        ; Get result
  1930.     avp_fail:    rts            ; return
  1931.  
  1932.     ;
  1933.     ; Function to do LibFreeVecPooled(pool,memory)
  1934.     ;
  1935.     FreeVecPooled:    move.l    -(a1),d0    ; Get size / ajust pointer
  1936.             jmp    LibFreePooled
  1937.  
  1938.     SEE ALSO
  1939.     FreePooled(), CreatePool(), DeletePool(),
  1940.     LibFreePooled(), LibCreatePool(), LibDeletePool()
  1941.  
  1942. pools.lib/LibCreatePool                               pools.lib/LibCreatePool
  1943.  
  1944.     NAME
  1945.     LibCreatePool -- Generate a private memory pool header (V33)
  1946.  
  1947.     SYNOPSIS
  1948.     newPool=LibCreatePool(memFlags,puddleSize,threshSize)
  1949.     a0                    d0       d1         d2
  1950.  
  1951.     void *LibCreatePool(ULONG,ULONG,ULONG);
  1952.  
  1953.     FUNCTION
  1954.     This function is a copy of the pool functions in V39 and up of
  1955.     EXEC.  In fact, if you are running in V39, this function will
  1956.     notice and call the EXEC function.  This function works in
  1957.     V33 and up (1.2) Amiga system.
  1958.  
  1959.     The C code interface is _LibCreatePool() and takes its arguments
  1960.     from the stack just like the C code interface for CreatePool()
  1961.     in amiga.lib.  The assembly code interface is with the symbol
  1962.     _AsmCreatePool: and takes the parameters in registers with the
  1963.     additional parameter of ExecBase being in a6 which can be used
  1964.     from SAS/C 6 by a prototype of:
  1965.  
  1966.     void * __asm AsmCreatePool(register __d0 ULONG,
  1967.                                register __d1 ULONG,
  1968.                                register __d2 ULONG,
  1969.                                register __a6 struct ExecBase *);
  1970.  
  1971.     Allocate and prepare a new memory pool header.    Each pool is a
  1972.     separate tracking system for memory of a specific type.  Any number
  1973.     of pools may exist in the system.
  1974.  
  1975.     Pools automatically expand and shrink based on demand.    Fixed sized
  1976.     "puddles" are allocated by the pool manager when more total memory
  1977.     is needed.  Many small allocations can fit in a single puddle.
  1978.     Allocations larger than the threshSize are allocation in their own
  1979.     puddles.
  1980.  
  1981.     At any time individual allocations may be freed.  Or, the entire
  1982.     pool may be removed in a single step.
  1983.  
  1984.     INPUTS
  1985.     memFlags - a memory flags specifier, as taken by AllocMem.
  1986.     puddleSize - the size of Puddles...
  1987.     threshSize - the largest allocation that goes into normal puddles
  1988.                  This *MUST* be less than or equal to puddleSize
  1989.                  (LibCreatePool() will fail if it is not)
  1990.  
  1991.     RESULT
  1992.     The address of a new pool header, or NULL for error.
  1993.  
  1994.     SEE ALSO
  1995.     DeletePool(), AllocPooled(), FreePooled(), exec/memory.i,
  1996.     LibDeletePool(), LibAllocPooled(), LibFreePooled()
  1997.  
  1998. pools.lib/LibDeletePool                               pools.lib/LibDeletePool
  1999.  
  2000.     NAME
  2001.     LibDeletePool --  Drain an entire memory pool (V33)
  2002.  
  2003.     SYNOPSIS
  2004.     LibDeletePool(poolHeader)
  2005.                   a0
  2006.  
  2007.     void LibDeletePool(void *);
  2008.  
  2009.     FUNCTION
  2010.     This function is a copy of the pool functions in V39 and up of
  2011.     EXEC.  In fact, if you are running in V39, this function will
  2012.     notice and call the EXEC function.  This function works in
  2013.     V33 and up (1.2) Amiga system.
  2014.  
  2015.     The C code interface is _LibDeletePool() and takes its arguments
  2016.     from the stack just like the C code interface for DeletePool()
  2017.     in amiga.lib.  The assembly code interface is with the symbol
  2018.     _AsmDeletePool: and takes the parameters in registers with the
  2019.     additional parameter of ExecBase being in a6 which can be used
  2020.     from SAS/C 6 by a prototype of:
  2021.  
  2022.     void __asm AsmDeletePool(register __a0 void *,
  2023.                              register __a6 struct ExecBase *);
  2024.  
  2025.     Frees all memory in all puddles of the specified pool header, then
  2026.     deletes the pool header.  Individual free calls are not needed.
  2027.  
  2028.     INPUTS
  2029.     poolHeader - as returned by LibCreatePool().
  2030.  
  2031.     SEE ALSO
  2032.     CreatePool(), AllocPooled(), FreePooled(),
  2033.     LibCreatePool(), LibAllocPooled(), LibFreePooled()
  2034.  
  2035. pools.lib/LibFreePooled                               pools.lib/LibFreePooled
  2036.  
  2037.     NAME
  2038.     LibFreePooled -- Free pooled memory  (V33)
  2039.  
  2040.     SYNOPSIS
  2041.     LibFreePooled(poolHeader,memory,memSize)
  2042.               a0         a1     d0
  2043.  
  2044.     void LibFreePooled(void *,void *,ULONG);
  2045.  
  2046.     FUNCTION
  2047.     This function is a copy of the pool functions in V39 and up of
  2048.     EXEC.  In fact, if you are running in V39, this function will
  2049.     notice and call the EXEC function.  This function works in
  2050.     V33 and up (1.2) Amiga system.
  2051.  
  2052.     The C code interface is _LibFreePooled() and takes its arguments
  2053.     from the stack just like the C code interface for FreePooled()
  2054.     in amiga.lib.  The assembly code interface is with the symbol
  2055.     _AsmFreePooled: and takes the parameters in registers with the
  2056.     additional parameter of ExecBase being in a6 which can be used
  2057.     from SAS/C 6 by a prototype of:
  2058.  
  2059.     void __asm AsmFreePooled(register __a0 void *,
  2060.                              register __a1 void *,
  2061.                              register __d0 ULONG,
  2062.                              register __a6 struct ExecBase *);
  2063.  
  2064.     Deallocates memory allocated by LibAllocPooled().  The size of the
  2065.     allocation *MUST* match the size given to LibAllocPooled().
  2066.     The reason the pool functions do not track individual allocation
  2067.     sizes is because many of the uses of pools have small allocation
  2068.     sizes and the tracking of the size would be a large overhead.
  2069.  
  2070.     Only memory allocated by LibAllocPooled() may be freed with this
  2071.     function!
  2072.  
  2073.     Doing a LibDeletePool() on the pool will free all of the puddles
  2074.     and thus all of the allocations done with LibAllocPooled() in that
  2075.     pool.  (No need to LibFreePooled() each allocation)
  2076.  
  2077.     INPUTS
  2078.     memory - pointer to memory allocated by AllocPooled.
  2079.     poolHeader - a specific private pool header.
  2080.  
  2081.     NOTES
  2082.     The pool function do not protect an individual pool from
  2083.     multiple accesses.  The reason is that in most cases the pools
  2084.     will be used by a single task.  If your pool is going to
  2085.     be used by more than one task you must Semaphore protect
  2086.     the pool from having more than one task trying to allocate
  2087.     within the same pool at the same time.  Warning:  Forbid()
  2088.     protection *will not work* in the future.  *Do NOT* assume
  2089.     that we will be able to make it work in the future.  LibFreePooled()
  2090.     may well break a Forbid() and as such can only be protected
  2091.     by a semaphore.
  2092.  
  2093.     To track sizes yourself, the following code can be used:
  2094.     *Assumes a6=ExecBase*
  2095.  
  2096.     ;
  2097.     ; Function to do AllocVecPooled(Pool,memSize)
  2098.     ;
  2099.     AllocVecPooled:    addq.l    #4,d0        ; Get space for tracking
  2100.             move.l    d0,-(sp)    ; Save the size
  2101.             jsr    LibAllocPooled    ; Call pool...
  2102.             move.l    (sp)+,d1    ; Get size back...
  2103.             tst.l    d0        ; Check for error
  2104.             beq.s    avp_fail    ; If NULL, failed!
  2105.             move.l    d0,a0        ; Get pointer...
  2106.             move.l    d1,(a0)+    ; Store size
  2107.             move.l    a0,d0        ; Get result
  2108.     avp_fail:    rts            ; return
  2109.  
  2110.     ;
  2111.     ; Function to do LibFreeVecPooled(pool,memory)
  2112.     ;
  2113.     FreeVecPooled:    move.l    -(a1),d0    ; Get size / ajust pointer
  2114.             jmp    LibFreePooled
  2115.  
  2116.     SEE ALSO
  2117.     AllocPooled(), CreatePool(), DeletePool(),
  2118.     LibAllocPooled(), LibCreatePool(), LibDeletePool()
  2119.  
  2120.