2 * Amanda, The Advanced Maryland Automatic Network Disk Archiver
3 * Copyright (c) 1991-1998 University of Maryland at College Park
4 * Copyright (c) 2007-2012 Zmanda, Inc. All Rights Reserved.
7 * Permission to use, copy, modify, distribute, and sell this software and its
8 * documentation for any purpose is hereby granted without fee, provided that
9 * the above copyright notice appear in all copies and that both that
10 * copyright notice and this permission notice appear in supporting
11 * documentation, and that the name of U.M. not be used in advertising or
12 * publicity pertaining to distribution of the software without specific,
13 * written prior permission. U.M. makes no representations about the
14 * suitability of this software for any purpose. It is provided "as is"
15 * without express or implied warranty.
17 * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
19 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
20 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
21 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
22 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24 * Authors: the Amanda Development Team. Its members are listed in a
25 * file named AUTHORS, in the root directory of this distribution.
28 * $Id: arglist.h,v 1.9 2006/06/16 11:33:43 martinea Exp $
30 * support macros for variable argument list declaration and definition
40 #define printf_arglist_function(fdecl, \
41 hook_type, hook_name) \
43 fdecl(hook_type hook_name, ...)
45 #define printf_arglist_function1(fdecl, \
46 arg1_type, arg1_name, \
47 hook_type, hook_name) \
49 fdecl(arg1_type arg1_name, \
50 hook_type hook_name, ...)
52 #define printf_arglist_function2(fdecl, \
53 arg1_type, arg1_name, \
54 arg2_type, arg2_name, \
55 hook_type, hook_name) \
57 fdecl(arg1_type arg1_name, \
58 arg2_type arg2_name, \
59 hook_type hook_name, ...)
61 #define printf_arglist_function3(fdecl, \
62 arg1_type, arg1_name, \
63 arg2_type, arg2_name, \
64 arg3_type, arg3_name, \
65 hook_type, hook_name) \
67 fdecl(arg1_type arg1_name, \
68 arg2_type arg2_name, \
69 arg3_type arg3_name, \
70 hook_type hook_name, ...)
72 #define arglist_function(fdecl, \
73 hook_type, hook_name) \
74 fdecl(hook_type hook_name, ...)
76 #define arglist_function1(fdecl, \
77 arg1_type, arg1_name, \
78 hook_type, hook_name) \
79 fdecl(arg1_type arg1_name, \
80 hook_type hook_name, ...)
82 #define arglist_function2(fdecl, \
83 arg1_type, arg1_name, \
84 arg2_type, arg2_name, \
85 hook_type, hook_name) \
86 fdecl(arg1_type arg1_name, \
87 arg2_type arg2_name, \
88 hook_type hook_name, ...)
90 #define arglist_function3(fdecl, arg1_type, arg1_name, arg2_type, arg2_name, \
91 arg3_type, arg3_name, hook_type, hook_name) \
92 fdecl(arg1_type arg1_name, arg2_type arg2_name, \
93 arg3_type arg3_name, hook_type hook_name, ...)
95 #define arglist_start(arg,hook_name) va_start(arg,hook_name)
101 #define printf_arglist_function(fdecl, hook_type, hook_name) \
102 fdecl(hook_name, va_alist) \
103 hook_type hook_name; \
106 #define printf_arglist_function1(fdecl, arg1_type, arg1_name, hook_type, hook_name) \
107 fdecl(arg1_name, hook_name, va_alist) \
108 arg1_type arg1_name; \
109 hook_type hook_name; \
112 #define printf_arglist_function2(fdecl, arg1_type, arg1_name, arg2_type, arg2_name, hook_type, hook_name) \
113 fdecl(arg1_name, arg2_name, hook_name, va_alist) \
114 arg1_type arg1_name; \
115 arg2_type arg2_name; \
116 hook_type hook_name; \
119 #define arglist_function(fdecl, hook_type, hook_name) \
120 fdecl(hook_name, va_alist) \
121 hook_type hook_name; \
124 #define arglist_function1(fdecl, arg1_type, arg1_name, hook_type, hook_name) \
125 fdecl(arg1_name, hook_name, va_alist) \
126 arg1_type arg1_name; \
127 hook_type hook_name; \
130 #define arglist_function2(fdecl, arg1_type, arg1_name, arg2_type, arg2_name, hook_type, hook_name) \
131 fdecl(arg1_name, arg2_name, hook_name, va_alist) \
132 arg1_type arg1_name; \
133 arg2_type arg2_name; \
134 hook_type hook_name; \
137 #define arglist_function3(fdecl, arg1_type, arg1_name, arg2_type, arg2_name, \
138 arg3_type, arg3_name, hook_type, hook_name) \
139 fdecl(arg1_name, arg2_name, arg3_name, hook_name, va_alist) \
140 arg1_type arg1_name; \
141 arg2_type arg2_name; \
142 arg3_type arg3_name; \
143 hook_type hook_name; \
146 #define arglist_start(arg,hook_name) va_start(arg)
150 #define arglist_val(arg,type) va_arg(arg,type)
151 #define arglist_end(arg) va_end(arg)
153 #endif /* !ARGLIST_H */