cfg.h revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _CFG_H
#define _CFG_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _CFG_IMPL_H
/*
* These are really declared in cfg_impl.h, declare as dummy's here to
* allow clients to compile without including cfg_impl.h.
*/
#endif /* _CFG_IMPL_H */
int numflds, ...);
int cfg_get_single_option(CFGFILE *, int, const char *, char *, char *, int);
int cfg_del_option(CFGFILE *, int, const char *, char *);
void cfg_free_section(char ***, int);
/*
* Handle cluster configuration
*/
#define FP_SUN_CLUSTER(x) \
/*
* rewind sections
*/
#define CFG_SEC_CONF 0 /* configuration section */
/*
* parser sections
*/
#define CFG_PARSE_CONF 0 /* config section key */
/*
* error codes
*/
#define CFG_ENONFATAL 0 /* non fatal error */
/*
* some error strings
*/
#define CFG_NOTLOCKED "Configuration not locked"
#define CFG_RDFAILED "Unable to read configuration"
#define CFG_EINVAL "Invalid Argument"
#define CFG_EGENERIC "Generic cfg failure"
/*
* location modes
*/
#define CFG_LOC_SET_LOCAL 0
#define CFG_LOC_GET_LOCAL 1
#define CFG_LOC_SET_CLUSTER 2
#define CFG_LOC_GET_CLUSTER 3
/*
* location strings
*/
#define CFG_LOCAL_LOCATION "/etc/dscfg_local"
#define CFG_CLUSTER_LOCATION "/etc/dscfg_cluster"
/*
* lock mode
*/
typedef enum {
} CFGLOCK;
void cfg_unlock(CFGFILE *);
int cfg_commit(CFGFILE *);
int cfg_dgname_islocal(char *, char **); /* find locality of dg */
int cfg_iscluster(void); /* running in a cluster? */
int cfg_issuncluster(void); /* running in a Sun Cluster? */
void cfg_invalidate_sizes(int);
/*
*/
#define CFG_USER_ERR 1
#define CFG_USER_OK 2
#define CFG_USER_FIRST 3
#define CFG_USER_LAST 4
#define CFG_USER_GONE 5
#define CFG_USER_REPEAT 6
void cfg_unload_dsvols(); /* unload dsvol: section */
void cfg_unload_svols(); /* unload sv: section */
void cfg_unload_shadows(); /* unload ii: */
int cfg_get_canonical_name(CFGFILE *, const char *, char **);
#ifdef __cplusplus
}
#endif
#endif /* _CFG_H */