]> git.wh0rd.org - fontconfig.git/commitdiff
Revert "Remove fcprivate.h, move the remaining macros to fcint.h."
authorKeith Packard <keithp@koto.keithp.com>
Tue, 13 Nov 2007 23:48:30 +0000 (15:48 -0800)
committerKeith Packard <keithp@koto.keithp.com>
Tue, 13 Nov 2007 23:48:30 +0000 (15:48 -0800)
This reverts commit b607922909acfc7ae96de688ed34efd19cd038ac.

Conflicts:

src/Makefile.am

Xft still uses the macros that are in fcprivate.h. Document those macros and
include fcprivate.h in the published header files.

doc/check-missing-doc
doc/fcobjectset.fncs
doc/fcpattern.fncs
fontconfig/Makefile.am
fontconfig/fcprivate.h [new file with mode: 0644]
fontconfig/fontconfig.h
src/Makefile.am
src/fcint.h

index 3eef93a167f5755d3dae61db4fbdfbea92b63708..195ec003be6dc16e7897e9cd98c9ffbed01b2020 100644 (file)
@@ -21,3 +21,4 @@ fi
 echo \
 'Library Export                                                        Documentation'
 diff -y $header $doc | grep '[<>]'
+exit 1
index ce1ecaec27c4cbf4f5b59691accb915c6e26559b..a15326a08e5a0d692c498ede21a1e746918f909c 100644 (file)
@@ -51,12 +51,23 @@ Destroys an object set.
 @FUNC@         FcObjectSetBuild
 @TYPE1@                const char *                    @ARG1@          first
 @TYPE2@                ...
+
 @PROTOTYPE+@
 @RET+@         FcObjectSet *
 @FUNC+@                FcObjectSetVaBuild
 @TYPE1+@       const char *                    @ARG1+@         first
 @TYPE2+@       va_list%                        @ARG2+@         va
+
+@PROTOTYPE++@
+@RET++@                void
+@FUNC++@       FcObjectSetVapBuild
+@TYPE1++@      FcObjectSet *                   @ARG1++@        result
+@TYPE2++@      const char *                    @ARG2++@        first
+@TYPE3++@      va_list%                        @ARG3++@        va
+
 @PURPOSE@      Build object set from args
 @DESC@
 These build an object set from a null-terminated list of property names.
+FcObjectSetVapBuild is a macro version of FcObjectSetVaBuild which returns
+the result in the <parameter>result</parameter> variable directly.
 @@
index a346cc59811f21154e71b1b4218e291e5b1f3b6e..ba04566e425850c69afbc65edd2b05155870841a 100644 (file)
@@ -273,6 +273,14 @@ in preference to FcPatternGet to provide compile-time typechecking.
 @FUNC+@                FcPatternVaBuild
 @TYPE1+@       FcPattern *                     @ARG1+@         orig
 @TYPE2+@       va_list%                        @ARG2+@         va
+
+@PROTOTYPE++@
+@RET++@                void
+@FUNC++@       FcPatternVapBuild
+@TYPE1++@      FcPattern *                     @ARG1++@        result
+@TYPE2++@      FcPattern *                     @ARG2++@        orig
+@TYPE3++@      va_list%                        @ARG3++@        va
+
 @PURPOSE@      Create patterns from arguments
 @DESC@
 Builds a pattern using a list of objects, types and values.  Each
@@ -300,7 +308,9 @@ pattern = FcPatternBuild (0, FC_FAMILY, FcTypeString, "Times", (char *) 0);
 </programlisting>
 <para>
 FcPatternVaBuild is used when the arguments are already in the form of a
-varargs value.
+varargs value. FcPatternVapBuild is a macro version of FcPatternVaBuild
+which returns its result directly in the <parameter>result</parameter>
+variable.
 @@
 
 @RET@          FcBool
index 7616d8f3b3ade22c861783dbce793502ddd033d2..72fec336e61683951c4d61f81a8d28682eff38ef 100644 (file)
@@ -2,6 +2,7 @@ fontconfigincludedir=$(includedir)/fontconfig
 
 fontconfig_headers=            \
        fontconfig.h            \
-       fcfreetype.h
+       fcfreetype.h            \
+       fcprivate.h
 
 fontconfiginclude_HEADERS = $(fontconfig_headers)
