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/group.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/group.h')
-rw-r--r-- | toxcore/group.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/toxcore/group.h b/toxcore/group.h index a81dac39..684f7972 100644 --- a/toxcore/group.h +++ b/toxcore/group.h | |||
@@ -108,6 +108,9 @@ typedef struct { | |||
108 | void (*group_on_delete)(void *, uint32_t); | 108 | void (*group_on_delete)(void *, uint32_t); |
109 | } Group_c; | 109 | } Group_c; |
110 | 110 | ||
111 | typedef void g_conference_invite_cb(Messenger *, uint32_t, int, const uint8_t *, size_t, void *); | ||
112 | typedef void g_conference_message_cb(Messenger *m, uint32_t, uint32_t, int, const uint8_t *, size_t, void *); | ||
113 | |||
111 | typedef struct { | 114 | typedef struct { |
112 | Messenger *m; | 115 | Messenger *m; |
113 | Friend_Connections *fr_c; | 116 | Friend_Connections *fr_c; |
@@ -115,8 +118,8 @@ typedef struct { | |||
115 | Group_c *chats; | 118 | Group_c *chats; |
116 | uint32_t num_chats; | 119 | uint32_t num_chats; |
117 | 120 | ||
118 | void (*invite_callback)(Messenger *m, uint32_t, int, const uint8_t *, size_t, void *); | 121 | g_conference_invite_cb *invite_callback; |
119 | void (*message_callback)(Messenger *m, uint32_t, uint32_t, int, const uint8_t *, size_t, void *); | 122 | g_conference_message_cb *message_callback; |
120 | void (*peer_name_callback)(Messenger *m, uint32_t, uint32_t, const uint8_t *, size_t, void *); | 123 | void (*peer_name_callback)(Messenger *m, uint32_t, uint32_t, const uint8_t *, size_t, void *); |
121 | void (*peer_list_changed_callback)(Messenger *m, uint32_t, void *); | 124 | void (*peer_list_changed_callback)(Messenger *m, uint32_t, void *); |
122 | void (*title_callback)(Messenger *m, uint32_t, uint32_t, const uint8_t *, size_t, void *); | 125 | void (*title_callback)(Messenger *m, uint32_t, uint32_t, const uint8_t *, size_t, void *); |