|  |  |  | Rasqal RDF Query Library Manual |  | 
|---|---|---|---|---|
| Top | Description | ||||
rasqal_variable; rasqal_variable * rasqal_new_variable_from_variable (rasqal_variable *v); void rasqal_free_variable (rasqal_variable *v); int rasqal_variable_print (rasqal_variable *v,FILE *fh); void rasqal_variable_set_value (rasqal_variable *v,rasqal_literal *l); enum rasqal_variable_type;
A class to hold a variable with optional name and a rasqal_literal value. The name is not required for SPARQL anonymous variables.
typedef struct {
  rasqal_variables_table* vars_table;
  const char * name;
  rasqal_literal* value;
  int offset;
  rasqal_variable_type type;
  struct rasqal_expression_s* expression;
  void *user_data;
  int usage;
} rasqal_variable;
Binding between a variable name and a value.
Includes internal field offset for recording the offset into the
(internal) rasqal_query variables array.
| rasqal_variables_table * | variables table that owns this variable | 
| Variable name. | |
| rasqal_literal * | Variable value or NULL if unbound. | 
| Internal. | |
| rasqal_variable_type  | Variable type. | 
| Expression when the variable is a computed SELECT expression | |
| Pointer to user data associated with a variable. This is not used by rasqal. | |
| reference count | 
rasqal_variable *   rasqal_new_variable_from_variable   (rasqal_variable *v);
Copy Constructor - Create a new Rasqal variable from an existing one
This adds a new reference to the variable, it does not do a deep copy
| 
 | rasqal_variable to copy | 
| Returns : | a new rasqal_variable or NULL on failure. | 
void                rasqal_free_variable                (rasqal_variable *v);
Destructor - Destroy a Rasqal variable object.
| 
 | rasqal_variable object | 
int rasqal_variable_print (rasqal_variable *v,FILE *fh);
Print a Rasqal variable in a debug format.
The print debug format may change in any release.
| 
 | the rasqal_variable object | 
| 
 | the FILE* handle to print to | 
| Returns : | non-0 on failure | 
void rasqal_variable_set_value (rasqal_variable *v,rasqal_literal *l);
Set the value of a Rasqal variable.
The variable value is an input parameter and is copied in, not shared. If the variable value is NULL, any existing value is deleted.
| 
 | the rasqal_variable object | 
| 
 | the rasqal_literal value to set (or NULL) |