49 const char* tmp = afb_req_value (request, source);
54 long tmp_id = strtol(tmp,&endptr,10);
57 if( (tmp_id > UINT16_MAX) || (tmp_id < 0) )
66 *out_id = (uint16_t)tmp_id;
85 const char* tmp = afb_req_value (request, source);
90 long tmp_id = strtol(tmp,&endptr,10);
93 if( (tmp_id > INT16_MAX) || (tmp_id < INT16_MIN) )
102 *out_id = (int16_t)tmp_id;
121 const char* tmp = afb_req_value (request, source);
126 long tmp_id = strtol(tmp,&endptr,10);
129 if( (tmp_id > INT32_MAX) || (tmp_id < INT32_MIN) )
138 *out_id = (int32_t)tmp_id;
157 va_start(args, count);
158 for(
int i = 0; i < count; ++i )
160 char *key = va_arg(args,
char*);
161 int value = va_arg(args,
int);
162 json_object_object_add(j_obj, key, json_object_new_int((int32_t)value));
183 va_start(args, count);
184 for(
int i = 0; i < count; ++i )
186 char *key = va_arg(args,
char*);
187 char *value = va_arg(args,
char*);
188 json_object_object_add(j_obj, key, json_object_new_string(value));
210 va_start(args, count);
212 json_object_object_add(j_obj,
"verb", json_object_new_string(verb_name));
214 for(
int i = 0; i < count; ++i )
216 char *key = va_arg(args,
char*);
217 int value = va_arg(args,
int);
218 json_object_object_add(j_obj, key, json_object_new_int((int32_t)value));
236 size_t buf_size = 50;
239 for(
size_t i = 0 ; i < size ; ++i)
241 if(!strncmp(value,
evlist[i], buf_size))
REQ_ERROR get_value_uint16(const afb_req_t request, const char *source, uint16_t *out_id)
REQ_ERROR get_value_int16(const afb_req_t request, const char *source, int16_t *out_id)
void hs_add_object_to_json_object_str(struct json_object *j_obj, int count,...)
void hs_add_object_to_json_object(struct json_object *j_obj, int count,...)
void hs_add_object_to_json_object_func(struct json_object *j_obj, const char *verb_name, int count,...)
REQ_ERROR get_value_int32(const afb_req_t request, const char *source, int32_t *out_id)
int hs_search_event_name_index(const char *value)