r = aug_match (t, path, &matches);
if (r == -1)
- raise_error ("Augeas.match");
+ raise_error ("Augeas.matches");
/* Copy the paths to a list. */
rv = Val_int (0);
CAMLreturn (rv);
}
+/* val count_matches : t -> path -> int */
+CAMLprim value
+ocaml_augeas_count_matches (value tv, value pathv)
+{
+ CAMLparam2 (tv, pathv);
+ augeas_t t = Augeas_t_val (tv);
+ char *path = String_val (path);
+ int r;
+
+ r = aug_match (t, path, NULL);
+ if (r == -1)
+ raise_error ("Augeas.count_matches");
+
+ CAMLreturn (Val_int (r));
+}
+
/* val save : t -> unit */
CAMLprim value
ocaml_augeas_save (value tv)