From 44638ee75c72b2dcf4fa577ddd8731ba88e1bb59 Mon Sep 17 00:00:00 2001 From: Trumeet Date: Tue, 21 Sep 2021 13:33:46 -0700 Subject: refactor: mark private functions static --- main.c | 8 ++++---- tg/tg.c | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/main.c b/main.c index 5a7433e..1c11837 100644 --- a/main.c +++ b/main.c @@ -13,7 +13,7 @@ #include #include -void *main_mc2tg(void *e) +static void *main_mc2tg(void *e) { const Environ *env = (Environ*)e; int r = 0; @@ -55,7 +55,7 @@ cleanup: return NULL; } -void *main_tg2mc(void *e) +static void *main_tg2mc(void *e) { const Environ *env = (Environ*)e; CURL *curl = curl_easy_init(); @@ -245,7 +245,7 @@ run: goto run; } -int start_threads(Environ *env) +static int start_threads(Environ *env) { int r = 0; @@ -271,7 +271,7 @@ cleanup: return r; } -int truncate_updates(Environ *env, CURL *curl) +static int truncate_updates(Environ *env, CURL *curl) { int r = 0; TGResp *resp; diff --git a/tg/tg.c b/tg/tg.c index 1701c34..95547a0 100644 --- a/tg/tg.c +++ b/tg/tg.c @@ -9,7 +9,7 @@ #include #include -void _tg_entity_parse(TGEntity *entity, json_object *json) +static void _tg_entity_parse(TGEntity *entity, json_object *json) { entity->type = NULL; entity->offset = 0; @@ -24,11 +24,11 @@ void _tg_entity_parse(TGEntity *entity, json_object *json) entity->length = json_object_get_int(obj); } -void _tg_photo_parse(TGPhoto *photo, json_object *json) +static void _tg_photo_parse(TGPhoto *photo, json_object *json) { } -TGSticker *_tg_sticker_parse(json_object *json) +static TGSticker *_tg_sticker_parse(json_object *json) { TGSticker *sticker = malloc(sizeof(TGSticker)); sticker->emoji = NULL; @@ -40,7 +40,7 @@ TGSticker *_tg_sticker_parse(json_object *json) return sticker; } -TGDocument *_tg_document_parse(json_object *json) +static TGDocument *_tg_document_parse(json_object *json) { TGDocument *document = malloc(sizeof(TGDocument)); document->file_name = NULL; @@ -51,7 +51,7 @@ TGDocument *_tg_document_parse(json_object *json) return document; } -TGChat *_tg_chat_parse(json_object *json) +static TGChat *_tg_chat_parse(json_object *json) { TGChat *chat = malloc(sizeof(TGChat)); chat->id = 0; @@ -63,7 +63,7 @@ TGChat *_tg_chat_parse(json_object *json) return chat; } -TGUser *_tg_user_parse(json_object *json) +static TGUser *_tg_user_parse(json_object *json) { TGUser *user = malloc(sizeof(TGUser)); user->id = 0; @@ -84,7 +84,7 @@ TGUser *_tg_user_parse(json_object *json) return user; } -TGMessage *_tg_message_parse(json_object *json) +static TGMessage *_tg_message_parse(json_object *json) { TGMessage *message = malloc(sizeof(TGMessage)); message->message_id = 0; @@ -142,7 +142,7 @@ TGMessage *_tg_message_parse(json_object *json) return message; } -void _tg_update_parse(TGUpdate *update, json_object *json) +static void _tg_update_parse(TGUpdate *update, json_object *json) { update->update_id = 0; update->message = NULL; @@ -156,7 +156,7 @@ void _tg_update_parse(TGUpdate *update, json_object *json) #define _TG_BASE_URL "https://api.telegram.org/bot" -int _tg_api_call( +static int _tg_api_call( CURL *curl, const char *tg_api, const char parse_body, -- cgit v1.2.3