table of contents
| jwt_helpers_set_grp(3) | Library Functions Manual | jwt_helpers_set_grp(3) |
NAME¶
jwt_helpers_set_grp - Setters
SYNOPSIS¶
Macros¶
#define jwt_set_SET_INT(__v, __n, __x)
Setup a jwt_value_t to set an integer value. #define
jwt_set_SET_STR(__v, __n, __x)
Setup a jwt_value_t to set a string value. #define
jwt_set_SET_BOOL(__v, __n, __x)
Setup a jwt_value_t to set a boolean value. #define
jwt_set_SET_JSON(__v, __n, __x)
Setup a jwt_value_t to set a JSON string.
Detailed Description¶
When setting a value, you must set the type, name, and the specific val for the type. If the value already exists, then the function will return JWT_VALUE_ERR_EXISTS and value.error will be set the same. If value.replace is non-zero, then any existing value will be overwritten.
Remarks
Note
jwt_value_error_t ret; jwt_value_t jval; jwt_set_SET_STR(&jval, "iss", "foo.example.com"); ret = jwt_builder_header_set(jwt, &jval); if (ret == JWT_VALUE_ERR_NONE)
printf("iss updated to: %s\n", jval.str_val);
Macro Definition Documentation¶
#define jwt_set_SET_BOOL(__v, __n, __x)¶
Value:.PP
({ \
(__v)->type=JWT_VALUE_BOOL;(__v)->replace=0; \
(__v)->name=(__n);(__v)->bool_val=(__x);(__v)->error=0;\
(__v);})
Setup a jwt_value_t to set a boolean value.
Parameters
__n Name of the value
__x Value to set
Returns
#define jwt_set_SET_INT(__v, __n, __x)¶
Value:.PP
({ \
(__v)->type=JWT_VALUE_INT;(__v)->replace=0; \
(__v)->name=(__n);(__v)->int_val=(__x);(__v)->error=0;\
(__v);})
Setup a jwt_value_t to set an integer value.
Parameters
__n Name of the value
__x Value to set
Returns
#define jwt_set_SET_JSON(__v, __n, __x)¶
Value:.PP
({ \
(__v)->type=JWT_VALUE_JSON;(__v)->replace=0; \
(__v)->name=(__n);(__v)->json_val=(__x);(__v)->error=0; \
(__v);})
Setup a jwt_value_t to set a JSON string.
Parameters
__n Name of the value
__x Value to set
Returns
#define jwt_set_SET_STR(__v, __n, __x)¶
Value:.PP
({ \
(__v)->type=JWT_VALUE_STR;(__v)->replace=0; \
(__v)->name=(__n);(__v)->str_val=(__x);(__v)->error=0;\
(__v);})
Setup a jwt_value_t to set a string value.
Parameters
__n Name of the value
__x Value to set
Returns
Author¶
Generated automatically by Doxygen for LibJWT from the source code.
| Version 3.2.2 | LibJWT |