mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
common/json: Implement json_add_snum for signed numbers.
This commit is contained in:
parent
1da27c51c2
commit
8c527f3931
@ -457,6 +457,11 @@ void json_add_num(struct json_result *result, const char *fieldname, unsigned in
|
||||
json_start_member(result, fieldname);
|
||||
result_append_fmt(result, "%u", value);
|
||||
}
|
||||
void json_add_snum(struct json_result *result, const char *fieldname, int value)
|
||||
{
|
||||
json_start_member(result, fieldname);
|
||||
result_append_fmt(result, "%d", value);
|
||||
}
|
||||
|
||||
void json_add_u64(struct json_result *result, const char *fieldname,
|
||||
uint64_t value)
|
||||
|
@ -89,6 +89,9 @@ void json_add_string(struct json_result *result, const char *fieldname, const ch
|
||||
void json_add_literal(struct json_result *result, const char *fieldname,
|
||||
const char *literal, int len);
|
||||
/* '"fieldname" : value' or 'value' if fieldname is NULL */
|
||||
void json_add_snum(struct json_result *result, const char *fieldname,
|
||||
int value);
|
||||
/* '"fieldname" : value' or 'value' if fieldname is NULL */
|
||||
void json_add_num(struct json_result *result, const char *fieldname,
|
||||
unsigned int value);
|
||||
/* '"fieldname" : value' or 'value' if fieldname is NULL */
|
||||
|
Loading…
Reference in New Issue
Block a user