summaryrefslogtreecommitdiff
path: root/lib/ocaml_rts/linksem/endianness.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ocaml_rts/linksem/endianness.ml')
-rw-r--r--lib/ocaml_rts/linksem/endianness.ml35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/ocaml_rts/linksem/endianness.ml b/lib/ocaml_rts/linksem/endianness.ml
new file mode 100644
index 00000000..2821fc6a
--- /dev/null
+++ b/lib/ocaml_rts/linksem/endianness.ml
@@ -0,0 +1,35 @@
+(*Generated by Lem from endianness.lem.*)
+(** [endian.lem] defines a type for describing the endianness of an ELF file,
+ * and functions and other operations over that type.
+ *)
+
+open Lem_string
+open Show
+
+(** Type [endianness] describes the endianness of an ELF file. This is deduced from
+ * the first few bytes (magic number, etc.) of the ELF header.
+ *)
+type endianness
+ = Big (* Big endian *)
+ | Little (* Little endian *)
+
+(** [default_endianness] is a default endianness to use when reading in the ELF header
+ * before we have deduced from its entries what the rest of the file is encoded
+ * with.
+ *)
+(*val default_endianness : endianness*)
+let default_endianness:endianness= Little
+
+(** [string_of_endianness e] produces a string representation of the [endianness] value
+ * [e].
+ *)
+(*val string_of_endianness : endianness -> string*)
+let string_of_endianness e:string=
+ ((match e with
+ | Big -> "Big"
+ | Little -> "Little"
+ ))
+
+let instance_Show_Show_Endianness_endianness_dict:(endianness)show_class= ({
+
+ show_method = string_of_endianness})