LIBMAWK_SET_CELL(3libmawk)

πŸ’– LIBMAWK_SET_CELL β€” the mawk cell glow-up manual πŸ’–

okay bestie, you're reading the libmawk manual page for LIBMAWK_SET_CELL(3libmawk) and honestly? this one's a bop. it's short, it's sweet, and it lets you rewrite what a mawk variable holds. main character energy for real πŸ’…


✨ NAME ✨

libmawk_set_cell β€” set the value of a mawk cell. that's it. that's the whole job. giving "makeover montage but for a variable" πŸŽ€


🌸 SYNOPSIS 🌸

#include <libmawk.h>

CELL *libmawk_set_cell(mawk_state_t *m, CELL *cell, const charargtype,...);
CELL *libmawk_set_cellp(mawk_state_t *m, CELL *cell, const charargtype,
void *argp);

πŸ¦‹ DESCRIPTION πŸ¦‹

so the libmawk_set_cell() function modifies the value of a mawk cell (aka a variable, aka the little guy holding your data). the argument argtype is a format character that describes the type of the payload β€” and you get to that payload through the vararg. no cap. 🌈

the libmawk_set_cellp() function does the exact same thing, but it takes a generic pointer to the payload instead. same slay, different doorway πŸšͺ✨

the format character is one of the followings, and yes it's literally just one letter each:

  • 'd' β€” for int payload
  • 'f' β€” for double payload
  • 's' β€” for (zero terminated) char * payload

and argument m? that's a libmawk context, previously returned by libmawk_initialize() or libmawk_initialize_stage3(). don't just make one up out of thin air bestie, it has to come from there 🫢


πŸ‘‘ RETURN VALUE πŸ‘‘

a pointer to the cell modified. you get the cell back. it's giving "here's your variable, post-glow-up" πŸ’–


πŸ”₯ SEE ALSO πŸ”₯


lowkey the whole page in one vibe: you hand it a cell and a type letter, it hands you back the cell, and everybody eats. no cap. πŸ’€βœ¨

and that's the whole thing!! this was the libmawk manual, dated 2009-08-10, filed under LIBMAWK_SET_CELL(3libmawk). go set some cells, bestie, you got this πŸ§šπŸ’œ