Explicit types in the generator.
[wrappi.git] / generator-lib / wrappi_types.ml
index 7c3dfde..957d479 100644 (file)
@@ -20,7 +20,13 @@ open Camlp4.PreCast
 
 open Printf
 
-type any_type = TInt32 | TInt64 | Type of string
+type any_type =
+  | TFilePerm
+  | TInt32
+  | TInt64
+  | TPathname
+  | TUInt32
+  | TUInt64
 
 type parameter = string * any_type
 
@@ -29,17 +35,24 @@ type return_type = RErr | Return of any_type
 type c_code = string
 
 type entry_point = {
-  (*ep_loc : Camlp4.PreCast.Loc.t;*)
+  ep_loc : Camlp4.PreCast.Loc.t;
   ep_name : string;
   ep_params : parameter list;
   ep_return : return_type;
   ep_code : c_code option;
 }
 
+type api = {
+  api_entry_points : entry_point list;
+}
+
 let string_of_any_type = function
+  | TFilePerm -> "fileperm"
   | TInt32 -> "int32"
   | TInt64 -> "int64"
-  | Type s -> s
+  | TPathname -> "pathname"
+  | TUInt32 -> "uint32"
+  | TUInt64 -> "uint64"
 let string_of_return_type = function
   | RErr -> "err"
   | Return t -> string_of_any_type t