Function declarations changed to common Maxscale style.
This commit is contained in:
@ -258,8 +258,7 @@ typedef struct strpart
|
||||
|
||||
/** Static function declarations */
|
||||
static bool logfiles_init(logmanager_t* lmgr);
|
||||
static bool logfile_init(
|
||||
logfile_t* logfile,
|
||||
static bool logfile_init(logfile_t* logfile,
|
||||
logfile_id_t logfile_id,
|
||||
logmanager_t* logmanager,
|
||||
bool store_shmem,
|
||||
@ -272,8 +271,7 @@ static bool logfile_create(logfile_t* lf);
|
||||
static bool logfile_open_file(filewriter_t* fw, logfile_t* lf);
|
||||
static char* form_full_file_name(strpart_t* parts, logfile_t* lf, int seqnoidx);
|
||||
|
||||
static bool filewriter_init(
|
||||
logmanager_t* logmanager,
|
||||
static bool filewriter_init(logmanager_t* logmanager,
|
||||
filewriter_t* fw,
|
||||
skygw_message_t* clientmes,
|
||||
skygw_message_t* logmes);
|
||||
@ -290,8 +288,7 @@ static void logmanager_unregister(void);
|
||||
static bool logmanager_init_nomutex(int argc, char* argv[]);
|
||||
static void logmanager_done_nomutex(void);
|
||||
|
||||
static int logmanager_write_log(
|
||||
logfile_id_t id,
|
||||
static int logmanager_write_log(logfile_id_t id,
|
||||
bool flush,
|
||||
bool use_valist,
|
||||
bool spread_down,
|
||||
@ -302,8 +299,7 @@ static int logmanager_write_log(
|
||||
|
||||
static blockbuf_t* blockbuf_init(logfile_id_t id);
|
||||
static void blockbuf_node_done(void* bb_data);
|
||||
static char* blockbuf_get_writepos(
|
||||
blockbuf_t** p_bb,
|
||||
static char* blockbuf_get_writepos(blockbuf_t** p_bb,
|
||||
logfile_id_t id,
|
||||
size_t str_len,
|
||||
bool flush);
|
||||
@ -313,8 +309,7 @@ static void blockbuf_unregister(blockbuf_t* bb);
|
||||
static bool logfile_set_enabled(logfile_id_t id, bool val);
|
||||
static char* add_slash(char* str);
|
||||
|
||||
static bool check_file_and_path(
|
||||
char* filename,
|
||||
static bool check_file_and_path(char* filename,
|
||||
bool* writable,
|
||||
bool do_log);
|
||||
|
||||
@ -374,9 +369,7 @@ const char* get_logpath_default(void)
|
||||
return "/var/log/maxscale";
|
||||
}
|
||||
|
||||
static bool logmanager_init_nomutex(
|
||||
int argc,
|
||||
char* argv[])
|
||||
static bool logmanager_init_nomutex(int argc, char* argv[])
|
||||
{
|
||||
fnames_conf_t* fn;
|
||||
filewriter_t* fw;
|
||||
@ -498,9 +491,7 @@ return_succp:
|
||||
* @return true if succeed, otherwise false
|
||||
*
|
||||
*/
|
||||
bool skygw_logmanager_init(
|
||||
int argc,
|
||||
char* argv[])
|
||||
bool skygw_logmanager_init(int argc, char* argv[])
|
||||
{
|
||||
bool succp = false;
|
||||
|
||||
@ -658,8 +649,7 @@ static logfile_t* logmanager_get_logfile(
|
||||
* @return 0 if succeed, -1 otherwise
|
||||
*
|
||||
*/
|
||||
static int logmanager_write_log(
|
||||
logfile_id_t id,
|
||||
static int logmanager_write_log(logfile_id_t id,
|
||||
bool flush,
|
||||
bool use_valist,
|
||||
bool spread_down,
|
||||
@ -955,8 +945,7 @@ return_err:
|
||||
*
|
||||
* @param bb block buffer
|
||||
*/
|
||||
static void blockbuf_register(
|
||||
blockbuf_t* bb)
|
||||
static void blockbuf_register(blockbuf_t* bb)
|
||||
{
|
||||
CHK_BLOCKBUF(bb);
|
||||
ss_dassert(bb->bb_refcount >= 0);
|
||||
@ -969,8 +958,7 @@ static void blockbuf_register(
|
||||
*
|
||||
* @param bb block buffer
|
||||
*/
|
||||
static void blockbuf_unregister(
|
||||
blockbuf_t* bb)
|
||||
static void blockbuf_unregister(blockbuf_t* bb)
|
||||
{
|
||||
logfile_t* lf;
|
||||
|
||||
@ -1008,8 +996,7 @@ static void blockbuf_unregister(
|
||||
* mutex.
|
||||
*
|
||||
*/
|
||||
static char* blockbuf_get_writepos(
|
||||
blockbuf_t** p_bb,
|
||||
static char* blockbuf_get_writepos(blockbuf_t** p_bb,
|
||||
logfile_id_t id,
|
||||
size_t str_len,
|
||||
bool flush)
|
||||
@ -1265,16 +1252,14 @@ static char* blockbuf_get_writepos(
|
||||
return pos;
|
||||
}
|
||||
|
||||
static void blockbuf_node_done(
|
||||
void* bb_data)
|
||||
static void blockbuf_node_done(void* bb_data)
|
||||
{
|
||||
blockbuf_t* bb = (blockbuf_t *)bb_data;
|
||||
simple_mutex_done(&bb->bb_mutex);
|
||||
}
|
||||
|
||||
|
||||
static blockbuf_t* blockbuf_init(
|
||||
logfile_id_t id)
|
||||
static blockbuf_t* blockbuf_init(logfile_id_t id)
|
||||
{
|
||||
blockbuf_t* bb;
|
||||
|
||||
@ -1303,8 +1288,7 @@ static blockbuf_t* blockbuf_init(
|
||||
}
|
||||
|
||||
|
||||
int skygw_log_enable(
|
||||
logfile_id_t id)
|
||||
int skygw_log_enable(logfile_id_t id)
|
||||
{
|
||||
bool err = 0;
|
||||
|
||||
@ -1329,8 +1313,7 @@ return_err:
|
||||
return err;
|
||||
}
|
||||
|
||||
int skygw_log_disable(
|
||||
logfile_id_t id) /*< no locking */
|
||||
int skygw_log_disable(logfile_id_t id) /*< no locking */
|
||||
{
|
||||
int rc;
|
||||
|
||||
@ -1562,8 +1545,7 @@ static int log_write(logfile_id_t id,
|
||||
return rv;
|
||||
}
|
||||
|
||||
int skygw_log_write_context_flush(
|
||||
logfile_id_t id,
|
||||
int skygw_log_write_context_flush(logfile_id_t id,
|
||||
const char* file,
|
||||
int line,
|
||||
const char* function,
|
||||
@ -1604,8 +1586,7 @@ int skygw_log_write_context_flush(
|
||||
|
||||
|
||||
|
||||
int skygw_log_write_context(
|
||||
logfile_id_t id,
|
||||
int skygw_log_write_context(logfile_id_t id,
|
||||
const char* file,
|
||||
int line,
|
||||
const char* function,
|
||||
@ -1645,8 +1626,7 @@ int skygw_log_write_context(
|
||||
}
|
||||
|
||||
|
||||
int skygw_log_flush(
|
||||
logfile_id_t id)
|
||||
int skygw_log_flush(logfile_id_t id)
|
||||
{
|
||||
int err = 0;
|
||||
va_list valist; /**< Dummy, must be present but it is not processed */
|
||||
@ -1676,8 +1656,7 @@ return_err:
|
||||
* Replace current logfile with new file with increased sequence number on
|
||||
* its name.
|
||||
*/
|
||||
int skygw_log_rotate(
|
||||
logfile_id_t id)
|
||||
int skygw_log_rotate(logfile_id_t id)
|
||||
{
|
||||
int err = 0;
|
||||
logfile_t* lf;
|
||||
@ -1739,8 +1718,7 @@ return_err:
|
||||
* @details Link count modify is protected by mutex.
|
||||
*
|
||||
*/
|
||||
static bool logmanager_register(
|
||||
bool writep)
|
||||
static bool logmanager_register(bool writep)
|
||||
{
|
||||
bool succp = true;
|
||||
|
||||
@ -1839,8 +1817,7 @@ static void logmanager_unregister(void)
|
||||
* @details Note that input parameter lenghts are checked here.
|
||||
*
|
||||
*/
|
||||
static bool fnames_conf_init(
|
||||
fnames_conf_t* fn,
|
||||
static bool fnames_conf_init(fnames_conf_t* fn,
|
||||
int argc,
|
||||
char* argv[])
|
||||
{
|
||||
@ -2013,8 +1990,7 @@ return_conf_init:
|
||||
}
|
||||
|
||||
|
||||
static char* fname_conf_get_prefix(
|
||||
fnames_conf_t* fn,
|
||||
static char* fname_conf_get_prefix(fnames_conf_t* fn,
|
||||
logfile_id_t id)
|
||||
{
|
||||
CHK_FNAMES_CONF(fn);
|
||||
@ -2043,8 +2019,7 @@ static char* fname_conf_get_prefix(
|
||||
}
|
||||
}
|
||||
|
||||
static char* fname_conf_get_suffix(
|
||||
fnames_conf_t* fn,
|
||||
static char* fname_conf_get_suffix(fnames_conf_t* fn,
|
||||
logfile_id_t id)
|
||||
{
|
||||
CHK_FNAMES_CONF(fn);
|
||||
@ -2157,8 +2132,7 @@ static bool logfiles_init(
|
||||
return succp;
|
||||
}
|
||||
|
||||
static void logfile_flush(
|
||||
logfile_t* lf)
|
||||
static void logfile_flush(logfile_t* lf)
|
||||
{
|
||||
CHK_LOGFILE(lf);
|
||||
acquire_lock(&lf->lf_spinlock);
|
||||
@ -2173,8 +2147,7 @@ static void logfile_flush(
|
||||
*
|
||||
* @param lf logfile pointer
|
||||
*/
|
||||
static void logfile_rotate(
|
||||
logfile_t* lf)
|
||||
static void logfile_rotate(logfile_t* lf)
|
||||
{
|
||||
CHK_LOGFILE(lf);
|
||||
acquire_lock(&lf->lf_spinlock);
|
||||
@ -2196,8 +2169,7 @@ static void logfile_rotate(
|
||||
* using log manager in parallel with multiple processes and by configuring
|
||||
* log manager to use same directories among those processes.
|
||||
*/
|
||||
static bool logfile_create(
|
||||
logfile_t* lf)
|
||||
static bool logfile_create(logfile_t* lf)
|
||||
{
|
||||
bool namecreatefail;
|
||||
bool nameconflicts;
|
||||
@ -2337,8 +2309,7 @@ return_succp:
|
||||
* false if failed.
|
||||
*
|
||||
*/
|
||||
static bool logfile_open_file(
|
||||
filewriter_t* fw,
|
||||
static bool logfile_open_file(filewriter_t* fw,
|
||||
logfile_t* lf)
|
||||
{
|
||||
bool succp;
|
||||
@ -2428,8 +2399,7 @@ return_succp:
|
||||
* @return Pointer to filename, of NULL if failed.
|
||||
*
|
||||
*/
|
||||
static char* form_full_file_name(
|
||||
strpart_t* parts,
|
||||
static char* form_full_file_name(strpart_t* parts,
|
||||
logfile_t* lf,
|
||||
int seqnoidx)
|
||||
{
|
||||
@ -2545,8 +2515,7 @@ return_filename:
|
||||
* @details (write detailed description here)
|
||||
*
|
||||
*/
|
||||
static char* add_slash(
|
||||
char* str)
|
||||
static char* add_slash(char* str)
|
||||
{
|
||||
char* p = str;
|
||||
size_t plen = strlen(p);
|
||||
@ -2581,8 +2550,7 @@ static char* add_slash(
|
||||
* TODO: recall what was the reason for not succeeding with simply
|
||||
* calling access, and fstat. vraa 26.11.13
|
||||
*/
|
||||
static bool check_file_and_path(
|
||||
char* filename,
|
||||
static bool check_file_and_path(char* filename,
|
||||
bool* writable,
|
||||
bool do_log)
|
||||
{
|
||||
@ -2655,8 +2623,7 @@ static bool check_file_and_path(
|
||||
|
||||
|
||||
|
||||
static bool file_is_symlink(
|
||||
char* filename)
|
||||
static bool file_is_symlink(char* filename)
|
||||
{
|
||||
int rc;
|
||||
bool succp = false;
|
||||
@ -2689,8 +2656,7 @@ static bool file_is_symlink(
|
||||
*
|
||||
* @return true if succeed, false otherwise
|
||||
*/
|
||||
static bool logfile_init(
|
||||
logfile_t* logfile,
|
||||
static bool logfile_init(logfile_t* logfile,
|
||||
logfile_id_t logfile_id,
|
||||
logmanager_t* logmanager,
|
||||
bool store_shmem,
|
||||
@ -2823,8 +2789,7 @@ return_with_succp:
|
||||
* flag read/write. Lock would be held during log write operation by clients.
|
||||
*
|
||||
*/
|
||||
static void logfile_done(
|
||||
logfile_t* lf)
|
||||
static void logfile_done(logfile_t* lf)
|
||||
{
|
||||
switch(lf->lf_state)
|
||||
{
|
||||
@ -2870,8 +2835,7 @@ static void logfile_free_memory(
|
||||
* @return true if succeed, false if failed
|
||||
*
|
||||
*/
|
||||
static bool filewriter_init(
|
||||
logmanager_t* logmanager,
|
||||
static bool filewriter_init(logmanager_t* logmanager,
|
||||
filewriter_t* fw,
|
||||
skygw_message_t* clientmes,
|
||||
skygw_message_t* logmes)
|
||||
@ -2926,8 +2890,7 @@ return_succp:
|
||||
return succp;
|
||||
}
|
||||
|
||||
static void filewriter_done(
|
||||
filewriter_t* fw)
|
||||
static void filewriter_done(filewriter_t* fw)
|
||||
{
|
||||
int i;
|
||||
logfile_id_t id;
|
||||
@ -3003,8 +2966,7 @@ static void filewriter_done(
|
||||
* version is even and read is consistent only if version hasn't changed
|
||||
* during the read.
|
||||
*/
|
||||
static void* thr_filewriter_fun(
|
||||
void* data)
|
||||
static void* thr_filewriter_fun(void* data)
|
||||
{
|
||||
skygw_thread_t* thr;
|
||||
filewriter_t* fwr;
|
||||
@ -3237,8 +3199,7 @@ static void* thr_filewriter_fun(
|
||||
}
|
||||
|
||||
|
||||
static void fnames_conf_done(
|
||||
fnames_conf_t* fn)
|
||||
static void fnames_conf_done(fnames_conf_t* fn)
|
||||
{
|
||||
switch (fn->fn_state)
|
||||
{
|
||||
@ -3255,8 +3216,7 @@ static void fnames_conf_done(
|
||||
}
|
||||
|
||||
|
||||
static void fnames_conf_free_memory(
|
||||
fnames_conf_t* fn)
|
||||
static void fnames_conf_free_memory(fnames_conf_t* fn)
|
||||
{
|
||||
if (fn->fn_debug_prefix != NULL) free(fn->fn_debug_prefix);
|
||||
if (fn->fn_debug_suffix!= NULL) free(fn->fn_debug_suffix);
|
||||
@ -3278,8 +3238,7 @@ static void fnames_conf_free_memory(
|
||||
*
|
||||
* @return the biggest sequence number used
|
||||
*/
|
||||
static int find_last_seqno(
|
||||
strpart_t* parts,
|
||||
static int find_last_seqno(strpart_t* parts,
|
||||
int seqno,
|
||||
int seqnoidx)
|
||||
{
|
||||
|
Reference in New Issue
Block a user