summaryrefslogtreecommitdiff
path: root/usr/src/man/man3picltree/picld_plugin_register.3picltree
blob: 142385cabb0df94a99d6245af8a65f3fa24e0b0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
'\" te
.\" Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved.
.\" 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 or http://www.opensolaris.org/os/licensing.  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]
.TH PICLD_PLUGIN_REGISTER 3PICLTREE "Sep 19, 2001"
.SH NAME
picld_plugin_register \- register plug-in with the daemon
.SH SYNOPSIS
.LP
.nf
\fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lpicltree\fR [ \fIlibrary\fR... ]
#include <picltree.h>

\fBint\fR \fBpicld_plugin_register\fR(\fBpicld_plugin_reg_t  *\fR\fIregp\fR);
.fi

.SH DESCRIPTION
.sp
.LP
The \fBpicld_plugin_register()\fR function is the function used by a plug-in
module to register itself with the PICL daemon upon initialization. The plug-in
provides its name and the entry points of the initialization and cleanup
routines in the \fIregp\fR argument.
.sp
.in +2
.nf
typedef struct {
    int   version;               /* PICLD_PLUGIN_VERSION */
    int   critical;              /* is plug-in critical? */
    char  *name;                 /* name of the plugin module */
    void  (*plugin_init)(void);  /* init/reinit function */
    void  (*plugin_fini)(void);  /* fini/cleanup function */
} picld_plugin_reg_t;
.fi
.in -2

.sp
.LP
The plug-in module also specifies whether it is a critical module for the
proper system operation. The critical field in the registration information is
set to \fBPICLD_PLUGIN_NON_CRITICAL\fR by plug-in modules that are not critical
to system operation, and is set to \fBPICLD_PLUGIN_CRITICAL\fR by plug-in
modules that are critical to the system operation. An environment control
plug-in module is an example for a \fBPICLD_PLUGIN_CRITICAL\fR type of plug-in
module.
.sp
.LP
The PICL daemon saves the information passed during registration in \fIregp\fR
in the order in which the plug-ins registered.
.sp
.LP
Upon initialization, the PICL daemon invokes the \fBplugin_init()\fR routine of
each of the registered plug-in modules in the order in which they registered.
In their \fBplugin_init()\fR routines, the plug-in modules collect the platform
configuration data and add it to the PICL tree using PICLTREE interfaces
(3PICLTREE).
.sp
.LP
On reinitialization, the PICL daemon invokes the \fBplugin_fini()\fR routines
of the registered plug-in modules in the reverse order of registration. Then,
the \fBplugin_init()\fR entry points are invoked again in the order in which
the plug-ins registered.
.SH RETURN VALUES
.sp
.LP
Upon successful completion, \fB0\fR is returned. On failure, a negative value
is returned.
.SH ERRORS
.sp
.ne 2
.na
\fB\fBPICL_NOTSUPPORTED\fR\fR
.ad
.RS 21n
Version not supported
.RE

.sp
.ne 2
.na
\fB\fBPICL_FAILURE\fR\fR
.ad
.RS 21n
General system failure
.RE

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Evolving
_
MT-Level	MT-Safe
.TE

.SH SEE ALSO
.sp
.LP
.BR libpicltree (3PICLTREE),
.BR attributes (7)