diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-07-23 12:53:08 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-07-23 12:53:08 +0100 |
commit | fe79d8c5a39f2b717f78cc3f3ef21b3cfc46500b (patch) | |
tree | c84e6a5d4c5cd78a7a2cc3c7adbc7af5d0541682 /src/libserver/cfg_rcl.h | |
parent | e0483657ff6cf1adc828ccce457814d61fe90a0d (diff) | |
download | rspamd-fe79d8c5a39f2b717f78cc3f3ef21b3cfc46500b.tar.gz rspamd-fe79d8c5a39f2b717f78cc3f3ef21b3cfc46500b.zip |
Revert "Unify code style."
This reverts commit e0483657ff6cf1adc828ccce457814d61fe90a0d.
Diffstat (limited to 'src/libserver/cfg_rcl.h')
-rw-r--r-- | src/libserver/cfg_rcl.h | 86 |
1 files changed, 30 insertions, 56 deletions
diff --git a/src/libserver/cfg_rcl.h b/src/libserver/cfg_rcl.h index 6ba197be8..6db0b0d81 100644 --- a/src/libserver/cfg_rcl.h +++ b/src/libserver/cfg_rcl.h @@ -63,17 +63,15 @@ struct rspamd_rcl_struct_parser { * @param err error object * @return TRUE if a section has been parsed */ -typedef gboolean (*rspamd_rcl_handler_t) (struct rspamd_config *cfg, - const ucl_object_t *obj, - gpointer ud, struct rspamd_rcl_section *section, GError **err); +typedef gboolean (*rspamd_rcl_handler_t) (struct rspamd_config *cfg, const ucl_object_t *obj, + gpointer ud, struct rspamd_rcl_section *section, GError **err); /** * A handler type that is called at the end of section parsing * @param cfg configuration * @param ud user data */ -typedef void (*rspamd_rcl_section_fin_t)(struct rspamd_config *cfg, - gpointer ud); +typedef void (*rspamd_rcl_section_fin_t)(struct rspamd_config *cfg, gpointer ud); struct rspamd_rcl_default_handler_data { struct rspamd_rcl_struct_parser pd; @@ -83,12 +81,12 @@ struct rspamd_rcl_default_handler_data { }; struct rspamd_rcl_section { - const gchar *name; /**< name of section */ - rspamd_rcl_handler_t handler; /**< handler of section attributes */ - enum ucl_type type; /**< type of attribute */ - gboolean required; /**< whether this param is required */ - gboolean strict_type; /**< whether we need strict type */ - UT_hash_handle hh; /** hash handle */ + const gchar *name; /**< name of section */ + rspamd_rcl_handler_t handler; /**< handler of section attributes */ + enum ucl_type type; /**< type of attribute */ + gboolean required; /**< whether this param is required */ + gboolean strict_type; /**< whether we need strict type */ + UT_hash_handle hh; /** hash handle */ struct rspamd_rcl_section *subsections; /**< hash table of subsections */ struct rspamd_rcl_default_handler_data *default_parser; /**< generic parsing fields */ rspamd_rcl_section_fin_t fin; /** called at the end of section parsing */ @@ -99,7 +97,7 @@ struct rspamd_rcl_section { * Init common sections known to rspamd * @return top section */ -struct rspamd_rcl_section * rspamd_rcl_config_init (void); +struct rspamd_rcl_section* rspamd_rcl_config_init (void); /** * Get a section specified by path, it understand paths separated by '/' character @@ -107,9 +105,8 @@ struct rspamd_rcl_section * rspamd_rcl_config_init (void); * @param path '/' divided path * @return */ -struct rspamd_rcl_section * rspamd_rcl_config_get_section ( - struct rspamd_rcl_section *top, - const char *path); +struct rspamd_rcl_section *rspamd_rcl_config_get_section (struct rspamd_rcl_section *top, + const char *path); /** * Read RCL configuration and parse it to a config file @@ -119,7 +116,7 @@ struct rspamd_rcl_section * rspamd_rcl_config_get_section ( * @return TRUE if an object can be parsed */ gboolean rspamd_read_rcl_config (struct rspamd_rcl_section *top, - struct rspamd_config *cfg, const ucl_object_t *obj, GError **err); + struct rspamd_config *cfg, const ucl_object_t *obj, GError **err); /** @@ -132,8 +129,8 @@ gboolean rspamd_read_rcl_config (struct rspamd_rcl_section *top, * @return TRUE if the object has been parsed */ gboolean rspamd_rcl_section_parse_defaults (struct rspamd_rcl_section *section, - struct rspamd_config *cfg, const ucl_object_t *obj, gpointer ptr, - GError **err); + struct rspamd_config *cfg, const ucl_object_t *obj, gpointer ptr, + GError **err); /** * Here is a section of common handlers that accepts rcl_struct_parser * which itself contains a struct pointer and the offset of a member in a @@ -149,11 +146,8 @@ gboolean rspamd_rcl_section_parse_defaults (struct rspamd_rcl_section *section, * @param err error pointer * @return TRUE if a string value has been successfully parsed */ -gboolean rspamd_rcl_parse_struct_string (struct rspamd_config *cfg, - const ucl_object_t *obj, - gpointer ud, - struct rspamd_rcl_section *section, - GError **err); +gboolean rspamd_rcl_parse_struct_string (struct rspamd_config *cfg, const ucl_object_t *obj, + gpointer ud, struct rspamd_rcl_section *section, GError **err); /** * Parse an integer field of a structure @@ -164,11 +158,8 @@ gboolean rspamd_rcl_parse_struct_string (struct rspamd_config *cfg, * @param err error pointer * @return TRUE if a value has been successfully parsed */ -gboolean rspamd_rcl_parse_struct_integer (struct rspamd_config *cfg, - const ucl_object_t *obj, - gpointer ud, - struct rspamd_rcl_section *section, - GError **err); +gboolean rspamd_rcl_parse_struct_integer (struct rspamd_config *cfg, const ucl_object_t *obj, + gpointer ud, struct rspamd_rcl_section *section, GError **err); /** @@ -180,11 +171,8 @@ gboolean rspamd_rcl_parse_struct_integer (struct rspamd_config *cfg, * @param err error pointer * @return TRUE if a value has been successfully parsed */ -gboolean rspamd_rcl_parse_struct_double (struct rspamd_config *cfg, - const ucl_object_t *obj, - gpointer ud, - struct rspamd_rcl_section *section, - GError **err); +gboolean rspamd_rcl_parse_struct_double (struct rspamd_config *cfg, const ucl_object_t *obj, + gpointer ud, struct rspamd_rcl_section *section, GError **err); /** * Parse a time field of a structure @@ -195,11 +183,8 @@ gboolean rspamd_rcl_parse_struct_double (struct rspamd_config *cfg, * @param err error pointer * @return TRUE if a value has been successfully parsed */ -gboolean rspamd_rcl_parse_struct_time (struct rspamd_config *cfg, - const ucl_object_t *obj, - gpointer ud, - struct rspamd_rcl_section *section, - GError **err); +gboolean rspamd_rcl_parse_struct_time (struct rspamd_config *cfg, const ucl_object_t *obj, + gpointer ud, struct rspamd_rcl_section *section, GError **err); /** * Parse a string list field of a structure presented by a GList* object @@ -210,11 +195,8 @@ gboolean rspamd_rcl_parse_struct_time (struct rspamd_config *cfg, * @param err error pointer * @return TRUE if a value has been successfully parsed */ -gboolean rspamd_rcl_parse_struct_string_list (struct rspamd_config *cfg, - const ucl_object_t *obj, - gpointer ud, - struct rspamd_rcl_section *section, - GError **err); +gboolean rspamd_rcl_parse_struct_string_list (struct rspamd_config *cfg, const ucl_object_t *obj, + gpointer ud, struct rspamd_rcl_section *section, GError **err); /** * Parse a boolean field of a structure @@ -225,11 +207,8 @@ gboolean rspamd_rcl_parse_struct_string_list (struct rspamd_config *cfg, * @param err error pointer * @return TRUE if a value has been successfully parsed */ -gboolean rspamd_rcl_parse_struct_boolean (struct rspamd_config *cfg, - const ucl_object_t *obj, - gpointer ud, - struct rspamd_rcl_section *section, - GError **err); +gboolean rspamd_rcl_parse_struct_boolean (struct rspamd_config *cfg, const ucl_object_t *obj, + gpointer ud, struct rspamd_rcl_section *section, GError **err); /** * Utility functions @@ -244,13 +223,8 @@ gboolean rspamd_rcl_parse_struct_boolean (struct rspamd_config *cfg, * @param target opaque target structure * @param offset offset inside a structure */ -void rspamd_rcl_register_worker_option (struct rspamd_config *cfg, - gint type, - const gchar *name, - rspamd_rcl_handler_t handler, - gpointer target, - gsize offset, - gint flags); +void rspamd_rcl_register_worker_option (struct rspamd_config *cfg, gint type, const gchar *name, + rspamd_rcl_handler_t handler, gpointer target, gsize offset, gint flags); /** * Regiester a default parser for a worker @@ -260,5 +234,5 @@ void rspamd_rcl_register_worker_option (struct rspamd_config *cfg, * @param ud userdata for handler function */ void rspamd_rcl_register_worker_parser (struct rspamd_config *cfg, gint type, - gboolean (*func)(ucl_object_t *, gpointer), gpointer ud); + gboolean (*func)(ucl_object_t *, gpointer), gpointer ud); #endif /* CFG_RCL_H_ */ |