fmd_conf.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _FMD_CONF_H
#define _FMD_CONF_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
struct fmd_conf_param;
typedef struct fmd_conf_ops {
int (*co_set)(struct fmd_conf_param *, const char *);
void (*co_get)(const struct fmd_conf_param *, void *);
int (*co_del)(struct fmd_conf_param *, const char *);
void (*co_free)(struct fmd_conf_param *);
typedef struct fmd_conf_formal {
const char *cf_name;
const fmd_conf_ops_t *cf_ops;
const char *cf_default;
typedef struct fmd_conf_param {
const fmd_conf_formal_t *cp_formal;
struct fmd_conf_param *cp_next;
union {
char *cpv_str;
void *cpv_ptr;
} cp_value;
typedef struct fmd_conf {
const fmd_conf_formal_t *cf_argv;
int cf_argc;
} fmd_conf_t;
typedef struct fmd_conf_verb {
const char *cv_name;
int (*cv_exec)(fmd_conf_t *, int, char *[]);
typedef struct fmd_conf_path {
const char **cpa_argv;
int cpa_argc;
typedef struct fmd_conf_mode {
const char *cm_name;
const char *cm_desc;
extern int fmd_conf_mode_set(const fmd_conf_mode_t *,
fmd_conf_param_t *, const char *);
extern void fmd_conf_mode_get(const fmd_conf_param_t *, void *);
extern int fmd_conf_notsup(fmd_conf_param_t *, const char *);
extern void fmd_conf_nop(fmd_conf_param_t *);
extern const char FMD_PROP_SUBSCRIPTIONS[]; /* fmd_conf_list */
extern const char FMD_PROP_DICTIONARIES[]; /* fmd_conf_list */
extern void fmd_conf_merge(fmd_conf_t *, const char *);
extern void fmd_conf_close(fmd_conf_t *);
extern int fmd_conf_getprop(fmd_conf_t *, const char *, void *);
extern int fmd_conf_setprop(fmd_conf_t *, const char *, const char *);
extern int fmd_conf_delprop(fmd_conf_t *, const char *, const char *);
#ifdef __cplusplus
}
#endif
#endif /* _FMD_CONF_H */