Re: Latest CVS Compilation error
Alexander, I have submitted your change to XFree86 as part of a large patch set. See bug 701: http://bugs.xfree86.org/show_bug.cgi?id=701 Harold Alexander Gottwald wrote: Harold L Hunt II wrote: Please resubmit your earlier patch when you have this completed. Stupid me. Has forgotten to attach the patch *g*. bye ago NP: Welle:Erdball - Starfighter F-104G (2) Index: winmsg.c === RCS file: /cvs/xc/programs/Xserver/hw/xwin/winmsg.c,v retrieving revision 1.1 diff -u -r1.1 winmsg.c --- winmsg.c 17 Oct 2002 08:18:22 - 1.1 +++ winmsg.c 15 Sep 2003 19:27:26 - @@ -45,26 +45,7 @@ winVMsg (int scrnIndex, MessageType type, int verb, const char *format, va_list ap) { - const char *prefix = NULL; - - if (verb verb VERBOSE_LEVEL) -return; - -#undef __msg -#define __msg(name,string) case name: prefix = string; break; -#undef _msg -#define _msg(name,string) __msg(name,string) - switch (type) -{ - MESSAGE_STRINGS default:prefix = NULL; - break; -} -#undef __msg -#undef _msg - - if (prefix != NULL) -ErrorF (%s , prefix); - VErrorF (format, ap); + LogVMessageVerb(type, verb, format, ap); } @@ -73,7 +54,7 @@ { va_list ap; va_start (ap, format); - winVMsg (scrnIndex, type, 0, format, ap); + LogVMessageVerb(type, 0, format, ap); va_end (ap); } @@ -83,7 +64,7 @@ { va_list ap; va_start (ap, format); - winVMsg (0, type, 0, format, ap); + LogVMessageVerb(type, 0, format, ap); va_end (ap); } @@ -94,7 +75,7 @@ { va_list ap; va_start (ap, format); - winVMsg (scrnIndex, type, verb, format, ap); + LogVMessageVerb(type, verb, format, ap); va_end (ap); } @@ -104,7 +85,7 @@ { va_list ap; va_start (ap, format); - winVMsg (0, type, verb, format, ap); + LogVMessageVerb(type, verb, format, ap); va_end (ap); } @@ -114,6 +95,6 @@ { va_list ap; va_start (ap, format); - winVMsg (0, X_NONE, verb, format, ap); + LogVMessageVerb(X_NONE, verb, format, ap); va_end (ap); } Index: winmsg.h === RCS file: /cvs/xc/programs/Xserver/hw/xwin/winmsg.h,v retrieving revision 1.1 diff -u -r1.1 winmsg.h --- winmsg.h 17 Oct 2002 08:18:22 - 1.1 +++ winmsg.h 15 Sep 2003 19:27:26 - @@ -32,31 +32,6 @@ #ifndef __WIN_MSG_H__ #define __WIN_MSG_H__ - -#define __msg_name(name,string) name -#define __msg(name,string) __msg_name(name,string) -#define _msg(name,string) __msg(name,string), - -#define MESSAGE_STRINGS \ -_msg(X_PROBED,(--)/* Value was probed */)\ -_msg(X_CONFIG,(**)/* Value was given in the config file */)\ -_msg(X_DEFAULT,(==) /* Value is a default */)\ -_msg(X_CMDLINE,(++) /* Value was given on the command line */)\ -_msg(X_NOTICE,(!!)/* Notice */) \ -_msg(X_ERROR,(EE) /* Error message */) \ -_msg(X_WARNING,(WW) /* Warning message */) \ -_msg(X_INFO,(II) /* Informational message */) \ -_msg(X_UNKNOWN,(??) /* Unknown, trigraph fix */) \ -_msg(X_NONE,NULL/* No prefix */) \ -__msg(X_NOT_IMPLEMENTED,(NI) /* Not implemented */) - -typedef enum -{ - MESSAGE_STRINGS -} -MessageType; - - /* * Function prototypes */ Index: InitOutput.c === RCS file: /cvs/xc/programs/Xserver/hw/xwin/InitOutput.c,v retrieving revision 1.33 diff -u -r1.33 InitOutput.c --- InitOutput.c 29 Jul 2003 21:25:15 - 1.33 +++ InitOutput.c 15 Sep 2003 19:27:27 - @@ -47,13 +47,15 @@ int g_iWindowPrivateIndex = -1; unsigned long g_ulServerGeneration = 0; Bool g_fInitializedDefaultScreens = FALSE; -FILE *g_pfLog = NULL; DWORD g_dwEnginesSupported = 0; HINSTANCE g_hInstance = 0; HWND g_hDlgDepthChange = NULL; HWND g_hDlgExit = NULL; Bool g_fCalledSetLocale = FALSE; Bool g_fCalledXInitThreads = FALSE; +int g_iLogVerbose = 4; +char * g_pszLogFile = WIN_LOG_FNAME; +Boolg_fLogInited = FALSE; /* @@ -190,15 +192,11 @@ g_fdMessageQueue = WIN_FD_INVALID; } - /* Close the log file handle */ - if (g_pfLog != NULL) -{ - /* Close log file */ - fclose (g_pfLog); - - /* Set the file handle to invalid */ - g_pfLog = NULL; -} + if (!g_fLogInited) { +LogInit(g_pszLogFile, NULL); +g_fLogInited = TRUE; + } + LogClose(); /* * At this point we aren't creating any new screens, so @@ -242,12 +240,15 @@ #ifdef DDXOSVERRORF if (!OsVendorVErrorFProc) OsVendorVErrorFProc = OsVendorVErrorF; - - /* Open log file if not yet open */ - if (g_pfLog == NULL) -g_pfLog = fopen (WIN_LOG_FNAME, w); #endif + if (!g_fLogInited) { +LogInit(g_pszLogFile, NULL); +g_fLogInited = TRUE; + } + LogSetParameter(XLOG_FLUSH, 1); +
Re: Latest CVS Compilation error
Harold L Hunt II wrote: Sounds good. Please resubmit your earlier patch when you have this completed. It doesn't look like it would be a good idea to implement it one half at a time. However, we can certainly wait on trying to make the log either output to stdout or to a file... that could take some time to get right. Here is the revised patch. This patch is against the HEAD branch of the xfree cvs and is only directed to developers who compile from xfree cvs. The changes do _not_ apply to the test-XX releases of XWin.exe. Th patch forwards all output to the new log functions. The new switch -logfile adjusts the name of the log and -logverbose adjusts the number of messages written. Setting the last to a very low value (eg 0) will remove only few messages since most messages written by the xserver have no special verbosity level set and default to the lowest. The log functions do write the messages to the logfile _and_ to stderr. Most people will not notice as XWin has no console attached in the compiled version. The move to use only the LogXXX functions instead of winMsg and ErrorF has to wait until a 4.4 release of XFree is out and we can import the 4.4 branch to the development cvs. bye ago NP: Welle:Erdball - Starfighter F-104G (2) -- [EMAIL PROTECTED] http://www.gotti.org ICQ: 126018723
Re: Latest CVS Compilation error
Harold L Hunt II wrote: Please resubmit your earlier patch when you have this completed. Stupid me. Has forgotten to attach the patch *g*. bye ago NP: Welle:Erdball - Starfighter F-104G (2) -- [EMAIL PROTECTED] http://www.gotti.org ICQ: 126018723Index: winmsg.c === RCS file: /cvs/xc/programs/Xserver/hw/xwin/winmsg.c,v retrieving revision 1.1 diff -u -r1.1 winmsg.c --- winmsg.c17 Oct 2002 08:18:22 - 1.1 +++ winmsg.c15 Sep 2003 19:27:26 - @@ -45,26 +45,7 @@ winVMsg (int scrnIndex, MessageType type, int verb, const char *format, va_list ap) { - const char *prefix = NULL; - - if (verb verb VERBOSE_LEVEL) -return; - -#undef __msg -#define __msg(name,string) case name: prefix = string; break; -#undef _msg -#define _msg(name,string) __msg(name,string) - switch (type) -{ - MESSAGE_STRINGS default:prefix = NULL; - break; -} -#undef __msg -#undef _msg - - if (prefix != NULL) -ErrorF (%s , prefix); - VErrorF (format, ap); + LogVMessageVerb(type, verb, format, ap); } @@ -73,7 +54,7 @@ { va_list ap; va_start (ap, format); - winVMsg (scrnIndex, type, 0, format, ap); + LogVMessageVerb(type, 0, format, ap); va_end (ap); } @@ -83,7 +64,7 @@ { va_list ap; va_start (ap, format); - winVMsg (0, type, 0, format, ap); + LogVMessageVerb(type, 0, format, ap); va_end (ap); } @@ -94,7 +75,7 @@ { va_list ap; va_start (ap, format); - winVMsg (scrnIndex, type, verb, format, ap); + LogVMessageVerb(type, verb, format, ap); va_end (ap); } @@ -104,7 +85,7 @@ { va_list ap; va_start (ap, format); - winVMsg (0, type, verb, format, ap); + LogVMessageVerb(type, verb, format, ap); va_end (ap); } @@ -114,6 +95,6 @@ { va_list ap; va_start (ap, format); - winVMsg (0, X_NONE, verb, format, ap); + LogVMessageVerb(X_NONE, verb, format, ap); va_end (ap); } Index: winmsg.h === RCS file: /cvs/xc/programs/Xserver/hw/xwin/winmsg.h,v retrieving revision 1.1 diff -u -r1.1 winmsg.h --- winmsg.h17 Oct 2002 08:18:22 - 1.1 +++ winmsg.h15 Sep 2003 19:27:26 - @@ -32,31 +32,6 @@ #ifndef __WIN_MSG_H__ #define __WIN_MSG_H__ - -#define __msg_name(name,string) name -#define __msg(name,string) __msg_name(name,string) -#define _msg(name,string) __msg(name,string), - -#define MESSAGE_STRINGS \ -_msg(X_PROBED,(--)/* Value was probed */)\ -_msg(X_CONFIG,(**)/* Value was given in the config file */)\ -_msg(X_DEFAULT,(==) /* Value is a default */)\ -_msg(X_CMDLINE,(++) /* Value was given on the command line */)\ -_msg(X_NOTICE,(!!)/* Notice */) \ -_msg(X_ERROR,(EE) /* Error message */) \ -_msg(X_WARNING,(WW) /* Warning message */) \ -_msg(X_INFO,(II) /* Informational message */) \ -_msg(X_UNKNOWN,(??) /* Unknown, trigraph fix */) \ -_msg(X_NONE,NULL/* No prefix */) \ -__msg(X_NOT_IMPLEMENTED,(NI) /* Not implemented */) - -typedef enum -{ - MESSAGE_STRINGS -} -MessageType; - - /* * Function prototypes */ Index: InitOutput.c === RCS file: /cvs/xc/programs/Xserver/hw/xwin/InitOutput.c,v retrieving revision 1.33 diff -u -r1.33 InitOutput.c --- InitOutput.c29 Jul 2003 21:25:15 - 1.33 +++ InitOutput.c15 Sep 2003 19:27:27 - @@ -47,13 +47,15 @@ intg_iWindowPrivateIndex = -1; unsigned long g_ulServerGeneration = 0; Bool g_fInitializedDefaultScreens = FALSE; -FILE *g_pfLog = NULL; DWORD g_dwEnginesSupported = 0; HINSTANCE g_hInstance = 0; HWND g_hDlgDepthChange = NULL; HWND g_hDlgExit = NULL; Bool g_fCalledSetLocale = FALSE; Bool g_fCalledXInitThreads = FALSE; +int g_iLogVerbose = 4; +char * g_pszLogFile = WIN_LOG_FNAME; +Boolg_fLogInited = FALSE; /* @@ -190,15 +192,11 @@ g_fdMessageQueue = WIN_FD_INVALID; } - /* Close the log file handle */ - if (g_pfLog != NULL) -{ - /* Close log file */ - fclose (g_pfLog); - - /* Set the file handle to invalid */ - g_pfLog = NULL; -} + if (!g_fLogInited) { +LogInit(g_pszLogFile, NULL); +g_fLogInited = TRUE; + } + LogClose(); /* * At this point we aren't creating any new screens, so @@ -242,12 +240,15 @@ #ifdef DDXOSVERRORF if (!OsVendorVErrorFProc) OsVendorVErrorFProc = OsVendorVErrorF; - - /* Open log file if not yet open */ - if (g_pfLog == NULL) -g_pfLog = fopen (WIN_LOG_FNAME, w); #endif + if (!g_fLogInited) { +LogInit(g_pszLogFile, NULL); +g_fLogInited = TRUE; + } + LogSetParameter(XLOG_FLUSH, 1); + LogSetParameter(XLOG_VERBOSITY, g_iLogVerbose); + /*
Re: Latest CVS Compilation error
Hi, Applied the patchworks fine for me. Colin
Re: Latest CVS Compilation error
Colin Harrison wrote: To build I had to remove typedef MessageType; from winmsg.h in Xwin. Clashes with defs in os/log.c after latest mods to move log handling to DIX. The patch is attached. This patch is _only_ for the xfree86 HEAD. _Not_ for the 4_3_Branch. It forwards the winMsg functions to the LogMessage functions which were introduces short time ago. bye ago NP: Wumpscut - Embryodead -- [EMAIL PROTECTED] http://www.gotti.org ICQ: 126018723Index: winmsg.h === RCS file: /cvs/xc/programs/Xserver/hw/xwin/winmsg.h,v retrieving revision 1.1 diff -u -r1.1 winmsg.h --- winmsg.h17 Oct 2002 08:18:22 - 1.1 +++ winmsg.h14 Sep 2003 18:47:49 - @@ -32,31 +32,6 @@ #ifndef __WIN_MSG_H__ #define __WIN_MSG_H__ - -#define __msg_name(name,string) name -#define __msg(name,string) __msg_name(name,string) -#define _msg(name,string) __msg(name,string), - -#define MESSAGE_STRINGS \ -_msg(X_PROBED,(--)/* Value was probed */)\ -_msg(X_CONFIG,(**)/* Value was given in the config file */)\ -_msg(X_DEFAULT,(==) /* Value is a default */)\ -_msg(X_CMDLINE,(++) /* Value was given on the command line */)\ -_msg(X_NOTICE,(!!)/* Notice */) \ -_msg(X_ERROR,(EE) /* Error message */) \ -_msg(X_WARNING,(WW) /* Warning message */) \ -_msg(X_INFO,(II) /* Informational message */) \ -_msg(X_UNKNOWN,(??) /* Unknown, trigraph fix */) \ -_msg(X_NONE,NULL/* No prefix */) \ -__msg(X_NOT_IMPLEMENTED,(NI) /* Not implemented */) - -typedef enum -{ - MESSAGE_STRINGS -} -MessageType; - - /* * Function prototypes */ Index: winmsg.c === RCS file: /cvs/xc/programs/Xserver/hw/xwin/winmsg.c,v retrieving revision 1.1 diff -u -r1.1 winmsg.c --- winmsg.c17 Oct 2002 08:18:22 - 1.1 +++ winmsg.c14 Sep 2003 18:47:49 - @@ -45,26 +45,7 @@ winVMsg (int scrnIndex, MessageType type, int verb, const char *format, va_list ap) { - const char *prefix = NULL; - - if (verb verb VERBOSE_LEVEL) -return; - -#undef __msg -#define __msg(name,string) case name: prefix = string; break; -#undef _msg -#define _msg(name,string) __msg(name,string) - switch (type) -{ - MESSAGE_STRINGS default:prefix = NULL; - break; -} -#undef __msg -#undef _msg - - if (prefix != NULL) -ErrorF (%s , prefix); - VErrorF (format, ap); + LogVMessageVerb(type, verb, format, ap); } @@ -73,7 +54,7 @@ { va_list ap; va_start (ap, format); - winVMsg (scrnIndex, type, 0, format, ap); + LogVMessageVerb(type, 0, format, ap); va_end (ap); } @@ -83,7 +64,7 @@ { va_list ap; va_start (ap, format); - winVMsg (0, type, 0, format, ap); + LogVMessageVerb(type, 0, format, ap); va_end (ap); } @@ -94,7 +75,7 @@ { va_list ap; va_start (ap, format); - winVMsg (scrnIndex, type, verb, format, ap); + LogVMessageVerb(type, verb, format, ap); va_end (ap); } @@ -104,7 +85,7 @@ { va_list ap; va_start (ap, format); - winVMsg (0, type, verb, format, ap); + LogVMessageVerb(type, verb, format, ap); va_end (ap); } @@ -114,6 +95,6 @@ { va_list ap; va_start (ap, format); - winVMsg (0, X_NONE, verb, format, ap); + LogVMessageVerb(X_NONE, verb, format, ap); va_end (ap); }
Re: Latest CVS Compilation error
Colin Harrison wrote: My XWin.log no longer shows config file output e.g. lines like:- (==) winConfigKeyboard - Layout: 0809 (==) Using preset keyboard for English (United Kingdom) (0809), type 4 Is this as intended? No, I think I'll have to initialize the logging somehow. bye ago -- [EMAIL PROTECTED] http://www.gotti.org ICQ: 126018723
Re: Latest CVS Compilation error
Alexander Gottwald wrote: No, I think I'll have to initialize the logging somehow. I'll adjust the error handling (including our own VErrorF function) to use new log functions. The new log functions do use a buffer, so redirecting the messages to another file (or stdout) is now possible too. bye ago -- [EMAIL PROTECTED] http://www.gotti.org ICQ: 126018723
Re: Latest CVS Compilation error
Sounds good. Please resubmit your earlier patch when you have this completed. It doesn't look like it would be a good idea to implement it one half at a time. However, we can certainly wait on trying to make the log either output to stdout or to a file... that could take some time to get right. Harold Alexander Gottwald wrote: Alexander Gottwald wrote: No, I think I'll have to initialize the logging somehow. I'll adjust the error handling (including our own VErrorF function) to use new log functions. The new log functions do use a buffer, so redirecting the messages to another file (or stdout) is now possible too. bye ago
Latest CVS Compilation error
Hi, Just pulled a new tree from the [EMAIL PROTECTED]:/cvs. To build I had to remove typedef MessageType; from winmsg.h in Xwin. Clashes with defs in os/log.c after latest mods to move log handling to DIX. Probably a hack..but it works for me! Colin