pacemaker
2.1.9-49aab99839
Scalable High-Availability cluster resource manager
|
Pacemaker APIs related to scores. More...
Go to the source code of this file.
Macros | |
#define | PCMK_SCORE_INFINITY 1000000 |
Integer score to use to represent "infinity". More... | |
Functions | |
int | pcmk_parse_score (const char *score_s, int *score, int default_score) |
Parse an integer score from a string. More... | |
const char * | pcmk_readable_score (int score) |
Return a displayable static string for a score value. More... | |
int | char2score (const char *score) |
Get the integer value of a score string. More... | |
Pacemaker APIs related to scores.
Definition in file scores.h.
#define PCMK_SCORE_INFINITY 1000000 |
int char2score | ( | const char * | score | ) |
Get the integer value of a score string.
Given a string representation of a score, return the integer equivalent. This accepts infinity strings as well as red, yellow, and green, and bounds the result to +/-INFINITY.
[in] | score | Score as string |
score
int pcmk_parse_score | ( | const char * | score_s, |
int * | score, | ||
int | default_score | ||
) |
Parse an integer score from a string.
Parse an integer score from a string. This accepts infinity strings as well as red, yellow, and green, and bounds the result to +/-INFINITY.
[in] | score_s | Score as string |
[out] | score | Where to store integer value corresponding to score_s (may be NULL to only check validity) |
[in] | default_score | Value to use if score_s is NULL or invalid |
const char* pcmk_readable_score | ( | int | score | ) |
Return a displayable static string for a score value.
Given a score value, return a pointer to a static string representation of the score suitable for log messages, output, etc.
[in] | score | Score to display |
score