'\" t .\" Title: __bitmap_parselist .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: July 2017 .\" Manual: Basic Kernel Library Functions .\" Source: Kernel Hackers Manual 4.11.11 .\" Language: English .\" .TH "__BITMAP_PARSELIST" "9" "July 2017" "Kernel Hackers Manual 4\&.11\&" "Basic Kernel 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" __bitmap_parselist \- convert list format ASCII string to bitmap .SH "SYNOPSIS" .HP \w'int\ __bitmap_parselist('u .BI "int __bitmap_parselist(const\ char\ *\ " "buf" ", unsigned\ int\ " "buflen" ", int\ " "is_user" ", unsigned\ long\ *\ " "maskp" ", int\ " "nmaskbits" ");" .SH "ARGUMENTS" .PP \fIconst char * buf\fR .RS 4 read nul\-terminated user string from this buffer .RE .PP \fIunsigned int buflen\fR .RS 4 buffer size in bytes\&. If string is smaller than this then it must be terminated with a \e0\&. .RE .PP \fIint is_user\fR .RS 4 location of buffer, 0 indicates kernel space .RE .PP \fIunsigned long * maskp\fR .RS 4 write resulting mask here .RE .PP \fIint nmaskbits\fR .RS 4 number of bits in mask to be written .RE .SH "DESCRIPTION" .PP Input format is a comma\-separated list of decimal numbers and ranges\&. Consecutively set bits are shown as two hyphen\-separated decimal numbers, the smallest and largest bit numbers set in the range\&. Optionally each range can be postfixed to denote that only parts of it should be set\&. The range will divided to groups of specific size\&. From each group will be used only defined amount of bits\&. Syntax: range:used_size/group_size .SH "EXAMPLE" .sp .if n \{\ .RS 4 .\} .nf 0\-1023:2/256 ==> 0,1,256,257,512,513,768,769 Returns 0 on success, \-errno on invalid input strings\&. Error values: \fB\-EINVAL\fR: second number in range smaller than first \fB\-EINVAL\fR: invalid character in string \fB\-ERANGE\fR: bit number specified too large for mask .fi .if n \{\ .RE .\} .SH "COPYRIGHT" .br