pacemaker  1.1.18-7fdfbbe
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
internal.h File Reference
#include <glib.h>
#include <dirent.h>
#include <unistd.h>
#include <sys/types.h>
#include <crm/common/logging.h>
Include dependency graph for internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CRM_FAIL_COUNT_PREFIX   "fail-count"
 
#define CRM_LAST_FAILURE_PREFIX   "last-failure"
 

Functions

char * generate_series_filename (const char *directory, const char *series, int sequence, gboolean bzip)
 
int get_last_sequence (const char *directory, const char *series)
 
void write_last_sequence (const char *directory, const char *series, int sequence, int max)
 
int crm_chown_last_sequence (const char *directory, const char *series, uid_t uid, gid_t gid)
 
gboolean crm_is_writable (const char *dir, const char *file, const char *user, const char *group, gboolean need_both)
 
void crm_sync_directory (const char *name)
 
char * crm_read_contents (const char *filename)
 
int crm_write_sync (int fd, const char *contents)
 
int crm_set_nonblocking (int fd)
 
int crm_procfs_process_info (struct dirent *entry, char *name, int *pid)
 
int crm_procfs_pid_of (const char *name)
 
unsigned int crm_procfs_num_cores (void)
 
void crm_schema_init (void)
 
void crm_schema_cleanup (void)
 
char * crm_concat (const char *prefix, const char *suffix, char join)
 
void g_hash_destroy_str (gpointer data)
 
long long crm_int_helper (const char *text, char **end_text)
 
bool crm_starts_with (const char *str, const char *prefix)
 Check whether a string starts with a certain sequence. More...
 
gboolean crm_ends_with (const char *s, const char *match)
 
gboolean crm_ends_with_ext (const char *s, const char *match)
 
char * add_list_element (char *list, const char *value)
 
bool crm_compress_string (const char *data, int length, int max, char **result, unsigned int *result_len)
 
gint crm_alpha_sort (gconstpointer a, gconstpointer b)
 Compare two strings alphabetically (case-insensitive) More...
 

Macro Definition Documentation

#define CRM_FAIL_COUNT_PREFIX   "fail-count"

Definition at line 88 of file internal.h.

#define CRM_LAST_FAILURE_PREFIX   "last-failure"

Definition at line 89 of file internal.h.

Function Documentation

char* add_list_element ( char *  list,
const char *  value 
)

Definition at line 394 of file strings.c.

gint crm_alpha_sort ( gconstpointer  a,
gconstpointer  b 
)

Compare two strings alphabetically (case-insensitive)

Parameters
[in]aFirst string to compare
[in]bSecond string to compare
Returns
0 if strings are equal, -1 if a < b, 1 if a > b
Note
Usable as a GCompareFunc with g_list_sort(). NULL is considered less than non-NULL.

Definition at line 472 of file strings.c.

int crm_chown_last_sequence ( const char *  directory,
const char *  series,
uid_t  uid,
gid_t  gid 
)

Definition at line 251 of file io.c.

bool crm_compress_string ( const char *  data,
int  length,
int  max,
char **  result,
unsigned int *  result_len 
)

Definition at line 413 of file strings.c.

char* crm_concat ( const char *  prefix,
const char *  suffix,
char  join 
)

Definition at line 32 of file strings.c.

gboolean crm_ends_with ( const char *  s,
const char *  match 
)

Definition at line 302 of file strings.c.

gboolean crm_ends_with_ext ( const char *  s,
const char *  match 
)

Definition at line 331 of file strings.c.

long long crm_int_helper ( const char *  text,
char **  end_text 
)

Definition at line 80 of file strings.c.

gboolean crm_is_writable ( const char *  dir,
const char *  file,
const char *  user,
const char *  group,
gboolean  need_both 
)

Definition at line 279 of file io.c.

unsigned int crm_procfs_num_cores ( void  )

Definition at line 152 of file procfs.c.

int crm_procfs_pid_of ( const char *  name)

Definition at line 118 of file procfs.c.

int crm_procfs_process_info ( struct dirent *  entry,
char *  name,
int *  pid 
)

Definition at line 47 of file procfs.c.

char* crm_read_contents ( const char *  filename)

Definition at line 395 of file io.c.

void crm_schema_cleanup ( void  )

Definition at line 512 of file schemas.c.

void crm_schema_init ( void  )

Definition at line 273 of file schemas.c.

int crm_set_nonblocking ( int  fd)

Definition at line 471 of file io.c.

bool crm_starts_with ( const char *  str,
const char *  prefix 
)

Check whether a string starts with a certain sequence.

Parameters
[in]strString to check
[in]matchSequence to match against beginning of str
Returns
TRUE if str begins with match, FALSE otherwise
Note
This is equivalent to !strncmp(s, prefix, strlen(prefix)) but is likely less efficient when prefix is a string literal if the compiler optimizes away the strlen() at compile time, and more efficient otherwise.

Definition at line 252 of file strings.c.

void crm_sync_directory ( const char *  name)

Definition at line 358 of file io.c.

int crm_write_sync ( int  fd,
const char *  contents 
)

Definition at line 441 of file io.c.

void g_hash_destroy_str ( gpointer  data)

Definition at line 74 of file strings.c.

char* generate_series_filename ( const char *  directory,
const char *  series,
int  sequence,
gboolean  bzip 
)

Definition at line 86 of file io.c.

int get_last_sequence ( const char *  directory,
const char *  series 
)

Definition at line 122 of file io.c.

void write_last_sequence ( const char *  directory,
const char *  series,
int  sequence,
int  max 
)

Definition at line 194 of file io.c.