From 16a678004a5aa6afafddc55bda1d05bfb0e8db22 Mon Sep 17 00:00:00 2001 From: reinelt Date: Wed, 21 Jan 2004 10:48:17 +0000 Subject: [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 --- hash.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'hash.h') 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 +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); -- cgit v1.2.3