Sambar Server Documentation

sa_scalar_init


Purpose

Initialize an in-line scalar handler. The Sambar Server is extensible, allowing users to write their own scalar functions to add functionality to the server.

Syntax

sa_scalar_init (context, name, args, numargs, desc, func);

SA_CTX *context;
SA_CHAR *name;
SA_SCALARARG *args;
SA_INT numargs;
SA_CHAR *desc;
SA_SCALARFUNC func;

Parameters

context Server context.
name RPC name.
args Scalar arguments.
numargs The number of scalar argument definitions being passed in. The number of arguments cannot exceed 20.
desc Scalar description. Displayed in the system administration console reports.
func Function callback that is executed whenever name scalar is called. The function must take the following form:
SA_RETCODE function_name(SA_CTX *, SA_CONN *, SA_ARG *, SA_CHAR *)

Returns

SA_SUCCEED if the function is successful; SA_FAIL otherwise.

Comments

The server guarantees the callback is called with exactly the number of arguments defined. The resulting value must be put in the value argument passed to the callback; the value must be a null-terminated string not more than 1000 characters.

See Also

None

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