add rc_getline to the man page

This commit is contained in:
Roy Marples 2008-01-07 12:39:27 +00:00
parent 43d0f3fc76
commit c256510570

View File

@ -22,16 +22,17 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.Dd Dec 24, 2007 .Dd Jan 08, 2008
.Dt RC_CONFIG 3 SMM .Dt RC_CONFIG 3 SMM
.Os OpenRC .Os OpenRC
.Sh NAME .Sh NAME
.Nm rc_config_list , rc_config_load , rc_config_value , rc_yesno .Nm rc_getline , rc_config_list , rc_config_load , rc_config_value , rc_yesno
.Nd functions to query OpenRC service configurations .Nd functions to query OpenRC service configurations
.Sh LIBRARY .Sh LIBRARY
Run Command library (librc, -lrc) Run Command library (librc, -lrc)
.Sh SYNOPSIS .Sh SYNOPSIS
.In rc.h .In rc.h
.Ft "char *" Fn rc_getline "FILE *fp"
.Ft "char **" Fn rc_config_list "const char *file" .Ft "char **" Fn rc_config_list "const char *file"
.Ft "char **" Fn rc_config_load "const char *file" .Ft "char **" Fn rc_config_load "const char *file"
.Ft "char *" Fn rc_config_value "const char *const *list" "const char *entry" .Ft "char *" Fn rc_config_value "const char *const *list" "const char *entry"
@ -39,6 +40,14 @@ Run Command library (librc, -lrc)
.Sh DESCRIPTION .Sh DESCRIPTION
These functions provide an easy means of querying OpenRC configuration files. These functions provide an easy means of querying OpenRC configuration files.
.Pp .Pp
.Fn rc_getline
expands it's buffer using
.Fn malloc
until it has read a whole line from the file or EOF.
Trailing newlines are removed and the buffer is returned. Any functions that
read from files should use this function to avoid any potential overflows and
to ensure that arbitary long lines are read.
.Pp
.Fn rc_config_list .Fn rc_config_list
returns a list of non comment lines in returns a list of non comment lines in
.Fa file . .Fa file .
@ -66,6 +75,7 @@ is also not false, no, off or 0 regardless of case then
is set to is set to
.Va EINVAL . .Va EINVAL .
.Sh SEE ALSO .Sh SEE ALSO
.Xr malloc 3 ,
.Xr rc_strlist_free 3 , .Xr rc_strlist_free 3 ,
.Xr sh 1 .Xr sh 1
.Sh AUTHORS .Sh AUTHORS