LCDproc development and user support list

Text archives Help

[Lcdproc] API-v0.5: drvthis and private_data (comment in CVS)

Chronological Thread 
  • From: David GLAUDE Mailing" <dglaudemailing AT (David GLAUDE Mailing)
  • Subject: [Lcdproc] API-v0.5: drvthis and private_data (comment in CVS)
  • Date: Wed Dec 5 19:43:01 2001

Joris (and other),
I took the liberty to comment inside the CVS version of the doc for API 0.5.
All the new line start with DG: (easy to remove then).

I know I am maybe late but I don't understand why it is so "complicate" in
the sample
definition you provide...
It is very very C++ to have a "drvthis" pointer but it is not the way I
expected stuff to work.

The pointer to functions are the same for every instance of the driver, they
are not going to change,
nor be different per instance. So the only time we need them are in the init

Within the driver code, if we have to call another function, we will call
the internal one,
not the one via drvthis pointer. Sowe don't need that drvthis (except to
fill it in init).
[who is suppose to alocate the space? (the server) and dealocate? (the

The only think we need for multiple instance to be possible, is that:
1) in init we alocate a private_data, fill-it and return it to the server.
2) in every function we receive our (instance) copy of private_data.
3) in close we dealocate the private_data.

In private data we have all the stuff that use to be static (frame_buffer,
custom char cache, status).

In your document it seem's that the server, prior to calling an instance,
should call a specific function to put private_data in place.
I don't see the point of this at all.

If you want to keep drvthis in every call, fine... but why that function?


Archive powered by MHonArc 2.6.18.

Top of page