1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
8 * String-related functions as replacement for libc equivalents
11 #ifndef _RTE_STRING_FNS_H_
12 #define _RTE_STRING_FNS_H_
19 * Takes string "string" parameter and splits it at character "delim"
20 * up to maxtokens-1 times - to give "maxtokens" resulting tokens. Like
21 * strtok or strsep functions, this modifies its input string, by replacing
22 * instances of "delim" with '\\0'. All resultant tokens are returned in the
23 * "tokens" array which must have enough entries to hold "maxtokens".
26 * The input string to be split into tokens
29 * The max length of the input buffer
32 * The array to hold the pointers to the tokens in the string
35 * The number of elements in the tokens array. At most, maxtokens-1 splits
36 * of the string will be done.
39 * The character on which the split of the data will be done
42 * The number of tokens in the tokens array.
45 rte_strsplit(char *string, int stringlen,
46 char **tokens, int maxtokens, char delim);
52 #endif /* RTE_STRING_FNS_H */