buffer_getn(3diet)

buffer_getn3diet

Read binary data from buffer

Usage

#include <buffer.h>

ssize_t buffer_getn(buffer* b,char* x,size_t len);

Overview

buffer_getn copies data to x[0], x[1], ..., x[len-1] from the buffer, calling buffer_feed as needed, and returns len.

If a read error occurs, buffer_getn returns -1 and sets errno appropriately. It may then have put any number between 0 and len in the buffer, you can't tell. That makes this function only useful if you don't care when an error occurs. Use buffer_get otherwise.

If the read operation signals end-of-file before len bytes were read, buffer_getn returns the number of bytes read from the buffer before end-of-file.

Releases

4 releases since Debian 3.1 (Sarge); the text changed 2 times.

  1. 3.1
  2. 4.0
  3. 5.0–6.0

From libowfat-dev 0.28-2 in Debian 6.0 (Squeeze). Parsed by carta from the page's man source.