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;
| 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
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)