TTDT_SAVE(3)

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

🌸 NAME 🌸

ttdt_Save β€” from the (library call) manual, bestie β€” this one is all about requesting a ToolTalk client to save a file. πŸ’Ύβœ¨


✨ SYNOPSIS ✨

#include &<Tt/tttk.h>
Tt_status ttdt_Save(
       Tt_message context,
       const char *pathname,
       Tt_scope the_scope,
       XtAppContext app2run,
       int ms_timeout);

πŸ’… DESCRIPTION πŸ’…

okay so ttdt_Save sends a Save request inside the the_scope argument and then waits for the reply. A Save request asks the handling ToolTalk client to save any changes pending on pathname. That’s the whole assignment, and it ate. 🫢

The context argument describes the environment to use. If context is not zero, messages created by ttdt_Save inherit from context all contexts whose slotname begins with the characters ENV_. slay, inherited context. 🧚

The the_scope argument identifies the scope of the request. If the_scope is TT_SCOPE_NONE, ttdt_Save tries TT_BOTH, and falls back to TT_FILE_IN_SESSION if, for example, the ToolTalk database server is not installed on the file server that owns pathname. not the database server catching strays 😭 but okay, that’s literally the fallback.

The ttdt_Save function passes app2run and ms_timeout to tttk_block_while(3), blocking on the reply to the Save request it sends. so yes bestie, it’s giving β€œsend it, then wait for the reply” energy. β³πŸ’…


πŸ‘‘ RETURN VALUE πŸ‘‘

Upon successful completion, the ttdt_Save function returns the status of the operation as one of the following Tt_status values:

  • TT_OK β€” The sent request received an affirmative reply within ms_timeout milliseconds. πŸŽ€
  • TT_DESKTOP_ETIMEDOUT β€” No reply was received within ms_timeout milliseconds. β°πŸ’€
  • TT_DESKTOP_EPROTO β€” The request was failed, but the handler set the tt_message_status of the failure reply to TT_OK, instead of a specific error status. πŸ™ˆ
  • TT_ERR_DBAVAIL β€” The ToolTalk service could not access the ToolTalk database needed for this operation. 😭
  • TT_ERR_DBEXIST β€” The ToolTalk service could not access the specified ToolTalk database in the expected place. 🫠
  • TT_ERR_NOMEM β€” There is insufficient memory available to perform the function. 🧠πŸ’₯
  • TT_ERR_NOMP β€” The ttsession(1) process is not running and the ToolTalk service cannot restart it. πŸ’€
  • TT_ERR_OVERFLOW β€” The ToolTalk service has more active messages than it can handle. (The maximum number of active messages is implementation specific, but is at least 2000.) πŸ”₯
  • TT_ERR_POINTER β€” The pathname argument was NULL or was a ToolTalk error pointer. 🫣
  • TT_ERR_PROCID β€” The specified process identifier is out of date or invalid. πŸͺͺ✨

🌈 SEE ALSO 🌈

Tt/tttk.h - Tttttk(5), ttdt_Revert(3), ttdt_file_join(3), ttdt_file_event(3), tttk_block_while(3).

πŸ’– cute footer sign-off, bestie: the footer/source-version-and-date slot shows ttdt_Save(library call) β€” that’s the exact footer energy, no extra invented date text, periodt. Byeee, go save something iconic! πŸ«Άβœ¨πŸ’‹

πŸ“¦ where this page comes from