• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _SSL_STACK_H_
2 #define _SSL_STACK_H_
3 
4 #ifdef __cplusplus
5  extern "C" {
6 #endif
7 
8 #include "ssl_types.h"
9 
10 #define STACK_OF(type)  struct stack_st_##type
11 
12 #define SKM_DEFINE_STACK_OF(t1, t2, t3) \
13     STACK_OF(t1); \
14     static ossl_inline STACK_OF(t1) *sk_##t1##_new_null(void) \
15     { \
16         return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
17     } \
18 
19 #define DEFINE_STACK_OF(t) SKM_DEFINE_STACK_OF(t, t, t)
20 
21 /**
22  * @brief create a openssl stack object
23  *
24  * @param c - stack function
25  *
26  * @return openssl stack object point
27  */
28 OPENSSL_STACK* OPENSSL_sk_new(OPENSSL_sk_compfunc c);
29 
30 /**
31  * @brief create a NULL function openssl stack object
32  *
33  * @param none
34  *
35  * @return openssl stack object point
36  */
37 OPENSSL_STACK *OPENSSL_sk_new_null(void);
38 
39 /**
40  * @brief free openssl stack object
41  *
42  * @param openssl stack object point
43  *
44  * @return none
45  */
46 void OPENSSL_sk_free(OPENSSL_STACK *stack);
47 
48 #ifdef __cplusplus
49 }
50 #endif
51 
52 #endif
53