diff --git a/fontconfig/fcprivate.h b/fontconfig/fcprivate.h
new file mode 100644 (file)
index 0000000..9be4c01
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * $RCSId: xc/lib/fontconfig/fontconfig/fcprivate.h,v 1.5 2002/08/19 19:32:04 keithp Exp $
+ *
+ * Copyright © 2001 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission.  Keith Packard makes no
+ * representations about the suitability of this software for any purpose.  It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _FCPRIVATE_H_
+#define _FCPRIVATE_H_
+
+/*
+ * I tried this with functions that took va_list* arguments
+ * but portability concerns made me change these functions
+ * into macros (sigh).
+ */
+
+#define FcPatternVapBuild(result, orig, va)                        \
+{                                                                  \
+    FcPattern  *__p__ = (orig);                                    \
+    const char *__o__;                                             \
+    FcValue    __v__;                                              \
+                                                                   \
+    if (!__p__)                                                            \
+    {                                                              \
+       __p__ = FcPatternCreate ();                                 \
+       if (!__p__)                                                 \
+           goto _FcPatternVapBuild_bail0;                          \
+    }                                                              \
+    for (;;)                                                       \
+    {                                                              \
+       __o__ = va_arg (va, const char *);                          \
+       if (!__o__)                                                 \
+           break;                                                  \
+       __v__.type = va_arg (va, FcType);                           \
+       switch (__v__.type) {                                       \
+       case FcTypeVoid:                                            \
+           goto _FcPatternVapBuild_bail1;                          \
+       case FcTypeInteger:                                         \
+           __v__.u.i = va_arg (va, int);                           \
+           break;                                                  \
+       case FcTypeDouble:                                          \
+           __v__.u.d = va_arg (va, double);                        \
+           break;                                                  \
+       case FcTypeString:                                          \
+           __v__.u.s = va_arg (va, const FcChar8 *);               \
+           break;                                                  \
+       case FcTypeBool:                                            \
+           __v__.u.b = va_arg (va, FcBool);                        \
+           break;                                                  \
+       case FcTypeMatrix:                                          \
+           __v__.u.m = va_arg (va, const FcMatrix *);              \
+           break;                                                  \
+       case FcTypeCharSet:                                         \
+           __v__.u.c = va_arg (va, const FcCharSet *);             \
+           break;                                                  \
+       case FcTypeFTFace:                                          \
+           __v__.u.f = va_arg (va, FT_Face);                       \
+           break;                                                  \
+       case FcTypeLangSet:                                         \
+           __v__.u.l = va_arg (va, const FcLangSet *);             \
+           break;                                                  \
+       }                                                           \
+       if (!FcPatternAdd (__p__, __o__, __v__, FcTrue))            \
+           goto _FcPatternVapBuild_bail1;                          \
+    }                                                              \
+    result = __p__;                                                \
+    goto _FcPatternVapBuild_return;                                \
+                                                                   \
+_FcPatternVapBuild_bail1:                                          \
+    if (!orig)                                                     \
+       FcPatternDestroy (__p__);                                   \
+_FcPatternVapBuild_bail0:                                          \
+    result = (void*)0;                                             \
+                                                                   \
+_FcPatternVapBuild_return:                                         \
+    ;                                                              \
+}
+
+
+#define FcObjectSetVapBuild(__ret__, __first__, __va__)                \
+{                                                                      \
+    FcObjectSet    *__os__;                                            \
+    const char     *__ob__;                                            \
+                                                                       \
+    __ret__ = 0;                                                       \
+    __os__ = FcObjectSetCreate ();                                     \
+    if (!__os__)                                                       \
+       goto _FcObjectSetVapBuild_bail0;                                \
+    __ob__ = __first__;                                                        \
+    while (__ob__)                                                     \
+    {                                                                  \
+       if (!FcObjectSetAdd (__os__, __ob__))                           \
+           goto _FcObjectSetVapBuild_bail1;                            \
+       __ob__ = va_arg (__va__, const char *);                         \
+    }                                                                  \
+    __ret__ = __os__;                                                  \
+                                                                       \
+_FcObjectSetVapBuild_bail1:                                            \
+    if (!__ret__ && __os__)                                            \
+       FcObjectSetDestroy (__os__);                                    \
+_FcObjectSetVapBuild_bail0:                                            \
+    ;                                                                  \
+}
+
+#endif /* _FCPRIVATE_H_ */
+
index 0a09766c10c50395aaf65b603454c82e191854c6..37d6652d2c8cd49bf87c3ae6cd164030b092dfed 100644 (file)
@@ -551,7 +551,7 @@ FcPublic FcBool
 FcInitBringUptoDate (void);
 
 /* fclang.c */
-FcStrSet *
+FcPublic FcStrSet *
 FcGetLangs (void);
 
 FcPublic const FcCharSet *
index a4bbc4542c881d23dc1351836a9565af88ba7c27..e4c203c58d48f9e804aa3cc1fc530ea86b91df5d 100644 (file)
@@ -125,7 +125,8 @@ uninstall-local: uninstall-ms-import-lib uninstall-libtool-import-lib
 PUBLIC_FILES = \
        $(top_srcdir)/fontconfig/fontconfig.h \
        $(top_srcdir)/fontconfig/fcfreetype.h \
