src.dualinventive.com/dinet/sec-multi-proxy/libdi/include/di/rpc/param.h

105 lines
3.6 KiB
C
Executable File

#ifndef LIBDI_INCLUDE_RPC_PARAM_H_
#define LIBDI_INCLUDE_RPC_PARAM_H_
#include <stdint.h>
#include <float.h>
#include <di/types.h>
#include <di/rpc/structures.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Get the boolean value from the decoded parameter.
* Only allowed to have the data boolean field set.
* @param value[out] Boolean value
* @param data[in] Deserialized rpc data
* @return DNOK when value is written to value parameter, !DNOK otherwise
*/
di_errno_t di_rpc_param_value_bool(bool *value, const struct di_rpc_data *data);
/**
* Get the u8 value from the decoded parameter
* It is able to load the u8 value from all numeric types (when fits).
* Otherwise it returns an error.
* @param value[out] U8 value
* @param data[in] Deserialized rpc data
* @return DNOK when value is written to value parameter, !DNOK otherwise
*/
di_errno_t di_rpc_param_value_u8(uint8_t *value, const struct di_rpc_data *data);
/**
* Get the s8 value from the decoded parameter
* It is able to load the s8 value from all numeric types (when fits).
* Otherwise it returns an error.
* @param value[out] S8 value
* @param data[in] Deserialized rpc data
* @return DNOK when value is written to value parameter, !DNOK otherwise
*/
di_errno_t di_rpc_param_value_s8(int8_t *value, const struct di_rpc_data *data);
/**
* Get the u16 value from the decoded parameter
* It is able to load the u16 value from all numeric types (when fits).
* Otherwise it returns an error.
* @param value[out] U16 value
* @param data[in] Deserialized rpc data
* @return DNOK when value is written to value parameter, !DNOK otherwise
*/
di_errno_t di_rpc_param_value_u16(uint16_t *value, const struct di_rpc_data *data);
/**
* Get the s16 value from the decoded parameter
* It is able to load the s16 value from all numeric types (when fits).
* Otherwise it returns an error.
* @param value[out] S16 value
* @param data[in] Deserialized rpc data
* @return DNOK when value is written to value parameter, !DNOK otherwise
*/
di_errno_t di_rpc_param_value_s16(int16_t *value, const struct di_rpc_data *data);
/**
* Get the u32 value from the decoded parameter
* It is able to load the u32 value from all numeric types (when fits).
* Otherwise it returns an error.
* @param value[out] U32 value
* @param data[in] Deserialized rpc data
* @return DNOK when value is written to value parameter, !DNOK otherwise
*/
di_errno_t di_rpc_param_value_u32(uint32_t *value, const struct di_rpc_data *data);
/**
* Get the s32 value from the decoded parameter
* It is able to load the s32 value from all numeric types (when fits).
* Otherwise it returns an error.
* @param value[out] S32 value
* @param data[in] Deserialized rpc data
* @return DNOK when value is written to value parameter, !DNOK otherwise
*/
di_errno_t di_rpc_param_value_s32(int32_t *value, const struct di_rpc_data *data);
/**
* Get the float value from the decoded parameter
* It is able to load the float value from all numeric types (when fits).
* Otherwise it returns an error.
* @param value[out] float value
* @param data[in] Deserialized rpc data
* @return DNOK when value is written to value parameter, !DNOK otherwise
*/
di_errno_t di_rpc_param_value_f(float *value, const struct di_rpc_data *data);
/**
* Get the string value from the decoded parameter
* @param value[out] string value
* @param data[in] Deserialized rpc data
* @return DNOK when value is written to value parameter, !DNOK otherwise
*/
di_errno_t di_rpc_param_value_string(const char **value, const struct di_rpc_data *data);
#ifdef __cplusplus
}
#endif
#endif /* LIBDI_INCLUDE_RPC_PARAM_H_ */