pacemaker  3.0.0-d8340737c4
Scalable High-Availability cluster resource manager
Functions
strings.h File Reference

API for strings. More...

#include <glib.h>
Include dependency graph for strings.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

long long crm_get_msec (const char *input)
 Parse a time+units string and return milliseconds equivalent. More...
 
int pcmk_parse_interval_spec (const char *input, guint *result_ms)
 Parse milliseconds from a Pacemaker interval specification. More...
 
gboolean crm_is_true (const char *s)
 
int crm_str_to_boolean (const char *s, int *ret)
 
char * crm_strdup_printf (char const *format,...) G_GNUC_PRINTF(1
 

Detailed Description

API for strings.

Definition in file strings.h.

Function Documentation

◆ crm_get_msec()

long long crm_get_msec ( const char *  input)

Parse a time+units string and return milliseconds equivalent.

Parameters
[in]inputString with a nonnegative number and optional unit (optionally with whitespace before and/or after the number). If missing, the unit defaults to seconds.
Returns
Milliseconds corresponding to string expression, or PCMK__PARSE_INT_DEFAULT on error

Definition at line 351 of file strings.c.

◆ crm_is_true()

gboolean crm_is_true ( const char *  s)

Definition at line 490 of file strings.c.

◆ crm_str_to_boolean()

int crm_str_to_boolean ( const char *  s,
int *  ret 
)

Definition at line 498 of file strings.c.

◆ crm_strdup_printf()

char* crm_strdup_printf ( char const *  format,
  ... 
)

◆ pcmk_parse_interval_spec()

int pcmk_parse_interval_spec ( const char *  input,
guint *  result_ms 
)

Parse milliseconds from a Pacemaker interval specification.

Parameters
[in]inputPacemaker time interval specification (a bare number of seconds; a number with a unit, optionally with whitespace before and/or after the number; or an ISO 8601 duration)
[out]result_msWhere to store milliseconds equivalent of input on success (limited to the range of an unsigned integer), or 0 if input is NULL or invalid
Returns
Standard Pacemaker return code (specifically, pcmk_rc_ok if input is valid or NULL, and EINVAL otherwise)

Definition at line 452 of file strings.c.