Fix 2 functions

FossilOrigin-Name: 32d6739639c9c031f3ac84a99f3204a9e9c9e7986f2cf3d86b463afb58b15c45
This commit is contained in:
nekobit 2022-11-04 18:48:50 +00:00
parent 38de5f2392
commit 5687929253
3 changed files with 6 additions and 6 deletions

View file

@ -28,7 +28,7 @@ struct mstdnt_fetch_data
// Callback from user
mstdnt_request_cb_t callback;
void* callback_args;
int (*json_cb)(cJSON*, void*);
int (*json_cb)(cJSON*, void*, mstdnt_request_cb_data*);
void* json_args;
};

View file

@ -126,8 +126,8 @@ int mstdnt_statuses_json(struct mstdnt_status* statuses[],
size_t* size,
cJSON* js);
void _mstdnt_val_status_call(cJSON* v, void* _type);
void _mstdnt_val_malloc_status_call(cJSON* v, void* _type);
void _mstdnt_val_status_call(cJSON* v, void* args, mstdnt_request_cb_data* data);
void _mstdnt_val_malloc_status_call(cJSON* v, void* args, mstdnt_request_cb_data* data);
int mstdnt_status_context_json(struct mstdnt_status* statuses_before[],
struct mstdnt_status* statuses_after[],

View file

@ -132,7 +132,7 @@ int mstdnt_status_json(struct mstdnt_status* status, cJSON* js)
return 0;
}
int mstdnt_status_json_callback(cJSON* json, void* args, mstdnt_request_cb_data data)
int mstdnt_status_json_callback(cJSON* json, void* args, mstdnt_request_cb_data* data)
{
// No arguments passed for statuses
(void)_args;
@ -143,10 +143,10 @@ int mstdnt_status_json_callback(cJSON* json, void* args, mstdnt_request_cb_data
// GENERATE mstdnt_statuses_json
GENERATE_JSON_ARRAY_FUNC(mstdnt_statuses_json, struct mstdnt_status, mstdnt_status_json)
int mstdnt_statuses_json_callback(cJSON* json, void** _args)
int mstdnt_statuses_json_callback(cJSON* json, void* args, mstdnt_request_cb_data* data)
{
// TODO
struct mstdnt_statuses* statuses = malloc(sizeof(struct mstdnt_statuses));
*_args = (void*)statuses;
return mstdnt_statuses_json(&(statuses->statuses), &(statuses->len), json);
}