X-Git-Url: http://git.annexia.org/?p=ocaml-augeas.git;a=blobdiff_plain;f=augeas.ml;h=e9dd26a6027b055dc6ed2883b5f1a9037b9dffe4;hp=f556df0f12905f02984d5a3d105be5d48609a754;hb=d34f7efe4e4fa9ee0a2a05ebad5ad73dbb390373;hpb=3c2a975fdd1314729c6d7b591344ef1ac80c65a8 diff --git a/augeas.ml b/augeas.ml index f556df0..e9dd26a 100644 --- a/augeas.ml +++ b/augeas.ml @@ -20,8 +20,6 @@ type t -exception Error of string - type flag = | AugSaveBackup | AugSaveNewFile @@ -29,6 +27,32 @@ type flag = | 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 @@ -38,6 +62,10 @@ 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 @@ -54,6 +82,12 @@ 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, "", "", ""))