RSL Memory Management

Functions

globus_rsl_t * globus_rsl_copy_recursive (globus_rsl_t *ast_node)
 
globus_rsl_value_t * globus_rsl_value_copy_recursive (globus_rsl_value_t *globus_rsl_value_ptr)
 
int globus_rsl_value_free (globus_rsl_value_t *val)
 
int globus_rsl_free (globus_rsl_t *ast_node)
 
int globus_rsl_value_free_recursive (globus_rsl_value_t *globus_rsl_value_ptr)
 
int globus_rsl_free_recursive (globus_rsl_t *ast_node)
 
int globus_rsl_value_list_literal_replace (globus_list_t *value_list, char *string_value)
 
int globus_rsl_value_eval (globus_rsl_value_t *ast_node, globus_symboltable_t *symbol_table, char **string_value, int rsl_substitution_flag)
 
int globus_rsl_eval (globus_rsl_t *ast_node, globus_symboltable_t *symbol_table)
 

Detailed Description

Function Documentation

globus_rsl_t* globus_rsl_copy_recursive ( globus_rsl_t *  ast_node)

Create a deep copy of an RSL syntax tree.

The globus_rsl_copy_recursive() function performs a deep copy
of the RSL syntax tree pointed to by the @a ast_node parameter. All
RSL nodes, value nodes, variable names, attributes, and literals
will be copied to the return value.
Parameters
ast_nodeAn RSL syntax tree to copy.
Returns
The globus_rsl_copy_recursive() function returns a copy of its input parameter that that can be used after the ast_node and its values have been freed. If an error occurs, globus_rsl_copy_recursive() returns NULL.

References globus_list_copy_reverse(), globus_rsl_boolean_get_operand_list(), globus_rsl_boolean_get_operator(), globus_rsl_copy_recursive(), globus_rsl_make_boolean(), globus_rsl_make_relation(), globus_rsl_relation_get_attribute(), globus_rsl_relation_get_operator(), globus_rsl_relation_get_value_sequence(), globus_rsl_value_copy_recursive(), globus_rsl_value_make_sequence(), and globus_rsl_value_sequence_get_value_list().

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.

The globus_rsl_value_copy_recursive() function performs a deep copy
of the RSL value pointed to by the @a globus_rsl_value_ptr parameter.
All variable names, attributes, literals, and value lists will be copied
to the return value.
Parameters
globus_rsl_value_ptrA pointer to an RSL value to copy.
Returns
The globus_rsl_value_copy_recursive() function returns a copy of its input parameter that that can be used after the globus_rsl_value_ptr and its values have been freed. If an error occurs, globus_rsl_value_copy_recursive() returns NULL.

References globus_list_copy_reverse(), globus_rsl_value_concatenation_get_left(), globus_rsl_value_concatenation_get_right(), globus_rsl_value_copy_recursive(), globus_rsl_value_literal_get_string(), globus_rsl_value_make_concatenation(), globus_rsl_value_make_literal(), globus_rsl_value_make_sequence(), globus_rsl_value_make_variable(), globus_rsl_value_sequence_get_value_list(), and globus_rsl_value_variable_get_sequence().

int globus_rsl_value_free ( globus_rsl_value_t *  val)

Free an RSL value node.

The globus_rsl_value_free() function frees the RSL value pointed to
by the @a val parameter. This only frees the RSL value node itself, and
not any sequence or string values associated with that node.
Parameters
valThe RSL value node to free.
Returns
The globus_rsl_value_free() function always returns GLOBUS_SUCCESS.
int globus_rsl_free ( globus_rsl_t *  ast_node)

Free an RSL syntax tree node.

The globus_rsl_free() function frees the RSL syntax tree node pointed
to by the @a ast_node parameter. This only frees the RSL syntax tree
node itself, and not any boolean operands, relation names, or values
associated with the node.
Parameters
ast_nodeThe RSL syntax tree node to free.
Returns
The globus_rsl_value_free() function always returns GLOBUS_SUCCESS.
int globus_rsl_value_free_recursive ( globus_rsl_value_t *  globus_rsl_value_ptr)

Free an RSL value and all its child nodes.

The globus_rsl_free_recursive() function frees the RSL value
node pointed to by the @a globus_rsl_value_ptr, including all 
literal strings, variable names, and value sequences.
Any pointers to these are no longer valid after
globus_rsl_value_free_recursive() returns.
Parameters
globus_rsl_value_ptrAn RSL value node to free.
Returns
The globus_rsl_value_free_recursive() function always returns GLOBUS_SUCCESS.

References globus_rsl_value_concatenation_get_left(), globus_rsl_value_concatenation_get_right(), globus_rsl_value_free_recursive(), globus_rsl_value_literal_get_string(), globus_rsl_value_sequence_get_value_list(), and globus_rsl_value_variable_get_sequence().

int globus_rsl_free_recursive ( globus_rsl_t *  ast_node)

Free an RSL syntax tree and all its child nodes.

The globus_rsl_free_recursive() function frees the RSL syntax tree
pointed to by the @a ast_node parameter, including all 
boolean operands, attribute names, and values.
Any pointers to these are no longer valid after
globus_rsl_free_recursive() returns.
Parameters
ast_nodeAn RSL parse tree to free.
Returns
The globus_rsl_value_free_recursive() function always returns GLOBUS_SUCCESS.

References globus_rsl_boolean_get_operand_list(), globus_rsl_free_recursive(), globus_rsl_relation_get_attribute(), globus_rsl_relation_get_value_sequence(), and globus_rsl_value_free_recursive().

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.

The globus_rsl_value_list_literal_replace() function replaces
the first value in the list pointed to by the @a value_list parameter
with a new value node that is a literal string node pointing to the
value of the @a string_value parameter, freeing the old value.
Parameters
value_listThe RSL value list to modify by replacing its first element.
string_valueThe new string value to use as a literal first element of the list pointed to by the value_list parameter.
Returns
Upon 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 the string_value parameter. If an error occurs, globus_rsl_value_list_literal_replace() returns 1.

References globus_rsl_value_free(), and globus_rsl_value_make_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.

The globus_rsl_value_eval() function modifies the value pointed to
by its @a ast_node parameter by replacing all RSL substitution
variable reference nodes with the literal values those variables 
evaluate to based on the current scope of the symbol table pointed to
by the @a symbol_table parameter. It also combines string
concatenations into literal string values. Any nodes which are replaced
by this function are freed using globus_rsl_value_free_recursive().
Parameters
ast_nodeA pointer to the RSL value node to evaluate.
symbol_tableA symbol table containing current definitions of the RSL substitutions which can occur in this evaluation scope.
string_valueAn 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_flagA flag indicating whether the node pointed to by the ast_node parameter defines RSL substition variables.
Returns
Upon success, globus_rsl_value_eval() returns GLOBUS_SUCCESS, and replaces any RSL substitution values in the node pointed to by the ast_node parameter. If the node evaluates to a single literal, the string_value parameter is modified to point to the value of that literal. If an error occurs, globus_rsl_value_eval() returns a non-zero value.

References globus_rsl_value_concatenation_get_left(), globus_rsl_value_concatenation_get_right(), globus_rsl_value_eval(), globus_rsl_value_free_recursive(), globus_rsl_value_is_concatenation(), globus_rsl_value_is_literal(), globus_rsl_value_is_sequence(), globus_rsl_value_is_variable(), globus_rsl_value_literal_get_string(), globus_rsl_value_make_literal(), globus_rsl_value_sequence_get_value_list(), globus_rsl_value_variable_get_name(), and globus_rsl_value_variable_get_size().

int globus_rsl_eval ( globus_rsl_t *  ast_node,
globus_symboltable_t *  symbol_table 
)

Evaluate an RSL syntax tree.

The globus_rsl_eval() function modifies the RSL parse tree pointed
to by its @a ast_node parameter by replacing all RSL substitution
variable reference nodes with the literal values those variables 
evaluate to based on the current scope of the symbol table pointed to
by the @a symbol_table parameter. It also combines string
concatenations into literal string values. Any nodes which are replaced
by this function are freed using globus_rsl_value_free_recursive().
Parameters
ast_nodeA pointer to the RSL syntax tree to evaluate.
symbol_tableA symbol table containing current definitions of the RSL substitutions which can occur in this evaluation scope.
Returns
Upon success, globus_rsl_eval() returns GLOBUS_SUCCESS, and replaces all RSL substitution values and concatenations in ast_node or its child nodes with the evaluated forms described above. If an error occurs, globus_rsl_eval() returns a non-zero value.

References globus_rsl_boolean_get_operand_list(), globus_rsl_eval(), globus_rsl_is_boolean(), globus_rsl_is_relation(), globus_rsl_is_relation_attribute_equal(), globus_rsl_relation_get_value_sequence(), globus_rsl_value_eval(), globus_rsl_value_free_recursive(), globus_rsl_value_is_sequence(), globus_rsl_value_make_literal(), and globus_rsl_value_sequence_get_value_list().


about globus | globus toolkit | dev.globus

Comments? webmaster@globus.org