TT_DEFAULT_SESSION(3)

πŸ“¦
version 2.5.3 Β· 2 versions
, in nixos 26.05

✨ tt_default_session ✨

okay bestie, welcome to the tt_default_session glow-up πŸ’… this one's a library call (yes, our fave genre), and it's literally just here to hand you the current default session identifier. no cap, that's the whole vibe πŸŽ€


🌸 NAME 🌸

tt_default_session β€” retrieve the current default session identifier πŸ¦‹


✨ SYNOPSIS ✨

#include <Tt/tt_c.h>
char *tt_default_session(void)

that's it, that's the whole signature β€” no arguments, no drama, just a void and a char * coming back at you 🫢


πŸ’– DESCRIPTION πŸ’–

so the tt_default_session function retrieves the current default session identifier. that's the tea β˜• literally its one job and it ate πŸ”₯


πŸ‘‘ RETURN VALUE πŸ‘‘

upon successful completion, tt_default_session returns the pointer to the unique identifier for the current default session, periodt πŸ’…

if that pointer is NULL, then no default session is set β€” and that's your signal that something's up πŸ™ˆ to actually find out what, your app can use tt_ptr_error(3) to extract one of these Tt_status values from the returned pointer:

  • TT_OK β€” the operation completed successfully, slay βœ…
  • TT_ERR_NOMP β€” the ttsession(1) process is not running and the ToolTalk service cannot restart it 😭
  • TT_ERR_PROCID β€” the current default process identifier is out of date or invalid πŸ’€

🌈 APPLICATION USAGE 🌈

okay so important lore incoming 🧚 a session can have more than one session identifier. which means β€” and bestie listen β€” the application cannot compare the result of tt_default_session with the result of tt_message_session(3) to verify that the message was sent in the default session. iykyk, that comparison is a social faux pas, do not do it πŸ™…

fr fr, do not compare those two things. the manpage said what it said πŸ’€

also, the application should use tt_free(3) to free any data stored in the address returned by the ToolTalk API. be a good citizen, free your pointers 🫢


⭐ SEE ALSO ⭐


and that's the page, bestie πŸŽ€ this little icon was brought to you by the tt_default_session(library call) source, version and date energy β€” go forth, grab your default session, and remember to tt_free(3) your stuff πŸ’œβœ¨πŸ‘‘

πŸ“¦ where this page comes from