mupdf
Loading...
Searching...
No Matches
hash.h
Go to the documentation of this file.
1// Copyright (C) 2004-2021 Artifex Software, Inc.
2//
3// This file is part of MuPDF.
4//
5// MuPDF is free software: you can redistribute it and/or modify it under the
6// terms of the GNU Affero General Public License as published by the Free
7// Software Foundation, either version 3 of the License, or (at your option)
8// any later version.
9//
10// MuPDF is distributed in the hope that it will be useful, but WITHOUT ANY
11// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
13// details.
14//
15// You should have received a copy of the GNU Affero General Public License
16// along with MuPDF. If not, see <https://www.gnu.org/licenses/agpl-3.0.en.html>
17//
18// Alternative licensing terms are available from the licensor.
19// For commercial licensing, see <https://www.artifex.com/> or contact
20// Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
21// CA 94129, USA, for further information.
22
23#ifndef MUPDF_FITZ_HASH_H
24#define MUPDF_FITZ_HASH_H
25
26#include "mupdf/fitz/system.h"
27#include "mupdf/fitz/context.h"
28#include "mupdf/fitz/output.h"
29
30#define FZ_HASH_TABLE_KEY_LENGTH 48
31
43
45
51typedef void (fz_hash_table_drop_fn)(fz_context *ctx, void *val);
52
67fz_hash_table *fz_new_hash_table(fz_context *ctx, int initialsize, int keylen, int lock, fz_hash_table_drop_fn *drop_val);
68
75
80void *fz_hash_find(fz_context *ctx, fz_hash_table *table, const void *key);
81
92void *fz_hash_insert(fz_context *ctx, fz_hash_table *table, const void *key, void *val);
93
100void fz_hash_remove(fz_context *ctx, fz_hash_table *table, const void *key);
101
106typedef void (fz_hash_table_for_each_fn)(fz_context *ctx, void *state, void *key, int keylen, void *val);
107
111void fz_hash_for_each(fz_context *ctx, fz_hash_table *table, void *state, fz_hash_table_for_each_fn *callback);
112
118typedef int (fz_hash_table_filter_fn)(fz_context *ctx, void *state, void *key, int keylen, void *val);
119
124void fz_hash_filter(fz_context *ctx, fz_hash_table *table, void *state, fz_hash_table_filter_fn *callback);
125
126#endif
struct fz_hash_table fz_hash_table
Definition hash.h:44
fz_hash_table * fz_new_hash_table(fz_context *ctx, int initialsize, int keylen, int lock, fz_hash_table_drop_fn *drop_val)
void * fz_hash_find(fz_context *ctx, fz_hash_table *table, const void *key)
void * fz_hash_insert(fz_context *ctx, fz_hash_table *table, const void *key, void *val)
int fz_hash_table_filter_fn(fz_context *ctx, void *state, void *key, int keylen, void *val)
Definition hash.h:118
void fz_hash_for_each(fz_context *ctx, fz_hash_table *table, void *state, fz_hash_table_for_each_fn *callback)
void fz_drop_hash_table(fz_context *ctx, fz_hash_table *table)
void fz_hash_table_drop_fn(fz_context *ctx, void *val)
Definition hash.h:51
void fz_hash_remove(fz_context *ctx, fz_hash_table *table, const void *key)
void fz_hash_filter(fz_context *ctx, fz_hash_table *table, void *state, fz_hash_table_filter_fn *callback)
void fz_hash_table_for_each_fn(fz_context *ctx, void *state, void *key, int keylen, void *val)
Definition hash.h:106
Definition context.h:886