cs_parse_string(3)

πŸ’– cs_parse_string(3) πŸ’–

okay bestie, so this one lives in the <cs/cs.h> corner of the ClearSilver universe β€” it's a section 3 (library) page, and it's literally all about parsing a CS template string. πŸ¦‹


✨ NAME ✨

cs_parse_string β€” parse a CS template string πŸŽ€


✨ SYNOPSIS ✨

#include <cs/cs.h>

NEOERR *cs_parse_string (CSPARSE *parse, char *buf, size_t blen);

✨ ARGUMENTS ✨

  • parse β€” a CSPARSE structure that you made with cs_init. that's your parse-y bestie right there 🫢
  • buf β€” the string you want to parse. heads up: embedded NULLs are not currently supported, so don't even try it πŸ’€
  • blen β€” the length of the string. yes, you gotta tell it. it's not psychic ✨

✨ DESCRIPTION ✨

so cs_parse_string parses a string. that's the whole vibe, but there's lore:

the string gets modified, and the parse tree keeps internal references into it. it's giving "we're holding onto your string forever" energy. for this reason, ownership of the string is transferred to the CS system, and the string will be free'd when cs_destroy() is called. so like… don't go freeing it yourself afterwards, bestie, that's not your job anymore πŸ™ˆ

the parse information gets appended to the current parse tree β€” appended, not replacing, okay? it stacks. πŸ‘‘

and during parse, the only HDF variables that get evaluated are the ones used in evar or include statements. everything else? not the moment. not today. ⭐


✨ RETURN VALUE ✨

None. that's it. that's the answer. 😭 (the NEOERR * is out here for the culture, but this page says None and we respect that.)


✨ SEE ALSO ✨

the whole friend group, fr fr:


πŸ’… and that's the whole page, no cap. go parse something iconic.

this lil masterpiece is brought to you by ClearSilver, dated 12 July 2007 β€” yeah, she's vintage, and she's still serving. mwah. πŸŽ€πŸ’–