Omit version-info for convenience libraries
[idzebra-moved-to-github.git] / bfile / mfile.c
index 54a2a82..2f6500f 100644 (file)
@@ -1,5 +1,5 @@
-/* $Id: mfile.c,v 1.63 2006-04-05 02:02:36 adam Exp $
-   Copyright (C) 1995-2005
+/* $Id: mfile.c,v 1.66 2006-06-07 10:14:39 adam Exp $
+   Copyright (C) 1995-2006
    Index Data ApS
 
 This file is part of the Zebra server.
@@ -616,3 +616,34 @@ int mf_unlink(MFile mf)
     return 0;
 }
 
+int mf_area_directory_stat(MFile_area ma, int no, const char **directory,
+                          double *used_bytes, double *max_bytes)
+{
+    int i;
+    mf_dir *d = ma->dirs;
+    for (i = 0; d && i<no; i++, d = d->next)
+       ;
+    if (!d)
+       return 0;
+    if (directory)
+       *directory = d->name;
+    if (max_bytes)
+    {
+        /* possible loss of data. But it's just statistics and lies */
+       *max_bytes = (double) d->max_bytes;
+    }
+    if (used_bytes)
+    {
+        /* possible loss of data. But it's just statistics and lies */
+       *used_bytes = (double) (d->max_bytes - d->avail_bytes);
+    }
+    return 1;
+}
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+