1 | .\" $Id: locker_iterate_attachtab.3,v 1.2 1999-03-27 17:34:01 danw Exp $ |
---|
2 | .\" |
---|
3 | .\" Copyright 1997 by the Massachusetts Institute of Technology. |
---|
4 | .\" |
---|
5 | .\" Permission to use, copy, modify, and distribute this |
---|
6 | .\" software and its documentation for any purpose and without |
---|
7 | .\" fee is hereby granted, provided that the above copyright |
---|
8 | .\" notice appear in all copies and that both that copyright |
---|
9 | .\" notice and this permission notice appear in supporting |
---|
10 | .\" documentation, and that the name of M.I.T. not be used in |
---|
11 | .\" advertising or publicity pertaining to distribution of the |
---|
12 | .\" software without specific, written prior permission. |
---|
13 | .\" M.I.T. makes no representations about the suitability of |
---|
14 | .\" this software for any purpose. It is provided "as is" |
---|
15 | .\" without express or implied warranty. |
---|
16 | .\" |
---|
17 | .TH LOCKER_ITERATE_ATTACHTAB 3 |
---|
18 | .SH NAME |
---|
19 | locker_iterate_attachtab \- Iterate through the entries in the |
---|
20 | attachtab |
---|
21 | .SH SYNOPSIS |
---|
22 | .nf |
---|
23 | .B #include <locker.h> |
---|
24 | .PP |
---|
25 | .B |
---|
26 | typedef int (*locker_callback)(locker_context, locker_attachent *, |
---|
27 | .B |
---|
28 | void *) |
---|
29 | .PP |
---|
30 | .B |
---|
31 | int locker_iterate_attachtab(locker_context \fIcontext\fP, |
---|
32 | .B |
---|
33 | locker_callback \fItest\fP, void *\fItestarg\fP, |
---|
34 | .B |
---|
35 | locker_callback \fIact\fP, void *\fIactarg\fP) |
---|
36 | .PP |
---|
37 | .B cc file.c -llocker ... |
---|
38 | .fi |
---|
39 | .SH DESCRIPTION |
---|
40 | The |
---|
41 | .B locker_iterate_attachtab |
---|
42 | function reads each attachtab entry in the attachtab directory in |
---|
43 | turn. For each attached locker, the |
---|
44 | .I test |
---|
45 | function (if non-NULL) is called with a |
---|
46 | .I locker_attachent |
---|
47 | corresponding to that locker, and the supplied |
---|
48 | .I testarg\fP. |
---|
49 | If |
---|
50 | .I test |
---|
51 | returns true (or was NULL), |
---|
52 | .B locker_iterate_attachtab |
---|
53 | then calls the |
---|
54 | .I act |
---|
55 | function, with the same |
---|
56 | .I locker_attachent |
---|
57 | and the |
---|
58 | .I actarg\fP. |
---|
59 | .PP |
---|
60 | As a side effect, |
---|
61 | .B locker_iterate_attachtab |
---|
62 | deletes any empty or malformed entries from the attachtab directory. |
---|
63 | .PP |
---|
64 | See |
---|
65 | .BR locker_read_attachent (3) |
---|
66 | for more information about the format of a |
---|
67 | .I locker_attachent\fP. |
---|
68 | .SH RETURN VALUES |
---|
69 | .B locker_iterate_attachtab |
---|
70 | returns |
---|
71 | .I LOCKER_EATTACHTAB |
---|
72 | if it couldn't open or lock the attachtab directory, |
---|
73 | .I LOCKER_ENOMEM |
---|
74 | if it runs out of memory, |
---|
75 | or |
---|
76 | .I LOCKER_SUCCESS |
---|
77 | if it runs successfully. |
---|
78 | .SH SEE ALSO |
---|
79 | locker_init(3), locker_check_owner(3), locker_check_host(3) |
---|
80 | .SH AUTHOR |
---|
81 | Dan Winship, MIT Information Systems |
---|
82 | .br |
---|
83 | Copyright 1998 by the Massachusetts Institute of Technology. |
---|