kstrtobool(9)

kstrtobool9

Convert common user inputs into boolean values

Usage

int kstrtobool(const char * s, bool * res);

Arguments

s

input string

res

result

Overview

This routine returns 0 iff the first character is one of 'Yy1Nn0', or [oO][NnFf] for “on” and “off”. Otherwise it will return -EINVAL. Value pointed to by res is updated upon finding a match.

From linux-manual-4.9 4.9.228-1 in Debian 9 (Stretch). Parsed by carta from the page's man source.