Function silc_argument_get_decoded
SYNOPSIS
SilcBool silc_argument_get_decoded(SilcArgumentPayload payload,
SilcUInt32 type,
SilcArgumentDecodeType dec_type,
void *ret_arg,
void *ret_arg_alloc);
DESCRIPTION
Returns decoded argument by type. This is a helper function to
decode common argument types directly. The `type' is the argument
type number in the payload, and the `dec_type' is the type the
argument is decoded to. If the `ret_arg' is non-NULL then the
decodec data is returned into that pointer. If the `ret_arg_alloc'
is non-NULL then this function will allocate the decoded data and
will return the pointer into `ret_arg_alloc'. Some types must always
be allocated; see SilcArgumentDecodeType.
Return TRUE if the argument was present and waa successfully decoded.
FALSE if it is not present, or could not be decoded.
EXAMPLE
SilcID id;
SilcPublicKey public_key;
if (!silc_argument_get_decoded(args, 2, SILC_ARGUMENT_ID, &id, NULL))
error;
if (!silc_argument_get_decoded(args, 4, SILC_ARGUMENT_PUBLIC_KEY,
NULL, &public_key))
error;
|