extern CAMLprim value ocaml_augeas_save (value tv);
extern CAMLprim value ocaml_augeas_load (value tv);
extern CAMLprim value ocaml_augeas_set (value tv, value pathv, value valuev);
+extern CAMLprim value ocaml_augeas_setm (value tv, value basev, value subv, value valv);
extern CAMLprim value ocaml_augeas_transform (value tv, value lensv, value filev, value modev);
extern CAMLprim value ocaml_augeas_source (value tv, value pathv)
#ifndef HAVE_AUG_SOURCE
CAMLreturn (Val_unit);
}
+/* val setm : t -> path -> string option -> value option -> int */
+CAMLprim value
+ocaml_augeas_setm (value tv, value basev, value subv, value valv)
+{
+ CAMLparam4 (tv, basev, subv, valv);
+ augeas_t t = Augeas_t_val (tv);
+ const char *base = String_val (basev);
+ const char *sub = Optstring_val (subv);
+ const char *val = Optstring_val (valv);
+ int r;
+
+ r = aug_setm (t, base, sub, val);
+ if (r == -1)
+ raise_error (t, "Augeas.setm");
+
+ CAMLreturn (Val_int (r));
+}
+
/* val transform : t -> string -> string -> transform_mode -> unit */
CAMLprim value
ocaml_augeas_transform (value tv, value lensv, value filev, value modev)
= "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
val set : t -> path -> value option -> unit
(** [set t path] sets [value] as new value at [path]. *)
+val setm : t -> path -> string option -> value option -> int
+ (** [setm t base sub value] sets [value] as new value for all the
+ nodes under [base] that match [sub] (or all, if [sub] is
+ [None]).
+
+ Returns the number of nodes modified. *)
+
val transform : t -> string -> string -> transform_mode -> unit
(** [transform t lens file mode] adds or removes (depending on
[mode]) the transformation of the specified [lens] for [file]. *)