Macros | Functions
MyQttd: general facilities, initialization, etc

Macros

#define abort_error(m,...)   do{myqttd_error (ctx, axl_true, __AXL_FILE__, __AXL_LINE__, m, ##__VA_ARGS__);}while(0)
 Drop an error msg to the console stderr without taking into consideration debug configuration. More...
 
#define error(m,...)   do{myqttd_error (ctx, axl_false, __AXL_FILE__, __AXL_LINE__, m, ##__VA_ARGS__);}while(0)
 Drop an error msg to the console stderr. More...
 
#define msg(m,...)   do{myqttd_msg (ctx, __AXL_FILE__, __AXL_LINE__, m, ##__VA_ARGS__);}while(0)
 Drop a msg to the console stdout. More...
 
#define msg2(m,...)   do{myqttd_msg2 (ctx, __AXL_FILE__, __AXL_LINE__, m, ##__VA_ARGS__);}while(0)
 Drop a second level msg to the console stdout. More...
 
#define tbc_access(m,...)   do{myqttd_access (ctx, __AXL_FILE__, __AXL_LINE__, m, ##__VA_ARGS__);}while(0)
 Reports an access message, a message that is sent to the access log file. More...
 
#define wrn(m,...)   do{myqttd_wrn (ctx, __AXL_FILE__, __AXL_LINE__, m, ##__VA_ARGS__);}while(0)
 Drop a warning msg to the console stdout. More...
 
#define wrn_sl(m,...)   do{myqttd_wrn_sl (ctx, __AXL_FILE__, __AXL_LINE__, m, ##__VA_ARGS__);}while(0)
 Drops to the console stdout a warning, placing the content prefixed with the file and the line that caused the message, without introducing a new line. More...
 

Functions

char * myqttd_base_dir (const char *path)
 Allows to get the base dir associated to the provided path. More...
 
axl_bool myqttd_change_fd_owner (MyQttdCtx *ctx, const char *file_name, const char *user, const char *group)
 Allows to change the owner (user and group) of the socket's file associated. More...
 
axl_bool myqttd_change_fd_perms (MyQttdCtx *ctx, const char *file_name, const char *mode)
 Allows to change the permissions of the socket's file associated. More...
 
void myqttd_color_log_enable (MyQttdCtx *ctx, int value)
 Allows to configure if the console log produced is colorfied according to the status reported (red: (error,criticals), yellow: (warning), green: (info, debug). More...
 
axl_bool myqttd_create_dir (const char *path)
 Creates the directory with the path provided. More...
 
const char * myqttd_datadir (MyQttdCtx *ctx)
 Allows to get the MYQTTD_DATADIR path provided at compilation time. More...
 
const char * myqttd_ensure_str (const char *string)
 Ensure having a printable string from the provided reference. More...
 
void myqttd_exit (MyQttdCtx *ctx, axl_bool free_ctx, axl_bool free_myqtt_ctx)
 Performs all operations required to cleanup myqttd runtime execution (calling to all module cleanups).
 
axl_bool myqttd_file_is_fullpath (const char *file)
 Allows to check if the provided file path is a full path (not releative). More...
 
char * myqttd_file_name (const char *path)
 Allows to get the file name associated to the provided path. More...
 
axl_bool myqttd_file_test_v (const char *format, MyQttFileTest test,...)
 Provides the same functionality like myqtt_support_file_test, but allowing to provide the file path as a printf like argument. More...
 
long myqttd_get_day (void)
 Allows to get current day. More...
 
long myqttd_get_month (void)
 Allows to get current month. More...
 
int myqttd_get_system_id (MyQttdCtx *ctx, const char *value, axl_bool get_user)
 Allows to get system user id or system group id from the provided string. More...
 
axl_bool myqttd_init (MyQttdCtx *ctx, MyQttCtx *myqtt_ctx, const char *config)
 Starts myqttd execution, initializing all libraries required by the server application. More...
 
axl_bool myqttd_is_num (const char *value)
 Allows to check if the provided value contains a decimal number. More...
 
long myqttd_last_modification (const char *file)
 Allows to get last modification date for the file provided. More...
 
void myqttd_log2_enable (MyQttdCtx *ctx, int value)
 Allows to activate the second level console log. More...
 
axl_bool myqttd_log2_enabled (MyQttdCtx *ctx)
 Allows to check if the second level debug is activated (msg2 type). More...
 
void myqttd_log3_enable (MyQttdCtx *ctx, int value)
 Allows to activate the third level console log. More...
 
axl_bool myqttd_log3_enabled (MyQttdCtx *ctx)
 Allows to check if the third level debug is activated (msg2 with additional information). More...
 
void myqttd_log_enable (MyQttdCtx *ctx, int value)
 Allows to activate the myqttd console log (by default disabled). More...
 
axl_bool myqttd_log_enabled (MyQttdCtx *ctx)
 Allows to check if the debug is activated (msg type). More...
 
long myqttd_now (void)
 Allows to get current epoch (now). More...
 
void myqttd_reload_config (MyQttdCtx *ctx, int value)
 Function that performs a reload operation for the current myqttd instance (represented by the provided MyQttdCtx). More...
 
const char * myqttd_runtime_datadir (MyQttdCtx *ctx)
 Allows to get the MYQTTD_RUNTIME_DATADIR path provided at compilation time. More...
 
const char * myqttd_runtime_tmpdir (MyQttdCtx *ctx)
 Allows to get current temporal directory. More...
 
void myqttd_sleep (MyQttdCtx *ctx, long microseconds)
 Implements a portable subsecond thread sleep operation. More...
 
const char * myqttd_sysconfdir (MyQttdCtx *ctx)
 Allows to get the SYSCONFDIR path provided at compilation time. More...
 
axl_bool myqttd_unlink (const char *path)
 Allows to remove the selected file pointed by the path provided. More...
 

Detailed Description