Index: xc/programs/Xserver/Xprint/Init.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/Init.c,v retrieving revision 1.1.4.2.6.1.6.1 diff -u -r1.1.4.2.6.1.6.1 Init.c --- a/xc/programs/Xserver/Xprint/Init.c 13 Apr 2004 03:16:44 -0000 1.1.4.2.6.1.6.1 +++ b/xc/programs/Xserver/Xprint/Init.c 20 Apr 2004 03:18:49 -0000 @@ -287,6 +287,24 @@ static Bool freeDefaultFontPath = FALSE; static char *origFontPath = (char *)NULL; +static Bool xprintInitGlobalsCalled = FALSE; +/* + * This function is responsible for doing initalisation of any global + * variables at an very early point of server startup (even before + * |ProcessCommandLine()|. + */ +void XprintInitGlobals(void) +{ + xprintInitGlobalsCalled = TRUE; + +#ifdef SMART_SCHEDULE + /* Somehow the XF86 "smart scheduler" completely kills the Xprint DDX + * (see http://xprint.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=467 + * ("Xfree86's "smart scheduler" breaks Xprt") */ + SmartScheduleDisable = TRUE; +#endif /* SMART_SCHEDULE */ +} + /* * XprintUseMsg() prints usage for the Xprint-specific options */ @@ -1272,6 +1290,18 @@ char **driverNames; char *configDir; + /* This should NEVER happen, but... */ + if( !xprintInitGlobalsCalled ) + { + FatalError("Internal error: XprintInitGlobals() not called."); + } +#ifdef SMART_SCHEDULE + if( SmartScheduleDisable != TRUE ) + { + FatalError("Internal error: XF86 smart scheduler incompatible to Xprint DDX."); + } +#endif /* SMART_SCHEDULE */ + /* * this little test is just a warning at startup to make sure * that the config directory exists. Index: xc/programs/Xserver/Xprint/ddxInit.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/ddxInit.c,v retrieving revision 1.1.4.2.6.1.6.1 diff -u -r1.1.4.2.6.1.6.1 ddxInit.c --- a/xc/programs/Xserver/Xprint/ddxInit.c 13 Apr 2004 03:16:44 -0000 1.1.4.2.6.1.6.1 +++ b/xc/programs/Xserver/Xprint/ddxInit.c 20 Apr 2004 03:18:49 -0000 @@ -229,6 +229,12 @@ } #endif +/* ddxInitGlobals - called by |InitGlobals| from os/util.c */ +void ddxInitGlobals(void) +{ + XprintInitGlobals(); +} + /**************************************** * ddxUseMsg() * Index: xc/programs/Xserver/dix/dispatch.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/dix/dispatch.c,v retrieving revision 1.1.4.4.2.3.6.1 diff -u -r1.1.4.4.2.3.6.1 dispatch.c --- a/xc/programs/Xserver/dix/dispatch.c 17 Apr 2004 02:34:47 -0000 1.1.4.4.2.3.6.1 +++ b/xc/programs/Xserver/dix/dispatch.c 20 Apr 2004 03:18:51 -0000 @@ -253,14 +253,7 @@ #define SMART_SCHEDULE_DEFAULT_INTERVAL 20 /* ms */ #define SMART_SCHEDULE_MAX_SLICE 200 /* ms */ -#ifdef XPRINT -/* Somehow the XF86 "smart scheduler" completely kills the Xprint DDX - * (see http://xprint.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=467 - * ("Xfree86's "smart scheduler" breaks Xprt") */ -Bool SmartScheduleDisable = TRUE; -#else Bool SmartScheduleDisable = FALSE; -#endif /* XPRINT */ long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE; Index: xc/programs/Xserver/dix/main.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/dix/main.c,v retrieving revision 1.1.4.5.2.4 diff -u -r1.1.4.5.2.4 main.c --- a/xc/programs/Xserver/dix/main.c 8 Mar 2004 00:36:56 -0000 1.1.4.5.2.4 +++ b/xc/programs/Xserver/dix/main.c 20 Apr 2004 03:18:51 -0000 @@ -251,6 +251,8 @@ display = "0"; + InitGlobals(); + /* Quartz support on Mac OS X requires that the Cocoa event loop be in * the main thread. This allows the X server main to be called again * from another thread. */ Index: xc/programs/Xserver/hw/darwin/darwin.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/darwin/darwin.c,v retrieving revision 1.1.4.2.4.1.6.2 diff -u -r1.1.4.2.4.1.6.2 darwin.c --- a/xc/programs/Xserver/hw/darwin/darwin.c 12 Apr 2004 12:20:59 -0000 1.1.4.2.4.1.6.2 +++ b/xc/programs/Xserver/hw/darwin/darwin.c 20 Apr 2004 03:18:52 -0000 @@ -697,6 +697,10 @@ } } +/* ddxInitGlobals - called by |InitGlobals| from os/util.c */ +void ddxInitGlobals(void) +{ +} /* * ddxProcessArgument -- Index: xc/programs/Xserver/hw/sun/sunIo.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/sun/sunIo.c,v retrieving revision 1.1.4.2.6.1 diff -u -r1.1.4.2.6.1 sunIo.c --- a/xc/programs/Xserver/hw/sun/sunIo.c 4 Mar 2004 17:47:31 -0000 1.1.4.2.6.1 +++ b/xc/programs/Xserver/hw/sun/sunIo.c 20 Apr 2004 03:18:52 -0000 @@ -193,6 +193,11 @@ AbortDDX (); } +/* ddxInitGlobals - called by |InitGlobals| from os/util.c */ +void ddxInitGlobals(void) +{ +} + int ddxProcessArgument (argc, argv, i) int argc; Index: xc/programs/Xserver/hw/sunLynx/sunLyIo.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/sunLynx/sunLyIo.c,v retrieving revision 1.1.4.2.6.1 diff -u -r1.1.4.2.6.1 sunLyIo.c --- a/xc/programs/Xserver/hw/sunLynx/sunLyIo.c 4 Mar 2004 17:47:33 -0000 1.1.4.2.6.1 +++ b/xc/programs/Xserver/hw/sunLynx/sunLyIo.c 20 Apr 2004 03:18:52 -0000 @@ -295,6 +295,11 @@ AbortDDX (); } +/* ddxInitGlobals - called by |InitGlobals| from os/util.c */ +void ddxInitGlobals(void) +{ +} + int ddxProcessArgument (argc, argv, i) int argc; Index: xc/programs/Xserver/hw/vfb/InitOutput.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/vfb/InitOutput.c,v retrieving revision 1.1.4.2.6.1 diff -u -r1.1.4.2.6.1 InitOutput.c --- a/xc/programs/Xserver/hw/vfb/InitOutput.c 4 Mar 2004 17:47:33 -0000 1.1.4.2.6.1 +++ b/xc/programs/Xserver/hw/vfb/InitOutput.c 20 Apr 2004 03:18:53 -0000 @@ -273,6 +273,11 @@ #endif } +/* ddxInitGlobals - called by |InitGlobals| from os/util.c */ +void ddxInitGlobals(void) +{ +} + int ddxProcessArgument(int argc, char *argv[], int i) { Index: xc/programs/Xserver/hw/xfree86/common/xf86Init.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v retrieving revision 1.1.4.5.2.1.4.1 diff -u -r1.1.4.5.2.1.4.1 xf86Init.c --- a/xc/programs/Xserver/hw/xfree86/common/xf86Init.c 10 Apr 2004 09:04:36 -0000 1.1.4.5.2.1.4.1 +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Init.c 20 Apr 2004 03:18:54 -0000 @@ -1295,6 +1295,11 @@ return save; } +/* ddxInitGlobals - called by |InitGlobals| from os/util.c */ +void ddxInitGlobals(void) +{ +} + /* * ddxProcessArgument -- * Process device-dependent command line args. Returns 0 if argument is Index: xc/programs/Xserver/hw/xnest/Args.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xnest/Args.c,v retrieving revision 1.1.4.1.6.1 diff -u -r1.1.4.1.6.1 Args.c --- a/xc/programs/Xserver/hw/xnest/Args.c 4 Mar 2004 17:48:19 -0000 1.1.4.1.6.1 +++ b/xc/programs/Xserver/hw/xnest/Args.c 20 Apr 2004 03:18:55 -0000 @@ -47,6 +47,11 @@ Bool xnestDoDirectColormaps = False; Window xnestParentWindow = 0; +/* ddxInitGlobals - called by |InitGlobals| from os/util.c */ +void ddxInitGlobals(void) +{ +} + int ddxProcessArgument (int argc, char *argv[], int i) { Index: xc/programs/Xserver/hw/xwin/InitOutput.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/InitOutput.c,v retrieving revision 1.1.4.1.6.1.6.1 diff -u -r1.1.4.1.6.1.6.1 InitOutput.c --- a/xc/programs/Xserver/hw/xwin/InitOutput.c 10 Apr 2004 09:05:34 -0000 1.1.4.1.6.1.6.1 +++ b/xc/programs/Xserver/hw/xwin/InitOutput.c 20 Apr 2004 03:18:56 -0000 @@ -394,6 +394,11 @@ /* Compare the current option with the string. */ #define IS_OPTION(name) (strcmp (argv[i], name) == 0) +/* ddxInitGlobals - called by |InitGlobals| from os/util.c */ +void ddxInitGlobals(void) +{ +} + int ddxProcessArgument (int argc, char *argv[], int i) { Index: xc/programs/Xserver/include/os.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/include/os.h,v retrieving revision 1.1.4.3.6.2 diff -u -r1.1.4.3.6.2 os.h --- a/xc/programs/Xserver/include/os.h 17 Mar 2004 17:39:36 -0000 1.1.4.3.6.2 +++ b/xc/programs/Xserver/include/os.h 20 Apr 2004 03:18:56 -0000 @@ -231,6 +231,8 @@ extern void UseMsg(void); +extern void InitGlobals(void); + extern void ProcessCommandLine(int /*argc*/, char* /*argv*/[]); extern int set_font_authorizations( @@ -412,6 +414,8 @@ extern void ExpandCommandLine(int * /*pargc*/, char *** /*pargv*/); #endif +extern void ddxInitGlobals(void); + extern int ddxProcessArgument(int /*argc*/, char * /*argv*/ [], int /*i*/); extern void ddxUseMsg(void); Index: xc/programs/Xserver/os/utils.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/os/utils.c,v retrieving revision 1.1.4.6.2.4.6.2 diff -u -r1.1.4.6.2.4.6.2 utils.c --- a/xc/programs/Xserver/os/utils.c 12 Apr 2004 12:21:07 -0000 1.1.4.6.2.4.6.2 +++ b/xc/programs/Xserver/os/utils.c 20 Apr 2004 03:18:57 -0000 @@ -576,6 +576,17 @@ } /* + * This function is responsible for doing initalisation of any global + * variables at an very early point of server startup (even before + * |ProcessCommandLine()|. + */ +void InitGlobals(void) +{ + ddxInitGlobals(); +} + + +/* * This function parses the command line. Handles device-independent fields * and allows ddx to handle additional fields. It is not allowed to modify * argc or any of the strings pointed to by argv.