summaryrefslogtreecommitdiffstats
path: root/generator/structs.mli
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-10-30 11:23:58 +0000
committerRichard W.M. Jones <rjones@redhat.com>2012-10-30 12:32:30 +0000
commiteb185eef2998e7eed1dce6b82e3b4836a3db3ab2 (patch)
tree33f8a15eea9f9aace3d4b5db3b47f2f9c12d1989 /generator/structs.mli
parent72e19deee75317368a211234950fad11b8d381f1 (diff)
downloadlibguestfs-eb185eef2998e7eed1dce6b82e3b4836a3db3ab2.tar.gz
libguestfs-eb185eef2998e7eed1dce6b82e3b4836a3db3ab2.tar.xz
libguestfs-eb185eef2998e7eed1dce6b82e3b4836a3db3ab2.zip
generator: Use an OCaml struct to store the structs.
This just makes it simpler to add extra fields to each struct. This is code motion.
Diffstat (limited to 'generator/structs.mli')
-rw-r--r--generator/structs.mli19
1 files changed, 13 insertions, 6 deletions
diff --git a/generator/structs.mli b/generator/structs.mli
index 56987e0f..f0c2ba65 100644
--- a/generator/structs.mli
+++ b/generator/structs.mli
@@ -23,12 +23,16 @@
type cols = (string * Types.field) list
(** List of structure fields (called "columns"). *)
-val structs : (string * cols) list
+type struc = {
+ s_name : string; (** Regular name. *)
+ s_cols : cols; (** Columns. *)
+ s_camel_name : string; (** Camel-cased name. *)
+ s_unused : unit;
+}
+
+val structs : struc list
(** List of structures. *)
-val camel_structs : (string * string) list
-(** For bindings which want camel case struct names *)
-
val lvm_pv_cols : cols
val lvm_vg_cols : cols
val lvm_lv_cols : cols
@@ -36,8 +40,11 @@ val lvm_lv_cols : cols
used to generate code for parsing the output of commands like
[lvs]. One day replace this with liblvm API calls. *)
+val lookup_struct : string -> struc
+(** Lookup a struct by name. *)
+
val camel_name_of_struct : string -> string
-(** Camel case name of struct. *)
+(** Lookup struct by name, return the s_camel_name field. *)
val cols_of_struct : string -> cols
-(** Extract columns of a struct. *)
+(** Lookup struct by name, return the s_cols field. *)