-type any_type =
- | TFilePerm
- | TInt32
- | TInt64
- | TPathname
- | TUInt32
- | TUInt64
-(** Any API parameter or return type. *)
-
-type parameter = string * any_type
-(** API parameter (argument name and type). *)
-
-type return_type = RErr | Return of any_type
-(** API return type. A superset of {!any_type} because we allow the
- special value [RErr] for dealing with errno. *)
+type ptype =
+ | TBool (** Boolean *)
+ | TBuffer (** 8 bit buffer of limited length *)
+ | TEnum of string (** Enumerated type *)
+ | TFile (** arbitrary length file in/out *)
+ | THash of ptype (** Hash of string -> ptype *)
+ | TInt (** Integer: MUST have preconditions *)
+ | TInt32 (** Signed 32 bit integer *)
+ | TInt64 (** Signed 64 bit integer *)
+ | TList of ptype (** List/array of values *)
+ | TNullable of ptype (** NULLable type modifier *)
+ | TString (** String (non-null) *)
+ | TStruct of string (** Struct *)
+ | TTypedef of string (** Typedef (before being resolved) *)
+ | TUInt32 (** Unsigned 32 bit integer *)
+ | TUInt64 (** Unsigned 64 bit integer *)
+ | TUnion of string (** Qualified union *)
+(** API parameter type. *)
+
+type prec
+(** Parameter precondition (XXX not implemented yet). *)
+
+type parameter = string * ptype * prec option
+(** API parameter (argument name, type, optional precondition). *)
+
+type rtype = RVoid | Return of ptype
+(** API return type. A superset of {!ptype} because we allow the
+ special value [RVoid] for functions that don't return any value. *)
+
+type ftype = rtype * parameter list * parameter list
+(** A function type. Return type, list of required parameters, list
+ of optional parameters. *)