2 * @file main-win-tokenizer.cpp
3 * @brief Windows版固有実装(トークン分割)
6 #include "main-win/main-win-tokenizer.h"
11 * - Taken from files.c.
13 * Extract "tokens" from a buffer
15 * This function uses "whitespace" as delimiters, and treats any amount of
16 * whitespace as a single delimiter. We will never return any empty tokens.
17 * When given an empty buffer, or a buffer containing only "whitespace", we
18 * will return no tokens. We will never extract more than "num" tokens.
20 * By running a token through the "text_to_ascii()" function, you can allow
21 * that token to include (encoded) whitespace, using "\s" to encode spaces.
23 * We save pointers to the tokens in "tokens", and return the number found.
25 int16_t tokenize_whitespace(char *buf, int16_t num, char **tokens)
32 for (; *s && iswspace(*s); ++s) { /* loop */
40 for (t = s; *t && !iswspace(*t); ++t) { /* loop */