Description
UDM_AGENT* UdmAgentInit(UDM_AGENT* Agent, UDM_ENV* Env, int id);
Allocates or initializes an UDM_AGENT variable (search session).
If Agent is a NULL pointer,
the function allocates, initializes, and returns a new variable.
Otherwise, the variable is initialized and the address of the
variable is returned. If UdmAgentInit()
allocates a new variable, it is freed when
UdmAgentFree() is called to close search
session.
Examples
Example 1. UdmAgentInit example #1
UDM_AGENT *Agent;
if (!(Agent= UdmAgentInit(NULL, Env, 0)))
{
printf('Fatal error: could not allocate Agent');
exit(1);
}
...
UdmAgentFree(Agent);
Example 2. UdmAgentInit example #2
UDM_AGENT Agent;
if (!UdmEnvInit(&Agent))
{
printf('Fatal error: could not initialize Agent');
exit(1);
}
...
UdmAgentFree(&Agent);