It seems that the OS documentation is rather out-of-date: It looks like (in about 2005 ?) there were some functions added to OS4's Commodities library that allow any other program to do what the Exchange program does.
CLIExchange has an example of this, but it is one of the most cryptic C programs I've read (seemingly in an attempt to reduce the file size by a few bytes).
The new functions (well methods) are these:
Quote:
LONG CopyBrokerList(struct List * blist);
VOID FreeBrokerList(struct List * list);
LONG BrokerCommand(STRPTR name, LONG id);
But in fact the only one I needed is BrokerCommand(), to which you supply the commodity's name, and one of the following command (IDs) : CXCMD_DISABLE, CXCMD_ENABLE, CXCMD_APPEAR, CXCMD_DISAPPEAR, CXCMD_KILL, CXCMD_UNIQUE . BTW, it actually returns 0 for success, and -1 for failure, depending on whether or not the named commodity exists.
Pretty easy. And those 3 functions are now added to the next beta release of PortablE...