LIBMAWK_INITIALIZE(3libmawk)
π LIBMAWK_INITIALIZE π
okay bestie, welcome to the libmawk corner of the manual β this is the 3libmawk page, and it's literally the "hi, hello, let's go" function of the whole library π«Ά
β¨ NAME β¨
libmawk_initialize β create a new libmawk context π±
like, spawn a fresh little mawk universe. main character energy fr.
πΈ SYNOPSIS πΈ
#include <libmawk.h>
mawk_state_t *libmawk_initialize(int s, char *argv[]);
yes she takes an int s and a char *argv[], and yes she gives you back a mawk_state_t *. iconic.
π¦ DESCRIPTION π¦
okay so, libmawk_initialize() returns a pointer to a newly created libmawk context. brand new, still smells like fresh code, no cap π
and here's the slay part: any amount of libmawk contexts can live in parallel in an application β¨ like, not just one, not two β any amount, all vibing at the same time in the same process. it's giving polycule of interpreters, honestly.
the arguments you pass are the same as for a command line mawk session. so whatever you'd hand to mawk in your terminal, that's what goes in here. that means:
- Scripts are loaded β either from the command line, or from files using
-fπ - Variables are set β with
-vπ - Special options are set β with
-WβοΈ - and
<pink>etc.</pink>β you know how it goes, the whole mawk command line experience π
π₯ RETURN VALUE π₯
you get a pointer to a new libmawk context π
or, and hear me out, NULL on error π so pls check it, bestie, don't just rawdog that pointer, k?
π SEE ALSO π
go read the stage one next, it's the sequel, and uninitialize is the "ok bye clean up after yourself" arc π§
and that's the whole page, periodt. this was libmawk manual, dated 2009-08-10 β the page itself is called LIBMAWK_INITIALIZE(3libmawk) and yeah, it's been serving since 2009 and still ate π bye bestie, go make some contexts β¨
π¦ where this page comes from
- debian bookworm: libmawk1 1.0.2-3
- debian trixie: libmawk1t64 1.0.4-4
- fedora 43: libmawk-devel 1.0.3-8.fc41 Β· GPLv2
- fedora 43: libmawk-devel 1.0.3-8.fc41 Β· GPLv2
- fedora 44: libmawk-devel 1.0.5-1.fc44 Β· GPL-2.0-only
- fedora 44: libmawk-devel 1.0.5-1.fc44 Β· GPL-2.0-only
- ubuntu jammy: libmawk1 1.0.2-3
- ubuntu noble: libmawk1t64 1.0.4-3build1
- ubuntu questing: libmawk1t64 1.0.4-5
- ubuntu resolute: libmawk1t64 1.0.5-1
- ubuntu stonking: libmawk1t64 1.0.5-1
- Copyright 2009 Tibor Palinkas (mawk@inno.bme.hu)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms