Add .clang-format. Reformat everything.

This commit is contained in:
Håvard Pettersson 2017-02-10 19:08:26 -08:00
parent 2947cc1562
commit fa579df623
32 changed files with 994 additions and 1126 deletions

View file

@ -22,8 +22,8 @@
#include <stdbool.h>
#include <weechat/weechat-plugin.h>
#include <tox/tox.h>
#include <weechat/weechat-plugin.h>
enum t_twc_profile_option
{
@ -61,34 +61,41 @@ struct t_twc_profile
};
extern struct t_twc_list *twc_profiles;
extern struct t_config_option *twc_config_profile_default[TWC_PROFILE_NUM_OPTIONS];
extern struct t_config_option
*twc_config_profile_default[TWC_PROFILE_NUM_OPTIONS];
#define TWC_PROFILE_OPTION_BOOLEAN(profile, index) \
(!weechat_config_option_is_null(profile->options[index]) \
? weechat_config_boolean(profile->options[index]) \
: (!weechat_config_option_is_null(twc_config_profile_default[index]) \
? weechat_config_boolean(twc_config_profile_default[index]) \
: (!weechat_config_option_default_is_null(twc_config_profile_default[index]) \
? weechat_config_boolean_default(twc_config_profile_default[index]) \
: 0)))
#define TWC_PROFILE_OPTION_BOOLEAN(profile, index) \
(!weechat_config_option_is_null(profile->options[index]) \
? weechat_config_boolean(profile->options[index]) \
: (!weechat_config_option_is_null(twc_config_profile_default[index]) \
? weechat_config_boolean(twc_config_profile_default[index]) \
: (!weechat_config_option_default_is_null( \
twc_config_profile_default[index]) \
? weechat_config_boolean_default( \
twc_config_profile_default[index]) \
: 0)))
#define TWC_PROFILE_OPTION_INTEGER(profile, index) \
(!weechat_config_option_is_null(profile->options[index]) \
? weechat_config_integer(profile->options[index]) \
: (!weechat_config_option_is_null(twc_config_profile_default[index]) \
? weechat_config_integer(twc_config_profile_default[index]) \
: (!weechat_config_option_default_is_null(twc_config_profile_default[index]) \
? weechat_config_integer_default(twc_config_profile_default[index]) \
: 0)))
#define TWC_PROFILE_OPTION_INTEGER(profile, index) \
(!weechat_config_option_is_null(profile->options[index]) \
? weechat_config_integer(profile->options[index]) \
: (!weechat_config_option_is_null(twc_config_profile_default[index]) \
? weechat_config_integer(twc_config_profile_default[index]) \
: (!weechat_config_option_default_is_null( \
twc_config_profile_default[index]) \
? weechat_config_integer_default( \
twc_config_profile_default[index]) \
: 0)))
#define TWC_PROFILE_OPTION_STRING(profile, index) \
(!weechat_config_option_is_null(profile->options[index]) \
? weechat_config_string(profile->options[index]) \
: (!weechat_config_option_is_null(twc_config_profile_default[index]) \
? weechat_config_string(twc_config_profile_default[index]) \
: (!weechat_config_option_default_is_null(twc_config_profile_default[index]) \
? weechat_config_string_default(twc_config_profile_default[index]) \
: NULL)))
#define TWC_PROFILE_OPTION_STRING(profile, index) \
(!weechat_config_option_is_null(profile->options[index]) \
? weechat_config_string(profile->options[index]) \
: (!weechat_config_option_is_null(twc_config_profile_default[index]) \
? weechat_config_string(twc_config_profile_default[index]) \
: (!weechat_config_option_default_is_null( \
twc_config_profile_default[index]) \
? weechat_config_string_default( \
twc_config_profile_default[index]) \
: NULL)))
void
twc_profile_init();
@ -132,5 +139,4 @@ twc_profile_free(struct t_twc_profile *profile);
void
twc_profile_free_all();
#endif // TOX_WEECHAT_PROFILE_H
#endif /* TOX_WEECHAT_PROFILE_H */