6.3.1 Virtual Functions

Any database handled by guile module is associated with a virtual function table. This table is an association list which supplies to the module the Scheme call-back functions implemented to perform particular tasks on that database. In this list, the car of each element contains the name of a function, and its cdr gives the corresponding function. The defined function names and their semantics are described in the following table:

init

Initialize the module.

done

Close the module, releasing any resources held by it.

open

Open the database.

close

Close the database.

query

Handle a socket map query

xform

Handle a transformation request (see section Transformations).

For example, the following is a valid virtual function table:

 
(list (cons "open" open-module)
      (cons "close" close-module)
      (cons "query" run-query))

Apart from per-database virtual tables, there is also a global virtual function table, which is used to supply the entries missing in the former. Both tables are created during the module initialization, as described in the next subsection.

Particular virtual functions are described in Guile API.