xref: /onnv-gate/usr/src/lib/libscf/common/libscf_impl.h (revision 12967:ab9ae749152f)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
55777Stw21770  * Common Development and Distribution License (the "License").
65777Stw21770  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
211219Sraf 
220Sstevel@tonic-gate /*
23*12967Sgavin.maltby@oracle.com  * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #ifndef	_LIBSCF_IMPL_H
270Sstevel@tonic-gate #define	_LIBSCF_IMPL_H
280Sstevel@tonic-gate 
290Sstevel@tonic-gate #include <libscf.h>
300Sstevel@tonic-gate #include <libscf_priv.h>
310Sstevel@tonic-gate 
320Sstevel@tonic-gate #ifdef	__cplusplus
330Sstevel@tonic-gate extern "C" {
340Sstevel@tonic-gate #endif
350Sstevel@tonic-gate 
360Sstevel@tonic-gate /*
370Sstevel@tonic-gate  * This macro must be extended if additional FMRI prefixes are defined
380Sstevel@tonic-gate  */
390Sstevel@tonic-gate #define	SCF_FMRI_PREFIX_MAX_LEN		(sizeof (SCF_FMRI_SVC_PREFIX) > \
400Sstevel@tonic-gate 					    sizeof (SCF_FMRI_FILE_PREFIX) ? \
410Sstevel@tonic-gate 					    sizeof (SCF_FMRI_SVC_PREFIX) - 1 : \
420Sstevel@tonic-gate 					    sizeof (SCF_FMRI_FILE_PREFIX) - 1)
430Sstevel@tonic-gate 
440Sstevel@tonic-gate int scf_setup_error(void);
450Sstevel@tonic-gate int scf_set_error(scf_error_t);			/* returns -1 */
460Sstevel@tonic-gate 
470Sstevel@tonic-gate typedef enum {
480Sstevel@tonic-gate 	SCF_MSG_ARGTOOLONG,
490Sstevel@tonic-gate 	SCF_MSG_PATTERN_NOINSTANCE,
500Sstevel@tonic-gate 	SCF_MSG_PATTERN_NOINSTSVC,
510Sstevel@tonic-gate 	SCF_MSG_PATTERN_NOSERVICE,
520Sstevel@tonic-gate 	SCF_MSG_PATTERN_NOENTITY,
530Sstevel@tonic-gate 	SCF_MSG_PATTERN_MULTIMATCH,
540Sstevel@tonic-gate 	SCF_MSG_PATTERN_POSSIBLE,
550Sstevel@tonic-gate 	SCF_MSG_PATTERN_LEGACY
560Sstevel@tonic-gate } scf_msg_t;
570Sstevel@tonic-gate 
58*12967Sgavin.maltby@oracle.com scf_type_t scf_true_base_type(scf_type_t);
590Sstevel@tonic-gate const char *scf_get_msg(scf_msg_t);
60*12967Sgavin.maltby@oracle.com int ismember(const scf_error_t, const scf_error_t[]);
61*12967Sgavin.maltby@oracle.com int32_t state_from_string(const char *, size_t);
620Sstevel@tonic-gate 
630Sstevel@tonic-gate #ifdef	__cplusplus
640Sstevel@tonic-gate }
650Sstevel@tonic-gate #endif
660Sstevel@tonic-gate 
670Sstevel@tonic-gate #endif	/* _LIBSCF_IMPL_H */
68