8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / lib / libreparse / common / rp_plugin.h
bloba12b45776cd2d8658fec47f2fddeea08866ab8e2
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _RP_PLUGIN_H
28 #define _RP_PLUGIN_H
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
34 #include <sys/types.h>
36 #define RP_LIB_DIR "/usr/lib/reparse"
37 #define RP_PLUGIN_V1 1
40 * some error codes
42 #define RP_OK 0
43 #define RP_NO_PLUGIN ENOENT
44 #define RP_NO_MEMORY ENOMEM
45 #define RP_NO_PLUGIN_DIR ENOTDIR
46 #define RP_INVALID_PROTOCOL EINVAL
48 extern int rp_plugin_init();
50 typedef struct rp_plugin_ops {
51 int rpo_version;
52 int (*rpo_init)(void);
53 int (*rpo_fini)(void);
54 char *(*rpo_svc_types)(void);
55 boolean_t (*rpo_supports_svc)(const char *);
56 int (*rpo_form)(const char *, const char *, char *, size_t *);
57 int (*rpo_deref)(const char *, const char *, char *, size_t *);
58 } rp_plugin_ops_t;
60 typedef struct rp_proto_plugin {
61 struct rp_proto_plugin *plugin_next;
62 rp_plugin_ops_t *plugin_ops;
63 void *plugin_handle;
64 } rp_proto_plugin_t;
66 typedef struct rp_proto_handle {
67 int rp_num_proto;
68 rp_plugin_ops_t **rp_ops;
69 } rp_proto_handle_t;
71 #ifdef __cplusplus
73 #endif
75 #endif /* _RP_PLUGIN_H */