TTDT_SUBCONTRACT_MANAGE(3)

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

πŸ’… ttdt_subcontract_manage β€” manage an outstanding request

okay so real quick: this is a page from the ttdt_subcontract_manage(library call) manual, and yes bestie we're getting into it ✨


✨ NAME ✨

ttdt_subcontract_manage β€” manage an outstanding request 🫢


🌸 SYNOPSIS 🌸

#include <Tt/tttk.h>
Tt_pattern *ttdt_subcontract_manage(
Tt_message subcontract,
Ttdt_contract_cb cb,
Widget shell,
void *clientdata);

πŸ¦‹ DESCRIPTION πŸ¦‹

so ttdt_subcontract_manage is literally the function that lets a requester manage the standard Desktop interactions with the tool that's handling the request. main character energy fr πŸ’…

what it does is register, in the default session, for TT_HANDLER-addressed requests Get_Geometry and Get_XInfo, plus Status notices. that's the whole vibe check ✨

now here's the tea on shell β˜• β€” if shell is not NULL, the ToolTalk service handles the Get_Geometry and Get_XInfo notices transparently, no stress, it's handled πŸ™ˆ. otherwise it passes them to cb. but the Status notice? that one is always passed to the callback, every single time, no exceptions πŸ‘‘

if you wanna know what a Ttdt_contract_cb callback actually is, go read ttdt_session_join(3) β€” it's all described over there πŸ“–

🚨 important cleanup lore: if subcontract gets destroyed by tttk_message_destroy, then the patterns get destroyed too β€” iconic, self-cleaning, we love to see it. but otherwise, the caller is responsible for iterating over the array and destroying each pattern themselves. that's on you, bestie 😭 don't forget or it's giving leak.

πŸ’– RETURN VALUE πŸ’–

Upon successful completion, ttdt_subcontract_manage returns a null-terminated array of Tt_pattern, and associates this array with subcontract. slay πŸŽ‰

otherwise? it returns an error pointer πŸ’€. the application can use tt_ptr_error(3) to extract one of the following Tt_status values from the returned handle:

  • TT_DESKTOP_EINVAL β€” both the shell and cb arguments were NULL. like, both? yeah that's a no from me πŸ™ˆ
  • TT_ERR_NOMEM β€” there is insufficient memory available to perform the function. the math isn't mathing, no room 😭
  • TT_ERR_NOMP β€” the ttsession(1) process is not running and the ToolTalk service cannot restart it. it's not giving what it needs to give πŸ’€
  • TT_ERR_POINTER β€” the subcontract argument was not a valid Tt_message. bestie that's not a real message 🚩
  • TT_ERR_PROCID β€” the specified process identifier is out of date or invalid. expired, stale, past its moment ⏰

🌈 SEE ALSO 🌈


okay that's the whole page, you ate that πŸ“ and just so you know, this was ttdt_subcontract_manage(library call) β€” same title on both ends of the page, cute little bookends πŸŽ€ now go forth and manage those outstanding requests, bestie πŸ’œ

πŸ“¦ where this page comes from