sig
type unichar = int
type unistring = Glib.unichar array
exception GError of string
module Main :
sig
type t
val create : bool -> Glib.Main.t
val iteration : bool -> bool
val pending : unit -> bool
val is_running : Glib.Main.t -> bool
val quit : Glib.Main.t -> unit
val destroy : Glib.Main.t -> unit
type locale_category =
[ `ALL
| `COLLATE
| `CTYPE
| `MESSAGES
| `MONETARY
| `NUMERIC
| `TIME ]
val setlocale : Glib.Main.locale_category -> string option -> string
val wrap_poll_func : unit -> unit
end
val int_of_priority :
[< `DEFAULT | `DEFAULT_IDLE | `HIGH | `HIGH_IDLE | `LOW ] -> int
module Timeout :
sig
type id
val add : ms:int -> callback:(unit -> bool) -> Glib.Timeout.id
val remove : Glib.Timeout.id -> unit
end
module Idle :
sig
type id
val add : ?prio:int -> (unit -> bool) -> Glib.Idle.id
val remove : Glib.Idle.id -> unit
end
module Io :
sig
type channel
type condition = [ `ERR | `HUP | `IN | `NVAL | `OUT | `PRI ]
type id
val channel_of_descr : Unix.file_descr -> Glib.Io.channel
val add_watch :
cond:Glib.Io.condition list ->
callback:(Glib.Io.condition list -> bool) ->
?prio:int -> Glib.Io.channel -> Glib.Io.id
val remove : Glib.Io.id -> unit
val read : Glib.Io.channel -> buf:bytes -> pos:int -> len:int -> int
val read_chars :
Glib.Io.channel -> buf:bytes -> pos:int -> len:int -> int
end
module Message :
sig
type log_level =
[ `CRITICAL
| `DEBUG
| `ERROR
| `FLAG_FATAL
| `FLAG_RECURSION
| `INFO
| `MESSAGE
| `WARNING ]
val log_level :
[< `CRITICAL
| `CUSTOM of int
| `DEBUG
| `ERROR
| `FLAG_FATAL
| `FLAG_RECURSION
| `INFO
| `MESSAGE
| `WARNING ] ->
int
type log_handler
val set_log_handler :
?domain:string ->
levels:Glib.Message.log_level list ->
(level:int -> string -> unit) -> Glib.Message.log_handler
val remove_log_handler : Glib.Message.log_handler -> unit
val set_always_fatal : Glib.Message.log_level list -> unit
val set_fatal_mask :
?domain:string ->
[ `CRITICAL
| `CUSTOM of int
| `DEBUG
| `ERROR
| `FLAG_FATAL
| `FLAG_RECURSION
| `INFO
| `MESSAGE
| `WARNING ] list -> unit
val log :
?domain:string ->
[ `CRITICAL
| `CUSTOM of int
| `DEBUG
| `ERROR
| `FLAG_FATAL
| `FLAG_RECURSION
| `INFO
| `MESSAGE
| `WARNING ] -> ('a, unit, string, unit) Stdlib.format4 -> 'a
end
module Convert :
sig
type error =
NO_CONVERSION
| ILLEGAL_SEQUENCE
| FAILED
| PARTIAL_INPUT
| BAD_URI
| NOT_ABSOLUTE_PATH
exception Error of Glib.Convert.error * string
val convert :
string -> to_codeset:string -> from_codeset:string -> string
val convert_with_fallback :
?fallback:string ->
to_codeset:string -> from_codeset:string -> string -> string
val locale_from_utf8 : string -> string
val locale_to_utf8 : string -> string
val filename_from_utf8 : string -> string
val filename_to_utf8 : string -> string
val filename_from_uri : string -> string option * string
val filename_to_uri : ?hostname:string -> string -> string
val get_charset : unit -> bool * string
end
module Unichar :
sig
val to_lower : Glib.unichar -> Glib.unichar
val to_upper : Glib.unichar -> Glib.unichar
val to_title : Glib.unichar -> Glib.unichar
val digit_value : Glib.unichar -> int
val xdigit_value : Glib.unichar -> int
val validate : Glib.unichar -> bool
val isalnum : Glib.unichar -> bool
val isalpha : Glib.unichar -> bool
val iscntrl : Glib.unichar -> bool
val isdigit : Glib.unichar -> bool
val isgraph : Glib.unichar -> bool
val islower : Glib.unichar -> bool
val isprint : Glib.unichar -> bool
val ispunct : Glib.unichar -> bool
val isspace : Glib.unichar -> bool
val isupper : Glib.unichar -> bool
val isxdigit : Glib.unichar -> bool
val istitle : Glib.unichar -> bool
val isdefined : Glib.unichar -> bool
val iswide : Glib.unichar -> bool
end
module Utf8 :
sig
val validate : string -> bool
val length : string -> int
val from_unichar : Glib.unichar -> string
val from_unistring : Glib.unistring -> string
val to_unichar_validated : string -> pos:int Stdlib.ref -> Glib.unichar
val to_unichar : string -> pos:int Stdlib.ref -> Glib.unichar
val to_unistring : string -> Glib.unistring
val first_char : string -> Glib.unichar
val offset_to_pos : string -> pos:int -> off:int -> int
type normalize_mode =
[ `ALL | `ALL_COMPOSE | `DEFAULT | `DEFAULT_COMPOSE ]
val normalize : string -> Glib.Utf8.normalize_mode -> string
val uppercase : string -> string
val lowercase : string -> string
val casefold : string -> string
val collate : string -> string -> int
val collate_key : string -> string
end
module Markup :
sig
type error =
BAD_UTF8
| EMPTY
| PARSE
| UNKNOWN_ELEMENT
| UNKNOWN_ATTRIBUTE
| INVALID_CONTENT
exception Error of Glib.Markup.error * string
val escape_text : string -> string
end
val get_prgname : unit -> string
val set_prgname : string -> unit
val get_application_name : unit -> string
val set_application_name : string -> unit
val get_user_name : unit -> string
val get_real_name : unit -> string
val get_home_dir : unit -> string option
val get_tmp_dir : unit -> string
val find_program_in_path : string -> string
val getenv : string -> string
val setenv : string -> string -> bool -> unit
val unsetenv : string -> unit
val get_user_cache_dir : unit -> string
val get_user_data_dir : unit -> string
val get_user_config_dir : unit -> string
val get_system_data_dirs : unit -> string list
val get_system_config_dirs : unit -> string list
val usleep : int -> unit
end