talircd/lib/irc/mode.mli

81 lines
1.9 KiB
OCaml

(*
User Modes:
+i Invisible User Mode
+o Oper User Mode
+w WALLOPS User Mode
Channel Modes:
Type A:
+b Ban Channel Mode
Type B:
+k Key Channel Mode
+o Operator Channel Membership Prefix (@)
+v Voice Channel Membership Prefix (+)
Type C:
+l Client Limit Channel Mode
Type D:
+i Invite-Only Channel Mode
+m Moderated Channel Mode
+n No External Messages Mode
+s Secret Channel Mode
+t Protected Topic Channel Mode
*)
type user = [`i | `o | `w]
type chan_a = [`b]
type chan_b = [`k | `o | `v]
type chan_c = [`l]
type chan_d = [`i | `m | `s | `t | `n]
type chan = [chan_a | chan_b | chan_c | chan_d]
type t = [user | chan]
val pp : Format.formatter -> [< t] -> unit
val to_char : [< t] -> char
val of_char_user : char -> [> user]
val of_char_chan : char -> [> chan]
module Set : sig
type t
type elt = [user | chan_d]
val empty : t
val singleton : [< elt] -> t
val mem : [< elt] -> t -> bool
val add : [< elt] -> t -> t
val remove : [< elt] -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val diff : t -> t -> t
val equal : t -> t -> bool
val pp : Format.formatter -> t -> unit
val to_string : t -> string
val of_string : string -> t
(* val to_list : t -> elt list *)
(* val of_list : [< elt] list -> t *)
end
module Parse : sig
exception Error
type user_mode_set = {
add : Set.t;
rem : Set.t;
}
val pp_user_mode_set : Format.formatter -> user_mode_set -> unit
val user : string -> user_mode_set
(* type ('a, 'b) add_rem = Add of 'a | Rem of 'b *)
(* type chan_mode_set = *)
(* | A of chan_a * (string, string option) add_rem *)
(* | B of chan_b * (string, string) add_rem *)
(* | C of chan_c * (string, unit) add_rem *)
(* | D of chan_d * (unit, unit) add_rem *)
(* val chan : string -> chan_mode_set list *)
end