• Antelope Release 5.9 Mac OS X 10.13.2 2019-05-01

 

NAME

splitlist, splitlistc, freeargs - split strings

SYNOPSIS


#include "brttutil.h"

int
splitlist (char *list, int *argc, char ***argv)

int
splitlistc (char *list, int *argc, char ***argv, char *schars)

void
freeargs (int argv, char **argv)

These provide a simple string splitting utility.

splitlist will take a character string list and split it into *argc dynamically allocated substrings that are referenced by another dynamically allocated array of string pointers in *argv. The default substring separation characters are ' ' (blank) and/or '\t' (tab).

splitlist is the same as splitlist except that the separation characters can be specified in schars.

freeargs should be used to free the dynamically allocated substrings and substring pointer array after they are no longer needed.

RETURNS

Success is indicated by a return of 0 and an error is indicated by -1.

LIBRARY

-lbrttutil

AUTHOR

Danny Harvey
Printer icon