be8300d800a51d138a9f95865962fdeff2f564cb
[virt-top.git] / libvirt / README
1 README
2 ======
3
4 The public interface is described in 'libvirt.mli'.  You may prefer to
5 do 'make doc' at the top level source directory and then read the HTML
6 documentation starting at html/index.html.
7
8 'libvirt.ml' describes how OCaml functions map to C functions.
9
10 'libvirt_c*.c' are the C functions which map OCaml objects to C
11 objects and vice versa (see next section).
12
13 Generated code
14 --------------
15
16 The C bindings in 'libvirt_c.c' are now generated automatically by a
17 Perl script called 'generator.pl'.  You do not normally need to run
18 this script, but you may need to if you want to extend libvirt
19 coverage.
20
21 The majority of the functions are now generated automatically, but
22 there are a few one-off bindings (eg. one-of-a-type functions,
23 functions with particularly complex mappings).  Our eventual aim to is
24 autogenerate as much as possible.  Use 'make autostatus' in this
25 directory to find out how we're doing.
26
27 The generated 'libvirt_c.c' #includes some other C files in this
28 directory:
29
30   #include "libvirt_c_prologue.c"
31
32     A prologue that prototypes some static functions which are defined
33     in the epilogue (see below), and provides some general macros.
34
35   #include "libvirt_c_oneoffs.c"
36
37     One-off bindings: Bindings which are too specialised or one-of-a-kind
38     to be worth generating automatically.
39
40   [Followed by generated bindings, then ...]
41
42   #include "libvirt_c_epilogue.c"
43
44     An epilogue which defines some standard static functions (eg.) for
45     wrapping and unwrapping libvirt objects.
46
47 The key to understanding the generator is to look at the generated
48 code (libvirt_c.c) first, and go from there back to parts of the
49 generator script.