| M E M _ M A K E T O K E N L I S T ( )
| | | | | SOURCE: qdev_autodocs.txt 1.163 (12/09/2014) English AMIGA - MEM_#?
----------------------------------------------------------------------------
NAME
mem_maketokenlist() - Tokenizes NULL term. string and
creates a list.
SYNOPSIS
list = mem_maketokenlist(string, delim);
struct MinList *mem_maketokenlist(UBYTE *, LONG);
FUNCTION
This function is able to tokenize a string and create
'MinList' containing these tokens.
INPUTS
string - NULL terminated string.
delim - Delimiter character.
RETURNS
Returns pointer to 'MinList' or NULL if there is not
enough memory.
BASES
SysBase
NOTES
To iterate the list use 'QDEV_HLP_ITERATE' macro and
'mem_mtl_iter' structure!
List of tokens, including the list bootstrap is one
big memory block, so dont try to free single entries!
SEE ALSO
mem_freetokenlist()
EXAMPLE
...
struct MinList *ml;
struct mem_mtl_iter *mi;
UBYTE *string = "so,many,commas,eh?";
if ((ml = mem_maketokenlist(string, ',')))
{
QDEV_HLP_ITERATE(ml, struct mem_mtl_iter *, mi)
{
FPrintf(Output(), "%s\n", (LONG)mi->mi_token);
}
mem_freetokenlist(ml);
}
BUGS
None known.
----------------------------------------------------------------------------
| |
| |