Tk_GetUid(3)
πΈ NAME πΈ
okay so bestie, this is Tk_GetUid(3) from the Tk Library Procedures β the iconic page about Tk_GetUid and Tk_Uid, aka how to convert from string to unique identifier. π
β¨
β¨ SYNOPSIS β¨
#include <tk.h>
Tk_Uid
Tk_GetUid(string)
π ARGUMENTS π
char *string(in) β the string for which the corresponding unique identifier is desired. That's the input, bestie, and it's giving main-character energy. π«Ά
π DESCRIPTION π
So Tk_GetUid returns the unique identifier corresponding to string. Unique identifiers are similar to atoms in Lisp, and Tk uses them to speed up comparisons and searches. slay. π
A unique identifier (type Tk_Uid) is a string pointer and may be used anywhere that a variable of type char * could be used. But here's the guaranteed icon behavior: there is guaranteed to be exactly one unique identifier for any given string value. π
If Tk_GetUid is called twice, once with string a and once with string b, and if a and b have the same string value (strcmp(a, b) == 0), then Tk_GetUid will return exactly the same Tk_Uid value for each call (Tk_GetUid(a) == Tk_GetUid(b)). Not me being obsessed with the exact same Tk_Uid value β it's literally the point. πβ¨
That means variables of type Tk_Uid may be compared directly (x == y) without having to call strcmp. Highkey convenient. In addition, the return value from Tk_GetUid will have the same string value as its argument (strcmp(Tk_GetUid(a), a) == 0). fr fr. π¦
π KEYWORDS π
atomunique identifier
xoxo, this is from Tk π β source/version energy, page label Tk_GetUid(3), and no date in this footer so we're not inventing one, periodt π«Άβ¨
π¦ where this page comes from
- alpine 3.23: tk9-doc 9.0.3-r0 Β· TCL
- alpine 3.24: tk9-doc 9.0.3-r2 Β· TCL
- fedora 43: tk-devel 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 43: tk-devel 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk-devel 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk-devel 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- nixos 26.05: tk 9.0.3
- nixpkgs unstable: tk 9.1.0
- Copyright (c) 1990 The Regents of the University of California
- Copyright (c) 1994-1996 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms