---
name: "bitmap_parse"
section: "9"
platform: "linux"
package: "linux-manual-2.6.18"
version: "2.6.18.dfsg.1-26etch2"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/bitmap_parse"
---

# bitmap\_parse(9)

convert an ASCII hex string into a bitmap.

## NAME

bitmap\_parse - convert an ASCII hex string into a bitmap.

## SYNOPSIS

**int bitmap\_parse(const char \_\_user \*** *ubuf***, unsigned int** *ubuflen***, unsigned long \*** *maskp***, int** *nmaskbits***);**

## ARGUMENTS

*ubuf*

pointer to buffer in user space containing string.

*ubuflen*

buffer size in bytes. If string is smaller than this then it must be terminated with a \\0.

*maskp*

pointer to bitmap array that will contain result.

*nmaskbits*

size of bitmap, in bits.

## DESCRIPTION

Commas group hex digits into chunks. Each chunk defines exactly 32 bits of the resultant bitmask. No chunk may specify a value larger than 32 bits (**-EOVERFLOW**), and if a chunk specifies a smaller value then leading 0-bits are prepended. **-EINVAL** is returned for illegal characters and for grouping errors such as “1,,5”, “,44”, “,” and "". Leading and trailing whitespace accepted, but not embedded whitespace.

## COPYRIGHT
