aboutsummaryrefslogtreecommitdiffstats
path: root/hash.h
diff options
context:
space:
mode:
authorreinelt <>2004-01-21 10:48:17 +0000
committerreinelt <>2004-01-21 10:48:17 +0000
commit25221f8a2f8be7d5a1d6c51af09d33872e9f3a5a (patch)
tree69c46372045db8efe22c2b64c883de6bf40a1cfa /hash.h
parent135e41deff385062b531a3fc11a9534edd7d29ee (diff)
downloadlcd4linux-25221f8a2f8be7d5a1d6c51af09d33872e9f3a5a.tar.gz
[lcd4linux @ 2004-01-21 10:48:17 by reinelt]
hash_age function added
Diffstat (limited to 'hash.h')
-rw-r--r--hash.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/hash.h b/hash.h
index f29ccdb..58e2a70 100644
--- a/hash.h
+++ b/hash.h
@@ -1,4 +1,4 @@
-/* $Id: hash.h,v 1.5 2004/01/18 09:01:45 reinelt Exp $
+/* $Id: hash.h,v 1.6 2004/01/21 10:48:17 reinelt Exp $
*
* hashes (associative arrays)
*
@@ -23,6 +23,9 @@
*
*
* $Log: hash.h,v $
+ * Revision 1.6 2004/01/21 10:48:17 reinelt
+ * hash_age function added
+ *
* Revision 1.5 2004/01/18 09:01:45 reinelt
* /proc/stat parsing finished
*
@@ -53,22 +56,25 @@
// struct timeval
#include <sys/time.h>
+typedef struct timeval timeval;
typedef struct {
- struct timeval time;
- double val;
+ timeval time;
+ double val;
} HASH_SLOT;
typedef struct {
char *key;
char *val;
+ timeval time;
HASH_SLOT *Slot;
} HASH_ITEM;
typedef struct {
int sorted;
+ timeval time;
int nItems;
HASH_ITEM *Items;
} HASH;
@@ -76,6 +82,7 @@ typedef struct {
void hash_set (HASH *Hash, char *key, char *val);
void hash_set_filter (HASH *Hash, char *key, char *val);
+int hash_age (HASH *Hash, char *key, char **value);
char *hash_get (HASH *Hash, char *key);
double hash_get_filter (HASH *Hash, char *key, int delay);
void hash_destroy (HASH *Hash);