CUBRID Engine  latest
util_func.h File Reference
#include <sys/types.h>
#include <math.h>
#include <time.h>
Include dependency graph for util_func.h:

Go to the source code of this file.

Macros

#define UTIL_PID_ENVVAR_NAME   "UTIL_PID"
 
#define UTIL_infinity()   (HUGE_VAL)
 
#define SLEEP_MILISEC(sec, msec)
 
#define PRINT_AND_LOG_ERR_MSG(...)
 

Typedefs

typedef void(* SIG_HANDLER) (void)
 

Functions

unsigned int hashpjw (const char *)
 
int util_compare_filepath (const char *file1, const char *file2)
 
void util_arm_signal_handlers (SIG_HANDLER DB_INT32_handler, SIG_HANDLER quit_handler)
 
void util_disarm_signal_handlers (void)
 
char ** util_split_string (const char *str, const char *delim)
 
void util_free_string_array (char **array)
 
time_t util_str_to_time_since_epoch (char *str)
 
void util_shuffle_string_array (char **array, int count)
 
int util_log_write_result (int error)
 
int util_log_write_errid (int message_id,...)
 
int util_log_write_errstr (const char *format,...)
 
int util_log_write_warnstr (const char *format,...)
 
int util_log_write_command (int argc, char *argv[])
 
int util_bsearch (const void *key, const void *base, int n_elems, unsigned int sizeof_elem, int(*func_compare)(const void *, const void *), bool *out_found)
 
void util_get_second_and_ms_since_epoch (time_t *secs, int *msec)
 

Macro Definition Documentation

#define UTIL_infinity ( )    (HUGE_VAL)

Definition at line 35 of file util_func.h.

Referenced by qo_env_init().

#define UTIL_PID_ENVVAR_NAME   "UTIL_PID"

Definition at line 34 of file util_func.h.

Referenced by main(), and util_log_header().

Typedef Documentation

typedef void(* SIG_HANDLER) (void)

Definition at line 60 of file util_func.h.

Function Documentation

unsigned int hashpjw ( const char *  )

Definition at line 83 of file util_func.c.

References assert, and NULL.

Referenced by dl_validate_candidates(), pp_generic_case_hash(), and pp_generic_hash().

Here is the caller graph for this function:

void util_arm_signal_handlers ( SIG_HANDLER  DB_INT32_handler,
SIG_HANDLER  quit_handler 
)
int util_bsearch ( const void *  key,
const void *  base,
int  n_elems,
unsigned int  sizeof_elem,
int(*)(const void *, const void *)  func_compare,
bool out_found 
)

Definition at line 764 of file util_func.c.

References max, and min.

Referenced by file_extdata_find_ordered(), and vacuum_add_dropped_file().

Here is the caller graph for this function:

int util_compare_filepath ( const char *  file1,
const char *  file2 
)
void util_disarm_signal_handlers ( void  )

Definition at line 192 of file util_func.c.

References NULL, os_set_signal_handler(), user_interrupt_handler, and user_quit_handler.

Referenced by util_arm_signal_handlers().

Here is the caller graph for this function:

void util_free_string_array ( char **  array)

Definition at line 292 of file util_func.c.

References i, and NULL.

Referenced by boot_restart_client(), server_monitor_thr_f(), util_free_ha_conf(), util_get_num_of_ha_nodes(), util_is_replica_node(), and util_make_ha_conf().

Here is the caller graph for this function:

void util_get_second_and_ms_since_epoch ( time_t *  secs,
int *  msec 
)

Definition at line 829 of file util_func.c.

References assert, and NULL.

Referenced by db_calculate_current_time(), db_sys_date_and_epoch_time(), db_sys_datetime(), fetch_peek_arith(), logddl_get_time_string(), qexec_execute_query(), ut_time_string(), and util_log_header().

Here is the caller graph for this function:

int util_log_write_command ( int  argc,
char *  argv[] 
)

Definition at line 540 of file util_func.c.

References i, NULL, p, strlen, UTIL_LOG_MAX_MSG_SIZE, and util_log_write_internal().

Referenced by main().

Here is the caller graph for this function:

int util_log_write_errstr ( const char *  format,
  ... 
)
int util_log_write_result ( int  error)

Definition at line 448 of file util_func.c.

References NO_ERROR, NULL, and util_log_write_internal().

Referenced by main().

Here is the caller graph for this function:

int util_log_write_warnstr ( const char *  format,
  ... 
)

Definition at line 516 of file util_func.c.

References UTIL_LOG_MAX_MSG_SIZE, and util_log_write_internal().

Referenced by backupdb().

Here is the caller graph for this function:

void util_shuffle_string_array ( char **  array,
int  count 
)

Definition at line 412 of file util_func.c.

References i, and NULL.

Referenced by boot_client_all_finalize().

Here is the caller graph for this function:

char** util_split_string ( const char *  str,
const char *  delim 
)

Definition at line 247 of file util_func.c.

References cubregex::count(), NULL, and strdup().

Referenced by boot_restart_client(), server_monitor_thr_f(), util_split_ha_db(), util_split_ha_node(), and util_split_ha_sync().

Here is the caller graph for this function:

time_t util_str_to_time_since_epoch ( char *  str)

Definition at line 310 of file util_func.c.

References ER_GENERIC_ERROR, NO_ERROR, NULL, and strdup().

Referenced by applyinfo(), applylogdb(), and la_delay_replica().

Here is the caller graph for this function: