funtablerowget(3)
π funtablerowget(3) β SAORD Documentation π
okay bestie, welcome to the funtablerowget(3) page, aka the one where we get Funtools rows. yes it's a section-3 manual page, yes it's from SAORD Documentation, and yes we are gonna make it make sense. no cap. π¦
β¨ NAME β¨
FunTableRowGet β get Funtools rows π
β¨ SYNOPSIS β¨
#include <funtools.h>
void *FunTableRowGet(Fun fun, void *rows, int maxrow, char *plist,
int *nrow)
like, that's the whole vibe. one function, five args, zero drama (okay maybe a lil drama, keep reading). π
β¨ DESCRIPTION β¨
so FunTableRowGet() literally retrieves rows from a Funtools binary table or raw event file, and it drops the values of the columns you picked with FunColumnSelect() into an array of user structs. and the way it just handles the glow-up for you?? the selected column values get automatically converted to the user data type you specified (and to native data format) whenever that's needed. obsessed. β¨
here's the arg-by-arg breakdown, bestie, don't skip:
- first argument β the
Funhandle that's associated with this row data. it's giving "who am i even talking to" but it's a handle, so it knows. - second argument,
rowsβ the array of user structs where the selected columns are gonna be stored. and if you passNULL?? the routine will automatically allocate space for this array itself. (and yes, that includes properly allocating the pointers inside each struct, if the"@"pointer type is used when selecting columns. π)
β οΈ okay important one: if you passNULLin the second argument, you should free this space using the standardfree()system call when you're done with the array of rows. like, don't just leave it there, bestie, that's a memory leak and it's not cute. π
- third argument,
maxrowβ the maximum number of rows to be returned. so ifrowsis allocated by the user, it should be at least of sizemaxrow*sizeof(evstruct). - fourth argument,
plistβ a param list string. currently, the keyword/value pair"mask=transparent"is supported in theplistargument. if this string is passed in the call'splistargument, then all rows are passed back to the user (instead of just the rows passing the filter). π«Ά
this is only useful when FunColumnSelect() is also used to specify "$region" as a column to return for each row. in that case:
- rows found within a region have a returned region value greater than 0 (corresponding to the region id of the region they're located in)
- rows passing the filter but not in a region have region value of
-1 - rows not passing any filter have region value of
0
so, using "mask=transparent" and that returned region value, a program can process all rows and decide on an action based on whether a given row passed the filter or not. main character decision-making energy. π
- final argument β a pointer to an
intvariable that will return the actual number of rows returned. the routine returns a pointer to the array of stored rows, orNULLif there was an error. (and that pointer will be the same as the second argument, if the latter is non-NULL). π
here's the example, verbatim, because we do not mess with code in this house:
/* get rows -- let routine allocate the row array */
while( (buf = (Ev)FunTableRowGet(fun, NULL, MAXROW, NULL, &got)) ){
/* process all rows */
for(i=0; i<got; i++){
/* point to the i'th row */
ev = buf+i;
/* rearrange some values. etc. */
ev->energy = (ev->pi+ev->pha)/2.0;
ev->pha = -ev->pha;
ev->pi = -ev->pi;
}
/* write out this batch of rows */
FunTableRowPut(fun2, buf, got, 0, NULL);
/* free row data */
if( buf ) free(buf);
}
see how it works? like, as shown above, successive calls to FunTableRowGet() will return the next set of rows from the input file until all rows have been read. i.e., the routine behaves like sequential Unix I/O calls such as fread(). it's giving "one at a time, patiently, like a good little loop". π
πΈ wanna see a fuller, more complete example? go peek at the evmerge example code. iykyk.
and one last thing, bestie β note that FunTableRowGet() also can be called as FunEventsGet(), for backward compatibility. yes, it has a whole other name. iconic of it, honestly. β¨
π SEE ALSO π
see funtools(7) for a list of Funtools help pages. go, read, slay. ππ
okay that's the whole page, you ate it up, periodt. π this masterpiece is from version 1.4.5, dated April 14, 2011, brought to you by SAORD Documentation β mwah, thanks for the lore, love u, bye bestie ππ¦
π¦ where this page comes from
- debian bookworm: libfuntools-dev 1.4.8-1 Β· GPL
- debian trixie: libfuntools-dev 1.4.8-1.1+b2 Β· GPL
- ubuntu jammy: libfuntools-dev 1.4.8-1 Β· GPL
- ubuntu noble: libfuntools-dev 1.4.8-1.1build2 Β· GPL
- ubuntu questing: libfuntools-dev 1.4.8-2
- ubuntu resolute: libfuntools-dev 1.4.8-2build1 Β· GPL
- ubuntu stonking: libfuntools-dev 1.4.8-2build1 Β· GPL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms