2 * libzvbi -- Useful macros
4 * Copyright (C) 2002, 2003, 2004, 2007 Michael H. Schimek
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301 USA.
22 /* $Id: macros.h,v 1.12 2013-07-10 23:11:18 mschimek Exp $ */
24 #ifndef __ZVBI_MACROS_H__
25 #define __ZVBI_MACROS_H__
28 # define VBI_BEGIN_DECLS extern "C" {
29 # define VBI_END_DECLS }
31 # define VBI_BEGIN_DECLS
32 # define VBI_END_DECLS
40 # define _vbi_sentinel __attribute__ ((__sentinel__(0)))
41 # define _vbi_deprecated __attribute__ ((__deprecated__))
43 # define _vbi_sentinel
44 # define _vbi_deprecated
48 #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ >= 4
49 # define _vbi_nonnull(params) __attribute__ ((__nonnull__ params))
50 # define _vbi_format(params) __attribute__ ((__format__ params))
52 # define _vbi_nonnull(params)
53 # define _vbi_format(params)
57 # define _vbi_pure __attribute__ ((__pure__))
58 # define _vbi_alloc __attribute__ ((__malloc__))
65 # define _vbi_unused __attribute__ ((__unused__))
66 # define _vbi_const __attribute__ ((__const__))
67 # define _vbi_inline static __inline__
71 # define _vbi_inline static
93 # define NULL ((void *) 0)
97 /* XXX Document me - for variadic funcs. */
98 #define VBI_END ((void *) 0)
102 vbi_lock_fn (void * user_data);
104 vbi_unlock_fn (void * user_data);
112 /** External error causes, for example lack of memory. */
113 VBI_LOG_ERROR = 1 << 3,
116 * Invalid parameters and similar problems which suggest
117 * a bug in the application using the library.
119 VBI_LOG_WARNING = 1 << 4,
122 * Causes of possibly undesired results, for example when a
123 * data service cannot be decoded with the current video
126 VBI_LOG_NOTICE = 1 << 5,
128 /** Progress messages. */
129 VBI_LOG_INFO = 1 << 6,
131 /** Information useful to debug the library. */
132 VBI_LOG_DEBUG = 1 << 7,
134 /** Driver responses (strace). Not implemented yet. */
135 VBI_LOG_DRIVER = 1 << 8,
137 /** More detailed debugging information. */
138 VBI_LOG_DEBUG2 = 1 << 9,
139 VBI_LOG_DEBUG3 = 1 << 10
143 vbi_log_fn (vbi_log_mask level,
144 const char * context,
145 const char * message,
148 extern vbi_log_fn vbi_log_on_stderr;
161 #endif /* __ZVBI_MACROS_H__ */