pacemaker  2.1.8-3980678f03
Scalable High-Availability cluster resource manager
Macros | Functions
scores.h File Reference

Pacemaker APIs related to scores. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PCMK_SCORE_INFINITY   1000000
 Integer score to use to represent "infinity". More...
 

Functions

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...
 

Detailed Description

Pacemaker APIs related to scores.

Definition in file scores.h.

Macro Definition Documentation

◆ PCMK_SCORE_INFINITY

#define PCMK_SCORE_INFINITY   1000000

Integer score to use to represent "infinity".

Definition at line 24 of file scores.h.

Function Documentation

◆ char2score()

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.

Parameters
[in]scoreScore as string
Returns
Integer value corresponding to score

Definition at line 36 of file scores.c.

◆ pcmk_readable_score()

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.

Parameters
[in]scoreScore to display
Returns
Pointer to static memory containing string representation of score
Note
Subsequent calls to this function will overwrite the returned value, so it should be used only in a local context such as a printf()-style statement.

Definition at line 86 of file scores.c.