Expression functions


Functions

RDB_bool RDB_expr_is_const (const RDB_expression *exp)
RDB_expression * RDB_expr_resolve_varnames (const RDB_expression *exp, RDB_getobjfn *getfnp, void *getdata, RDB_exec_context *ecp, RDB_transaction *txp)
RDB_type * RDB_expr_type (RDB_expression *exp, RDB_gettypefn *getfnp, void *arg, RDB_exec_context *ecp, RDB_transaction *txp)
RDB_expression * RDB_bool_to_expr (RDB_bool v, RDB_exec_context *ecp)
RDB_expression * RDB_int_to_expr (RDB_int v, RDB_exec_context *ecp)
RDB_expression * RDB_float_to_expr (RDB_float v, RDB_exec_context *ecp)
RDB_expression * RDB_string_to_expr (const char *v, RDB_exec_context *ecp)
RDB_expression * RDB_obj_to_expr (const RDB_object *objp, RDB_exec_context *ecp)
RDB_expression * RDB_table_ref (RDB_object *tbp, RDB_exec_context *ecp)
RDB_expression * RDB_var_ref (const char *attrname, RDB_exec_context *ecp)
RDB_expression * RDB_ro_op (const char *opname, RDB_exec_context *ecp)
void RDB_add_arg (RDB_expression *exp, RDB_expression *argp)
RDB_expression * RDB_eq (RDB_expression *arg1, RDB_expression *arg2, RDB_exec_context *ecp)
RDB_expression * RDB_tuple_attr (RDB_expression *arg, const char *attrname, RDB_exec_context *ecp)
RDB_expression * RDB_expr_comp (RDB_expression *arg, const char *compname, RDB_exec_context *ecp)
int RDB_drop_expr (RDB_expression *exp, RDB_exec_context *ecp)
int RDB_evaluate (RDB_expression *exp, RDB_getobjfn *getfnp, void *getdata, RDB_exec_context *ecp, RDB_transaction *txp, RDB_object *valp)
int RDB_evaluate_bool (RDB_expression *exp, RDB_getobjfn *getfnp, void *getdata, RDB_exec_context *ecp, RDB_transaction *txp, RDB_bool *resp)
RDB_expression * RDB_dup_expr (const RDB_expression *exp, RDB_exec_context *ecp)
RDB_objectRDB_expr_obj (RDB_expression *exp)

Function Documentation

void RDB_add_arg ( RDB_expression *  exp,
RDB_expression *  argp 
)

RDB_add_arg adds the child expression *argp to the expression *exp. exp must represent a read-only operator invocation. RDB_ro_op() should be used to create such an expression.

To obtain a valid expression representing a read-only operator invocation, RDB_add_arg must be called once for each argument of the operator.

RDB_expression* RDB_bool_to_expr ( RDB_bool  v,
RDB_exec_context *  ecp 
)

RDB_bool_to_expr creates a constant expression of type BOOLEAN.

Returns:
A pointer to the newly created expression, of NULL if the creation failed.

int RDB_drop_expr ( RDB_expression *  exp,
RDB_exec_context *  ecp 
)

RDB_drop_expr destroys the expression specified to by exp (including all subexpressions) and frees all resources associated with it.

Returns:
RDB_OK on success, RDB_ERROR on failure.

Errors:
The call may fail for a system error.

RDB_expression* RDB_dup_expr ( const RDB_expression *  exp,
RDB_exec_context *  ecp 
)

Create a copy of an expression.

RDB_expression* RDB_eq ( RDB_expression *  arg1,
RDB_expression *  arg2,
RDB_exec_context *  ecp 
)

RDB_eq creates an expression that represents an "is equal" operator. If one of the arguments is NULL, NULL is returned.

Returns:
A pointer to the newly created expression, of NULL if the creation failed.

RDB_expression* RDB_expr_comp ( RDB_expression *  arg,
const char *  compname,
RDB_exec_context *  ecp 
)

RDB_expr_comp creates an expression which evaluates to a possible representation component.

Returns:
A pointer to the newly created expression, of NULL if the creation failed.

RDB_bool RDB_expr_is_const ( const RDB_expression *  exp  ) 

RDB_expr_is_const returns if the expression is a constant expression.

Returns:
RDB_TRUE if the expression is a constant expression, RDB_FALSE otherwise.

RDB_object* RDB_expr_obj ( RDB_expression *  exp  ) 

RDB_expr_obj returns a pointer to RDB_object embedded in an expression.

Returns:
A pointer to the embedded RDB_object or NULL if the expression does not represent a RDB_object.

RDB_expression* RDB_float_to_expr ( RDB_float  v,
RDB_exec_context *  ecp 
)

RDB_float_to_expr creates a constant expression of type FLOAT.

Returns:
A pointer to the newly created expression, of NULL if the creation failed.

RDB_expression* RDB_int_to_expr ( RDB_int  v,
RDB_exec_context *  ecp 
)

RDB_int_to_expr creates a constant expression of type INTEGER.

Returns:
A pointer to the newly created expression, of NULL if the creation failed.

RDB_expression* RDB_obj_to_expr ( const RDB_object objp,
RDB_exec_context *  ecp 
)

RDB_obj_to_expr creates a constant expression from a RDB_object.

Passing an objp of NULL is equivalent to passing a pointer to a RDB_object which has been newly initialized using RDB_init_obj().

Returns:
A pointer to the newly created expression, of NULL if the creation failed.

RDB_expression* RDB_ro_op ( const char *  opname,
RDB_exec_context *  ecp 
)

RDB_ro_op creates an expression which represents the invocation of a readonly operator.

Use RDB_add_arg() to add arguments.

Returns:
On success, a pointer to the newly created expression is returned. If the expression could not be created due to insufficient memory, NULL is returned and an error is left in *ecp.

RDB_expression* RDB_string_to_expr ( const char *  v,
RDB_exec_context *  ecp 
)

RDB_string_to_expr creates a constant expression of type STRING.

Returns:
A pointer to the newly created expression, of NULL if the creation failed.

RDB_expression* RDB_table_ref ( RDB_object tbp,
RDB_exec_context *  ecp 
)

RDB_table_ref creates an expression which refers to a table.

Returns:
A pointer to the newly created expression, of NULL if the creation failed.

RDB_expression* RDB_tuple_attr ( RDB_expression *  arg,
const char *  attrname,
RDB_exec_context *  ecp 
)

RDB_tuple_attr creates an expression that represents a tuple attribute extraction.

Returns:
A pointer to the newly created expression, of NULL if the creation failed.

RDB_expression* RDB_var_ref ( const char *  attrname,
RDB_exec_context *  ecp 
)

RDB_var_ref creates an expression that refers to a variable.

Returns:
A pointer to the newly created expression, of NULL if the creation failed.


Generated on Tue Mar 11 23:48:15 2008 for Duro by  doxygen 1.5.1