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 / commodities.doc < prev    next >
Encoding:
Text File  |  1993-08-12  |  28.4 KB  |  967 lines

  1. TABLE OF CONTENTS
  2.  
  3. commodities.library/ActivateCxObj
  4. commodities.library/AddIEvents
  5. commodities.library/AttachCxObj
  6. commodities.library/ClearCxObjError
  7. commodities.library/CreateCxObj
  8. commodities.library/CxBroker
  9. commodities.library/CxMsgData
  10. commodities.library/CxMsgID
  11. commodities.library/CxMsgType
  12. commodities.library/CxObjError
  13. commodities.library/CxObjType
  14. commodities.library/DeleteCxObj
  15. commodities.library/DeleteCxObjAll
  16. commodities.library/DisposeCxMsg
  17. commodities.library/DivertCxMsg
  18. commodities.library/EnqueueCxObj
  19. commodities.library/InsertCxObj
  20. commodities.library/InvertKeyMap
  21. commodities.library/MatchIX
  22. commodities.library/ParseIX
  23. commodities.library/RemoveCxObj
  24. commodities.library/RouteCxMsg
  25. commodities.library/SetCxObjPri
  26. commodities.library/SetFilter
  27. commodities.library/SetFilterIX
  28. commodities.library/SetTranslate
  29. commodities.library/ActivateCxObj           commodities.library/ActivateCxObj
  30.  
  31.    NAME
  32.     ActivateCxObj -- change the activation state of a commodity object.
  33.              (V36)
  34.  
  35.    SYNOPSIS
  36.     previous = ActivateCxObj(co,true);
  37.     D0             A0 D0
  38.  
  39.     LONG ActivateCxObj(CxObj *,LONG);
  40.  
  41.    FUNCTION
  42.     Commodity objects of all types maintain an activation state.
  43.     If an object is "active", then it performs its particular action
  44.     whenever a commodity message arrives. If the object is "inactive"
  45.     no action is taken, and the message goes on to its next destination.
  46.  
  47.     All objects are created in the "active" state except brokers
  48.     which are created "inactive". Thus, after you create your
  49.     broker and hang a tree of objects off of it, you must remember
  50.     to use this function to activate it. This causes it to divert all
  51.     messages to your tree of objects.
  52.  
  53.     This function activates 'co' if 'true' is different than 0. and
  54.     deactivates it otherwise. The previous activation state is
  55.     returned.
  56.  
  57.    INPUTS
  58.     co - the commodity object to affect (may be NULL)
  59.     true - 0 to deactivate the object, anything else to activate it
  60.  
  61.    RESULTS
  62.     previous - the previous activation state: 0 if the object was
  63.            inactive or if 'co' was NULL, anything else if the object
  64.            was active
  65.  
  66.    SEE ALSO
  67.     CxBroker()
  68.  
  69. commodities.library/AddIEvents                 commodities.library/AddIEvents
  70.  
  71.    NAME
  72.     AddIEvents -- add input events to commodities' input stream. (V36)
  73.  
  74.    SYNOPSIS
  75.     AddIEvents(events)
  76.            A0
  77.  
  78.     VOID AddIEvents(struct InputEvent *);
  79.  
  80.    FUNCTION
  81.     This function adds a null-terminated linked list of input events to
  82.     the input stream processed by commodities. It is a touch easier than
  83.     using the input device directly.
  84.  
  85.     The contents of the input events are copied into commodity messages,
  86.     so they may be disposed of as soon as this call returns.
  87.  
  88.     The messages are initially routed to the first broker in
  89.     commodities' object list.
  90.  
  91.    INPUTS
  92.     events - the list of input events to add (may be NULL)
  93.  
  94.    WARNING
  95.     The cx_lib/InvertString() function creates lists of input events that
  96.     are in reverse order. Thus, passing the result of InvertString()
  97.     to this function will insert a series of input events that will
  98.     generate a string that's a mirror image of the string passed to
  99.     InvertString() originally.
  100.  
  101.     The solution to the above is to either flip the string before
  102.     passing it to InvertString(), or flip the resulting list of input
  103.     events.
  104.  
  105.    BUGS
  106.     Prior to V40, this function did not copy the data pointed to by
  107.     ie_EventAddress for any events of type IECLASS_NEWPOINTERPOS.
  108.  
  109.    SEE ALSO
  110.     cx_lib/FreeIEvents()
  111.  
  112. commodities.library/AttachCxObj               commodities.library/AttachCxObj
  113.  
  114.    NAME
  115.     AttachCxObj -- attach a commodity object to the end of an existing
  116.                list of objects. (V36)
  117.  
  118.    SYNOPSIS
  119.     AttachCxObj(headObj,co);
  120.             A0      A1
  121.  
  122.     VOID AttachCxObj(CxObj *,CxObj *);
  123.  
  124.    FUNCTION
  125.     Adds 'co' to the list of objects pointed to by 'headObj'. The
  126.     new object is added at the end of the list.
  127.  
  128.    INPUTS
  129.     headObj - pointer to a list of objects. If this value is NULL, then
  130.           the entire tree of objects pointed to by 'co' is deleted
  131.           and becomes invalid.
  132.     co - the object to add to the list (may be NULL)
  133.  
  134.    RESULTS
  135.     If 'co' is NULL, this function will record that fact in the
  136.     internal accumulated error of 'headObj'. This error record
  137.     can be retrieved using CxObjError() and cleared using
  138.     ClearCxObjError().
  139.  
  140.    BUGS
  141.     Until V38, passing a NULL 'headObj' parameter would cause low-memory
  142.     access and unpredictable results.
  143.  
  144.    SEE ALSO
  145.     CxObjError(), ClearCxObjError()
  146.  
  147. commodities.library/ClearCxObjError       commodities.library/ClearCxObjError
  148.  
  149.    NAME
  150.     ClearCxObjError -- clear the accumulated error value of a commodity
  151.                object. (V36)
  152.  
  153.    SYNOPSIS
  154.     ClearCxObjError(co);
  155.                       A0
  156.  
  157.     VOID ClearCxObjError(CxObj *);
  158.  
  159.    FUNCTION
  160.     This function clears the accumulated error value of commodity object
  161.     'co'.
  162.  
  163.     It is unwise to do this to a filter if COERR_BADFILTER is set.
  164.     This will fool commodities into thinking the filter is OK. Set
  165.     another valid filter, or leave the error value alone.
  166.  
  167.    INPUTS
  168.     co - the object to affect (may be NULL)
  169.  
  170.    SEE ALSO
  171.     CxObjError()
  172.  
  173. commodities.library/CreateCxObj               commodities.library/CreateCxObj
  174.  
  175.    NAME
  176.     CreateCxObj -- create a new commodity object. (V36)
  177.  
  178.    SYNOPSIS
  179.     co = CreateCxObj(type,arg1,arg2);
  180.     D0         D0   A0   A1
  181.  
  182.     CxObj *CreateCxObj(ULONG,LONG,LONG);
  183.  
  184.    FUNCTION
  185.     This function creates a commodity object of type 'type'. It is not
  186.     proper to call this function directly. Each object creation routine
  187.     except CxBroker() is defined as a macro in <libraries/commodities.h>
  188.     These are independently documented.
  189.  
  190.     All functions which operate on a commodity object are made with
  191.     a reference to the thirty-two bit value returned by this function
  192.     (or by CxBroker()).
  193.  
  194.    INPUTS
  195.     type - the type of object to create as defined in
  196.            <libraries/commodities.h>
  197.     arg1 - first argument, meaning depends on 'type'
  198.     arg2 - second argument, meaning depends on 'type'
  199.  
  200.    RESULTS
  201.     co - a pointer to the new object or NULL if it could not be created.
  202.          A NULL return indicates typically a lack of system memory. Minor
  203.          problems in creating an object, such as providing a bad filter
  204.          description to cx_lib/CxFilter(), typically don't cause failure,
  205.          but are recorded in an internal error field in the new object
  206.          which can be accessed via CxObjError().
  207.  
  208.    SEE ALSO
  209.     CxObjError(), cx_lib/CxFilter(), cx_lib/CxSender(),
  210.     cx_lib/CxSignal(), cx_lib/CxTranslate(), cx_lib/CxDebug(),
  211.     cx_lib/CxCustom(), CxBroker()
  212.  
  213. commodities.library/CxBroker                     commodities.library/CxBroker
  214.  
  215.    NAME
  216.     CxBroker -- create a commodity broker. (V36)
  217.  
  218.    SYNOPSIS
  219.     broker = CxBroker(nb,error);
  220.     D0          A0 D0
  221.  
  222.     CxObj *CxBroker(struct NewBroker *,LONG *);
  223.  
  224.    FUNCTION
  225.     This function creates a broker from the specification found in the
  226.     NewBroker structure pointed to by 'nb'. The purpose and meaning of the
  227.     fields of the NewBroker structure are described below. Also see
  228.     <libraries/commodities.h> for more info.
  229.  
  230.     struct NewBroker
  231.     {
  232.         BYTE            nb_Version;
  233.         STRPTR          nb_Name;
  234.         STRPTR          nb_Title;
  235.         STRPTR          nb_Descr;
  236.         WORD            nb_Unique;
  237.         WORD        nb_Flags;
  238.         BYTE            nb_Pri;
  239.         struct MsgPort *nb_Port;
  240.         WORD            nb_ReservedChannel;
  241.     };
  242.  
  243.     nb_Version
  244.     This is the way that future versions of commodities can identify
  245.     which version of the NewBroker structure you are using. This should be
  246.     set to NB_VERSION as defined in <libraries/commodities.h>
  247.  
  248.     nb_Name
  249.     This is the name of the broker. This name is used to find the broker
  250.     in commodities' object list and is the name shown in the listview
  251.     gadget of the Exchange program. The name string is copied in the
  252.     broker object upon creation so it can be discarded right after
  253.     CxBroker() returns. The maximum length of the name string is defined
  254.     by a constant in <libraries/commodities.h>.
  255.  
  256.     nb_Title, nb_Descr
  257.     These are two strings which appear to the user in the Exchange
  258.     program and describe the application the broker is representing.
  259.     Note that these strings are copied into the broker object so they
  260.     can be discarded right after CxBroker() returns. The maximum length
  261.     of these strings that will be recognized are defined by constants in
  262.     <libraries/commodities.h>.
  263.  
  264.     nb_Unique
  265.     This field indicates what should happen if a broker of the same name
  266.     (nb_Name) already exists in commodities' object list. Constants
  267.     in <libraries/commodities.h> allow the caller to specify whether
  268.     another broker is to be created, and whether any existing broker of
  269.     the same name should be notified that an attempt at creating a
  270.     duplicate has been made.
  271.  
  272.     nb_Pri
  273.     This specifies with what priority the new broker is to be inserted
  274.     within commodities' object list. Higher priority nodes appear
  275.     earlier in a list. It is strongly recommended that the ToolTypes
  276.     environment of an application be used to allow the end-user to set
  277.     the priority of the broker.
  278.  
  279.    INPUTS
  280.     nb - an initialized NewBroker structure
  281.     error - a pointer to a longword where to store a failure code (may be
  282.         NULL)
  283.  
  284.    RESULTS
  285.     broker - a pointer to the broker object or NULL upon failure. If the
  286.          'error' pointer is not NULL, a further diagnostic code is
  287.          placed at that address. Error codes are defined in
  288.          <libraries/commodities.h> and include:
  289.  
  290.             CBERR_OK
  291.             No problems; broker created OK.
  292.  
  293.              CBERR_SYSERR
  294.             System problems, not your fault, sign of low memory.
  295.  
  296.             CBERR_DUP
  297.             The nb_Unique field specified that only one broker of
  298.             'nb_Name' should be allowed, and one already exists.
  299.  
  300.             CBERR_VERSION
  301.             The version specified in 'nb_Version' is unknown to the
  302.             library.
  303.  
  304.    SEE ALSO
  305.     SetCxObjPri(), <libraries/commodities.h>
  306.  
  307. commodities.library/CxMsgData                   commodities.library/CxMsgData
  308.  
  309.    NAME
  310.     CxMsgData -- obtain a pointer to a commodity message's data area. (V36)
  311.  
  312.    SYNOPSIS
  313.     data = CxMsgData(cxm);
  314.     D0         A0
  315.  
  316.     APTR CxMsgData(struct CxMsg *);
  317.  
  318.    FUNCTION
  319.     Most commodity messages contain meaningful data such as an InputEvent
  320.     structure. This function returns a pointer to this data.
  321.  
  322.     You may get a commodity message from a synchronous (custom object) or
  323.     asynchronous (sender object) source. In the second case, 'data' is
  324.     not valid after you have replied to the message.
  325.  
  326.    INPUTS
  327.     cxm - the commodity message to get the data pointer from (may be NULL)
  328.  
  329.    RESULTS
  330.     data - a pointer to the message's data, or NULL if 'cxm' is NULL.
  331.            The meaning of the data varies depending on which kind of
  332.            object is being inspected.
  333.  
  334.    BUGS
  335.     Until V38, passing a NULL 'cxm' parameter would cause low-memory
  336.     access and unpredictable results.
  337.  
  338.     Until V40, whenever the data pointer is a (struct InputEvent), the
  339.     ie_EventAddress field of these structures was not reliable whenever
  340.     the message was generated by a sender object.
  341.  
  342.    SEE ALSO
  343.     cx_lib/CxSender(), cx_lib/CxCustom()
  344.  
  345. commodities.library/CxMsgID                       commodities.library/CxMsgID
  346.  
  347.    NAME
  348.     CxMsgID -- obtain the ID of a commodity message. (V36)
  349.  
  350.    SYNOPSIS
  351.     id = CxMsgID(cxm);
  352.     D0         A0
  353.  
  354.     LONG CxMsgID(struct CxMsg *);
  355.  
  356.    FUNCTION
  357.     This function returns the value associated with the cause or source
  358.     of the commodity message 'cxm'. Values are provided by the application
  359.     when a sender or custom object is created.
  360.  
  361.    INPUTS
  362.     cxm - the commodity message to inquire about (must NOT be NULL)
  363.  
  364.    RESULTS
  365.     id - if not specified by the application, the ID value of a
  366.          commodity message will be 0. It is suggested that using
  367.          non-zero values in your program as a rule may identify some
  368.          possible errors.
  369.  
  370.    SEE ALSO
  371.     cx_lib/CxSender(), cx_lib/CxCustom()
  372.  
  373. commodities.library/CxMsgType                   commodities.library/CxMsgType
  374.  
  375.    NAME
  376.     CxMsgType -- obtain the type of a commodity message. (V36)
  377.  
  378.    SYNOPSIS
  379.     type = CxMsgType(cxm);
  380.     D0         A0
  381.  
  382.     ULONG CxMsgType(struct CxMsg *);
  383.  
  384.    FUNCTION
  385.     This function returns the type of a commodity message. Possible values
  386.     of 'type' are defined in <libraries/commodities.h>. Most commodity
  387.     messages are of type CXM_IEVENT.
  388.  
  389.    INPUTS
  390.     cxm - the commodity message to inquire about (must NOT be NULL)
  391.  
  392.    RESULTS
  393.        type - the type of the commodity message, possible values are defined
  394.            in <libraries/commodities.h>
  395.  
  396. commodities.library/CxObjError                 commodities.library/CxObjError
  397.  
  398.    NAME
  399.     CxObjError -- obtain a commodity object's accumulated error. (V36)
  400.  
  401.    SYNOPSIS
  402.     error = CxObjError(co);
  403.     D0           A0
  404.  
  405.     LONG CxObjError(CxObj *);
  406.  
  407.    FUNCTION
  408.     When a function acting on an object fails, it records the failure
  409.     in the object. This function returns the accumulated error value.
  410.     The values are represented by flag bits defined in
  411.     <libraries/commodities.h>. Several errors may be recorded by multiple
  412.     bits in 'error'.
  413.  
  414.     The currently defined errors are:
  415.  
  416.     COERR_ISNULL
  417.       The value of parameter 'co' was in fact NULL. This error
  418.       means "the problem with the object you inquire about is
  419.       that it failed to be created."
  420.  
  421.       COERR_NULLATTACH
  422.       Using the commodities' list manipulation functions, an attempt was
  423.       made to add a NULL object to the list belonging to 'co'. This allows
  424.       a line of code as follows to exist in an error-tolerant program:
  425.  
  426.         AttachCxObj(filter,CxSender(myport,MY_ID));
  427.  
  428.       COERR_BADFILTER
  429.       The most recent filter specification for a filter object
  430.       was faulty. This happens if no sense can be made out of a
  431.       description string, or if an input expression (IX) has an
  432.       invalid format or version byte. When this bit is set in a
  433.       filter's error field, the filter will match nothing, but this
  434.       is not the proper way to "turn off" a filter, use ActivateCxObj().
  435.  
  436.       COERR_BADTYPE
  437.       A type specific operation, such as SetFilterIX(), was called
  438.       for object 'co', but 'co' isn't of the proper type.
  439.  
  440.    INPUTS
  441.     co - the commodity object to get the accumulated error from (may be
  442.          NULL)
  443.  
  444.    RESULTS
  445.     error - the accumulated error, or 0 if 'co' is NULL
  446.  
  447.    SEE ALSO
  448.     SetFilter(), SetFilterIX(), AttachCxObj(), ActivateCxObj(),
  449.     ClearCxObjError()
  450.  
  451. commodities.library/CxObjType                   commodities.library/CxObjType
  452.  
  453.    NAME
  454.     CxObjType -- obtain the type of a commodity object. (V36)
  455.  
  456.    SYNOPSIS
  457.     type = CxObjType(co);
  458.     D0         A0
  459.  
  460.     ULONG CxObjType(CxObj *);
  461.  
  462.    FUNCTION
  463.     This function should not really be necessary. It returns
  464.     the type of a commodity object, which you should already
  465.     know, since you created it in the first place.
  466.  
  467.    INPUTS
  468.     co - the commodity object to inquire about (may be NULL)
  469.  
  470.    RESULTS
  471.     type - the type of the commodity object, possible values are
  472.            defined in <libraries/commodities.h>. Returns CX_INVALID
  473.            if 'co' is NULL.
  474.  
  475.    SEE ALSO
  476.     CreateCxObj()
  477.  
  478. commodities.library/DeleteCxObj               commodities.library/DeleteCxObj
  479.  
  480.    NAME
  481.     DeleteCxObj -- delete a commmodity object. (V36)
  482.  
  483.    SYNOPSIS
  484.     DeleteCxObj(co);
  485.                 A0
  486.  
  487.     VOID DeleteCxObj(CxObj *);
  488.  
  489.    FUNCTION
  490.     Deletes a commodity object of any type. If the object
  491.     is linked into a list, it is first removed. Note that
  492.     the handle 'co' is invalid after this function is called.
  493.  
  494.     Also note that deleting an object which has other objects attached
  495.     to it may be undesirable. Use the function DeleteCxObjAll()
  496.     to delete an entire sub-tree of objects.
  497.  
  498.    INPUTS
  499.     co - the commodity object to delete (may be NULL)
  500.  
  501.    SEE ALSO
  502.     DeleteCxObjAll()
  503.  
  504. commodities.library/DeleteCxObjAll         commodities.library/DeleteCxObjAll
  505.  
  506.    NAME
  507.     DeleteCxObjAll -- recursively delete a tree of commodity objects.
  508.               (V36)
  509.  
  510.    SYNOPSIS
  511.     DeleteCxObjAll(co);
  512.                A0
  513.  
  514.     VOID DeleteCxObjAll(CxObj *);
  515.  
  516.    FUNCTION
  517.     This function deletes the commodity object 'co', and
  518.     recursively deletes all objects attached to it, and the
  519.     objects attached to them, etc.
  520.  
  521.     If 'co' is linked into a list, it is first removed. Note
  522.     that the handle 'co' is invalid after this function is called.
  523.  
  524.     This function is useful when an application exits: most
  525.     applications can clean up completely by deleting the
  526.     entire sub-tree of objects starting at their broker.
  527.  
  528.    INPUTS
  529.     co - the first commodity object to delete (may be NULL)
  530.  
  531.    SEE ALSO
  532.     DeleteCxObj()
  533.  
  534. commodities.library/DisposeCxMsg             commodities.library/DisposeCxMsg
  535.  
  536.    NAME
  537.     DisposeCxMsg -- delete a commodity message. (V36)
  538.  
  539.    SYNOPSIS
  540.     DisposeCxMsg(cxm);
  541.              A0
  542.  
  543.     VOID DisposeCxMsg(struct CxMsg *);
  544.  
  545.    FUNCTION
  546.     This function eliminates the commodity message pointed to by 'cxm'.
  547.     Can be used to 'swallow' input events by disposing of every commodity
  548.     message of type CXM_IEVENT.
  549.  
  550.     This function can only be called from within a custom object running
  551.     on the input handler's context. It cannot be called from code running
  552.     on a commodities' context, such as when receiving a CXM_IEVENT message
  553.     from a sender object. CxMsg sent to a commodity program from a sender
  554.     object must be sent back using ReplyMsg().
  555.  
  556.    INPUTS
  557.     cxm - the commodity message to delete (must NOT be NULL)
  558.  
  559. commodities.library/DivertCxMsg               commodities.library/DivertCxMsg
  560.  
  561.    NAME
  562.     DivertCxMsg -- send a commodity message down an object list. (V36)
  563.  
  564.    SYNOPSIS
  565.     DivertCxMsg(cxm,headObj,returnObj);
  566.             A0  A1      A2
  567.  
  568.     VOID DivertCxMsg(struct CxMsg *,CxObj *,CxObj *);
  569.  
  570.    FUNCTION
  571.     This function sends the commodity message 'cxm' down the list of
  572.     objects attached to 'headObj'. The pointer 'returnObj' is first
  573.     pushed onto the routing stack of 'cxm' so that when the end of the
  574.     list of 'headObj' is reached the SUCCESSOR of 'returnObj' is the
  575.     next destination.
  576.  
  577.     For example, when a filter finds a match with a message, the
  578.     message is diverted down the filter's list like this:
  579.  
  580.       DivertCxMsg(cxm,filter,filter);
  581.  
  582.    INPUTS
  583.     cxm - the commodity message to divert (must NOT be NULL)
  584.     headObj - the list of objects to divert the message to
  585.     returnObj - the object to use as a place holder
  586.  
  587.    SEE ALSO
  588.     RouteCxMsg()
  589.  
  590. commodities.library/EnqueueCxObj             commodities.library/EnqueueCxObj
  591.  
  592.    NAME
  593.     EnqueueCxObj -- insert a commodity object within a list of objects
  594.                 based on object priority. (V36)
  595.  
  596.    SYNOPSIS
  597.     EnqueueCxObj(headObj,co);
  598.              A0      A1
  599.  
  600.     VOID EnqueueCxObj(CxObj *,CxObj *);
  601.  
  602.    FUNCTION
  603.     This function puts object 'co' into the list of object 'headObj'.
  604.     The insertion point is determined by the object's priority. The
  605.     objects are kept in the list from the highest priority to the
  606.     lowest. New nodes are inserted in front of the first node with a
  607.     lower priority. Hence a FIFO queue for nodes of equal priority.
  608.  
  609.     The priority of the commodity object can be set using SetCxObjPri().
  610.  
  611.    INPUTS
  612.     headObj - pointer to a list of objects. If this value is NULL, then
  613.           the entire tree of objects pointed to by 'co' is deleted
  614.           and becomes invalid.
  615.     co - the object to add to the list (may be NULL)
  616.  
  617.    RESULTS
  618.     If 'co' is NULL, this function will record that fact in the
  619.     internal accumulated error of 'headObj'. This error record
  620.     can be retrieved using CxObjError() and cleared using
  621.     ClearCxObjError().
  622.  
  623.    BUGS
  624.     Until V38, passing a NULL 'headObj' parameter would cause low-memory
  625.     access and unpredictable results.
  626.  
  627.    SEE ALSO
  628.     SetCxObjPri(), CxObjError(), ClearCxObjError()
  629.  
  630. commodities.library/InsertCxObj               commodities.library/InsertCxObj
  631.  
  632.    NAME
  633.     InsertCxObj -- insert a commodity object in a list after a given
  634.                object. (V36)
  635.  
  636.    SYNOPSIS
  637.     InsertCxObj(headObj,co,pred);
  638.             A0      A1 A2
  639.  
  640.     VOID InsertCxObj(CxObj *,CxObj *,CxObj *);
  641.  
  642.    FUNCTION
  643.     Adds 'co' to the list of objects pointed to by 'headObj' after
  644.     object 'pred'.
  645.  
  646.    INPUTS
  647.     headObj - pointer to a list of objects. If this value is NULL, then
  648.           the entire tree of objects pointed to by 'co' is deleted
  649.           and becomes invalid.
  650.     co - the object to add to the list (may be NULL)
  651.     pred - the object after which 'co' should be inserted. If this is NULL
  652.            then 'co' is added to the head of the list.
  653.  
  654.    RESULTS
  655.     If 'co' is NULL, this function will record that fact in the
  656.     internal accumulated error of 'headObj'. This error record
  657.     can be retrieved using CxObjError() and cleared using
  658.     ClearCxObjError().
  659.  
  660.    BUGS
  661.     Until V38, passing a NULL 'headObj' parameter would cause low-memory
  662.     access and unpredictable results.
  663.  
  664.    SEE ALSO
  665.     CxObjError(), ClearCxObjError()
  666.  
  667. commodities.library/InvertKeyMap             commodities.library/InvertKeyMap
  668.  
  669.    NAME
  670.     InvertKeyMap -- generate an input event from an ANSI code. (V36)
  671.  
  672.    SYNOPSIS
  673.     success = InvertKeyMap(ansiCode,event,km)
  674.     D0                D0       A0    A1
  675.  
  676.     BOOL InvertKeyMap(ULONG,struct InputEvent *,struct KeyMap *);
  677.  
  678.    FUNCTION
  679.     This function uses the system call MapANSI() to figure out what
  680.     InputEvent translates to an ANSI character code 'ansiCode'. The
  681.     InputEvent pointed to by 'event' is filled in with that information.
  682.     The KeyMap 'km' is used for the translation, unless it is NULL, in
  683.     which case the current system default keymap is used.
  684.  
  685.    INPUTS
  686.     ansiCode - the ANSI code to convert to an input event
  687.     event - the InputEvent to fill-in
  688.     km - the keymap to use for the translation, or NULL to use the
  689.          current system default keymap.
  690.  
  691.    RESULTS
  692.     success - TRUE if the translation worked, FALSE otherwise.
  693.  
  694.    BUGS
  695.     This function currently handles one-deep dead keys (such as
  696.     <alt f>o ). It does not look up the high key map (keystrokes
  697.     with scan codes greater than 0x40).
  698.  
  699.     Prior to V40, this function was not initializing the ie_SubClass
  700.     and ie_TimeStamp fields of the InputEvent structure. A simple work
  701.     around to the problem is to clear these values to 0 before making
  702.     a call to this function:
  703.  
  704.         struct InputEvent ie;
  705.  
  706.             ie.ie_SubClass           = 0;
  707.             ie.ie_TimeStamp.tv_secs  = 0;
  708.             ie.ie_TimeStamp.tv_micro = 0;
  709.             if (InvertKeyMap(ansiCode,&ie,NULL))
  710.             ...
  711.  
  712.    SEE ALSO
  713.     cx_lib/InvertString()
  714.  
  715. commodities.library/MatchIX                       commodities.library/MatchIX
  716.  
  717.    NAME
  718.     MatchIX -- see if an input event matches an initialized input
  719.            expression. (V38)
  720.  
  721.    SYNOPSIS
  722.     match = MatchIX(event,ix);
  723.     D0        A0    A1
  724.  
  725.     BOOL MatchIX(struct InputEvent *,IX *);
  726.  
  727.    FUNCTION
  728.     This function determines whether an input event matches an
  729.     initialized input expression. Applications generally do not
  730.     need to call this function as filter objects will normally provide
  731.     all the event filtering needed. Nevertheless, MatchIX()
  732.     can come in handy as it is the same function used to match an
  733.     event to the various filter objects when an event makes its way
  734.     through the input network.
  735.  
  736.    INPUTS
  737.     event - the input event to match against the input expression
  738.     ix - the input expression for the comparison
  739.  
  740.    RESULTS
  741.     match - TRUE if the input event matches the input expression, or
  742.         FALSE if not
  743.  
  744.    SEE ALSO
  745.     <libraries/commodities.h>, ParseIX()
  746.  
  747. commodities.library/ParseIX                       commodities.library/ParseIX
  748.  
  749.    NAME
  750.     ParseIX -- initialize an input expression given a description string.
  751.            (V36)
  752.  
  753.    SYNOPSIS
  754.     failureCode = ParseIX(description,ix);
  755.     D0              A0          A1
  756.  
  757.     LONG ParseIX(STRPTR,IX *);
  758.  
  759.    FUNCTION
  760.     Given an input description string and an allocated input
  761.     expression, sets the fields of the input expression to
  762.     correspond to the description string.
  763.  
  764.    INPUTS
  765.     description - the string to parse
  766.     ix - the input expression to hold the result of the parse
  767.  
  768.    RESULTS
  769.     failureCode -  0 if all went well,
  770.               -1 if tokens after end (code spec)
  771.                   -2 if 'description' was NULL
  772.  
  773.    SEE ALSO
  774.     <libraries/commodities.h>, MatchIX()
  775.  
  776. commodities.library/RemoveCxObj               commodities.library/RemoveCxObj
  777.  
  778.    NAME
  779.     RemoveCxObj -- remove a commodity object from a list. (V36)
  780.  
  781.    SYNOPSIS
  782.     RemoveCxObj(co);
  783.             A0
  784.  
  785.     VOID RemoveCxObj(CxObj *);
  786.  
  787.    FUNCTION
  788.     This function removes 'co' from any list it may be a part of.
  789.     Will not crash if 'co' is NULL, or if it has not been inserted
  790.     in a list.
  791.  
  792.    INPUTS
  793.     co - the object to remove (may be NULL)
  794.  
  795.    SEE ALSO
  796.     AttachCxObj(), EnqueueCxObj(), InsertCxObj()
  797.  
  798. commodities.library/RouteCxMsg                 commodities.library/RouteCxMsg
  799.  
  800.    NAME
  801.     RouteCxMsg -- set the next destination of a commodity message. (V36)
  802.  
  803.    SYNOPSIS
  804.     RouteCxMsg(cxm,co);
  805.            A0  A1
  806.  
  807.     VOID RouteCxMsg(struct CxMsg *,CxObj *);
  808.  
  809.    FUNCTION
  810.     Establishes the next destination of a commodity message
  811.     to be 'co', which must be a valid commodity object, and
  812.     must be linked in ultimately to commodities' object list.
  813.  
  814.     Routing of an object is analogous to a 'goto' in a program.
  815.     There is no effect on the message's routing stack.
  816.  
  817.    INPUTS
  818.     cxm - the commodity message to route (must NOT be NULL)
  819.     co - the commodity object to route the message to (must NOT be NULL)
  820.  
  821.    SEE ALSO
  822.     DivertCxMsg()
  823.  
  824. commodities.library/SetCxObjPri               commodities.library/SetCxObjPri
  825.  
  826.    NAME
  827.     SetCxObjPri -- set the priority of a commodity object. (V36)
  828.  
  829.    SYNOPSIS
  830.     oldPri = SetCxObjPri(co,pri)
  831.     D0                   A0 D0
  832.  
  833.     LONG SetCxObjPri(CxObj *,LONG);
  834.  
  835.    FUNCTION
  836.     This function sets the priority of a commodity object for the
  837.     purposes of EnqueueCxObj().
  838.  
  839.     It is strongly recommended that the ToolTypes environment be
  840.     utilized to provide end-user control over the priority of
  841.      brokers, but application specific ordering of other objects
  842.     within their lists is not dictated.
  843.  
  844.    INPUTS
  845.     co - the commodity object to affect (may be NULL)
  846.     pri - the object's new priority in the range -128 to +127. A value
  847.           of 0 is normal.
  848.  
  849.    RESULTS
  850.     oldPri - the previous priority of the object or 0 if 'co' was NULL.
  851.          This value is only returned in V38 and beyond.
  852.  
  853.    BUGS
  854.     This function will not reposition an object within its list when
  855.     its priority changes. To attain the same effect, first remove the
  856.     object from its list using RemoveCxObj(), set its priority using
  857.     SetCxObjPri(), and reinsert it in the list using EnqueueCxObj().
  858.  
  859.    SEE ALSO
  860.     EnqueueCxObj()
  861.  
  862. commodities.library/SetFilter                   commodities.library/SetFilter
  863.  
  864.    NAME
  865.     SetFilter -- change the matching condition of a commodity filter.
  866.              (V36)
  867.  
  868.    SYNOPSIS
  869.     SetFilter(filter,text);
  870.           A0     A1
  871.  
  872.     VOID SetFilter(CxObj *,STRPTR);
  873.  
  874.    FUNCTION
  875.     This function changes the matching condition of a commodity input
  876.     filter to that described by the input description string 'text'.
  877.  
  878.    INPUTS
  879.     filter - the filter object to affect (may be NULL)
  880.     text - the new matching conditions for the filter
  881.  
  882.    RESULTS
  883.     The internal error of 'filter' will have the COERR_BADFILTER
  884.     bit set or cleared depending on the failure or success of this
  885.     function.
  886.  
  887.    SEE ALSO
  888.     SetFilterIX(), CxObjError()
  889.  
  890. commodities.library/SetFilterIX               commodities.library/SetFilterIX
  891.  
  892.    NAME
  893.     SetFilterIX -- change the matching condition of a commodity filter.
  894.                (V36)
  895.  
  896.    SYNOPSIS
  897.     SetFilterIX(filter,ix);
  898.             A0     A1
  899.  
  900.     VOID SetFilterIX(CxObj *,IX *);
  901.  
  902.    FUNCTION
  903.     This function changes the matching condition of a commodity input
  904.     filter to that described by the binary input expression pointed by
  905.     'ix'.
  906.  
  907.     Input expressions are defined in <libraries/commodities.h>.
  908.     It is important to remember that the first field of the input
  909.     expression structure must indicate which version of the
  910.     input expression structure is being used.
  911.  
  912.    INPUTS
  913.     filter - the filter object to affect (may be NULL)
  914.     ix - the new matching conditions for the filter
  915.  
  916.    RESULTS
  917.     The internal error of 'filter' will have the COERR_BADFILTER
  918.     bit set or cleared depending on the failure or success of this
  919.     function.
  920.  
  921.    SEE ALSO
  922.     SetFilter(), CxObjError()
  923.  
  924. commodities.library/SetTranslate             commodities.library/SetTranslate
  925.  
  926.    NAME
  927.     SetTranslate -- replace a translator object's translation list. (V36)
  928.  
  929.    SYNOPSIS
  930.     SetTranslate(translator,events);
  931.              A0         A1
  932.  
  933.     VOID SetTranslate(CxObj *,struct InputEvent *);
  934.  
  935.    FUNCTION
  936.     This function replaces the translation list of a commodity
  937.     translator object with the linked list starting at 'events'.
  938.  
  939.     A NULL value for 'events' indicates that the object 'translator'
  940.     should swallow all commodity messages that are sent its way.
  941.  
  942.     Note that the input events are not copied into commodities' private
  943.     memory, but the value of 'events' is used -- asynchronously to the
  944.     application program -- to find a chain of InputEvents in the
  945.     application's data space. At the time of translation, each input event
  946.     is copied into its own new commodity message.
  947.  
  948.     The above means that no other commodities' user, nor
  949.     commodities.library itself will be modifying your list of InputEvents.
  950.     On the other hand, your program must not corrupt the input event
  951.     chain that has been presented to a translator.
  952.  
  953.    INPUTS
  954.     translator - the translator object to affect (may be NULL)
  955.     events - the new input event translation list
  956.  
  957.    BUGS
  958.     The list of input events manipulated by a translator object is
  959.     inserted in reverse order in the commodities network, and come out
  960.     of the network in reverse order as well. The cx_lib/InvertString()
  961.     function creates lists of input events that are in reverse order so
  962.     they can be used directly with translator objects.
  963.  
  964.    SEE ALSO
  965.     <devices/inputevent.h>, cx_lib/CxTranslate()
  966.  
  967.