1#include <stdio.h>
2#include <X11/fonts/fntfilst.h>
3#include <X11/fonts/font.h>
4
5#ifndef True
6#define True (-1)
7#endif
8#ifndef False
9#define False (0)
10#endif
11
12/* this probably works for Mach-O too, but probably not for PE */
13#if defined(__ELF__) && defined(__GNUC__) && (__GNUC__ >= 3)
14#define weak __attribute__((weak))
15#else
16#define weak
17#ifndef __SUNPRO_C /* Sun compilers use #pragma weak in .c files instead */
18#define NO_WEAK_SYMBOLS
19#endif
20#endif
21
22#if defined(NO_WEAK_SYMBOLS) && defined(PIC)
23#include <stdarg.h>
24extern int _font_init_stubs(void);
25#define OVERRIDE_DATA(sym) \
26    _font_init_stubs(); \
27    if (__ptr_##sym && __ptr_##sym != &sym) \
28      sym = *__ptr_##sym
29#define OVERRIDE_SYMBOL(sym,...) \
30    _font_init_stubs(); \
31    if (__##sym && __##sym != sym) \
32      return (*__##sym)(__VA_ARGS__)
33#define OVERRIDE_VA_SYMBOL(sym,f) \
34    va_list _args; \
35    _font_init_stubs(); \
36    va_start(_args, f); \
37    if (__##sym) \
38      (*__##sym)(f, _args); \
39    va_end(_args)
40
41extern int (*__client_auth_generation)(ClientPtr);
42extern Bool (*__ClientSignal)(ClientPtr);
43extern void (*__DeleteFontClientID)(Font);
44extern void (*__VErrorF)(const char *, va_list);
45extern FontPtr (*__find_old_font)(FSID);
46extern FontResolutionPtr (*__GetClientResolutions)(int *);
47extern int (*__GetDefaultPointSize)(void);
48extern Font (*__GetNewFontClientID)(void);
49extern unsigned long (*__GetTimeInMillis)(void);
50extern int (*__init_fs_handlers)(FontPathElementPtr, BlockHandlerProcPtr);
51extern int (*__RegisterFPEFunctions)(NameCheckFunc, InitFpeFunc, FreeFpeFunc,
52            ResetFpeFunc, OpenFontFunc, CloseFontFunc, ListFontsFunc,
53            StartLfwiFunc, NextLfwiFunc, WakeupFpeFunc, ClientDiedFunc,
54            LoadGlyphsFunc, StartLaFunc, NextLaFunc, SetPathFunc);
55extern void (*__remove_fs_handlers)(FontPathElementPtr, BlockHandlerProcPtr, Bool);
56extern void **__ptr_serverClient;
57extern int (*__set_font_authorizations)(char **, int *, ClientPtr);
58extern int (*__StoreFontClientFont)(FontPtr, Font);
59extern Atom (*__MakeAtom)(const char *, unsigned, int);
60extern int (*__ValidAtom)(Atom);
61extern char *(*__NameForAtom)(Atom);
62extern unsigned long *__ptr_serverGeneration;
63extern void (*__register_fpe_functions)(void);
64#else /* NO_WEAK_SYMBOLS && PIC */
65#define OVERRIDE_DATA(sym)
66#define OVERRIDE_SYMBOL(sym,...)
67#define OVERRIDE_VA_SYMBOL(sym,f)
68#endif
69
70extern FontPtr find_old_font ( FSID id );
71extern int set_font_authorizations ( char **authorizations,
72				     int *authlen,
73				     ClientPtr client );
74
75extern unsigned long GetTimeInMillis (void);
76
77extern void ErrorF(const char *format, ...);
78
79/* end of file */
80