TT_SPEC_MOVE(3)

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

okay so bestie, you opened the tt_spec_move page from the library call manual, and it’s literally the β€œtell ToolTalk this object moved” icon ✨. No cap, every detail matters here, so let’s go 🫢.

🌼 NAME 🌼

tt_spec_move β€” notify the ToolTalk service that an object has moved to a different file. That’s the whole vibe: object relocated, service needs the tea β˜•.

πŸŽ€ SYNOPSIS πŸŽ€

#include &<Tt/tt_c.h>
char *tt_spec_move(
const char *objid,
const char *newfilepath);

Two args, bestie: objid and newfilepath, both const char *, and the return is char * πŸ’….

πŸ’… DESCRIPTION πŸ’…

The tt_spec_move function notifies the ToolTalk service that this object has moved to a different file. Like, β€œhey bestie, same object, new address” πŸ’Œ.

The ToolTalk service returns a new objid for the object and leaves a forwarding pointer from the old objid to the new one. So the old ID still points to the new ID β€” main character forwarding energy πŸ‘‘.

If a new objid is not required (for example, because the new and old files are in the same file system), tt_spec_move returns TT_WRN_SAME_OBJID. That’s not a fail, it’s just β€œno new ID needed, periodt” πŸ’….

The objid argument is the identifier of the object involved in this operation. Literally the object’s ID card πŸͺͺ.

The newfilepath argument is the new file name. That’s the new address, bestie 🏑.

⭐ RETURN VALUE ⭐

Upon successful completion, the tt_spec_move function returns the new unique identifier of the object involved in this operation. The application can use tt_ptr_error(3) to extract one of the following Tt_status values from the returned pointer:

  • TT_OK β€” The operation completed successfully. Slay βœ…
  • TT_ERR_DBAVAIL β€” The ToolTalk service could not access the ToolTalk database needed for this operation. Database said β€œnot today” 😭
  • TT_ERR_DBEXIST β€” The ToolTalk service could not access the specified ToolTalk database in the expected place. It looked where it should be and went πŸ‘€β“
  • TT_ERR_NOMP β€” The ttsession(1) process is not running and the ToolTalk service cannot restart it. No session, no service, big yikes πŸ’€
  • TT_ERR_OBJID β€” The objid passed to the ToolTalk service does not reference an existing object spec. That ID is giving expired student card πŸ™ˆ
  • TT_ERR_PATH β€” The specified pathname included an unsearchable directory. Path said β€œyou can’t search here” 🚫
  • TT_WRN_SAME_OBJID β€” A new objid is not required. No new ID needed, periodt πŸ’…

πŸ¦‹ APPLICATION USAGE πŸ¦‹

The application should use tt_free(3) to free any data stored in the address returned by the ToolTalk API. Free it, bestie β€” don’t leak, that’s not cute 🧚.

For efficiency and reliability, the application should replace any references in the application to the old objid with references to the new one. Out with the old ID, in with the new ID, fr fr πŸ”.

🌈 SEE ALSO 🌈

kisses and object-moved blessings πŸ’– β€” source/version: tt_spec_move in the library call manual; date: not listed on this page, so no invented date tea from me, ngl πŸŽ€

πŸ“¦ where this page comes from