summaryrefslogtreecommitdiffstats
path: root/bytecomp/bytesections.mli
diff options
context:
space:
mode:
Diffstat (limited to 'bytecomp/bytesections.mli')
-rw-r--r--bytecomp/bytesections.mli48
1 files changed, 48 insertions, 0 deletions
diff --git a/bytecomp/bytesections.mli b/bytecomp/bytesections.mli
new file mode 100644
index 000000000..9e1279609
--- /dev/null
+++ b/bytecomp/bytesections.mli
@@ -0,0 +1,48 @@
+(***********************************************************************)
+(* *)
+(* Objective Caml *)
+(* *)
+(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
+(* *)
+(* Copyright 2000 Institut National de Recherche en Informatique et *)
+(* en Automatique. All rights reserved. This file is distributed *)
+(* under the terms of the Q Public License version 1.0. *)
+(* *)
+(***********************************************************************)
+
+(* $Id$ *)
+
+(* Handling of sections in bytecode executable files *)
+
+(** Recording sections written to a bytecode executable file *)
+
+val init_record: out_channel -> unit
+ (* Start recording sections from the current position in out_channel *)
+
+val record: out_channel -> string -> unit
+ (* Record the current position in the out_channel as the end of
+ the section with the given name *)
+
+val write_toc_and_trailer: out_channel -> unit
+ (* Write the table of contents and the standard trailer for bytecode
+ executable files *)
+
+(** Reading sections from a bytecode executable file *)
+
+val read_toc: in_channel -> unit
+ (* Read the table of sections from a bytecode executable *)
+
+exception Bad_magic_number
+ (* Raised by [read_toc] if magic number doesn't match *)
+
+val toc: unit -> (string * int) list
+ (* Return the current table of contents as a list of
+ (section name, section length) pairs. *)
+
+val seek_section: in_channel -> string -> int
+ (* Position the input channel at the beginning of the section named "name",
+ and return the length of that section. Raise Not_found if no
+ such section exists. *)
+
+val pos_first_section: in_channel -> int
+ (* Return the position of the beginning of the first section *)