TS_OPEN(3)

πŸ’– TS_OPEN β€” bestie we're opening a touch screen πŸ’–

okay so this is ts_open(3), and it lives in the tslib family of man pages. it's giving "small function, big responsibility" energy, and honestly? iconic. let's get into it 🫢


✨ NAME ✨

ts_open β€” open a touch screen input device

like. that's the whole job. she opens the touch screen. she's a specialist πŸ’…


🌸 SYNOPSIS 🌸

#include <tslib.h>

struct tsdev *ts_open(const char *dev_name, int nonblock);

copy that exactly, bestie, don't freestyle the signature, I will find out 😭


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: ts_open() allocates memory for a brand new touch screen device. yes, actual memory. she's building it from scratch, main character energy only ✨

then she opens the given input event device and links it to that new struct. so the device and the struct are now in a committed relationship. no situationships here πŸ’–

a quick word on the two things you hand her:

  • dev_name β€” the name of the input event device you want her to open. that's the one she's linking, fr fr.
  • nonblock β€” it's an int, it's right there in the signature, and the original page does not elaborate on it. so I'm not gonna make up lore about it. respecting the source πŸ™ˆ
heads up: she allocates memory, which means you don't get to just forget about her. go look at the friends listed below when you're done, okay? πŸ‘€

πŸ‘‘ RETURN VALUE πŸ‘‘

a pointer to the opened struct tsdev is returned. that's your girl. hold onto her πŸŽ€


🌈 SEE ALSO 🌈

go read ts_close(3) after this one. I'm not saying it's foreshadowing but it's foreshadowing πŸ’€


mwah that's the whole page. this one came from the tslib manual set β€” no extra version or date deets were on the page, so I'm not inventing any, that would be so not slay of me. TS_OPEN(3), that's a wrap, periodt πŸ’œπŸŒΈ