|
| void | makecommodity (void) |
| void | addhotkey (void) |
| void | hotkeyhit (void) |
| void | waitevent (void) |
| void | event (void) |
| void | exchangemessage (void) |
| void | disabled (void) |
| void | enable (void) |
| void | appear (void) |
| void | disappear (void) |
| void | kill (void) |
| void | list (void) |
| void | unqiue (void) |
| void | cxdisable (void) |
| | CxDisable, CxEnable, CxAppear, CxDisAppear, CxKill, CxListChange, CxUnique: the CXCMD_ codes.
|
| void | cxenable (void) |
| void | cxappear (void) |
| void | cxdisappear (void) |
| void | cxkill (void) |
| void | cxlist (void) |
| void | cxunique (void) |
| void | status (void) |
| void | port (void) |
| void | ricommoditieslib_libinit (void) |
| void | ricommoditieslib_libfinit (void) |
| void | hotkeynumchk (void) |
| | RI_FUNC (hotkeyhit, "HotKeyHit", "") |
| | RI_FUNC (event, "CommodityEvent", "") |
| | RI_FUNC (exchangemessage, "ExchangeMessage", "") |
| | RI_FUNC (disabled, "ExchangeDisable", "") |
| | RI_FUNC (enable, "ExchangeEnable", "") |
| | RI_FUNC (appear, "ExchangeAppear", "") |
| | RI_FUNC (disappear, "ExchangeDisAppear", "") |
| | RI_FUNC (kill, "ExchangeKill", "") |
| | RI_FUNC (list, "ExchangeListChange", "") |
| | RI_FUNC (unqiue, "ExchangeUnique", "") |
| | RI_FUNC (cxdisable, "CxDisable", "") |
| | RI_FUNC (cxenable, "CxEnable", "") |
| | RI_FUNC (cxappear, "CxAppear", "") |
| | RI_FUNC (cxdisappear, "CxDisAppear", "") |
| | RI_FUNC (cxkill, "CxKill", "") |
| | RI_FUNC (cxlist, "CxListChange", "") |
| | RI_FUNC (cxunique, "CxUnique", "") |
| static void | libinit_c (void) |
| | init: OpenLibrary("commodities.library",37).
|
| static void | delmsgport (struct MsgPort *p) |
| static void | replymsg (void) |
| static void | libfinit_c (void) |
| | finit: deletes the broker, replies the messages, deletes the message port and closes commodities.library.
|
| static BB_BOOL | waitevent_c (void) |
| | WaitCommodity: fetches the next message into msg, waiting for one.
|
| static BB_BOOL | event_c (void) |
| | CommodityEvent: fetches the next message (GetMsg) into msg.
|
| static void | getmessage (void) |
| static LONG | hotkeyhit_c (void) |
| | HotKeyHit: the hotkey id of the fetched message.
|
| static LONG | exchangemessage_c (void) |
| | ExchangeMessage: the Exchange command of the fetched message.
|
| static BB_BOOL | is_cmd (ULONG cmd) |
| static BB_BOOL | disabled_c (void) |
| | ExchangeDisable, ExchangeEnable, ExchangeAppear, ExchangeDisAppear, ExchangeKill, ExchangeListChange, ExchangeUnique: whether the last message was that Exchange command.
|
| static BB_BOOL | enable_c (void) |
| static BB_BOOL | appear_c (void) |
| static BB_BOOL | disappear_c (void) |
| static BB_BOOL | kill_c (void) |
| static BB_BOOL | list_c (void) |
| static BB_BOOL | unqiue_c (void) |
| static void | delhotkey (LONG n) |
| static BB_BOOL | addhotkey_c (LONG n, STRPTR desc) |
| | SetHotKey(hotkeynum,hotkey$): a hotkey filter with a sender (id hotkeynum) attached to the broker.
|
| static ULONG | port_c (void) |
| | CommodityMsgPort: the message port address.
|
| static BB_BOOL | status_c (LONG on) |
| | SetCxStatus on|off: -1 activates, 0 deactivates the broker.
|
| static BB_BOOL | makecommodity_c (STRPTR name, STRPTR title, STRPTR descr) |
| | MakeCommodity(name$,title$,description$): the commodity's broker (NBU_UNIQUE|NBU_NOTIFY, COF_SHOW_HIDE), activated.
|
| static void | hotkeynumchk_c (ULONG n) |
| | The error check of SetHotKey (debugger only).
|
| BB_BOOL addhotkey_c |
( |
LONG | n, |
|
|
STRPTR | desc ) |
|
static |
SetHotKey(hotkeynum,hotkey$): a hotkey filter with a sender (id hotkeynum) attached to the broker.
Amiga mode only; the broker is activated afterwards. A number outside 0..15 hits the variables around cxfilter/cxsends: an invalid argument, refused by hotkeynumchk with runtime error checking (#564). Fixed (#563): a replaced hotkey's filter is deleted with its sender (DeleteCxObjAll, which also detaches it), and when a step fails the new filter (with a sender attached to it) is deleted and the slots are cleared; the original only removed the replaced objects (RemoveCxObj, the sender only if the filter existed) and left what it had made before a failure. Fixed (#565): a description commodities cannot parse (CxObjError of the new filter, COERR_BADFILTER) is refused: the filter is deleted, the result 0; AttachCxObj (void) is not tested. The original never called CxObjError (its 'oops2 tail is unreachable) and tested the d0 AttachCxObj leaves.
- Parameters
-
| n | d0: the hotkey number |
| desc | d1: the hotkey description (CX_FILTER) |
- Returns
- d0: BB_TRUE, BB_FALSE without a broker, for a description commodities cannot parse or if an object cannot be made
CxDisable, CxEnable, CxAppear, CxDisAppear, CxKill, CxListChange, CxUnique: the CXCMD_ codes.
Inline constants (MOVE.l CXCMD_...,d0, copied by the compiler). Result: d0 = the code (15, 17, 19, 21, 23, 27, 25).
ExchangeDisable, ExchangeEnable, ExchangeAppear, ExchangeDisAppear, ExchangeKill, ExchangeListChange, ExchangeUnique: whether the last message was that Exchange command.
Amiga mode only. Fixed (#555): only a CXM_COMMAND message counts; the original compared the id whatever the type (a hotkey id 15 counted as ExchangeDisable).
- Returns
- d0: BB_TRUE if the last message is a CXM_COMMAND with the CXCMD_ code, else BB_FALSE
| void hotkeynumchk_c |
( |
ULONG | n | ) |
|
|
static |
The error check of SetHotKey (debugger only).
Fixed (#564), not in the original (ricommoditieslib had no error check area): the number indexes the tables of 16 filters and senders without a check, so a number outside 0..15 made SetHotKey remove and overwrite the variables around them (with -1 the broker). The release code is unchanged (an invalid argument).
Errors: "Hotkey number must be 0 to 15".
- Parameters
-
finit: deletes the broker, replies the messages, deletes the message port and closes commodities.library.
Fixed (#561): the message fetched last and those still queued are replied (after the broker is deleted, so no more come) before the port is deleted; the original deleted the port with them. Fixed (#556): commodities.library is closed last; the original closed it first and then called DeleteCxObj through the closed base. Fixed (#557): the broker is deleted with DeleteCxObjAll, its hotkey filters and senders with it, and the slots are cleared; the original's DeleteCxObj left them allocated.
| BB_BOOL makecommodity_c |
( |
STRPTR | name, |
|
|
STRPTR | title, |
|
|
STRPTR | descr ) |
|
static |
MakeCommodity(name$,title$,description$): the commodity's broker (NBU_UNIQUE|NBU_NOTIFY, COF_SHOW_HIDE), activated.
Amiga mode only. The message port is created on the first call. Fixed (#559): without commodities.library (init's OpenLibrary failed) it returns 0 before it makes the port; the original called CxBroker through a base of 0. Fixed (#560): while the library has a broker it returns 0 and the broker stays in use (user decision W4 Q4); the original made a new broker on every call and left the previous one active with the same port.
- Parameters
-
| name | d0: the name |
| title | d1: the title |
| descr | d2: the description |
- Returns
- d0: BB_TRUE, BB_FALSE without the library, with a broker already made or if the port or the broker fails
WaitCommodity: fetches the next message into msg, waiting for one.
Amiga mode only. Fixed (#566): GetMsg, and on an empty port WaitPort and GetMsg again; the original branched on the condition codes GetMsg leaves, inverted ("ne", what exec leaves: WaitPort, msg = the head, left queued; a message GetMsg had removed was lost). Fixed (#561): the message fetched before is replied first.
- Returns
- d0: BB_TRUE, BB_FALSE without a broker