|
| iMatix home page | << | < | > | >> |
SMTVersion 2.81 |
#include "smtlib.h" int smt_term (void)
Shuts-down the SMT. Destroys all agents, methods, queues, events, threads. Returns 0 if there were no errors, otherwise returns -1 and sets smt_errno to one of these values:
| SMT NOTREADY | smt_init() was not called, or failed |
| SMT OUTOFMEMORY | Not enough heap memory left |
{
EXITFCT *exitfct; /* Exit function address */
#if (defined (SMT_TRACE))
trace ("smt_term");
#endif
if (!smt_alive) /* If SMT API was not correctly */
{ /* initialised, forget it */
smt_errno = SMT_NOTREADY;
return (-1);
}
FORLIST (exitfct, exitfcts) /* Execute all exit functions */
(*exitfct-> handler) ();
while (exitfcts.next != &exitfcts) /* And free the memory */
node_destroy (exitfcts.next);
agent destroy (NULL); /* Free all agents */
semaph destroy (NULL); /* Free all semaphores */
sym_delete_table (dict);
smt_alive = FALSE; /* SMT is now disactivated */
return (0);
}
| | << | < | > | >> |
|