| iMatix home page
| << | < | > | >>
SMT Logo SMT
Version 2.81

 

method_destroy

#include "smtlib.h"
int
method_destroy (
    METHOD *method                      /*  Method to destroy                */
)

Synopsis

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

Source Code - (smtlib.c)

{
#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);
}

| << | < | > | >> iMatix Copyright © 1996-99 iMatix Corporation