Debian Codegraph @

doc/ck_hs_apply

raw
1 .\"
2 .\" Copyright 2014 Samy Al Bahra.
3 .\" Copyright 2014 Backtrace I/O, Inc.
4 .\" All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\"
15 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 .\" SUCH DAMAGE.
26 .\"
27 .\"
28 .Dd September 1, 2014
29 .Dt CK_HS_APPLY 3
30 .Sh NAME
31 .Nm ck_hs_apply
32 .Nd apply a function to hash set value
33 .Sh LIBRARY
34 Concurrency Kit (libck, \-lck)
35 .Sh SYNOPSIS
36 .In ck_hs.h
37 .Ft void *
38 .Fn ck_hs_apply_fn_t "void *key" "void *closure"
39 .Ft bool
40 .Fn ck_hs_apply "ck_hs_t *hs" "unsigned long hash" "const void *key" "ck_hs_apply_fn_t *function" "void *argument"
41 .Sh DESCRIPTION
42 The
43 .Fn ck_hs_apply 3
44 function will lookup the hash set slot associated with
45 .Fa key
46 and pass it to function pointed to by
47 .Fa function
48 for further action. This callback may remove or replace
49 the value by respectively returning NULL or a pointer to
50 another object with an identical key. The first argument
51 passed to
52 .Fa function
53 is a pointer to the object found in the hash set and
54 the second argument is the
55 .Fa argument
56 pointer passed to
57 .Fn ck_hs_apply 3 .
58 If the pointer returned by
59 .Fa function
60 is equivalent to the first argument then no modification
61 is made to the hash set.
62 .Sh RETURN VALUES
63 Upon successful completion,
64 .Fn ck_hs_apply 3
65 returns true and otherwise returns false on failure.
66 .Sh SEE ALSO
67 .Xr ck_hs_init 3 ,
68 .Xr ck_hs_move 3 ,
69 .Xr ck_hs_destroy 3 ,
70 .Xr ck_hs_fas 3 ,
71 .Xr CK_HS_HASH 3 ,
72 .Xr ck_hs_iterator_init 3 ,
73 .Xr ck_hs_next 3 ,
74 .Xr ck_hs_get 3 ,
75 .Xr ck_hs_put 3 ,
76 .Xr ck_hs_put_unique 3 ,
77 .Xr ck_hs_remove 3 ,
78 .Xr ck_hs_grow 3 ,
79 .Xr ck_hs_rebuild 3 ,
80 .Xr ck_hs_gc 3 ,
81 .Xr ck_hs_count 3 ,
82 .Xr ck_hs_reset 3 ,
83 .Xr ck_hs_reset_size 3 ,
84 .Xr ck_hs_stat 3
85 .Pp
86 Additional information available at http://concurrencykit.org/