X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=augeas.ml;h=006b76b44accc2c897b04e5610c4be7f90b2332b;hb=775f9763a4ff5422fca837c2fb213273adb772c9;hp=40833b286458f89a37d9da51f5e4d815f74aa2e6;hpb=e078b8d80273f7b1df94b4acc2eca2f6f44a0a66;p=ocaml-augeas.git diff --git a/augeas.ml b/augeas.ml index 40833b2..006b76b 100644 --- a/augeas.ml +++ b/augeas.ml @@ -20,12 +20,39 @@ type t -exception Error of string - type flag = | AugSaveBackup | AugSaveNewFile | AugTypeCheck + | AugNoStdinc + | AugSaveNoop + | AugNoLoad + | AugNoModlAutoload + | AugEnableSpan + | AugNoErrClose + | AugTraceModuleLoading + +type error_code = + | AugErrInternal + | AugErrPathX + | AugErrNoMatch + | AugErrMMatch + | AugErrSyntax + | AugErrNoLens + | AugErrMXfm + | AugErrNoSpan + | AugErrMvDesc + | AugErrCmdRun + | AugErrBadArg + | AugErrLabel + | AugErrCpDesc + | AugErrUnknown of int + +type transform_mode = + | Include + | Exclude + +exception Error of error_code * string * string * string type path = string @@ -35,12 +62,18 @@ external create : string -> string option -> flag list -> t = "ocaml_augeas_create" external close : t -> unit = "ocaml_augeas_close" +external defnode : t -> string -> string -> string option -> int * bool + = "ocaml_augeas_defnode" +external defvar : t -> string -> string option -> int option + = "ocaml_augeas_defvar" external get : t -> path -> value option = "ocaml_augeas_get" external exists : t -> path -> bool = "ocaml_augeas_exists" external insert : t -> ?before:bool -> path -> string -> unit = "ocaml_augeas_insert" +external label : t -> path -> string option + = "ocaml_augeas_label" external rm : t -> path -> int = "ocaml_augeas_rm" external matches : t -> path -> path list @@ -49,6 +82,18 @@ external count_matches : t -> path -> int = "ocaml_augeas_count_matches" external save : t -> unit = "ocaml_augeas_save" +external load : t -> unit + = "ocaml_augeas_load" +external mv : t -> path -> path -> unit + = "ocaml_augeas_mv" +external set : t -> path -> value option -> unit + = "ocaml_augeas_set" +external setm : t -> path -> string option -> value option -> int + = "ocaml_augeas_setm" +external transform : t -> string -> string -> transform_mode -> unit + = "ocaml_augeas_transform" +external source : t -> path -> path option + = "ocaml_augeas_source" let () = - Callback.register_exception "Augeas.Error" (Error "") + Callback.register_exception "Augeas.Error" (Error (AugErrInternal, "", "", ""))