]>
git.wh0rd.org - fontconfig.git/blob - fontconfig/fcprivate.h
3754efa7f64d6fcb551f25b495d525494c4046e5
2 * $XFree86: xc/lib/fontconfig/fontconfig/fcprivate.h,v 1.3 2002/05/31 23:21:24 keithp Exp $
4 * Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc.
6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name of Keith Packard not be used in
11 * advertising or publicity pertaining to distribution of the software without
12 * specific, written prior permission. Keith Packard makes no
13 * representations about the suitability of this software for any purpose. It
14 * is provided "as is" without express or implied warranty.
16 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22 * PERFORMANCE OF THIS SOFTWARE.
29 * I tried this with functions that took va_list* arguments
30 * but portability concerns made me change these functions
34 #define FcPatternVapBuild(result, orig, va) \
36 FcPattern *__p__ = (orig); \
42 __p__ = FcPatternCreate (); \
44 goto _FcPatternVapBuild_bail0; \
48 __o__ = va_arg (va, const char *); \
51 __v__.type = va_arg (va, FcType); \
52 switch (__v__.type) { \
54 goto _FcPatternVapBuild_bail1; \
56 __v__.u.i = va_arg (va, int); \
59 __v__.u.d = va_arg (va, double); \
62 __v__.u.s = va_arg (va, FcChar8 *); \
65 __v__.u.b = va_arg (va, FcBool); \
68 __v__.u.m = va_arg (va, FcMatrix *); \
71 __v__.u.c = va_arg (va, FcCharSet *); \
74 __v__.u.f = va_arg (va, FT_Face); \
77 __v__.u.p = va_arg (va, FcPattern *); \
79 if (!FcPatternAdd (__p__, __o__, __v__, FcTrue)) \
80 goto _FcPatternVapBuild_bail1; \
83 goto _FcPatternVapBuild_return; \
85 _FcPatternVapBuild_bail1: \
87 FcPatternDestroy (__p__); \
88 _FcPatternVapBuild_bail0: \
91 _FcPatternVapBuild_return: \
96 #define FcObjectSetVapBuild(__ret__, __first__, __va__) \
98 FcObjectSet *__os__; \
102 __os__ = FcObjectSetCreate (); \
104 goto _FcObjectSetVapBuild_bail0; \
105 __ob__ = __first__; \
108 if (!FcObjectSetAdd (__os__, __ob__)) \
109 goto _FcObjectSetVapBuild_bail1; \
110 __ob__ = va_arg (__va__, const char *); \
114 _FcObjectSetVapBuild_bail1: \
115 if (!__ret__ && __os__) \
116 FcObjectSetDestroy (__os__); \
117 _FcObjectSetVapBuild_bail0: \
121 #endif /* _FCPRIVATE_H_ */