module Pdfio:sig
..end
type
input = {
|
pos_in : |
|
seek_in : |
|
input_char : |
|
input_byte : |
|
in_channel_length : |
|
set_offset : |
|
caml_channel : |
|
source : |
pos_in ()
will give the current position (i.e the index of the next byte to be read) in the range zero to the length of the channel minus one.seek_in x
moves to a given position.input_char ()
returns None if end of input, or the next byte of the input as a character.input_byte ()
returns the next byte as an integer, or Pdfio.no_more
in case of end of input. in_channel_length
is the length of the channel.set_offset
shifts the channel so permissions run from offset to channel_length + offset - 1 instead of 0 to channel_length - 1.caml_channel
is the underlying OCaml channel (if any) of the input.source
is a string used to inficate the original source of the data, for debugging purposes.type
output = {
|
pos_out : |
|
seek_out : |
|
output_char : |
|
output_byte : |
|
output_string : |
|
out_caml_channel : |
|
out_channel_length : |
pos_out ()
gives the position of the next byte to be writtenseek_out x
moves to a a given position in the outputoutput_char
writes a given character as the next byteoutput_byte
writes an integer between 0 and 255 as the next byteoutput_string
writes a string as a sequence of bytesout_caml_channel
holds the OCaml channel this output is based on, if anyout_channel_length ()
gives the current length of the output channelval no_more : int
type
bytes
val input_of_channel : ?source:string -> Pervasives.in_channel -> input
val input_of_bytes : ?source:string -> bytes -> input
val input_of_string : ?source:string -> string -> input
val output_of_channel : Pervasives.out_channel -> output
bytes
val input_output_of_bytes : int -> output * bytes Pervasives.ref
val extract_bytes_from_input_output : output -> bytes Pervasives.ref -> bytes
val nudge : input -> unit
val rewind : input -> unit
val peek_char : input -> char option
val peek_byte : input -> int
Pdfio.no_more
for end of file.val read_char_back : input -> char option
val read_line : input -> string
Pervasives.read_line
.val read_lines : input -> string list
Pervasives.read_line
.val mkbytes : int -> bytes
val bytes_size : bytes -> int
val fillbytes : int -> bytes -> unit
val print_bytes : bytes -> unit
val bget : bytes -> int -> int
val bget_unsafe : bytes -> int -> int
bget
, but with no range checkingval getinit : output -> bytes -> int -> int -> unit
getinit f s o l
calls f on each s within o...l - 1val bset : bytes -> int -> int -> unit
bset s n v
sets the value n at position v in bytesval bset_unsafe : bytes -> int -> int -> unit
bset
but with no range checkingval setinit : input -> bytes -> int -> int -> unit
setinit f s o l
sets s o...o + l - 1 to values generated by fval bytes_of_string : string -> bytes
val bytes_of_list : int list -> bytes
val bytes_of_charlist : char list -> bytes
val bytes_of_arraylist : int array list -> bytes
val bytes_of_int_array : int array -> bytes
val int_array_of_bytes : bytes -> int array
val int_array_of_string : string -> int array
val string_of_int_arrays : int array list -> string
val string_of_int_array : int array -> string
val bytes_selfmap : (int -> int) -> bytes -> unit
val string_of_bytes : bytes -> string
String.max_length
.val charlist_of_bytes : bytes -> char list
val copybytes : bytes -> bytes
val bytes_to_output_channel : Pervasives.out_channel -> bytes -> unit
val bytes_of_input_channel : Pervasives.in_channel -> bytes
type
bitstream
val bitbytes_of_input : input -> bitstream
type
bitstream_position
val bitstream_pos : bitstream -> bitstream_position
val bitstream_seek : bitstream -> bitstream_position -> unit
val getbit : bitstream -> bool
val getbitint : bitstream -> int
val align : bitstream -> unit
val getval_32 : bitstream -> int -> int32
val getval_31 : bitstream -> int -> int
type
bitstream_write
val make_write_bitstream : unit -> bitstream_write
val putbit : bitstream_write -> int -> unit
val putval : bitstream_write -> int -> int32 -> unit
int32
) containing the given number of
useful bits into a bitstreamval align_write : bitstream_write -> unit
val write_bitstream_append_aligned : bitstream_write -> bitstream_write -> bitstream_write
val bytes_of_write_bitstream : bitstream_write -> bytes
val debug_next_n_chars : int -> input -> unit
n
chars to standard output and then rewind back