#include <json_parameter.h>
◆ AllocateJSONParameter()
JSONParameter * AllocateJSONParameter |
( |
const struct ServiceData * |
service_data_p, |
|
|
const ParameterType |
pt, |
|
|
const char *const |
name_s, |
|
|
const char *const |
display_name_s, |
|
|
const char *const |
description_s, |
|
|
const json_t * |
default_value_p, |
|
|
const json_t * |
current_value_p, |
|
|
ParameterLevel |
level |
|
) |
| |
Allocate a JSONParameter.
- Parameters
-
service_data_p | The ServiceData for the Service that is allocating this Parameter. |
name_s | The name of the Parameter. The Parameter will store a copy of this string so this value does not need to remain in scope. |
display_name_s | An optional name to display for the Parameter for use in Clients. The Parameter will store a copy of this string so this value does not need to remain in scope. This can be NULL . |
description_s | The description of the Parameter. The Parameter will store a copy of this string so this value does not need to remain in scope. |
options_p | This can be used to constrain the Parameter to a fixed set of values. If this is NULL then the Parameter can be set to any value. |
default_value_p | The default value for this Parameter. |
current_value_p | If this is not NULL , then copy this value as the current value of the Parameter. If this is NULL , then current value for this Parameter will be set to be a copy of its default value. |
bounds_p | If this is not NULL , then this will be used to specify the minimum and maximum values that this Parameter can take. If this is NULL , then the Parameter can take any value. |
level | The ParameterLevel for this Parameter. This determines when the Client should display this Parameter to the user. |
check_value_fn | If this is not NULL , then this will be used to check whether the Parameter has been set to a valid value. |
- Returns
- A newly-allocated Parameter or
NULL
upon error.
◆ jp_base_param
◆ jp_current_value_p
json_t* jp_current_value_p |
◆ jp_default_value_p
json_t* jp_default_value_p |
The documentation for this struct was generated from the following file: