FossilOrigin-Name: ae2f52cfed5dadf645e1afb9b2f1724414bd83ec6c4afcf9f87ffa0ce453d946
This commit is contained in:
nekobit 2022-10-15 21:40:40 +00:00
parent 28d69a286f
commit 332291bf0a
37 changed files with 111 additions and 111 deletions

View file

@ -41,14 +41,14 @@ void mstdnt_global_curl_cleanup();
* \param data Pointer to struct to fill in
* \return Value of curl_easy_init(); either Zero or non-zero
*/
int mstdnt_init(mstdnt_t* data);
int mstdnt_init(mastodont_t* data);
/*!
* Cleans up the mstdnt struct
*
* \param data Pointer to the mstdnt data
*/
void mstdnt_cleanup(mstdnt_t* data);
void mstdnt_cleanup(mastodont_t* data);
/*!
* Cleans up a storage struct.

View file

@ -76,7 +76,7 @@ struct mstdnt_account_args
int with_relationships; // mstdnt_get_mutes
};
int mstdnt_account_action(mstdnt_t* data,
int mstdnt_account_action(mastodont_t* data,
struct mstdnt_args* args,
char* id,
struct mstdnt_storage* storage,
@ -87,7 +87,7 @@ int mstdnt_accounts_json(struct mstdnt_account* accounts[],
size_t* size,
cJSON* js);
#define MSTDNT_ACCOUNT_ACTION_DECL(type) int mstdnt_##type##_account(mstdnt_t* data, struct mstdnt_args* args, char* id, struct mstdnt_storage* storage, struct mstdnt_relationship* relationship)
#define MSTDNT_ACCOUNT_ACTION_DECL(type) int mstdnt_##type##_account(mastodont_t* data, struct mstdnt_args* args, char* id, struct mstdnt_storage* storage, struct mstdnt_relationship* relationship)
#define MSTDNT_ACCOUNT_ACTION_FUNC_URL(action) { \
return mstdnt_account_action(data, args, id, storage, relationship, "api/v1/accounts/%s/" action); \
}
@ -101,33 +101,33 @@ MSTDNT_ACCOUNT_ACTION_DECL(unblock);
MSTDNT_ACCOUNT_ACTION_DECL(subscribe);
MSTDNT_ACCOUNT_ACTION_DECL(unsubscribe);
int mstdnt_verify_credentials(mstdnt_t* data,
int mstdnt_verify_credentials(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_account* acct,
struct mstdnt_storage* storage);
int mstdnt_get_account(mstdnt_t* data,
int mstdnt_get_account(mastodont_t* data,
struct mstdnt_args* m_args,
int lookup_type,
char* id,
struct mstdnt_account* acct,
struct mstdnt_storage* storage);
int mstdnt_get_blocks(mstdnt_t* data,
int mstdnt_get_blocks(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_account_args* args,
struct mstdnt_storage* storage,
struct mstdnt_account* accts[],
size_t* accts_len);
int mstdnt_get_mutes(mstdnt_t* data,
int mstdnt_get_mutes(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_account_args* args,
struct mstdnt_storage* storage,
struct mstdnt_account* accts[],
size_t* accts_len);
int mstdnt_get_followers(mstdnt_t* data,
int mstdnt_get_followers(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_account_args* args,
@ -135,7 +135,7 @@ int mstdnt_get_followers(mstdnt_t* data,
struct mstdnt_account* accts[],
size_t* accts_len);
int mstdnt_get_following(mstdnt_t* data,
int mstdnt_get_following(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_account_args* args,

View file

@ -56,13 +56,13 @@ struct mstdnt_application_args
char* website;
};
int mstdnt_register_app(mstdnt_t* data,
int mstdnt_register_app(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_application_args* args,
struct mstdnt_storage* storage,
struct mstdnt_app* app);
int mstdnt_obtain_oauth_token(mstdnt_t* data,
int mstdnt_obtain_oauth_token(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_application_args* args,
struct mstdnt_storage* storage,

View file

@ -51,7 +51,7 @@ int mstdnt_attachment_json(cJSON* att_json, struct mstdnt_attachment* att);
void _mstdnt_val_attachments_call(cJSON* v, void* _type);
int mstdnt_upload_media(mstdnt_t* api,
int mstdnt_upload_media(mastodont_t* api,
struct mstdnt_args* m_args,
struct mstdnt_upload_media_args* args,
struct mstdnt_storage* storage,

View file

@ -58,14 +58,14 @@ int mstdnt_message_json(struct mstdnt_message* message, cJSON* js);
int mstdnt_message_json_callback(cJSON* json, void* chat);
int mstdnt_messages_json(struct mstdnt_message* message[], size_t* size, cJSON* js);
int mstdnt_get_chats_v2(mstdnt_t* data,
int mstdnt_get_chats_v2(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_chats_args* args,
struct mstdnt_storage* storage,
struct mstdnt_chat* chats[],
size_t* chats_len);
int mstdnt_get_chat_messages(mstdnt_t* data,
int mstdnt_get_chat_messages(mastodont_t* data,
struct mstdnt_args* m_args,
char* chat_id,
struct mstdnt_chats_args* args,
@ -73,7 +73,7 @@ int mstdnt_get_chat_messages(mstdnt_t* data,
struct mstdnt_message* chats[],
size_t* size);
int mstdnt_get_chat(mstdnt_t* data,
int mstdnt_get_chat(mastodont_t* data,
struct mstdnt_args* m_args,
char* chat_id,
struct mstdnt_storage* storage,

View file

@ -27,7 +27,7 @@ struct mstdnt_fetch_results
size_t mstdnt_curl_write_callback(char* ptr, size_t _size, size_t nmemb, void* _content);
void mstdnt_fetch_results_cleanup(struct mstdnt_fetch_results* res);
int mstdnt_fetch_curl(mstdnt_t* mstdnt,
int mstdnt_fetch_curl(mastodont_t* mstdnt,
CURL* curl,
struct mstdnt_args* args,
char* url,

View file

@ -23,7 +23,7 @@ struct mstdnt_instance
};
// TODO
int mstdnt_instance(mstdnt_t* api, struct mstdnt_args* args,
int mstdnt_instance(mastodont_t* api, struct mstdnt_args* args,
struct mstdnt_instance* inst);
#endif /* MASTODONT_INSTANCE_H */

