TT_PATTERN_CREATE(3)

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

πŸ’… tt_pattern_create πŸ’…

okay so this is the tt_pattern_create page, and it's a library call β€” welcome to the pattern-creation era, bestie 🫢. It's literally the call that asks for a brand-new pattern object, and we're gonna walk through it like a group chat.


✨ NAME ✨

tt_pattern_create β€” request a new pattern object. That's the whole vibe: you want a pattern object, you ask for one, periodt πŸ’….

πŸŽ€ SYNOPSIS πŸŽ€

#include &<Tt/tt_c.h>
Tt_pattern tt_pattern_create(void)

🌸 DESCRIPTION 🌸

The tt_pattern_create function requests a new pattern object. Simple, iconic, no cap.

After you receive the pattern object, your application fills in the message pattern fields to indicate what type of messages the process wants to receive, and then registers the pattern with the ToolTalk service. So it's like: make the pattern, fill in the deets, register it β€” main character energy from start to finish ✨.

The application can supply multiple values for each attribute added to a pattern β€” though some attributes are set and can only have one value, so don't try to give them a whole entourage πŸ’€.

A pattern attribute matches a message attribute if any of the values in the pattern match the value in the message. It's giving "any of these? then we're matching" and honestly? obsessed.

If no value is specified for an attribute, the ToolTalk service assumes that any value will match. So no value = any value goes, and that's the tea β˜•.

πŸ”₯ RETURN VALUE πŸ”₯

Upon successful completion, tt_pattern_create returns the opaque handle for a message pattern. Your application can use this handle in future calls to identify the pattern object β€” it's the pattern's little ID bracelet, iykyk πŸ’….

Your application can use tt_ptr_error(3) to extract one of the following 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. big yikes 😭

πŸ’œ APPLICATION USAGE πŸ’œ

The application should use tt_free(3) to free any data stored in the address returned by the ToolTalk API. Like, clean up after yourself, bestie β€” the ToolTalk API is not your mom 🫢.

🌈 SEE ALSO 🌈


okay that's the whole page! signing off from the tt_pattern_create(library call) manual β€” that's the source/version line, and there's no date in the footer, so don't come for me πŸ˜­πŸ’…πŸ«Ά

πŸ“¦ where this page comes from