diff --git a/include/mastodont_fetch.h b/include/mastodont_fetch.h index 2de0dff..0c4873d 100644 --- a/include/mastodont_fetch.h +++ b/include/mastodont_fetch.h @@ -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; }; diff --git a/include/mastodont_status.h b/include/mastodont_status.h index 09390f3..969a581 100644 --- a/include/mastodont_status.h +++ b/include/mastodont_status.h @@ -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[], diff --git a/src/status.c b/src/status.c index c87eda1..726cc72 100644 --- a/src/status.c +++ b/src/status.c @@ -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); }