Debian Codegraph @

auth/mig-decls.h

raw
1 /*
2 Copyright (C) 2014 Free Software Foundation, Inc.
3 Written by Justus Winter.
4
5 This file is part of the GNU Hurd.
6
7 The GNU Hurd is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2, or (at
10 your option) any later version.
11
12 The GNU Hurd is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with the GNU Hurd. If not, see <http://www.gnu.org/licenses/>. */
19
20 #ifndef __AUTH_MIG_DECLS_H__
21 #define __AUTH_MIG_DECLS_H__
22
23 #include "auth.h"
24
25 typedef struct authhandle *authhandle_t;
26
27 /* Called by server stub functions. */
28
29 static inline struct authhandle * __attribute__ ((unused))
30 auth_port_to_handle (mach_port_t auth)
31 {
32 return ports_lookup_port (auth_bucket, auth, authhandle_portclass);
33 }
34
35 static inline struct authhandle * __attribute__ ((unused))
36 auth_payload_to_handle (uintptr_t payload)
37 {
38 return ports_lookup_payload (auth_bucket, payload, authhandle_portclass);
39 }
40
41 static inline void __attribute__ ((unused))
42 end_using_authhandle (struct authhandle *auth)
43 {
44 if (auth)
45 ports_port_deref (auth);
46 }
47
48 #endif /* __AUTH_MIG_DECLS_H__ */