Add an optional argument: `?(copyright = "Red Hat")`, to
`generate_header` in generator/utils.ml and generator/utils.mli.
Makes it possible for authors to license generated code under their
own name or organization.
---
generator/utils.ml | 5 +++--
generator/utils.mli | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/generator/utils.ml b/generator/utils.ml
index 13d8029..da687eb 100644
--- a/generator/utils.ml
+++ b/generator/utils.ml
@@ -365,7 +365,8 @@ type comment_style =
| CStyle | CPlusPlusStyle | HashStyle | OCamlStyle | HaskellStyle
| PODCommentStyle
-let generate_header ?(extra_sources = []) comment_style =
+let generate_header ?(extra_sources = []) ?(copyright = "Red Hat")
+ comment_style =
let inputs = "generator/generator" :: extra_sources in
let c = match comment_style with
| CStyle -> pr "/* "; " *"
@@ -379,7 +380,7 @@ let generate_header ?(extra_sources = []) comment_style =
pr "%s %s\n" c (String.concat " " inputs);
pr "%s ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.\n" c;
pr "%s\n" c;
- pr "%s Copyright Red Hat\n" c;
+ pr "%s Copyright %s\n" c copyright;
pr "%s\n" c;
pr "%s This library is free software; you can redistribute it and/or\n" c;
pr "%s modify it under the terms of the GNU Lesser General Public\n" c;
diff --git a/generator/utils.mli b/generator/utils.mli
index 24d25f8..3df69a5 100644
--- a/generator/utils.mli
+++ b/generator/utils.mli
@@ -48,7 +48,8 @@ val quote : string -> string
val spaces : int -> string
val files_equal : string -> string -> bool
-val generate_header : ?extra_sources:string list -> comment_style -> unit
+val generate_header :
+ ?extra_sources:string list -> ?copyright:string -> comment_style -> unit
(** Type of code formatter. *)
type formatter =
--
2.41.0