More implementation.
[wrappi.git] / generator-lib / wrappi_types.ml
index f738f95..998e911 100644 (file)
@@ -44,11 +44,14 @@ type prec
 
 type parameter = string * ptype * prec option
 
-type rtype = RVoid | Return of ptype
+type rtype = RVoid | RStaticString | Return of ptype
 
 type ftype = rtype * parameter list * parameter list
 
-type c_code = string
+type c_code = {
+  cc_loc : Camlp4.PreCast.Loc.t;
+  cc_code : string;
+}
 
 type entry_point = {
   ep_loc : Camlp4.PreCast.Loc.t;
@@ -124,6 +127,7 @@ let rec string_of_ptype = function
   | TUnion name -> sprintf "union %s" name
 let string_of_rtype = function
   | RVoid -> "void"
+  | RStaticString -> "static_string"
   | Return t -> string_of_ptype t
 let string_of_parameter (name, t, _) =
   sprintf "%s %s" (string_of_ptype t) name
@@ -132,7 +136,7 @@ let string_of_parameters params =
 let string_of_ftype (ret, req, opt) =
   sprintf "%s %s %s"
     (string_of_rtype ret) (string_of_parameters req) (string_of_parameters opt)
-let string_of_c_code code = code
+let string_of_c_code code = code.cc_code
 
 let string_of_typedef td =
   sprintf "typedef %s %s" td.td_name (string_of_ptype td.td_type)