NAME
upscli_str_contains_token - Verify that an unique token is present in the string
SYNOPSIS
Note
|
Two NUT websites
This version of the page reflects NUT release v2.8.3 with codebase commited c0acf09af at 2025-04-21T23:59:59+00:00 Options, features and capabilities in current development (and future releases) are detailed on the main site and may differ from ones described here. |
#include <upsclient.h>
int upscli_str_contains_token(const char *string, const char *token);
DESCRIPTION
The upscli_str_contains_token() function takes the pointer tgt to a
caller-provided const char *
buffer, comprised of unique tokens separated
by single space characters (ASCII 0x20), and the pointer token to a
presumed-contiguous token value that should be found in the tgt buffer.
RETURN VALUE
The upscli_str_contains_token() function returns a numeric code:
-
non-zero if the token value was found in tgt buffer (possibly surrounded by space characters, or being at start/end of the string);
-
0 if token was not found, or if either token or tgt string was
NULL
or empty.