Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
bs_capacityassert(3)	    Library Functions Manual	    bs_capacityassert(3)

NAME
     bs_capacityassert - assert that there are least n bytes left in the stream

SYNTAX
     #include <libowfat/parse.h>

     int bs_capacityassert(struct bytestream* &bs,
		     size_t capacity);

DESCRIPTION
     bs_capacityassert will check that there are at least this many bytes in the
     bytestream. If there are not, it will set the bytestream to the error state
     and return 0; otherwise it will return 1.

     Note  that  this compares against the limits of the bytestream, not the ac-
     tual length. These are often the same, but bytestreams can  be  tied  to  a
     buffer*, in which case the actual length of the stream is not known before-
     hand.  Even  if  bs_capacityassert returns successful, the following actual
     reads could still run into an error.

     bs_capacitycheck does the same thing but does not set the bytestream to the
     error state if there is not enough space.

     Us bs_capacityleft to find out how many bytes are left in the bytestream.

     bs_nomoredataassert is the inverse assertion.

     Use bs_err to find out whether the bytestream is in the error state.

SEE ALSO
     bs_init_membuf(3),  bs_init_iobuf(3),  bs_init_iobuf_size(3),  bs_init_mem-
     buf(3),   bs_capacitycheck(3),  bs_capacityleft(3),  bs_err(3),  bs_nomore-
     dataassert(3)

							    bs_capacityassert(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=libowfat_bs_capacityassert&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help