RC_STRLIST

Section: C Library Functions (3)
Updated: SMM
Page Index

BSD mandoc
OpenRC  

NAME

rc_stringlist_add , rc_stringlist_addu , rc_stringlist_delete rc_stringlist_free , rc_stringlist_new , rc_stringlist_sort - RC string list functions  

LIBRARY

Run Command library (librc, -lrc)  

SYNOPSIS

In rc.h Ft RC_STRINGLIST * Fn rc_stringlist_new void Ft RC_STRING * Fn rc_stringlist_add RC_STRINGLIST *list const char *item Ft RC_STRING * Fn rc_stringlist_addu RC_STRINGLIST *list const char *item Ft bool Fn rc_stringlist_delete RC_STRINGLIST const char *item Ft void Fn rc_stringlist_free RC_STRINGLIST *list Ft void Fn rc_stringlist_sort RC_STRINGLIST *list  

DESCRIPTION

These functions provide an easy means of manipulating string lists. They are basically wrappers around TAILQ macros found in queue(3).

Fn rc_stringlist_new creates a new list head to store the list.

Fn rc_stringlist_add adds a malloced copy of Fa item to Fa list . It returns a pointer to the new item on success, or NULL on failure and sets errno accordingly. Fn rc_stringlist_addu only works if Fa list does not already contain Fa item .

Fn rc_stringlist_delete removes and frees Fa item from Fa list , retuning true on success, otherwise false.

Fn rc_stringlist_sort sorts the Fa list according to C locale.

Fn rc_stringlist_free frees each item on Fa list and the Fa list itself.  

SEE ALSO

malloc(3), free(3), queue(3), strcmp(3)  

AUTHORS

An Roy Marples <roy@marples.name>


 

Index

NAME
LIBRARY
SYNOPSIS
DESCRIPTION
SEE ALSO
AUTHORS