willy tarreau | 1235015 | 2005-12-18 01:03:27 +0100 | [diff] [blame] | 1 | /* |
| 2 | This File is copied from |
| 3 | |
| 4 | http://www.oreilly.com/catalog/masteralgoc/index.html |
| 5 | Mastering Algorithms with C |
| 6 | By Kyle Loudon |
| 7 | ISBN: 1-56592-453-3 |
| 8 | Publishd by O'Reilly |
| 9 | |
| 10 | We have added our own struct to these function. |
| 11 | */ |
| 12 | |
| 13 | /***************************************************************************** |
| 14 | * * |
| 15 | * ------------------------------- hashpjw.h ------------------------------ * |
| 16 | * * |
| 17 | *****************************************************************************/ |
| 18 | |
| 19 | #ifndef HASHPJW_H |
| 20 | #define HASHPJW_H |
| 21 | |
| 22 | #include <sys/time.h> |
| 23 | |
| 24 | typedef struct appsessions { |
| 25 | char *sessid; |
| 26 | char *serverid; |
| 27 | struct timeval expire; /* next expiration time for this application session */ |
| 28 | unsigned long int request_count; |
| 29 | } appsess; /* end struct appsessions */ |
| 30 | |
| 31 | /***************************************************************************** |
| 32 | * * |
| 33 | * Define a table size for demonstration purposes only. * |
| 34 | * * |
| 35 | *****************************************************************************/ |
| 36 | |
| 37 | #define PRIME_TBLSIZ 1699 |
| 38 | |
| 39 | /***************************************************************************** |
| 40 | * * |
| 41 | * --------------------------- Public Interface --------------------------- * |
| 42 | * * |
| 43 | *****************************************************************************/ |
| 44 | |
| 45 | int hashpjw(const void *key); |
| 46 | |
| 47 | #endif |