Current File : //usr/include/suri_strings.h
/*
 * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
 */

#ifndef	_SURI_STRINGS_H
#define	_SURI_STRINGS_H

/*
 * This is an internal libsuri header file. Should be never included from
 * outside of libsuri itself.
 */

#include <libintl.h>

#ifdef	__cplusplus
extern "C" {
#endif

#if !defined(TEXT_DOMAIN)
#define	TEXT_DOMAIN	"SYS_TEST"
#endif

#define	SURIGTEXT(x)	dgettext(TEXT_DOMAIN, x)

/*
 * Common library [error] message strings
 *
 * If a message is not enclosed in SURIGTEXT() it means that it is part of
 * another string enclosed in SURIGTEXT().
 *
 * Messages are constructed so that we never have a conversion specifier (%) in
 * them in case the localized strings got messed up during translation.
 */
#define	ERR_SURI_NOMEM		SURIGTEXT("Out of memory")
#define	ERR_SURI_NAMETOOLONG	SURIGTEXT("Name is too long")
#define	ERR_SURI_PARSE_FAILED	SURIGTEXT("Failed to parse URI")
#define	ERR_SURI_MAP_FAILED	SURIGTEXT("Failed to map URI")
#define	ERR_SURI_LOOKUP_MAPPING_FAILED \
	SURIGTEXT("Failed to lookup mapping for URI")
#define	ERR_SURI_UNMAP_FAILED	SURIGTEXT("Failed to unmap URI")
#define	ERR_SURI_NORMALIZE_FAILED	SURIGTEXT("Failed to normalize URI")
#define	ERR_SURI_EMPTY_URI	SURIGTEXT("Empty URI string")
#define	ERR_SURI_CREATE_FAILED	SURIGTEXT("Failed to create object for URI")
#define	ERR_SURI_DESTROY_FAILED	SURIGTEXT("Failed to destroy object for URI")
#define	ERR_SURI_FOR_TARGET	SURIGTEXT("for target")
#define	ERR_SURI_AND		SURIGTEXT("and")
#define	ERR_SURI_NEEDS_MDEV	\
	SURIGTEXT("This URI type needs to be looked up through mapped device")
/* sometimes we need to insert the type of the URI before the "URI" string */
#define	ERR_SURI_LOOKUP_FAILED	"Failed to look up"
/* this is for non-URI type specific case */
#define	ERR_SURI_LOOKUP_FAILED2	SURIGTEXT(ERR_SURI_LOOKUP_FAILED " URI")
#define	ERR_SURI_NO_UNIT_FOUND	SURIGTEXT("No logical unit found")
#define	ERR_SURI_NO_DEV_LINK \
	SURIGTEXT("Logical unit does not have link under /dev")
#define	ERR_SURI_FOR_DEV	"for device:"
#define	ERR_SURI_FOR_LUNAME	"for logical unit name:"
#define	ERR_SURI_LOOKUP_URI_FAILED_FOR_DEV \
	SURIGTEXT(ERR_SURI_LOOKUP_FAILED " URI " ERR_SURI_FOR_DEV)
#define	ERR_SURI_CREATE_PROPS	SURIGTEXT("Getting create object property")
#define	ERR_SURI_SET_PROP	SURIGTEXT("Failed to set property value")
#define	ERR_SURI_SVC_ENABLE	SURIGTEXT("Failed to enable service")
#define	ERR_SURI_NOT_IN_SLASH_DEV \
	SURIGTEXT("Absolute device path must start with " _PATH_DEV)
#define	ERR_SURI_SLICE_PRESENT	\
	SURIGTEXT("Device path with slice does not represent entire disk")
#define	ERR_SURI_NON_PATH_SPECIFIC	SURIGTEXT("Non-path specific")
#define	ERR_SURI_SHOULD_IDENTIFY_DEV	\
	SURIGTEXT("URI should be used to identify device")
#define	ERR_SURI_WITH_MULTIPATHING	\
	SURIGTEXT("which has multipathing enabled.")
#define	ERR_SURI_NOT_ENTIRE_DISK \
	SURIGTEXT("Device path does not represent entire disk")
#define	ERR_SURI_NO_SUPPORTED_PROPS \
	SURIGTEXT("No input properties supported")
/*
 * Intentionally without SURIGTEXT().  The message is used like this but is also
 * modified elsewhere by an appended string.  SURIGTEXT cannot be applied here.
 */
#define	ERR_SURI_DI_INIT	"Cannot create a kernel device tree snapshot"
#define	ERR_SURI_MAPPED_TO_DIFF		"URI is mapped with"
#define	ERR_SURI_STAT_FAILED		"Cannot get file status"
#define	ERR_SURI_MMAP_FAILED		"Unable to mmap data"
#define	ERR_SURI_MNTOPTS_TOOLONG	"Mount options are too long"
#define	ERR_SURI_PROPVAL_TOOLONG	"Property value is too long"

#ifdef __cplusplus
}
#endif

#endif /* _SURI_STRINGS_H */