<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968" /><title>bitmap_parselist</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><link rel="home" href="index.html" title="The Linux Kernel API" /><link rel="up" href="ch03.html#id2630756" title="Bitmap Operations" /><link rel="prev" href="re108.html" title="bitmap_scnlistprintf" /><link rel="next" href="re110.html" title="bitmap_remap" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span>bitmap_parselist</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re108.html">Prev</a> </td><th width="60%" align="center">Bitmap Operations</th><td width="20%" align="right"> <a accesskey="n" href="re110.html">Next</a></td></tr></table><hr /></div><div class="refentry" title="bitmap_parselist"><a id="API-bitmap-parselist"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>bitmap_parselist — convert list format ASCII string to bitmap </p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">int <b class="fsfunc">bitmap_parselist </b>(</code></td><td>const char * <var class="pdparam">bp</var>, </td></tr><tr><td> </td><td>unsigned long * <var class="pdparam">maskp</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">nmaskbits</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1" title="Arguments"><a id="id2632038"></a><h2>Arguments</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>bp</code></em></span></dt><dd><p> read nul-terminated user string from this buffer </p></dd><dt><span class="term"><em class="parameter"><code>maskp</code></em></span></dt><dd><p> write resulting mask here </p></dd><dt><span class="term"><em class="parameter"><code>nmaskbits</code></em></span></dt><dd><p> number of bits in mask to be written </p></dd></dl></div></div><div class="refsect1" title="Description"><a id="id2632100"></a><h2>Description</h2><p> 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. </p><p> Returns 0 on success, -errno on invalid input strings. </p></div><div class="refsect1" title="Error values"><a id="id2632117"></a><h2>Error values</h2><p> <code class="constant">-EINVAL</code>: second number in range smaller than first <code class="constant">-EINVAL</code>: invalid character in string <code class="constant">-ERANGE</code>: bit number specified too large for mask </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="re108.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch03.html#id2630756">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="re110.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span>bitmap_scnlistprintf</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span>bitmap_remap</span></td></tr></table></div></body></html>