BSUBSET(3)


Table of Contents

1. NAME
2. SYNOPSIS
3. DESCRIPTION
4. RETURN VALUE
5. ERRORS
6. EXAMPLE
7. BUGS
8. SEE ALSO
9. COPYING

1. NAME

Bsubset - check that buffer 2 is part of the buffer 1 (values and fields found in buffer 1)

2. SYNOPSIS

#include <ubf.h>

int Bsubset (UBFH *p_ubf1, UBFH *p_ubf2);

Link with -lubf -lnstd -lm -lpthread

3. DESCRIPTION

Test that p_ubf2 (needle) is found in p_ubf1 (haystack).

4. RETURN VALUE

If p_ubf2 occurrences, fields and values are found in p_ubf1 the function returns 1, if there are any differences, function returns 0 (not found). In case of error -1 is returned with Berror set accordingly.

For field type BFLD_UBF subset testing is performed in recursive way, i.e. subset of p_ubf2 UBF field is tested in p_ubf1 UBF field.

5. ERRORS

Note that Bstrerror() returns generic error message plus custom message with debug info from last function call.

BEINVAL p_ubf1 or p_ubf2 are NULL pointers.

BNOTFLD p_ubf1 or p_ubf2 buffers not fielded, not correctly allocated or corrupted.

6. EXAMPLE

See ubftest/test_bcmp.c for sample code.

7. BUGS

Report bugs to support@mavimax.com

8. SEE ALSO

Bcmp(3)

9. COPYING

© Mavimax, Ltd