aboutsummaryrefslogtreecommitdiff
path: root/man/rc_deptree.3
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-12-24 22:03:27 +0000
committerRoy Marples <roy@marples.name>2007-12-24 22:03:27 +0000
commit5741ad634d778df45d802aa3ee1de5bee178f138 (patch)
treea79922fad6a955220b11d815372b333f721465f6 /man/rc_deptree.3
parent7de72229a55300a7a22bfe4a4da43207f3fe475f (diff)
Add man pages for all librc functions.
Diffstat (limited to 'man/rc_deptree.3')
-rw-r--r--man/rc_deptree.3114
1 files changed, 114 insertions, 0 deletions
diff --git a/man/rc_deptree.3 b/man/rc_deptree.3
new file mode 100644
index 00000000..e29e13ee
--- /dev/null
+++ b/man/rc_deptree.3
@@ -0,0 +1,114 @@
+.\" Copyright 2007 Roy Marples
+.\" All rights reserved
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.Dd Dec 24, 2007
+.Dt RC_DEPTREE 3 SMM
+.Os OpenRC
+.Sh NAME
+.Nm rc_deptree_update , rc_deptree_update_needed , rc_deptree_load ,
+.Nm rc_deptree_depend , rc_deptree_depends , rc_deptree_order ,
+.Nm rc_deptree_free
+.Nd RC dependency tree functions
+.Sh LIBRARY
+Run Command library (librc, -lrc)
+.Sh SYNOPSIS
+.In rc.h
+.Ft bool Fn rc_deptree_update void
+.Ft bool Fn rc_deptree_update_needed void
+.Ft rc_depinfo_t Fn rc_deptree_load void
+.Ft "char **" Fo rc_deptree_depend
+.Fa "const rc_depinfo_t *deptree"
+.Fa "const char *type"
+.Fa "const char *service"
+.Fc
+.Ft bool Fo rc_deptree_depends
+.Fa "const rc_depinfo_t *deptree"
+.Fa "const char *const *types"
+.Fa "const char *const *services"
+.Fa "const char *runlevel"
+.Fa "int options"
+.Fc
+.Ft "char **" Fo rc_deptree_order
+.Fa "const rc_depinfo_t *deptree"
+.Fa "const char *runlevel"
+.Fa "int options"
+.Fc
+.Ft void Fn rc_deptree_free "rc_depinfo_t *deptree"
+.Sh DESCRIPTION
+These functions provide a means of querying the dependencies of OpenRC
+services.
+.Pp
+.Fn rc_deptree_update
+updates the service dependency tree, normally
+.Pa /lib/rc/init.d/deptree .
+.Fn rc_deptree_update_needed
+checks to see if the dependency tree needs updated based on the mtime of it
+compared to
+.Pa /etc/init.d ,
+.Pa /etc/conf.d ,
+.Pa /usr/local/etc/init.d ,
+.Pa /usr/local/etc/conf.d ,
+.Pa /etc/rc.conf
+and any files specified by a service.
+.Pp
+.Fn rc_deptree_load
+loads the deptree and returns a pointer to it which needs to be freed by
+.Fn rc_deptree_free
+when done.
+.Pp
+.Fn rc_deptree_depend ,
+.Fn rc_deptree_depends
+and
+.Fn rc_deptree_order
+return a list of services from the
+.Fa deptree
+based on the
+.Fa type
+or
+.Fa types
+of dependency.
+.Fa options
+can be a bitmask of
+.Va RC_DEP_TRACE
+and
+.Va RC_DEP_STRICT .
+.Va RC_DEP_TRACE
+follows each services dependencies right down to the first service needed and
+.Va RC_DEP_STRICT
+only lists services actually needed or in the
+.Va runlevel .
+.Sh IMPLEMENTATION NOTES
+Each function that returns
+.Fr "char **"
+returns a malloced NULL terminated array of malloced NULL terminated strings,
+all of which need to be freed using
+.Fn rc_strlist_free
+when done.
+.Sh SEE ALSO
+.Xr malloc 3 ,
+.Xr free 3 ,
+.Xr rc_strlist_free 3 ,
+.Xr runscript 8
+.Sh AUTHORS
+.An "Roy Marples" Aq roy@marples.name