|
| iMatix home page | << | < | > | >> |
SMTVersion 2.81 |
#include "smtlib.h"
AGENT *
agent_lookup (
const char *agent_name /* Name of agent to look for */
)
Checks whether a specific agent exists; returns the address of the agent 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 NOSUCHAGENT | Specified agent was not declared |
{
SYMBOL *dict_entry; /* Dictionary symbol */
#if (defined (SMT_TRACE))
trace ("agent_lookup: agent=%s", agent_name);
#endif
if (!smt_alive) /* If SMT API was not correctly */
{ /* initialised, forget it */
smt_errno = SMT_NOTREADY;
return (NULL);
}
dict_entry = sym_lookup_symbol (dict, get_entity_name (agent_name, NULL));
if (dict_entry == NULL)
{
smt_errno = SMT_NOSUCHAGENT;
return (NULL);
}
return (dict_entry-> data); /* Return pointer to AGENT */
}
| | << | < | > | >> |
|