libnvmf_tid_parse_strict-libnvme32
Like libnvmf_tid_parse(), but reject malformed input.
Usage
int libnvmf_tid_parse_strict (struct libnvme_global_ctx *ctx , const char *str , struct libnvmf_tid **out );
Arguments
ctx
|
Global context for logging. |
|---|---|
str
|
Input string. |
out
|
The allocated TID on success; NULL on error. |
Overview
Same as libnvmf_tid_parse except that a malformed token -- a non-empty bare token (no '='), an empty value, or an unrecognized key -- fails the whole parse instead of being skipped. Empty tokens (from ";;" or a trailing ';') are still benign. Useful when an unrecognized key should be treated as an error (e.g. a typo in a hand-edited config) rather than silently ignored.
Return
0 on success (*out is the allocated TID); -EINVAL if ctx, out or str is NULL, or on a malformed token; -ENOMEM on allocation failure.