| RString _ -> pr "%s" string
| RStringList _ -> pr "[%s]" string
| RStruct (_, typ) ->
- let name = java_name_of_struct typ in
+ let name = camel_name_of_struct typ in
pr "%s" name
| RStructList (_, typ) ->
- let name = java_name_of_struct typ in
+ let name = camel_name_of_struct typ in
pr "[%s]" name
| RHashtable _ -> pr "Hashtable"
| RBufferOut _ -> pr "%s" string
| RBufferOut _ -> pr "String ";
| RStringList _ -> pr "String[] ";
| RStruct (_, typ) ->
- let name = java_name_of_struct typ in
+ let name = camel_name_of_struct typ in
pr "%s " name;
| RStructList (_, typ) ->
- let name = java_name_of_struct typ in
+ let name = camel_name_of_struct typ in
pr "%s[] " name;
| RHashtable _ ->
if not native then
pr " free (r);\n";
pr " return jr;\n"
| RStruct (_, typ) ->
- let jtyp = java_name_of_struct typ in
+ let jtyp = camel_name_of_struct typ in
let cols = cols_of_struct typ in
generate_java_struct_return typ jtyp cols
| RStructList (_, typ) ->
- let jtyp = java_name_of_struct typ in
+ let jtyp = camel_name_of_struct typ in
let cols = cols_of_struct typ in
generate_java_struct_list_return typ jtyp cols
| RBufferOut _ ->
List.iter (
fun (typ, jtyp) ->
pr "\tcom/redhat/et/libguestfs/%s.java \\\n" jtyp;
- ) java_structs;
+ ) camel_structs;
pr "\tcom/redhat/et/libguestfs/GuestFS.java\n"
let cols = cols_of_struct typ in
let filename = sprintf "java/com/redhat/et/libguestfs/%s.java" jtyp in
output_to filename (generate_java_struct jtyp cols);
- ) java_structs;
+ ) camel_structs;
output_to "java/Makefile.inc" generate_java_makefile_inc;
output_to "java/com_redhat_et_libguestfs_GuestFS.c" generate_java_c;
];
] (* end of structs *)
-(* Ugh, Java has to be different ..
- * These names are also used by the Haskell bindings.
- *)
-let java_structs = [
+(* For bindings which want camel case *)
+let camel_structs = [
"int_bool", "IntBool";
"lvm_pv", "PV";
"lvm_vg", "VG";
"application", "Application";
]
-let java_name_of_struct typ =
- try List.assoc typ java_structs
+let camel_name_of_struct typ =
+ try List.assoc typ camel_structs
with Not_found ->
failwithf
- "java_name_of_struct: no java_structs entry corresponding to %s" typ
+ "camel_name_of_struct: no camel_structs entry corresponding to %s" typ
let cols_of_struct typ =
try List.assoc typ structs
val structs : (string * cols) list
(** List of structures. *)
-val java_structs : (string * string) list
-(** Of course, Java has to be different from everyone else. *)
+val camel_structs : (string * string) list
+(** For bindings which want camel case struct names *)
val lvm_pv_cols : cols
val lvm_vg_cols : cols
used to generate code for parsing the output of commands like
[lvs]. One day replace this with liblvm API calls. *)
-val java_name_of_struct : string -> string
-(** Extract Java name of struct. *)
+val camel_name_of_struct : string -> string
+(** Camel case name of struct. *)
val cols_of_struct : string -> cols
(** Extract columns of a struct. *)