Andrew C Aitchison schrieb:

On Thu, 26 Jun 2003, Cheshire Cat Fish wrote:



How do I go about reading a file from within my X driver. I want to read in a table of gamma correction values. If I use fopen() I get an unresolved symbol error.

Do I need to link to libc somehow? Or use something other than fopen()?



Drivers can't call libc functions, because drivers binaries are supposed to run on any operating system. XFree86 provides wrappers for some libc
functions, but files are deliberately excluded (there is an exception
for input device drivers to talk to the device).


hmm.... strange ... i can do exaclty that !!!
i am doing fopen() in an Input driver to reread my calibration data for the touchscreen
so i can do calibration on the fly with it ...
not doing a


#include <stdio.h>

did the trick , cause it seems that the X-source has his own fopen()

( unfortunatly i am missing a good way to signal the change of that data ...
does anyone know how to SIGNAL a Input driver from a  X-application )

my code looks like that : ( see also www.sourceforge.net/project/pacebook and browse the CVS for my touchscreen driver )

xf86PaceBookMisc(void)
{
FILE *fp;
fp = fopen ("/etc/X11/XF86Config","r");
 do {
       char *logs_old;
       char logstring[1025];
       logstring[0]='#';
       fgets(logstring,1024,fp);
       logstring[1025]=0; /* just to make extra sure */
       if(logstring[0]=='#') continue;
       if (strstr(logstring,"horizontalMax"))
...

Cheers Rob


I think that XF86VidModeSetGammaRamp <X11/extensions/xf86vmode.h>
will do what you want. If so write a small client to read the file and use XF86VidModeSetGammaRamp to pass the data to the server.
It should be then trivial (or even automatic) to get the driver to take the data from the server, I think it is just a color map change request.


Andrew C Aitchison

_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel




-- _____________________________________ *Robert Woerle Linux & Customer Support* *PaceBlade Technology Europe SA* phone: +49 89 552 99935 fax: +49 89 552 99910 mobile: +49 179 474 45 27 email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> web: http://www.paceblade.com _____________________________________




_______________________________________________ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel

Reply via email to