XErrorDB in a modular world

Jim Gettys Jim.Gettys at hp.com
Mon Jun 6 09:56:19 PDT 2005


Well, looking at this code myself for the first time since I wrote it
over 15 years ago, it is a bit hard...  Some archeology is in order. 

There is clearly some sort of support for extensions (no great surprise
there, I have memories of believing strongly that extensions had to be
first class citizens).

There is also some sort of resource manager database support intended
for I18N there as well, I have even vaguer memories there of worrying
about some way to localize messages, e.g. XGetErrorDatabaseText).

As I look at this, the other issue to worry about is "fail safeness".
I also worried about trying to make the interface proof against failure
to have the message databases properly installed; I wanted some error
message that might make some sense to be able to be printed in that
case.

>From a quick look at where it is used in Xlib (it may be used in
toolkits, some other looking will be needed), it may be possible to do a
lazy evaluation so that the file(s) only get opened in the case of an
error.
				- Jim



On Mon, 2005-06-06 at 09:37 -0700, Alan Coopersmith wrote:
> Jim Gettys wrote:
> > On Sun, 2005-06-05 at 13:04 -0700, Alan Coopersmith wrote:
> >>What if XErrorDB as a single file was replaced with a directory
> >>in which each extension installs it's own file as part of it's
> >>protocol module and the original XErrorDB was used for just the
> >>X11 core protocol entries?
> > 
> > I worry a bit about startup time for this solution.
> 
> Does XErrorDB need to be read at startup or when the first error
> message is issued?   (Which for most apps should hopefully be never.)
> 
> > The other issue we should think about more seriously is the I18N support
> > of this facility; error messages should be able to be localized.
> 
> Right - I thought about that as well as long as we're changing the code.
> For most of XErrorDB, localization doesn't make sense - it's just a
> mapping of request & error codes to the protocol names, and localizing
> those would just make it harder to figure out what's going on.   There
> are some text messages in there that should be localized though, but
> only for a few
> 
> I was thinking the lookup path for messages for each extension/protocol
> would be something like:
> 	<prefix>/lib/X11/ErrorDB/<language>/<extension>
> 	<prefix>/lib/X11/ErrorDB/C/<extension>
> 
> And what's now XErrorDB would become <prefix>/lib/X11/ErrorDB/C/X11
> (possibly with a symlink to that left for minimal backwards 
> compatibility with any clients linked with old libX11's).
> 
> (I know some of the desktops today prefer the model of having all the
>   localized versions in one file, instead of per-locale files.   I've
>   always preferred the per-locale versions, since it's easier to add
>   new locales after the fact.   Does anyone have strong preferences
>   one way or another?)
> 
> I thought I read XCB would use XML protocol description files, so 
> perhaps eventually these can be generated from those at build time.
> 



More information about the xorg-modular mailing list