00001 /* Part of the culibs project, <http://www.eideticdew.org/culibs/>. 00002 * Copyright (C) 2006--2007 Petter Urkedal <urkedal@nbi.dk> 00003 * 00004 * This program is free software: you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation, either version 3 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 #ifndef CU_VA_REF_H 00019 #define CU_VA_REF_H 00020 00021 #include <cu/fwd.h> 00022 #include <cu/conf.h> 00023 #include <stdarg.h> 00024 00025 CU_BEGIN_DECLARATIONS 00026 /** \defgroup cu_va_ref_h cu/va_ref.h: Passing \c va_list as a Reference 00027 ** @{ \ingroup cu_util_mod */ 00028 00029 #ifdef CUCONF_VA_LIST_IS_REF 00030 00031 typedef va_list cu_va_ref_t; 00032 #define cu_va_ref_of_va_list(va) (va) 00033 #define cu_va_ref_to_va_list(va) (va) 00034 #define cu_va_ref_arg(va, t) va_arg(va, t) 00035 00036 #else 00037 00038 typedef va_list *cu_va_ref_t; 00039 #define cu_va_ref_of_va_list(va) (&(va)) 00040 #define cu_va_ref_to_va_list(va) (*(va)) 00041 #define cu_va_ref_arg(va, t) va_arg(*(va), t) 00042 00043 #endif 00044 00045 /** @} */ 00046 CU_END_DECLARATIONS 00047 00048 #endif