TS_CONF_GET(3)

🌸 TS_CONF_GET(3) 🌸

okay so real talk, bestie β€” this is a page from the tslib manual, and the header card up top literally says TS_CONF_GET(3) while the whole page is about ts_conf_set. iconic mismatched-title energy, we love her anyway πŸ’…. buckle up, because we're about to write a config file and rebuild the whole world (or like, the touchscreen modules). πŸ¦‹


✨ NAME ✨

ts_conf_set β€” write a new TSLIB_CONFFILE config file and reload it. no cap. πŸŽ€


✨ SYNOPSIS ✨

#include <tslib.h>

int ts_conf_set(struct ts_module_conf *conf);

✨ DESCRIPTION ✨

so ts_conf_set() takes a pointer to a struct ts_module_conf. bestie it reads data from all the linked structs in the list β€” like, through the next and prev pointers, the whole lil chain β€” and then it writes a brand new TSLIB_CONFFILE. πŸ’–

the ordering is giving very much "first come, first line": the first struct in the list, the one where prev is NULL, becomes the first line of the file, and so on down the chain. 🌈

⚠️ after writing, you have to call ts_reconfig() so the new modules and parameters actually get reloaded and applied to the program that's currently running. writing the file alone is not the vibe, okay? you gotta reload. πŸ”₯

also, heads up: the given set of ts_module_conf structs is freed and destroyed right here. like, gone gone. so after calling ts_conf_set() you have to use ts_conf_get() again if you want to make a different change. don't be out here touching freed structs, that's not the move 😭.

here's the struct, look at her:

struct ts_module_conf {
     char *name;
     char *params;
     int raw;
     int nr;

     struct ts_module_conf *next;
     struct ts_module_conf *prev;
};

✨ RETURN VALUE ✨

this function returns zero on success and a negative integer on failure. so like, zero is the slay, negative is the "we don't talk about it". πŸ’€


✨ SEE ALSO ✨


kay bye bestie, that's the whole page!! 🫢 this was the TS_CONF_GET(3) page from the tslib manual β€” same name on the header and the footer, she's consistent at least ✨ go forth and reconfigure, ily, mwah πŸ’œ