mirror of https://github.com/xzeldon/htop.git
Hashtable: hide implementation of Hashtable and HashtableItem
This commit is contained in:
parent
8fe04b7494
commit
7043a93eba
14
Hashtable.c
14
Hashtable.c
|
@ -19,6 +19,20 @@ in the source distribution for its full text.
|
||||||
#include "XUtils.h"
|
#include "XUtils.h"
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct HashtableItem_ {
|
||||||
|
ht_key_t key;
|
||||||
|
unsigned int probe;
|
||||||
|
void* value;
|
||||||
|
} HashtableItem;
|
||||||
|
|
||||||
|
struct Hashtable_ {
|
||||||
|
unsigned int size;
|
||||||
|
HashtableItem* buckets;
|
||||||
|
unsigned int items;
|
||||||
|
bool owner;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
|
||||||
static void Hashtable_dump(const Hashtable* this) {
|
static void Hashtable_dump(const Hashtable* this) {
|
||||||
|
|
13
Hashtable.h
13
Hashtable.h
|
@ -14,18 +14,7 @@ typedef unsigned int ht_key_t;
|
||||||
|
|
||||||
typedef void(*Hashtable_PairFunction)(ht_key_t key, void* value, void* userdata);
|
typedef void(*Hashtable_PairFunction)(ht_key_t key, void* value, void* userdata);
|
||||||
|
|
||||||
typedef struct HashtableItem_ {
|
typedef struct Hashtable_ Hashtable;
|
||||||
ht_key_t key;
|
|
||||||
unsigned int probe;
|
|
||||||
void* value;
|
|
||||||
} HashtableItem;
|
|
||||||
|
|
||||||
typedef struct Hashtable_ {
|
|
||||||
unsigned int size;
|
|
||||||
HashtableItem* buckets;
|
|
||||||
unsigned int items;
|
|
||||||
bool owner;
|
|
||||||
} Hashtable;
|
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue