globus_rsl_memory(3)

πŸ“¦
version 11.4 Β· 5 versions
, in epel 10, fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

πŸ’– globus_rsl_memory β€” RSL Memory Management πŸ’–

okay so bestie, welcome to globus_rsl_memory(3), a page from the globus_rsl library functions manual, and it is literally all about RSL Memory Management. that's it, that's the whole vibe. memory. management. slay.


✨ SYNOPSIS ✨

🫢 Functions

  • globus_rsl_t * globus_rsl_copy_recursive (globus_rsl_t *ast_node) β€” Create a deep copy of an RSL syntax tree.
  • globus_rsl_value_t * globus_rsl_value_copy_recursive (globus_rsl_value_t *globus_rsl_value_ptr) β€” Create a deep copy of an RSL value.
  • int globus_rsl_value_free (globus_rsl_value_t *val) β€” Free an RSL value node.
  • int globus_rsl_free (globus_rsl_t *ast_node) β€” Free an RSL syntax tree node.
  • int globus_rsl_value_free_recursive (globus_rsl_value_t *globus_rsl_value_ptr) β€” Free an RSL value and all its child nodes.
  • int globus_rsl_free_recursive (globus_rsl_t *ast_node) β€” Free an RSL syntax tree and all its child nodes.
  • int globus_rsl_value_list_literal_replace (globus_list_t *value_list, char *string_value) β€” Replace the first value in a value list with a literal.
  • int globus_rsl_value_eval (globus_rsl_value_t *ast_node, globus_symboltable_t *symbol_table, char **string_value, int rsl_substitution_flag) β€” Evaluate RSL substitions in an RSL value node.
  • int globus_rsl_eval (globus_rsl_t *ast_node, globus_symboltable_t *symbol_table) β€” Evaluate an RSL syntax tree.

🌸 Detailed Description 🌸

RSL Memory Management. that's the whole description bestie, they really said "short and iconic" πŸ’…


πŸŽ€ Function Documentation πŸŽ€

πŸ’œ globus_rsl_t * globus_rsl_copy_recursive (globus_rsl_t * ast_node)

Create a deep copy of an RSL syntax tree.

so the globus_rsl_copy_recursive() function does a deep copy of the RSL syntax tree that ast_node is pointing at. and when we say deep, we mean deep β€” every single RSL node, value node, variable name, attribute, and literal gets copied into the return value. no shortcuts, no sharing, all yours πŸ”₯

Parameters

  • ast_node β€” An RSL syntax tree to copy.

Returns

globus_rsl_copy_recursive() hands you back a copy of its input parameter that you can keep using even after ast_node and all its values have been freed. and if something goes wrong? it returns NULL. 😭


πŸ’œ int globus_rsl_eval (globus_rsl_t * ast_node, globus_symboltable_t * symbol_table)

Evaluate an RSL syntax tree.

okay so globus_rsl_eval() modifies the RSL parse tree that ast_node points to β€” it swaps out every RSL substitution variable reference node with the literal values those variables evaluate to, based on the current scope of the symbol table that symbol_table points to. it also squishes string concatenations together into literal string values. and any nodes that get replaced by this function? they get freed using globus_rsl_value_free_recursive(). bye bestie 🫢

Parameters

  • ast_node β€” A pointer to the RSL syntax tree to evaluate.
  • symbol_table β€” A symbol table containing current definitions of the RSL substitutions which can occur in this evaluation scope.

Returns

on success, globus_rsl_eval() returns GLOBUS_SUCCESS, and it replaces all RSL substitution values and concatenations in ast_node or its child nodes with the evaluated forms described above. and if an error happens, globus_rsl_eval() returns a non-zero value. periodt.


πŸ’œ int globus_rsl_free (globus_rsl_t * ast_node)

Free an RSL syntax tree node.

globus_rsl_free() frees the RSL syntax tree node that ast_node points to. and listen, this is a shallow free β€” it only frees the RSL syntax tree node itself. it does not free any boolean operands, relation names, or values associated with the node. those are on their own, bestie πŸ™ˆ

Parameters

  • ast_node β€” The RSL syntax tree node to free.

Returns

