| 1 |
// Copyright (C) 1995-1998 Eric Young ([email protected]) All rights reserved. |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
#ifndef OPENSSL_HEADER_LHASH_H |
| 5 |
#define OPENSSL_HEADER_LHASH_H |
| 6 |
|
| 7 |
#include <openssl/base.h> |
| 8 |
|
| 9 |
#if defined(__cplusplus) |
| 10 |
extern "C" { |
| 11 |
#endif |
| 12 |
|
| 13 |
|
| 14 |
// Hash table implementation for internal use. |
| 15 |
|
| 16 |
|
| 17 |
typedef struct lhash_st _LHASH; |
| 18 |
|
| 19 |
// lhash is an internal library and not exported for use outside BoringSSL. This |
| 20 |
// header is provided for compatibility with code that expects OpenSSL. |
| 21 |
|
| 22 |
|
| 23 |
// These two macros are exported for compatibility with existing callers of |
| 24 |
// |X509V3_EXT_conf_nid|. Do not use these symbols outside BoringSSL. |
| 25 |
#define LHASH_OF(type) struct lhash_st_##type |
| 26 |
#define DECLARE_LHASH_OF(type) LHASH_OF(type); |
| 27 |
|
| 28 |
OPENSSL_EXPORT void lh_doall_arg(_LHASH *lh, void (*func)(void *, void *), |
| 29 |
void *arg); |
| 30 |
|
| 31 |
// These two macros are the bare minimum of |LHASH| macros downstream consumers |
| 32 |
// use. |
| 33 |
#define IMPLEMENT_LHASH_DOALL_ARG_FN(name, o_type, a_type) \ |
| 34 |
void name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \ |
| 35 |
o_type *a = arg1; \ |
| 36 |
a_type *b = arg2; \ |
| 37 |
name##_doall_arg(a, b); } |
| 38 |
#define LHASH_DOALL_ARG_FN(name) name##_LHASH_DOALL_ARG |
| 39 |
|
| 40 |
|
| 41 |
#if defined(__cplusplus) |
| 42 |
} // extern C |
| 43 |
#endif |
| 44 |
|
| 45 |
#endif // OPENSSL_HEADER_LHASH_H |