diff options
author | David Turner <david@freetype.org> | 1999-12-29 00:22:24 +0000 |
---|---|---|
committer | David Turner <david@freetype.org> | 1999-12-29 00:22:24 +0000 |
commit | 10effdf61e6ee3d35394acf58e7cdc7121798b36 (patch) | |
tree | ce91b42da3252fb4f47b0bf30e1257ba4f0bf52f /src/base/ftinit.c | |
parent | f8bf6e2bc95e6458d5f6eec561a982df4e571e54 (diff) |
Added the rules files `module.mk' to "sfnt", "truetype" and "type1" to
reflect the new modules/drivers list management performed through the
file `freetype2/config/modules.mk'
Changed the driver header files to reflect the new modules/drivers
list management. We get rid, at last, of the infamous pre-processor
tricks used to build the list at compile time.
`src/base/ftinit.c' is also modified to reflect the changes..
Diffstat (limited to 'src/base/ftinit.c')
-rw-r--r-- | src/base/ftinit.c | 61 |
1 files changed, 18 insertions, 43 deletions
diff --git a/src/base/ftinit.c b/src/base/ftinit.c index ca754aed..56f41f60 100644 --- a/src/base/ftinit.c +++ b/src/base/ftinit.c @@ -48,47 +48,25 @@ ************************************************************************/ #include <ftobjs.h> -#include <ftdriver.h> #include <ftconfig.h> #include <ftdebug.h> +#include <ftdriver.h> #undef FT_COMPONENT #define FT_COMPONENT trace_init - /*************************************************************************/ - /* */ - /* The macros FT_SUPPORT_xxxx are defined by Makefile.lib when this file */ - /* is compiled. They come from a make variable called FTINIT_MACROS */ - /* which is updated by each driver Makefile. */ - /* */ - /* This means that when a driver isn't part of the build, ftinit.o */ - /* won't try to reference it. */ - /* */ - /*************************************************************************/ - -#define FTINIT_DRIVER_CHAIN -#define FT_INIT_LAST_DRIVER_CHAIN ((FT_DriverChain*) 0) - - /* Include the SFNT driver interface if needed */ - -#ifdef FT_SUPPORT_SFNT -#include "sfdriver.h" -#endif - - /* Include the TrueType driver interface if needed */ - -#ifdef FT_SUPPORT_TRUETYPE -#include "ttdriver.h" -#endif - - - /* Include the Type1 driver interface if needed */ - -#ifdef FT_SUPPORT_TYPE1 -#include "t1driver.h" -#endif +#undef FT_DRIVER +#define FT_DRIVER(x) extern FT_DriverInterface x; +#include <ftmodule.h> +#undef FT_DRIVER +#define FT_DRIVER(x) &x, +static +const FT_DriverInterface* ft_default_drivers[] = { +#include <ftmodule.h> + 0 +}; /*************************************************************************/ /* */ @@ -104,23 +82,20 @@ EXPORT_FUNC void FT_Default_Drivers( FT_Library library ) { - FT_Error error; - const FT_DriverChain* chain = FT_INIT_LAST_DRIVER_CHAIN; + FT_Error error; + const FT_DriverInterface* *cur; - while (chain) + cur = ft_default_drivers; + while (*cur) { - error = FT_Add_Driver( library, chain->interface ); - + error = FT_Add_Driver( library, *cur ); /* notify errors, but don't stop */ if (error) { FT_ERROR(( "FT.Default_Drivers: cannot install `%s', error = %x\n", - chain->interface->driver_name, - error )); + (*cur)->driver_name, error )); } - - chain = chain->next; - error = 0; /* clear error */ + cur++; } } |