corosync 3.1.7
Macros | Enumerations | Functions
exec/util.h File Reference
#include <sys/time.h>
#include <corosync/corotypes.h>
Include dependency graph for exec/util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define min(a, b)   ((a) < (b) ? (a) : (b))
 
#define corosync_exit_error(err)   _corosync_exit_error ((err), __FILE__, __LINE__)
 

Enumerations

enum  e_corosync_done {
  COROSYNC_DONE_EXIT = 0 , COROSYNC_DONE_FORK = 4 , COROSYNC_DONE_LOGCONFIGREAD = 7 , COROSYNC_DONE_MAINCONFIGREAD = 8 ,
  COROSYNC_DONE_LOGSETUP = 9 , COROSYNC_DONE_ICMAP = 12 , COROSYNC_DONE_INIT_SERVICES = 13 , COROSYNC_DONE_FATAL_ERR = 15 ,
  COROSYNC_DONE_DIR_NOT_PRESENT = 16 , COROSYNC_DONE_ACQUIRE_LOCK = 17 , COROSYNC_DONE_ALREADY_RUNNING = 18 , COROSYNC_DONE_STD_TO_NULL_REDIR = 19 ,
  COROSYNC_DONE_SERVICE_ENGINE_INIT = 20 , COROSYNC_DONE_STORE_RINGID = 21 , COROSYNC_DONE_STATS = 22 , COROSYNC_DONE_PLOAD = 99
}
 

Functions

cs_time_t clust_time_now (void)
 Get the time of day and convert to nanoseconds. More...
 
int name_match (cs_name_t *name1, cs_name_t *name2)
 Compare two names. More...
 
void _corosync_exit_error (enum e_corosync_done err, const char *file, unsigned int line) __attribute__((noreturn))
 
void _corosync_out_of_memory_error (void) __attribute__((noreturn))
 
char * getcs_name_t (cs_name_t *name)
 
void setcs_name_t (cs_name_t *name, char *str)
 
int cs_name_tisEqual (cs_name_t *str1, char *str2)
 
const char * short_service_name_get (uint32_t service_id, char *buf, size_t buf_size)
 Get the short name of a service from the service_id. More...
 
const char * get_state_dir (void)
 
int util_is_valid_knet_crypto_model (const char *val, const char **list_str, int machine_parseable_str, const char *error_string_prefix, const char **error_string)
 
int util_is_valid_knet_compress_model (const char *val, const char **list_str, int machine_parseable_str, const char *error_string_prefix, const char **error_string)
 

Macro Definition Documentation

◆ corosync_exit_error

#define corosync_exit_error (   err)    _corosync_exit_error ((err), __FILE__, __LINE__)

Definition at line 72 of file exec/util.h.

◆ min

#define min (   a,
 
)    ((a) < (b) ? (a) : (b))

Definition at line 66 of file exec/util.h.

Enumeration Type Documentation

◆ e_corosync_done

Enumerator
COROSYNC_DONE_EXIT 
COROSYNC_DONE_FORK 
COROSYNC_DONE_LOGCONFIGREAD 
COROSYNC_DONE_MAINCONFIGREAD 
COROSYNC_DONE_LOGSETUP 
COROSYNC_DONE_ICMAP 
COROSYNC_DONE_INIT_SERVICES 
COROSYNC_DONE_FATAL_ERR 
COROSYNC_DONE_DIR_NOT_PRESENT 
COROSYNC_DONE_ACQUIRE_LOCK 
COROSYNC_DONE_ALREADY_RUNNING 
COROSYNC_DONE_STD_TO_NULL_REDIR 
COROSYNC_DONE_SERVICE_ENGINE_INIT 
COROSYNC_DONE_STORE_RINGID 
COROSYNC_DONE_STATS 
COROSYNC_DONE_PLOAD 

Definition at line 47 of file exec/util.h.

Function Documentation

◆ _corosync_exit_error()

void _corosync_exit_error ( enum e_corosync_done  err,
const char *  file,
unsigned int  line 
)

◆ _corosync_out_of_memory_error()

void _corosync_out_of_memory_error ( void  )

Definition at line 118 of file util.c.

◆ clust_time_now()

cs_time_t clust_time_now ( void  )

Get the time of day and convert to nanoseconds.

Definition at line 103 of file util.c.

◆ cs_name_tisEqual()

int cs_name_tisEqual ( cs_name_t str1,
char *  str2 
)

Definition at line 165 of file util.c.

References cs_name_t::length, and cs_name_t::value.

◆ get_state_dir()

const char * get_state_dir ( void  )

Definition at line 174 of file util.c.

References CS_OK, icmap_get_string(), and LOCALSTATEDIR.

◆ getcs_name_t()

char * getcs_name_t ( cs_name_t name)

Definition at line 142 of file util.c.

References CS_MAX_NAME_LENGTH, cs_name_t::length, min, and cs_name_t::value.

◆ name_match()

int name_match ( cs_name_t name1,
cs_name_t name2 
)

Compare two names.

returns non-zero on match.

Definition at line 91 of file util.c.

References cs_name_t::length, and cs_name_t::value.

◆ setcs_name_t()

void setcs_name_t ( cs_name_t name,
char *  str 
)

Definition at line 155 of file util.c.

References CS_MAX_NAME_LENGTH, cs_name_t::length, and cs_name_t::value.

◆ short_service_name_get()

const char * short_service_name_get ( uint32_t  service_id,
char *  buf,
size_t  buf_size 
)

Get the short name of a service from the service_id.

Definition at line 74 of file util.c.

◆ util_is_valid_knet_compress_model()

int util_is_valid_knet_compress_model ( const char *  val,
const char **  list_str,
int  machine_parseable_str,
const char *  error_string_prefix,
const char **  error_string 
)

Definition at line 279 of file util.c.

◆ util_is_valid_knet_crypto_model()

int util_is_valid_knet_crypto_model ( const char *  val,
const char **  list_str,
int  machine_parseable_str,
const char *  error_string_prefix,
const char **  error_string 
)

Definition at line 213 of file util.c.