MCPcopy Create free account
hub / github.com/FedeDP/Clight / init

Function init

src/modules/gamma.c:48–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46MODULE_WITH_PAUSE("GAMMA");
47
48static void init(void) {
49 m_ref("DAYTIME", &daytime_ref);
50 M_SUB(BL_UPD);
51 M_SUB(TEMP_REQ);
52 M_SUB(AMB_GAMMA_REQ);
53 M_SUB(DAYTIME_UPD);
54 M_SUB(NEXT_DAYEVT_UPD);
55 M_SUB(SUSPEND_UPD);
56
57 // Store current temperature to later restore it if requested
58 SYSBUS_ARG_REPLY(args, parse_bus_reply, &initial_temp, CLIGHTD_SERVICE, "/org/clightd/clightd/Gamma", "org.clightd.clightd.Gamma", "Get");
59 if (call(&args, "ss", fetch_display(), fetch_env()) < 0) {
60 // We are on an unsupported wayland compositor; kill ourself immediately without further message processing
61 WARN("Failed to init. Killing module.\n");
62 module_deregister((self_t **)&self());
63 } else {
64 m_become(waiting_daytime);
65 init_Gamma_api();
66 }
67}
68
69static bool check(void) {
70 return true;

Callers

nothing calls this directly

Calls 3

callFunction · 0.85
fetch_displayFunction · 0.85
fetch_envFunction · 0.85

Tested by

no test coverage detected