+/* Automatically generated binding for virStoragePoolNumOfVolumes.
+ * In generator.pl this function has signature "pool : int".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEPOOLNUMOFVOLUMES
+extern int virStoragePoolNumOfVolumes (virStoragePoolPtr pool) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_pool_num_of_volumes (value poolv)
+{
+ CAMLparam1 (poolv);
+#ifndef HAVE_VIRSTORAGEPOOLNUMOFVOLUMES
+ /* Symbol virStoragePoolNumOfVolumes not found at compile time. */
+ not_supported ("virStoragePoolNumOfVolumes");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStoragePoolNumOfVolumes
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStoragePoolNumOfVolumes);
+
+ virStoragePoolPtr pool = Pool_val (poolv);
+ virConnectPtr conn = Connect_polv (poolv);
+ int r;
+
+ NONBLOCKING (r = virStoragePoolNumOfVolumes (pool));
+ CHECK_ERROR (r == -1, conn, "virStoragePoolNumOfVolumes");
+
+ CAMLreturn (Val_int (r));
+#endif
+}
+
+/* Automatically generated binding for virStoragePoolListVolumes.
+ * In generator.pl this function has signature "pool, int : string array".
+ */
+
+#ifdef HAVE_WEAK_SYMBOLS
+#ifdef HAVE_VIRSTORAGEPOOLLISTVOLUMES
+extern int virStoragePoolListVolumes (virStoragePoolPtr pool, char **const names, int maxnames) __attribute__((weak));
+#endif
+#endif
+
+CAMLprim value
+ocaml_libvirt_storage_pool_list_volumes (value poolv, value iv)
+{
+ CAMLparam2 (poolv, iv);
+#ifndef HAVE_VIRSTORAGEPOOLLISTVOLUMES
+ /* Symbol virStoragePoolListVolumes not found at compile time. */
+ not_supported ("virStoragePoolListVolumes");
+ /* Suppresses a compiler warning. */
+ (void) caml__frame;
+#else
+ /* Check that the symbol virStoragePoolListVolumes
+ * is in runtime version of libvirt.
+ */
+ WEAK_SYMBOL_CHECK (virStoragePoolListVolumes);
+
+ CAMLlocal2 (rv, strv);
+ virStoragePoolPtr pool = Pool_val (poolv);
+ virConnectPtr conn = Connect_polv (poolv);
+ int i = Int_val (iv);
+ char *names[i];
+ int r;
+
+ NONBLOCKING (r = virStoragePoolListVolumes (pool, names, i));
+ CHECK_ERROR (r == -1, conn, "virStoragePoolListVolumes");
+
+ rv = caml_alloc (r, 0);
+ for (i = 0; i < r; ++i) {
+ strv = caml_copy_string (names[i]);
+ Store_field (rv, i, strv);
+ free (names[i]);
+ }
+
+ CAMLreturn (rv);
+#endif
+}
+