]> git.sesse.net Git - betaftpd/blobdiff - dcache.h
Moved most of the dcache stuff into its own file. Updated Makefile.in accordingly.
[betaftpd] / dcache.h
diff --git a/dcache.h b/dcache.h
new file mode 100644 (file)
index 0000000..1be0150
--- /dev/null
+++ b/dcache.h
@@ -0,0 +1,38 @@
+/*  dcache.h: BetaFTPD directory cache prototypes
+    Copyright (C) 2000 Steinar H. Gunderson
+
+    This program is is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License, version 2 if the
+    License as published by the Free Software Foundation.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+/* doubly linked list of cached directory listings */
+struct dcache {
+        struct dcache *prev_dcache;
+        struct dcache *next_dcache;
+
+        int use_count;
+        time_t last_used;
+        time_t generated;
+
+        char dir_name[256];
+        char pattern[256];
+        struct list_options lo;
+
+        char *dir_data;
+        int dir_size;
+};
+
+struct dcache *alloc_new_dcache();
+void time_out_dcache();
+void populate_dcache(struct ftran * const f, const char * const cwd,
+                    const char * const pattern, const struct list_options * const lo);