yuezonghe | 824eb0c | 2024-06-27 02:32:26 -0700 | [diff] [blame] | 1 | /* stack.h |
| 2 | * |
| 3 | * Copyright (C) 2006-2021 wolfSSL Inc. |
| 4 | * |
| 5 | * This file is part of wolfSSL. |
| 6 | * |
| 7 | * wolfSSL is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or |
| 10 | * (at your option) any later version. |
| 11 | * |
| 12 | * wolfSSL is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA |
| 20 | */ |
| 21 | |
| 22 | /* stack.h for openSSL */ |
| 23 | |
| 24 | #ifndef WOLFSSL_STACK_H_ |
| 25 | #define WOLFSSL_STACK_H_ |
| 26 | |
| 27 | #ifdef __cplusplus |
| 28 | extern "C" { |
| 29 | #endif |
| 30 | |
| 31 | typedef void (*wolfSSL_sk_freefunc)(void *); |
| 32 | |
| 33 | WOLFSSL_API void wolfSSL_sk_GENERIC_pop_free(WOLFSSL_STACK* sk, wolfSSL_sk_freefunc); |
| 34 | WOLFSSL_API void wolfSSL_sk_GENERIC_free(WOLFSSL_STACK *); |
| 35 | WOLFSSL_API int wolfSSL_sk_GENERIC_push(WOLFSSL_STACK *sk, void *data); |
| 36 | WOLFSSL_API void wolfSSL_sk_pop_free(WOLFSSL_STACK *st, void (*func) (void *)); |
| 37 | WOLFSSL_API WOLFSSL_STACK *wolfSSL_sk_new_null(void); |
| 38 | |
| 39 | WOLFSSL_API int wolfSSL_sk_CIPHER_push(WOLFSSL_STACK *st,WOLFSSL_CIPHER *cipher); |
| 40 | WOLFSSL_API WOLFSSL_CIPHER* wolfSSL_sk_CIPHER_pop(WOLF_STACK_OF(WOLFSSL_CIPHER)* sk); |
| 41 | WOLFSSL_API WOLFSSL_STACK* wolfSSL_sk_new_cipher(void); |
| 42 | |
| 43 | #define OPENSSL_sk_free wolfSSL_sk_free |
| 44 | #define OPENSSL_sk_pop_free wolfSSL_sk_pop_free |
| 45 | #define OPENSSL_sk_new_null wolfSSL_sk_new_null |
| 46 | #define OPENSSL_sk_push wolfSSL_sk_push |
| 47 | |
| 48 | /* provides older OpenSSL API compatibility */ |
| 49 | #define sk_free OPENSSL_sk_free |
| 50 | #define sk_pop_free OPENSSL_sk_pop_free |
| 51 | #define sk_new_null OPENSSL_sk_new_null |
| 52 | #define sk_push OPENSSL_sk_push |
| 53 | |
| 54 | #ifdef __cplusplus |
| 55 | } |
| 56 | #endif |
| 57 | |
| 58 | #endif |