Author: mladen.turk(a)jboss.com
Date: 2007-09-08 12:43:32 -0400 (Sat, 08 Sep 2007)
New Revision: 990
Modified:
trunk/sight/native/include/sight_local.h
trunk/sight/native/include/sight_types.h
Log:
Add prototypes for list based hash
Modified: trunk/sight/native/include/sight_local.h
===================================================================
--- trunk/sight/native/include/sight_local.h 2007-09-08 16:43:04 UTC (rev 989)
+++ trunk/sight/native/include/sight_local.h 2007-09-08 16:43:32 UTC (rev 990)
@@ -398,6 +398,12 @@
#endif
+/* Prototypes from cache.c */
+cache_table_t *cache_new(size_t);
+cache_entry_t *cache_add(cache_table_t *, const char *);
+cache_entry_t *cache_find(cache_table_t *, const char *);
+void cache_free(cache_table_t *, void (*destroy)(const char *, void *));
+
/* Prototypes from finfo.c */
jobject sight_new_finfo_class(SIGHT_STDARGS);
void sight_finfo_fill(SIGHT_STDARGS, apr_finfo_t *);
Modified: trunk/sight/native/include/sight_types.h
===================================================================
--- trunk/sight/native/include/sight_types.h 2007-09-08 16:43:04 UTC (rev 989)
+++ trunk/sight/native/include/sight_types.h 2007-09-08 16:43:32 UTC (rev 990)
@@ -122,6 +122,30 @@
void (*clean)(int, sight_object_t *);
};
+#define CACHE_HASH_MASK 255
+#define CACHE_HASH_SIZE 256
+
+typedef struct cache_entry_t cache_entry_t;
+typedef struct cache_table_t cache_table_t;
+
+struct cache_entry_t {
+ cache_entry_t *next; /* Next cache entry in bucket */
+ char *key; /* cache id */
+ void *data;
+};
+
+struct cache_table_t {
+ /* Pointer to the linked list of cache entries */
+ cache_entry_t **list;
+ /* Table of hash buckets */
+ cache_entry_t *hash[CACHE_HASH_SIZE];
+ /* Number of cache buckets defined */
+ size_t siz;
+ /* Maximum number of cache buckets */
+ size_t len;
+};
+
+
#define SIGHT_FS_UNKNOWN 0
#define SIGHT_FS_MSDOS 1
#define SIGHT_FS_VFAT 2
@@ -178,6 +202,19 @@
#define SIGHT_DRIVE_RAMDISK 6
#define SIGHT_DRIVE_SWAP 7
+/* Socket TCP states */
+#define SIGHT_TCP_CLOSED 1
+#define SIGHT_TCP_LISTENING 2
+#define SIGHT_TCP_SYN_SENT 3
+#define SIGHT_TCP_SYN_RCVD 4
+#define SIGHT_TCP_ESTABLISHED 5
+#define SIGHT_TCP_FIN_WAIT1 6
+#define SIGHT_TCP_FIN_WAIT2 7
+#define SIGHT_TCP_CLOSE_WAIT 8
+#define SIGHT_TCP_CLOSING 9
+#define SIGHT_TCP_LAST_ACK 10
+#define SIGHT_TCP_TIME_WAIT 11
+#define SIGHT_TCP_DELETE_TCB 12
#ifdef __cplusplus
Show replies by date