Scalar and generic functions


Functions

int RDB_obj_equals (const RDB_object *val1p, const RDB_object *val2p, RDB_exec_context *ecp, RDB_transaction *txp, RDB_bool *resp)
void RDB_init_obj (RDB_object *valp)
int RDB_destroy_obj (RDB_object *objp, RDB_exec_context *ecp)
void RDB_bool_to_obj (RDB_object *valp, RDB_bool v)
void RDB_int_to_obj (RDB_object *valp, RDB_int v)
void RDB_float_to_obj (RDB_object *valp, RDB_float v)
int RDB_string_to_obj (RDB_object *valp, const char *str, RDB_exec_context *ecp)
int RDB_append_string (RDB_object *objp, const char *str, RDB_exec_context *ecp)
int RDB_obj_comp (const RDB_object *valp, const char *compname, RDB_object *compvalp, RDB_exec_context *ecp, RDB_transaction *txp)
int RDB_obj_set_comp (RDB_object *valp, const char *compname, const RDB_object *compvalp, RDB_exec_context *ecp, RDB_transaction *txp)
RDB_bool RDB_obj_bool (const RDB_object *valp)
RDB_int RDB_obj_int (const RDB_object *valp)
RDB_float RDB_obj_float (const RDB_object *valp)
char * RDB_obj_string (const RDB_object *valp)
int RDB_binary_set (RDB_object *valp, size_t pos, const void *srcp, size_t len, RDB_exec_context *ecp)
int RDB_binary_get (const RDB_object *objp, size_t pos, size_t len, RDB_exec_context *ecp, void **pp, size_t *alenp)
size_t RDB_binary_length (const RDB_object *objp)
RDB_type * RDB_obj_type (const RDB_object *objp)
void RDB_obj_set_typeinfo (RDB_object *objp, RDB_type *typ)

Function Documentation

int RDB_append_string ( RDB_object objp,
const char *  str,
RDB_exec_context *  ecp 
)

Appends the string str to *objp.

objp must be of type STRING.

Returns:
RDB_OK on success, RDB_ERROR if an error occurred.

Errors:
The call may fail for a system error.

int RDB_binary_get ( const RDB_object objp,
size_t  pos,
size_t  len,
RDB_exec_context *  ecp,
void **  pp,
size_t *  alenp 
)

RDB_binary_get obtains a pointer to len bytes starting at position pos of the RDB_object pointed to by valp and stores this pointer at the location pointed to by pp. If the sum of pos and len exceeds the length of the object, the length of the byte block will be lower than requested.

If alenp is not NULL, the actual length of the byte block is stored at the location pointed to by alenp.

valp must point to a RDB_object of type BINARY.

Returns:
RDB_OK on success, RDB_ERROR if an error occurred.

Errors:
The call may fail for a system error.

size_t RDB_binary_length ( const RDB_object objp  ) 

RDB_binary_length returns the number of bytes stored in the RDB_object pointed to by valp. The RDB_object must be of type BINARY.

Returns:
The length of the RDB_object.

int RDB_binary_set ( RDB_object valp,
size_t  pos,
const void *  srcp,
size_t  len,
RDB_exec_context *  ecp 
)

RDB_binary_set copies len bytes from srcp to the position pos in the RDB_object pointed to by valp. valp must point either to a new initialized RDB_object or to a RDB_object of type BINARY.

If an error occurs, an error value is left in *ecp.

Returns:
RDB_OK on success, RDB_ERROR if an error occurred.

Errors:
The call may fail for a system error.

void RDB_bool_to_obj ( RDB_object valp,
RDB_bool  v 
)

RDB_bool_to_obj sets the RDB_object pointed to by valp to the boolean value specified by v.

The RDB_object must either be newly initialized or of type BOOLEAN.

int RDB_destroy_obj ( RDB_object objp,
RDB_exec_context *  ecp 
)

RDB_destroy_obj releases all resources associated with a RDB_object structure.

Returns:
RDB_OK on success, RDB_ERROR if an error occurred.

