Files
rk35xx-android14/external/ltp/pan/splitstr.h
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

37 lines
1.1 KiB
C

#ifndef _SPLITSTR_H_
#define _SPLITSTR_H_
/*
* Synopsis
*
* const char **splitstr(const char *str, const char *separator, int *argcount)
*
* Description
* This function splits a string (str) into components that are separated by
* one or more of the characters in the (separator) string. An array of
* strings is returned, along with argcount being set to the number of strings
* found. Argcount can be NULL. There will always be a NULL element in the
* array after the last valid element. If an error occurs, NULL will be
* returned and argcount will be set to zero.
*
* To rid yourself of the memory allocated for splitstr(), pass the return
* value from splitstr() unmodified to splitstr_free():
*
* void splitstr_free( const char ** return_from_splitstr );
*
*/
const char **
splitstr(const char *, const char *, int *);
/*
* splitster_free( const char ** )
*
* This takes the return value from splitster() and free()s memory
* allocated by splitster. Assuming: ret=splitster(...), this
* requires that ret and *ret returned from splitster() have not
* been modified.
*/
void
splitstr_free( const char ** );
#endif