eid-viewer
eid-viewer library
backend.h
1 #ifndef EID_VWR_BACKEND_H
2 #define EID_VWR_BACKEND_H
3 
4 #include <eid-viewer/macros.h>
5 
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9 
10 #include <eid-viewer/oslayer.h>
11 
12 void be_setcallbacks(struct eid_vwr_ui_callbacks* cb_);
13 DllExport int eid_vwr_set_cbfuncs(void(*newsrc)(enum eid_vwr_source source), // data source has changed.
14  void(*newstringdata)(const EID_CHAR* label, const EID_CHAR* data), // new string data to be displayed in UI.
15  void(*newbindata)(const EID_CHAR* label, const unsigned char* data, int datalen), // new binary data to be displayed in UI.
16  void(*log)(enum eid_vwr_loglevel loglevel, const EID_CHAR* line), // log a string at the given level.
17  //void(*logv)(enum eid_vwr_loglevel loglevel, const char* line, va_list ap), // log a string using varargs. Note: a UI needs to implement only one of log() or logv(); the backend will use whichever is implemented.
18  void(*newstate)(enum eid_vwr_states states), // issued at state machine transition
19  void(*pinop_result)(enum eid_vwr_pinops pinops, enum eid_vwr_result result), // issued when a PIN operation finished.
20  void(*readers_changed)(unsigned long nreaders, slotdesc* slots)
21  );
22 
23 void be_log(enum eid_vwr_loglevel, const EID_CHAR* line, ...);
24 
25 int be_newsource(enum eid_vwr_source which);
26 int be_newstate(enum eid_vwr_states s);
27 int be_newstringdata(const EID_CHAR* label, const EID_CHAR* data);
28 int be_newbindata(const EID_CHAR* label, const unsigned char* data, int datalen);
29 int be_pinresult(enum eid_vwr_pinops, enum eid_vwr_result);
30 int be_readers_changed(unsigned long nreaders, slotdesc* slots);
31 
32 #ifdef __cplusplus
33 }
34 #endif
35 
36 #endif
Callbacks which the backend can perform towards the UI.
Definition: oslayer.h:105
Definition: oslayer.h:22
eid_vwr_pinops
Definition: oslayer.h:47
eid_vwr_result
Definition: oslayer.h:53
eid_vwr_loglevel
Log levels.
Definition: oslayer.h:39
eid_vwr_states
Possible states.
Definition: oslayer.h:63
contains the functions, enums and structures that need to be known by the ui
eid_vwr_source
Definition: oslayer.h:28