CAMLreturn (Val_unit);
}
+
+/* val set : t -> -> path -> value option -> unit */
+CAMLprim value
+ocaml_augeas_set (value tv, value pathv, value valuev)
+{
+ CAMLparam3 (tv, pathv, valuev);
+ augeas_t t = Augeas_t_val (tv);
+ const char *path = String_val (pathv);
+ const char *val;
+
+ val =
+ valuev == Val_int (0)
+ ? NULL
+ : String_val (Field (valuev, 0));
+
+ if (aug_set (t, path, val) == -1)
+ raise_error (t, "Augeas.set");
+
+ CAMLreturn (Val_unit);
+}
= "ocaml_augeas_save"
external load : t -> unit
= "ocaml_augeas_load"
+external set : t -> path -> value option -> unit
+ = "ocaml_augeas_set"
let () =
Callback.register_exception "Augeas.Error" (Error (AugErrInternal, "", "", ""))
val load : t -> unit
(** [load t] loads files into the tree. *)
+
+val set : t -> path -> value option -> unit
+ (** [set t path] sets [value] as new value at [path]. *)