void RDB_float_to_obj ( RDB_object valp,
RDB_float  v 
)

RDB_float_to_obj sets the RDB_object pointed to by valp to the RDB_float value specified by v.

The RDB_object must either be newly initialized or of type FLOAT.

void RDB_init_obj ( RDB_object valp  ) 

RDB_init_obj initializes the RDB_object structure pointed to by valp. RDB_init_obj must be called before any other operation can be performed on a RDB_object variable.

void RDB_int_to_obj ( RDB_object valp,
RDB_int  v 
)

RDB_int_to_obj sets the RDB_object pointed to by valp to the integer value specified by v.

The RDB_object must either be newly initialized or of type INTEGER.

RDB_bool RDB_obj_bool ( const RDB_object valp  ) 

RDB_obj_bool returns the value of the RDB_object pointed to by valp as a RDB_bool. The RDB_object must be of type BOOLEAN.

Returns:
The value of the RDB_object.

int RDB_obj_comp ( const RDB_object valp,
const char *  compname,
RDB_object compvalp,
RDB_exec_context *  ecp,
RDB_transaction *  txp 
)

RDB_obj_comp copies the value of component compname of a possible representation of the variable pointed to by valp to the variable pointed to by comp.

If an error occurs, an error value is left in *ecp.

Returns:
RDB_OK on success, RDB_ERROR if an error occurred.

Errors:
RDB_INVALID_ARGUMENT_ERROR
The type of *valp is not scalar, or it does not have a possible representation with a component compname.
RDB_OPERATOR_NOT_FOUND_ERROR
The getter method for component compname has not been created.

RDB_obj_comp may also raise an error raised by a user-provided getter function.

The call may also fail for a system error.

int RDB_obj_equals ( const RDB_object val1p,
const RDB_object val2p,
RDB_exec_context *  ecp,
RDB_transaction *  txp,
RDB_bool *  resp 
)

RDB_obj_equals checks two RDB_object variables for equality and stores the result in the variable pointed to by resp.

If an error occurs, an error value is left in *ecp.

Returns:
RDB_OK on success, RDB_ERROR if an error occurred.

RDB_float RDB_obj_float ( const RDB_object valp  ) 

RDB_obj_float returns the value of the RDB_object pointed to by valp as a RDB_float. The RDB_object must be of type FLOAT.

Returns:
The value of the RDB_object.

RDB_int RDB_obj_int ( const RDB_object valp  ) 

RDB_obj_int returns the value of the RDB_object pointed to by valp as a RDB_int. The RDB_object must be of type INTEGER.

Returns:
The value of the RDB_object.

int RDB_obj_set_comp ( RDB_object valp,
const char *  compname,
const RDB_object compvalp,
RDB_exec_context *  ecp,
RDB_transaction *  txp 
)

RDB_obj_set_comp sets the the value of component compname of a possible representation of the RDB_object specified to by valp to the value of the variable pointed to by comp.

The RDB_object must be of a type which has a component compname.

If an error occurs, an error value is left in *ecp.

Returns:
RDB_OK on success, RDB_ERROR if an error occurred.

void RDB_obj_set_typeinfo ( RDB_object objp,
RDB_type *  typ 
)

Set the type information for *objp. This should be used only for tuples and arrays, which, unlike scalars and tables, do not to carry explicit type information by default. The caller must manage the type; it is not automatically destroyed when *objp is destroyed.

char* RDB_obj_string ( const RDB_object valp  ) 

RDB_obj_string returns a pointer to the value of the RDB_object pointed to by valp as a char *. The RDB_object must be of type STRING.

Returns:
The string value of the RDB_object.

RDB_type* RDB_obj_type ( const RDB_object objp  ) 

RDB_obj_type returns a pointer to the type of *objp.

Returns:
A pointer to the type of the RDB_object.

int RDB_string_to_obj ( RDB_object valp,
const char *  str,
RDB_exec_context *  ecp 
)

RDB_string_to_obj sets the RDB_object pointed to by valp to the string value specified by str.

The RDB_object must either be newly initialized or of type STRING.


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