Next: , Previous: tokqsplit, Up: Strings   [Contents]


4.27 toksplit

split a string into tokens

Synopsis

#include <suplib/str.h>

int toksplit(
  char *str,
  char *tok[],
  const char *delim,
  int ntok
);

Parameters

char *str

the string to split up

char *tok[]

the array to stick

const char *delim

the delimiters to split on

int ntok

the maximum number of tokens to read

Description

toksplit splits a string into a series of tokens using strtok. It fills a caller provided array with pointers to the tokens. The caller should specify the maximum number of tokens to read.

Returns

It returns the actual number of tokens in the string, which may differ (either greater and lesser) than the number requested.

Author

Diab Jerius