sw_salt
structure contains configuration parameters for a Howl function.
sw_result
sw_salt_init
(
sw_salt *self,
sw_context
context,
int argc,
char **argv)
sw_salt
structure. self
is allocated by the user and filled in by Howl.
@@scott: anything to say about command-line parameters?
void run_rendezvous_in_gui(int argc, char **argv) {
sw_result result;
sw_salt salt;
sw_salt_init(&salt, SW_CONTEXT_GUI, argc, argv);
sw_rendezvous session;
result = sw_rendezvous_init_with_salt(&session, salt);
if (result == SW_OKAY) {
. . .
}
sw_salt_fina(salt);
}
sw_context
, sw_rendezvous_init_with_salt
sw_result
sw_salt_fina
(sw_salt self);
sw_salt
structure. Once sw_salt_fina
has been called, the memory occupied by self
may safely be freed.
typedef enum
{
SW_CONTEXT_CONSOLE,
SW_CONTEXT_GUI
} sw_context
;
sw_rendezvous_init_with_salt
, indicating how the Rendezvous session should plug into the GUI event loop, if there is one.
SW_CONTEXT_CONSOLE
: No event loop. sw_rendezvous_run
must be called to yield the CPU to Howl. Rendezvous code must run in a separate thread from the GUI thread, if there is one.
SW_CONTEXT_GUI
: Howl incorporates itself into the GUI event loop. There is no need to call sw_rendezvous_run
.
sw_salt_init
, sw_rendezvous_run
, sw_rendezvous_init_with_salt