File: bytesections.mli

package info (click to toggle)
jocaml 3.12.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 16,740 kB
  • sloc: ml: 107,815; ansic: 36,537; sh: 5,467; asm: 5,359; lisp: 4,041; makefile: 2,527; perl: 45; fortran: 21; sed: 19; cs: 9; tcl: 2
file content (54 lines) | stat: -rw-r--r-- 2,369 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
(***********************************************************************)
(*                                                                     *)
(*                           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: bytesections.mli 7192 2005-10-27 09:14:16Z maranget $ *)

(* 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 read_section_string: in_channel -> string -> string
    (* Return the contents of a section, as a string *)

val read_section_struct: in_channel -> string -> 'a
    (* Return the contents of a section, as marshalled data *)

val pos_first_section: in_channel -> int
   (* Return the position of the beginning of the first section *)