Sambar Server Documentation

sa_cmd_init



Purpose

Initialize an RPC command handler. The Sambar Server is extensible, allowing users to write their own Remote Procedure Calls (RPCs) to add functionality to the server.

Syntax

sa_cmd_init (context, name, params, numparams, authorization, desc, func);

SA_CTX *context;
SA_CHAR *name;
SA_RPCPARAM *params;
SA_INT numparams;
SA_INT authorization;
SA_CHAR *desc;
SA_RPCFUNC func;

Parameters

context Server context.
name RPC name.
params RPC parameter arguments.
numparams The number of parameter arguments being passed in. The number of parameters cannot exceed 20.
authorization Authorization level; specify either:

SA_AUTHORIZATION_ALL - Any user can execute this RPC.

SA_AUTHORIZATION_USER - Only logged in users may execute this RPC.

SA_AUTHORIZATION_ADMIN - Only the System Administrator can execute this RPC.

SA_AUTHORIZATION_SCRIPT - This RPC can only be executed using the RCX scripting function.

desc RPC description. Displayed in the system administration console reports.
func Function callback that is executed whenever name is called. The function must take the following form:
SA_RETCODE function_name(SA_CTX *, SA_CONN *, SA_PARAMS *, SA_INT *)

Returns

SA_SUCCEED if the function is successful; SA_FAIL otherwise.

Comments

Commands initialized with this interface may be executed using the /session directive, RCX scripting interface, or Server-side includes.

See Also

None

© 1998-1999 Sambar Technologies. All rights reserved. Terms of Use.