summaryrefslogtreecommitdiff
path: root/toxcore/tox_api.c
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_api.c
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_api.c')
-rw-r--r--toxcore/tox_api.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toxcore/tox_api.c b/toxcore/tox_api.c
index 31f21158..87123968 100644
--- a/toxcore/tox_api.c
+++ b/toxcore/tox_api.c
@@ -5,7 +5,7 @@
5#include <stdlib.h> 5#include <stdlib.h>
6#include <string.h> 6#include <string.h>
7 7
8#define SET_ERROR_PARAMETER(param, x) {if(param) {*param = x;}} 8#define SET_ERROR_PARAMETER(param, x) do { if (param) { *param = x; } } while (0)
9 9
10 10
11#define CONST_FUNCTION(lowercase, uppercase) \ 11#define CONST_FUNCTION(lowercase, uppercase) \