the globus_rsl_value_free() function always returns GLOBUS_SUCCESS. (yes, the docs really say globus_rsl_value_free() here, we don't make the rules, we just report them πŸ’€)


πŸ’œ int globus_rsl_free_recursive (globus_rsl_t * ast_node)

Free an RSL syntax tree and all its child nodes.

globus_rsl_free_recursive() frees the RSL syntax tree that ast_node points to, including all boolean operands, attribute names, and values. so heads up: any pointers to those are no longer valid once globus_rsl_free_recursive() returns. dangling pointers are NOT the vibe, ok?

Parameters

  • ast_node β€” An RSL parse tree to free.

Returns

the globus_rsl_value_free_recursive() function always returns GLOBUS_SUCCESS. (again, that's literally what the page says πŸ’…)


πŸ’œ globus_rsl_value_t * globus_rsl_value_copy_recursive (globus_rsl_value_t * globus_rsl_value_ptr)

Create a deep copy of an RSL value.

globus_rsl_value_copy_recursive() performs a deep copy of the RSL value that globus_rsl_value_ptr points to. all variable names, attributes, literals, and value lists get copied over into the return value. everything. the whole squad. πŸ‘‘

Parameters

  • globus_rsl_value_ptr β€” A pointer to an RSL value to copy.

Returns

globus_rsl_value_copy_recursive() returns a copy of its input parameter that you can use after globus_rsl_value_ptr and its values have been freed. if an error occurs, globus_rsl_value_copy_recursive() returns NULL. 😭


πŸ’œ int globus_rsl_value_eval (globus_rsl_value_t * ast_node, globus_symboltable_t * symbol_table, char ** string_value, int rsl_substitution_flag)

Evaluate RSL substitions in an RSL value node.

globus_rsl_value_eval() modifies the value that ast_node points to, replacing every RSL substitution variable reference node with the literal values those variables evaluate to, based on the current scope of the symbol table that symbol_table points to. it also combines string concatenations into literal string values. any nodes replaced by this function get freed using globus_rsl_value_free_recursive(). ✨

Parameters

  • ast_node β€” A pointer to the RSL value node to evaluate.
  • symbol_table β€” A symbol table containing current definitions of the RSL substitutions which can occur in this evaluation scope.
  • string_value β€” An output parameter which is set to point to the value of the string returned by evaluating the value node pointed to by ast_node if it evaluates to a literal value. list pointed to by the value_list parameter.
  • rsl_substitution_flag β€” A flag indicating whether the node pointed to by the ast_node parameter defines RSL substition variables.

Returns

on success, globus_rsl_value_eval() returns GLOBUS_SUCCESS, and it replaces any RSL substitution values in the node pointed to by ast_node. if that node evaluates to a single literal, the string_value parameter gets modified to point to the value of that literal. and if an error occurs, globus_rsl_value_eval() returns a non-zero value.


πŸ’œ int globus_rsl_value_free (globus_rsl_value_t * val)

Free an RSL value node.

globus_rsl_value_free() frees the RSL value that val points to. and again β€” shallow! it only frees the RSL value node itself, not any sequence or string values associated with that node. don't @ me πŸ™ˆ

Parameters

  • val β€” The RSL value node to free.

Returns

the globus_rsl_value_free() function always returns GLOBUS_SUCCESS. always. every time. iconic consistency πŸ’…


πŸ’œ int globus_rsl_value_free_recursive (globus_rsl_value_t * globus_rsl_value_ptr)

Free an RSL value and all its child nodes.

globus_rsl_free_recursive() frees the RSL value node that globus_rsl_value_ptr points to, including all literal strings, variable names, and value sequences. so once globus_rsl_value_free_recursive() returns, any pointers to these are no longer valid. seriously, let them go πŸ¦‹

Parameters

  • globus_rsl_value_ptr β€” An RSL value node to free.

Returns

the globus_rsl_value_free_recursive() function always returns GLOBUS_SUCCESS.


πŸ’œ int globus_rsl_value_list_literal_replace (globus_list_t * value_list, char * string_value)

Replace the first value in a value list with a literal.

globus_rsl_value_list_literal_replace() swaps out the first value in the list that value_list points to with a brand-new value node β€” a literal string node pointing to the value of string_value β€” and frees the old value on the way out. out with the old, in with the literal πŸ’–

Parameters

  • value_list β€” The RSL value list to modify by replacing its first element.
  • string_value β€” The new string value to use as a literal first element of the list pointed to by the value_list parameter.

Returns

on success, globus_rsl_value_list_literal_replace() returns GLOBUS_SUCCESS, frees the current first value of value_list, and replaces it with a new literal string node pointing to the value of string_value. and if an error occurs, globus_rsl_value_list_literal_replace() returns 1.


🌈 Author 🌈

Generated automatically by Doxygen for globus_rsl from the source code. (not a human, just a robot doing its little thing πŸ€–βœ¨)


okay that's the whole page bestie, you ate that 🫢 this was globus_rsl_memory(3) from globus_rsl, Version 11.4, no cap. go free your memory responsibly, mwah πŸ’‹πŸŒˆπŸ’œ

πŸ“¦ where this page comes from