Implement Augeas.load API.
[ocaml-augeas.git] / augeas-c.c
index 3f5431b..c06bf92 100644 (file)
@@ -273,3 +273,16 @@ ocaml_augeas_save (value tv)
 
   CAMLreturn (Val_unit);
 }
+
+/* val load : t -> unit */
+CAMLprim value
+ocaml_augeas_load (value tv)
+{
+  CAMLparam1 (tv);
+  augeas_t t = Augeas_t_val (tv);
+
+  if (aug_load (t) == -1)
+    raise_error ("Augeas.load");
+
+  CAMLreturn (Val_unit);
+}