Tcl_GetKeyedListKeys(3tclx)
π NAME π
TclX_NewKeyedListObj, TclX_KeyedListGet, TclX_KeyedListSet, TclX_KeyedListDelete, TclX_KeyedListGetKeys β bestie, these are the keyed list management routines. That's the whole assignment. β¨
Oh and btw, this whole page lives in the 3tclx section of the manual, so you know exactly where you are. π«Ά
π SYNOPSIS π
#include <tclExtend.h>
Tcl_Obj *
TclX_NewKeyedListObj (void);
int
TclX_KeyedListGet (Tcl_Interp *interp,
Tcl_Obj *keylPtr,
char *key,
Tcl_Obj **valuePtrPtr);
int
TclX_KeyedListSet (Tcl_Interp *interp,
Tcl_Obj *keylPtr,
char *key,
Tcl_Obj *valuePtr);
int
TclX_KeyedListDelete (Tcl_Interp *interp,
Tcl_Obj *keylPtr,
char *key);
int
TclX_KeyedListGetKeys (Tcl_Interp *interp,
Tcl_Obj *keylPtr,
char *key,
Tcl_Obj **listObjPtrPtr);
π¦ DESCRIPTION π¦
okay so real talk: these routines do operations on keyed lists. π Wanna know what a keyed list even is? The Extended Tcl man page has the whole lore drop β go read that one, iykyk. πβ¨
π TclX_NewKeyedListObj π
Create and initialize a brand new keyed list object. It's giving fresh notebook, first page, no mistakes yet. π
Returns:
- A pointer to the object. π«Ά
π TclX_KeyedListGet π
Retrieve a key value from a keyed list. Slay, honestly. β¨
Parameters:
interpβ if there's an error, the error message will be returned in the result. πkeylPtrβ the keyed list object to get the key from.keyβ the name of the key to extract. It will recursively process sub-keys separated by.(that's a literal dot, bestie, don't come for me).valuePtrPtrβ if the key is found, a pointer to the key object is returned here.NULLis returned if the key is not present. π (the page's own description calls this onevalueObjPtrPtrβ same parameter, just the manpage being quirky π)
Returns:
TCL_OKβ if the key value was returned. πTCL_BREAKβ if the key was not found.TCL_ERRORβ if an error occurred. π
β¨ TclX_KeyedListSet β¨
Set a key value in a keyed list object. Main character behavior, lowkey. π
Parameters:
interpβ the error message will be returned in the result object.keylPtrβ the keyed list object to update.keyβ the name of the key to extract. It will recursively process sub-key separated by..valuePtrβ the value to set for the key. (the description spells this onevalueObjPtr, same deal, we move πΈ)
Returns:
TCL_OKorTCL_ERROR. That's it, noTCL_BREAKin the mix, periodt. π
ποΈ TclX_KeyedListDelete π
Delete a key value from a keyed list. Not me removing things... π
Parameters:
interpβ the error message will be returned in the result if there is an error.keylPtrβ the keyed list object to update.keyβ the name of the key to extract. It will recursively process sub-key separated by..
Returns:
TCL_OKβ if the key was deleted. πTCL_BREAKβ if the key was not found.TCL_ERRORβ if an error occurred. π
π TclX_KeyedListGetKeys π
Retrieve a list of keyed list keys. So many keys, it's giving janitor energy. πππ
Parameters:
interpβ the error message will be returned in the result if there is an error.keylPtrβ the keyed list object to get the key from.keyβ the name of the key to get the sub keys for.NULLor empty to retrieve all top level keys. (yes, empty is valid, she contains multitudes π¦)listObjPtrPtrβ the list object is returned here, with the keys as values.
Returns:
TCL_OKβ if zero or more keys were returned. βTCL_BREAKβ if the key was not found.TCL_ERRORβ if an error occurred. π
Friendly reminder bestie:TCL_BREAKshows up inTclX_KeyedListGet,TclX_KeyedListDeleteandTclX_KeyedListGetKeys, but not inTclX_KeyedListSetβ that one only ever gives youTCL_OKorTCL_ERROR. Don't go looking for a break that isn't there. π«Ά
mwah π that's the whole page, no notes. This one is served fresh from the Tcl manual, filed under Tcl_GetKeyedListKeys(3tclx) β go forth and manage your keyed lists, you absolute icon. π§π
π¦ where this page comes from
- debian bookworm: tclx8.4-doc 8.4.1-4
- debian trixie: tclx8.4-doc 8.4.1-5
- ubuntu jammy: tclx8.4-doc 8.4.1-4
- ubuntu noble: tclx8.4-doc 8.4.1-4
- ubuntu questing: tclx8.4-doc 8.4.1-5
- ubuntu resolute: tclx8.4-doc 8.4.1-6
- ubuntu stonking: tclx8.4-doc 8.4.1-6
- Copyright 1992-1999 Karl Lehenbauer and Mark Diekhans
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms