]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - secure/lib/libcrypto/man/DEFINE_STACK_OF.3
MFC: r340703
[FreeBSD/FreeBSD.git] / secure / lib / libcrypto / man / DEFINE_STACK_OF.3
1 .\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
6 .if t .sp .5v
7 .if n .sp
8 ..
9 .de Vb \" Begin verbatim text
10 .ft CW
11 .nf
12 .ne \\$1
13 ..
14 .de Ve \" End verbatim text
15 .ft R
16 .fi
17 ..
18 .\" Set up some character translations and predefined strings.  \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
21 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
24 .tr \(*W-
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26 .ie n \{\
27 .    ds -- \(*W-
28 .    ds PI pi
29 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
31 .    ds L" ""
32 .    ds R" ""
33 .    ds C` ""
34 .    ds C' ""
35 'br\}
36 .el\{\
37 .    ds -- \|\(em\|
38 .    ds PI \(*p
39 .    ds L" ``
40 .    ds R" ''
41 .    ds C`
42 .    ds C'
43 'br\}
44 .\"
45 .\" Escape single quotes in literal strings from groff's Unicode transform.
46 .ie \n(.g .ds Aq \(aq
47 .el       .ds Aq '
48 .\"
49 .\" If the F register is >0, we'll generate index entries on stderr for
50 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
51 .\" entries marked with X<> in POD.  Of course, you'll have to process the
52 .\" output yourself in some meaningful fashion.
53 .\"
54 .\" Avoid warning from groff about undefined register 'F'.
55 .de IX
56 ..
57 .if !\nF .nr F 0
58 .if \nF>0 \{\
59 .    de IX
60 .    tm Index:\\$1\t\\n%\t"\\$2"
61 ..
62 .    if !\nF==2 \{\
63 .        nr % 0
64 .        nr F 2
65 .    \}
66 .\}
67 .\"
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
70 .    \" fudge factors for nroff and troff
71 .if n \{\
72 .    ds #H 0
73 .    ds #V .8m
74 .    ds #F .3m
75 .    ds #[ \f1
76 .    ds #] \fP
77 .\}
78 .if t \{\
79 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 .    ds #V .6m
81 .    ds #F 0
82 .    ds #[ \&
83 .    ds #] \&
84 .\}
85 .    \" simple accents for nroff and troff
86 .if n \{\
87 .    ds ' \&
88 .    ds ` \&
89 .    ds ^ \&
90 .    ds , \&
91 .    ds ~ ~
92 .    ds /
93 .\}
94 .if t \{\
95 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101 .\}
102 .    \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 .    \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 .    \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
117 \{\
118 .    ds : e
119 .    ds 8 ss
120 .    ds o a
121 .    ds d- d\h'-1'\(ga
122 .    ds D- D\h'-1'\(hy
123 .    ds th \o'bp'
124 .    ds Th \o'LP'
125 .    ds ae ae
126 .    ds Ae AE
127 .\}
128 .rm #[ #] #H #V #F C
129 .\" ========================================================================
130 .\"
131 .IX Title "DEFINE_STACK_OF 3"
132 .TH DEFINE_STACK_OF 3 "2018-11-20" "1.1.1a" "OpenSSL"
133 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
134 .\" way too many mistakes in technical documents.
135 .if n .ad l
136 .nh
137 .SH "NAME"
138 DEFINE_STACK_OF, DEFINE_STACK_OF_CONST, DEFINE_SPECIAL_STACK_OF, DEFINE_SPECIAL_STACK_OF_CONST, sk_TYPE_num, sk_TYPE_value, sk_TYPE_new, sk_TYPE_new_null, sk_TYPE_reserve, sk_TYPE_free, sk_TYPE_zero, sk_TYPE_delete, sk_TYPE_delete_ptr, sk_TYPE_push, sk_TYPE_unshift, sk_TYPE_pop, sk_TYPE_shift, sk_TYPE_pop_free, sk_TYPE_insert, sk_TYPE_set, sk_TYPE_find, sk_TYPE_find_ex, sk_TYPE_sort, sk_TYPE_is_sorted, sk_TYPE_dup, sk_TYPE_deep_copy, sk_TYPE_set_cmp_func, sk_TYPE_new_reserve \&\- stack container
139 .SH "SYNOPSIS"
140 .IX Header "SYNOPSIS"
141 .Vb 1
142 \& #include <openssl/safestack.h>
143 \&
144 \& STACK_OF(TYPE)
145 \& DEFINE_STACK_OF(TYPE)
146 \& DEFINE_STACK_OF_CONST(TYPE)
147 \& DEFINE_SPECIAL_STACK_OF(FUNCTYPE, TYPE)
148 \& DEFINE_SPECIAL_STACK_OF_CONST(FUNCTYPE, TYPE)
149 \&
150 \& typedef int (*sk_TYPE_compfunc)(const TYPE *const *a, const TYPE *const *b);
151 \& typedef TYPE * (*sk_TYPE_copyfunc)(const TYPE *a);
152 \& typedef void (*sk_TYPE_freefunc)(TYPE *a);
153 \&
154 \& int sk_TYPE_num(const STACK_OF(TYPE) *sk);
155 \& TYPE *sk_TYPE_value(const STACK_OF(TYPE) *sk, int idx);
156 \& STACK_OF(TYPE) *sk_TYPE_new(sk_TYPE_compfunc compare);
157 \& STACK_OF(TYPE) *sk_TYPE_new_null(void);
158 \& int sk_TYPE_reserve(STACK_OF(TYPE) *sk, int n);
159 \& void sk_TYPE_free(const STACK_OF(TYPE) *sk);
160 \& void sk_TYPE_zero(const STACK_OF(TYPE) *sk);
161 \& TYPE *sk_TYPE_delete(STACK_OF(TYPE) *sk, int i);
162 \& TYPE *sk_TYPE_delete_ptr(STACK_OF(TYPE) *sk, TYPE *ptr);
163 \& int sk_TYPE_push(STACK_OF(TYPE) *sk, const TYPE *ptr);
164 \& int sk_TYPE_unshift(STACK_OF(TYPE) *sk, const TYPE *ptr);
165 \& TYPE *sk_TYPE_pop(STACK_OF(TYPE) *sk);
166 \& TYPE *sk_TYPE_shift(STACK_OF(TYPE) *sk);
167 \& void sk_TYPE_pop_free(STACK_OF(TYPE) *sk, sk_TYPE_freefunc freefunc);
168 \& int sk_TYPE_insert(STACK_OF(TYPE) *sk, TYPE *ptr, int idx);
169 \& TYPE *sk_TYPE_set(STACK_OF(TYPE) *sk, int idx, const TYPE *ptr);
170 \& int sk_TYPE_find(STACK_OF(TYPE) *sk, TYPE *ptr);
171 \& int sk_TYPE_find_ex(STACK_OF(TYPE) *sk, TYPE *ptr);
172 \& void sk_TYPE_sort(const STACK_OF(TYPE) *sk);
173 \& int sk_TYPE_is_sorted(const STACK_OF(TYPE) *sk);
174 \& STACK_OF(TYPE) *sk_TYPE_dup(const STACK_OF(TYPE) *sk);
175 \& STACK_OF(TYPE) *sk_TYPE_deep_copy(const STACK_OF(TYPE) *sk,
176 \&                                   sk_TYPE_copyfunc copyfunc,
177 \&                                   sk_TYPE_freefunc freefunc);
178 \& sk_TYPE_compfunc (*sk_TYPE_set_cmp_func(STACK_OF(TYPE) *sk,
179 \&                                         sk_TYPE_compfunc compare));
180 \& STACK_OF(TYPE) *sk_TYPE_new_reserve(sk_TYPE_compfunc compare, int n);
181 .Ve
182 .SH "DESCRIPTION"
183 .IX Header "DESCRIPTION"
184 Applications can create and use their own stacks by placing any of the macros
185 described below in a header file. These macros define typesafe inline
186 functions that wrap around the utility \fBOPENSSL_sk_\fR \s-1API.\s0
187 In the description here, \fI\s-1TYPE\s0\fR is used
188 as a placeholder for any of the OpenSSL datatypes, such as \fIX509\fR.
189 .PP
190 \&\s-1\fISTACK_OF\s0()\fR returns the name for a stack of the specified \fB\s-1TYPE\s0\fR.
191 \&\s-1\fIDEFINE_STACK_OF\s0()\fR creates set of functions for a stack of \fB\s-1TYPE\s0\fR. This
192 will mean that type \fB\s-1TYPE\s0\fR is stored in each stack, the type is referenced by
193 \&\s-1STACK_OF\s0(\s-1TYPE\s0) and each function name begins with \fIsk_TYPE_\fR. For example:
194 .PP
195 .Vb 1
196 \& TYPE *sk_TYPE_value(STACK_OF(TYPE) *sk, int idx);
197 .Ve
198 .PP
199 \&\s-1\fIDEFINE_STACK_OF_CONST\s0()\fR is identical to \s-1\fIDEFINE_STACK_OF\s0()\fR except
200 each element is constant. For example:
201 .PP
202 .Vb 1
203 \& const TYPE *sk_TYPE_value(STACK_OF(TYPE) *sk, int idx);
204 .Ve
205 .PP
206 \&\s-1\fIDEFINE_SPECIAL_STACK_OF\s0()\fR defines a stack of \fB\s-1TYPE\s0\fR but
207 each function uses \fB\s-1FUNCNAME\s0\fR in the function name. For example:
208 .PP
209 .Vb 1
210 \& TYPE *sk_FUNCNAME_value(STACK_OF(TYPE) *sk, int idx);
211 .Ve
212 .PP
213 \&\s-1\fIDEFINE_SPECIAL_STACK_OF_CONST\s0()\fR is similar except that each element is
214 constant:
215 .PP
216 .Vb 1
217 \& const TYPE *sk_FUNCNAME_value(STACK_OF(TYPE) *sk, int idx);
218 .Ve
219 .PP
220 \&\fIsk_TYPE_num()\fR returns the number of elements in \fBsk\fR or \-1 if \fBsk\fR is
221 \&\fB\s-1NULL\s0\fR.
222 .PP
223 \&\fIsk_TYPE_value()\fR returns element \fBidx\fR in \fBsk\fR, where \fBidx\fR starts at
224 zero. If \fBidx\fR is out of range then \fB\s-1NULL\s0\fR is returned.
225 .PP
226 \&\fIsk_TYPE_new()\fR allocates a new empty stack using comparison function \fBcompare\fR.
227 If \fBcompare\fR is \fB\s-1NULL\s0\fR then no comparison function is used. This function is
228 equivalent to sk_TYPE_new_reserve(compare, 0).
229 .PP
230 \&\fIsk_TYPE_new_null()\fR allocates a new empty stack with no comparison function. This
231 function is equivalent to sk_TYPE_new_reserve(\s-1NULL, 0\s0).
232 .PP
233 \&\fIsk_TYPE_reserve()\fR allocates additional memory in the \fBsk\fR structure
234 such that the next \fBn\fR calls to \fIsk_TYPE_insert()\fR, \fIsk_TYPE_push()\fR
235 or \fIsk_TYPE_unshift()\fR will not fail or cause memory to be allocated
236 or reallocated. If \fBn\fR is zero, any excess space allocated in the
237 \&\fBsk\fR structure is freed. On error \fBsk\fR is unchanged.
238 .PP
239 \&\fIsk_TYPE_new_reserve()\fR allocates a new stack. The new stack will have additional
240 memory allocated to hold \fBn\fR elements if \fBn\fR is positive. The next \fBn\fR calls
241 to \fIsk_TYPE_insert()\fR, \fIsk_TYPE_push()\fR or \fIsk_TYPE_unshift()\fR will not fail or cause
242 memory to be allocated or reallocated. If \fBn\fR is zero or less than zero, no
243 memory is allocated. \fIsk_TYPE_new_reserve()\fR also sets the comparison function
244 \&\fBcompare\fR to the newly created stack. If \fBcompare\fR is \fB\s-1NULL\s0\fR then no
245 comparison function is used.
246 .PP
247 \&\fIsk_TYPE_set_cmp_func()\fR sets the comparison function of \fBsk\fR to \fBcompare\fR.
248 The previous comparison function is returned or \fB\s-1NULL\s0\fR if there was
249 no previous comparison function.
250 .PP
251 \&\fIsk_TYPE_free()\fR frees up the \fBsk\fR structure. It does \fBnot\fR free up any
252 elements of \fBsk\fR. After this call \fBsk\fR is no longer valid.
253 .PP
254 \&\fIsk_TYPE_zero()\fR sets the number of elements in \fBsk\fR to zero. It does not free
255 \&\fBsk\fR so after this call \fBsk\fR is still valid.
256 .PP
257 \&\fIsk_TYPE_pop_free()\fR frees up all elements of \fBsk\fR and \fBsk\fR itself. The
258 free function \fIfreefunc()\fR is called on each element to free it.
259 .PP
260 \&\fIsk_TYPE_delete()\fR deletes element \fBi\fR from \fBsk\fR. It returns the deleted
261 element or \fB\s-1NULL\s0\fR if \fBi\fR is out of range.
262 .PP
263 \&\fIsk_TYPE_delete_ptr()\fR deletes element matching \fBptr\fR from \fBsk\fR. It returns
264 the deleted element or \fB\s-1NULL\s0\fR if no element matching \fBptr\fR was found.
265 .PP
266 \&\fIsk_TYPE_insert()\fR inserts \fBptr\fR into \fBsk\fR at position \fBidx\fR. Any existing
267 elements at or after \fBidx\fR are moved downwards. If \fBidx\fR is out of range
268 the new element is appended to \fBsk\fR. \fIsk_TYPE_insert()\fR either returns the
269 number of elements in \fBsk\fR after the new element is inserted or zero if
270 an error (such as memory allocation failure) occurred.
271 .PP
272 \&\fIsk_TYPE_push()\fR appends \fBptr\fR to \fBsk\fR it is equivalent to:
273 .PP
274 .Vb 1
275 \& sk_TYPE_insert(sk, ptr, \-1);
276 .Ve
277 .PP
278 \&\fIsk_TYPE_unshift()\fR inserts \fBptr\fR at the start of \fBsk\fR it is equivalent to:
279 .PP
280 .Vb 1
281 \& sk_TYPE_insert(sk, ptr, 0);
282 .Ve
283 .PP
284 \&\fIsk_TYPE_pop()\fR returns and removes the last element from \fBsk\fR.
285 .PP
286 \&\fIsk_TYPE_shift()\fR returns and removes the first element from \fBsk\fR.
287 .PP
288 \&\fIsk_TYPE_set()\fR sets element \fBidx\fR of \fBsk\fR to \fBptr\fR replacing the current
289 element. The new element value is returned or \fB\s-1NULL\s0\fR if an error occurred:
290 this will only happen if \fBsk\fR is \fB\s-1NULL\s0\fR or \fBidx\fR is out of range.
291 .PP
292 \&\fIsk_TYPE_find()\fR searches \fBsk\fR for the element \fBptr\fR.  In the case
293 where no comparison function has been specified, the function performs
294 a linear search for a pointer equal to \fBptr\fR. The index of the first
295 matching element is returned or \fB\-1\fR if there is no match. In the case
296 where a comparison function has been specified, \fBsk\fR is sorted then
297 \&\fIsk_TYPE_find()\fR returns the index of a matching element or \fB\-1\fR if there
298 is no match. Note that, in this case, the matching element returned is
299 not guaranteed to be the first; the comparison function will usually
300 compare the values pointed to rather than the pointers themselves and
301 the order of elements in \fBsk\fR could change.
302 .PP
303 \&\fIsk_TYPE_find_ex()\fR operates like \fIsk_TYPE_find()\fR except when a comparison
304 function has been specified and no matching element is found. Instead
305 of returning \fB\-1\fR, \fIsk_TYPE_find_ex()\fR returns the index of the element
306 either before or after the location where \fBptr\fR would be if it were
307 present in \fBsk\fR.
308 .PP
309 \&\fIsk_TYPE_sort()\fR sorts \fBsk\fR using the supplied comparison function.
310 .PP
311 \&\fIsk_TYPE_is_sorted()\fR returns \fB1\fR if \fBsk\fR is sorted and \fB0\fR otherwise.
312 .PP
313 \&\fIsk_TYPE_dup()\fR returns a copy of \fBsk\fR. Note the pointers in the copy
314 are identical to the original.
315 .PP
316 \&\fIsk_TYPE_deep_copy()\fR returns a new stack where each element has been copied.
317 Copying is performed by the supplied \fIcopyfunc()\fR and freeing by \fIfreefunc()\fR. The
318 function \fIfreefunc()\fR is only called if an error occurs.
319 .SH "NOTES"
320 .IX Header "NOTES"
321 Care should be taken when accessing stacks in multi-threaded environments.
322 Any operation which increases the size of a stack such as \fIsk_TYPE_insert()\fR or
323 \&\fIsk_push()\fR can \*(L"grow\*(R" the size of an internal array and cause race conditions
324 if the same stack is accessed in a different thread. Operations such as
325 \&\fIsk_find()\fR and \fIsk_sort()\fR can also reorder the stack.
326 .PP
327 Any comparison function supplied should use a metric suitable
328 for use in a binary search operation. That is it should return zero, a
329 positive or negative value if \fBa\fR is equal to, greater than
330 or less than \fBb\fR respectively.
331 .PP
332 Care should be taken when checking the return values of the functions
333 \&\fIsk_TYPE_find()\fR and \fIsk_TYPE_find_ex()\fR. They return an index to the
334 matching element. In particular \fB0\fR indicates a matching first element.
335 A failed search is indicated by a \fB\-1\fR return value.
336 .PP
337 \&\s-1\fISTACK_OF\s0()\fR, \s-1\fIDEFINE_STACK_OF\s0()\fR, \s-1\fIDEFINE_STACK_OF_CONST\s0()\fR, and
338 \&\s-1\fIDEFINE_SPECIAL_STACK_OF\s0()\fR are implemented as macros.
339 .PP
340 The underlying utility \fBOPENSSL_sk_\fR \s-1API\s0 should not be used directly.
341 It defines these functions: \fIOPENSSL_sk_deep_copy()\fR,
342 \&\fIOPENSSL_sk_delete()\fR, \fIOPENSSL_sk_delete_ptr()\fR, \fIOPENSSL_sk_dup()\fR,
343 \&\fIOPENSSL_sk_find()\fR, \fIOPENSSL_sk_find_ex()\fR, \fIOPENSSL_sk_free()\fR,
344 \&\fIOPENSSL_sk_insert()\fR, \fIOPENSSL_sk_is_sorted()\fR, \fIOPENSSL_sk_new()\fR,
345 \&\fIOPENSSL_sk_new_null()\fR, \fIOPENSSL_sk_num()\fR, \fIOPENSSL_sk_pop()\fR,
346 \&\fIOPENSSL_sk_pop_free()\fR, \fIOPENSSL_sk_push()\fR, \fIOPENSSL_sk_reserve()\fR,
347 \&\fIOPENSSL_sk_set()\fR, \fIOPENSSL_sk_set_cmp_func()\fR, \fIOPENSSL_sk_shift()\fR,
348 \&\fIOPENSSL_sk_sort()\fR, \fIOPENSSL_sk_unshift()\fR, \fIOPENSSL_sk_value()\fR,
349 \&\fIOPENSSL_sk_zero()\fR.
350 .SH "RETURN VALUES"
351 .IX Header "RETURN VALUES"
352 \&\fIsk_TYPE_num()\fR returns the number of elements in the stack or \fB\-1\fR if the
353 passed stack is \fB\s-1NULL\s0\fR.
354 .PP
355 \&\fIsk_TYPE_value()\fR returns a pointer to a stack element or \fB\s-1NULL\s0\fR if the
356 index is out of range.
357 .PP
358 \&\fIsk_TYPE_new()\fR, \fIsk_TYPE_new_null()\fR and \fIsk_TYPE_new_reserve()\fR return an empty
359 stack or \fB\s-1NULL\s0\fR if an error occurs.
360 .PP
361 \&\fIsk_TYPE_reserve()\fR returns \fB1\fR on successful allocation of the required memory
362 or \fB0\fR on error.
363 .PP
364 \&\fIsk_TYPE_set_cmp_func()\fR returns the old comparison function or \fB\s-1NULL\s0\fR if
365 there was no old comparison function.
366 .PP
367 \&\fIsk_TYPE_free()\fR, \fIsk_TYPE_zero()\fR, \fIsk_TYPE_pop_free()\fR and \fIsk_TYPE_sort()\fR do
368 not return values.
369 .PP
370 \&\fIsk_TYPE_pop()\fR, \fIsk_TYPE_shift()\fR, \fIsk_TYPE_delete()\fR and \fIsk_TYPE_delete_ptr()\fR
371 return a pointer to the deleted element or \fB\s-1NULL\s0\fR on error.
372 .PP
373 \&\fIsk_TYPE_insert()\fR, \fIsk_TYPE_push()\fR and \fIsk_TYPE_unshift()\fR return the total
374 number of elements in the stack and 0 if an error occurred.
375 .PP
376 \&\fIsk_TYPE_set()\fR returns a pointer to the replacement element or \fB\s-1NULL\s0\fR on
377 error.
378 .PP
379 \&\fIsk_TYPE_find()\fR and \fIsk_TYPE_find_ex()\fR return an index to the found element
380 or \fB\-1\fR on error.
381 .PP
382 \&\fIsk_TYPE_is_sorted()\fR returns \fB1\fR if the stack is sorted and \fB0\fR if it is
383 not.
384 .PP
385 \&\fIsk_TYPE_dup()\fR and \fIsk_TYPE_deep_copy()\fR return a pointer to the copy of the
386 stack.
387 .SH "HISTORY"
388 .IX Header "HISTORY"
389 Before OpenSSL 1.1.0, this was implemented via macros and not inline functions
390 and was not a public \s-1API.\s0
391 .PP
392 \&\fIsk_TYPE_reserve()\fR and \fIsk_TYPE_new_reserve()\fR were added in OpenSSL 1.1.1.
393 .SH "COPYRIGHT"
394 .IX Header "COPYRIGHT"
395 Copyright 2000\-2017 The OpenSSL Project Authors. All Rights Reserved.
396 .PP
397 Licensed under the OpenSSL license (the \*(L"License\*(R").  You may not use
398 this file except in compliance with the License.  You can obtain a copy
399 in the file \s-1LICENSE\s0 in the source distribution or at
400 <https://www.openssl.org/source/license.html>.