From 7f8de787946b883cc791bf6c0bcb514496caf074 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 6 Feb 2009 15:00:38 +0300 Subject: [PATCH] * Make doxygen happy about structures members --- src/cfg_file.h | 156 ++++++++++++++++++++++++------------------------ src/filter.h | 31 +++++----- src/hash.h | 23 ++----- src/main.h | 159 +++++++++++++++++++++++++------------------------ src/mem_pool.h | 52 ++++++++-------- src/message.h | 10 ++-- src/protocol.h | 9 +-- src/statfile.h | 51 ++++++++-------- 8 files changed, 242 insertions(+), 249 deletions(-) diff --git a/src/cfg_file.h b/src/cfg_file.h index b80f4081c..a7ad3eaaf 100644 --- a/src/cfg_file.h +++ b/src/cfg_file.h @@ -1,8 +1,8 @@ -/* - * $Id$ +/** + * @file cfg_file.h + * Config file parser and config routines API */ - #ifndef CFG_FILE_H #define CFG_FILE_H @@ -72,37 +72,37 @@ enum rspamd_log_type { * Regexp structure */ struct rspamd_regexp { - enum rspamd_regexp_type type; /** < regexp type */ - char *regexp_text; /** < regexp text representation */ - GRegex *regexp; /** < glib regexp structure */ - char *header; /** < header name for header regexps */ + enum rspamd_regexp_type type; /**< regexp type */ + char *regexp_text; /**< regexp text representation */ + GRegex *regexp; /**< glib regexp structure */ + char *header; /**< header name for header regexps */ }; /** * Memcached server object */ struct memcached_server { - struct upstream up; /** < common upstream base */ - struct in_addr addr; /** < address of server */ - uint16_t port; /** < port to connect */ - short alive; /** < is this server alive */ - short int num; /** < number of servers in case of mirror */ + struct upstream up; /**< common upstream base */ + struct in_addr addr; /**< address of server */ + uint16_t port; /**< port to connect */ + short alive; /**< is this server alive */ + short int num; /**< number of servers in case of mirror */ }; /** * Perl module list item */ struct perl_module { - char *path; /** < path to module */ - LIST_ENTRY (perl_module) next; /** < chain link */ + char *path; /**< path to module */ + LIST_ENTRY (perl_module) next; /**< chain link */ }; /** * Module option */ struct module_opt { - char *param; /** < parameter name */ - char *value; /** < paramater value */ + char *param; /**< parameter name */ + char *value; /**< paramater value */ LIST_ENTRY (module_opt) next; }; @@ -110,85 +110,85 @@ struct module_opt { * Statfile config definition */ struct statfile { - char *alias; /** < alias of statfile */ - char *pattern; /** < filesystem pattern (with %r or %f) */ - double weight; /** < weight scale */ - char *metric; /** < metric name */ - size_t size; /** < size of statfile */ - struct tokenizer *tokenizer; /** < tokenizer used for statfile */ + char *alias; /**< alias of statfile */ + char *pattern; /**< filesystem pattern (with %r or %f) */ + double weight; /**< weight scale */ + char *metric; /**< metric name */ + size_t size; /**< size of statfile */ + struct tokenizer *tokenizer; /**< tokenizer used for statfile */ }; /** * Config option for importing to perl module */ struct config_scalar { - void *pointer; /** < pointer to data */ + void *pointer; /**< pointer to data */ enum { SCALAR_TYPE_INT, SCALAR_TYPE_UINT, SCALAR_TYPE_STR, SCALAR_TYPE_SIZE, - } type; /** < type of data */ + } type; /**< type of data */ }; /** * Structure that stores all config data */ struct config_file { - memory_pool_t *cfg_pool; /** < memory pool for config */ - char *cfg_name; /** < name of config file */ - char *pid_file; /** < name of pid file */ - char *temp_dir; /** < dir for temp files */ - - char *bind_host; /** < bind line */ - struct in_addr bind_addr; /** < bind address in case of TCP socket */ - uint16_t bind_port; /** < bind port in case of TCP socket */ - uint16_t bind_family; /** < bind type (AF_UNIX or AF_INET) */ - - char *control_host; /** < bind line for controller */ - struct in_addr control_addr; /** < bind address for controller */ - uint16_t control_port; /** < bind port for controller */ - uint16_t control_family; /** < bind family for controller */ - int controller_enabled; /** < whether controller is enabled */ - char *control_password; /** < controller password */ - - int no_fork; /** < if 1 do not call daemon() */ - unsigned int workers_number; /** < number of workers */ - - enum rspamd_log_type log_type; /** < log type */ - int log_facility; /** < log facility in case of syslog */ - int log_level; /** < log level trigger */ - char *log_file; /** < path to logfile in case of file logging */ - int log_fd; /** < log descriptor in case of file logging */ - - size_t max_statfile_size; /** < maximum size for statfile */ - - struct memcached_server memcached_servers[MAX_MEMCACHED_SERVERS]; /** < memcached servers */ - size_t memcached_servers_num; /** < number of memcached servers */ - memc_proto_t memcached_protocol; /** < memcached protocol */ - unsigned int memcached_error_time; /** < memcached error time (see upstream documentation) */ - unsigned int memcached_dead_time; /** < memcached dead time */ - unsigned int memcached_maxerrors; /** < maximum number of errors */ - unsigned int memcached_connect_timeout; /** < connection timeout */ - - LIST_HEAD (modulesq, perl_module) perl_modules; /** < linked list of perl modules to load */ - - LIST_HEAD (headersq, filter) header_filters; /** < linked list of all header's filters */ - LIST_HEAD (mimesq, filter) mime_filters; /** < linked list of all mime filters */ - LIST_HEAD (messagesq, filter) message_filters; /** < linked list of all message's filters */ - LIST_HEAD (urlsq, filter) url_filters; /** < linked list of all url's filters */ - char *header_filters_str; /** < string of header's filters */ - char *mime_filters_str; /** < string of mime's filters */ - char *message_filters_str; /** < string of message's filters */ - char *url_filters_str; /** < string for url's filters */ - GHashTable* modules_opts; /** < hash for module options indexed by module name */ - GHashTable* variables; /** < hash of $variables defined in config, indexed by variable name */ - GHashTable* metrics; /** < hash of metrics indexed by metric name */ - GHashTable* factors; /** < hash of factors indexed by symbol name */ - GHashTable* c_modules; /** < hash of c modules indexed by module name */ - GHashTable* composite_symbols; /** < hash of composite symbols indexed by its name */ - GHashTable* statfiles; /** < hash of defined statfiles indexed by alias */ - GHashTable* cfg_params; /** < all cfg params indexed by its name in this structure */ + memory_pool_t *cfg_pool; /**< memory pool for config */ + char *cfg_name; /**< name of config file */ + char *pid_file; /**< name of pid file */ + char *temp_dir; /**< dir for temp files */ + + char *bind_host; /**< bind line */ + struct in_addr bind_addr; /**< bind address in case of TCP socket */ + uint16_t bind_port; /**< bind port in case of TCP socket */ + uint16_t bind_family; /**< bind type (AF_UNIX or AF_INET) */ + + char *control_host; /**< bind line for controller */ + struct in_addr control_addr; /**< bind address for controller */ + uint16_t control_port; /**< bind port for controller */ + uint16_t control_family; /**< bind family for controller */ + int controller_enabled; /**< whether controller is enabled */ + char *control_password; /**< controller password */ + + int no_fork; /**< if 1 do not call daemon() */ + unsigned int workers_number; /**< number of workers */ + + enum rspamd_log_type log_type; /**< log type */ + int log_facility; /**< log facility in case of syslog */ + int log_level; /**< log level trigger */ + char *log_file; /**< path to logfile in case of file logging */ + int log_fd; /**< log descriptor in case of file logging */ + + size_t max_statfile_size; /**< maximum size for statfile */ + + struct memcached_server memcached_servers[MAX_MEMCACHED_SERVERS]; /**< memcached servers */ + size_t memcached_servers_num; /**< number of memcached servers */ + memc_proto_t memcached_protocol; /**< memcached protocol */ + unsigned int memcached_error_time; /**< memcached error time (see upstream documentation) */ + unsigned int memcached_dead_time; /**< memcached dead time */ + unsigned int memcached_maxerrors; /**< maximum number of errors */ + unsigned int memcached_connect_timeout; /**< connection timeout */ + + LIST_HEAD (modulesq, perl_module) perl_modules; /**< linked list of perl modules to load */ + + LIST_HEAD (headersq, filter) header_filters; /**< linked list of all header's filters */ + LIST_HEAD (mimesq, filter) mime_filters; /**< linked list of all mime filters */ + LIST_HEAD (messagesq, filter) message_filters; /**< linked list of all message's filters */ + LIST_HEAD (urlsq, filter) url_filters; /**< linked list of all url's filters */ + char *header_filters_str; /**< string of header's filters */ + char *mime_filters_str; /**< string of mime's filters */ + char *message_filters_str; /**< string of message's filters */ + char *url_filters_str; /**< string for url's filters */ + GHashTable* modules_opts; /**< hash for module options indexed by module name */ + GHashTable* variables; /**< hash of $variables defined in config, indexed by variable name */ + GHashTable* metrics; /**< hash of metrics indexed by metric name */ + GHashTable* factors; /**< hash of factors indexed by symbol name */ + GHashTable* c_modules; /**< hash of c modules indexed by module name */ + GHashTable* composite_symbols; /**< hash of composite symbols indexed by its name */ + GHashTable* statfiles; /**< hash of defined statfiles indexed by alias */ + GHashTable* cfg_params; /**< all cfg params indexed by its name in this structure */ }; /** diff --git a/src/filter.h b/src/filter.h index d732a8fbc..b991109f9 100644 --- a/src/filter.h +++ b/src/filter.h @@ -1,3 +1,8 @@ +/** + * @file filter.h + * Filters logic implemetation + */ + #ifndef RSPAMD_FILTER_H #define RSPAMD_FILTER_H @@ -9,10 +14,6 @@ #endif #include -/** - * Filters logic implemetation - */ - struct worker_task; typedef double (*metric_cons_func)(struct worker_task *task, const char *metric_name); @@ -24,29 +25,29 @@ enum filter_type { C_FILTER, PERL_FILTER }; * Filter structure */ struct filter { - char *func_name; /** < function name */ - enum filter_type type; /** < filter type (c or perl) */ - LIST_ENTRY (filter) next; /** < chain link */ + char *func_name; /**< function name */ + enum filter_type type; /**< filter type (c or perl) */ + LIST_ENTRY (filter) next; /**< chain link */ }; /** * Common definition of metric */ struct metric { - char *name; /** < name of metric */ - char *func_name; /** < name of consolidation function */ - metric_cons_func func; /** < c consolidation function */ - double required_score; /** < required score for this metric */ - struct classifier *classifier; /** < classifier that is used for metric */ + char *name; /**< name of metric */ + char *func_name; /**< name of consolidation function */ + metric_cons_func func; /**< c consolidation function */ + double required_score; /**< required score for this metric */ + struct classifier *classifier; /**< classifier that is used for metric */ }; /** * Result of metric processing */ struct metric_result { - struct metric *metric; /** < pointer to metric structure */ - double score; /** < total score */ - GHashTable *symbols; /** < symbols of metric */ + struct metric *metric; /**< pointer to metric structure */ + double score; /**< total score */ + GHashTable *symbols; /**< symbols of metric */ }; /** diff --git a/src/hash.h b/src/hash.h index 8f87bb10e..4a1e973fb 100644 --- a/src/hash.h +++ b/src/hash.h @@ -1,17 +1,7 @@ -/* - * ===================================================================================== - * - * Filename: hash.h - * - * Description: Hash table implementation that uses memory pools from mem_pool library - * - * Created: 27.01.2009 16:31:11 - * Compiler: gcc - * - * Author: Vsevolod Stakhov - * Company: Rambler - * - * ===================================================================================== +/** + * @file hash.h + * Hash table implementation that allows using memory pools for storage as well as using + * shared memory for this purpose */ #ifndef RSPAMD_HASH_H @@ -21,11 +11,6 @@ #include #include "mem_pool.h" -/** - * Hash table implementation that allows using memory pools for storage as well as using - * shared memory for this purpose - */ - struct rspamd_hash_node { gpointer key; gpointer value; diff --git a/src/main.h b/src/main.h index 4bab0072d..10f9ef215 100644 --- a/src/main.h +++ b/src/main.h @@ -1,10 +1,11 @@ -#ifndef RSPAMD_MAIN_H -#define RSPAMD_MAIN_H - /** + * @file main.h * Definitions for main rspamd structures */ +#ifndef RSPAMD_MAIN_H +#define RSPAMD_MAIN_H + #include "config.h" #include @@ -70,26 +71,26 @@ enum script_type { * Logic expression */ struct expression { - enum { EXPR_OPERAND, EXPR_OPERATION } type; /** < expression type */ + enum { EXPR_OPERAND, EXPR_OPERATION } type; /**< expression type */ union { void *operand; char operation; - } content; /** < union for storing operand or operation code */ - struct expression *next; /** < chain link */ + } content; /**< union for storing operand or operation code */ + struct expression *next; /**< chain link */ }; /** * Worker process structure */ struct rspamd_worker { - pid_t pid; /** < pid of worker */ - char is_initialized; /** < is initialized */ - char is_dying; /** < if worker is going to shutdown */ - struct rspamd_main *srv; /** < pointer to server structure */ - enum process_type type; /** < process type */ - struct event sig_ev; /** < signals event */ - struct event bind_ev; /** < socket events */ - TAILQ_ENTRY (rspamd_worker) next; /** < chain link to next worker */ + pid_t pid; /**< pid of worker */ + char is_initialized; /**< is initialized */ + char is_dying; /**< if worker is going to shutdown */ + struct rspamd_main *srv; /**< pointer to server structure */ + enum process_type type; /**< process type */ + struct event sig_ev; /**< signals event */ + struct event bind_ev; /**< socket events */ + TAILQ_ENTRY (rspamd_worker) next; /**< chain link to next worker */ }; struct pidfh; @@ -102,73 +103,73 @@ struct mime_part; * Server statistics */ struct rspamd_stat { - unsigned int messages_scanned; /** < total number of messages scanned */ - unsigned int messages_spam; /** < messages treated as spam */ - unsigned int messages_ham; /** < messages treated as ham */ - unsigned int connections_count; /** < total connections count */ - unsigned int control_connections_count; /** < connections count to control interface */ - unsigned int messages_learned; /** < messages learned */ + unsigned int messages_scanned; /**< total number of messages scanned */ + unsigned int messages_spam; /**< messages treated as spam */ + unsigned int messages_ham; /**< messages treated as ham */ + unsigned int connections_count; /**< total connections count */ + unsigned int control_connections_count; /**< connections count to control interface */ + unsigned int messages_learned; /**< messages learned */ }; /** * Struct that determine main server object (for logging purposes) */ struct rspamd_main { - struct config_file *cfg; /** < pointer to config structure */ - pid_t pid; /** < main pid */ + struct config_file *cfg; /**< pointer to config structure */ + pid_t pid; /**< main pid */ /* Pid file structure */ - struct pidfh *pfh; /** < struct pidfh for pidfile */ - enum process_type type; /** < process type */ - unsigned int ev_initialized; /** < is event system is initialized */ - struct rspamd_stat *stat; /** < pointer to statistics */ + struct pidfh *pfh; /**< struct pidfh for pidfile */ + enum process_type type; /**< process type */ + unsigned int ev_initialized; /**< is event system is initialized */ + struct rspamd_stat *stat; /**< pointer to statistics */ - memory_pool_t *server_pool; /** < server's memory pool */ - statfile_pool_t *statfile_pool; /** < shared statfiles pool */ + memory_pool_t *server_pool; /**< server's memory pool */ + statfile_pool_t *statfile_pool; /**< shared statfiles pool */ - TAILQ_HEAD (workq, rspamd_worker) workers; /** < linked list of workers */ + TAILQ_HEAD (workq, rspamd_worker) workers; /**< linked list of workers */ }; /** * Save point object for delayed filters processing */ struct save_point { - void *entry; /** < pointer to C function or perl function name */ - enum script_type type; /** < where we did stop */ - unsigned int saved; /** < how much time we have delayed processing */ + void *entry; /**< pointer to C function or perl function name */ + enum script_type type; /**< where we did stop */ + unsigned int saved; /**< how much time we have delayed processing */ }; /** * Control session object */ struct controller_session { - struct rspamd_worker *worker; /** < pointer to worker structure (controller in fact) */ + struct rspamd_worker *worker; /**< pointer to worker structure (controller in fact) */ enum { STATE_COMMAND, STATE_LEARN, STATE_REPLY, STATE_QUIT, - } state; /** < current session state */ - int sock; /** < socket descriptor */ + } state; /**< current session state */ + int sock; /**< socket descriptor */ /* Access to authorized commands */ - int authorized; /** < whether this session is authorized */ - memory_pool_t *session_pool; /** < memory pool for session */ - struct bufferevent *bev; /** < buffered event for IO */ - struct config_file *cfg; /** < pointer to config file */ - char *learn_rcpt; /** < recipient for learning */ - char *learn_from; /** < from address for learning */ - struct tokenizer *learn_tokenizer; /** < tokenizer for learning */ - struct classifier *learn_classifier; /** < classifier for learning */ - char *learn_filename; /** < real filename for learning */ - f_str_buf_t *learn_buf; /** < learn input */ - GList *parts; /** < extracted mime parts */ - int in_class; /** < positive or negative learn */ + int authorized; /**< whether this session is authorized */ + memory_pool_t *session_pool; /**< memory pool for session */ + struct bufferevent *bev; /**< buffered event for IO */ + struct config_file *cfg; /**< pointer to config file */ + char *learn_rcpt; /**< recipient for learning */ + char *learn_from; /**< from address for learning */ + struct tokenizer *learn_tokenizer; /**< tokenizer for learning */ + struct classifier *learn_classifier; /**< classifier for learning */ + char *learn_filename; /**< real filename for learning */ + f_str_buf_t *learn_buf; /**< learn input */ + GList *parts; /**< extracted mime parts */ + int in_class; /**< positive or negative learn */ }; /** * Worker task structure */ struct worker_task { - struct rspamd_worker *worker; /** < pointer to worker object */ + struct rspamd_worker *worker; /**< pointer to worker object */ enum { READ_COMMAND, READ_HEADER, @@ -177,50 +178,50 @@ struct worker_task { WRITE_ERROR, WAIT_FILTER, CLOSING_CONNECTION, - } state; /** < current session state */ - size_t content_length; /** < length of user's input */ - enum rspamd_protocol proto; /** < protocol (rspamc or spamc) */ - enum rspamd_command cmd; /** < command */ - int sock; /** < socket descriptor */ - char *helo; /** < helo header value */ - char *from; /** < frmo header value */ - GList *rcpt; /** < recipients list */ - unsigned int nrcpt; /** < number of recipients */ - struct in_addr from_addr; /** < client addr in numeric form */ - f_str_buf_t *msg; /** < message buffer */ - struct bufferevent *bev; /** < buffered event for IO */ - memcached_ctx_t *memc_ctx; /** < memcached context associated with task */ - unsigned memc_busy:1; /** < is memcached connection is busy XXX: fix this */ - int parts_count; /** < mime parts count */ - GMimeMessage *message; /** < message, parsed with GMime */ - GList *parts; /** < list of parsed parts */ - TAILQ_HEAD (uriq, uri) urls; /** < list of parsed urls */ - GHashTable *results; /** < hash table of metric_result indexed by + } state; /**< current session state */ + size_t content_length; /**< length of user's input */ + enum rspamd_protocol proto; /**< protocol (rspamc or spamc) */ + enum rspamd_command cmd; /**< command */ + int sock; /**< socket descriptor */ + char *helo; /**< helo header value */ + char *from; /**< from header value */ + GList *rcpt; /**< recipients list */ + unsigned int nrcpt; /**< number of recipients */ + struct in_addr from_addr; /**< client addr in numeric form */ + f_str_buf_t *msg; /**< message buffer */ + struct bufferevent *bev; /**< buffered event for IO */ + memcached_ctx_t *memc_ctx; /**< memcached context associated with task */ + unsigned memc_busy:1; /**< is memcached connection is busy XXX: fix this */ + int parts_count; /**< mime parts count */ + GMimeMessage *message; /**< message, parsed with GMime */ + GList *parts; /**< list of parsed parts */ + TAILQ_HEAD (uriq, uri) urls; /**< list of parsed urls */ + GHashTable *results; /**< hash table of metric_result indexed by * metric's name */ - struct config_file *cfg; /** < pointer to config object */ - struct save_point save; /** < save point for delayed processing */ - char *last_error; /** < last error */ - int error_code; /** < code of last error */ - memory_pool_t *task_pool; /** < memory pool for task */ + struct config_file *cfg; /**< pointer to config object */ + struct save_point save; /**< save point for delayed processing */ + char *last_error; /**< last error */ + int error_code; /**< code of last error */ + memory_pool_t *task_pool; /**< memory pool for task */ }; /** * Common structure representing C module context */ struct module_ctx { - int (*header_filter)(struct worker_task *task); /** < pointer to headers process function */ - int (*mime_filter)(struct worker_task *task); /** < pointer to mime parts process function */ - int (*message_filter)(struct worker_task *task); /** < pointer to the whole message process function */ - int (*url_filter)(struct worker_task *task); /** < pointer to urls process function */ + int (*header_filter)(struct worker_task *task); /**< pointer to headers process function */ + int (*mime_filter)(struct worker_task *task); /**< pointer to mime parts process function */ + int (*message_filter)(struct worker_task *task); /**< pointer to the whole message process function */ + int (*url_filter)(struct worker_task *task); /**< pointer to urls process function */ }; /** * Common structure for C module */ struct c_module { - const char *name; /** < name */ - struct module_ctx *ctx; /** < pointer to context */ - LIST_ENTRY (c_module) next; /** < linked list */ + const char *name; /**< name */ + struct module_ctx *ctx; /**< pointer to context */ + LIST_ENTRY (c_module) next; /**< linked list */ }; void start_worker (struct rspamd_worker *worker, int listen_sock); diff --git a/src/mem_pool.h b/src/mem_pool.h index 79f029bf3..719aef220 100644 --- a/src/mem_pool.h +++ b/src/mem_pool.h @@ -1,10 +1,5 @@ -#ifndef RSPAMD_MEM_POOL_H -#define RSPAMD_MEM_POOL_H - -#include -#include - /** + * @file mem_pool.h * \brief Memory pools library. * * Memory pools library. Library is designed to implement efficient way to @@ -14,17 +9,26 @@ * can use pool for them */ -/** Destructor type definition */ +#ifndef RSPAMD_MEM_POOL_H +#define RSPAMD_MEM_POOL_H + +#include +#include + + +/** + * Destructor type definition + */ typedef void (*pool_destruct_func)(void *ptr); /** * Pool page structure */ struct _pool_chain { - u_char *begin; /** < begin of pool chain block */ - u_char *pos; /** < current start of free space in block */ - size_t len; /** < length of block */ - struct _pool_chain *next; /** < chain link */ + u_char *begin; /**< begin of pool chain block */ + u_char *pos; /**< current start of free space in block */ + size_t len; /**< length of block */ + struct _pool_chain *next; /**< chain link */ }; /** @@ -42,37 +46,37 @@ struct _pool_chain_shared { * Destructors list item structure */ struct _pool_destructors { - pool_destruct_func func; /** < pointer to destructor */ - void *data; /** < data to free */ - struct _pool_destructors *prev; /** < chain link */ + pool_destruct_func func; /**< pointer to destructor */ + void *data; /**< data to free */ + struct _pool_destructors *prev; /**< chain link */ }; /** * Memory pool type */ typedef struct memory_pool_s { - struct _pool_chain *cur_pool; /** < currently used page */ - struct _pool_chain *first_pool; /** < first page */ - struct _pool_chain_shared *shared_pool; /** < shared chain */ - struct _pool_destructors *destructors; /** < destructors chain */ + struct _pool_chain *cur_pool; /**< currently used page */ + struct _pool_chain *first_pool; /**< first page */ + struct _pool_chain_shared *shared_pool; /**< shared chain */ + struct _pool_destructors *destructors; /**< destructors chain */ } memory_pool_t; /** * Statistics structure */ typedef struct memory_pool_stat_s { - size_t bytes_allocated; /** < bytes that are allocated with pool allocator */ - size_t chunks_allocated; /** < number of chunks that are allocated */ - size_t shared_chunks_allocated; /** < shared chunks allocated */ - size_t chunks_freed; /** < chunks freed */ + size_t bytes_allocated; /**< bytes that are allocated with pool allocator */ + size_t chunks_allocated; /**< number of chunks that are allocated */ + size_t shared_chunks_allocated; /**< shared chunks allocated */ + size_t chunks_freed; /**< chunks freed */ } memory_pool_stat_t; /** * Rwlock for locking shared memory regions */ typedef struct memory_pool_rwlock_s { - gint *__r_lock; /** < read mutex (private) */ - gint *__w_lock; /** < write mutex (private) */ + gint *__r_lock; /**< read mutex (private) */ + gint *__w_lock; /**< write mutex (private) */ } memory_pool_rwlock_t; /** diff --git a/src/message.h b/src/message.h index 7b880f226..6fa4ad83c 100644 --- a/src/message.h +++ b/src/message.h @@ -1,3 +1,8 @@ +/** + * @file message.h + * Message processing functions and structures + */ + #ifndef RSPAMD_MESSAGE_H #define RSPAMD_MESSAGE_H @@ -24,11 +29,6 @@ #include #include - -/** - * Message processing functions and structures - */ - struct mime_part { GMimeContentType *type; GByteArray *content; diff --git a/src/protocol.h b/src/protocol.h index 600632119..243e216aa 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -1,3 +1,8 @@ +/** + * @file protocol.h + * Rspamd protocol definition + */ + #ifndef RSPAMD_PROTOCOL_H #define RSPAMD_PROTOCOL_H @@ -8,10 +13,6 @@ #define RSPAMD_PROTOCOL_ERROR 3 #define RSPAMD_LENGTH_ERROR 4 -/** - * Rspamd protocol definition - */ - struct worker_task; enum rspamd_protocol { diff --git a/src/statfile.h b/src/statfile.h index fd0d20626..539fda842 100644 --- a/src/statfile.h +++ b/src/statfile.h @@ -1,5 +1,6 @@ /** - * Describes common methods in accessing statistics files and caching them in memory + * @file statfile.h + * Describes common methods for accessing statistics files and caching them in memory */ #ifndef RSPAMD_STATFILE_H @@ -21,58 +22,58 @@ * Common statfile header */ struct stat_file_header { - u_char magic[3]; /** < magic signature ('r' 's' 'd') */ - u_char version[2]; /** < version of statfile (1.0) */ - u_char padding[3]; /** < padding */ - uint64_t create_time; /** < create time (time_t->uint64_t) */ + u_char magic[3]; /**< magic signature ('r' 's' 'd') */ + u_char version[2]; /**< version of statfile (1.0) */ + u_char padding[3]; /**< padding */ + uint64_t create_time; /**< create time (time_t->uint64_t) */ } __attribute__((__packed__)); /** * Block of data in statfile */ struct stat_file_block { - uint32_t hash1; /** < hash1 (also acts as index) */ - uint32_t hash2; /** < hash2 */ - float value; /** < float value */ - uint32_t last_access; /** < last access to block since create time of file */ + uint32_t hash1; /**< hash1 (also acts as index) */ + uint32_t hash2; /**< hash2 */ + float value; /**< float value */ + uint32_t last_access; /**< last access to block since create time of file */ }; /** * Statistic file */ struct stat_file { - struct stat_file_header header; /** < header */ - struct stat_file_block blocks[1]; /** < first block of data */ + struct stat_file_header header; /**< header */ + struct stat_file_block blocks[1]; /**< first block of data */ }; /** * Common view of statfile object */ typedef struct stat_file_s { - char *filename; /** < name of file */ - int fd; /** < descriptor */ - void *map; /** < mmaped area */ - time_t open_time; /** < time when file was opened */ - time_t access_time; /** < last access time */ - size_t len; /** < length of file(in bytes) */ - size_t blocks; /** < length of file in blocks */ - gint *lock; /** < mutex */ + char *filename; /**< name of file */ + int fd; /**< descriptor */ + void *map; /**< mmaped area */ + time_t open_time; /**< time when file was opened */ + time_t access_time; /**< last access time */ + size_t len; /**< length of file(in bytes) */ + size_t blocks; /**< length of file in blocks */ + gint *lock; /**< mutex */ } stat_file_t; /** * Statfiles pool */ typedef struct statfile_pool_s { - rspamd_hash_t *files; /** < hash table of opened files indexed by name */ - int opened; /** < number of opened files */ - size_t max; /** < maximum size */ - size_t occupied; /** < current size */ - memory_pool_t *pool; /** < memory pool object */ + rspamd_hash_t *files; /**< hash table of opened files indexed by name */ + int opened; /**< number of opened files */ + size_t max; /**< maximum size */ + size_t occupied; /**< current size */ + memory_pool_t *pool; /**< memory pool object */ } statfile_pool_t; /** * Create new statfile pool - * @param size maximum size + * @param max_size maximum size * @return statfile pool object */ statfile_pool_t* statfile_pool_new (size_t max_size); -- 2.39.5