* TTY devices.
*/
port.pt_names = ttys;
- if (STRSEP2LS(fields[0], ",", ttys) == -1)
+ if (strsep2ls_a(fields[0], ",", ttys) == -1)
goto next;
/*
* The last entry in the list is a NULL pointer.
*/
port.pt_users = users;
- if (STRSEP2LS(fields[1], ",", users) == -1)
+ if (strsep2ls_a(fields[1], ",", users) == -1)
goto next;
/*
Similar to strsep2arr(), but terminate the list with a null
pointer.
Useful when the number of delimiter-separated fields is unknown.
- STRSEP2LS()
+ strsep2ls_a()
Like strsep2ls(), but take an array.
astrsep2ls()
#include "string/strtok/strsep2arr.h"
-#define STRSEP2LS(s, delim, ls) strsep2ls(s, delim, countof(ls), ls)
+// strsep2ls_a - string separate to list-of-strings array
+#define strsep2ls_a(s, delim, ls) strsep2ls(s, delim, countof(ls), ls)
ATTR_ACCESS(read_write, 1) ATTR_ACCESS(write_only, 4, 3)
size_t n, char *ls[restrict n]);
-// string separate to list-of-strings
+// strsep2ls - string separate to list-of-strings
// Like strsep2arr(), but add a NULL terminator.
inline ssize_t
strsep2ls(char *s, const char *restrict delim, size_t n, char *ls[restrict n])