src/dirbuf.h
changeset 26 61668c57f4bb
parent 7 3a603d755bcb
child 27 461be4cd34a3
--- a/src/dirbuf.h	Sun Oct 12 20:10:47 2008 +0300
+++ b/src/dirbuf.h	Sun Oct 12 21:59:52 2008 +0300
@@ -16,6 +16,13 @@
     size_t off;
 };
 
+// maximum length for a dirbuf name, including NUL byte
+#define DIRBUF_NAME_MAX 256
+
+/*
+ * Estimate how many dir entries will, at most, fit into a difbuf of the given size, based on a minimum filename size.
+ */
+size_t difbuf_estimate (size_t req_size, size_t min_namelen);
 
 /*
  * Initialize a dirbuf for a request. The dirbuf will be filled with at most req_size bytes of dir entries.