sig
module Lwt_main = Uwt.Main
module Lwt_bytes = Uwt_bytes
module Lwt_process = Uwt_process
module Lwt_throttle = Uwt_throttle
module Lwt_unix :
sig
type file_descr
val to_file_descr :
[ `File of Uwt.file
| `Pipe of Uwt.Pipe.t
| `Tcp of Uwt.Tcp.t
| `Udp of Uwt.Udp.t ] -> Uwt_compat.Lwt_unix.file_descr
val from_file_descr :
Uwt_compat.Lwt_unix.file_descr ->
[ `File of Uwt.file
| `Pipe of Uwt.Pipe.t
| `Tcp of Uwt.Tcp.t
| `Udp of Uwt.Udp.t ]
type dir_handle
type process_status =
Unix.process_status =
WEXITED of int
| WSIGNALED of int
| WSTOPPED of int
type wait_flag = Unix.wait_flag = WNOHANG | WUNTRACED
type file_perm = Unix.file_perm
type open_flag =
Unix.open_flag =
O_RDONLY
| O_WRONLY
| O_RDWR
| O_NONBLOCK
| O_APPEND
| O_CREAT
| O_TRUNC
| O_EXCL
| O_NOCTTY
| O_DSYNC
| O_SYNC
| O_RSYNC
| O_SHARE_DELETE
| O_CLOEXEC
| O_KEEPEXEC
type seek_command = Unix.seek_command = SEEK_SET | SEEK_CUR | SEEK_END
type file_kind = Unix.file_kind
type stats =
Unix.stats = {
st_dev : int;
st_ino : int;
st_kind : Uwt_compat.Lwt_unix.file_kind;
st_perm : Uwt_compat.Lwt_unix.file_perm;
st_nlink : int;
st_uid : int;
st_gid : int;
st_rdev : int;
st_size : int;
st_atime : float;
st_mtime : float;
st_ctime : float;
}
type access_permission =
Unix.access_permission =
R_OK
| W_OK
| X_OK
| F_OK
type inet_addr = Unix.inet_addr
type socket_domain = Unix.socket_domain = PF_UNIX | PF_INET | PF_INET6
type socket_type =
Unix.socket_type =
SOCK_STREAM
| SOCK_DGRAM
| SOCK_RAW
| SOCK_SEQPACKET
type sockaddr =
Unix.sockaddr =
ADDR_UNIX of string
| ADDR_INET of Uwt_compat.Lwt_unix.inet_addr * int
type shutdown_command =
Unix.shutdown_command =
SHUTDOWN_RECEIVE
| SHUTDOWN_SEND
| SHUTDOWN_ALL
type msg_flag = Unix.msg_flag = MSG_OOB | MSG_DONTROUTE | MSG_PEEK
type socket_bool_option =
Unix.socket_bool_option =
SO_DEBUG
| SO_BROADCAST
| SO_REUSEADDR
| SO_KEEPALIVE
| SO_DONTROUTE
| SO_OOBINLINE
| SO_ACCEPTCONN
| TCP_NODELAY
| IPV6_ONLY
type socket_int_option =
Unix.socket_int_option =
SO_SNDBUF
| SO_RCVBUF
| SO_ERROR
| SO_TYPE
| SO_RCVLOWAT
| SO_SNDLOWAT
type socket_optint_option = Unix.socket_optint_option = SO_LINGER
type socket_float_option =
Unix.socket_float_option =
SO_RCVTIMEO
| SO_SNDTIMEO
type host_entry =
Unix.host_entry = {
h_name : string;
h_aliases : string array;
h_addrtype : Uwt_compat.Lwt_unix.socket_domain;
h_addr_list : Uwt_compat.Lwt_unix.inet_addr array;
}
type protocol_entry =
Unix.protocol_entry = {
p_name : string;
p_aliases : string array;
p_proto : int;
}
type service_entry =
Unix.service_entry = {
s_name : string;
s_aliases : string array;
s_port : int;
s_proto : string;
}
type addr_info =
Unix.addr_info = {
ai_family : Uwt_compat.Lwt_unix.socket_domain;
ai_socktype : Uwt_compat.Lwt_unix.socket_type;
ai_protocol : int;
ai_addr : Uwt_compat.Lwt_unix.sockaddr;
ai_canonname : string;
}
type getaddrinfo_option =
Unix.getaddrinfo_option =
AI_FAMILY of Uwt_compat.Lwt_unix.socket_domain
| AI_SOCKTYPE of Uwt_compat.Lwt_unix.socket_type
| AI_PROTOCOL of int
| AI_NUMERICHOST
| AI_CANONNAME
| AI_PASSIVE
type name_info =
Unix.name_info = {
ni_hostname : string;
ni_service : string;
}
type getnameinfo_option =
Unix.getnameinfo_option =
NI_NOFQDN
| NI_NUMERICHOST
| NI_NAMEREQD
| NI_NUMERICSERV
| NI_DGRAM
type terminal_io =
Unix.terminal_io = {
mutable c_ignbrk : bool;
mutable c_brkint : bool;
mutable c_ignpar : bool;
mutable c_parmrk : bool;
mutable c_inpck : bool;
mutable c_istrip : bool;
mutable c_inlcr : bool;
mutable c_igncr : bool;
mutable c_icrnl : bool;
mutable c_ixon : bool;
mutable c_ixoff : bool;
mutable c_opost : bool;
mutable c_obaud : int;
mutable c_ibaud : int;
mutable c_csize : int;
mutable c_cstopb : int;
mutable c_cread : bool;
mutable c_parenb : bool;
mutable c_parodd : bool;
mutable c_hupcl : bool;
mutable c_clocal : bool;
mutable c_isig : bool;
mutable c_icanon : bool;
mutable c_noflsh : bool;
mutable c_echo : bool;
mutable c_echoe : bool;
mutable c_echok : bool;
mutable c_echonl : bool;
mutable c_vintr : char;
mutable c_vquit : char;
mutable c_verase : char;
mutable c_vkill : char;
mutable c_veof : char;
mutable c_veol : char;
mutable c_vmin : int;
mutable c_vtime : int;
mutable c_vstart : char;
mutable c_vstop : char;
}
type setattr_when = Unix.setattr_when = TCSANOW | TCSADRAIN | TCSAFLUSH
type flush_queue = Unix.flush_queue = TCIFLUSH | TCOFLUSH | TCIOFLUSH
val handle_unix_error : ('a -> 'b Lwt.t) -> 'a -> 'b Lwt.t
val sleep : float -> unit Lwt.t
val yield : unit -> unit Lwt.t
val auto_yield : float -> unit -> unit Lwt.t
exception Timeout
val timeout : float -> 'a Lwt.t
val with_timeout : float -> (unit -> 'a Lwt.t) -> 'a Lwt.t
val stdin : Uwt_compat.Lwt_unix.file_descr
val stdout : Uwt_compat.Lwt_unix.file_descr
val stderr : Uwt_compat.Lwt_unix.file_descr
val openfile :
string ->
Unix.open_flag list ->
Uwt_compat.Lwt_unix.file_perm -> Uwt_compat.Lwt_unix.file_descr Lwt.t
val close : Uwt_compat.Lwt_unix.file_descr -> unit Lwt.t
val read :
Uwt_compat.Lwt_unix.file_descr -> bytes -> int -> int -> int Lwt.t
val write :
Uwt_compat.Lwt_unix.file_descr -> bytes -> int -> int -> int Lwt.t
val write_string :
Uwt_compat.Lwt_unix.file_descr -> string -> int -> int -> int Lwt.t
val lseek :
Uwt_compat.Lwt_unix.file_descr ->
int -> Unix.seek_command -> int Lwt.t
val truncate : string -> int -> unit Lwt.t
val ftruncate : Uwt_compat.Lwt_unix.file_descr -> int -> unit Lwt.t
val fsync : Uwt_compat.Lwt_unix.file_descr -> unit Lwt.t
val fdatasync : Uwt_compat.Lwt_unix.file_descr -> unit Lwt.t
val stat : string -> Unix.stats Lwt.t
val lstat : string -> Unix.stats Lwt.t
val fstat : Uwt_compat.Lwt_unix.file_descr -> Unix.stats Lwt.t
val isatty : Uwt_compat.Lwt_unix.file_descr -> bool Lwt.t
val file_exists : string -> bool Lwt.t
module LargeFile :
sig
type stats =
Unix.LargeFile.stats = {
st_dev : int;
st_ino : int;
st_kind : Uwt_compat.Lwt_unix.file_kind;
st_perm : Uwt_compat.Lwt_unix.file_perm;
st_nlink : int;
st_uid : int;
st_gid : int;
st_rdev : int;
st_size : int64;
st_atime : float;
st_mtime : float;
st_ctime : float;
}
val stat : string -> Unix.LargeFile.stats Lwt.t
val lstat : string -> Unix.LargeFile.stats Lwt.t
val fstat :
Uwt_compat.Lwt_unix.file_descr -> Unix.LargeFile.stats Lwt.t
val lseek :
Uwt_compat.Lwt_unix.file_descr ->
int64 -> Unix.seek_command -> int Lwt.t
val truncate : string -> int64 -> unit Lwt.t
val ftruncate :
Uwt_compat.Lwt_unix.file_descr -> int64 -> unit Lwt.t
val file_exists : string -> bool Lwt.t
end
val unlink : string -> unit Lwt.t
val rename : string -> string -> unit Lwt.t
val link : string -> string -> unit Lwt.t
val chmod : string -> Uwt_compat.Lwt_unix.file_perm -> unit Lwt.t
val fchmod :
Uwt_compat.Lwt_unix.file_descr ->
Uwt_compat.Lwt_unix.file_perm -> unit Lwt.t
val chown : string -> int -> int -> unit Lwt.t
val fchown : Uwt_compat.Lwt_unix.file_descr -> int -> int -> unit Lwt.t
val access : string -> Unix.access_permission list -> unit Lwt.t
val mkdir : string -> Uwt_compat.Lwt_unix.file_perm -> unit Lwt.t
val rmdir : string -> unit Lwt.t
val opendir : string -> Uwt_compat.Lwt_unix.dir_handle Lwt.t
val readdir : Uwt_compat.Lwt_unix.dir_handle -> string Lwt.t
val readdir_n :
Uwt_compat.Lwt_unix.dir_handle -> int -> string array Lwt.t
val closedir : Uwt_compat.Lwt_unix.dir_handle -> unit Lwt.t
val files_of_directory : string -> string Lwt_stream.t
val symlink : string -> string -> unit Lwt.t
val readlink : string -> string Lwt.t
val getlogin : unit -> string Lwt.t
val getpwnam : string -> Unix.passwd_entry Lwt.t
val getgrnam : string -> Unix.group_entry Lwt.t
val getpwuid : int -> Unix.passwd_entry Lwt.t
val getgrgid : int -> Unix.group_entry Lwt.t
val chdir : string -> unit Lwt.t
val chroot : string -> unit Lwt.t
val getcwd : unit -> string Lwt.t
val gethostname : unit -> string Lwt.t
val gethostbyname : string -> Unix.host_entry Lwt.t
val gethostbyaddr : Unix.inet_addr -> Unix.host_entry Lwt.t
val getprotobyname : string -> Unix.protocol_entry Lwt.t
val getprotobynumber : int -> Unix.protocol_entry Lwt.t
val getservbyname : string -> string -> Unix.service_entry Lwt.t
val getservbyport : int -> string -> Unix.service_entry Lwt.t
val getaddrinfo :
string ->
string -> Unix.getaddrinfo_option list -> Unix.addr_info list Lwt.t
val getnameinfo :
Unix.sockaddr -> Unix.getnameinfo_option list -> Unix.name_info Lwt.t
val pipe :
unit ->
Uwt_compat.Lwt_unix.file_descr * Uwt_compat.Lwt_unix.file_descr
val pipe_in : unit -> Uwt_compat.Lwt_unix.file_descr * Unix.file_descr
val pipe_out : unit -> Unix.file_descr * Uwt_compat.Lwt_unix.file_descr
val system : string -> Unix.process_status Lwt.t
val utimes : string -> float -> float -> unit Lwt.t
type signal_handler_id
val on_signal :
int -> (int -> unit) -> Uwt_compat.Lwt_unix.signal_handler_id
val on_signal_full :
int ->
(Uwt_compat.Lwt_unix.signal_handler_id -> int -> unit) ->
Uwt_compat.Lwt_unix.signal_handler_id
val disable_signal_handler :
Uwt_compat.Lwt_unix.signal_handler_id -> unit
end
module Lwt_io :
sig
exception Channel_closed of string
type 'mode channel
type input
type output
type 'a mode = Input : input mode | Output : output mode
val input : input mode
val output : output mode
type input_channel = input channel
type output_channel = output channel
val mode : 'a channel -> 'a mode
val stdin : input_channel
val stdout : output_channel
val stderr : output_channel
val zero : input_channel
val null : output_channel
val pipe :
?cloexec:bool ->
?in_buffer:Uwt_bytes.t ->
?out_buffer:Uwt_bytes.t -> unit -> input_channel * output_channel
val make :
?buffer:Uwt_bytes.t ->
?close:(unit -> unit Lwt.t) ->
?seek:(int64 -> Unix.seek_command -> int64 Lwt.t) ->
mode:'mode mode ->
(Uwt_bytes.t -> int -> int -> int Lwt.t) -> 'mode channel
val of_bytes : mode:'mode mode -> Uwt_bytes.t -> 'mode channel
val of_file :
?buffer:Uwt_bytes.t ->
?close:(unit -> unit Lwt.t) -> mode:'m mode -> Uwt.file -> 'm channel
val of_stream :
?buffer:Uwt_bytes.t ->
?close:(unit -> unit Lwt.t) ->
mode:'m mode -> Uwt.Stream.t -> 'm channel
val of_pipe :
?buffer:Uwt_bytes.t ->
?close:(unit -> unit Lwt.t) ->
mode:'m mode -> Uwt.Pipe.t -> 'm channel
val of_tcp :
?buffer:Uwt_bytes.t ->
?close:(unit -> unit Lwt.t) ->
mode:'m mode -> Uwt.Tcp.t -> 'm channel
val close : 'a channel -> unit Lwt.t
val abort : 'a channel -> unit Lwt.t
val atomic : ('a channel -> 'b Lwt.t) -> 'a channel -> 'b Lwt.t
val file_length : string -> int64 Lwt.t
val buffered : 'a channel -> int
val flush : output_channel -> unit Lwt.t
val flush_all : unit -> unit Lwt.t
val buffer_size : 'a channel -> int
val resize_buffer : 'a channel -> int -> unit Lwt.t
val is_busy : 'a channel -> bool
val position : 'a channel -> int64
val set_position : 'a channel -> int64 -> unit Lwt.t
val length : 'a channel -> int64 Lwt.t
val read_char : input_channel -> char Lwt.t
val read_char_opt : input_channel -> char option Lwt.t
val read_chars : input_channel -> char Lwt_stream.t
val read_line : input_channel -> string Lwt.t
val read_line_opt : input_channel -> string option Lwt.t
val read_lines : input_channel -> string Lwt_stream.t
val read : ?count:int -> input_channel -> string Lwt.t
val read_into : input_channel -> Bytes.t -> int -> int -> int Lwt.t
val read_into_exactly :
input_channel -> Bytes.t -> int -> int -> unit Lwt.t
val read_value : input_channel -> 'a Lwt.t
val write_char : output_channel -> char -> unit Lwt.t
val write_chars : output_channel -> char Lwt_stream.t -> unit Lwt.t
val write : output_channel -> string -> unit Lwt.t
val write_line : output_channel -> string -> unit Lwt.t
val write_lines : output_channel -> string Lwt_stream.t -> unit Lwt.t
val write_from : output_channel -> Bytes.t -> int -> int -> int Lwt.t
val write_from_string :
output_channel -> string -> int -> int -> int Lwt.t
val write_from_exactly :
output_channel -> Bytes.t -> int -> int -> unit Lwt.t
val write_from_string_exactly :
output_channel -> string -> int -> int -> unit Lwt.t
val write_value :
output_channel ->
?flags:Marshal.extern_flags list -> 'a -> unit Lwt.t
val fprint : output_channel -> string -> unit Lwt.t
val fprintl : output_channel -> string -> unit Lwt.t
val fprintf :
output_channel -> ('a, unit, string, unit Lwt.t) format4 -> 'a
val fprintlf :
output_channel -> ('a, unit, string, unit Lwt.t) format4 -> 'a
val print : string -> unit Lwt.t
val printl : string -> unit Lwt.t
val printf : ('a, unit, string, unit Lwt.t) format4 -> 'a
val printlf : ('a, unit, string, unit Lwt.t) format4 -> 'a
val eprint : string -> unit Lwt.t
val eprintl : string -> unit Lwt.t
val eprintf : ('a, unit, string, unit Lwt.t) format4 -> 'a
val eprintlf : ('a, unit, string, unit Lwt.t) format4 -> 'a
val hexdump_stream : output_channel -> char Lwt_stream.t -> unit Lwt.t
val hexdump : output_channel -> string -> unit Lwt.t
type file_name = string
val open_connection :
?in_buffer:Uwt_bytes.t ->
?out_buffer:Uwt_bytes.t ->
Unix.sockaddr -> (input_channel * output_channel) Lwt.t
val with_connection :
?in_buffer:Uwt_bytes.t ->
?out_buffer:Uwt_bytes.t ->
Unix.sockaddr ->
(input_channel * output_channel -> 'a Lwt.t) -> 'a Lwt.t
type server
val establish_server_with_client_address :
?buffer_size:int ->
?backlog:int ->
?no_close:bool ->
Unix.sockaddr ->
(Unix.sockaddr -> input_channel * output_channel -> unit Lwt.t) ->
server Lwt.t
val establish_server :
?buffer_size:int ->
?backlog:int ->
?no_close:bool ->
Unix.sockaddr ->
(input_channel * output_channel -> unit Lwt.t) -> server Lwt.t
val shutdown_server : server -> unit Lwt.t
val lines_of_file : file_name -> string Lwt_stream.t
val lines_to_file : file_name -> string Lwt_stream.t -> unit Lwt.t
val chars_of_file : file_name -> char Lwt_stream.t
val chars_to_file : file_name -> char Lwt_stream.t -> unit Lwt.t
module type NumberIO =
sig
val read_int : input_channel -> int Lwt.t
val read_int16 : input_channel -> int Lwt.t
val read_int32 : input_channel -> int32 Lwt.t
val read_int64 : input_channel -> int64 Lwt.t
val read_float32 : input_channel -> float Lwt.t
val read_float64 : input_channel -> float Lwt.t
val write_int : output_channel -> int -> unit Lwt.t
val write_int16 : output_channel -> int -> unit Lwt.t
val write_int32 : output_channel -> int32 -> unit Lwt.t
val write_int64 : output_channel -> int64 -> unit Lwt.t
val write_float32 : output_channel -> float -> unit Lwt.t
val write_float64 : output_channel -> float -> unit Lwt.t
end
module LE : NumberIO
module BE : NumberIO
val read_int : input_channel -> int Lwt.t
val read_int16 : input_channel -> int Lwt.t
val read_int32 : input_channel -> int32 Lwt.t
val read_int64 : input_channel -> int64 Lwt.t
val read_float32 : input_channel -> float Lwt.t
val read_float64 : input_channel -> float Lwt.t
val write_int : output_channel -> int -> unit Lwt.t
val write_int16 : output_channel -> int -> unit Lwt.t
val write_int32 : output_channel -> int32 -> unit Lwt.t
val write_int64 : output_channel -> int64 -> unit Lwt.t
val write_float32 : output_channel -> float -> unit Lwt.t
val write_float64 : output_channel -> float -> unit Lwt.t
type byte_order = Little_endian | Big_endian
val system_byte_order : byte_order
val block :
'a channel -> int -> (Uwt_bytes.t -> int -> 'b Lwt.t) -> 'b Lwt.t
type direct_access = {
da_buffer : Uwt_bytes.t;
mutable da_ptr : int;
mutable da_max : int;
da_perform : unit -> int Lwt.t;
}
val direct_access :
'a channel -> (direct_access -> 'b Lwt.t) -> 'b Lwt.t
val default_buffer_size : unit -> int
val set_default_buffer_size : int -> unit
val open_file :
?buffer:Lwt_bytes.t ->
?flags:Unix.open_flag list ->
?perm:Unix.file_perm -> mode:'a mode -> file_name -> 'a channel Lwt.t
val with_file :
?buffer:Lwt_bytes.t ->
?flags:Unix.open_flag list ->
?perm:Unix.file_perm ->
mode:'a mode -> file_name -> ('a channel -> 'b Lwt.t) -> 'b Lwt.t
val open_temp_file :
?buffer:Lwt_bytes.t ->
?flags:Unix.open_flag list ->
?perm:Unix.file_perm ->
?temp_dir:string ->
?prefix:string -> unit -> (string * output_channel) Lwt.t
val with_temp_file :
?buffer:Lwt_bytes.t ->
?flags:Unix.open_flag list ->
?perm:Unix.file_perm ->
?temp_dir:string ->
?prefix:string -> (string * output_channel -> 'b Lwt.t) -> 'b Lwt.t
end
end