Files
nethogs/hashtbl.h
2004-09-14 19:24:01 +00:00

34 lines
548 B
C++

#include <stdlib.h>
#include <stdio.h>
class HashNode
{
public:
~HashNode();
char * key;
void * content;
HashNode * next;
};
class HashTable
{
public:
HashTable(int n_size);
~HashTable();
/* after calling 'add', the calling application
* must free the string */
void add(char * key, void * content);
void * get(char * key);
private:
int size;
HashNode ** table;
HashNode * newHashNode(char * key, void * content, HashNode * next);
unsigned int HashString(const char * str);
HashTable(); // We leave this unimplemented ;)
};