You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* functions & variables required in each driver */
31
+
intdrv_main(intargc, char**argv);
32
+
33
+
/* functions & variables required in each driver
34
+
* See also: register_upsdrv_callbacks()
35
+
*/
32
36
voidupsdrv_tweak_prognames(void); /* optionally add aliases and/or set preferred name into [0] (for pipe name etc.); called just after populating prognames[0] and prognames_should_free[] entries */
33
37
voidupsdrv_initups(void); /* open connection to UPS, fail if not found */
34
38
voidupsdrv_initinfo(void); /* prep data, settings for UPS monitoring */
35
39
voidupsdrv_updateinfo(void); /* update state data if possible */
36
40
voidupsdrv_shutdown(void); /* make the UPS power off the load */
37
41
voidupsdrv_help(void); /* tack on anything useful for the -h text */
38
-
voidupsdrv_banner(void); /* print your version information */
39
42
voidupsdrv_cleanup(void); /* free any resources before shutdown */
43
+
voidupsdrv_makevartable(void); /* main calls this driver function - it needs to call addvar */
40
44
41
45
voidset_exit_flag(intsig);
42
46
47
+
voidupsdrv_banner(void); /* print your version information - shared in main.c */
48
+
43
49
/* --- details for the variable/value sharing --- */
44
50
45
51
/* Try each instant command in the comma-separated list of
/* allow main.c code in both static and shared driver builds
206
+
* to see implementations defined by specific driver sources,
207
+
* called by main-stub.c where used:
208
+
*/
209
+
typedefstructupsdrv_callback_s {
210
+
void (*upsdrv_tweak_prognames)(void); /* optionally add aliases and/or set preferred name into [0] (for pipe name etc.); called just after populating prognames[0] and prognames_should_free[] entries */
211
+
void (*upsdrv_initups)(void); /* open connection to UPS, fail if not found */
212
+
void (*upsdrv_initinfo)(void); /* prep data, settings for UPS monitoring */
213
+
void (*upsdrv_updateinfo)(void); /* update state data if possible */
214
+
void (*upsdrv_shutdown)(void); /* make the UPS power off the load */
215
+
void (*upsdrv_help)(void); /* tack on anything useful for the -h text */
216
+
void (*upsdrv_cleanup)(void); /* free any resources before shutdown */
217
+
void (*upsdrv_makevartable)(void); /* main calls this driver function - it needs to call addvar */
218
+
upsdrv_info_tupsdrv_info; /* public driver information from the driver file */
0 commit comments