CAPS Universe documentation  1.0.4
All you need to know to be successful
Data Fields

Declaration of the callbacks. More...

Data Fields

int(* idx_process )(void *anonymous_data, unsigned index_no)
 
int(* idx_is_ready )(void *anonymous_data, unsigned index_no)
 
int(* idx_send )(void *anonymous_data, unsigned index_no)
 

Detailed Description

Your idx_process() is called to process something with index index_no. For each index it is called only once.

Your idx_is_ready() is called to check if processing of index_no is finished.

Your idx_send() is called to send the processing result of index_no to the printer. It is called only if your idx_is_ready() has reported back a true for this index.

Field Documentation

◆ idx_process

int(* idx_process) (void *anonymous_data, unsigned index_no)

Process the index index_no and return:

  • 0 on success, e.g. processing was successful and should be continued
  • -EINVAL if index_no is invalid. In this case everything gets stopped, because this seems an internal programming error
  • -ENODATA if the data index_no points to cannot be processed, but processing further indices should still be done
  • -ECANCELED if processing should be stopped right now (something like "panic")

◆ idx_is_ready

int(* idx_is_ready) (void *anonymous_data, unsigned index_no)

Check, if the index index_no is finished and return:

  • 0 (e.g. false) if index_no isn't finished, yet
  • 1 (e.g. true) if index_no is finished

◆ idx_send

int(* idx_send) (void *anonymous_data, unsigned index_no)

Send the index index_no to the printer and return:

  • 0 on success, e.g. sending was successful and processing should be continued
  • -EINVAL if index_no is bad. In this case everything gets stopped, because this seems an internal programming error
  • -ENODATA if the data index_no points to cannot be sent, but processing should continue
  • -ECANCELED if everything should be stopped right now (something like "panic")

The documentation for this struct was generated from the following file: