action
unsigned int
action(const char *res_name, const char *action_token,
void **attr_val, char **args, char *output);
You may select any name for the function.
The action field of VCSAgV40EntryPointStruct passed to VCSAgRegisterEPStruct() must be assigned a pointer to this function.
For example:
extern "C"
unsigned int file_action (const char *res_name, const char *token,
void **attr_val, char **args, char *output)
{
//
// checks on the attr_val entry point arg list
//
//
// perform an action based on the action token passed in
//
if (!strcmp(token, "token1")) {
//
// Perform action corresponding to token1
//
} else if (!strcmp(token, "token2") {
//
// Perform action corresponding to token2
//
}
:
:
:
} else {
//
// a token that doesnt have an impl yet
//
VCSAgSnprintf(ep_output, MAXBUFFER,
"No implementation provided for token(%s)",
token);
}
//
// Any other checks to be done
//
//
// return value should indicate whether the ep succeeded or
// not:
// return 0 on success
// any other value on failure
//
if (success)
return 0;
else
return 1;
}
|