Merge in code from main trunk to BRANCH_engine.
This commit is contained in:
@@ -57,6 +57,8 @@
|
||||
|
||||
#include <openssl/stack.h>
|
||||
|
||||
#ifdef DEBUG_SAFESTACK
|
||||
|
||||
#define STACK_OF(type) struct stack_st_##type
|
||||
#define PREDECLARE_STACK_OF(type) STACK_OF(type);
|
||||
|
||||
@@ -65,7 +67,8 @@ STACK_OF(type) \
|
||||
{ \
|
||||
STACK stack; \
|
||||
}; \
|
||||
STACK_OF(type) *sk_##type##_new(int (*cmp)(type **,type **)); \
|
||||
STACK_OF(type) *sk_##type##_new(int (*cmp)(const type * const *, \
|
||||
const type * const *)); \
|
||||
STACK_OF(type) *sk_##type##_new_null(void); \
|
||||
void sk_##type##_free(STACK_OF(type) *sk); \
|
||||
int sk_##type##_num(const STACK_OF(type) *sk); \
|
||||
@@ -76,10 +79,11 @@ int sk_##type##_push(STACK_OF(type) *sk,type *v); \
|
||||
int sk_##type##_unshift(STACK_OF(type) *sk,type *v); \
|
||||
int sk_##type##_find(STACK_OF(type) *sk,type *v); \
|
||||
type *sk_##type##_delete(STACK_OF(type) *sk,int n); \
|
||||
void sk_##type##_delete_ptr(STACK_OF(type) *sk,type *v); \
|
||||
type *sk_##type##_delete_ptr(STACK_OF(type) *sk,type *v); \
|
||||
int sk_##type##_insert(STACK_OF(type) *sk,type *v,int n); \
|
||||
int (*sk_##type##_set_cmp_func(STACK_OF(type) *sk, \
|
||||
int (*cmp)(type **,type **)))(type **,type **); \
|
||||
int (*cmp)(const type * const *,const type * const *))) \
|
||||
(const type * const *,const type * const *); \
|
||||
STACK_OF(type) *sk_##type##_dup(STACK_OF(type) *sk); \
|
||||
void sk_##type##_pop_free(STACK_OF(type) *sk,void (*func)(type *)); \
|
||||
type *sk_##type##_shift(STACK_OF(type) *sk); \
|
||||
@@ -87,8 +91,10 @@ type *sk_##type##_pop(STACK_OF(type) *sk); \
|
||||
void sk_##type##_sort(STACK_OF(type) *sk);
|
||||
|
||||
#define IMPLEMENT_STACK_OF(type) \
|
||||
STACK_OF(type) *sk_##type##_new(int (*cmp)(type **,type **)) \
|
||||
{ return (STACK_OF(type) *)sk_new((int (*)())cmp); } \
|
||||
STACK_OF(type) *sk_##type##_new(int (*cmp)(const type * const *, \
|
||||
const type * const *)) \
|
||||
{ return (STACK_OF(type) *)sk_new( \
|
||||
(int (*)(const char * const *,const char * const *))cmp); } \
|
||||
STACK_OF(type) *sk_##type##_new_null() \
|
||||
{ return (STACK_OF(type) *)sk_new_null(); } \
|
||||
void sk_##type##_free(STACK_OF(type) *sk) \
|
||||
@@ -109,13 +115,15 @@ int sk_##type##_find(STACK_OF(type) *sk,type *v) \
|
||||
{ return sk_find((STACK *)sk,(char *)v); } \
|
||||
type *sk_##type##_delete(STACK_OF(type) *sk,int n) \
|
||||
{ return (type *)sk_delete((STACK *)sk,n); } \
|
||||
void sk_##type##_delete_ptr(STACK_OF(type) *sk,type *v) \
|
||||
{ sk_delete_ptr((STACK *)sk,(char *)v); } \
|
||||
type *sk_##type##_delete_ptr(STACK_OF(type) *sk,type *v) \
|
||||
{ return (type *)sk_delete_ptr((STACK *)sk,(char *)v); } \
|
||||
int sk_##type##_insert(STACK_OF(type) *sk,type *v,int n) \
|
||||
{ return sk_insert((STACK *)sk,(char *)v,n); } \
|
||||
int (*sk_##type##_set_cmp_func(STACK_OF(type) *sk, \
|
||||
int (*cmp)(type **,type **)))(type **,type **) \
|
||||
{ return (int (*)(type **,type **))sk_set_cmp_func((STACK *)sk,(int(*)(const void *, const void *))cmp); } \
|
||||
int (*cmp)(const type * const *,const type * const *))) \
|
||||
(const type * const *,const type * const *) \
|
||||
{ return (int (*)(const type * const *,const type * const *))sk_set_cmp_func( \
|
||||
(STACK *)sk, (int(*)(const char * const *, const char * const *))cmp); } \
|
||||
STACK_OF(type) *sk_##type##_dup(STACK_OF(type) *sk) \
|
||||
{ return (STACK_OF(type) *)sk_dup((STACK *)sk); } \
|
||||
void sk_##type##_pop_free(STACK_OF(type) *sk,void (*func)(type *)) \
|
||||
@@ -127,4 +135,13 @@ type *sk_##type##_pop(STACK_OF(type) *sk) \
|
||||
void sk_##type##_sort(STACK_OF(type) *sk) \
|
||||
{ sk_sort((STACK *)sk); }
|
||||
|
||||
#else
|
||||
|
||||
#define STACK_OF(type) STACK
|
||||
#define PREDECLARE_STACK_OF(type) /* nada */
|
||||
#define DECLARE_STACK_OF(type) /* nada */
|
||||
#define IMPLEMENT_STACK_OF(type) /* nada */
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* ndef HEADER_SAFESTACK_H */
|
||||
|
||||
Reference in New Issue
Block a user