STFL(3)

✨ libstfl β€” structured terminal forms language/library ✨

okay bestie, sit DOWN, because this one is a whole vibe πŸ’– this is the manual page for libstfl β€” the structured terminal forms language/library β€” and it's lowkey the reason your terminal apps can have actual widgets instead of just... sad little lines of text. 🌸


🌈 SYNOPSIS 🌈

#include <ncurses.h>
#include <stfl.h>

struct stfl_form *stfl_create( char *text);

void stfl_free(struct stfl_form *f);

char *stfl_run(struct stfl_form *f, int timeout);

void stfl_reset();

char *stfl_get(struct stfl_form *f,  char *name);

void stfl_set(struct stfl_form *f,  char *name,  char *value);

char *stfl_get_focus(struct stfl_form *f);

void stfl_set_focus(struct stfl_form *f,  char *name);

char *stfl_quote( char *text);

char *stfl_dump(struct stfl_form *f,  char *name,  char *prefix, int focus);

void stfl_modify(struct stfl_form *f,  char *name,  char *mode, const char *text);

char *stfl_lookup(struct stfl_form *f,  char *path,  char *newname);

char *stfl_error();

void stfl_error_action( char *mode);

πŸŽ€ DESCRIPTION πŸŽ€

so stfl is a library that implements a curses-based widget set for text terminals. ✨ and the way it describes GUIs is via a special language β€” the Structured Terminal Forms Language (iconic name, no notes). the whole point of this language is that it's easy and fast to write, so an application programmer does not need to spend ages fiddling around with the GUI and can concentrate on the more interesting programming tasks. periodt. πŸ’…


πŸ¦‹ stfl_create

Parses the the stfl description text passed as parameter and returns a form handler. yes bestie, "the the" β€” we keep it exactly as the original wrote it, no cap. 😭

πŸ¦‹ stfl_free

Free all resources associated with this form. bye girl, you're done. πŸ‘‹

πŸ¦‹ stfl_run

Return the next event. If no more prior generated events are waiting, display the form and process one input character. it's giving "main character takes one (1) step". 🌟

πŸ¦‹ stfl_reset

The stfl_run() function automatically activates ncurses. This function can be used to explicitely switch back to normal text mode. In some languages this is automatically done on program termination. (yes, "explicitely" β€” original spelling, we don't touch it πŸ™ˆ)

πŸ¦‹ stfl_get

Returns the current value of the specified variable. When the variable does not exist this function returns an undefined value. so like... don't come for her if the variable isn't there. undefined is undefined. πŸ’€

πŸ¦‹ stfl_set

This sets the specified variable to the specified value. simple, clean, slay.

πŸ¦‹ stfl_get_focus

Returns the name of the widget which currently has the focus, or an undefined value when the widget having the focus has no name. anonymous widget energy, honestly relatable. ✨

πŸ¦‹ stfl_set_focus

Set the focus to the specified widget. put the spotlight on her, she deserves it. πŸ”₯

πŸ¦‹ setfl_quote

Quote the text so it can be savely used as variable value in stfl code. (and yup β€” the original spells it setfl_quote right there in the description, and "savely" too. we preserve the lore exactly. 🫢)

πŸ¦‹ stfl_dump

Return the subtree starting with the widget specified in the 2nd parameter as stfl code fragment. screenshot but make it source code. πŸ“Έ

πŸ¦‹ stfl_modify

Import the stfl code specified in the 4th parameter to an existing form. The 2nd parameter is used to specify a widget which is used as starting point for the modification. The 3rd parameter is a string specifying how the new stfl code should be added to the widget tree. build-a-form workshop, but make it live. 🧚

πŸ¦‹ stfl_lookup

Lookup widgets in the form using a path and optionally assign a new name. This function is not implemented yet. 😭 not her being announced and then not showing up. bestie is late.

πŸ¦‹ stfl_error

Set the error handling algorithm. that's it, that's the whole description. short and iconic. πŸ’…


πŸ‘‘ AUTHORS πŸ‘‘

stfl is developed by Clifford Wolf <clifford@clifford.at>. This manual page was written by Nico Golde <nion@debian.org> for the Debian system (but may be used by others). thank you for your service, legends. πŸ«‘πŸ’–


🌸 SEE ALSO 🌸

  • ncurses(3)
  • /usr/include/stfl.h /usr/share/doc/libstfl-dev/README.gz

and that's the whole page, bestie β€” brought to you by libstfl(), exactly as it signs off at the bottom of the original too. go forth and build cute terminal forms. 🌈✨πŸ’