How to write a libvrmldb backend
Create a subdirectory under db-interfaces/[interface
name]
Add prototype and implementation for required data
access functions. These are
-
int [interface]_init : Initialize the
backend. Store any persistent data in the DB_Instance_Data.connection_information
data member.
-
void [interface]_close : Closes the backend
and frees any memory allocated in DB_Instance_Data.connection_information
-
int [interface]_num_fields : Returns the number
of fields in the relation
-
int [interface]_num_tuples : Returns the number
of tuples/rows in the relation
-
char* [interface]_field_name : Given a
field number return that field's name
-
char* [interface]_get_value : Given a field
number and tuple return the fields value as a string
-
int [interface]_is_null : Given a field number
and tuple return 0 if the field is NULL, else return 1
During intialization of libvrmldb, set DATA_ACCESS_FNXS
to point to your new interface routines.
Of course working code is the best example
so I suggest you look at the db-interfaces/postgres/vrml-postgres.* files
and the sample application.