X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=augeas.ml;h=a2d345d7a08a3b0c924ac6c01e275181ea7b39c7;hb=8e1cf339a7d6deae00e668da01ee2bce3031b6cc;hp=b7e1c582b289637ee495572fa61368e1ce386d69;hpb=d92842594f602cc60b199b7377862a10798dbb7a;p=ocaml-augeas.git diff --git a/augeas.ml b/augeas.ml index b7e1c58..a2d345d 100644 --- a/augeas.ml +++ b/augeas.ml @@ -20,12 +20,35 @@ type t -exception Error of string - type flag = | AugSaveBackup | AugSaveNewFile | AugTypeCheck + | AugNoStdinc + | AugSaveNoop + | AugNoLoad + +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 @@ -45,8 +68,18 @@ external rm : t -> path -> int = "ocaml_augeas_rm" external matches : t -> path -> path list = "ocaml_augeas_match" +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 set : t -> path -> value option -> unit + = "ocaml_augeas_set" +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, "", "", ""))