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

FreeBSD Manual Pages

  
 
  

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

NAME
       critbit0_allprefixed - search a critbit tree by prefix

SYNTAX
       #include	<critbit.h>

       critbit0_tree cb	= { 0 };

       int critbit0_allprefixed(critbit0_tree* cb,const	char* prefix,
	   int (*handle)(const char*,void*),void* arg);

DESCRIPTION
       critbit0_allprefixed  calls  the	 handle	 function on all members of cb
       that start with prefix. It passes arg as	second argument	to handle.

       If handle returns 0, the	search stops and critbit0_allprefixed  returns
       0.

       If  handle returns 1, the search	continues and critbit0_allprefixed re-
       turns 1 if all keys with	the given prefix were handled.

       If handle returns something else, the search stops and critbit0_allpre-
       fixed returns -1.

NOTE
       This  function uses recursion to	traverse the tree. It may require non-
       trivial amounts of available stack space.

RETURN VALUE
       1 if all	keys were found	and handled (or	if there  were	no  keys  with
       that prefix).

       0 if at least one key was found,	handle was called and returned 0.

       -1  if at least one key was found, handle was called and	returned some-
       thing other than	0 or 1.

SEE ALSO
       critbit0_contains(3)

						       critbit0_allprefixed(3)

NAME | SYNTAX | DESCRIPTION | NOTE | RETURN VALUE | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=critbit0_allprefixed&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help