---
name: "rc_stringlist"
section: "3"
platform: "linux"
package: "librc-dev"
version: "0.56-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rc_stringlist"
---

# rc\_stringlist(3)

RC string list functions

## 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

**#include \<rc.h\>**

*RC\_STRINGLIST \** *Fn* *rc\_stringlist\_new* *void*\

*RC\_STRING \** *Fn* *rc\_stringlist\_add* *RC\_STRINGLIST \*list* *const char \*item*\

*RC\_STRING \** *Fn* *rc\_stringlist\_addu* *RC\_STRINGLIST \*list* *const char \*item*\

*bool* *Fn* *rc\_stringlist\_delete* *RC\_STRINGLIST* *const char \*item*\

*void* *Fn* *rc\_stringlist\_free* *RC\_STRINGLIST \*list*\

*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)](/queue/3.md).

**rc\_stringlist\_new**() creates a new list head to store the list.

**rc\_stringlist\_add**() adds a malloced copy of *item* to *list*. It returns a pointer to the new item on success, or NULL on failure and sets *errno* accordingly. **rc\_stringlist\_addu**() only works if *list* does not already contain *item*.

**rc\_stringlist\_delete**() removes and frees *item* from *list*, retuning true on success, otherwise false.

**rc\_stringlist\_sort**() sorts the *list* according to C locale.

**rc\_stringlist\_free**() frees each item on *list* and the *list* itself.

## SEE ALSO

[malloc(3)](/malloc/3.md), [free(3)](/free/3.md), [queue(3)](/queue/3.md), [strcmp(3)](/strcmp/3.md)

## AUTHORS

Roy Marples \<roy@marples.name\>
