DuroDBMS API
1.7
|
Functions | |
int | Duro_init_interp (Duro_interp *interp, RDB_exec_context *ecp, RDB_environment *envp, const char *dbname) |
void | Duro_destroy_interp (Duro_interp *interp) |
RDB_environment * | Duro_dt_env (Duro_interp *interp) |
RDB_transaction * | Duro_dt_tx (Duro_interp *interp) |
void | Duro_println_error (const RDB_object *errobjp) |
void | Duro_print_error_f (const RDB_object *errobjp, FILE *f) |
void | Duro_dt_interrupt (Duro_interp *interp) |
int | Duro_dt_execute_path (const char *path, Duro_interp *interp, RDB_exec_context *ecp) |
int | Duro_dt_execute (FILE *infp, Duro_interp *interp, RDB_exec_context *ecp) |
int | Duro_dt_execute_str (const char *instr, Duro_interp *interp, RDB_exec_context *ecp) |
RDB_expression * | Duro_dt_parse_expr_str (const char *instr, Duro_interp *interp, RDB_exec_context *ecp) |
const char * | Duro_dt_prompt (Duro_interp *interp) |
RDB_object * | Duro_lookup_var (const char *name, Duro_interp *interp, RDB_exec_context *ecp) |
RDB_object * | Duro_lookup_sym (const char *name, Duro_interp *interp, int *flagsp, RDB_exec_context *ecp) |
int | Duro_dt_put_creop_info (Duro_interp *interp, const char *lang, Duro_uop_info *infop, RDB_exec_context *ecp) |
Duro_uop_info * | Duro_dt_get_creop_info (const Duro_interp *interp, const char *lang) |
#include <dli/iinterp.h>
void Duro_destroy_interp | ( | Duro_interp * | interp | ) |
Release resources allocated during interpreter initialization. If a database environment is connected it will be closed.
References RDB_close_env(), RDB_destroy_exec_context(), RDB_destroy_obj(), RDB_free(), and RDB_init_exec_context().
int Duro_dt_execute | ( | FILE * | infp, |
Duro_interp * | interp, | ||
RDB_exec_context * | ecp | ||
) |
Read statements from input stream *infp and execute them. If the input is a terminal, a function for reading lines must be provided using RDB_parse_set_read_line_fn().
References Duro_println_error(), RDB_bool_to_obj(), RDB_clear_err(), RDB_ec_set_property(), RDB_free(), RDB_get_err(), and RDB_init_obj().
int Duro_dt_execute_path | ( | const char * | path, |
Duro_interp * | interp, | ||
RDB_exec_context * | ecp | ||
) |
Read statements from file given by path and execute them. If path is NULL, read from standard input. If the input is a terminal, a function for reading lines must be provided using RDB_parse_set_read_line_fn().
int Duro_dt_execute_str | ( | const char * | instr, |
Duro_interp * | interp, | ||
RDB_exec_context * | ecp | ||
) |
Read statements from string instr and execute them.
References RDB_ec_set_property(), and RDB_free().
Duro_uop_info* Duro_dt_get_creop_info | ( | const Duro_interp * | interp, |
const char * | lang | ||
) |
Return the information about operator creation that was previously pass to Duro_dt_put_creop_info().
void Duro_dt_interrupt | ( | Duro_interp * | interp | ) |
Make the interpreter raise a system_error. This function may be called from a signal handler.
const char* Duro_dt_prompt | ( | Duro_interp * | interp | ) |
Return a pointer to the interp->prompt that is used in interactive mode.
References RDB_obj_string().
int Duro_dt_put_creop_info | ( | Duro_interp * | interp, |
const char * | lang, | ||
Duro_uop_info * | infop, | ||
RDB_exec_context * | ecp | ||
) |
Specifies how to create a user-defined operator implemented in the language given by argument lang.
If the interpreter encounters a statement of the form
OPERATOR <opname> ( <parameters> ) RETURNS <type> EXTERN '<lang>' '<external_ref>'; END OPERATOR;
it will call RDB_create_ro_op() with arguments libname and symname set to infop->libname and info->ro_op_symname, respectively.
If the interpreter encounters a statement of the form
OPERATOR <opname> ( <parameters> ) UPDATES { <update parameters> } EXTERN '<lang>' '<external_ref>'; END OPERATOR;
it will call RDB_create_update_op() with arguments libname and symname set to infop->libname and info->update_op_symname, respectively.
References RDB_errno_to_error().
int Duro_init_interp | ( | Duro_interp * | interp, |
RDB_exec_context * | ecp, | ||
RDB_environment * | envp, | ||
const char * | dbname | ||
) |
Initialize the interpreter.
References RDB_alloc(), RDB_bool_to_obj(), RDB_destroy_obj(), RDB_init_obj(), RDB_string_to_obj(), RDB_parameter::typ, and RDB_parameter::update.
RDB_object* Duro_lookup_sym | ( | const char * | name, |
Duro_interp * | interp, | ||
int * | flagsp, | ||
RDB_exec_context * | ecp | ||
) |
Looks up a variable or constant and returns a pointer to the RDB_object containing its value.
Referenced by Duro_lookup_var().
RDB_object* Duro_lookup_var | ( | const char * | name, |
Duro_interp * | interp, | ||
RDB_exec_context * | ecp | ||
) |
Looks up a variable and returns a pointer to the RDB_object containing its value.
References Duro_lookup_sym().
void Duro_print_error_f | ( | const RDB_object * | errobjp, |
FILE * | f | ||
) |
Print an error to an output stream.
References RDB_destroy_exec_context(), RDB_destroy_obj(), RDB_init_exec_context(), RDB_init_obj(), RDB_obj_property(), RDB_obj_string(), RDB_obj_type(), and RDB_type_name().
Referenced by Duro_println_error().
void Duro_println_error | ( | const RDB_object * | errobjp | ) |
Print an error to stderr, followed by a newline.
References Duro_print_error_f().
Referenced by Duro_dt_execute().