Beispiel #1
0
static bool
_node_state_equal (int i, const char *str)
{
	int len = strlen (str);

	if ((strncasecmp(node_state_string_compact(i), str, len) == 0) ||
	    (strncasecmp(node_state_string(i),         str, len) == 0))
		return (true);
	return (false);
}
Beispiel #2
0
int _print_state_compact(sinfo_data_t * sinfo_data, int width,
			bool right_justify, char *suffix)
{
	if (sinfo_data && sinfo_data->nodes_total) {
		char *upper_state = node_state_string_compact(
			sinfo_data->node_state);
		char *lower_state = _str_tolower(upper_state);
		_print_str(lower_state, width, right_justify, true);
		xfree(lower_state);
	} else if (sinfo_data)
		_print_str("n/a", width, right_justify, true);
	else
		_print_str("STATE", width, right_justify, true);

	if (suffix)
		printf("%s", suffix);
	return SLURM_SUCCESS;
}