summaryrefslogtreecommitdiff
path: root/stubs.h
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2017-10-24 13:54:47 -0400
committerAdam Jackson <ajax@redhat.com>2017-10-24 15:14:23 -0400
commit102696da8737fcb324034f673cd5815f28923311 (patch)
tree360e49b700b617768f4289c6d9d23da7641791b1 /stubs.h
parente12c03d50a634a98e4560c7117a3bec3349561e9 (diff)
Import libXfont's BDF-to-PCF code
bdftopcf is the only consumer of libXfont 1.x's read/write support, and we'd like 1.x to go away entirely. Copy in the BDF read and PCF write support so there's one fewer consumer of 1.x. Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Julien Cristau <jcristau@debian.org>
Diffstat (limited to 'stubs.h')
-rw-r--r--stubs.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/stubs.h b/stubs.h
new file mode 100644
index 0000000..9e71806
--- /dev/null
+++ b/stubs.h
@@ -0,0 +1,79 @@
+#include <stdio.h>
+#include <X11/fonts/fntfilst.h>
+#include <X11/fonts/font.h>
+
+#ifndef True
+#define True (-1)
+#endif
+#ifndef False
+#define False (0)
+#endif
+
+/* this probably works for Mach-O too, but probably not for PE */
+#if defined(__ELF__) && defined(__GNUC__) && (__GNUC__ >= 3)
+#define weak __attribute__((weak))
+#else
+#define weak
+#ifndef __SUNPRO_C /* Sun compilers use #pragma weak in .c files instead */
+#define NO_WEAK_SYMBOLS
+#endif
+#endif
+
+#if defined(NO_WEAK_SYMBOLS) && defined(PIC)
+#include <stdarg.h>
+extern int _font_init_stubs(void);
+#define OVERRIDE_DATA(sym) \
+ _font_init_stubs(); \
+ if (__ptr_##sym && __ptr_##sym != &sym) \
+ sym = *__ptr_##sym
+#define OVERRIDE_SYMBOL(sym,...) \
+ _font_init_stubs(); \
+ if (__##sym && __##sym != sym) \
+ return (*__##sym)(__VA_ARGS__)
+#define OVERRIDE_VA_SYMBOL(sym,f) \
+ va_list _args; \
+ _font_init_stubs(); \
+ va_start(_args, f); \
+ if (__##sym) \
+ (*__##sym)(f, _args); \
+ va_end(_args)
+
+extern int (*__client_auth_generation)(ClientPtr);
+extern Bool (*__ClientSignal)(ClientPtr);
+extern void (*__DeleteFontClientID)(Font);
+extern void (*__VErrorF)(const char *, va_list);
+extern FontPtr (*__find_old_font)(FSID);
+extern FontResolutionPtr (*__GetClientResolutions)(int *);
+extern int (*__GetDefaultPointSize)(void);
+extern Font (*__GetNewFontClientID)(void);
+extern unsigned long (*__GetTimeInMillis)(void);
+extern int (*__init_fs_handlers)(FontPathElementPtr, BlockHandlerProcPtr);
+extern int (*__RegisterFPEFunctions)(NameCheckFunc, InitFpeFunc, FreeFpeFunc,
+ ResetFpeFunc, OpenFontFunc, CloseFontFunc, ListFontsFunc,
+ StartLfwiFunc, NextLfwiFunc, WakeupFpeFunc, ClientDiedFunc,
+ LoadGlyphsFunc, StartLaFunc, NextLaFunc, SetPathFunc);
+extern void (*__remove_fs_handlers)(FontPathElementPtr, BlockHandlerProcPtr, Bool);
+extern void **__ptr_serverClient;
+extern int (*__set_font_authorizations)(char **, int *, ClientPtr);
+extern int (*__StoreFontClientFont)(FontPtr, Font);
+extern Atom (*__MakeAtom)(const char *, unsigned, int);
+extern int (*__ValidAtom)(Atom);
+extern char *(*__NameForAtom)(Atom);
+extern unsigned long *__ptr_serverGeneration;
+extern void (*__register_fpe_functions)(void);
+#else /* NO_WEAK_SYMBOLS && PIC */
+#define OVERRIDE_DATA(sym)
+#define OVERRIDE_SYMBOL(sym,...)
+#define OVERRIDE_VA_SYMBOL(sym,f)
+#endif
+
+extern FontPtr find_old_font ( FSID id );
+extern int set_font_authorizations ( char **authorizations,
+ int *authlen,
+ ClientPtr client );
+
+extern unsigned long GetTimeInMillis (void);
+
+extern void ErrorF(const char *format, ...);
+
+/* end of file */