|
| iMatix home page | << | < | > | >> |
SMTVersion 2.81 |
#include "smtlib.h"
int
method_destroy (
METHOD *method /* Method to destroy */
)
Destroys the method. Returns 0 when completed. In case of error, returns -1 and sets smt_errno to one of these values:
| SMT NOTREADY | smt_init() was not called, or failed |
{
#if (defined (SMT_TRACE))
trace ("method_destroy: method=%s", method-> name);
#endif
ASSERT (method);
if (!smt_alive) /* If SMT API was not correctly */
{ /* initialised, forget it */
smt_errno = SMT_NOTREADY;
return (-1);
}
/* We have to be a little careful or sym_delete_symbol () will */
/* try to release the symbol's data area; the data area points */
/* to our node, which we want to release ourselves. */
method-> symbol-> data = NULL;
sym_delete_symbol (dict, method-> symbol);
/* Delete the method */
mem_strfree (&method-> name);
node_destroy (method);
return (0);
}
| | << | < | > | >> |
|