Copyright consolidation 03/10
[openssl.git] / include / openssl / stack.h
1 /*
2  * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3  *
4  * Licensed under the OpenSSL license (the "License").  You may not use
5  * this file except in compliance with the License.  You can obtain a copy
6  * in the file LICENSE in the source distribution or at
7  * https://www.openssl.org/source/license.html
8  */
9
10 #ifndef HEADER_STACK_H
11 # define HEADER_STACK_H
12
13 #ifdef  __cplusplus
14 extern "C" {
15 #endif
16
17 typedef struct stack_st _STACK; /* Use STACK_OF(...) instead */
18
19 int sk_num(const _STACK *);
20 void *sk_value(const _STACK *, int);
21
22 void *sk_set(_STACK *, int, void *);
23
24 _STACK *sk_new(int (*cmp) (const void *, const void *));
25 _STACK *sk_new_null(void);
26 void sk_free(_STACK *);
27 void sk_pop_free(_STACK *st, void (*func) (void *));
28 _STACK *sk_deep_copy(_STACK *, void *(*)(void *), void (*)(void *));
29 int sk_insert(_STACK *sk, void *data, int where);
30 void *sk_delete(_STACK *st, int loc);
31 void *sk_delete_ptr(_STACK *st, void *p);
32 int sk_find(_STACK *st, void *data);
33 int sk_find_ex(_STACK *st, void *data);
34 int sk_push(_STACK *st, void *data);
35 int sk_unshift(_STACK *st, void *data);
36 void *sk_shift(_STACK *st);
37 void *sk_pop(_STACK *st);
38 void sk_zero(_STACK *st);
39 int (*sk_set_cmp_func(_STACK *sk, int (*c) (const void *, const void *)))
40  (const void *, const void *);
41 _STACK *sk_dup(_STACK *st);
42 void sk_sort(_STACK *st);
43 int sk_is_sorted(const _STACK *st);
44
45 #ifdef  __cplusplus
46 }
47 #endif
48
49 #endif