'\" t .\" Title: kstrtobool .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Basic C Library Functions .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "KSTRTOBOOL" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Basic C Library Functions" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" kstrtobool \- convert common user inputs into boolean values .SH "SYNOPSIS" .HP \w'int\ kstrtobool('u .BI "int kstrtobool(const\ char\ *\ " "s" ", bool\ *\ " "res" ");" .SH "ARGUMENTS" .PP \fIs\fR .RS 4 input string .RE .PP \fIres\fR .RS 4 result .RE .SH "DESCRIPTION" .PP This routine returns 0 iff the first character is one of \*(AqYy1Nn0\*(Aq, or [oO][NnFf] for \(lqon\(rq and \(lqoff\(rq\&. Otherwise it will return \-EINVAL\&. Value pointed to by res is updated upon finding a match\&. .SH "COPYRIGHT" .br