package genspio

  1. Overview
  2. Docs
type c_string =
  1. | C_string
type byte_array =
  1. | Byte_Array
module Literal : sig ... end
type fd_redirection = {
  1. take : int t;
  2. redirect_to : [ `Path of c_string t | `Fd of int t ];
}
and _ t =
  1. | Exec : c_string t list -> unit t
  2. | Raw_cmd : string -> 'a t
  3. | Bool_operator : bool t * [ `And | `Or ] * bool t -> bool t
  4. | String_operator : byte_array t * [ `Eq | `Neq ] * byte_array t -> bool t
  5. | Not : bool t -> bool t
  6. | Returns : {
    1. expr : 'a t;
    2. value : int;
    } -> bool t
  7. | No_op : unit t
  8. | If : bool t * unit t * unit t -> unit t
  9. | Seq : unit t list -> unit t
  10. | Literal : 'a Literal.t -> 'a t
  11. | Output_as_string : unit t -> byte_array t
  12. | Redirect_output : unit t * fd_redirection list -> unit t
  13. | Write_output : {
    1. expr : unit t;
    2. stdout : c_string t option;
    3. stderr : c_string t option;
    4. return_value : c_string t option;
    } -> unit t
  14. | Feed : byte_array t * unit t -> unit t
  15. | Pipe : unit t list -> unit t
  16. | While : {
    1. condition : bool t;
    2. body : unit t;
    } -> unit t
  17. | Fail : string -> unit t
  18. | Int_to_string : int t -> c_string t
  19. | String_to_int : c_string t -> int t
  20. | Bool_to_string : bool t -> c_string t
  21. | String_to_bool : c_string t -> bool t
  22. | List_to_string : 'a list t * ('a t -> byte_array t) -> byte_array t
  23. | String_to_list : byte_array t * (byte_array t -> 'a t) -> 'a list t
  24. | List : 'a t list -> 'a list t
  25. | C_string_concat : c_string list t -> c_string t
  26. | Byte_array_concat : byte_array list t -> byte_array t
  27. | List_append : ('a list t * 'a list t) -> 'a list t
  28. | List_iter : 'a list t * ((unit -> 'a t) -> unit t) -> unit t
  29. | Byte_array_to_c_string : byte_array t -> c_string t
  30. | C_string_to_byte_array : c_string t -> byte_array t
  31. | Int_bin_op : int t * [ `Plus | `Minus | `Mult | `Div | `Mod ] * int t -> int t
  32. | Int_bin_comparison : int t * [ `Eq | `Ne | `Gt | `Ge | `Lt | `Le ] * int t -> bool t
  33. | Getenv : c_string t -> c_string t
  34. | Setenv : c_string t * c_string t -> unit t
  35. | Comment : string * 'a t -> 'a t
val pp_in_expr : Format.formatter -> (Format.formatter -> unit -> unit) -> unit
val pp_fun_call : Format.formatter -> string -> (Format.formatter -> 'a -> unit) -> 'a list -> unit
val pp : 'a. Format.formatter -> 'a t -> unit
module Construct : sig ... end
type internal_error_details = {
  1. variable : string;
  2. content : string;
  3. code : string;
}
val pp_internal_error_details : big_string:(Format.formatter -> string -> unit) -> Format.formatter -> internal_error_details -> unit
type death_message =
  1. | User of string
  2. | C_string_failure of internal_error_details
  3. | String_to_int_failure of internal_error_details
val pp_death_message : ?style:[< `Lispy | `User Lispy ] -> big_string:(Format.formatter -> string -> unit) -> Format.formatter -> death_message -> unit
type death_function = comment_stack:string list -> death_message -> string
type output_parameters = {
  1. statement_separator : string;
  2. die_command : death_function option;
  3. max_argument_length : int option;
}
type internal_representation =
  1. | Unit of string
  2. | Octostring of string
  3. | Int of string
  4. | Bool of string
  5. | List of string
  6. | Death of string
val ir_unit : string -> internal_representation
val ir_octostring : string -> internal_representation
val ir_int : string -> internal_representation
val ir_bool : string -> internal_representation
val ir_death : string -> internal_representation
val ir_list : string -> internal_representation
val ir_to_shell : internal_representation -> string
type compilation_error = {
  1. error : [ `No_fail_configured of death_message | `Max_argument_length of string | `Not_a_c_string of string ];
  2. code : string option;
  3. comment_backtrace : string list;
}
exception Compilation of compilation_error
val error : ?code:string -> comment_backtrace:string list -> [ `Max_argument_length of string | `No_fail_configured of death_message | `Not_a_c_string of string ] -> 'a
val pp_error : Format.formatter -> compilation_error -> unit
val to_ir : 'a. string list -> output_parameters -> 'a t -> internal_representation
val to_shell : output_parameters -> 'a t -> string
val with_die_function : print_failure:(comment_stack:'a -> 'b -> string) -> statement_separator:string -> signal_name:string -> ?trap:[< `Exit_with of int | `None Exit_with ] -> (die:(comment_stack:'c -> 'd -> string) -> string) -> string
OCaml

Innovation. Community. Security.