aboutsummaryrefslogtreecommitdiffstats
path: root/hash.h
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-01-21 10:48:17 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-01-21 10:48:17 +0000
commit16a678004a5aa6afafddc55bda1d05bfb0e8db22 (patch)
tree69c46372045db8efe22c2b64c883de6bf40a1cfa /hash.h
parent83df846028ed3a272242276c1d94f86a6c7af2a7 (diff)
downloadlcd4linux-16a678004a5aa6afafddc55bda1d05bfb0e8db22.tar.gz
[lcd4linux @ 2004-01-21 10:48:17 by reinelt]
hash_age function added git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@329 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
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);