CAPS Universe documentation
1.0.4
All you need to know to be successful
|
Set and get some driver private data in your callback functions. More...
Functions | |
void | caps_drv_private_set (struct caps_drv *cdrv, void *private) |
void * | caps_drv_private_get (struct caps_drv *cdrv) |
Instead of using global data, you can collect all your private printer driver data and information into a structure and let libcapsdriver forwards a pointer to your callback functions.
Each callback function comes with an anonymous pointer to private data you can use to run your driver.
The caps_drv_private_get() function can be used instead in the absence of this anonymous pointer.
void caps_drv_private_set | ( | struct caps_drv * | cdrv, |
void * | private | ||
) |
Set a hint to the private data of your driver implementation
[in] | cdrv | libcapsdriver handle |
[in] | private | The hint to your private data |
This hint is used as the ud parameter in all further callbacks.
Can be called in the caps_generic_driver::init() callback, because it provides you with the libcapsdriver handle as well.
This function is the opposite of caps_drv_private_get()
void * caps_drv_private_get | ( | struct caps_drv * | cdrv | ) |
Get the hint to the private data
[in] | cdrv | libcapsdriver handle |
PRIVATE | The hint to the private data |
NULL | Not yet set |
This function is the opposite of caps_drv_private_set()