TICKIT_REF(3)
β¨ TICKIT_REF π
okay bestie, welcome to the TICKIT_REF(3) page, straight out of the Library Functions Manual β it's giving "how do I make my toplevel instance live forever / die on command" and honestly? iconic. sit down, hydrate, let's go π«Ά
NAME β¨
tickit_ref, tickit_unref β the two little functions that adjust the refcount of the toplevel instance. that's it. that's the job. and they ate π
SYNOPSIS πΈ
#include <tickit.h>
Tickit *tickit_ref(Tickit *t);
void tickit_unref(Tickit *t);
and like, don't forget to link with -ltickit, otherwise nothing works and you'll be sad π
DESCRIPTION π¦
so, two functions, two vibes, one refcount. here's the tea β
tickit_ref() bumps the stored refcount of the given toplevel instance up by one. and the cute part? it hands you back the pointer argument <em>itself</em>, which makes it perfect for chaining. chef's kiss π€
tickit_unref() is the other side of the coin β it drops the stored refcount of the given toplevel instance by one. and if that refcount hits zero? oh she's gone. the instance gets destroyed. periodt.
and when that destruction happens, a whole little chain reaction goes off:
- it releases any resources controlled by it π
- it unbinds all pending timer and later callbacks, which causes them to be invoked with the
TICKIT_EV_DESTROYflag if appropriate π₯ - it also decrements the refcount on the terminal and root window instances β which will likely cause them to be destroyed too π
so yeah. one unref can take the whole squad down with it. no cap.
RETURN VALUE β
tickit_ref()returns a toplevel instance pointer. like, the pointer. the same one you passed in. she's loyal π«Άtickit_unref()returns no value. nothing. void. she gives you nothing and that's valid π
SEE ALSO π
tickit_new_stdio(3), tickit(7)
go read those next, bestie, they're part of the lore β¨
ok and one lil reminder before you go: tickit_unref() hitting zero is destruction β resources freed, callbacks unbound, terminal and root window probably joining the afterlife. not a drill. be mindful of your refcounts fr fr π
that's the whole page! it lives in the <strong>Library Functions Manual</strong>, it's page <strong>TICKIT_REF(3)</strong>, and it's been serving cunt since forever. bye bestie, go write some slay code πππ§
π¦ where this page comes from
- alpine 3.24: libtickit-doc 0.4.6-r0 Β· MIT
- debian bookworm: libtickit-dev 0.4.3-1 Β· MIT
- debian trixie: libtickit-dev 0.4.3-2 Β· MIT
- fedora 43: libtickit-devel 0.4.5-2.fc43 Β· MIT
- fedora 43: libtickit-devel 0.4.5-2.fc43 Β· MIT
- fedora 44: libtickit-devel 0.4.5-3.fc44 Β· MIT
- fedora 44: libtickit-devel 0.4.5-3.fc44 Β· MIT
- nixos 26.05: libtickit 0.4.5
- nixpkgs unstable: libtickit 0.4.6
- ubuntu jammy: libtickit-dev 0.4.1-1 Β· MIT
- ubuntu noble: libtickit-dev 0.4.3-1.1build1 Β· MIT
- ubuntu questing: libtickit-dev 0.4.3-2
- ubuntu resolute: libtickit-dev 0.4.3-2build1 Β· MIT
- ubuntu stonking: libtickit-dev 0.4.3-2build1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms