TT_FILE_OBJECTS_QUERY(3)
π tt_file_objects_query β the "find every object in this file" era
ok so real talk: this is a library call page (like, section 3 energy, tt_file_objects_query(library call) if you're being formal about it) and it's about asking the ToolTalk service to go rummage around in a file and hand you back every object it finds. bestie, it's giving β¨inventory vibesβ¨ and honestly the way it works is so clean. let's get into it π«Ά
β¨ SYNOPSIS β¨
#include <Tt/tt_c.h>
Tt_status tt_file_objects_query(
const char *filepath,
Tt_filter_function filter,
void *context,
void *accumulator);
πΈ DESCRIPTION πΈ
okay so tt_file_objects_query is literally you telling the ToolTalk service: "girl, go find all the objects in the named file and pass the objids to my filter function." and the context pointer and accumulator pointer you gave it up front? those get passed along to the filter function too. everyone's invited to the group chat π¬
the way that it works is: as the ToolTalk service finds each object, it calls your filter function, passing it the objid of that object plus the two application-supplied pointers (yep, context and accumulator, the iconic duo). then your filter does its little computation and returns a Tt_filter_action value, which is basically the filter tapping the query function on the shoulder and going "keep going" or "bestie stop". π
the Tt_filter_action values are, in order:
TT_FILTER_CONTINUEβ the query function should continue. keep it moving, no thoughts just vibes β‘οΈTT_FILTER_STOPβ the query function should stop. that's it, that's the whole message, we're done here β
and now the arguments, one by one, no gatekeeping:
filepathβ the name of the file to be searched for objects. this is the target, the main character, the file in question πfilterβ the filter function to which the objids are to be passed. like, this is the callback that eats objids for breakfast πcontextβ a pointer to any information the filter needs to execute. heads up: the ToolTalk service does not interpret this argument, it just passes it directly to the filter function. it's a courier, not a critic πaccumulatorβ a pointer to where the filter is to store the results of the query and filter operations. same deal here: the ToolTalk service does not interpret this argument, it passes it directly to the filter function. no questions asked, no notes π
π RETURN VALUE π
upon successful completion, tt_file_objects_query returns the status of the operation as one of these Tt_status values. get you a function that can return all of these:
TT_OKβ the operation completed successfully. slay!! π the good ending.TT_ERR_DBAVAILβ the ToolTalk service could not access the ToolTalk database needed for this operation. the database said "new phone who dis" πTT_ERR_DBEXISTβ the ToolTalk service could not access the specified ToolTalk database in the expected place. she checked where it was supposed to be andβ¦ nobody home πTT_ERR_NOMPβ thettsession(1)process is not running and the ToolTalk service cannot restart it. no session, no service, no vibes πTT_ERR_PATHβ the specified pathname included an unsearchable directory. the path was giving locked door energy πͺπTT_WRN_STOPPEDβ the query operation being performed was halted byTt_filter_function. that's a warning not an error, your filter just called it early, respect the decision π
ngl,TT_WRN_STOPPEDis technically aTT_WRN_*not aTT_ERR_*β so don't panic when you see it, it's literally just "your filter said stop". periodt.
π¦ SEE ALSO π¦
Tt/tt_c.h-Tttt_c(5). iykyk β go read the header page for the full lore π
and that's the whole page, bestie β no cap π this was tt_file_objects_query(library call), straight from the library call pages, and that footer line up top-duplicated-down-low is just the same tt_file_objects_query(library call) stamp doing its little encore at the bottom. go find those objects, you're gonna ate πβ¨π
π¦ where this page comes from
- nixos 26.05: cde 2.5.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms