Unexport more of lhash.
There is also no need to make the struct public. Also tidy up includes a bit. Change-Id: I188848dfd8f9ed42925b2c55da8dc4751c29f146 Reviewed-on: https://boringssl-review.googlesource.com/22126 Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> Reviewed-by: Steven Valdez <svaldez@google.com>
This commit is contained in:
parent
4455e59980
commit
6675cfddef
@ -113,7 +113,6 @@
|
||||
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/lhash.h>
|
||||
#include <openssl/mem.h>
|
||||
#include <openssl/stack.h>
|
||||
#include <openssl/thread.h>
|
||||
|
@ -73,6 +73,25 @@ static const size_t kMinNumBuckets = 16;
|
||||
static const size_t kMaxAverageChainLength = 2;
|
||||
static const size_t kMinAverageChainLength = 1;
|
||||
|
||||
struct lhash_st {
|
||||
// num_items contains the total number of items in the hash table.
|
||||
size_t num_items;
|
||||
// buckets is an array of |num_buckets| pointers. Each points to the head of
|
||||
// a chain of LHASH_ITEM objects that have the same hash value, mod
|
||||
// |num_buckets|.
|
||||
LHASH_ITEM **buckets;
|
||||
// num_buckets contains the length of |buckets|. This value is always >=
|
||||
// kMinNumBuckets.
|
||||
size_t num_buckets;
|
||||
// callback_depth contains the current depth of |lh_doall| or |lh_doall_arg|
|
||||
// calls. If non-zero then this suppresses resizing of the |buckets| array,
|
||||
// which would otherwise disrupt the iteration.
|
||||
unsigned callback_depth;
|
||||
|
||||
lhash_cmp_func comp;
|
||||
lhash_hash_func hash;
|
||||
};
|
||||
|
||||
_LHASH *lh_new(lhash_hash_func hash, lhash_cmp_func comp) {
|
||||
_LHASH *ret = OPENSSL_malloc(sizeof(_LHASH));
|
||||
if (ret == NULL) {
|
||||
|
@ -61,7 +61,6 @@
|
||||
|
||||
#include <openssl/buf.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/lhash.h>
|
||||
#include <openssl/mem.h>
|
||||
#include <openssl/thread.h>
|
||||
#include <openssl/x509.h>
|
||||
|
@ -59,7 +59,6 @@
|
||||
|
||||
#include <openssl/buf.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/lhash.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/thread.h>
|
||||
|
||||
|
@ -58,7 +58,6 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/lhash.h>
|
||||
#include <openssl/mem.h>
|
||||
#include <openssl/thread.h>
|
||||
#include <openssl/x509.h>
|
||||
|
@ -59,7 +59,6 @@
|
||||
|
||||
#include <openssl/buf.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/lhash.h>
|
||||
#include <openssl/mem.h>
|
||||
#include <openssl/obj.h>
|
||||
#include <openssl/x509.h>
|
||||
|
@ -54,13 +54,7 @@
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.] */
|
||||
|
||||
#include <openssl/asn1.h>
|
||||
#include <openssl/buf.h>
|
||||
#include <openssl/cipher.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/lhash.h>
|
||||
#include <openssl/mem.h>
|
||||
#include <openssl/obj.h>
|
||||
#include <openssl/x509.h>
|
||||
|
||||
const char *X509_verify_cert_error_string(long n)
|
||||
|
@ -61,7 +61,6 @@
|
||||
#include <openssl/buf.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/lhash.h>
|
||||
#include <openssl/mem.h>
|
||||
#include <openssl/obj.h>
|
||||
#include <openssl/thread.h>
|
||||
|
@ -57,7 +57,6 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <openssl/buf.h>
|
||||
#include <openssl/lhash.h>
|
||||
#include <openssl/mem.h>
|
||||
#include <openssl/obj.h>
|
||||
#include <openssl/stack.h>
|
||||
|
@ -125,24 +125,7 @@ typedef int (*lhash_cmp_func)(const void *a, const void *b);
|
||||
// uint32_t.
|
||||
typedef uint32_t (*lhash_hash_func)(const void *a);
|
||||
|
||||
typedef struct lhash_st {
|
||||
// num_items contains the total number of items in the hash table.
|
||||
size_t num_items;
|
||||
// buckets is an array of |num_buckets| pointers. Each points to the head of
|
||||
// a chain of LHASH_ITEM objects that have the same hash value, mod
|
||||
// |num_buckets|.
|
||||
LHASH_ITEM **buckets;
|
||||
// num_buckets contains the length of |buckets|. This value is always >=
|
||||
// kMinNumBuckets.
|
||||
size_t num_buckets;
|
||||
// callback_depth contains the current depth of |lh_doall| or |lh_doall_arg|
|
||||
// calls. If non-zero then this suppresses resizing of the |buckets| array,
|
||||
// which would otherwise disrupt the iteration.
|
||||
unsigned callback_depth;
|
||||
|
||||
lhash_cmp_func comp;
|
||||
lhash_hash_func hash;
|
||||
} _LHASH;
|
||||
typedef struct lhash_st _LHASH;
|
||||
|
||||
// lh_new returns a new, empty hash table or NULL on error.
|
||||
OPENSSL_EXPORT _LHASH *lh_new(lhash_hash_func hash, lhash_cmp_func comp);
|
||||
|
@ -64,8 +64,6 @@
|
||||
#ifndef HEADER_X509_VFY_H
|
||||
#define HEADER_X509_VFY_H
|
||||
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/lhash.h>
|
||||
#include <openssl/thread.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -57,6 +57,7 @@
|
||||
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/conf.h>
|
||||
#include <openssl/lhash.h>
|
||||
#include <openssl/x509.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Loading…
Reference in New Issue
Block a user