Functions | |
| int | RDB_create_ro_op (const char *name, int argc, RDB_type *argtv[], RDB_type *rtyp, const char *libname, const char *symname, const void *iargp, size_t iarglen, RDB_exec_context *ecp, RDB_transaction *txp) |
| int | RDB_create_update_op (const char *name, int argc, RDB_type *argtv[], RDB_bool updv[], const char *libname, const char *symname, const void *iargp, size_t iarglen, RDB_exec_context *ecp, RDB_transaction *txp) |
| int | RDB_call_ro_op (const char *name, int argc, RDB_object *argv[], RDB_exec_context *ecp, RDB_transaction *txp, RDB_object *retvalp) |
| int | RDB_call_update_op (const char *name, int argc, RDB_object *argv[], RDB_exec_context *ecp, RDB_transaction *txp) |
| int | RDB_drop_op (const char *name, RDB_exec_context *ecp, RDB_transaction *txp) |
| int RDB_call_ro_op | ( | const char * | name, | |
| int | argc, | |||
| RDB_object * | argv[], | |||
| RDB_exec_context * | ecp, | |||
| RDB_transaction * | txp, | |||
| RDB_object * | retvalp | |||
| ) |
RDB_call_ro_op invokes the read-only operator with the name name, passing the arguments in argc and argv.
The result will be stored at the location pointed to by retvalp.
If txp</var is NULL, only built-in operators can be found.
If the user-supplied function which implements the function raises an error, this error is returned in *ecp.
The call may also fail for a system error, in which case the transaction may be implicitly rolled back.
| int RDB_call_update_op | ( | const char * | name, | |
| int | argc, | |||
| RDB_object * | argv[], | |||
| RDB_exec_context * | ecp, | |||
| RDB_transaction * | txp | |||
| ) |
RDB_call_update_op invokes the update operator with the name name, passing the arguments in argc and argv. The arguments must carry type information.
If the user-supplied function which implements the operator raises an error, this error is returned in *ecp.
The call may also fail for a system error, in which case the transaction may be implicitly rolled back.
| int RDB_create_ro_op | ( | const char * | name, | |
| int | argc, | |||
| RDB_type * | argtv[], | |||
| RDB_type * | rtyp, | |||
| const char * | libname, | |||
| const char * | symname, | |||
| const void * | iargp, | |||
| size_t | iarglen, | |||
| RDB_exec_context * | ecp, | |||
| RDB_transaction * | txp | |||
| ) |
RDB_create_ro_op creates a read-only operator with name name. The argument types are specified by argc and argtv.
To execute the operator, Duro will execute the function specified by sym from the library specified by libname.
The name of the library must be passed without the file extension.
This function must have the following signature:
int
<sym>(const char *name, int argc, RDB_object *argv[],
const void *iargp, size_t iarglen, RDB_exec_context *ecp, RDB_transaction *txp,
RDB_object *retvalp)
When the function is executed, the name of the operator is passed through name and the arguments are passed through argc and argv.
The function specified by sym must store the result at the location specified by retvalp and return RDB_OK. It can indicate an error condition by leaving an error in *ecp (see RDB_raise_err()) and returning RDB_ERROR.
If iargp is not NULL, it must point to a byte block of length iarglen which will be passed to the function specified by sym. This can be used to pass code to an interpreter function.
Overloading operators is possible.
Array-valued return types are not supported.
The call may also fail for a system error, in which case the transaction may be implicitly rolled back.
| int RDB_create_update_op | ( | const char * | name, | |
| int | argc, | |||
| RDB_type * | argtv[], | |||
| RDB_bool | updv[], | |||
| const char * | libname, | |||
| const char * | symname, | |||
| const void * | iargp, | |||
| size_t | iarglen, | |||
| RDB_exec_context * | ecp, | |||
| RDB_transaction * | txp | |||
| ) |
RDB_create_update_op creates an update operator with name name. The argument types are specified by argc and argtv.
The argument upd specifies which of the arguments are updated. If upd[i] is RDB_TRUE, this indicates that the ith argument is updated by the operator.
To execute the operator, Duro will execute the function specified by sym from the library specified by libname.
The name of the library must be passed without the file extension.
This function must have the following signature:
int
<sym>(const char *name, int argc, RDB_object *argv[],
RDB_bool updv[], const void *iargp, size_t iarglen,
RDB_exec_context *ecp, RDB_transaction *txp)
When the function is executed, the name of the operator is passed through name and the arguments are passed through argc and argv.
On success, the function specified by sym must return RDB_OK. It can indicate an error condition by leaving an error in *ecp (see RDB_raise_err() and related functions) and returning RDB_ERROR.
If iargp is not NULL, it must point to a byte block of length iarglen which will be passed to the function specified by sym. This can be used to pass code to an interpreter function.
Overloading operators is possible.
The call may also fail for a system error, in which case the transaction may be implicitly rolled back.
| int RDB_drop_op | ( | const char * | name, | |
| RDB_exec_context * | ecp, | |||
| RDB_transaction * | txp | |||
| ) |
RDB_drop_op deletes the operator with the name name from the database. This affects all overloaded versions.
The call may also fail for a system error, in which case the transaction may be implicitly rolled back.
1.5.1