jpayne@69: /* jpayne@69: * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. jpayne@69: * jpayne@69: * Licensed under the OpenSSL license (the "License"). You may not use jpayne@69: * this file except in compliance with the License. You can obtain a copy jpayne@69: * in the file LICENSE in the source distribution or at jpayne@69: * https://www.openssl.org/source/license.html jpayne@69: */ jpayne@69: jpayne@69: #ifndef HEADER_STACK_H jpayne@69: # define HEADER_STACK_H jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: extern "C" { jpayne@69: #endif jpayne@69: jpayne@69: typedef struct stack_st OPENSSL_STACK; /* Use STACK_OF(...) instead */ jpayne@69: jpayne@69: typedef int (*OPENSSL_sk_compfunc)(const void *, const void *); jpayne@69: typedef void (*OPENSSL_sk_freefunc)(void *); jpayne@69: typedef void *(*OPENSSL_sk_copyfunc)(const void *); jpayne@69: jpayne@69: int OPENSSL_sk_num(const OPENSSL_STACK *); jpayne@69: void *OPENSSL_sk_value(const OPENSSL_STACK *, int); jpayne@69: jpayne@69: void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data); jpayne@69: jpayne@69: OPENSSL_STACK *OPENSSL_sk_new(OPENSSL_sk_compfunc cmp); jpayne@69: OPENSSL_STACK *OPENSSL_sk_new_null(void); jpayne@69: OPENSSL_STACK *OPENSSL_sk_new_reserve(OPENSSL_sk_compfunc c, int n); jpayne@69: int OPENSSL_sk_reserve(OPENSSL_STACK *st, int n); jpayne@69: void OPENSSL_sk_free(OPENSSL_STACK *); jpayne@69: void OPENSSL_sk_pop_free(OPENSSL_STACK *st, void (*func) (void *)); jpayne@69: OPENSSL_STACK *OPENSSL_sk_deep_copy(const OPENSSL_STACK *, jpayne@69: OPENSSL_sk_copyfunc c, jpayne@69: OPENSSL_sk_freefunc f); jpayne@69: int OPENSSL_sk_insert(OPENSSL_STACK *sk, const void *data, int where); jpayne@69: void *OPENSSL_sk_delete(OPENSSL_STACK *st, int loc); jpayne@69: void *OPENSSL_sk_delete_ptr(OPENSSL_STACK *st, const void *p); jpayne@69: int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data); jpayne@69: int OPENSSL_sk_find_ex(OPENSSL_STACK *st, const void *data); jpayne@69: int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data); jpayne@69: int OPENSSL_sk_unshift(OPENSSL_STACK *st, const void *data); jpayne@69: void *OPENSSL_sk_shift(OPENSSL_STACK *st); jpayne@69: void *OPENSSL_sk_pop(OPENSSL_STACK *st); jpayne@69: void OPENSSL_sk_zero(OPENSSL_STACK *st); jpayne@69: OPENSSL_sk_compfunc OPENSSL_sk_set_cmp_func(OPENSSL_STACK *sk, jpayne@69: OPENSSL_sk_compfunc cmp); jpayne@69: OPENSSL_STACK *OPENSSL_sk_dup(const OPENSSL_STACK *st); jpayne@69: void OPENSSL_sk_sort(OPENSSL_STACK *st); jpayne@69: int OPENSSL_sk_is_sorted(const OPENSSL_STACK *st); jpayne@69: jpayne@69: # if OPENSSL_API_COMPAT < 0x10100000L jpayne@69: # define _STACK OPENSSL_STACK jpayne@69: # define sk_num OPENSSL_sk_num jpayne@69: # define sk_value OPENSSL_sk_value jpayne@69: # define sk_set OPENSSL_sk_set jpayne@69: # define sk_new OPENSSL_sk_new jpayne@69: # define sk_new_null OPENSSL_sk_new_null jpayne@69: # define sk_free OPENSSL_sk_free jpayne@69: # define sk_pop_free OPENSSL_sk_pop_free jpayne@69: # define sk_deep_copy OPENSSL_sk_deep_copy jpayne@69: # define sk_insert OPENSSL_sk_insert jpayne@69: # define sk_delete OPENSSL_sk_delete jpayne@69: # define sk_delete_ptr OPENSSL_sk_delete_ptr jpayne@69: # define sk_find OPENSSL_sk_find jpayne@69: # define sk_find_ex OPENSSL_sk_find_ex jpayne@69: # define sk_push OPENSSL_sk_push jpayne@69: # define sk_unshift OPENSSL_sk_unshift jpayne@69: # define sk_shift OPENSSL_sk_shift jpayne@69: # define sk_pop OPENSSL_sk_pop jpayne@69: # define sk_zero OPENSSL_sk_zero jpayne@69: # define sk_set_cmp_func OPENSSL_sk_set_cmp_func jpayne@69: # define sk_dup OPENSSL_sk_dup jpayne@69: # define sk_sort OPENSSL_sk_sort jpayne@69: # define sk_is_sorted OPENSSL_sk_is_sorted jpayne@69: # endif jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: #endif