Deleted Added
full compact
sysctl_ctx_init.9 (75670) sysctl_ctx_init.9 (79727)
1.\"
2.\" Copyright (c) 2000, Andrzej Bialecki <abial@FreeBSD.org>
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
1.\"
2.\" Copyright (c) 2000, Andrzej Bialecki <abial@FreeBSD.org>
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\" $FreeBSD: head/share/man/man9/sysctl_ctx_init.9 75670 2001-04-18 15:54:10Z ru $
28.\" $FreeBSD: head/share/man/man9/sysctl_ctx_init.9 79727 2001-07-14 19:41:16Z schweikh $
29.\"
30.Dd July 15, 2000
31.Dt SYSCTL_CTX_INIT 9
32.Os
33.Sh NAME
34.Nm sysctl_ctx_init ,
35.Nm sysctl_ctx_free ,
36.Nm sysctl_ctx_entry_add ,

--- 149 unchanged lines hidden (view full) ---

186 ...
187struct sysctl_ctx_list clist;
188struct sysctl_oid *oidp;
189int a_int;
190char *string = "dynamic sysctl";
191 ...
192
193sysctl_ctx_init(&clist);
29.\"
30.Dd July 15, 2000
31.Dt SYSCTL_CTX_INIT 9
32.Os
33.Sh NAME
34.Nm sysctl_ctx_init ,
35.Nm sysctl_ctx_free ,
36.Nm sysctl_ctx_entry_add ,

--- 149 unchanged lines hidden (view full) ---

186 ...
187struct sysctl_ctx_list clist;
188struct sysctl_oid *oidp;
189int a_int;
190char *string = "dynamic sysctl";
191 ...
192
193sysctl_ctx_init(&clist);
194oidp = SYSCTL_ADD_NODE( &clist, SYSCTL_STATIC_CHILDREN(/* tree top */),
194oidp = SYSCTL_ADD_NODE( &clist, SYSCTL_STATIC_CHILDREN(/* tree top */),
195 OID_AUTO, newtree, CTFLAG_RW, 0, "new top level tree");
196oidp = SYSCTL_ADD_INT( &clist, SYSCTL_CHILDREN(oidp),
197 OID_AUTO, newint, CTLFLAG_RW, &a_int, 0, "new int leaf");
198 ...
195 OID_AUTO, newtree, CTFLAG_RW, 0, "new top level tree");
196oidp = SYSCTL_ADD_INT( &clist, SYSCTL_CHILDREN(oidp),
197 OID_AUTO, newint, CTLFLAG_RW, &a_int, 0, "new int leaf");
198 ...
199oidp = SYSCTL_ADD_NODE( &clist, SYSCTL_STATIC_CHILDREN(_debug),
199oidp = SYSCTL_ADD_NODE( &clist, SYSCTL_STATIC_CHILDREN(_debug),
200 OID_AUTO, newtree, CTFLAG_RW, 0, "new tree under debug");
201oidp = SYSCTL_ADD_STRING( &clist, SYSCTL_CHILDREN(oidp),
202 OID_AUTO, newstring, CTLFLAG_R, string, 0, "new string leaf");
203 ...
204/* Now we can free up the oids */
205if(sysctl_ctx_free(&clist)) {
206 printf("can't free this context - other oids depend on it");
207 return(ENOTEMPTY);

--- 38 unchanged lines hidden ---
200 OID_AUTO, newtree, CTFLAG_RW, 0, "new tree under debug");
201oidp = SYSCTL_ADD_STRING( &clist, SYSCTL_CHILDREN(oidp),
202 OID_AUTO, newstring, CTLFLAG_R, string, 0, "new string leaf");
203 ...
204/* Now we can free up the oids */
205if(sysctl_ctx_free(&clist)) {
206 printf("can't free this context - other oids depend on it");
207 return(ENOTEMPTY);

--- 38 unchanged lines hidden ---