diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-07-05 10:31:29 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-07-05 23:09:28 +0000 |
commit | 8739f7fccb7cafc54ca0f5fa074c9a740f7048ba (patch) | |
tree | 88e9f53fa6e734cd8095487d1896c56f844c782c /toxcore/tox.h | |
parent | 64d0297acc7d6a1697683052e15cc76383312c38 (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.h | 36 |
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 | ||
2979 | typedef TOX_ERR_OPTIONS_NEW Tox_Err_Options_New; | ||
2980 | typedef TOX_ERR_NEW Tox_Err_New; | ||
2981 | typedef TOX_ERR_BOOTSTRAP Tox_Err_Bootstrap; | ||
2982 | typedef TOX_ERR_SET_INFO Tox_Err_Set_Info; | ||
2983 | typedef TOX_ERR_FRIEND_ADD Tox_Err_Friend_Add; | ||
2984 | typedef TOX_ERR_FRIEND_DELETE Tox_Err_Friend_Delete; | ||
2985 | typedef TOX_ERR_FRIEND_BY_PUBLIC_KEY Tox_Err_Friend_By_Public_Key; | ||
2986 | typedef TOX_ERR_FRIEND_GET_PUBLIC_KEY Tox_Err_Friend_Get_Public_Key; | ||
2987 | typedef TOX_ERR_FRIEND_GET_LAST_ONLINE Tox_Err_Friend_Get_Last_Online; | ||
2988 | typedef TOX_ERR_FRIEND_QUERY Tox_Err_Friend_Query; | ||
2989 | typedef TOX_ERR_SET_TYPING Tox_Err_Set_Typing; | ||
2990 | typedef TOX_ERR_FRIEND_SEND_MESSAGE Tox_Err_Friend_Send_Message; | ||
2991 | typedef TOX_ERR_FILE_CONTROL Tox_Err_File_Control; | ||
2992 | typedef TOX_ERR_FILE_SEEK Tox_Err_File_Seek; | ||
2993 | typedef TOX_ERR_FILE_GET Tox_Err_File_Get; | ||
2994 | typedef TOX_ERR_FILE_SEND Tox_Err_File_Send; | ||
2995 | typedef TOX_ERR_FILE_SEND_CHUNK Tox_Err_File_Send_Chunk; | ||
2996 | typedef TOX_ERR_CONFERENCE_NEW Tox_Err_Conference_New; | ||
2997 | typedef TOX_ERR_CONFERENCE_DELETE Tox_Err_Conference_Delete; | ||
2998 | typedef TOX_ERR_CONFERENCE_PEER_QUERY Tox_Err_Conference_Peer_Query; | ||
2999 | typedef TOX_ERR_CONFERENCE_INVITE Tox_Err_Conference_Invite; | ||
3000 | typedef TOX_ERR_CONFERENCE_JOIN Tox_Err_Conference_Join; | ||
3001 | typedef TOX_ERR_CONFERENCE_SEND_MESSAGE Tox_Err_Conference_Send_Message; | ||
3002 | typedef TOX_ERR_CONFERENCE_TITLE Tox_Err_Conference_Title; | ||
3003 | typedef TOX_ERR_CONFERENCE_GET_TYPE Tox_Err_Conference_Get_Type; | ||
3004 | typedef TOX_ERR_FRIEND_CUSTOM_PACKET Tox_Err_Friend_Custom_Packet; | ||
3005 | typedef TOX_ERR_GET_PORT Tox_Err_Get_Port; | ||
3006 | typedef TOX_USER_STATUS Tox_User_Status; | ||
3007 | typedef TOX_MESSAGE_TYPE Tox_Message_Type; | ||
3008 | typedef TOX_PROXY_TYPE Tox_Proxy_Type; | ||
3009 | typedef TOX_SAVEDATA_TYPE Tox_Savedata_Type; | ||
3010 | typedef TOX_LOG_LEVEL Tox_Log_Level; | ||
3011 | typedef TOX_CONNECTION Tox_Connection; | ||
3012 | typedef TOX_FILE_CONTROL Tox_File_Control; | ||
3013 | typedef TOX_CONFERENCE_TYPE Tox_Conference_Type; | ||
3014 | |||
2979 | #endif | 3015 | #endif |