-       $(top_srcdir)/src/fcdeprecate.h
+       $(top_srcdir)/src/fcdeprecate.h \
+       $(top_srcdir)/fontconfig/fcprivate.h
        
 fcaliastail.h: fcalias.h
 
index 62a04b8e5266016f7dc2b4c22dc7b29aefde45f0..922a2df0ce51ec885f2d001dcb930ef6cb87b8d8 100644 (file)
@@ -46,6 +46,7 @@
 #include <sys/stat.h>
 #include <time.h>
 #include <fontconfig/fontconfig.h>
+#include <fontconfig/fcprivate.h>
 #include <fontconfig/fcfreetype.h>
 #include "fcdeprecate.h"
 
@@ -496,100 +497,6 @@ typedef struct _FcCharMap FcCharMap;
 /* watch out; assumes that v is void * -PL */
 #define ALIGN(v,type) ((void *)(((uintptr_t)(v) + fc_alignof(type) - 1) & ~(fc_alignof(type) - 1)))
 
-/*
- * I tried this with functions that took va_list* arguments
- * but portability concerns made me change these functions
- * into macros (sigh).
- */
-
-#define FcPatternVapBuild(result, orig, va)                        \
-{                                                                  \
-    FcPattern  *__p__ = (orig);                                    \
-    const char *__o__;                                             \
-    FcValue    __v__;                                              \
-                                                                   \
-    if (!__p__)                                                            \
-    {                                                              \
-       __p__ = FcPatternCreate ();                                 \
-       if (!__p__)                                                 \
-           goto _FcPatternVapBuild_bail0;                          \
-    }                                                              \
-    for (;;)                                                       \
-    {                                                              \
-       __o__ = va_arg (va, const char *);                          \
-       if (!__o__)                                                 \
-           break;                                                  \
-       __v__.type = va_arg (va, FcType);                           \
-       switch (__v__.type) {                                       \
-       case FcTypeVoid:                                            \
-           goto _FcPatternVapBuild_bail1;                          \
-       case FcTypeInteger:                                         \
-           __v__.u.i = va_arg (va, int);                           \
-           break;                                                  \
-       case FcTypeDouble:                                          \
-           __v__.u.d = va_arg (va, double);                        \
-           break;                                                  \
-       case FcTypeString:                                          \
-           __v__.u.s = va_arg (va, const FcChar8 *);               \
-           break;                                                  \
-       case FcTypeBool:                                            \
-           __v__.u.b = va_arg (va, FcBool);                        \
-           break;                                                  \
-       case FcTypeMatrix:                                          \
-           __v__.u.m = va_arg (va, const FcMatrix *);              \
-           break;                                                  \
-       case FcTypeCharSet:                                         \
-           __v__.u.c = va_arg (va, const FcCharSet *);             \
-           break;                                                  \
-       case FcTypeFTFace:                                          \
-           __v__.u.f = va_arg (va, FT_Face);                       \
-           break;                                                  \
-       case FcTypeLangSet:                                         \
-           __v__.u.l = va_arg (va, const FcLangSet *);             \
-           break;                                                  \
-       }                                                           \
-       if (!FcPatternAdd (__p__, __o__, __v__, FcTrue))            \
-           goto _FcPatternVapBuild_bail1;                          \
-    }                                                              \
-    result = __p__;                                                \
-    goto _FcPatternVapBuild_return;                                \
-                                                                   \
-_FcPatternVapBuild_bail1:                                          \
-    if (!orig)                                                     \
-       FcPatternDestroy (__p__);                                   \
-_FcPatternVapBuild_bail0:                                          \
-    result = (void*)0;                                             \
-                                                                   \
-_FcPatternVapBuild_return:                                         \
-    ;                                                              \
-}
-
-
-#define FcObjectSetVapBuild(__ret__, __first__, __va__)                \
-{                                                                      \
-    FcObjectSet    *__os__;                                            \
-    const char     *__ob__;                                            \
-                                                                       \
-    __ret__ = 0;                                                       \
-    __os__ = FcObjectSetCreate ();                                     \
-    if (!__os__)                                                       \
-       goto _FcObjectSetVapBuild_bail0;                                \
-    __ob__ = __first__;                                                        \
-    while (__ob__)                                                     \
-    {                                                                  \
-       if (!FcObjectSetAdd (__os__, __ob__))                           \
-           goto _FcObjectSetVapBuild_bail1;                            \
-       __ob__ = va_arg (__va__, const char *);                         \
-    }                                                                  \
-    __ret__ = __os__;                                                  \
-                                                                       \
-_FcObjectSetVapBuild_bail1:                                            \
-    if (!__ret__ && __os__)                                            \
-       FcObjectSetDestroy (__os__);                                    \
-_FcObjectSetVapBuild_bail0:                                            \
-    ;                                                                  \
-}
-
 /* fcblanks.c */
 
 /* fccache.c */