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β aCSPARSEstructure that you made withcs_init. that's your parse-y bestie right there π«Άbufβ the string you want to parse. heads up: embeddedNULLs 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:
cs_dump(3)cs_destroy(3)cs_render(3)cs_register_esc_strfunc(3)cs_arg_parsev(3)cs_register_fileload(3)cs_init(3)cs_register_strfunc(3)cs_arg_parse(3)cs_parse_string(3)cs_parse_file(3)=(3)cs_register_function
π 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. ππ
π¦ where this page comes from
- debian bookworm: clearsilver-dev 0.10.5-4+b5
- debian trixie: clearsilver-dev 0.10.5-6+b1
- epel 10: clearsilver 0.10.5-80.el10_2 Β· Apache-1.1
- epel 9: clearsilver 0.10.5-74.el9 Β· Apache-1.1
- fedora 43: clearsilver 0.10.5-80.fc43 Β· Apache-1.1
- fedora 44: clearsilver 0.10.5-82.fc44 Β· Apache-1.1
- ubuntu jammy: clearsilver-dev 0.10.5-4build3
- ubuntu noble: clearsilver-dev 0.10.5-4build7
- ubuntu questing: clearsilver-dev 0.10.5-6build1
- ubuntu resolute: clearsilver-dev 0.10.5-7
- ubuntu stonking: clearsilver-dev 0.10.5-7build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms