Remove null terminated char ** lists in favour of RC_STRINGLIST, using TAILQ from queue(3). Refactor code style around the BSD KNF.

This commit is contained in:
Roy Marples
2008-03-16 17:00:56 +00:00
parent 40e12f6ba0
commit cb9da6a262
41 changed files with 4675 additions and 5322 deletions

View File

@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd Feb 22, 2008
.Dd Mar 16, 2008
.Dt RC_DEPTREE 3 SMM
.Os OpenRC
.Sh NAME
@@ -36,25 +36,25 @@ Run Command library (librc, -lrc)
.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"
.Ft RC_DEPTREE Fn rc_deptree_load void
.Ft "RC_STRINGLIST *" Fo rc_deptree_depend
.Fa "const RC_DEPTREE *deptree"
.Fa "const char *type"
.Fa "const char *service"
.Fc
.Ft bool Fo rc_deptree_depends
.Fa "const rc_depinfo_t *deptree"
.Fa "const RC_DEPTREE *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"
.Ft "RC_STRINGLIST *" Fo rc_deptree_order
.Fa "const RC_DEPTREE *deptree"
.Fa "const char *runlevel"
.Fa "int options"
.Fc
.Ft void Fn rc_deptree_free "rc_depinfo_t *deptree"
.Ft void Fn rc_deptree_free "RC_DEPTREE *deptree"
.Sh DESCRIPTION
These functions provide a means of querying the dependencies of OpenRC
services.
@@ -100,15 +100,14 @@ 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
.Fr "RC_STRINGLIST *"
should be freed by calling
.Fn rc_stringlist_free
when done.
.Sh SEE ALSO
.Xr malloc 3 ,
.Xr free 3 ,
.Xr rc_strlist_free 3 ,
.Xr rc_stringlist_free 3 ,
.Xr runscript 8
.Sh AUTHORS
.An "Roy Marples" Aq roy@marples.name