extern CAMLprim value ocaml_augeas_get (value tv, value pathv);
extern CAMLprim value ocaml_augeas_exists (value tv, value pathv);
extern CAMLprim value ocaml_augeas_insert (value tv, value beforev, value pathv, value labelv);
+extern CAMLprim value ocaml_augeas_mv (value tv, value srcv, value destv);
extern CAMLprim value ocaml_augeas_rm (value tv, value pathv);
extern CAMLprim value ocaml_augeas_match (value tv, value pathv);
extern CAMLprim value ocaml_augeas_count_matches (value tv, value pathv);
CAMLreturn (Val_unit);
}
+/* val mv : t -> path -> path -> unit */
+CAMLprim value
+ocaml_augeas_mv (value tv, value srcv, value destv)
+{
+ CAMLparam3 (tv, srcv, destv);
+ augeas_t t = Augeas_t_val (tv);
+ const char *src = String_val (srcv);
+ const char *dest = String_val (destv);
+
+ if (aug_mv (t, src, dest) == -1)
+ raise_error (t, "Augeas.mv");
+
+ CAMLreturn (Val_unit);
+}
+
/* val rm : t -> path -> int */
CAMLprim value
ocaml_augeas_rm (value tv, value pathv)
= "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 transform : t -> string -> string -> transform_mode -> unit
(** [matches t path] returns a list of path expressions
of all nodes matching [path]. *)
+val mv : t -> path -> path -> unit
+ (** [mv t src dest] moves a node. *)
+
val count_matches : t -> path -> int
(** [count_matches t path] counts the number of nodes matching
[path] but does not return them (see {!matches}). *)