Lines Matching refs:tp
462 struct tp *json_to_tp(void *data, size_t data_len) in json_to_tp()
464 static struct tp tp; in json_to_tp() local
466 memset(&tp, 0, sizeof(tp)); in json_to_tp()
469 &tp) < 0) { in json_to_tp()
473 tp.type = tp_msg_to_type(tp.msg); in json_to_tp()
475 return &tp; in json_to_tp()
478 void tp_new_find_and_apply(struct tp_new *tp, const char *key, void *value, in tp_new_find_and_apply() argument
484 for (i = 0; i < tp->num_entries; i++) { in tp_new_find_and_apply()
485 if (is(key, tp->data[i].key)) { in tp_new_find_and_apply()
496 new_value = atoi(tp->data[i].value); in tp_new_find_and_apply()
504 new_value = atoi(tp->data[i].value); in tp_new_find_and_apply()
518 struct tp_msg tp; in json_decode_msg() local
520 memset(&tp, 0, sizeof(tp)); in json_decode_msg()
523 ARRAY_SIZE(tp_msg_dsc), &tp); in json_decode_msg()
529 tp_dbg("%s", tp.msg); in json_decode_msg()
531 return tp.msg ? tp_msg_to_type(tp.msg) : TP_NONE; in json_decode_msg()
536 static struct tp_new tp; in json_to_tp_new() local
539 memset(&tp, 0, sizeof(tp)); in json_to_tp_new()
542 &tp) < 0) { in json_to_tp_new()
546 tp_dbg("%s", tp.msg); in json_to_tp_new()
548 for (i = 0; i < tp.num_entries; i++) { in json_to_tp_new()
549 tp_dbg("%s=%s", tp.data[i].key, tp.data[i].value); in json_to_tp_new()
552 return &tp; in json_to_tp_new()
555 void tp_encode(struct tp *tp, void *data, size_t *data_len) in tp_encode() argument
559 error = json_obj_encode_buf(tp_descr, ARRAY_SIZE(tp_descr), tp, in tp_encode()
569 void tp_new_to_json(struct tp_new *tp, void *data, size_t *data_len) in tp_new_to_json() argument
571 int error = json_obj_encode_buf(tp_new_dsc, ARRAY_SIZE(tp_new_dsc), tp, in tp_new_to_json()
588 struct tp_new tp = { in tp_out() local
594 tp_new_to_json(&tp, buf, &json_len); in tp_out()