aboutsummaryrefslogtreecommitdiffstats
path: root/libibex/ibex_internal.h
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2001-08-15 12:57:51 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-08-15 12:57:51 +0800
commitb4c3c0fa9b3fa9ce8ad64784ccf183e16b084b8c (patch)
treeb3a35e5e4d241a53eb3bb4e8ef7953b79538124c /libibex/ibex_internal.h
parent21a13fbcb64c543103a352d5b316565cac963c1c (diff)
downloadgsoc2013-evolution-b4c3c0fa9b3fa9ce8ad64784ccf183e16b084b8c.tar
gsoc2013-evolution-b4c3c0fa9b3fa9ce8ad64784ccf183e16b084b8c.tar.gz
gsoc2013-evolution-b4c3c0fa9b3fa9ce8ad64784ccf183e16b084b8c.tar.bz2
gsoc2013-evolution-b4c3c0fa9b3fa9ce8ad64784ccf183e16b084b8c.tar.lz
gsoc2013-evolution-b4c3c0fa9b3fa9ce8ad64784ccf183e16b084b8c.tar.xz
gsoc2013-evolution-b4c3c0fa9b3fa9ce8ad64784ccf183e16b084b8c.tar.zst
gsoc2013-evolution-b4c3c0fa9b3fa9ce8ad64784ccf183e16b084b8c.zip
New function to limit use of fd's. Mark an ibex file in use, re-open if
2001-08-15 Not Zed <NotZed@Ximian.com> * ibex_block.c (ibex_use): New function to limit use of fd's. Mark an ibex file in use, re-open if necessary, and close off another (lru) if necessary. (ibex_unuse): Mark an ibex as not in use. (ibex_open): Delay opening of the actual block file till later, and add the ibex to a global list. (ibex_save): Use/unuse around operations. (close_backend): Zero out blocks when closed. (ibex_close): Remove the ibex from the global list before closing it down. (ibex_index_buffer, ibex_find, ibex_unindex, ibex_find_name): Use/unuse around ops. svn path=/trunk/; revision=12042
Diffstat (limited to 'libibex/ibex_internal.h')
-rw-r--r--libibex/ibex_internal.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libibex/ibex_internal.h b/libibex/ibex_internal.h
index d8e5e28296..bb15ebc1f7 100644
--- a/libibex/ibex_internal.h
+++ b/libibex/ibex_internal.h
@@ -27,6 +27,11 @@
#include "wordindex.h"
struct ibex {
+ struct ibex *next; /* for list of open ibex's */
+ struct ibex *prev;
+
+ int usecount;
+
char *name;
int flags;
int mode;
@@ -41,6 +46,8 @@ struct ibex {
};
+#define IBEX_OPEN_THRESHOLD (5)
+
#ifdef ENABLE_THREADS
/*#define IBEX_LOCK(ib) (printf(__FILE__ "%d: %s: locking ibex\n", __LINE__, __FUNCTION__), g_mutex_lock(ib->lock))
#define IBEX_UNLOCK(ib) (printf(__FILE__ "%d: %s: unlocking ibex\n", __LINE__, __FUNCTION__), g_mutex_unlock(ib->lock))*/