.
[glibc.git] / mach / mach / mig_support.h
blob0f8c983c8709974671d505076d3b5ae69cba9e78
1 /* Copyright (C) 1993, 1994 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If
16 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
17 Cambridge, MA 02139, USA. */
19 /* Useful declarations and support functions for MiG-generated stubs. */
21 #ifndef _MACH_MIG_SUPPORT_H
23 #define _MACH_MIG_SUPPORT_H 1
25 #include <mach/std_types.h>
26 #include <mach/message.h>
27 #include <sys/types.h>
28 #include <string.h>
30 /* MiG initialization. */
31 extern void __mig_init (void *__first);
32 extern void mig_init (void *__first);
34 /* Shorthand functions for vm_allocate and vm_deallocate on
35 mach_task_self () (and with ANYWHERE=1). */
36 extern void __mig_allocate (vm_address_t *__addr_p, vm_size_t __size);
37 extern void mig_allocate (vm_address_t *__addr_p, vm_size_t __size);
38 extern void __mig_deallocate (vm_address_t __addr, vm_size_t __size);
39 extern void mig_deallocate (vm_address_t __addr, vm_size_t __size);
41 /* Reply-port management support functions. */
42 extern void __mig_dealloc_reply_port (mach_port_t);
43 extern void mig_dealloc_reply_port (mach_port_t);
44 extern mach_port_t __mig_get_reply_port (void);
45 extern mach_port_t mig_get_reply_port (void);
46 extern void __mig_put_reply_port (mach_port_t);
47 extern void mig_put_reply_port (mach_port_t);
49 extern void __mig_reply_setup (const mach_msg_header_t *__request,
50 mach_msg_header_t *__reply);
51 extern void mig_reply_setup (const mach_msg_header_t *__request,
52 mach_msg_header_t *__reply);
54 /* Idiocy support function. */
55 extern __inline vm_size_t
56 __mig_strncpy (char *__dst, const char *__src, vm_size_t __len)
58 return __stpncpy (__dst, __src, __len) - __dst;
60 extern __inline vm_size_t
61 mig_strncpy (char *__dst, const char *__src, vm_size_t __len)
63 return __mig_strncpy (__dst, __src, __len);
68 #endif /* mach/mig_support.h */