Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
7858 views
1
#ifndef MUPDF_FITZ_HASH_H
2
#define MUPDF_FITZ_HASH_H
3
4
#include "mupdf/fitz/system.h"
5
#include "mupdf/fitz/context.h"
6
7
/*
8
* Generic hash-table with fixed-length keys.
9
*/
10
11
typedef struct fz_hash_table_s fz_hash_table;
12
13
fz_hash_table *fz_new_hash_table(fz_context *ctx, int initialsize, int keylen, int lock);
14
void fz_empty_hash(fz_context *ctx, fz_hash_table *table);
15
void fz_drop_hash(fz_context *ctx, fz_hash_table *table);
16
17
void *fz_hash_find(fz_context *ctx, fz_hash_table *table, const void *key);
18
void *fz_hash_insert(fz_context *ctx, fz_hash_table *table, const void *key, void *val);
19
void *fz_hash_insert_with_pos(fz_context *ctx, fz_hash_table *table, const void *key, void *val, unsigned *pos);
20
void fz_hash_remove(fz_context *ctx, fz_hash_table *table, const void *key);
21
void fz_hash_remove_fast(fz_context *ctx, fz_hash_table *table, const void *key, unsigned pos);
22
23
int fz_hash_len(fz_context *ctx, fz_hash_table *table);
24
void *fz_hash_get_key(fz_context *ctx, fz_hash_table *table, int idx);
25
void *fz_hash_get_val(fz_context *ctx, fz_hash_table *table, int idx);
26
27
#ifndef NDEBUG
28
void fz_print_hash(fz_context *ctx, FILE *out, fz_hash_table *table);
29
void fz_print_hash_details(fz_context *ctx, FILE *out, fz_hash_table *table, void (*details)(FILE *, void *));
30
#endif
31
32
#endif
33
34