TT_PREQUEST_CREATE(3)

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

okay so bestie, welcome to the tt_prequest_create(library call) page β€” yes, the library call one β€” and it's literally about creating a procedure request message πŸ’…βœ¨

🌸 NAME 🌸

tt_prequest_create β€” create a procedure request message. that's the whole name section, short and iconic πŸŽ€

✨ SYNOPSIS ✨

#include &<Tt/tt_c.h>
Tt_message tt_prequest_create(
Tt_scope scope,
const char *op);

πŸ’– DESCRIPTION πŸ’–

the tt_prequest_create function creates a message. the message it creates contains this exact duo, no cap:

Tt_address = TT_PROCEDURE Tt_class = TT_REQUEST

you can use the returned handle to add arguments and other attributes, and to send the message. main character handle energy fr fr 🫢

the scope argument determines which processes are eligible to receive the message. here are the defined values, bestie:

  • TT_SESSION β€” all processes joined to the indicated session are eligible.
  • TT_FILE β€” all processes joined to the indicated file are eligible.
  • TT_BOTH β€” all processes joined to either the indicated file or the indicated session are eligible.
  • TT_FILE_IN_SESSION β€” all processes joined to both the indicated file and the indicated session are eligible.

the op argument is the operation to be performed by the receiving process. that's it, that's the op πŸ’…

πŸ”₯ RETURN VALUE πŸ”₯

upon successful completion, tt_prequest_create returns the unique handle that identifies this message. use tt_ptr_error(3) to extract one of these Tt_status values from the returned handle:

  • 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 specified process identifier is out of date or invalid.

πŸ¦‹ APPLICATION USAGE πŸ¦‹

the application should use tt_free(3) to free any data stored in the address returned by the ToolTalk API. yes, free it, bestie, that's the assignment πŸŽ€

okay important caveat: if the ToolTalk service is unable to create a message when requested, tt_prequest_create returns an invalid handle. when the application attempts to use this handle with another ToolTalk function, the ToolTalk service will return TT_ERR_POINTER. not the vibe β€” handle with care πŸ’€

🌈 SEE ALSO 🌈

Tt/tt_c.h - Tttt_c(5), tt_ptr_error(3), tt_free(3).


signing off from the footer, which gives us the tt_prequest_create library call source/version label and no date β€” so we're keeping it timeless and undated, periodt πŸ’–βœ¨

πŸ“¦ where this page comes from