View file

@ -49,37 +49,37 @@ int mstdnt_lists_json(struct mstdnt_list* lists[],
size_t* size,
cJSON* json);
int mstdnt_get_lists(mstdnt_t* api,
int mstdnt_get_lists(mastodont_t* api,
struct mstdnt_args* m_args,
struct mstdnt_storage* storage,
struct mstdnt_list* lists[],
size_t* size);
int mstdnt_get_list(mstdnt_t* api,
int mstdnt_get_list(mastodont_t* api,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_storage* storage,
struct mstdnt_list* lists);
int mstdnt_create_list(mstdnt_t* api,
int mstdnt_create_list(mastodont_t* api,
struct mstdnt_args* m_args,
struct mstdnt_list_args* args,
struct mstdnt_storage* storage,
struct mstdnt_list* list);
int mstdnt_update_list(mstdnt_t* api,
int mstdnt_update_list(mastodont_t* api,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_list_args* args,
struct mstdnt_storage* storage,
struct mstdnt_list* list);
int mstdnt_delete_list(mstdnt_t* api,
int mstdnt_delete_list(mastodont_t* api,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_storage* storage);
int mstdnt_list_get_accounts(mstdnt_t* data,
int mstdnt_list_get_accounts(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_account_args* args,
@ -87,14 +87,14 @@ int mstdnt_list_get_accounts(mstdnt_t* data,
struct mstdnt_account* accts[],
size_t* accts_len);
int mstdnt_list_add_accounts(mstdnt_t* api,
int mstdnt_list_add_accounts(mastodont_t* api,
struct mstdnt_args* m_args,
char* id,
char** account_ids,
size_t account_ids_len,
struct mstdnt_storage* storage);
int mstdnt_list_remove_accounts(mstdnt_t* api,
int mstdnt_list_remove_accounts(mastodont_t* api,
struct mstdnt_args* m_args,
char* id,
char** account_ids,

View file

@ -41,7 +41,7 @@ int mstdnt_nodeinfo_json(struct mstdnt_nodeinfo* nodeinfo, cJSON* js);
int mstdnt_nodeinfo_json_callback(cJSON* json, void* nodeinfo);
int mstdnt_get_nodeinfo(mstdnt_t* api, struct mstdnt_args* args,
int mstdnt_get_nodeinfo(mastodont_t* api, struct mstdnt_args* args,
char* version,
struct mstdnt_storage* storage,
struct mstdnt_nodeinfo* nodeinfo);

View file

@ -71,24 +71,24 @@ int mstdnt_notifications_json_callback(cJSON* json, void* _args);
int mstdnt_notification_json(struct mstdnt_notification* notif, cJSON* js);
int mstdnt_notification_pleroma_json(struct mstdnt_notification_pleroma* notif, cJSON* js);
int mstdnt_get_notifications(mstdnt_t* data,
int mstdnt_get_notifications(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_notifications_args* args,
struct mstdnt_storage* storage,
struct mstdnt_notification** notifs,
size_t* size);
int mstdnt_notifications_clear(mstdnt_t* data,
int mstdnt_notifications_clear(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_storage* storage);
int mstdnt_notifications_read(mstdnt_t* data,
int mstdnt_notifications_read(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_notifications_args* args,
struct mstdnt_storage* storage,
struct mstdnt_notification* notification);
int mstdnt_notification_dismiss(mstdnt_t* data,
int mstdnt_notification_dismiss(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_storage* storage,
char* id);

View file

@ -46,7 +46,7 @@ struct _mstdnt_query_param
} value;
};
char* _mstdnt_query_string(mstdnt_t* data,
char* _mstdnt_query_string(mastodont_t* data,
struct mstdnt_args* args,
char* src,
struct _mstdnt_query_param* params,

View file

@ -52,7 +52,7 @@ int mstdnt_relationships_json(struct mstdnt_relationship* relationships[],
int mstdnt_relationships_json_callback(cJSON* json, void* _args);
int mstdnt_get_relationships(mstdnt_t* data, struct mstdnt_args* args,
int mstdnt_get_relationships(mastodont_t* data, struct mstdnt_args* args,
char** ids,
size_t ids_len,
struct mstdnt_storage* storage,

View file

@ -34,7 +34,7 @@ struct mstdnt_request_args
int (*callback)(cJSON*, void*);
};
int mstdnt_request(mstdnt_t* data,
int mstdnt_request(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_request_args* args);

View file

@ -46,7 +46,7 @@ struct _mstdnt_scrobbles_cb_args
size_t* size;
};
int mstdnt_get_scrobbles(mstdnt_t* data,
int mstdnt_get_scrobbles(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_get_scrobbles_args* args,

View file

@ -54,7 +54,7 @@ int mstdnt_search_json_callback(cJSON* json, void* _args);
int mstdnt_search_json(struct mstdnt_search_results* search_results, cJSON* json);
int mstdnt_search(mstdnt_t* data,
int mstdnt_search(mastodont_t* data,
struct mstdnt_args* m_args,
char* query,
struct mstdnt_storage* storage,

View file

@ -18,11 +18,11 @@
#include "mastodont_types.h"
#include "mastodont_fetch.h"
int mstdnt_instance_panel(mstdnt_t* api,
int mstdnt_instance_panel(mastodont_t* api,
struct mstdnt_args* args,
struct mstdnt_fetch_results* html);
int mstdnt_terms_of_service(mstdnt_t* api,
int mstdnt_terms_of_service(mastodont_t* api,
struct mstdnt_args* args,
struct mstdnt_fetch_results* html);

View file

@ -113,7 +113,7 @@ void mstdnt_cleanup_statuses(struct mstdnt_status* statuses, size_t s);
void mstdnt_cleanup_status(struct mstdnt_status* status);
int mstdnt_status_json(struct mstdnt_status* status, cJSON* js);
int mstdnt_status_emoji_react(mstdnt_t* api,
int mstdnt_status_emoji_react(mastodont_t* api,
struct mstdnt_args* m_args,
char* id,
char* emoji,
@ -134,7 +134,7 @@ int mstdnt_status_context_json(struct mstdnt_status* statuses_before[],
size_t* size_after,
cJSON* js);
int mstdnt_get_account_statuses(mstdnt_t* data,
int mstdnt_get_account_statuses(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_account_statuses_args* args,
@ -142,13 +142,13 @@ int mstdnt_get_account_statuses(mstdnt_t* data,
struct mstdnt_status* statuses[],
size_t* size);
int mstdnt_get_status(mstdnt_t* data,
int mstdnt_get_status(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_storage* storage,
struct mstdnt_status* status);
int mstdnt_get_status_context(mstdnt_t* data,
int mstdnt_get_status_context(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_storage* storage,
@ -157,26 +157,26 @@ int mstdnt_get_status_context(mstdnt_t* data,
size_t* size_before,
size_t* size_after);
int mstdnt_status_favourited_by(mstdnt_t* data, struct mstdnt_args* args,
int mstdnt_status_favourited_by(mastodont_t* data, struct mstdnt_args* args,
char* id,
struct mstdnt_storage* storage,
struct mstdnt_account* accounts[],
size_t* accts);
int mstdnt_status_reblogged_by(mstdnt_t* data,
int mstdnt_status_reblogged_by(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_storage* storage,
struct mstdnt_account* accounts[],
size_t* accts);
int mstdnt_create_status(mstdnt_t* data,
int mstdnt_create_status(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_status_args* args,
struct mstdnt_storage* storage);
/* Generates do and undo functions */
#define MSTDNT_STATUS_ACTION_DECL(type) int mstdnt_##type##_status(mstdnt_t* data, struct mstdnt_args* m_args, char* id, struct mstdnt_storage* storage, struct mstdnt_status* status)
#define MSTDNT_STATUS_ACTION_DECL(type) int mstdnt_##type##_status(mastodont_t* data, struct mstdnt_args* m_args, char* id, struct mstdnt_storage* storage, struct mstdnt_status* status)
#define MSTDNT_STATUS_ACTION_FUNC_URL(action) { \
return mstdnt_status_action(data, m_args, id, storage, status, "api/v1/statuses/%s/" action); \
}
@ -191,13 +191,13 @@ MSTDNT_STATUS_ACTION_DECL(bookmark);
MSTDNT_STATUS_ACTION_DECL(unbookmark);
MSTDNT_STATUS_ACTION_DECL(delete);
int mstdnt_mute_conversation(mstdnt_t* data,
int mstdnt_mute_conversation(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_storage* storage,
struct mstdnt_status* status);
int mstdnt_unmute_conversation(mstdnt_t* data,
int mstdnt_unmute_conversation(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_storage* storage,
@ -233,14 +233,14 @@ struct mstdnt_favourites_args
int limit;
};
int mstdnt_get_bookmarks(mstdnt_t* data,
int mstdnt_get_bookmarks(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_bookmarks_args* args,
struct mstdnt_storage* storage,
struct mstdnt_status* statuses[],
size_t* size);
int mstdnt_get_favourites(mstdnt_t* data,
int mstdnt_get_favourites(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_favourites_args* args,
struct mstdnt_storage* storage,

View file

@ -40,14 +40,14 @@ struct mstdnt_timeline_args
int with_muted;
};
int mstdnt_timeline_home(mstdnt_t* data,
int mstdnt_timeline_home(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_timeline_args* args,
struct mstdnt_storage* storage,
struct mstdnt_status* statuses[],
size_t* size);
int mstdnt_timeline_list(mstdnt_t* data,
int mstdnt_timeline_list(mastodont_t* data,
struct mstdnt_args* m_args,
char* list_id,
struct mstdnt_timeline_args* args,
@ -55,21 +55,21 @@ int mstdnt_timeline_list(mstdnt_t* data,
struct mstdnt_status* statuses[],
size_t* size);
int mstdnt_timeline_public(mstdnt_t* data,
int mstdnt_timeline_public(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_timeline_args* args,
struct mstdnt_storage* storage,
struct mstdnt_status* statuses[],
size_t* statuses_size);
int mstdnt_timeline_direct(mstdnt_t* data,
int mstdnt_timeline_direct(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_timeline_args* args,
struct mstdnt_storage* storage,
struct mstdnt_status* statuses[],
size_t* statuses_size);
int mstdnt_timeline_tag(mstdnt_t* data,
int mstdnt_timeline_tag(mastodont_t* data,
struct mstdnt_args* m_args,
char* hashtag,
struct mstdnt_timeline_args* args,

View file

@ -36,7 +36,7 @@ typedef int8_t mstdnt_bool;
typedef struct mstdnt
{
CURLM* curl;
} mstdnt_t;
} mastodont_t;
struct mstdnt_storage
{

View file

@ -55,7 +55,7 @@ int mstdnt_accounts_json_callback(cJSON* json, void* _args)
}
static int mstdnt_get_accounts_query(char* url,
mstdnt_t* data,
mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_account_args* args,
struct mstdnt_storage* storage,
@ -90,7 +90,7 @@ static int mstdnt_get_accounts_query(char* url,
return mstdnt_request(data, m_args, &req_args);
}
int mstdnt_get_followers(mstdnt_t* data,
int mstdnt_get_followers(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_account_args* args,
@ -103,7 +103,7 @@ int mstdnt_get_followers(mstdnt_t* data,
return mstdnt_get_accounts_query(url, data, m_args, args, storage, accts, accts_len);
}
int mstdnt_get_following(mstdnt_t* data,
int mstdnt_get_following(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_account_args* args,
@ -116,7 +116,7 @@ int mstdnt_get_following(mstdnt_t* data,
return mstdnt_get_accounts_query(url, data, m_args, args, storage, accts, accts_len);
}
int mstdnt_get_blocks(mstdnt_t* data, struct mstdnt_args* m_args,
int mstdnt_get_blocks(mastodont_t* data, struct mstdnt_args* m_args,
struct mstdnt_account_args* args,
struct mstdnt_storage* storage,
struct mstdnt_account* accts[],
@ -125,7 +125,7 @@ int mstdnt_get_blocks(mstdnt_t* data, struct mstdnt_args* m_args,
return mstdnt_get_accounts_query("api/v1/blocks", data, m_args, args, storage, accts, accts_len);
}
int mstdnt_get_mutes(mstdnt_t* data, struct mstdnt_args* m_args,
int mstdnt_get_mutes(mastodont_t* data, struct mstdnt_args* m_args,
struct mstdnt_account_args* args,
struct mstdnt_storage* storage,
struct mstdnt_account* accts[],
@ -134,7 +134,7 @@ int mstdnt_get_mutes(mstdnt_t* data, struct mstdnt_args* m_args,
return mstdnt_get_accounts_query("api/v1/mutes", data, m_args, args, storage, accts, accts_len);
}
int mstdnt_get_account(mstdnt_t* data,
int mstdnt_get_account(mastodont_t* data,
struct mstdnt_args* m_args,
int lookup, /* TODO move into separate function for consistancy? */
char* id,
@ -161,7 +161,7 @@ int mstdnt_get_account(mstdnt_t* data,
return mstdnt_request(data, m_args, &req_args);
}
int mstdnt_verify_credentials(mstdnt_t* data,
int mstdnt_verify_credentials(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_account* acct,
struct mstdnt_storage* storage)
@ -223,7 +223,7 @@ int mstdnt_account_json(struct mstdnt_account* acct, cJSON* js)
}
int mstdnt_account_action(mstdnt_t* data,
int mstdnt_account_action(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_storage* storage,

View file

@ -87,7 +87,7 @@ void _mstdnt_val_malloc_application_call(cJSON* v, void* _type)
mstdnt_app_json(v->child, *type);
}
int mstdnt_register_app(mstdnt_t* data,
int mstdnt_register_app(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_application_args* args,
struct mstdnt_storage* storage,
@ -114,7 +114,7 @@ int mstdnt_register_app(mstdnt_t* data,
return mstdnt_request(data, m_args, &req_args);
}
int mstdnt_obtain_oauth_token(mstdnt_t* data,
int mstdnt_obtain_oauth_token(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_application_args* args,
struct mstdnt_storage* storage,

View file

@ -99,7 +99,7 @@ static int mstdnt_attachment_json_callback(cJSON* json, void* _args)
return mstdnt_attachment_json(json, _args);
}
int mstdnt_upload_media(mstdnt_t* api,
int mstdnt_upload_media(mastodont_t* api,
struct mstdnt_args* m_args,
struct mstdnt_upload_media_args* args,
struct mstdnt_storage* storage,

View file

@ -105,7 +105,7 @@ static int mstdnt_messages_json_callback(cJSON* json, void* _args)
return mstdnt_messages_json(args->messages, args->messages_len, json);
}
int mstdnt_get_chats_v2(mstdnt_t* data,
int mstdnt_get_chats_v2(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_chats_args* args,
struct mstdnt_storage* storage,
@ -138,7 +138,7 @@ int mstdnt_get_chats_v2(mstdnt_t* data,
return mstdnt_request(data, m_args, &req_args);
}
int mstdnt_get_chat_messages(mstdnt_t* data,
int mstdnt_get_chat_messages(mastodont_t* data,
struct mstdnt_args* m_args,
char* chat_id,
struct mstdnt_chats_args* args,
@ -175,7 +175,7 @@ int mstdnt_get_chat_messages(mstdnt_t* data,
return mstdnt_request(data, m_args, &req_args);
}
int mstdnt_get_chat(mstdnt_t* data,
int mstdnt_get_chat(mastodont_t* data,
struct mstdnt_args* m_args,
char* chat_id,
struct mstdnt_storage* storage,

View file

@ -46,7 +46,7 @@ void mstdnt_fetch_results_cleanup(struct mstdnt_fetch_results* res)
}
#define TOKEN_STR_SIZE 512
int mstdnt_fetch_curl(mstdnt_t* mstdnt,
int mstdnt_fetch_curl(mastodont_t* mstdnt,
CURL* curl,
struct mstdnt_args* m_args,
char* _url,

View file

@ -15,7 +15,7 @@
#include <mastodont_instance.h>
int mstdnt_instance(mstdnt_t* api, struct mstdnt_args* args,
int mstdnt_instance(mastodont_t* api, struct mstdnt_args* args,
struct mstdnt_instance* inst)
{
return -1;

View file

@ -73,7 +73,7 @@ static int mstdnt_lists_json_callback(cJSON* json, void* _args)
return mstdnt_lists_json(args->lists, args->size, json);
}
int mstdnt_get_lists(mstdnt_t* data,
int mstdnt_get_lists(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_storage* storage,
struct mstdnt_list* lists[],
@ -98,7 +98,7 @@ int mstdnt_get_lists(mstdnt_t* data,
return mstdnt_request(data, m_args, &req_args);
}
int mstdnt_get_list(mstdnt_t* data,
int mstdnt_get_list(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_storage* storage,
@ -135,7 +135,7 @@ static const char* replies_policy_str(enum mstdnt_list_replies_policy pol)
}
}
int mstdnt_create_list(mstdnt_t* data, struct mstdnt_args* m_args,
int mstdnt_create_list(mastodont_t* data, struct mstdnt_args* m_args,
struct mstdnt_list_args* args,
struct mstdnt_storage* storage,
struct mstdnt_list* list)
@ -159,7 +159,7 @@ int mstdnt_create_list(mstdnt_t* data, struct mstdnt_args* m_args,
return mstdnt_request(data, m_args,&req_args);
}
int mstdnt_update_list(mstdnt_t* data,
int mstdnt_update_list(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_list_args* args,
@ -188,7 +188,7 @@ int mstdnt_update_list(mstdnt_t* data,
return mstdnt_request(data, m_args, &req_args);
}
int mstdnt_delete_list(mstdnt_t* api,
int mstdnt_delete_list(mastodont_t* api,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_storage* storage)
@ -210,7 +210,7 @@ int mstdnt_delete_list(mstdnt_t* api,
return mstdnt_request(api, m_args, &req_args);
}
int mstdnt_list_add_accounts(mstdnt_t* api,
int mstdnt_list_add_accounts(mastodont_t* api,
struct mstdnt_args* m_args,
char* id,
char** account_ids,
@ -243,7 +243,7 @@ int mstdnt_list_add_accounts(mstdnt_t* api,
return mstdnt_request(api, m_args, &req_args);
}
int mstdnt_list_remove_accounts(mstdnt_t* api,
int mstdnt_list_remove_accounts(mastodont_t* api,
struct mstdnt_args* m_args,
char* id,
char** account_ids,
@ -276,7 +276,7 @@ int mstdnt_list_remove_accounts(mstdnt_t* api,
return mstdnt_request(api, m_args, &req_args);
}
int mstdnt_list_get_accounts(mstdnt_t* data,
int mstdnt_list_get_accounts(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_account_args* args,

View file

@ -14,13 +14,13 @@ void mstdnt_global_curl_cleanup()
}
// Curl multi can still be used with single context's
int mstdnt_init(mstdnt_t* data)
int mstdnt_init(mastodont_t* data)
{
data->curl = curl_multi_init();
return data->curl == NULL;
}
void mstdnt_cleanup(mstdnt_t* data)
void mstdnt_cleanup(mastodont_t* data)
{
curl_multi_cleanup(data->curl);
}

View file

@ -95,7 +95,7 @@ int mstdnt_nodeinfo_json_callback(cJSON* json, void* nodeinfo)
return mstdnt_nodeinfo_json(nodeinfo, json);
}
int mstdnt_get_nodeinfo(mstdnt_t* api,
int mstdnt_get_nodeinfo(mastodont_t* api,
struct mstdnt_args* m_args,
char* version,
struct mstdnt_storage* storage,

View file

@ -114,7 +114,7 @@ int mstdnt_notifications_json_callback(cJSON* json, void* _args)
return mstdnt_notifications_json(args->notif, args->size, json);
}
int mstdnt_get_notifications(mstdnt_t* data,
int mstdnt_get_notifications(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_notifications_args* args,
struct mstdnt_storage* storage,
@ -159,7 +159,7 @@ int mstdnt_get_notifications(mstdnt_t* data,
return mstdnt_request(data, m_args, &req_args);
}
int mstdnt_notification_dismiss(mstdnt_t* data,
int mstdnt_notification_dismiss(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_storage* storage,
char* id)
@ -181,7 +181,7 @@ int mstdnt_notification_dismiss(mstdnt_t* data,
return mstdnt_request(data, m_args, &req_args);
}
int mstdnt_notifications_clear(mstdnt_t* data,
int mstdnt_notifications_clear(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_storage* storage)
{
@ -199,7 +199,7 @@ int mstdnt_notifications_clear(mstdnt_t* data,
return mstdnt_request(data, m_args, &req_args);
}
int mstdnt_notifications_read(mstdnt_t* data,
int mstdnt_notifications_read(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_notifications_args* args,
struct mstdnt_storage* storage,

View file

@ -21,7 +21,7 @@
#define CONV_SIZE 64
/* TODO audit this function for overflows */
char* _mstdnt_query_string(mstdnt_t* data,
char* _mstdnt_query_string(mastodont_t* data,
struct mstdnt_args* args,
char* src,
struct _mstdnt_query_param* params,

View file

@ -97,7 +97,7 @@ int mstdnt_relationships_json_callback(cJSON* json, void* _args)
return mstdnt_relationships_json(args->relationships, args->size, json);
}
int mstdnt_get_relationships(mstdnt_t* data, struct mstdnt_args* m_args,
int mstdnt_get_relationships(mastodont_t* data, struct mstdnt_args* m_args,
char** ids,
size_t ids_len,
struct mstdnt_storage* storage,

View file

@ -71,7 +71,7 @@ static void mime_params_post(curl_mime* mime,
}
int mstdnt_request(mstdnt_t* data,
int mstdnt_request(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_request_args* args)
{

View file

@ -52,7 +52,7 @@ int mstdnt_scrobbles_json_callback(cJSON* json, void* _args)
return mstdnt_scrobbles_json(args->scrobbles, args->size, json);
}
int mstdnt_get_scrobbles(mstdnt_t* data,
int mstdnt_get_scrobbles(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_get_scrobbles_args* args,

View file

@ -61,7 +61,7 @@ int mstdnt_search_json_callback(cJSON* json, void* _args)
return mstdnt_search_json(_args, json);
}
int mstdnt_search(mstdnt_t* data,
int mstdnt_search(mastodont_t* data,
struct mstdnt_args* m_args,
char* query,
struct mstdnt_storage* storage,

View file

@ -16,7 +16,7 @@
#include <mastodont_static.h>
#include <mastodont_fetch.h>
int mstdnt_instance_panel(mstdnt_t* api,
int mstdnt_instance_panel(mastodont_t* api,
struct mstdnt_args* m_args,
struct mstdnt_fetch_results* html)
{
@ -32,7 +32,7 @@ int mstdnt_instance_panel(mstdnt_t* api,
return status;
}
int mstdnt_terms_of_service(mstdnt_t* api,
int mstdnt_terms_of_service(mastodont_t* api,
struct mstdnt_args* m_args,
struct mstdnt_fetch_results* html)
{

View file

@ -145,7 +145,7 @@ int mstdnt_statuses_json_callback(cJSON* json, void* _args)
return mstdnt_statuses_json(args->statuses, args->size, json);
}
int mstdnt_get_account_statuses(mstdnt_t* data,
int mstdnt_get_account_statuses(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_account_statuses_args* args,
@ -186,7 +186,7 @@ int mstdnt_get_account_statuses(mstdnt_t* data,
}
/* TODO Populate the arguments! */
int mstdnt_create_status(mstdnt_t* data,
int mstdnt_create_status(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_status_args* args,
struct mstdnt_storage* storage)
@ -219,7 +219,7 @@ int mstdnt_create_status(mstdnt_t* data,
return mstdnt_request(data, m_args, &req_args);
}
static int mstdnt_status_action(mstdnt_t* data,
static int mstdnt_status_action(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_storage* storage,
@ -289,7 +289,7 @@ MSTDNT_STATUS_ACTION_DECL(delete)
}
/* TODO Mutes can be timed */
int mstdnt_mute_conversation(mstdnt_t* data,
int mstdnt_mute_conversation(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_storage* storage,
@ -298,7 +298,7 @@ int mstdnt_mute_conversation(mstdnt_t* data,
return mstdnt_status_action(data, m_args, id, storage, status, "api/v1/statuses/%s/mute");
}
int mstdnt_unmute_conversation(mstdnt_t* data,
int mstdnt_unmute_conversation(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_storage* storage,
@ -307,7 +307,7 @@ int mstdnt_unmute_conversation(mstdnt_t* data,
return mstdnt_status_action(data, m_args, id, storage, status, "api/v1/statuses/%s/unmute");
}
int mstdnt_get_status(mstdnt_t* data,
int mstdnt_get_status(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_storage* storage,
@ -389,7 +389,7 @@ int mstdnt_status_context_json_callback(cJSON* json, void* _args)
json);
}
int mstdnt_get_status_context(mstdnt_t* data,
int mstdnt_get_status_context(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_storage* storage,
@ -421,7 +421,7 @@ int mstdnt_get_status_context(mstdnt_t* data,
return mstdnt_request(data, m_args, &req_args);
}
int mstdnt_status_favourited_by(mstdnt_t* data,
int mstdnt_status_favourited_by(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_storage* storage,
@ -449,7 +449,7 @@ int mstdnt_status_favourited_by(mstdnt_t* data,
return mstdnt_request(data, m_args, &req_args);
}
int mstdnt_status_reblogged_by(mstdnt_t* data,
int mstdnt_status_reblogged_by(mastodont_t* data,
struct mstdnt_args* m_args,
char* id,
struct mstdnt_storage* storage,
@ -478,7 +478,7 @@ int mstdnt_status_reblogged_by(mstdnt_t* data,
}
int mstdnt_get_bookmarks(mstdnt_t* data,
int mstdnt_get_bookmarks(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_bookmarks_args* args,
struct mstdnt_storage* storage,
@ -508,7 +508,7 @@ int mstdnt_get_bookmarks(mstdnt_t* data,
return mstdnt_request(data, m_args, &req_args);
}
int mstdnt_get_favourites(mstdnt_t* data,
int mstdnt_get_favourites(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_favourites_args* args,
struct mstdnt_storage* storage,
@ -537,7 +537,7 @@ int mstdnt_get_favourites(mstdnt_t* data,
return mstdnt_request(data, m_args, &req_args);
}
int mstdnt_status_emoji_react(mstdnt_t* api,
int mstdnt_status_emoji_react(mastodont_t* api,
struct mstdnt_args* m_args,
char* id,
char* emoji,

View file

@ -20,7 +20,7 @@
#include <mastodont_query.h>
#include <mastodont_request.h>
int mstdnt_timeline_list(mstdnt_t* data,
int mstdnt_timeline_list(mastodont_t* data,
struct mstdnt_args* m_args,
char* list_id,
struct mstdnt_timeline_args* args,
@ -59,7 +59,7 @@ int mstdnt_timeline_list(mstdnt_t* data,
return mstdnt_request(data, m_args, &req_args);
}
int mstdnt_timeline_tag(mstdnt_t* data,
int mstdnt_timeline_tag(mastodont_t* data,
struct mstdnt_args* m_args,
char* hashtag,
struct mstdnt_timeline_args* args,
@ -115,7 +115,7 @@ static const char* reply_visibility_str(enum mstdnt_reply_visibility vis)
}
}
int mstdnt_timeline_public(mstdnt_t* data,
int mstdnt_timeline_public(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_timeline_args* args,
struct mstdnt_storage* storage,
@ -152,7 +152,7 @@ int mstdnt_timeline_public(mstdnt_t* data,
}
int mstdnt_timeline_direct(mstdnt_t* data,
int mstdnt_timeline_direct(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_timeline_args* args,
struct mstdnt_storage* storage,
@ -185,7 +185,7 @@ int mstdnt_timeline_direct(mstdnt_t* data,
}
int mstdnt_timeline_home(mstdnt_t* data,
int mstdnt_timeline_home(mastodont_t* data,
struct mstdnt_args* m_args,
struct mstdnt_timeline_args* args,
struct mstdnt_storage* storage,