WSLAY_EVENT_GET_WRITE_ENABLED(3)

πŸ’… WSLAY_EVENT_GET_WRITE_ENABLED β€” bestie's guide to the write-permission vibe check

ok so this is a page from the wslay manual, section 3 (library functions, the fun ones ✨). And it's about wslay_event_get_write_enabled, which is genuinely the most "are we still doing this or not" little function you'll ever meet. Let's get into it 🫢


✨ NAME ✨

wslay_event_get_write_enabled β€” query whether the event-based API context allows write operation

Like. It asks the context "hey bestie, are we still allowed to write? πŸ‘€" and the context answers. That's the whole gig. Iconic behaviour, no notes.


🌸 SYNOPSIS 🌸

#include <wslay/wslay.h>

int wslay_event_get_write_enabled(wslay_event_context_ptr ctx)

so you gotta pull in <wslay/wslay.h> first, obviously, and then you hit it with the ctx β€” that's your wslay_event_context_ptr β€” and it hands you back an int. Simple. Clean. Ate πŸ’–


πŸŽ€ DESCRIPTION πŸŽ€

okay so here's the tea β˜•

wslay_event_get_write_enabled() returns 1 if the event-based API context allows write operation, or return 0.

That's it. That's the function. It's a vibe check and the vibe is a boolean, lowkey. One means go off, writing is enabled. Zero means nope, the door is closed, do not pass go 🚫

And here's the part you actually need to remember:

After wslay_event_shutdown_write() is called, wslay_event_get_write_enabled() returns 0.

periodt. Once you've shut down the write side, this thing will forever be like "0, babe, we're done here" β€” so if you're out here calling this function expecting a 1 after a shutdown write, that's on you, not on the function 😭 It's literally just reporting the truth.

no cap: this is the query half of the pair. It doesn't do anything, it doesn't change anything, it just tells you what the context already thinks. Read-only queen πŸ‘‘

πŸ¦‹ SEE ALSO πŸ¦‹

  • wslay_event_shutdown_write() β€” the function that flips this whole thing to 0. They're a duo, they're linked, they're giving sibling energy fr fr.

🌈 AUTHOR 🌈

Tatsuhiro Tsujikawa β€” the legend who wrote all this. Respect. 🫑


2024, 2015, Tatsuhiro Tsujikawa


ok that's the whole page, you're all caught up, go forth and check your write-enabled-ness before you write, bestie, because nothing is more embarrassing than writing to a context that already said no πŸ™ˆ

and for the record, this was the wslay package, version @PACKAGE_VERSION@, dated Apr 22, 2024 β€” so if you're reading a copy that's giving different energy, check your version πŸ’… mwah, bye! πŸ’–

πŸ“¦ where this page comes from