mirror of
https://github.com/openssl/openssl.git
synced 2025-03-19 19:50:42 +08:00
Add ossl_sa symbols
Partial fix for #12964 Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14473)
This commit is contained in:
parent
8a6e912520
commit
ff0266eddc
@ -60,7 +60,7 @@ struct sparse_array_st {
|
||||
void **nodes;
|
||||
};
|
||||
|
||||
OPENSSL_SA *OPENSSL_SA_new(void)
|
||||
OPENSSL_SA *ossl_sa_new(void)
|
||||
{
|
||||
OPENSSL_SA *res = OPENSSL_zalloc(sizeof(*res));
|
||||
|
||||
@ -112,13 +112,13 @@ static void sa_free_leaf(ossl_uintmax_t n, void *p, void *arg)
|
||||
OPENSSL_free(p);
|
||||
}
|
||||
|
||||
void OPENSSL_SA_free(OPENSSL_SA *sa)
|
||||
void ossl_sa_free(OPENSSL_SA *sa)
|
||||
{
|
||||
sa_doall(sa, &sa_free_node, NULL, NULL);
|
||||
OPENSSL_free(sa);
|
||||
}
|
||||
|
||||
void OPENSSL_SA_free_leaves(OPENSSL_SA *sa)
|
||||
void ossl_sa_free_leaves(OPENSSL_SA *sa)
|
||||
{
|
||||
sa_doall(sa, &sa_free_node, &sa_free_leaf, NULL);
|
||||
OPENSSL_free(sa);
|
||||
@ -134,8 +134,7 @@ static void trampoline(ossl_uintmax_t n, void *l, void *arg)
|
||||
((const struct trampoline_st *)arg)->func(n, l);
|
||||
}
|
||||
|
||||
void OPENSSL_SA_doall(const OPENSSL_SA *sa, void (*leaf)(ossl_uintmax_t,
|
||||
void *))
|
||||
void ossl_sa_doall(const OPENSSL_SA *sa, void (*leaf)(ossl_uintmax_t, void *))
|
||||
{
|
||||
struct trampoline_st tramp;
|
||||
|
||||
@ -144,7 +143,7 @@ void OPENSSL_SA_doall(const OPENSSL_SA *sa, void (*leaf)(ossl_uintmax_t,
|
||||
sa_doall(sa, NULL, &trampoline, &tramp);
|
||||
}
|
||||
|
||||
void OPENSSL_SA_doall_arg(const OPENSSL_SA *sa,
|
||||
void ossl_sa_doall_arg(const OPENSSL_SA *sa,
|
||||
void (*leaf)(ossl_uintmax_t, void *, void *),
|
||||
void *arg)
|
||||
{
|
||||
@ -152,12 +151,12 @@ void OPENSSL_SA_doall_arg(const OPENSSL_SA *sa,
|
||||
sa_doall(sa, NULL, leaf, arg);
|
||||
}
|
||||
|
||||
size_t OPENSSL_SA_num(const OPENSSL_SA *sa)
|
||||
size_t ossl_sa_num(const OPENSSL_SA *sa)
|
||||
{
|
||||
return sa == NULL ? 0 : sa->nelem;
|
||||
}
|
||||
|
||||
void *OPENSSL_SA_get(const OPENSSL_SA *sa, ossl_uintmax_t n)
|
||||
void *ossl_sa_get(const OPENSSL_SA *sa, ossl_uintmax_t n)
|
||||
{
|
||||
int level;
|
||||
void **p, *r = NULL;
|
||||
@ -180,7 +179,7 @@ static ossl_inline void **alloc_node(void)
|
||||
return OPENSSL_zalloc(SA_BLOCK_MAX * sizeof(void *));
|
||||
}
|
||||
|
||||
int OPENSSL_SA_set(OPENSSL_SA *sa, ossl_uintmax_t posn, void *val)
|
||||
int ossl_sa_set(OPENSSL_SA *sa, ossl_uintmax_t posn, void *val)
|
||||
{
|
||||
int i, level = 1;
|
||||
ossl_uintmax_t n = posn;
|
||||
|
@ -25,44 +25,48 @@ extern "C" {
|
||||
static ossl_unused ossl_inline SPARSE_ARRAY_OF(type) * \
|
||||
ossl_sa_##type##_new(void) \
|
||||
{ \
|
||||
return (SPARSE_ARRAY_OF(type) *)OPENSSL_SA_new(); \
|
||||
return (SPARSE_ARRAY_OF(type) *)ossl_sa_new(); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void ossl_sa_##type##_free(SPARSE_ARRAY_OF(type) *sa) \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_sa_##type##_free(SPARSE_ARRAY_OF(type) *sa) \
|
||||
{ \
|
||||
OPENSSL_SA_free((OPENSSL_SA *)sa); \
|
||||
ossl_sa_free((OPENSSL_SA *)sa); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void ossl_sa_##type##_free_leaves(SPARSE_ARRAY_OF(type) *sa) \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_sa_##type##_free_leaves(SPARSE_ARRAY_OF(type) *sa) \
|
||||
{ \
|
||||
OPENSSL_SA_free_leaves((OPENSSL_SA *)sa); \
|
||||
ossl_sa_free_leaves((OPENSSL_SA *)sa); \
|
||||
} \
|
||||
static ossl_unused ossl_inline size_t ossl_sa_##type##_num(const SPARSE_ARRAY_OF(type) *sa) \
|
||||
static ossl_unused ossl_inline size_t \
|
||||
ossl_sa_##type##_num(const SPARSE_ARRAY_OF(type) *sa) \
|
||||
{ \
|
||||
return OPENSSL_SA_num((OPENSSL_SA *)sa); \
|
||||
return ossl_sa_num((OPENSSL_SA *)sa); \
|
||||
} \
|
||||
static ossl_unused ossl_inline void ossl_sa_##type##_doall(const SPARSE_ARRAY_OF(type) *sa, \
|
||||
void (*leaf)(ossl_uintmax_t, \
|
||||
type *)) \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_sa_##type##_doall(const SPARSE_ARRAY_OF(type) *sa, \
|
||||
void (*leaf)(ossl_uintmax_t, type *)) \
|
||||
{ \
|
||||
OPENSSL_SA_doall((OPENSSL_SA *)sa, (void (*)(ossl_uintmax_t, void *))leaf); \
|
||||
ossl_sa_doall((OPENSSL_SA *)sa, \
|
||||
(void (*)(ossl_uintmax_t, void *))leaf); \
|
||||
} \
|
||||
static ossl_unused ossl_inline \
|
||||
void ossl_sa_##type##_doall_arg(const SPARSE_ARRAY_OF(type) *sa, \
|
||||
void (*leaf)(ossl_uintmax_t, type *, void *), \
|
||||
void *arg) \
|
||||
static ossl_unused ossl_inline void \
|
||||
ossl_sa_##type##_doall_arg(const SPARSE_ARRAY_OF(type) *sa, \
|
||||
void (*leaf)(ossl_uintmax_t, type *, void *), \
|
||||
void *arg) \
|
||||
{ \
|
||||
OPENSSL_SA_doall_arg((OPENSSL_SA *)sa, (void (*)(ossl_uintmax_t, void *, \
|
||||
void *))leaf, \
|
||||
arg); \
|
||||
ossl_sa_doall_arg((OPENSSL_SA *)sa, \
|
||||
(void (*)(ossl_uintmax_t, void *, void *))leaf, arg); \
|
||||
} \
|
||||
static ossl_unused ossl_inline ctype *ossl_sa_##type##_get(const SPARSE_ARRAY_OF(type) *sa, \
|
||||
ossl_uintmax_t n) \
|
||||
static ossl_unused ossl_inline ctype \
|
||||
*ossl_sa_##type##_get(const SPARSE_ARRAY_OF(type) *sa, ossl_uintmax_t n) \
|
||||
{ \
|
||||
return (type *)OPENSSL_SA_get((OPENSSL_SA *)sa, n); \
|
||||
return (type *)ossl_sa_get((OPENSSL_SA *)sa, n); \
|
||||
} \
|
||||
static ossl_unused ossl_inline int ossl_sa_##type##_set(SPARSE_ARRAY_OF(type) *sa, \
|
||||
ossl_uintmax_t n, ctype *val) \
|
||||
static ossl_unused ossl_inline int \
|
||||
ossl_sa_##type##_set(SPARSE_ARRAY_OF(type) *sa, \
|
||||
ossl_uintmax_t n, ctype *val) \
|
||||
{ \
|
||||
return OPENSSL_SA_set((OPENSSL_SA *)sa, n, (void *)val); \
|
||||
return ossl_sa_set((OPENSSL_SA *)sa, n, (void *)val); \
|
||||
} \
|
||||
SPARSE_ARRAY_OF(type)
|
||||
|
||||
@ -72,16 +76,15 @@ extern "C" {
|
||||
DEFINE_SPARSE_ARRAY_OF_INTERNAL(type, const type)
|
||||
|
||||
typedef struct sparse_array_st OPENSSL_SA;
|
||||
OPENSSL_SA *OPENSSL_SA_new(void);
|
||||
void OPENSSL_SA_free(OPENSSL_SA *sa);
|
||||
void OPENSSL_SA_free_leaves(OPENSSL_SA *sa);
|
||||
size_t OPENSSL_SA_num(const OPENSSL_SA *sa);
|
||||
void OPENSSL_SA_doall(const OPENSSL_SA *sa,
|
||||
void (*leaf)(ossl_uintmax_t, void *));
|
||||
void OPENSSL_SA_doall_arg(const OPENSSL_SA *sa,
|
||||
void (*leaf)(ossl_uintmax_t, void *, void *), void *);
|
||||
void *OPENSSL_SA_get(const OPENSSL_SA *sa, ossl_uintmax_t n);
|
||||
int OPENSSL_SA_set(OPENSSL_SA *sa, ossl_uintmax_t n, void *val);
|
||||
OPENSSL_SA *ossl_sa_new(void);
|
||||
void ossl_sa_free(OPENSSL_SA *sa);
|
||||
void ossl_sa_free_leaves(OPENSSL_SA *sa);
|
||||
size_t ossl_sa_num(const OPENSSL_SA *sa);
|
||||
void ossl_sa_doall(const OPENSSL_SA *sa, void (*leaf)(ossl_uintmax_t, void *));
|
||||
void ossl_sa_doall_arg(const OPENSSL_SA *sa,
|
||||
void (*leaf)(ossl_uintmax_t, void *, void *), void *);
|
||||
void *ossl_sa_get(const OPENSSL_SA *sa, ossl_uintmax_t n);
|
||||
int ossl_sa_set(OPENSSL_SA *sa, ossl_uintmax_t n, void *val);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user