~ubuntu-branches/ubuntu/warty/htop/warty

« back to all changes in this revision

Viewing changes to Hashtable.h

  • Committer: Bazaar Package Importer
  • Author(s): Bartosz Fenski
  • Date: 2004-06-20 10:33:13 UTC
  • Revision ID: james.westby@ubuntu.com-20040620103313-7tsm7dmr4obb3b5t
Tags: upstream-0.3.3
ImportĀ upstreamĀ versionĀ 0.3.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Do not edit this file. It was automatically genarated. */
 
2
 
 
3
#ifndef HEADER_Hashtable
 
4
#define HEADER_Hashtable
 
5
/*
 
6
htop
 
7
(C) 2004 Hisham H. Muhammad
 
8
Released under the GNU GPL, see the COPYING file
 
9
in the source distribution for its full text.
 
10
*/
 
11
 
 
12
 
 
13
#include <stdlib.h>
 
14
#include <stdbool.h>
 
15
 
 
16
#include "debug.h"
 
17
 
 
18
typedef struct Hashtable_ Hashtable;
 
19
 
 
20
typedef void(*HashtablePairFunction)(int, void*);
 
21
typedef int(*HashtableHashAlgorithm)(Hashtable*, int);
 
22
 
 
23
typedef struct HashtableItem {
 
24
   int key;
 
25
   void* value;
 
26
   struct HashtableItem* next;
 
27
} HashtableItem;
 
28
 
 
29
struct Hashtable_ {
 
30
   int size;
 
31
   HashtableItem** buckets;
 
32
   int items;
 
33
   HashtableHashAlgorithm hashAlgorithm;
 
34
   bool owner;
 
35
};
 
36
 
 
37
HashtableItem* HashtableItem_new(int key, void* value);
 
38
 
 
39
Hashtable* Hashtable_new(int size, bool owner);
 
40
 
 
41
int Hashtable_hashAlgorithm(Hashtable* this, int key);
 
42
 
 
43
void Hashtable_delete(Hashtable* this);
 
44
 
 
45
int Hashtable_size(Hashtable* this);
 
46
 
 
47
void Hashtable_put(Hashtable* this, int key, void* value);
 
48
 
 
49
void* Hashtable_remove(Hashtable* this, int key);
 
50
 
 
51
void* Hashtable_get(Hashtable* this, int key);
 
52
 
 
53
void Hashtable_foreach(Hashtable* this, HashtablePairFunction f);
 
54
 
 
55
#endif