1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00
libwebsockets/minimal-examples/api-tests/api-test-lws_tokenize
Andy Green 157acfc906 windows: clean type warnings
There are some minor public api type improvements rather than cast everywhere
inside lws and user code to work around them... these changed from int to
size_t

 - lws_buflist_use_segment() return
 - lws_tokenize_t .len and .token_len
 - lws_tokenize_cstr() length
 - lws_get_peer_simple() namelen
 - lws_get_peer_simple_fd() namelen, int fd -> lws_sockfd_type fd
 - lws_write_numeric_address() len
 - lws_sa46_write_numeric_address() len

These changes are typically a NOP for user code
2020-01-11 14:04:50 +00:00
..
CMakeLists.txt cleaning 2020-01-05 22:17:58 +00:00
main.c windows: clean type warnings 2020-01-11 14:04:50 +00:00
README.md lws_tokenize 2018-10-13 08:16:27 +08:00
selftest.sh lws_tokenize 2018-10-13 08:16:27 +08:00

lws api test lws_tokenize

Performs selftests for lws_tokenize

build

 $ cmake . && make

usage

Commandline option Meaning
-d Debug verbosity in decimal, eg, -d15
-s "input string" String to tokenize
-f 15 LWS_TOKENIZE_F_ flag values to apply to processing of -s
 $ ./lws-api-test-lws_tokenize
[2018/10/09 09:14:17:4834] USER: LWS API selftest: lws_tokenize
[2018/10/09 09:14:17:4835] USER: Completed: PASS: 6, FAIL: 0

If the -s string option is given, the string is tokenized on stdout in the format used to produce the tests in the sources

 $ ./lws-api-test-lws_tokenize -s "hello: 1234,256"
[2018/10/09 09:14:17:4834] USER: LWS API selftest: lws_tokenize
{ LWS_TOKZE_TOKEN_NAME_COLON, "hello", 5 }
{ LWS_TOKZE_INTEGER, "1234", 4 }
{ LWS_TOKZE_DELIMITER, ",", 1 }
{ LWS_TOKZE_INTEGER, "256", 3 }
{ LWS_TOKZE_ENDED, "", 0 }