blob: a20b5b3b2c98b6e35dd9a9368a8955098c8fabd3 [file] [log] [blame]
willy tarreau12350152005-12-18 01:03:27 +01001/*
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
24typedef 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
45int hashpjw(const void *key);
46
47#endif