diff options
author | Rich Salz <rsalz@openssl.org> | 2016-05-20 10:46:29 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-05-20 10:48:29 -0400 |
commit | 739a1eb1961cdc3b1597a040766f3cb359d095f6 (patch) | |
tree | da90e8dd33e1aa605351b529713901bb1b0f37b8 /include | |
parent | 06593767b21d4ebacc3e6ecc8daedd9d5c5f9f97 (diff) |
Rename lh_xxx,sk_xxx tp OPENSSL_{LH,SK}_xxx
Rename sk_xxx to OPENSSL_sk_xxx and _STACK to OPENSSL_STACK
Rename lh_xxx API to OPENSSL_LH_xxx and LHASH_NODE to OPENSSL_LH_NODE
Make lhash stuff opaque.
Use typedefs for function pointers; makes the code simpler.
Remove CHECKED_xxx macros.
Add documentation; remove old X509-oriented doc.
Add API-compat names for entire old API
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/openssl/lhash.h | 142 | ||||
-rw-r--r-- | include/openssl/safestack.h | 84 | ||||
-rw-r--r-- | include/openssl/stack.h | 83 | ||||
-rw-r--r-- | include/openssl/txt_db.h | 2 |
4 files changed, 150 insertions, 161 deletions
diff --git a/include/openssl/lhash.h b/include/openssl/lhash.h index 158300f9b0..7c568ac057 100644 --- a/include/openssl/lhash.h +++ b/include/openssl/lhash.h @@ -21,16 +21,12 @@ extern "C" { #endif -typedef struct lhash_node_st { - void *data; - struct lhash_node_st *next; - unsigned long hash; -} LHASH_NODE; - -typedef int (*LHASH_COMP_FN_TYPE) (const void *, const void *); -typedef unsigned long (*LHASH_HASH_FN_TYPE) (const void *); -typedef void (*LHASH_DOALL_FN_TYPE) (void *); -typedef void (*LHASH_DOALL_ARG_FN_TYPE) (void *, void *); +typedef struct lhash_node_st OPENSSL_LH_NODE; +typedef int (*OPENSSL_LH_COMPFUNC) (const void *, const void *); +typedef unsigned long (*OPENSSL_LH_HASHFUNC) (const void *); +typedef void (*OPENSSL_LH_DOALL_FUNC) (void *); +typedef void (*OPENSSL_LH_DOALL_FUNCARG) (void *, void *); +typedef struct lhash_st OPENSSL_LHASH; /* * Macros for declaring and implementing type-safe wrappers for LHASH @@ -70,62 +66,53 @@ typedef void (*LHASH_DOALL_ARG_FN_TYPE) (void *, void *); name##_doall_arg(a, b); } # define LHASH_DOALL_ARG_FN(name) name##_LHASH_DOALL_ARG -typedef struct lhash_st { - LHASH_NODE **b; - LHASH_COMP_FN_TYPE comp; - LHASH_HASH_FN_TYPE hash; - unsigned int num_nodes; - unsigned int num_alloc_nodes; - unsigned int p; - unsigned int pmax; - unsigned long up_load; /* load times 256 */ - unsigned long down_load; /* load times 256 */ - unsigned long num_items; - unsigned long num_expands; - unsigned long num_expand_reallocs; - unsigned long num_contracts; - unsigned long num_contract_reallocs; - unsigned long num_hash_calls; - unsigned long num_comp_calls; - unsigned long num_insert; - unsigned long num_replace; - unsigned long num_delete; - unsigned long num_no_delete; - unsigned long num_retrieve; - unsigned long num_retrieve_miss; - unsigned long num_hash_comps; - int error; -} _LHASH; /* Do not use _LHASH directly, use LHASH_OF - * and friends */ # define LH_LOAD_MULT 256 -/* - * Indicates a malloc() error in the last call, this is only bad in - * lh_insert(). - */ -int lh_error(_LHASH *lh); - -_LHASH *lh_new(LHASH_HASH_FN_TYPE h, LHASH_COMP_FN_TYPE c); -void lh_free(_LHASH *lh); -void *lh_insert(_LHASH *lh, void *data); -void *lh_delete(_LHASH *lh, const void *data); -void *lh_retrieve(_LHASH *lh, const void *data); -void lh_doall(_LHASH *lh, LHASH_DOALL_FN_TYPE func); -void lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg); -unsigned long lh_strhash(const char *c); -unsigned long lh_num_items(const _LHASH *lh); -unsigned long lh_get_down_load(const _LHASH *lh); -void lh_set_down_load(_LHASH *lh, unsigned long down_load); +int OPENSSL_LH_error(OPENSSL_LHASH *lh); +OPENSSL_LHASH *OPENSSL_LH_new(OPENSSL_LH_HASHFUNC h, OPENSSL_LH_COMPFUNC c); +void OPENSSL_LH_free(OPENSSL_LHASH *lh); +void *OPENSSL_LH_insert(OPENSSL_LHASH *lh, void *data); +void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data); +void *OPENSSL_LH_retrieve(OPENSSL_LHASH *lh, const void *data); +void OPENSSL_LH_doall(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNC func); +void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg); +unsigned long OPENSSL_LH_strhash(const char *c); +unsigned long OPENSSL_LH_num_items(const OPENSSL_LHASH *lh); +unsigned long OPENSSL_LH_get_down_load(const OPENSSL_LHASH *lh); +void OPENSSL_LH_set_down_load(OPENSSL_LHASH *lh, unsigned long down_load); # ifndef OPENSSL_NO_STDIO -void lh_stats(const _LHASH *lh, FILE *fp); -void lh_node_stats(const _LHASH *lh, FILE *fp); -void lh_node_usage_stats(const _LHASH *lh, FILE *fp); +void OPENSSL_LH_stats(const OPENSSL_LHASH *lh, FILE *fp); +void OPENSSL_LH_node_stats(const OPENSSL_LHASH *lh, FILE *fp); +void OPENSSL_LH_node_usage_stats(const OPENSSL_LHASH *lh, FILE *fp); +# endif +void OPENSSL_LH_stats_bio(const OPENSSL_LHASH *lh, BIO *out); +void OPENSSL_LH_node_stats_bio(const OPENSSL_LHASH *lh, BIO *out); +void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out); + +# if OPENSSL_API_COMPAT < 0x10100000L +# define _LHASH OPENSSL_LHASH +# define LHASH_NODE OPENSSL_LH_NODE +# define lh_error OPENSSL_LH_error +# define lh_new OPENSSL_lh_new +# define lh_free OPENSSL_LH_free +# define lh_insert OPENSSL_LH_insert +# define lh_delete OPENSSL_LH_delete +# define lh_retrieve OPENSSL_LH_retrieve +# define lh_doall OPENSSL_LH_doall +# define lh_doall_arg OPENSSL_LH_doall_arg +# define lh_strhash OPENSSL_LH_strhash +# define lh_num_items OPENSSL_LH_num_items +# ifndef OPENSSL_NO_STDIO +# define lh_stats OPENSSL_LH_stats +# define lh_node_stats OPENSSL_LH_node_stats +# define lh_node_usage_stats OPENSSL_LH_node_usage_stats +# endif +# define lh_stats_bio OPENSSL_LH_stats_bio +# define lh_node_stats_bio OPENSSL_LH_node_stats_bio +# define lh_node_usage_stats_bio OPENSSL_LH_node_usage_stats_bio # endif -void lh_stats_bio(const _LHASH *lh, BIO *out); -void lh_node_stats_bio(const _LHASH *lh, BIO *out); -void lh_node_usage_stats_bio(const _LHASH *lh, BIO *out); /* Type checking... */ @@ -138,56 +125,56 @@ void lh_node_usage_stats_bio(const _LHASH *lh, BIO *out); int (*cfn)(const type *, const type *)) \ { \ return (LHASH_OF(type) *) \ - lh_new((LHASH_HASH_FN_TYPE) hfn, (LHASH_COMP_FN_TYPE)cfn); \ + OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); \ } \ static ossl_inline void lh_##type##_free(LHASH_OF(type) *lh) \ { \ - lh_free((_LHASH *)lh); \ + OPENSSL_LH_free((OPENSSL_LHASH *)lh); \ } \ static ossl_inline type *lh_##type##_insert(LHASH_OF(type) *lh, type *d) \ { \ - return (type *)lh_insert((_LHASH *)lh, d); \ + return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \ } \ static ossl_inline type *lh_##type##_delete(LHASH_OF(type) *lh, const type *d) \ { \ - return (type *)lh_delete((_LHASH *)lh, d); \ + return (type *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); \ } \ static ossl_inline type *lh_##type##_retrieve(LHASH_OF(type) *lh, const type *d) \ { \ - return (type *)lh_retrieve((_LHASH *)lh, d); \ + return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \ } \ static ossl_inline int lh_##type##_error(LHASH_OF(type) *lh) \ { \ - return lh_error((_LHASH *)lh); \ + return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \ } \ static ossl_inline unsigned long lh_##type##_num_items(LHASH_OF(type) *lh) \ { \ - return lh_num_items((_LHASH *)lh); \ + return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh); \ } \ static ossl_inline void lh_##type##_node_stats_bio(const LHASH_OF(type) *lh, BIO *out) \ { \ - lh_node_stats_bio((_LHASH *)lh, out); \ + OPENSSL_LH_node_stats_bio((OPENSSL_LHASH *)lh, out); \ } \ static ossl_inline void lh_##type##_node_usage_stats_bio(const LHASH_OF(type) *lh, BIO *out) \ { \ - lh_node_usage_stats_bio((_LHASH *)lh, out); \ + OPENSSL_LH_node_usage_stats_bio((OPENSSL_LHASH *)lh, out); \ } \ static ossl_inline void lh_##type##_stats_bio(const LHASH_OF(type) *lh, BIO *out) \ { \ - lh_stats_bio((_LHASH *)lh, out); \ + OPENSSL_LH_stats_bio((OPENSSL_LHASH *)lh, out); \ } \ static ossl_inline unsigned long lh_##type##_get_down_load(LHASH_OF(type) *lh) \ { \ - return lh_get_down_load((_LHASH *)lh); \ + return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); \ } \ static ossl_inline void lh_##type##_set_down_load(LHASH_OF(type) *lh, unsigned long dl) \ { \ - lh_set_down_load((_LHASH *)lh, dl); \ + OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); \ } \ static ossl_inline void lh_##type##_doall(LHASH_OF(type) *lh, \ void (*doall)(type *)) \ { \ - lh_doall((_LHASH *)lh, (LHASH_DOALL_FN_TYPE)doall); \ + OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \ } \ LHASH_OF(type) @@ -203,17 +190,10 @@ void lh_node_usage_stats_bio(const _LHASH *lh, BIO *out); void (*fn)(cbargtype *, argtype *), \ argtype *arg) \ { \ - lh_doall_arg((_LHASH *)lh, (LHASH_DOALL_ARG_FN_TYPE)fn, (void *)arg); \ + OPENSSL_LH_doall_arg((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNCARG)fn, (void *)arg); \ } \ LHASH_OF(type) -# define CHECKED_LHASH_OF(type,lh) \ - ((_LHASH *)CHECKED_PTR_OF(LHASH_OF(type),lh)) - -/* Define wrapper functions. */ -# define LHM_lh_doall_arg(type, lh, fn, arg_type, arg) \ - lh_doall_arg(CHECKED_LHASH_OF(type, lh), fn, CHECKED_PTR_OF(arg_type, arg)) - DEFINE_LHASH_OF(OPENSSL_STRING); DEFINE_LHASH_OF(OPENSSL_CSTRING); diff --git a/include/openssl/safestack.h b/include/openssl/safestack.h index e12f60df56..d0af0eba5d 100644 --- a/include/openssl/safestack.h +++ b/include/openssl/safestack.h @@ -17,124 +17,104 @@ extern "C" { #endif -# ifndef CHECKED_PTR_OF -# define CHECKED_PTR_OF(type, p) ((void*) (1 ? p : (type*)0)) -# endif - -/* - * In C++ we get problems because an explicit cast is needed from (void *) we - * use CHECKED_STACK_OF to ensure the correct type is passed in the macros - * below. - */ - -# define CHECKED_STACK_OF(type, p) \ - ((_STACK*) (1 ? p : (STACK_OF(type)*)0)) - -# define CHECKED_SK_COPY_FUNC(type, p) \ - ((void *(*)(void *)) ((1 ? p : (type *(*)(const type *))0))) - -# define CHECKED_SK_FREE_FUNC(type, p) \ - ((void (*)(void *)) ((1 ? p : (void (*)(type *))0))) - -# define CHECKED_SK_CMP_FUNC(type, p) \ - ((int (*)(const void *, const void *)) \ - ((1 ? p : (int (*)(const type * const *, const type * const *))0))) - # define STACK_OF(type) struct stack_st_##type # define SKM_DEFINE_STACK_OF(t1, t2, t3) \ STACK_OF(t1); \ + typedef int (*sk_##t1##_compfunc)(const t3 * const *a, const t3 *const *b); \ + typedef void (*sk_##t1##_freefunc)(t3 *a); \ + typedef t3 * (*sk_##t1##_copyfunc)(const t3 *a); \ static ossl_inline int sk_##t1##_num(const STACK_OF(t1) *sk) \ { \ - return sk_num((const _STACK *)sk); \ + return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \ } \ static ossl_inline t2 *sk_##t1##_value(const STACK_OF(t1) *sk, int idx) \ { \ - return (t2 *)sk_value((const _STACK *)sk, idx); \ + return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \ } \ - static ossl_inline STACK_OF(t1) *sk_##t1##_new(int (*cmpf)(const t3 * const *a, const t3 * const *b)) \ + static ossl_inline STACK_OF(t1) *sk_##t1##_new(sk_##t1##_compfunc compare) \ { \ - return (STACK_OF(t1) *)sk_new((int (*)(const void *a, const void *b))cmpf); \ + return (STACK_OF(t1) *)OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \ } \ static ossl_inline STACK_OF(t1) *sk_##t1##_new_null(void) \ { \ - return (STACK_OF(t1) *)sk_new_null(); \ + return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \ } \ static ossl_inline void sk_##t1##_free(STACK_OF(t1) *sk) \ { \ - sk_free((_STACK *)sk); \ + OPENSSL_sk_free((OPENSSL_STACK *)sk); \ } \ static ossl_inline void sk_##t1##_zero(STACK_OF(t1) *sk) \ { \ - sk_zero((_STACK *)sk); \ + OPENSSL_sk_zero((OPENSSL_STACK *)sk); \ } \ static ossl_inline t2 *sk_##t1##_delete(STACK_OF(t1) *sk, int i) \ { \ - return (t2 *)sk_delete((_STACK *)sk, i); \ + return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); \ } \ static ossl_inline t2 *sk_##t1##_delete_ptr(STACK_OF(t1) *sk, t2 *ptr) \ { \ - return (t2 *)sk_delete_ptr((_STACK *)sk, (void *)ptr); \ + return (t2 *)OPENSSL_sk_delete_ptr((OPENSSL_STACK *)sk, (void *)ptr); \ } \ static ossl_inline int sk_##t1##_push(STACK_OF(t1) *sk, t2 *ptr) \ { \ - return sk_push((_STACK *)sk, (void *)ptr); \ + return OPENSSL_sk_push((OPENSSL_STACK *)sk, (void *)ptr); \ } \ static ossl_inline int sk_##t1##_unshift(STACK_OF(t1) *sk, t2 *ptr) \ { \ - return sk_unshift((_STACK *)sk, (void *)ptr); \ + return OPENSSL_sk_unshift((OPENSSL_STACK *)sk, (void *)ptr); \ } \ static ossl_inline t2 *sk_##t1##_pop(STACK_OF(t1) *sk) \ { \ - return (t2 *)sk_pop((_STACK *)sk); \ + return (t2 *)OPENSSL_sk_pop((OPENSSL_STACK *)sk); \ } \ static ossl_inline t2 *sk_##t1##_shift(STACK_OF(t1) *sk) \ { \ - return (t2 *)sk_shift((_STACK *)sk); \ + return (t2 *)OPENSSL_sk_shift((OPENSSL_STACK *)sk); \ } \ - static ossl_inline void sk_##t1##_pop_free(STACK_OF(t1) *sk, void (*func)(t3 *a)) \ + static ossl_inline void sk_##t1##_pop_free(STACK_OF(t1) *sk, sk_##t1##_freefunc freefunc) \ { \ - sk_pop_free((_STACK *)sk, (void (*)(void *))func); \ + OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \ } \ static ossl_inline int sk_##t1##_insert(STACK_OF(t1) *sk, t2 *ptr, int idx) \ { \ - return sk_insert((_STACK *)sk, (void *)ptr, idx); \ + return OPENSSL_sk_insert((OPENSSL_STACK *)sk, (void *)ptr, idx); \ } \ static ossl_inline t2 *sk_##t1##_set(STACK_OF(t1) *sk, int idx, t2 *ptr) \ { \ - return (t2 *)sk_set((_STACK *)sk, idx, (void *)ptr); \ + return (t2 *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (void *)ptr); \ } \ static ossl_inline int sk_##t1##_find(STACK_OF(t1) *sk, t2 *ptr) \ { \ - return sk_find((_STACK *)sk, (void *)ptr); \ + return OPENSSL_sk_find((OPENSSL_STACK *)sk, (void *)ptr); \ } \ static ossl_inline int sk_##t1##_find_ex(STACK_OF(t1) *sk, t2 *ptr) \ { \ - return sk_find_ex((_STACK *)sk, (void *)ptr); \ + return OPENSSL_sk_find_ex((OPENSSL_STACK *)sk, (void *)ptr); \ } \ static ossl_inline void sk_##t1##_sort(STACK_OF(t1) *sk) \ { \ - sk_sort((_STACK *)sk); \ + OPENSSL_sk_sort((OPENSSL_STACK *)sk); \ } \ static ossl_inline int sk_##t1##_is_sorted(const STACK_OF(t1) *sk) \ { \ - return sk_is_sorted((const _STACK *)sk); \ + return OPENSSL_sk_is_sorted((const OPENSSL_STACK *)sk); \ } \ static ossl_inline STACK_OF(t1) * sk_##t1##_dup(STACK_OF(t1) *sk) \ { \ - return (STACK_OF(t1) *)sk_dup((_STACK *)sk); \ + return (STACK_OF(t1) *)OPENSSL_sk_dup((OPENSSL_STACK *)sk); \ } \ static ossl_inline STACK_OF(t1) *sk_##t1##_deep_copy(STACK_OF(t1) *sk, \ - t3 *(*copyfn)(const t3 *), \ - void (*freefn)(t3 *)) \ + sk_##t1##_copyfunc copyfunc, \ + sk_##t1##_freefunc freefunc) \ { \ - return (STACK_OF(t1) *)sk_deep_copy((_STACK *)sk, \ - (void * (*)(void *a))copyfn, \ - (void (*)(void *a))freefn); \ + return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((OPENSSL_STACK *)sk, \ + (OPENSSL_sk_copyfunc)copyfunc, \ + (OPENSSL_sk_freefunc)freefunc); \ } \ - static ossl_inline int (*sk_##t1##_set_cmp_func(STACK_OF(t1) *sk, int (*cmpf)(const t3 * const *a, const t3 * const *b)))(const t3 * const *, const t3 * const *) \ + static ossl_inline sk_##t1##_compfunc sk_##t1##_set_cmp_func(STACK_OF(t1) *sk, sk_##t1##_compfunc compare) \ { \ - return (int (*)(const t3 * const *,const t3 * const *))sk_set_cmp_func((_STACK *)sk, (int (*)(const void *a, const void *b))cmpf); \ + return (sk_##t1##_compfunc)OPENSSL_sk_set_cmp_func((OPENSSL_STACK *)sk, (OPENSSL_sk_compfunc)compare); \ } # define DEFINE_SPECIAL_STACK_OF(t1, t2) SKM_DEFINE_STACK_OF(t1, t2, t2) diff --git a/include/openssl/stack.h b/include/openssl/stack.h index 5a90de637b..6fab33b759 100644 --- a/include/openssl/stack.h +++ b/include/openssl/stack.h @@ -14,33 +14,62 @@ extern "C" { #endif -typedef struct stack_st _STACK; /* Use STACK_OF(...) instead */ - -int sk_num(const _STACK *); -void *sk_value(const _STACK *, int); - -void *sk_set(_STACK *, int, void *); - -_STACK *sk_new(int (*cmp) (const void *, const void *)); -_STACK *sk_new_null(void); -void sk_free(_STACK *); -void sk_pop_free(_STACK *st, void (*func) (void *)); -_STACK *sk_deep_copy(_STACK *, void *(*)(void *), void (*)(void *)); -int sk_insert(_STACK *sk, void *data, int where); -void *sk_delete(_STACK *st, int loc); -void *sk_delete_ptr(_STACK *st, void *p); -int sk_find(_STACK *st, void *data); -int sk_find_ex(_STACK *st, void *data); -int sk_push(_STACK *st, void *data); -int sk_unshift(_STACK *st, void *data); -void *sk_shift(_STACK *st); -void *sk_pop(_STACK *st); -void sk_zero(_STACK *st); -int (*sk_set_cmp_func(_STACK *sk, int (*c) (const void *, const void *))) - (const void *, const void *); -_STACK *sk_dup(_STACK *st); -void sk_sort(_STACK *st); -int sk_is_sorted(const _STACK *st); +typedef struct stack_st OPENSSL_STACK; /* Use STACK_OF(...) instead */ + +typedef int (*OPENSSL_sk_compfunc)(const void *, const void *); +typedef void (*OPENSSL_sk_freefunc)(void *); +typedef void *(*OPENSSL_sk_copyfunc)(const void *); + +int OPENSSL_sk_num(const OPENSSL_STACK *); +void *OPENSSL_sk_value(const OPENSSL_STACK *, int); + +void *OPENSSL_sk_set(OPENSSL_STACK *, int, void *); + +OPENSSL_STACK *OPENSSL_sk_new(OPENSSL_sk_compfunc cmp); +OPENSSL_STACK *OPENSSL_sk_new_null(void); +void OPENSSL_sk_free(OPENSSL_STACK *); +void OPENSSL_sk_pop_free(OPENSSL_STACK *st, void (*func) (void *)); +OPENSSL_STACK *OPENSSL_sk_deep_copy(OPENSSL_STACK *, OPENSSL_sk_copyfunc c, OPENSSL_sk_freefunc f); +int OPENSSL_sk_insert(OPENSSL_STACK *sk, void *data, int where); +void *OPENSSL_sk_delete(OPENSSL_STACK *st, int loc); +void *OPENSSL_sk_delete_ptr(OPENSSL_STACK *st, void *p); +int OPENSSL_sk_find(OPENSSL_STACK *st, void *data); +int OPENSSL_sk_find_ex(OPENSSL_STACK *st, void *data); +int OPENSSL_sk_push(OPENSSL_STACK *st, void *data); +int OPENSSL_sk_unshift(OPENSSL_STACK *st, void *data); +void *OPENSSL_sk_shift(OPENSSL_STACK *st); +void *OPENSSL_sk_pop(OPENSSL_STACK *st); +void OPENSSL_sk_zero(OPENSSL_STACK *st); +OPENSSL_sk_compfunc OPENSSL_sk_set_cmp_func(OPENSSL_STACK *sk, OPENSSL_sk_compfunc cmp); +OPENSSL_STACK *OPENSSL_sk_dup(OPENSSL_STACK *st); +void OPENSSL_sk_sort(OPENSSL_STACK *st); +int OPENSSL_sk_is_sorted(const OPENSSL_STACK *st); + +# if OPENSSL_API_COMPAT < 0x10100000L +# define _STACK OPENSSL_STACK +# define sk_num OPENSSL_sk_num +# define sk_value OPENSSL_sk_value +# define sk_set OPENSSL_sk_set +# define sk_new OPENSSL_sk_new +# define sk_new_null OPENSSL_sk_new_null +# define sk_free OPENSSL_sk_free +# define sk_pop_free OPENSSL_sk_pop_free +# define sk_deep_copy OPENSSL_sk_deep_copy +# define sk_insert OPENSSL_sk_insert +# define sk_delete OPENSSL_sk_delete +# define sk_delete_ptr OPENSSL_sk_delete_ptr +# define sk_find OPENSSL_sk_find +# define sk_find_ex OPENSSL_sk_find_ex +# define sk_push OPENSSL_sk_push +# define sk_unshift OPENSSL_sk_unshift +# define sk_shift OPENSSL_sk_shift +# define sk_pop OPENSSL_sk_pop +# define sk_zero OPENSSL_sk_zero +# define sk_set_cmp_func OPENSSL_sk_set_cmp_func +# define sk_dup OPENSSL_sk_dup +# define sk_sort OPENSSL_sk_sort +# define sk_is_sorted OPENSSL_sk_is_sorted +# endif #ifdef __cplusplus } diff --git a/include/openssl/txt_db.h b/include/openssl/txt_db.h index a12d62f96f..0e6c943e0e 100644 --- a/include/openssl/txt_db.h +++ b/include/openssl/txt_db.h @@ -44,7 +44,7 @@ typedef struct txt_db_st { TXT_DB *TXT_DB_read(BIO *in, int num); long TXT_DB_write(BIO *out, TXT_DB *db); int TXT_DB_create_index(TXT_DB *db, int field, int (*qual) (OPENSSL_STRING *), - LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp); + OPENSSL_LH_HASHFUNC hash, OPENSSL_LH_COMPFUNC cmp); void TXT_DB_free(TXT_DB *db); OPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx, OPENSSL_STRING *value); |