summaryrefslogtreecommitdiff
path: root/toxcore/tox.h
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-07-05 10:31:29 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-07-05 23:09:28 +0000
commit8739f7fccb7cafc54ca0f5fa074c9a740f7048ba (patch)
tree88e9f53fa6e734cd8095487d1896c56f844c782c /toxcore/tox.h
parent64d0297acc7d6a1697683052e15cc76383312c38 (diff)
Make tox.c unambiguously parseable.
Rules: 1. Constants are uppercase names: THE_CONSTANT. 2. SUE[1] types start with an uppercase letter and have at least one lowercase letter in it: The_Type, THE_Type. 3. Function types end in "_cb": tox_friend_connection_cb. 4. Variable and function names are all lowercase: the_function. This makes it easier for humans reading the code to determine what an identifier means. I'm not convinced by the enum type name change, but I don't know a better rule. Currently, a lot of enum types are spelled like constants, which is confusing. [1] struct/union/enum
Diffstat (limited to 'toxcore/tox.h')
-rw-r--r--toxcore/tox.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/toxcore/tox.h b/toxcore/tox.h
index 45ebf176..faf4e559 100644
--- a/toxcore/tox.h
+++ b/toxcore/tox.h
@@ -2976,4 +2976,40 @@ uint16_t tox_self_get_tcp_port(const Tox *tox, TOX_ERR_GET_PORT *error);
2976} 2976}
2977#endif 2977#endif
2978 2978
2979typedef TOX_ERR_OPTIONS_NEW Tox_Err_Options_New;
2980typedef TOX_ERR_NEW Tox_Err_New;
2981typedef TOX_ERR_BOOTSTRAP Tox_Err_Bootstrap;
2982typedef TOX_ERR_SET_INFO Tox_Err_Set_Info;
2983typedef TOX_ERR_FRIEND_ADD Tox_Err_Friend_Add;
2984typedef TOX_ERR_FRIEND_DELETE Tox_Err_Friend_Delete;
2985typedef TOX_ERR_FRIEND_BY_PUBLIC_KEY Tox_Err_Friend_By_Public_Key;
2986typedef TOX_ERR_FRIEND_GET_PUBLIC_KEY Tox_Err_Friend_Get_Public_Key;
2987typedef TOX_ERR_FRIEND_GET_LAST_ONLINE Tox_Err_Friend_Get_Last_Online;
2988typedef TOX_ERR_FRIEND_QUERY Tox_Err_Friend_Query;
2989typedef TOX_ERR_SET_TYPING Tox_Err_Set_Typing;
2990typedef TOX_ERR_FRIEND_SEND_MESSAGE Tox_Err_Friend_Send_Message;
2991typedef TOX_ERR_FILE_CONTROL Tox_Err_File_Control;
2992typedef TOX_ERR_FILE_SEEK Tox_Err_File_Seek;
2993typedef TOX_ERR_FILE_GET Tox_Err_File_Get;
2994typedef TOX_ERR_FILE_SEND Tox_Err_File_Send;
2995typedef TOX_ERR_FILE_SEND_CHUNK Tox_Err_File_Send_Chunk;
2996typedef TOX_ERR_CONFERENCE_NEW Tox_Err_Conference_New;
2997typedef TOX_ERR_CONFERENCE_DELETE Tox_Err_Conference_Delete;
2998typedef TOX_ERR_CONFERENCE_PEER_QUERY Tox_Err_Conference_Peer_Query;
2999typedef TOX_ERR_CONFERENCE_INVITE Tox_Err_Conference_Invite;
3000typedef TOX_ERR_CONFERENCE_JOIN Tox_Err_Conference_Join;
3001typedef TOX_ERR_CONFERENCE_SEND_MESSAGE Tox_Err_Conference_Send_Message;
3002typedef TOX_ERR_CONFERENCE_TITLE Tox_Err_Conference_Title;
3003typedef TOX_ERR_CONFERENCE_GET_TYPE Tox_Err_Conference_Get_Type;
3004typedef TOX_ERR_FRIEND_CUSTOM_PACKET Tox_Err_Friend_Custom_Packet;
3005typedef TOX_ERR_GET_PORT Tox_Err_Get_Port;
3006typedef TOX_USER_STATUS Tox_User_Status;
3007typedef TOX_MESSAGE_TYPE Tox_Message_Type;
3008typedef TOX_PROXY_TYPE Tox_Proxy_Type;
3009typedef TOX_SAVEDATA_TYPE Tox_Savedata_Type;
3010typedef TOX_LOG_LEVEL Tox_Log_Level;
3011typedef TOX_CONNECTION Tox_Connection;
3012typedef TOX_FILE_CONTROL Tox_File_Control;
3013typedef TOX_CONFERENCE_TYPE Tox_Conference_Type;
3014
2979#endif 3015#endif