Blame src/status.c

Packit Service db8df9
/*
Packit Service db8df9
 * Intel(R) Enclosure LED Utilities
Packit Service db8df9
 * Copyright (C) 2009-2019 Intel Corporation.
Packit Service db8df9
 *
Packit Service db8df9
 * This program is free software; you can redistribute it and/or modify it
Packit Service db8df9
 * under the terms and conditions of the GNU General Public License,
Packit Service db8df9
 * version 2, as published by the Free Software Foundation.
Packit Service db8df9
 *
Packit Service db8df9
 * This program is distributed in the hope it will be useful, but WITHOUT
Packit Service db8df9
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
Packit Service db8df9
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
Packit Service db8df9
 * more details.
Packit Service db8df9
 *
Packit Service db8df9
 * You should have received a copy of the GNU General Public License along with
Packit Service db8df9
 * this program; if not, write to the Free Software Foundation, Inc.,
Packit Service db8df9
 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
Packit Service db8df9
 *
Packit Service db8df9
 */
Packit Service db8df9
Packit Service db8df9
#include "config.h"
Packit Service db8df9
#include "status.h"
Packit Service db8df9
Packit Service db8df9
/**
Packit Service db8df9
 */
Packit Service db8df9
#define _S_CODE(__code) \
Packit Service db8df9
	case __code: return #__code
Packit Service db8df9
Packit Service db8df9
/**
Packit Service db8df9
 */
Packit Service db8df9
char *strstatus(status_t scode)
Packit Service db8df9
{
Packit Service db8df9
	switch (scode) {
Packit Service db8df9
		_S_CODE(STATUS_SUCCESS);
Packit Service db8df9
		_S_CODE(STATUS_BUFFER_OVERFLOW);
Packit Service db8df9
		_S_CODE(STATUS_INVALID_NODE);
Packit Service db8df9
		_S_CODE(STATUS_OUT_OF_MEMORY);
Packit Service db8df9
		_S_CODE(STATUS_OUT_OF_RANGE);
Packit Service db8df9
		_S_CODE(STATUS_DATA_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_IBPI_DETERMINE_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_INVALID_PATH);
Packit Service db8df9
		_S_CODE(STATUS_INVALID_SUBOPTION);
Packit Service db8df9
		_S_CODE(STATUS_INVALID_STATE);
Packit Service db8df9
		_S_CODE(STATUS_NULL_POINTER);
Packit Service db8df9
		_S_CODE(STATUS_SIZE_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_FILE_OPEN_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_FILE_READ_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_FILE_WRITE_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_FILE_LOCK_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_SYSFS_PATH_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_SYSFS_INIT_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_SYSFS_SCAN_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_SYSFS_RESET_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_DIR_OPEN_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_LIST_EMPTY);
Packit Service db8df9
		_S_CODE(STATUS_LIST_INIT_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_BLOCK_LIST_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_VOLUM_LIST_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_CNTRL_LIST_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_SLAVE_LIST_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_CNTNR_LIST_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_INVALID_FORMAT);
Packit Service db8df9
		_S_CODE(STATUS_LEDMON_INIT);
Packit Service db8df9
		_S_CODE(STATUS_LEDMON_RUNNING);
Packit Service db8df9
		_S_CODE(STATUS_ONEXIT_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_INVALID_CONTROLLER);
Packit Service db8df9
		_S_CODE(STATUS_NOT_SUPPORTED);
Packit Service db8df9
		_S_CODE(STATUS_STAT_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_CMDLINE_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_NOT_A_PRIVILEGED_USER);
Packit Service db8df9
		_S_CODE(STATUS_ENCLO_LIST_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_SLOTS_LIST_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_CONFIG_FILE_ERROR);
Packit Service db8df9
		_S_CODE(STATUS_LOG_FILE_ERROR);
Packit Service db8df9
	default:
Packit Service db8df9
		return "???";
Packit Service db8df9
	}
Packit Service db8df9
}