| iMatix home page | << | < | > | >> |
SMT Version 2.81 |
#include "smtlib.h" METHOD * method_lookup ( const AGENT *agent, /* Agent to look at */ const char *method_name /* Name of method to look for */ )
Checks whether a specific method exists; returns the address of the method information block, or NULL if there was an error, setting smt_errno to one of these values:
SMT NOTREADY | smt_init() was not called, or failed |
SMT NOSUCHMETHOD | Specified method was not declared |
{ SYMBOL *dict_entry; /* Dictionary symbol */ char *full_name; /* Full agent/method name */ #if (defined (SMT_TRACE)) trace ("method_lookup: agent=%s", agent-> name, method_name); #endif ASSERT (agent); ASSERT (method_name); if (!smt_alive) /* If SMT API was not correctly */ { /* initialised, forget it */ smt_errno = SMT_NOTREADY; return (NULL); } full_name = get_method_name (agent-> name, method_name); dict_entry = sym_lookup_symbol (dict, full_name); if (dict_entry == NULL) { smt_errno = SMT_NOSUCHMETHOD; return (NULL); } return (dict_entry-> data); /* Return pointer to METHOD */ }
| << | < | > | >> | Copyright © 1996-99 iMatix Corporation |