Module Bytesections
module Name : sig ... endRecording sections written to a bytecode executable file
val init_record : Stdlib.out_channel -> Bytesections.toc_writerStart recording sections from the current position in out_channel
val record : Bytesections.toc_writer -> Bytesections.Name.t -> unitRecord the current position in the out_channel as the end of the section with the given name.
val write_toc_and_trailer : Bytesections.toc_writer -> unitWrite the table of contents and the standard trailer for bytecode executable files
Reading sections from a bytecode executable file
type section_entry = {name : Bytesections.Name.t;(*name of the section.
*)pos : int;(*byte offset at which the section starts.
*)len : int;(*length of the section.
*)
}val read_toc : Stdlib.in_channel -> Bytesections.section_tableRead the table of sections from a bytecode executable. Raise Bad_magic_number if magic number doesn't match
val seek_section :
Bytesections.section_table ->
Stdlib.in_channel ->
Bytesections.Name.t ->
intPosition 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 :
Bytesections.section_table ->
Stdlib.in_channel ->
Bytesections.Name.t ->
stringReturn the contents of a section, as a string.
val read_section_struct :
Bytesections.section_table ->
Stdlib.in_channel ->
Bytesections.Name.t ->
'aReturn the contents of a section, as marshalled data.
val all : Bytesections.section_table -> Bytesections.section_entry listReturns all section_entry from a section_table in increasing position order.
val pos_first_section : Bytesections.section_table -> intReturn the position of the beginning of the first section