buffer_get_token_pred(3)

buffer_get_token_pred3

Read token from buffer

Usage

#include <libowfat/buffer.h>

ssize_t buffer_get_token_pred(buffer* b,char* x,size_t len,
int (*predicate)(const char* s,size_t len));

Overview

buffer_get_token_pred copies data from b to x[0], x[1], ..., x[len-1] until len bytes have been read or predicate called on the destination string returns nonzero.

predicate can also return 0 (indicating further input is required to complete the token) or -1 (abort and return -1; use this if predicate wants to enfore a maximum message size or does timeout handling or detects a malformed message).

buffer_get_token_pred returns the number of bytes copied or -1 on error (setting errno appropriately).

Releases

7 releases since Debian 7 (Wheezy); the text changed 1 time.

  1. 7–11
  2. 12–13

From libowfat-dev 0.32-5 in Debian 13 (Trixie). Parsed by carta from the page's man source.