MSTL_INIT(3)

✨ MSTL_INIT β€” bestie edition ✨

okay so this is the libmseed page for mstl_init and mstl_free β€” aka the "make a MSTraceList and then let it go" duo πŸ’– (yes the page is called MSTL_INIT(3), that's the manual name, we're folding it in here like a lil name tag πŸŽ€).


🌸 SYNOPSIS 🌸

#include <libmseed.h>

MSTrace      *mstl_init ( MSTrace *mstl );

void          mstl_free ( MSTrace **ppmstl, flag freeprvtptr );

like… two functions, that's it, no drama πŸ¦‹


πŸ’… DESCRIPTION πŸ’…

mstl_init β€” the glow-up era ✨

mstl_init will initialize a MSTraceList structure. main character behavior tbh.

and here's the important bit, bestie: if the mstl parameter is not NULL, the structure gets cleared before being reallocated β€” and any memory allocated for associated MSTraceID and related sub-structures will be freed. so like, it cleans up after itself first, no cap. 🧹

mstl_free β€” the goodbye arc 😭

mstl_free will free all memory associated with a MSTraceList structure and set the structure pointer (*ppmstl) to 0. iconic. responsible. we love a clean exit.

and if the freeprvtptr flag is true, any memory pointed to by the prvtptr members of the MSTraceID or MSTraceSeg structures… πŸ‘€ (that's the part where it gets freed, fr fr β€” the flag controls whether that private-pointer memory goes too).

⚠️ heads up: mstl_free zeroes out *ppmstl for you, so don't go dereferencing it afterward expecting a whole structure, bestie. it's giving 0. πŸ’€

πŸ‘‘ RETURN VALUES πŸ‘‘

mstl_init returns a pointer to the MSTraceList structure it initialized on success, or NULL on error. so vibe check that return value, always. 🫢


πŸ¦‹ SEE ALSO πŸ¦‹


🌈 AUTHOR 🌈

Chad Trabant IRIS Data Management Center


and that's the whole page, no notes πŸ’œ this one's from the Libmseed API, dated 2008/11/21 β€” vintage but still slaying βœ¨πŸ«ΆπŸŽ€