CAPS Universe documentation  1.0.4
All you need to know to be successful
Functions
Managing printer driver private data

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)
 

Detailed Description

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.

Attention
The anonymous pointer in the caps_generic_driver::init callback is special. Refer Callback init() for details.

Function Documentation

◆ caps_drv_private_set()

void caps_drv_private_set ( struct caps_drv cdrv,
void *  private 
)

Set a hint to the private data of your driver implementation

Parameters
[in]cdrvlibcapsdriver handle
[in]privateThe 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()

◆ caps_drv_private_get()

void * caps_drv_private_get ( struct caps_drv cdrv)

Get the hint to the private data

Parameters
[in]cdrvlibcapsdriver handle
Return values
PRIVATEThe hint to the private data
NULLNot yet set

This function is the opposite of caps_drv_private_set()