1747993 Members
5339 Online
108756 Solutions
New Discussion юеВ

Any X expert is welcome

 
SOLVED
Go to solution
sandy_10
New Member

Any X expert is welcome

Hi,
I've been stuck for a long time in the past few days. I'm writing an add-on module for HP-UX 11's X server on a 9000 workstation. The module is actually a shared object. I want it to be automatically loaded by the X server when X starts. It's primary function is to monitor the X server and it's clients communication and do some other work according to what it hears (so, any stand alone application just does not apply). My question is: How can I make the module automatically loaded by the X Server? What's the proper entry point should be provided for the module's initialization(e.g. is it a function like "void xxx_Init()" or a global struct?).

Thanks in any advance.
I can do? :)
5 REPLIES 5
Ron Kinner
Honored Contributor

Re: Any X expert is welcome

Found this:

If you start your X session with xdm, you may customize just what happens at start-up. In particular, you may arrange for applications to be started when you login. To do this, place each application's command name, followed by a `&' in the file `~/.xsession-init'

from http://www.tufts.edu/tccs/acs/help/X/

Also see:

http://www.interex.org/tech/9000/Tech/aix_hpux_interop_v2/chap14_x11.html

Ron
sandy_10
New Member

Re: Any X expert is welcome


Thanks to Ron Kinner. But I might failed to make my question clear enough. My module is a shared object rather than a stand alone application. When the X server starts, it should load my module into it's own process space, so that my module actually becomes part of the X server process. Well, perhaps the correct term should be "X extensions" or something like that.

As far as I know, I should add an entry in the /etc/X11/X0devices config file, thus the X server will load the shared object when starting. The question is how the shared object should be wrote and what interface should be exported so that the X server can properly recognize and initialize it.
I can do? :)
Alex Glennie
Honored Contributor
Solution

Re: Any X expert is welcome

Hi Sandy ..... I don't think you will be able to get your module added as an Xserver extension (as in those listed by xdpyinfo) without access to the Xserver source code.

I also think someone else asked a similar question a few months back and received a similar reply by one of the HP Graphics gurus in the US, if I can find the post I'll post again.

The only other way I can think and I'm not sure it would meet your needs would be to start your module by creating an Xsession.d script in /etc/dt/config/Xsession.d/<script_name> see the entries in /usr/dt/config/Xsession.d.

ps I'm no expert.
Alex Glennie
Honored Contributor

Re: Any X expert is welcome

sandy_10
New Member

Re: Any X expert is welcome

Hi Alex,
Generally speaking, it's possible to write such an extension module without access the X server's source code(.c) if I have the proper header files(.h). Now I do have the header files and my module compiles with no problem. The only problem remained is I do not know what interface the shared object should export to the X server for regestering itself and properly being initialized. That is, what function is called immediately after the module is loaded by the X server?
Thanks for your repies any way.
I can do? :)