Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2014, Google Inc. |
| 2 | * |
| 3 | * Permission to use, copy, modify, and/or distribute this software for any |
| 4 | * purpose with or without fee is hereby granted, provided that the above |
| 5 | * copyright notice and this permission notice appear in all copies. |
| 6 | * |
| 7 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 8 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 9 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY |
| 10 | * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 11 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION |
| 12 | * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN |
| 13 | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ |
| 14 | |
| 15 | #if !defined(IN_STACK_H) |
| 16 | #error "Don't include this file directly. Include stack.h." |
| 17 | #endif |
| 18 | |
| 19 | /* ACCESS_DESCRIPTION */ |
| 20 | #define sk_ACCESS_DESCRIPTION_new(comp) \ |
| 21 | ((STACK_OF(ACCESS_DESCRIPTION) *)sk_new(CHECKED_CAST( \ |
| 22 | stack_cmp_func, \ |
| 23 | int (*)(const ACCESS_DESCRIPTION **a, const ACCESS_DESCRIPTION **b), \ |
| 24 | comp))) |
| 25 | |
| 26 | #define sk_ACCESS_DESCRIPTION_new_null() \ |
| 27 | ((STACK_OF(ACCESS_DESCRIPTION) *)sk_new_null()) |
| 28 | |
| 29 | #define sk_ACCESS_DESCRIPTION_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 30 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(ACCESS_DESCRIPTION) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 31 | |
| 32 | #define sk_ACCESS_DESCRIPTION_zero(sk) \ |
| 33 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk)); |
| 34 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 35 | #define sk_ACCESS_DESCRIPTION_value(sk, i) \ |
| 36 | ((ACCESS_DESCRIPTION *)sk_value( \ |
| 37 | CHECKED_CAST(const _STACK *, const STACK_OF(ACCESS_DESCRIPTION) *, sk), \ |
| 38 | (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 39 | |
| 40 | #define sk_ACCESS_DESCRIPTION_set(sk, i, p) \ |
| 41 | ((ACCESS_DESCRIPTION *)sk_set( \ |
| 42 | CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk), (i), \ |
| 43 | CHECKED_CAST(void *, ACCESS_DESCRIPTION *, p))) |
| 44 | |
| 45 | #define sk_ACCESS_DESCRIPTION_free(sk) \ |
| 46 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk)) |
| 47 | |
| 48 | #define sk_ACCESS_DESCRIPTION_pop_free(sk, free_func) \ |
| 49 | sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk), \ |
| 50 | CHECKED_CAST(void (*)(void *), void (*)(ACCESS_DESCRIPTION *), \ |
| 51 | free_func)) |
| 52 | |
| 53 | #define sk_ACCESS_DESCRIPTION_insert(sk, p, where) \ |
| 54 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk), \ |
| 55 | CHECKED_CAST(void *, ACCESS_DESCRIPTION *, p), (where)) |
| 56 | |
| 57 | #define sk_ACCESS_DESCRIPTION_delete(sk, where) \ |
| 58 | ((ACCESS_DESCRIPTION *)sk_delete( \ |
| 59 | CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk), (where))) |
| 60 | |
| 61 | #define sk_ACCESS_DESCRIPTION_delete_ptr(sk, p) \ |
| 62 | ((ACCESS_DESCRIPTION *)sk_delete_ptr( \ |
| 63 | CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk), \ |
| 64 | CHECKED_CAST(void *, ACCESS_DESCRIPTION *, p))) |
| 65 | |
| 66 | #define sk_ACCESS_DESCRIPTION_find(sk, out_index, p) \ |
| 67 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk), \ |
| 68 | (out_index), CHECKED_CAST(void *, ACCESS_DESCRIPTION *, p)) |
| 69 | |
| 70 | #define sk_ACCESS_DESCRIPTION_shift(sk) \ |
| 71 | ((ACCESS_DESCRIPTION *)sk_shift( \ |
| 72 | CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk))) |
| 73 | |
| 74 | #define sk_ACCESS_DESCRIPTION_push(sk, p) \ |
| 75 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk), \ |
| 76 | CHECKED_CAST(void *, ACCESS_DESCRIPTION *, p)) |
| 77 | |
| 78 | #define sk_ACCESS_DESCRIPTION_pop(sk) \ |
| 79 | ((ACCESS_DESCRIPTION *)sk_pop( \ |
| 80 | CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk))) |
| 81 | |
| 82 | #define sk_ACCESS_DESCRIPTION_dup(sk) \ |
| 83 | ((STACK_OF(ACCESS_DESCRIPTION) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 84 | CHECKED_CAST(const _STACK *, const STACK_OF(ACCESS_DESCRIPTION) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 85 | |
| 86 | #define sk_ACCESS_DESCRIPTION_sort(sk) \ |
| 87 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk)) |
| 88 | |
| 89 | #define sk_ACCESS_DESCRIPTION_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 90 | sk_is_sorted( \ |
| 91 | CHECKED_CAST(const _STACK *, const STACK_OF(ACCESS_DESCRIPTION) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 92 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 93 | #define sk_ACCESS_DESCRIPTION_set_cmp_func(sk, comp) \ |
| 94 | ((int (*)(const ACCESS_DESCRIPTION **a, const ACCESS_DESCRIPTION **b)) \ |
| 95 | sk_set_cmp_func( \ |
| 96 | CHECKED_CAST(_STACK *, STACK_OF(ACCESS_DESCRIPTION) *, sk), \ |
| 97 | CHECKED_CAST(stack_cmp_func, int (*)(const ACCESS_DESCRIPTION **a, \ |
| 98 | const ACCESS_DESCRIPTION **b), \ |
| 99 | comp))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 100 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 101 | #define sk_ACCESS_DESCRIPTION_deep_copy(sk, copy_func, free_func) \ |
| 102 | ((STACK_OF(ACCESS_DESCRIPTION) *)sk_deep_copy( \ |
| 103 | CHECKED_CAST(const _STACK *, const STACK_OF(ACCESS_DESCRIPTION) *, sk), \ |
| 104 | CHECKED_CAST(void *(*)(void *), \ |
| 105 | ACCESS_DESCRIPTION *(*)(ACCESS_DESCRIPTION *), copy_func), \ |
| 106 | CHECKED_CAST(void (*)(void *), void (*)(ACCESS_DESCRIPTION *), \ |
| 107 | free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 108 | |
| 109 | /* ASN1_ADB_TABLE */ |
| 110 | #define sk_ASN1_ADB_TABLE_new(comp) \ |
| 111 | ((STACK_OF(ASN1_ADB_TABLE) *)sk_new(CHECKED_CAST( \ |
| 112 | stack_cmp_func, \ |
| 113 | int (*)(const ASN1_ADB_TABLE **a, const ASN1_ADB_TABLE **b), comp))) |
| 114 | |
| 115 | #define sk_ASN1_ADB_TABLE_new_null() ((STACK_OF(ASN1_ADB_TABLE) *)sk_new_null()) |
| 116 | |
| 117 | #define sk_ASN1_ADB_TABLE_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 118 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_ADB_TABLE) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 119 | |
| 120 | #define sk_ASN1_ADB_TABLE_zero(sk) \ |
| 121 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk)); |
| 122 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 123 | #define sk_ASN1_ADB_TABLE_value(sk, i) \ |
| 124 | ((ASN1_ADB_TABLE *)sk_value( \ |
| 125 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_ADB_TABLE) *, sk), \ |
| 126 | (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 127 | |
| 128 | #define sk_ASN1_ADB_TABLE_set(sk, i, p) \ |
| 129 | ((ASN1_ADB_TABLE *)sk_set( \ |
| 130 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk), (i), \ |
| 131 | CHECKED_CAST(void *, ASN1_ADB_TABLE *, p))) |
| 132 | |
| 133 | #define sk_ASN1_ADB_TABLE_free(sk) \ |
| 134 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk)) |
| 135 | |
| 136 | #define sk_ASN1_ADB_TABLE_pop_free(sk, free_func) \ |
| 137 | sk_pop_free( \ |
| 138 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk), \ |
| 139 | CHECKED_CAST(void (*)(void *), void (*)(ASN1_ADB_TABLE *), free_func)) |
| 140 | |
| 141 | #define sk_ASN1_ADB_TABLE_insert(sk, p, where) \ |
| 142 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk), \ |
| 143 | CHECKED_CAST(void *, ASN1_ADB_TABLE *, p), (where)) |
| 144 | |
| 145 | #define sk_ASN1_ADB_TABLE_delete(sk, where) \ |
| 146 | ((ASN1_ADB_TABLE *)sk_delete( \ |
| 147 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk), (where))) |
| 148 | |
| 149 | #define sk_ASN1_ADB_TABLE_delete_ptr(sk, p) \ |
| 150 | ((ASN1_ADB_TABLE *)sk_delete_ptr( \ |
| 151 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk), \ |
| 152 | CHECKED_CAST(void *, ASN1_ADB_TABLE *, p))) |
| 153 | |
| 154 | #define sk_ASN1_ADB_TABLE_find(sk, out_index, p) \ |
| 155 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk), (out_index), \ |
| 156 | CHECKED_CAST(void *, ASN1_ADB_TABLE *, p)) |
| 157 | |
| 158 | #define sk_ASN1_ADB_TABLE_shift(sk) \ |
| 159 | ((ASN1_ADB_TABLE *)sk_shift( \ |
| 160 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk))) |
| 161 | |
| 162 | #define sk_ASN1_ADB_TABLE_push(sk, p) \ |
| 163 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk), \ |
| 164 | CHECKED_CAST(void *, ASN1_ADB_TABLE *, p)) |
| 165 | |
| 166 | #define sk_ASN1_ADB_TABLE_pop(sk) \ |
| 167 | ((ASN1_ADB_TABLE *)sk_pop( \ |
| 168 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk))) |
| 169 | |
| 170 | #define sk_ASN1_ADB_TABLE_dup(sk) \ |
| 171 | ((STACK_OF(ASN1_ADB_TABLE) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 172 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_ADB_TABLE) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 173 | |
| 174 | #define sk_ASN1_ADB_TABLE_sort(sk) \ |
| 175 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk)) |
| 176 | |
| 177 | #define sk_ASN1_ADB_TABLE_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 178 | sk_is_sorted( \ |
| 179 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_ADB_TABLE) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 180 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 181 | #define sk_ASN1_ADB_TABLE_set_cmp_func(sk, comp) \ |
| 182 | ((int (*)(const ASN1_ADB_TABLE **a, const ASN1_ADB_TABLE **b)) \ |
| 183 | sk_set_cmp_func( \ |
| 184 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_ADB_TABLE) *, sk), \ |
| 185 | CHECKED_CAST(stack_cmp_func, int (*)(const ASN1_ADB_TABLE **a, \ |
| 186 | const ASN1_ADB_TABLE **b), \ |
| 187 | comp))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 188 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 189 | #define sk_ASN1_ADB_TABLE_deep_copy(sk, copy_func, free_func) \ |
| 190 | ((STACK_OF(ASN1_ADB_TABLE) *)sk_deep_copy( \ |
| 191 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_ADB_TABLE) *, sk), \ |
| 192 | CHECKED_CAST(void *(*)(void *), ASN1_ADB_TABLE *(*)(ASN1_ADB_TABLE *), \ |
| 193 | copy_func), \ |
| 194 | CHECKED_CAST(void (*)(void *), void (*)(ASN1_ADB_TABLE *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 195 | |
| 196 | /* ASN1_GENERALSTRING */ |
| 197 | #define sk_ASN1_GENERALSTRING_new(comp) \ |
| 198 | ((STACK_OF(ASN1_GENERALSTRING) *)sk_new(CHECKED_CAST( \ |
| 199 | stack_cmp_func, \ |
| 200 | int (*)(const ASN1_GENERALSTRING **a, const ASN1_GENERALSTRING **b), \ |
| 201 | comp))) |
| 202 | |
| 203 | #define sk_ASN1_GENERALSTRING_new_null() \ |
| 204 | ((STACK_OF(ASN1_GENERALSTRING) *)sk_new_null()) |
| 205 | |
| 206 | #define sk_ASN1_GENERALSTRING_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 207 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_GENERALSTRING) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 208 | |
| 209 | #define sk_ASN1_GENERALSTRING_zero(sk) \ |
| 210 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk)); |
| 211 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 212 | #define sk_ASN1_GENERALSTRING_value(sk, i) \ |
| 213 | ((ASN1_GENERALSTRING *)sk_value( \ |
| 214 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_GENERALSTRING) *, sk), \ |
| 215 | (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 216 | |
| 217 | #define sk_ASN1_GENERALSTRING_set(sk, i, p) \ |
| 218 | ((ASN1_GENERALSTRING *)sk_set( \ |
| 219 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk), (i), \ |
| 220 | CHECKED_CAST(void *, ASN1_GENERALSTRING *, p))) |
| 221 | |
| 222 | #define sk_ASN1_GENERALSTRING_free(sk) \ |
| 223 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk)) |
| 224 | |
| 225 | #define sk_ASN1_GENERALSTRING_pop_free(sk, free_func) \ |
| 226 | sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk), \ |
| 227 | CHECKED_CAST(void (*)(void *), void (*)(ASN1_GENERALSTRING *), \ |
| 228 | free_func)) |
| 229 | |
| 230 | #define sk_ASN1_GENERALSTRING_insert(sk, p, where) \ |
| 231 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk), \ |
| 232 | CHECKED_CAST(void *, ASN1_GENERALSTRING *, p), (where)) |
| 233 | |
| 234 | #define sk_ASN1_GENERALSTRING_delete(sk, where) \ |
| 235 | ((ASN1_GENERALSTRING *)sk_delete( \ |
| 236 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk), (where))) |
| 237 | |
| 238 | #define sk_ASN1_GENERALSTRING_delete_ptr(sk, p) \ |
| 239 | ((ASN1_GENERALSTRING *)sk_delete_ptr( \ |
| 240 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk), \ |
| 241 | CHECKED_CAST(void *, ASN1_GENERALSTRING *, p))) |
| 242 | |
| 243 | #define sk_ASN1_GENERALSTRING_find(sk, out_index, p) \ |
| 244 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk), \ |
| 245 | (out_index), CHECKED_CAST(void *, ASN1_GENERALSTRING *, p)) |
| 246 | |
| 247 | #define sk_ASN1_GENERALSTRING_shift(sk) \ |
| 248 | ((ASN1_GENERALSTRING *)sk_shift( \ |
| 249 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk))) |
| 250 | |
| 251 | #define sk_ASN1_GENERALSTRING_push(sk, p) \ |
| 252 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk), \ |
| 253 | CHECKED_CAST(void *, ASN1_GENERALSTRING *, p)) |
| 254 | |
| 255 | #define sk_ASN1_GENERALSTRING_pop(sk) \ |
| 256 | ((ASN1_GENERALSTRING *)sk_pop( \ |
| 257 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk))) |
| 258 | |
| 259 | #define sk_ASN1_GENERALSTRING_dup(sk) \ |
| 260 | ((STACK_OF(ASN1_GENERALSTRING) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 261 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_GENERALSTRING) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 262 | |
| 263 | #define sk_ASN1_GENERALSTRING_sort(sk) \ |
| 264 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk)) |
| 265 | |
| 266 | #define sk_ASN1_GENERALSTRING_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 267 | sk_is_sorted( \ |
| 268 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_GENERALSTRING) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 269 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 270 | #define sk_ASN1_GENERALSTRING_set_cmp_func(sk, comp) \ |
| 271 | ((int (*)(const ASN1_GENERALSTRING **a, const ASN1_GENERALSTRING **b)) \ |
| 272 | sk_set_cmp_func( \ |
| 273 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_GENERALSTRING) *, sk), \ |
| 274 | CHECKED_CAST(stack_cmp_func, int (*)(const ASN1_GENERALSTRING **a, \ |
| 275 | const ASN1_GENERALSTRING **b), \ |
| 276 | comp))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 277 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 278 | #define sk_ASN1_GENERALSTRING_deep_copy(sk, copy_func, free_func) \ |
| 279 | ((STACK_OF(ASN1_GENERALSTRING) *)sk_deep_copy( \ |
| 280 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_GENERALSTRING) *, sk), \ |
| 281 | CHECKED_CAST(void *(*)(void *), \ |
| 282 | ASN1_GENERALSTRING *(*)(ASN1_GENERALSTRING *), copy_func), \ |
| 283 | CHECKED_CAST(void (*)(void *), void (*)(ASN1_GENERALSTRING *), \ |
| 284 | free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 285 | |
| 286 | /* ASN1_INTEGER */ |
| 287 | #define sk_ASN1_INTEGER_new(comp) \ |
| 288 | ((STACK_OF(ASN1_INTEGER) *)sk_new(CHECKED_CAST( \ |
| 289 | stack_cmp_func, int (*)(const ASN1_INTEGER **a, const ASN1_INTEGER **b), \ |
| 290 | comp))) |
| 291 | |
| 292 | #define sk_ASN1_INTEGER_new_null() ((STACK_OF(ASN1_INTEGER) *)sk_new_null()) |
| 293 | |
| 294 | #define sk_ASN1_INTEGER_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 295 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_INTEGER) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 296 | |
| 297 | #define sk_ASN1_INTEGER_zero(sk) \ |
| 298 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk)); |
| 299 | |
| 300 | #define sk_ASN1_INTEGER_value(sk, i) \ |
| 301 | ((ASN1_INTEGER *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 302 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_INTEGER) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 303 | |
| 304 | #define sk_ASN1_INTEGER_set(sk, i, p) \ |
| 305 | ((ASN1_INTEGER *)sk_set( \ |
| 306 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk), (i), \ |
| 307 | CHECKED_CAST(void *, ASN1_INTEGER *, p))) |
| 308 | |
| 309 | #define sk_ASN1_INTEGER_free(sk) \ |
| 310 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk)) |
| 311 | |
| 312 | #define sk_ASN1_INTEGER_pop_free(sk, free_func) \ |
| 313 | sk_pop_free( \ |
| 314 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk), \ |
| 315 | CHECKED_CAST(void (*)(void *), void (*)(ASN1_INTEGER *), free_func)) |
| 316 | |
| 317 | #define sk_ASN1_INTEGER_insert(sk, p, where) \ |
| 318 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk), \ |
| 319 | CHECKED_CAST(void *, ASN1_INTEGER *, p), (where)) |
| 320 | |
| 321 | #define sk_ASN1_INTEGER_delete(sk, where) \ |
| 322 | ((ASN1_INTEGER *)sk_delete( \ |
| 323 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk), (where))) |
| 324 | |
| 325 | #define sk_ASN1_INTEGER_delete_ptr(sk, p) \ |
| 326 | ((ASN1_INTEGER *)sk_delete_ptr( \ |
| 327 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk), \ |
| 328 | CHECKED_CAST(void *, ASN1_INTEGER *, p))) |
| 329 | |
| 330 | #define sk_ASN1_INTEGER_find(sk, out_index, p) \ |
| 331 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk), (out_index), \ |
| 332 | CHECKED_CAST(void *, ASN1_INTEGER *, p)) |
| 333 | |
| 334 | #define sk_ASN1_INTEGER_shift(sk) \ |
| 335 | ((ASN1_INTEGER *)sk_shift( \ |
| 336 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk))) |
| 337 | |
| 338 | #define sk_ASN1_INTEGER_push(sk, p) \ |
| 339 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk), \ |
| 340 | CHECKED_CAST(void *, ASN1_INTEGER *, p)) |
| 341 | |
| 342 | #define sk_ASN1_INTEGER_pop(sk) \ |
| 343 | ((ASN1_INTEGER *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk))) |
| 344 | |
| 345 | #define sk_ASN1_INTEGER_dup(sk) \ |
| 346 | ((STACK_OF(ASN1_INTEGER) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 347 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_INTEGER) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 348 | |
| 349 | #define sk_ASN1_INTEGER_sort(sk) \ |
| 350 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk)) |
| 351 | |
| 352 | #define sk_ASN1_INTEGER_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 353 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_INTEGER) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 354 | |
| 355 | #define sk_ASN1_INTEGER_set_cmp_func(sk, comp) \ |
| 356 | ((int (*)(const ASN1_INTEGER **a, const ASN1_INTEGER **b))sk_set_cmp_func( \ |
| 357 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_INTEGER) *, sk), \ |
| 358 | CHECKED_CAST(stack_cmp_func, \ |
| 359 | int (*)(const ASN1_INTEGER **a, const ASN1_INTEGER **b), \ |
| 360 | comp))) |
| 361 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 362 | #define sk_ASN1_INTEGER_deep_copy(sk, copy_func, free_func) \ |
| 363 | ((STACK_OF(ASN1_INTEGER) *)sk_deep_copy( \ |
| 364 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_INTEGER) *, sk), \ |
| 365 | CHECKED_CAST(void *(*)(void *), ASN1_INTEGER *(*)(ASN1_INTEGER *), \ |
| 366 | copy_func), \ |
| 367 | CHECKED_CAST(void (*)(void *), void (*)(ASN1_INTEGER *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 368 | |
| 369 | /* ASN1_OBJECT */ |
| 370 | #define sk_ASN1_OBJECT_new(comp) \ |
| 371 | ((STACK_OF(ASN1_OBJECT) *)sk_new(CHECKED_CAST( \ |
| 372 | stack_cmp_func, int (*)(const ASN1_OBJECT **a, const ASN1_OBJECT **b), \ |
| 373 | comp))) |
| 374 | |
| 375 | #define sk_ASN1_OBJECT_new_null() ((STACK_OF(ASN1_OBJECT) *)sk_new_null()) |
| 376 | |
| 377 | #define sk_ASN1_OBJECT_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 378 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_OBJECT) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 379 | |
| 380 | #define sk_ASN1_OBJECT_zero(sk) \ |
| 381 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk)); |
| 382 | |
| 383 | #define sk_ASN1_OBJECT_value(sk, i) \ |
| 384 | ((ASN1_OBJECT *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 385 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_OBJECT) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 386 | |
| 387 | #define sk_ASN1_OBJECT_set(sk, i, p) \ |
| 388 | ((ASN1_OBJECT *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk), \ |
| 389 | (i), CHECKED_CAST(void *, ASN1_OBJECT *, p))) |
| 390 | |
| 391 | #define sk_ASN1_OBJECT_free(sk) \ |
| 392 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk)) |
| 393 | |
| 394 | #define sk_ASN1_OBJECT_pop_free(sk, free_func) \ |
| 395 | sk_pop_free( \ |
| 396 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk), \ |
| 397 | CHECKED_CAST(void (*)(void *), void (*)(ASN1_OBJECT *), free_func)) |
| 398 | |
| 399 | #define sk_ASN1_OBJECT_insert(sk, p, where) \ |
| 400 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk), \ |
| 401 | CHECKED_CAST(void *, ASN1_OBJECT *, p), (where)) |
| 402 | |
| 403 | #define sk_ASN1_OBJECT_delete(sk, where) \ |
| 404 | ((ASN1_OBJECT *)sk_delete( \ |
| 405 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk), (where))) |
| 406 | |
| 407 | #define sk_ASN1_OBJECT_delete_ptr(sk, p) \ |
| 408 | ((ASN1_OBJECT *)sk_delete_ptr( \ |
| 409 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk), \ |
| 410 | CHECKED_CAST(void *, ASN1_OBJECT *, p))) |
| 411 | |
| 412 | #define sk_ASN1_OBJECT_find(sk, out_index, p) \ |
| 413 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk), (out_index), \ |
| 414 | CHECKED_CAST(void *, ASN1_OBJECT *, p)) |
| 415 | |
| 416 | #define sk_ASN1_OBJECT_shift(sk) \ |
| 417 | ((ASN1_OBJECT *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk))) |
| 418 | |
| 419 | #define sk_ASN1_OBJECT_push(sk, p) \ |
| 420 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk), \ |
| 421 | CHECKED_CAST(void *, ASN1_OBJECT *, p)) |
| 422 | |
| 423 | #define sk_ASN1_OBJECT_pop(sk) \ |
| 424 | ((ASN1_OBJECT *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk))) |
| 425 | |
| 426 | #define sk_ASN1_OBJECT_dup(sk) \ |
| 427 | ((STACK_OF(ASN1_OBJECT) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 428 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_OBJECT) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 429 | |
| 430 | #define sk_ASN1_OBJECT_sort(sk) \ |
| 431 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk)) |
| 432 | |
| 433 | #define sk_ASN1_OBJECT_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 434 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_OBJECT) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 435 | |
| 436 | #define sk_ASN1_OBJECT_set_cmp_func(sk, comp) \ |
| 437 | ((int (*)(const ASN1_OBJECT **a, const ASN1_OBJECT **b))sk_set_cmp_func( \ |
| 438 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_OBJECT) *, sk), \ |
| 439 | CHECKED_CAST(stack_cmp_func, \ |
| 440 | int (*)(const ASN1_OBJECT **a, const ASN1_OBJECT **b), \ |
| 441 | comp))) |
| 442 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 443 | #define sk_ASN1_OBJECT_deep_copy(sk, copy_func, free_func) \ |
| 444 | ((STACK_OF(ASN1_OBJECT) *)sk_deep_copy( \ |
| 445 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_OBJECT) *, sk), \ |
| 446 | CHECKED_CAST(void *(*)(void *), ASN1_OBJECT *(*)(ASN1_OBJECT *), \ |
| 447 | copy_func), \ |
| 448 | CHECKED_CAST(void (*)(void *), void (*)(ASN1_OBJECT *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 449 | |
| 450 | /* ASN1_STRING_TABLE */ |
| 451 | #define sk_ASN1_STRING_TABLE_new(comp) \ |
| 452 | ((STACK_OF(ASN1_STRING_TABLE) *)sk_new(CHECKED_CAST( \ |
| 453 | stack_cmp_func, \ |
| 454 | int (*)(const ASN1_STRING_TABLE **a, const ASN1_STRING_TABLE **b), \ |
| 455 | comp))) |
| 456 | |
| 457 | #define sk_ASN1_STRING_TABLE_new_null() \ |
| 458 | ((STACK_OF(ASN1_STRING_TABLE) *)sk_new_null()) |
| 459 | |
| 460 | #define sk_ASN1_STRING_TABLE_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 461 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_STRING_TABLE) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 462 | |
| 463 | #define sk_ASN1_STRING_TABLE_zero(sk) \ |
| 464 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk)); |
| 465 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 466 | #define sk_ASN1_STRING_TABLE_value(sk, i) \ |
| 467 | ((ASN1_STRING_TABLE *)sk_value( \ |
| 468 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_STRING_TABLE) *, sk), \ |
| 469 | (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 470 | |
| 471 | #define sk_ASN1_STRING_TABLE_set(sk, i, p) \ |
| 472 | ((ASN1_STRING_TABLE *)sk_set( \ |
| 473 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk), (i), \ |
| 474 | CHECKED_CAST(void *, ASN1_STRING_TABLE *, p))) |
| 475 | |
| 476 | #define sk_ASN1_STRING_TABLE_free(sk) \ |
| 477 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk)) |
| 478 | |
| 479 | #define sk_ASN1_STRING_TABLE_pop_free(sk, free_func) \ |
| 480 | sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk), \ |
| 481 | CHECKED_CAST(void (*)(void *), void (*)(ASN1_STRING_TABLE *), \ |
| 482 | free_func)) |
| 483 | |
| 484 | #define sk_ASN1_STRING_TABLE_insert(sk, p, where) \ |
| 485 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk), \ |
| 486 | CHECKED_CAST(void *, ASN1_STRING_TABLE *, p), (where)) |
| 487 | |
| 488 | #define sk_ASN1_STRING_TABLE_delete(sk, where) \ |
| 489 | ((ASN1_STRING_TABLE *)sk_delete( \ |
| 490 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk), (where))) |
| 491 | |
| 492 | #define sk_ASN1_STRING_TABLE_delete_ptr(sk, p) \ |
| 493 | ((ASN1_STRING_TABLE *)sk_delete_ptr( \ |
| 494 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk), \ |
| 495 | CHECKED_CAST(void *, ASN1_STRING_TABLE *, p))) |
| 496 | |
| 497 | #define sk_ASN1_STRING_TABLE_find(sk, out_index, p) \ |
| 498 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk), \ |
| 499 | (out_index), CHECKED_CAST(void *, ASN1_STRING_TABLE *, p)) |
| 500 | |
| 501 | #define sk_ASN1_STRING_TABLE_shift(sk) \ |
| 502 | ((ASN1_STRING_TABLE *)sk_shift( \ |
| 503 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk))) |
| 504 | |
| 505 | #define sk_ASN1_STRING_TABLE_push(sk, p) \ |
| 506 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk), \ |
| 507 | CHECKED_CAST(void *, ASN1_STRING_TABLE *, p)) |
| 508 | |
| 509 | #define sk_ASN1_STRING_TABLE_pop(sk) \ |
| 510 | ((ASN1_STRING_TABLE *)sk_pop( \ |
| 511 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk))) |
| 512 | |
| 513 | #define sk_ASN1_STRING_TABLE_dup(sk) \ |
| 514 | ((STACK_OF(ASN1_STRING_TABLE) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 515 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_STRING_TABLE) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 516 | |
| 517 | #define sk_ASN1_STRING_TABLE_sort(sk) \ |
| 518 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk)) |
| 519 | |
| 520 | #define sk_ASN1_STRING_TABLE_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 521 | sk_is_sorted( \ |
| 522 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_STRING_TABLE) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 523 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 524 | #define sk_ASN1_STRING_TABLE_set_cmp_func(sk, comp) \ |
| 525 | ((int (*)(const ASN1_STRING_TABLE **a, const ASN1_STRING_TABLE **b)) \ |
| 526 | sk_set_cmp_func( \ |
| 527 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_STRING_TABLE) *, sk), \ |
| 528 | CHECKED_CAST(stack_cmp_func, int (*)(const ASN1_STRING_TABLE **a, \ |
| 529 | const ASN1_STRING_TABLE **b), \ |
| 530 | comp))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 531 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 532 | #define sk_ASN1_STRING_TABLE_deep_copy(sk, copy_func, free_func) \ |
| 533 | ((STACK_OF(ASN1_STRING_TABLE) *)sk_deep_copy( \ |
| 534 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_STRING_TABLE) *, sk), \ |
| 535 | CHECKED_CAST(void *(*)(void *), \ |
| 536 | ASN1_STRING_TABLE *(*)(ASN1_STRING_TABLE *), copy_func), \ |
| 537 | CHECKED_CAST(void (*)(void *), void (*)(ASN1_STRING_TABLE *), \ |
| 538 | free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 539 | |
| 540 | /* ASN1_TYPE */ |
| 541 | #define sk_ASN1_TYPE_new(comp) \ |
| 542 | ((STACK_OF(ASN1_TYPE) *)sk_new( \ |
| 543 | CHECKED_CAST(stack_cmp_func, \ |
| 544 | int (*)(const ASN1_TYPE **a, const ASN1_TYPE **b), comp))) |
| 545 | |
| 546 | #define sk_ASN1_TYPE_new_null() ((STACK_OF(ASN1_TYPE) *)sk_new_null()) |
| 547 | |
| 548 | #define sk_ASN1_TYPE_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 549 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_TYPE) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 550 | |
| 551 | #define sk_ASN1_TYPE_zero(sk) \ |
| 552 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk)); |
| 553 | |
| 554 | #define sk_ASN1_TYPE_value(sk, i) \ |
| 555 | ((ASN1_TYPE *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 556 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_TYPE) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 557 | |
| 558 | #define sk_ASN1_TYPE_set(sk, i, p) \ |
| 559 | ((ASN1_TYPE *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk), (i), \ |
| 560 | CHECKED_CAST(void *, ASN1_TYPE *, p))) |
| 561 | |
| 562 | #define sk_ASN1_TYPE_free(sk) \ |
| 563 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk)) |
| 564 | |
| 565 | #define sk_ASN1_TYPE_pop_free(sk, free_func) \ |
| 566 | sk_pop_free( \ |
| 567 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk), \ |
| 568 | CHECKED_CAST(void (*)(void *), void (*)(ASN1_TYPE *), free_func)) |
| 569 | |
| 570 | #define sk_ASN1_TYPE_insert(sk, p, where) \ |
| 571 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk), \ |
| 572 | CHECKED_CAST(void *, ASN1_TYPE *, p), (where)) |
| 573 | |
| 574 | #define sk_ASN1_TYPE_delete(sk, where) \ |
| 575 | ((ASN1_TYPE *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk), \ |
| 576 | (where))) |
| 577 | |
| 578 | #define sk_ASN1_TYPE_delete_ptr(sk, p) \ |
| 579 | ((ASN1_TYPE *)sk_delete_ptr( \ |
| 580 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk), \ |
| 581 | CHECKED_CAST(void *, ASN1_TYPE *, p))) |
| 582 | |
| 583 | #define sk_ASN1_TYPE_find(sk, out_index, p) \ |
| 584 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk), (out_index), \ |
| 585 | CHECKED_CAST(void *, ASN1_TYPE *, p)) |
| 586 | |
| 587 | #define sk_ASN1_TYPE_shift(sk) \ |
| 588 | ((ASN1_TYPE *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk))) |
| 589 | |
| 590 | #define sk_ASN1_TYPE_push(sk, p) \ |
| 591 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk), \ |
| 592 | CHECKED_CAST(void *, ASN1_TYPE *, p)) |
| 593 | |
| 594 | #define sk_ASN1_TYPE_pop(sk) \ |
| 595 | ((ASN1_TYPE *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk))) |
| 596 | |
| 597 | #define sk_ASN1_TYPE_dup(sk) \ |
| 598 | ((STACK_OF(ASN1_TYPE) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 599 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_TYPE) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 600 | |
| 601 | #define sk_ASN1_TYPE_sort(sk) \ |
| 602 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk)) |
| 603 | |
| 604 | #define sk_ASN1_TYPE_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 605 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_TYPE) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 606 | |
| 607 | #define sk_ASN1_TYPE_set_cmp_func(sk, comp) \ |
| 608 | ((int (*)(const ASN1_TYPE **a, const ASN1_TYPE **b))sk_set_cmp_func( \ |
| 609 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_TYPE) *, sk), \ |
| 610 | CHECKED_CAST(stack_cmp_func, \ |
| 611 | int (*)(const ASN1_TYPE **a, const ASN1_TYPE **b), comp))) |
| 612 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 613 | #define sk_ASN1_TYPE_deep_copy(sk, copy_func, free_func) \ |
| 614 | ((STACK_OF(ASN1_TYPE) *)sk_deep_copy( \ |
| 615 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_TYPE) *, sk), \ |
| 616 | CHECKED_CAST(void *(*)(void *), ASN1_TYPE *(*)(ASN1_TYPE *), copy_func), \ |
| 617 | CHECKED_CAST(void (*)(void *), void (*)(ASN1_TYPE *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 618 | |
| 619 | /* ASN1_VALUE */ |
| 620 | #define sk_ASN1_VALUE_new(comp) \ |
| 621 | ((STACK_OF(ASN1_VALUE) *)sk_new(CHECKED_CAST( \ |
| 622 | stack_cmp_func, int (*)(const ASN1_VALUE **a, const ASN1_VALUE **b), \ |
| 623 | comp))) |
| 624 | |
| 625 | #define sk_ASN1_VALUE_new_null() ((STACK_OF(ASN1_VALUE) *)sk_new_null()) |
| 626 | |
| 627 | #define sk_ASN1_VALUE_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 628 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_VALUE) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 629 | |
| 630 | #define sk_ASN1_VALUE_zero(sk) \ |
| 631 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk)); |
| 632 | |
| 633 | #define sk_ASN1_VALUE_value(sk, i) \ |
| 634 | ((ASN1_VALUE *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 635 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_VALUE) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 636 | |
| 637 | #define sk_ASN1_VALUE_set(sk, i, p) \ |
| 638 | ((ASN1_VALUE *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk), \ |
| 639 | (i), CHECKED_CAST(void *, ASN1_VALUE *, p))) |
| 640 | |
| 641 | #define sk_ASN1_VALUE_free(sk) \ |
| 642 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk)) |
| 643 | |
| 644 | #define sk_ASN1_VALUE_pop_free(sk, free_func) \ |
| 645 | sk_pop_free( \ |
| 646 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk), \ |
| 647 | CHECKED_CAST(void (*)(void *), void (*)(ASN1_VALUE *), free_func)) |
| 648 | |
| 649 | #define sk_ASN1_VALUE_insert(sk, p, where) \ |
| 650 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk), \ |
| 651 | CHECKED_CAST(void *, ASN1_VALUE *, p), (where)) |
| 652 | |
| 653 | #define sk_ASN1_VALUE_delete(sk, where) \ |
| 654 | ((ASN1_VALUE *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk), \ |
| 655 | (where))) |
| 656 | |
| 657 | #define sk_ASN1_VALUE_delete_ptr(sk, p) \ |
| 658 | ((ASN1_VALUE *)sk_delete_ptr( \ |
| 659 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk), \ |
| 660 | CHECKED_CAST(void *, ASN1_VALUE *, p))) |
| 661 | |
| 662 | #define sk_ASN1_VALUE_find(sk, out_index, p) \ |
| 663 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk), (out_index), \ |
| 664 | CHECKED_CAST(void *, ASN1_VALUE *, p)) |
| 665 | |
| 666 | #define sk_ASN1_VALUE_shift(sk) \ |
| 667 | ((ASN1_VALUE *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk))) |
| 668 | |
| 669 | #define sk_ASN1_VALUE_push(sk, p) \ |
| 670 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk), \ |
| 671 | CHECKED_CAST(void *, ASN1_VALUE *, p)) |
| 672 | |
| 673 | #define sk_ASN1_VALUE_pop(sk) \ |
| 674 | ((ASN1_VALUE *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk))) |
| 675 | |
| 676 | #define sk_ASN1_VALUE_dup(sk) \ |
| 677 | ((STACK_OF(ASN1_VALUE) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 678 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_VALUE) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 679 | |
| 680 | #define sk_ASN1_VALUE_sort(sk) \ |
| 681 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk)) |
| 682 | |
| 683 | #define sk_ASN1_VALUE_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 684 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_VALUE) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 685 | |
| 686 | #define sk_ASN1_VALUE_set_cmp_func(sk, comp) \ |
| 687 | ((int (*)(const ASN1_VALUE **a, const ASN1_VALUE **b))sk_set_cmp_func( \ |
| 688 | CHECKED_CAST(_STACK *, STACK_OF(ASN1_VALUE) *, sk), \ |
| 689 | CHECKED_CAST(stack_cmp_func, \ |
| 690 | int (*)(const ASN1_VALUE **a, const ASN1_VALUE **b), \ |
| 691 | comp))) |
| 692 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 693 | #define sk_ASN1_VALUE_deep_copy(sk, copy_func, free_func) \ |
| 694 | ((STACK_OF(ASN1_VALUE) *)sk_deep_copy( \ |
| 695 | CHECKED_CAST(const _STACK *, const STACK_OF(ASN1_VALUE) *, sk), \ |
| 696 | CHECKED_CAST(void *(*)(void *), ASN1_VALUE *(*)(ASN1_VALUE *), \ |
| 697 | copy_func), \ |
| 698 | CHECKED_CAST(void (*)(void *), void (*)(ASN1_VALUE *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 699 | |
| 700 | /* BIO */ |
| 701 | #define sk_BIO_new(comp) \ |
| 702 | ((STACK_OF(BIO) *)sk_new(CHECKED_CAST( \ |
| 703 | stack_cmp_func, int (*)(const BIO **a, const BIO **b), comp))) |
| 704 | |
| 705 | #define sk_BIO_new_null() ((STACK_OF(BIO) *)sk_new_null()) |
| 706 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 707 | #define sk_BIO_num(sk) \ |
| 708 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(BIO) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 709 | |
| 710 | #define sk_BIO_zero(sk) sk_zero(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk)); |
| 711 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 712 | #define sk_BIO_value(sk, i) \ |
| 713 | ((BIO *)sk_value(CHECKED_CAST(const _STACK *, const STACK_OF(BIO) *, sk), \ |
| 714 | (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 715 | |
| 716 | #define sk_BIO_set(sk, i, p) \ |
| 717 | ((BIO *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk), (i), \ |
| 718 | CHECKED_CAST(void *, BIO *, p))) |
| 719 | |
| 720 | #define sk_BIO_free(sk) sk_free(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk)) |
| 721 | |
| 722 | #define sk_BIO_pop_free(sk, free_func) \ |
| 723 | sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk), \ |
| 724 | CHECKED_CAST(void (*)(void *), void (*)(BIO *), free_func)) |
| 725 | |
| 726 | #define sk_BIO_insert(sk, p, where) \ |
| 727 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk), \ |
| 728 | CHECKED_CAST(void *, BIO *, p), (where)) |
| 729 | |
| 730 | #define sk_BIO_delete(sk, where) \ |
| 731 | ((BIO *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk), (where))) |
| 732 | |
| 733 | #define sk_BIO_delete_ptr(sk, p) \ |
| 734 | ((BIO *)sk_delete_ptr(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk), \ |
| 735 | CHECKED_CAST(void *, BIO *, p))) |
| 736 | |
| 737 | #define sk_BIO_find(sk, out_index, p) \ |
| 738 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk), (out_index), \ |
| 739 | CHECKED_CAST(void *, BIO *, p)) |
| 740 | |
| 741 | #define sk_BIO_shift(sk) \ |
| 742 | ((BIO *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk))) |
| 743 | |
| 744 | #define sk_BIO_push(sk, p) \ |
| 745 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk), \ |
| 746 | CHECKED_CAST(void *, BIO *, p)) |
| 747 | |
| 748 | #define sk_BIO_pop(sk) \ |
| 749 | ((BIO *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk))) |
| 750 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 751 | #define sk_BIO_dup(sk) \ |
| 752 | ((STACK_OF(BIO) *)sk_dup( \ |
| 753 | CHECKED_CAST(const _STACK *, const STACK_OF(BIO) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 754 | |
| 755 | #define sk_BIO_sort(sk) sk_sort(CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk)) |
| 756 | |
| 757 | #define sk_BIO_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 758 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(BIO) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 759 | |
| 760 | #define sk_BIO_set_cmp_func(sk, comp) \ |
| 761 | ((int (*)(const BIO **a, const BIO **b))sk_set_cmp_func( \ |
| 762 | CHECKED_CAST(_STACK *, STACK_OF(BIO) *, sk), \ |
| 763 | CHECKED_CAST(stack_cmp_func, int (*)(const BIO **a, const BIO **b), \ |
| 764 | comp))) |
| 765 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 766 | #define sk_BIO_deep_copy(sk, copy_func, free_func) \ |
| 767 | ((STACK_OF(BIO) *)sk_deep_copy( \ |
| 768 | CHECKED_CAST(const _STACK *, const STACK_OF(BIO) *, sk), \ |
| 769 | CHECKED_CAST(void *(*)(void *), BIO *(*)(BIO *), copy_func), \ |
| 770 | CHECKED_CAST(void (*)(void *), void (*)(BIO *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 771 | |
| 772 | /* BY_DIR_ENTRY */ |
| 773 | #define sk_BY_DIR_ENTRY_new(comp) \ |
| 774 | ((STACK_OF(BY_DIR_ENTRY) *)sk_new(CHECKED_CAST( \ |
| 775 | stack_cmp_func, int (*)(const BY_DIR_ENTRY **a, const BY_DIR_ENTRY **b), \ |
| 776 | comp))) |
| 777 | |
| 778 | #define sk_BY_DIR_ENTRY_new_null() ((STACK_OF(BY_DIR_ENTRY) *)sk_new_null()) |
| 779 | |
| 780 | #define sk_BY_DIR_ENTRY_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 781 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(BY_DIR_ENTRY) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 782 | |
| 783 | #define sk_BY_DIR_ENTRY_zero(sk) \ |
| 784 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk)); |
| 785 | |
| 786 | #define sk_BY_DIR_ENTRY_value(sk, i) \ |
| 787 | ((BY_DIR_ENTRY *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 788 | CHECKED_CAST(const _STACK *, const STACK_OF(BY_DIR_ENTRY) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 789 | |
| 790 | #define sk_BY_DIR_ENTRY_set(sk, i, p) \ |
| 791 | ((BY_DIR_ENTRY *)sk_set( \ |
| 792 | CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk), (i), \ |
| 793 | CHECKED_CAST(void *, BY_DIR_ENTRY *, p))) |
| 794 | |
| 795 | #define sk_BY_DIR_ENTRY_free(sk) \ |
| 796 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk)) |
| 797 | |
| 798 | #define sk_BY_DIR_ENTRY_pop_free(sk, free_func) \ |
| 799 | sk_pop_free( \ |
| 800 | CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk), \ |
| 801 | CHECKED_CAST(void (*)(void *), void (*)(BY_DIR_ENTRY *), free_func)) |
| 802 | |
| 803 | #define sk_BY_DIR_ENTRY_insert(sk, p, where) \ |
| 804 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk), \ |
| 805 | CHECKED_CAST(void *, BY_DIR_ENTRY *, p), (where)) |
| 806 | |
| 807 | #define sk_BY_DIR_ENTRY_delete(sk, where) \ |
| 808 | ((BY_DIR_ENTRY *)sk_delete( \ |
| 809 | CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk), (where))) |
| 810 | |
| 811 | #define sk_BY_DIR_ENTRY_delete_ptr(sk, p) \ |
| 812 | ((BY_DIR_ENTRY *)sk_delete_ptr( \ |
| 813 | CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk), \ |
| 814 | CHECKED_CAST(void *, BY_DIR_ENTRY *, p))) |
| 815 | |
| 816 | #define sk_BY_DIR_ENTRY_find(sk, out_index, p) \ |
| 817 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk), (out_index), \ |
| 818 | CHECKED_CAST(void *, BY_DIR_ENTRY *, p)) |
| 819 | |
| 820 | #define sk_BY_DIR_ENTRY_shift(sk) \ |
| 821 | ((BY_DIR_ENTRY *)sk_shift( \ |
| 822 | CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk))) |
| 823 | |
| 824 | #define sk_BY_DIR_ENTRY_push(sk, p) \ |
| 825 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk), \ |
| 826 | CHECKED_CAST(void *, BY_DIR_ENTRY *, p)) |
| 827 | |
| 828 | #define sk_BY_DIR_ENTRY_pop(sk) \ |
| 829 | ((BY_DIR_ENTRY *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk))) |
| 830 | |
| 831 | #define sk_BY_DIR_ENTRY_dup(sk) \ |
| 832 | ((STACK_OF(BY_DIR_ENTRY) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 833 | CHECKED_CAST(const _STACK *, const STACK_OF(BY_DIR_ENTRY) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 834 | |
| 835 | #define sk_BY_DIR_ENTRY_sort(sk) \ |
| 836 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk)) |
| 837 | |
| 838 | #define sk_BY_DIR_ENTRY_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 839 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(BY_DIR_ENTRY) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 840 | |
| 841 | #define sk_BY_DIR_ENTRY_set_cmp_func(sk, comp) \ |
| 842 | ((int (*)(const BY_DIR_ENTRY **a, const BY_DIR_ENTRY **b))sk_set_cmp_func( \ |
| 843 | CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_ENTRY) *, sk), \ |
| 844 | CHECKED_CAST(stack_cmp_func, \ |
| 845 | int (*)(const BY_DIR_ENTRY **a, const BY_DIR_ENTRY **b), \ |
| 846 | comp))) |
| 847 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 848 | #define sk_BY_DIR_ENTRY_deep_copy(sk, copy_func, free_func) \ |
| 849 | ((STACK_OF(BY_DIR_ENTRY) *)sk_deep_copy( \ |
| 850 | CHECKED_CAST(const _STACK *, const STACK_OF(BY_DIR_ENTRY) *, sk), \ |
| 851 | CHECKED_CAST(void *(*)(void *), BY_DIR_ENTRY *(*)(BY_DIR_ENTRY *), \ |
| 852 | copy_func), \ |
| 853 | CHECKED_CAST(void (*)(void *), void (*)(BY_DIR_ENTRY *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 854 | |
| 855 | /* BY_DIR_HASH */ |
| 856 | #define sk_BY_DIR_HASH_new(comp) \ |
| 857 | ((STACK_OF(BY_DIR_HASH) *)sk_new(CHECKED_CAST( \ |
| 858 | stack_cmp_func, int (*)(const BY_DIR_HASH **a, const BY_DIR_HASH **b), \ |
| 859 | comp))) |
| 860 | |
| 861 | #define sk_BY_DIR_HASH_new_null() ((STACK_OF(BY_DIR_HASH) *)sk_new_null()) |
| 862 | |
| 863 | #define sk_BY_DIR_HASH_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 864 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(BY_DIR_HASH) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 865 | |
| 866 | #define sk_BY_DIR_HASH_zero(sk) \ |
| 867 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk)); |
| 868 | |
| 869 | #define sk_BY_DIR_HASH_value(sk, i) \ |
| 870 | ((BY_DIR_HASH *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 871 | CHECKED_CAST(const _STACK *, const STACK_OF(BY_DIR_HASH) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 872 | |
| 873 | #define sk_BY_DIR_HASH_set(sk, i, p) \ |
| 874 | ((BY_DIR_HASH *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk), \ |
| 875 | (i), CHECKED_CAST(void *, BY_DIR_HASH *, p))) |
| 876 | |
| 877 | #define sk_BY_DIR_HASH_free(sk) \ |
| 878 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk)) |
| 879 | |
| 880 | #define sk_BY_DIR_HASH_pop_free(sk, free_func) \ |
| 881 | sk_pop_free( \ |
| 882 | CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk), \ |
| 883 | CHECKED_CAST(void (*)(void *), void (*)(BY_DIR_HASH *), free_func)) |
| 884 | |
| 885 | #define sk_BY_DIR_HASH_insert(sk, p, where) \ |
| 886 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk), \ |
| 887 | CHECKED_CAST(void *, BY_DIR_HASH *, p), (where)) |
| 888 | |
| 889 | #define sk_BY_DIR_HASH_delete(sk, where) \ |
| 890 | ((BY_DIR_HASH *)sk_delete( \ |
| 891 | CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk), (where))) |
| 892 | |
| 893 | #define sk_BY_DIR_HASH_delete_ptr(sk, p) \ |
| 894 | ((BY_DIR_HASH *)sk_delete_ptr( \ |
| 895 | CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk), \ |
| 896 | CHECKED_CAST(void *, BY_DIR_HASH *, p))) |
| 897 | |
| 898 | #define sk_BY_DIR_HASH_find(sk, out_index, p) \ |
| 899 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk), (out_index), \ |
| 900 | CHECKED_CAST(void *, BY_DIR_HASH *, p)) |
| 901 | |
| 902 | #define sk_BY_DIR_HASH_shift(sk) \ |
| 903 | ((BY_DIR_HASH *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk))) |
| 904 | |
| 905 | #define sk_BY_DIR_HASH_push(sk, p) \ |
| 906 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk), \ |
| 907 | CHECKED_CAST(void *, BY_DIR_HASH *, p)) |
| 908 | |
| 909 | #define sk_BY_DIR_HASH_pop(sk) \ |
| 910 | ((BY_DIR_HASH *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk))) |
| 911 | |
| 912 | #define sk_BY_DIR_HASH_dup(sk) \ |
| 913 | ((STACK_OF(BY_DIR_HASH) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 914 | CHECKED_CAST(const _STACK *, const STACK_OF(BY_DIR_HASH) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 915 | |
| 916 | #define sk_BY_DIR_HASH_sort(sk) \ |
| 917 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk)) |
| 918 | |
| 919 | #define sk_BY_DIR_HASH_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 920 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(BY_DIR_HASH) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 921 | |
| 922 | #define sk_BY_DIR_HASH_set_cmp_func(sk, comp) \ |
| 923 | ((int (*)(const BY_DIR_HASH **a, const BY_DIR_HASH **b))sk_set_cmp_func( \ |
| 924 | CHECKED_CAST(_STACK *, STACK_OF(BY_DIR_HASH) *, sk), \ |
| 925 | CHECKED_CAST(stack_cmp_func, \ |
| 926 | int (*)(const BY_DIR_HASH **a, const BY_DIR_HASH **b), \ |
| 927 | comp))) |
| 928 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 929 | #define sk_BY_DIR_HASH_deep_copy(sk, copy_func, free_func) \ |
| 930 | ((STACK_OF(BY_DIR_HASH) *)sk_deep_copy( \ |
| 931 | CHECKED_CAST(const _STACK *, const STACK_OF(BY_DIR_HASH) *, sk), \ |
| 932 | CHECKED_CAST(void *(*)(void *), BY_DIR_HASH *(*)(BY_DIR_HASH *), \ |
| 933 | copy_func), \ |
| 934 | CHECKED_CAST(void (*)(void *), void (*)(BY_DIR_HASH *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 935 | |
| 936 | /* CONF_VALUE */ |
| 937 | #define sk_CONF_VALUE_new(comp) \ |
| 938 | ((STACK_OF(CONF_VALUE) *)sk_new(CHECKED_CAST( \ |
| 939 | stack_cmp_func, int (*)(const CONF_VALUE **a, const CONF_VALUE **b), \ |
| 940 | comp))) |
| 941 | |
| 942 | #define sk_CONF_VALUE_new_null() ((STACK_OF(CONF_VALUE) *)sk_new_null()) |
| 943 | |
| 944 | #define sk_CONF_VALUE_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 945 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(CONF_VALUE) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 946 | |
| 947 | #define sk_CONF_VALUE_zero(sk) \ |
| 948 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk)); |
| 949 | |
| 950 | #define sk_CONF_VALUE_value(sk, i) \ |
| 951 | ((CONF_VALUE *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 952 | CHECKED_CAST(const _STACK *, const STACK_OF(CONF_VALUE) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 953 | |
| 954 | #define sk_CONF_VALUE_set(sk, i, p) \ |
| 955 | ((CONF_VALUE *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk), \ |
| 956 | (i), CHECKED_CAST(void *, CONF_VALUE *, p))) |
| 957 | |
| 958 | #define sk_CONF_VALUE_free(sk) \ |
| 959 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk)) |
| 960 | |
| 961 | #define sk_CONF_VALUE_pop_free(sk, free_func) \ |
| 962 | sk_pop_free( \ |
| 963 | CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk), \ |
| 964 | CHECKED_CAST(void (*)(void *), void (*)(CONF_VALUE *), free_func)) |
| 965 | |
| 966 | #define sk_CONF_VALUE_insert(sk, p, where) \ |
| 967 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk), \ |
| 968 | CHECKED_CAST(void *, CONF_VALUE *, p), (where)) |
| 969 | |
| 970 | #define sk_CONF_VALUE_delete(sk, where) \ |
| 971 | ((CONF_VALUE *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk), \ |
| 972 | (where))) |
| 973 | |
| 974 | #define sk_CONF_VALUE_delete_ptr(sk, p) \ |
| 975 | ((CONF_VALUE *)sk_delete_ptr( \ |
| 976 | CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk), \ |
| 977 | CHECKED_CAST(void *, CONF_VALUE *, p))) |
| 978 | |
| 979 | #define sk_CONF_VALUE_find(sk, out_index, p) \ |
| 980 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk), (out_index), \ |
| 981 | CHECKED_CAST(void *, CONF_VALUE *, p)) |
| 982 | |
| 983 | #define sk_CONF_VALUE_shift(sk) \ |
| 984 | ((CONF_VALUE *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk))) |
| 985 | |
| 986 | #define sk_CONF_VALUE_push(sk, p) \ |
| 987 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk), \ |
| 988 | CHECKED_CAST(void *, CONF_VALUE *, p)) |
| 989 | |
| 990 | #define sk_CONF_VALUE_pop(sk) \ |
| 991 | ((CONF_VALUE *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk))) |
| 992 | |
| 993 | #define sk_CONF_VALUE_dup(sk) \ |
| 994 | ((STACK_OF(CONF_VALUE) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 995 | CHECKED_CAST(const _STACK *, const STACK_OF(CONF_VALUE) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 996 | |
| 997 | #define sk_CONF_VALUE_sort(sk) \ |
| 998 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk)) |
| 999 | |
| 1000 | #define sk_CONF_VALUE_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1001 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(CONF_VALUE) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1002 | |
| 1003 | #define sk_CONF_VALUE_set_cmp_func(sk, comp) \ |
| 1004 | ((int (*)(const CONF_VALUE **a, const CONF_VALUE **b))sk_set_cmp_func( \ |
| 1005 | CHECKED_CAST(_STACK *, STACK_OF(CONF_VALUE) *, sk), \ |
| 1006 | CHECKED_CAST(stack_cmp_func, \ |
| 1007 | int (*)(const CONF_VALUE **a, const CONF_VALUE **b), \ |
| 1008 | comp))) |
| 1009 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1010 | #define sk_CONF_VALUE_deep_copy(sk, copy_func, free_func) \ |
| 1011 | ((STACK_OF(CONF_VALUE) *)sk_deep_copy( \ |
| 1012 | CHECKED_CAST(const _STACK *, const STACK_OF(CONF_VALUE) *, sk), \ |
| 1013 | CHECKED_CAST(void *(*)(void *), CONF_VALUE *(*)(CONF_VALUE *), \ |
| 1014 | copy_func), \ |
| 1015 | CHECKED_CAST(void (*)(void *), void (*)(CONF_VALUE *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1016 | |
Steven Valdez | 909b19f | 2016-11-21 15:35:44 -0500 | [diff] [blame] | 1017 | /* CRYPTO_BUFFER */ |
| 1018 | #define sk_CRYPTO_BUFFER_new(comp) \ |
| 1019 | ((STACK_OF(CRYPTO_BUFFER) *)sk_new(CHECKED_CAST( \ |
| 1020 | stack_cmp_func, \ |
| 1021 | int (*)(const CRYPTO_BUFFER **a, const CRYPTO_BUFFER **b), comp))) |
| 1022 | |
| 1023 | #define sk_CRYPTO_BUFFER_new_null() ((STACK_OF(CRYPTO_BUFFER) *)sk_new_null()) |
| 1024 | |
| 1025 | #define sk_CRYPTO_BUFFER_num(sk) \ |
| 1026 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(CRYPTO_BUFFER) *, sk)) |
| 1027 | |
| 1028 | #define sk_CRYPTO_BUFFER_zero(sk) \ |
| 1029 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk)); |
| 1030 | |
| 1031 | #define sk_CRYPTO_BUFFER_value(sk, i) \ |
| 1032 | ((CRYPTO_BUFFER *)sk_value( \ |
| 1033 | CHECKED_CAST(const _STACK *, const STACK_OF(CRYPTO_BUFFER) *, sk), (i))) |
| 1034 | |
| 1035 | #define sk_CRYPTO_BUFFER_set(sk, i, p) \ |
| 1036 | ((CRYPTO_BUFFER *)sk_set( \ |
| 1037 | CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk), (i), \ |
| 1038 | CHECKED_CAST(void *, CRYPTO_BUFFER *, p))) |
| 1039 | |
| 1040 | #define sk_CRYPTO_BUFFER_free(sk) \ |
| 1041 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk)) |
| 1042 | |
| 1043 | #define sk_CRYPTO_BUFFER_pop_free(sk, free_func) \ |
| 1044 | sk_pop_free( \ |
| 1045 | CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk), \ |
| 1046 | CHECKED_CAST(void (*)(void *), void (*)(CRYPTO_BUFFER *), free_func)) |
| 1047 | |
| 1048 | #define sk_CRYPTO_BUFFER_insert(sk, p, where) \ |
| 1049 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk), \ |
| 1050 | CHECKED_CAST(void *, CRYPTO_BUFFER *, p), (where)) |
| 1051 | |
| 1052 | #define sk_CRYPTO_BUFFER_delete(sk, where) \ |
| 1053 | ((CRYPTO_BUFFER *)sk_delete( \ |
| 1054 | CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk), (where))) |
| 1055 | |
| 1056 | #define sk_CRYPTO_BUFFER_delete_ptr(sk, p) \ |
| 1057 | ((CRYPTO_BUFFER *)sk_delete_ptr( \ |
| 1058 | CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk), \ |
| 1059 | CHECKED_CAST(void *, CRYPTO_BUFFER *, p))) |
| 1060 | |
| 1061 | #define sk_CRYPTO_BUFFER_find(sk, out_index, p) \ |
| 1062 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk), (out_index), \ |
| 1063 | CHECKED_CAST(void *, CRYPTO_BUFFER *, p)) |
| 1064 | |
| 1065 | #define sk_CRYPTO_BUFFER_shift(sk) \ |
| 1066 | ((CRYPTO_BUFFER *)sk_shift( \ |
| 1067 | CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk))) |
| 1068 | |
| 1069 | #define sk_CRYPTO_BUFFER_push(sk, p) \ |
| 1070 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk), \ |
| 1071 | CHECKED_CAST(void *, CRYPTO_BUFFER *, p)) |
| 1072 | |
| 1073 | #define sk_CRYPTO_BUFFER_pop(sk) \ |
| 1074 | ((CRYPTO_BUFFER *)sk_pop( \ |
| 1075 | CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk))) |
| 1076 | |
| 1077 | #define sk_CRYPTO_BUFFER_dup(sk) \ |
| 1078 | ((STACK_OF(CRYPTO_BUFFER) *)sk_dup( \ |
| 1079 | CHECKED_CAST(const _STACK *, const STACK_OF(CRYPTO_BUFFER) *, sk))) |
| 1080 | |
| 1081 | #define sk_CRYPTO_BUFFER_sort(sk) \ |
| 1082 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk)) |
| 1083 | |
| 1084 | #define sk_CRYPTO_BUFFER_is_sorted(sk) \ |
| 1085 | sk_is_sorted( \ |
| 1086 | CHECKED_CAST(const _STACK *, const STACK_OF(CRYPTO_BUFFER) *, sk)) |
| 1087 | |
| 1088 | #define sk_CRYPTO_BUFFER_set_cmp_func(sk, comp) \ |
| 1089 | ((int (*)(const CRYPTO_BUFFER **a, const CRYPTO_BUFFER **b))sk_set_cmp_func( \ |
| 1090 | CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_BUFFER) *, sk), \ |
| 1091 | CHECKED_CAST(stack_cmp_func, \ |
| 1092 | int (*)(const CRYPTO_BUFFER **a, const CRYPTO_BUFFER **b), \ |
| 1093 | comp))) |
| 1094 | |
| 1095 | #define sk_CRYPTO_BUFFER_deep_copy(sk, copy_func, free_func) \ |
| 1096 | ((STACK_OF(CRYPTO_BUFFER) *)sk_deep_copy( \ |
| 1097 | CHECKED_CAST(const _STACK *, const STACK_OF(CRYPTO_BUFFER) *, sk), \ |
| 1098 | CHECKED_CAST(void *(*)(void *), CRYPTO_BUFFER *(*)(CRYPTO_BUFFER *), \ |
| 1099 | copy_func), \ |
| 1100 | CHECKED_CAST(void (*)(void *), void (*)(CRYPTO_BUFFER *), free_func))) |
| 1101 | |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1102 | /* CRYPTO_EX_DATA_FUNCS */ |
| 1103 | #define sk_CRYPTO_EX_DATA_FUNCS_new(comp) \ |
| 1104 | ((STACK_OF(CRYPTO_EX_DATA_FUNCS) *)sk_new(CHECKED_CAST( \ |
| 1105 | stack_cmp_func, \ |
| 1106 | int (*)(const CRYPTO_EX_DATA_FUNCS **a, const CRYPTO_EX_DATA_FUNCS **b), \ |
| 1107 | comp))) |
| 1108 | |
| 1109 | #define sk_CRYPTO_EX_DATA_FUNCS_new_null() \ |
| 1110 | ((STACK_OF(CRYPTO_EX_DATA_FUNCS) *)sk_new_null()) |
| 1111 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1112 | #define sk_CRYPTO_EX_DATA_FUNCS_num(sk) \ |
| 1113 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(CRYPTO_EX_DATA_FUNCS) *, \ |
| 1114 | sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1115 | |
| 1116 | #define sk_CRYPTO_EX_DATA_FUNCS_zero(sk) \ |
| 1117 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk)); |
| 1118 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1119 | #define sk_CRYPTO_EX_DATA_FUNCS_value(sk, i) \ |
| 1120 | ((CRYPTO_EX_DATA_FUNCS *)sk_value( \ |
| 1121 | CHECKED_CAST(const _STACK *, const STACK_OF(CRYPTO_EX_DATA_FUNCS) *, \ |
| 1122 | sk), \ |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1123 | (i))) |
| 1124 | |
| 1125 | #define sk_CRYPTO_EX_DATA_FUNCS_set(sk, i, p) \ |
| 1126 | ((CRYPTO_EX_DATA_FUNCS *)sk_set( \ |
| 1127 | CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk), (i), \ |
| 1128 | CHECKED_CAST(void *, CRYPTO_EX_DATA_FUNCS *, p))) |
| 1129 | |
| 1130 | #define sk_CRYPTO_EX_DATA_FUNCS_free(sk) \ |
| 1131 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk)) |
| 1132 | |
| 1133 | #define sk_CRYPTO_EX_DATA_FUNCS_pop_free(sk, free_func) \ |
| 1134 | sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk), \ |
| 1135 | CHECKED_CAST(void (*)(void *), void (*)(CRYPTO_EX_DATA_FUNCS *), \ |
| 1136 | free_func)) |
| 1137 | |
| 1138 | #define sk_CRYPTO_EX_DATA_FUNCS_insert(sk, p, where) \ |
| 1139 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk), \ |
| 1140 | CHECKED_CAST(void *, CRYPTO_EX_DATA_FUNCS *, p), (where)) |
| 1141 | |
| 1142 | #define sk_CRYPTO_EX_DATA_FUNCS_delete(sk, where) \ |
| 1143 | ((CRYPTO_EX_DATA_FUNCS *)sk_delete( \ |
| 1144 | CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk), (where))) |
| 1145 | |
| 1146 | #define sk_CRYPTO_EX_DATA_FUNCS_delete_ptr(sk, p) \ |
| 1147 | ((CRYPTO_EX_DATA_FUNCS *)sk_delete_ptr( \ |
| 1148 | CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk), \ |
| 1149 | CHECKED_CAST(void *, CRYPTO_EX_DATA_FUNCS *, p))) |
| 1150 | |
| 1151 | #define sk_CRYPTO_EX_DATA_FUNCS_find(sk, out_index, p) \ |
| 1152 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk), \ |
| 1153 | (out_index), CHECKED_CAST(void *, CRYPTO_EX_DATA_FUNCS *, p)) |
| 1154 | |
| 1155 | #define sk_CRYPTO_EX_DATA_FUNCS_shift(sk) \ |
| 1156 | ((CRYPTO_EX_DATA_FUNCS *)sk_shift( \ |
| 1157 | CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk))) |
| 1158 | |
| 1159 | #define sk_CRYPTO_EX_DATA_FUNCS_push(sk, p) \ |
| 1160 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk), \ |
| 1161 | CHECKED_CAST(void *, CRYPTO_EX_DATA_FUNCS *, p)) |
| 1162 | |
| 1163 | #define sk_CRYPTO_EX_DATA_FUNCS_pop(sk) \ |
| 1164 | ((CRYPTO_EX_DATA_FUNCS *)sk_pop( \ |
| 1165 | CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk))) |
| 1166 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1167 | #define sk_CRYPTO_EX_DATA_FUNCS_dup(sk) \ |
| 1168 | ((STACK_OF(CRYPTO_EX_DATA_FUNCS) *)sk_dup(CHECKED_CAST( \ |
| 1169 | const _STACK *, const STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1170 | |
| 1171 | #define sk_CRYPTO_EX_DATA_FUNCS_sort(sk) \ |
| 1172 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk)) |
| 1173 | |
| 1174 | #define sk_CRYPTO_EX_DATA_FUNCS_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1175 | sk_is_sorted(CHECKED_CAST(const _STACK *, \ |
| 1176 | const STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1177 | |
| 1178 | #define sk_CRYPTO_EX_DATA_FUNCS_set_cmp_func(sk, comp) \ |
| 1179 | ((int (*)(const CRYPTO_EX_DATA_FUNCS **a, const CRYPTO_EX_DATA_FUNCS **b)) \ |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1180 | sk_set_cmp_func( \ |
| 1181 | CHECKED_CAST(_STACK *, STACK_OF(CRYPTO_EX_DATA_FUNCS) *, sk), \ |
| 1182 | CHECKED_CAST(stack_cmp_func, \ |
| 1183 | int (*)(const CRYPTO_EX_DATA_FUNCS **a, \ |
| 1184 | const CRYPTO_EX_DATA_FUNCS **b), \ |
| 1185 | comp))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1186 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1187 | #define sk_CRYPTO_EX_DATA_FUNCS_deep_copy(sk, copy_func, free_func) \ |
| 1188 | ((STACK_OF(CRYPTO_EX_DATA_FUNCS) *)sk_deep_copy( \ |
| 1189 | CHECKED_CAST(const _STACK *, const STACK_OF(CRYPTO_EX_DATA_FUNCS) *, \ |
| 1190 | sk), \ |
| 1191 | CHECKED_CAST(void *(*)(void *), \ |
| 1192 | CRYPTO_EX_DATA_FUNCS *(*)(CRYPTO_EX_DATA_FUNCS *), \ |
| 1193 | copy_func), \ |
| 1194 | CHECKED_CAST(void (*)(void *), void (*)(CRYPTO_EX_DATA_FUNCS *), \ |
| 1195 | free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1196 | |
| 1197 | /* DIST_POINT */ |
| 1198 | #define sk_DIST_POINT_new(comp) \ |
| 1199 | ((STACK_OF(DIST_POINT) *)sk_new(CHECKED_CAST( \ |
| 1200 | stack_cmp_func, int (*)(const DIST_POINT **a, const DIST_POINT **b), \ |
| 1201 | comp))) |
| 1202 | |
| 1203 | #define sk_DIST_POINT_new_null() ((STACK_OF(DIST_POINT) *)sk_new_null()) |
| 1204 | |
| 1205 | #define sk_DIST_POINT_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1206 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(DIST_POINT) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1207 | |
| 1208 | #define sk_DIST_POINT_zero(sk) \ |
| 1209 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk)); |
| 1210 | |
| 1211 | #define sk_DIST_POINT_value(sk, i) \ |
| 1212 | ((DIST_POINT *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1213 | CHECKED_CAST(const _STACK *, const STACK_OF(DIST_POINT) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1214 | |
| 1215 | #define sk_DIST_POINT_set(sk, i, p) \ |
| 1216 | ((DIST_POINT *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk), \ |
| 1217 | (i), CHECKED_CAST(void *, DIST_POINT *, p))) |
| 1218 | |
| 1219 | #define sk_DIST_POINT_free(sk) \ |
| 1220 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk)) |
| 1221 | |
| 1222 | #define sk_DIST_POINT_pop_free(sk, free_func) \ |
| 1223 | sk_pop_free( \ |
| 1224 | CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk), \ |
| 1225 | CHECKED_CAST(void (*)(void *), void (*)(DIST_POINT *), free_func)) |
| 1226 | |
| 1227 | #define sk_DIST_POINT_insert(sk, p, where) \ |
| 1228 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk), \ |
| 1229 | CHECKED_CAST(void *, DIST_POINT *, p), (where)) |
| 1230 | |
| 1231 | #define sk_DIST_POINT_delete(sk, where) \ |
| 1232 | ((DIST_POINT *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk), \ |
| 1233 | (where))) |
| 1234 | |
| 1235 | #define sk_DIST_POINT_delete_ptr(sk, p) \ |
| 1236 | ((DIST_POINT *)sk_delete_ptr( \ |
| 1237 | CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk), \ |
| 1238 | CHECKED_CAST(void *, DIST_POINT *, p))) |
| 1239 | |
| 1240 | #define sk_DIST_POINT_find(sk, out_index, p) \ |
| 1241 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk), (out_index), \ |
| 1242 | CHECKED_CAST(void *, DIST_POINT *, p)) |
| 1243 | |
| 1244 | #define sk_DIST_POINT_shift(sk) \ |
| 1245 | ((DIST_POINT *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk))) |
| 1246 | |
| 1247 | #define sk_DIST_POINT_push(sk, p) \ |
| 1248 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk), \ |
| 1249 | CHECKED_CAST(void *, DIST_POINT *, p)) |
| 1250 | |
| 1251 | #define sk_DIST_POINT_pop(sk) \ |
| 1252 | ((DIST_POINT *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk))) |
| 1253 | |
| 1254 | #define sk_DIST_POINT_dup(sk) \ |
| 1255 | ((STACK_OF(DIST_POINT) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1256 | CHECKED_CAST(const _STACK *, const STACK_OF(DIST_POINT) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1257 | |
| 1258 | #define sk_DIST_POINT_sort(sk) \ |
| 1259 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk)) |
| 1260 | |
| 1261 | #define sk_DIST_POINT_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1262 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(DIST_POINT) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1263 | |
| 1264 | #define sk_DIST_POINT_set_cmp_func(sk, comp) \ |
| 1265 | ((int (*)(const DIST_POINT **a, const DIST_POINT **b))sk_set_cmp_func( \ |
| 1266 | CHECKED_CAST(_STACK *, STACK_OF(DIST_POINT) *, sk), \ |
| 1267 | CHECKED_CAST(stack_cmp_func, \ |
| 1268 | int (*)(const DIST_POINT **a, const DIST_POINT **b), \ |
| 1269 | comp))) |
| 1270 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1271 | #define sk_DIST_POINT_deep_copy(sk, copy_func, free_func) \ |
| 1272 | ((STACK_OF(DIST_POINT) *)sk_deep_copy( \ |
| 1273 | CHECKED_CAST(const _STACK *, const STACK_OF(DIST_POINT) *, sk), \ |
| 1274 | CHECKED_CAST(void *(*)(void *), DIST_POINT *(*)(DIST_POINT *), \ |
| 1275 | copy_func), \ |
| 1276 | CHECKED_CAST(void (*)(void *), void (*)(DIST_POINT *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1277 | |
| 1278 | /* GENERAL_NAME */ |
| 1279 | #define sk_GENERAL_NAME_new(comp) \ |
| 1280 | ((STACK_OF(GENERAL_NAME) *)sk_new(CHECKED_CAST( \ |
| 1281 | stack_cmp_func, int (*)(const GENERAL_NAME **a, const GENERAL_NAME **b), \ |
| 1282 | comp))) |
| 1283 | |
| 1284 | #define sk_GENERAL_NAME_new_null() ((STACK_OF(GENERAL_NAME) *)sk_new_null()) |
| 1285 | |
| 1286 | #define sk_GENERAL_NAME_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1287 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_NAME) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1288 | |
| 1289 | #define sk_GENERAL_NAME_zero(sk) \ |
| 1290 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk)); |
| 1291 | |
| 1292 | #define sk_GENERAL_NAME_value(sk, i) \ |
| 1293 | ((GENERAL_NAME *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1294 | CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_NAME) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1295 | |
| 1296 | #define sk_GENERAL_NAME_set(sk, i, p) \ |
| 1297 | ((GENERAL_NAME *)sk_set( \ |
| 1298 | CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk), (i), \ |
| 1299 | CHECKED_CAST(void *, GENERAL_NAME *, p))) |
| 1300 | |
| 1301 | #define sk_GENERAL_NAME_free(sk) \ |
| 1302 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk)) |
| 1303 | |
| 1304 | #define sk_GENERAL_NAME_pop_free(sk, free_func) \ |
| 1305 | sk_pop_free( \ |
| 1306 | CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk), \ |
| 1307 | CHECKED_CAST(void (*)(void *), void (*)(GENERAL_NAME *), free_func)) |
| 1308 | |
| 1309 | #define sk_GENERAL_NAME_insert(sk, p, where) \ |
| 1310 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk), \ |
| 1311 | CHECKED_CAST(void *, GENERAL_NAME *, p), (where)) |
| 1312 | |
| 1313 | #define sk_GENERAL_NAME_delete(sk, where) \ |
| 1314 | ((GENERAL_NAME *)sk_delete( \ |
| 1315 | CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk), (where))) |
| 1316 | |
| 1317 | #define sk_GENERAL_NAME_delete_ptr(sk, p) \ |
| 1318 | ((GENERAL_NAME *)sk_delete_ptr( \ |
| 1319 | CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk), \ |
| 1320 | CHECKED_CAST(void *, GENERAL_NAME *, p))) |
| 1321 | |
| 1322 | #define sk_GENERAL_NAME_find(sk, out_index, p) \ |
| 1323 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk), (out_index), \ |
| 1324 | CHECKED_CAST(void *, GENERAL_NAME *, p)) |
| 1325 | |
| 1326 | #define sk_GENERAL_NAME_shift(sk) \ |
| 1327 | ((GENERAL_NAME *)sk_shift( \ |
| 1328 | CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk))) |
| 1329 | |
| 1330 | #define sk_GENERAL_NAME_push(sk, p) \ |
| 1331 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk), \ |
| 1332 | CHECKED_CAST(void *, GENERAL_NAME *, p)) |
| 1333 | |
| 1334 | #define sk_GENERAL_NAME_pop(sk) \ |
| 1335 | ((GENERAL_NAME *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk))) |
| 1336 | |
| 1337 | #define sk_GENERAL_NAME_dup(sk) \ |
| 1338 | ((STACK_OF(GENERAL_NAME) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1339 | CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_NAME) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1340 | |
| 1341 | #define sk_GENERAL_NAME_sort(sk) \ |
| 1342 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk)) |
| 1343 | |
| 1344 | #define sk_GENERAL_NAME_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1345 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_NAME) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1346 | |
| 1347 | #define sk_GENERAL_NAME_set_cmp_func(sk, comp) \ |
| 1348 | ((int (*)(const GENERAL_NAME **a, const GENERAL_NAME **b))sk_set_cmp_func( \ |
| 1349 | CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAME) *, sk), \ |
| 1350 | CHECKED_CAST(stack_cmp_func, \ |
| 1351 | int (*)(const GENERAL_NAME **a, const GENERAL_NAME **b), \ |
| 1352 | comp))) |
| 1353 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1354 | #define sk_GENERAL_NAME_deep_copy(sk, copy_func, free_func) \ |
| 1355 | ((STACK_OF(GENERAL_NAME) *)sk_deep_copy( \ |
| 1356 | CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_NAME) *, sk), \ |
| 1357 | CHECKED_CAST(void *(*)(void *), GENERAL_NAME *(*)(GENERAL_NAME *), \ |
| 1358 | copy_func), \ |
| 1359 | CHECKED_CAST(void (*)(void *), void (*)(GENERAL_NAME *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1360 | |
| 1361 | /* GENERAL_NAMES */ |
| 1362 | #define sk_GENERAL_NAMES_new(comp) \ |
| 1363 | ((STACK_OF(GENERAL_NAMES) *)sk_new(CHECKED_CAST( \ |
| 1364 | stack_cmp_func, \ |
| 1365 | int (*)(const GENERAL_NAMES **a, const GENERAL_NAMES **b), comp))) |
| 1366 | |
| 1367 | #define sk_GENERAL_NAMES_new_null() ((STACK_OF(GENERAL_NAMES) *)sk_new_null()) |
| 1368 | |
| 1369 | #define sk_GENERAL_NAMES_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1370 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_NAMES) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1371 | |
| 1372 | #define sk_GENERAL_NAMES_zero(sk) \ |
| 1373 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk)); |
| 1374 | |
| 1375 | #define sk_GENERAL_NAMES_value(sk, i) \ |
| 1376 | ((GENERAL_NAMES *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1377 | CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_NAMES) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1378 | |
| 1379 | #define sk_GENERAL_NAMES_set(sk, i, p) \ |
| 1380 | ((GENERAL_NAMES *)sk_set( \ |
| 1381 | CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk), (i), \ |
| 1382 | CHECKED_CAST(void *, GENERAL_NAMES *, p))) |
| 1383 | |
| 1384 | #define sk_GENERAL_NAMES_free(sk) \ |
| 1385 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk)) |
| 1386 | |
| 1387 | #define sk_GENERAL_NAMES_pop_free(sk, free_func) \ |
| 1388 | sk_pop_free( \ |
| 1389 | CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk), \ |
| 1390 | CHECKED_CAST(void (*)(void *), void (*)(GENERAL_NAMES *), free_func)) |
| 1391 | |
| 1392 | #define sk_GENERAL_NAMES_insert(sk, p, where) \ |
| 1393 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk), \ |
| 1394 | CHECKED_CAST(void *, GENERAL_NAMES *, p), (where)) |
| 1395 | |
| 1396 | #define sk_GENERAL_NAMES_delete(sk, where) \ |
| 1397 | ((GENERAL_NAMES *)sk_delete( \ |
| 1398 | CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk), (where))) |
| 1399 | |
| 1400 | #define sk_GENERAL_NAMES_delete_ptr(sk, p) \ |
| 1401 | ((GENERAL_NAMES *)sk_delete_ptr( \ |
| 1402 | CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk), \ |
| 1403 | CHECKED_CAST(void *, GENERAL_NAMES *, p))) |
| 1404 | |
| 1405 | #define sk_GENERAL_NAMES_find(sk, out_index, p) \ |
| 1406 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk), (out_index), \ |
| 1407 | CHECKED_CAST(void *, GENERAL_NAMES *, p)) |
| 1408 | |
| 1409 | #define sk_GENERAL_NAMES_shift(sk) \ |
| 1410 | ((GENERAL_NAMES *)sk_shift( \ |
| 1411 | CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk))) |
| 1412 | |
| 1413 | #define sk_GENERAL_NAMES_push(sk, p) \ |
| 1414 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk), \ |
| 1415 | CHECKED_CAST(void *, GENERAL_NAMES *, p)) |
| 1416 | |
| 1417 | #define sk_GENERAL_NAMES_pop(sk) \ |
| 1418 | ((GENERAL_NAMES *)sk_pop( \ |
| 1419 | CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk))) |
| 1420 | |
| 1421 | #define sk_GENERAL_NAMES_dup(sk) \ |
| 1422 | ((STACK_OF(GENERAL_NAMES) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1423 | CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_NAMES) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1424 | |
| 1425 | #define sk_GENERAL_NAMES_sort(sk) \ |
| 1426 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk)) |
| 1427 | |
| 1428 | #define sk_GENERAL_NAMES_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1429 | sk_is_sorted( \ |
| 1430 | CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_NAMES) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1431 | |
| 1432 | #define sk_GENERAL_NAMES_set_cmp_func(sk, comp) \ |
| 1433 | ((int (*)(const GENERAL_NAMES **a, const GENERAL_NAMES **b))sk_set_cmp_func( \ |
| 1434 | CHECKED_CAST(_STACK *, STACK_OF(GENERAL_NAMES) *, sk), \ |
| 1435 | CHECKED_CAST(stack_cmp_func, \ |
| 1436 | int (*)(const GENERAL_NAMES **a, const GENERAL_NAMES **b), \ |
| 1437 | comp))) |
| 1438 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1439 | #define sk_GENERAL_NAMES_deep_copy(sk, copy_func, free_func) \ |
| 1440 | ((STACK_OF(GENERAL_NAMES) *)sk_deep_copy( \ |
| 1441 | CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_NAMES) *, sk), \ |
| 1442 | CHECKED_CAST(void *(*)(void *), GENERAL_NAMES *(*)(GENERAL_NAMES *), \ |
| 1443 | copy_func), \ |
| 1444 | CHECKED_CAST(void (*)(void *), void (*)(GENERAL_NAMES *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1445 | |
| 1446 | /* GENERAL_SUBTREE */ |
| 1447 | #define sk_GENERAL_SUBTREE_new(comp) \ |
| 1448 | ((STACK_OF(GENERAL_SUBTREE) *)sk_new(CHECKED_CAST( \ |
| 1449 | stack_cmp_func, \ |
| 1450 | int (*)(const GENERAL_SUBTREE **a, const GENERAL_SUBTREE **b), comp))) |
| 1451 | |
| 1452 | #define sk_GENERAL_SUBTREE_new_null() \ |
| 1453 | ((STACK_OF(GENERAL_SUBTREE) *)sk_new_null()) |
| 1454 | |
| 1455 | #define sk_GENERAL_SUBTREE_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1456 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_SUBTREE) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1457 | |
| 1458 | #define sk_GENERAL_SUBTREE_zero(sk) \ |
| 1459 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk)); |
| 1460 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1461 | #define sk_GENERAL_SUBTREE_value(sk, i) \ |
| 1462 | ((GENERAL_SUBTREE *)sk_value( \ |
| 1463 | CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_SUBTREE) *, sk), \ |
| 1464 | (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1465 | |
| 1466 | #define sk_GENERAL_SUBTREE_set(sk, i, p) \ |
| 1467 | ((GENERAL_SUBTREE *)sk_set( \ |
| 1468 | CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk), (i), \ |
| 1469 | CHECKED_CAST(void *, GENERAL_SUBTREE *, p))) |
| 1470 | |
| 1471 | #define sk_GENERAL_SUBTREE_free(sk) \ |
| 1472 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk)) |
| 1473 | |
| 1474 | #define sk_GENERAL_SUBTREE_pop_free(sk, free_func) \ |
| 1475 | sk_pop_free( \ |
| 1476 | CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk), \ |
| 1477 | CHECKED_CAST(void (*)(void *), void (*)(GENERAL_SUBTREE *), free_func)) |
| 1478 | |
| 1479 | #define sk_GENERAL_SUBTREE_insert(sk, p, where) \ |
| 1480 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk), \ |
| 1481 | CHECKED_CAST(void *, GENERAL_SUBTREE *, p), (where)) |
| 1482 | |
| 1483 | #define sk_GENERAL_SUBTREE_delete(sk, where) \ |
| 1484 | ((GENERAL_SUBTREE *)sk_delete( \ |
| 1485 | CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk), (where))) |
| 1486 | |
| 1487 | #define sk_GENERAL_SUBTREE_delete_ptr(sk, p) \ |
| 1488 | ((GENERAL_SUBTREE *)sk_delete_ptr( \ |
| 1489 | CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk), \ |
| 1490 | CHECKED_CAST(void *, GENERAL_SUBTREE *, p))) |
| 1491 | |
| 1492 | #define sk_GENERAL_SUBTREE_find(sk, out_index, p) \ |
| 1493 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk), \ |
| 1494 | (out_index), CHECKED_CAST(void *, GENERAL_SUBTREE *, p)) |
| 1495 | |
| 1496 | #define sk_GENERAL_SUBTREE_shift(sk) \ |
| 1497 | ((GENERAL_SUBTREE *)sk_shift( \ |
| 1498 | CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk))) |
| 1499 | |
| 1500 | #define sk_GENERAL_SUBTREE_push(sk, p) \ |
| 1501 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk), \ |
| 1502 | CHECKED_CAST(void *, GENERAL_SUBTREE *, p)) |
| 1503 | |
| 1504 | #define sk_GENERAL_SUBTREE_pop(sk) \ |
| 1505 | ((GENERAL_SUBTREE *)sk_pop( \ |
| 1506 | CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk))) |
| 1507 | |
| 1508 | #define sk_GENERAL_SUBTREE_dup(sk) \ |
| 1509 | ((STACK_OF(GENERAL_SUBTREE) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1510 | CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_SUBTREE) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1511 | |
| 1512 | #define sk_GENERAL_SUBTREE_sort(sk) \ |
| 1513 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk)) |
| 1514 | |
| 1515 | #define sk_GENERAL_SUBTREE_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1516 | sk_is_sorted( \ |
| 1517 | CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_SUBTREE) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1518 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1519 | #define sk_GENERAL_SUBTREE_set_cmp_func(sk, comp) \ |
| 1520 | ((int (*)(const GENERAL_SUBTREE **a, const GENERAL_SUBTREE **b)) \ |
| 1521 | sk_set_cmp_func( \ |
| 1522 | CHECKED_CAST(_STACK *, STACK_OF(GENERAL_SUBTREE) *, sk), \ |
| 1523 | CHECKED_CAST(stack_cmp_func, int (*)(const GENERAL_SUBTREE **a, \ |
| 1524 | const GENERAL_SUBTREE **b), \ |
| 1525 | comp))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1526 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1527 | #define sk_GENERAL_SUBTREE_deep_copy(sk, copy_func, free_func) \ |
| 1528 | ((STACK_OF(GENERAL_SUBTREE) *)sk_deep_copy( \ |
| 1529 | CHECKED_CAST(const _STACK *, const STACK_OF(GENERAL_SUBTREE) *, sk), \ |
| 1530 | CHECKED_CAST(void *(*)(void *), GENERAL_SUBTREE *(*)(GENERAL_SUBTREE *), \ |
| 1531 | copy_func), \ |
| 1532 | CHECKED_CAST(void (*)(void *), void (*)(GENERAL_SUBTREE *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1533 | |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1534 | /* POLICYINFO */ |
| 1535 | #define sk_POLICYINFO_new(comp) \ |
| 1536 | ((STACK_OF(POLICYINFO) *)sk_new(CHECKED_CAST( \ |
| 1537 | stack_cmp_func, int (*)(const POLICYINFO **a, const POLICYINFO **b), \ |
| 1538 | comp))) |
| 1539 | |
| 1540 | #define sk_POLICYINFO_new_null() ((STACK_OF(POLICYINFO) *)sk_new_null()) |
| 1541 | |
| 1542 | #define sk_POLICYINFO_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1543 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(POLICYINFO) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1544 | |
| 1545 | #define sk_POLICYINFO_zero(sk) \ |
| 1546 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk)); |
| 1547 | |
| 1548 | #define sk_POLICYINFO_value(sk, i) \ |
| 1549 | ((POLICYINFO *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1550 | CHECKED_CAST(const _STACK *, const STACK_OF(POLICYINFO) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1551 | |
| 1552 | #define sk_POLICYINFO_set(sk, i, p) \ |
| 1553 | ((POLICYINFO *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk), \ |
| 1554 | (i), CHECKED_CAST(void *, POLICYINFO *, p))) |
| 1555 | |
| 1556 | #define sk_POLICYINFO_free(sk) \ |
| 1557 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk)) |
| 1558 | |
| 1559 | #define sk_POLICYINFO_pop_free(sk, free_func) \ |
| 1560 | sk_pop_free( \ |
| 1561 | CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk), \ |
| 1562 | CHECKED_CAST(void (*)(void *), void (*)(POLICYINFO *), free_func)) |
| 1563 | |
| 1564 | #define sk_POLICYINFO_insert(sk, p, where) \ |
| 1565 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk), \ |
| 1566 | CHECKED_CAST(void *, POLICYINFO *, p), (where)) |
| 1567 | |
| 1568 | #define sk_POLICYINFO_delete(sk, where) \ |
| 1569 | ((POLICYINFO *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk), \ |
| 1570 | (where))) |
| 1571 | |
| 1572 | #define sk_POLICYINFO_delete_ptr(sk, p) \ |
| 1573 | ((POLICYINFO *)sk_delete_ptr( \ |
| 1574 | CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk), \ |
| 1575 | CHECKED_CAST(void *, POLICYINFO *, p))) |
| 1576 | |
| 1577 | #define sk_POLICYINFO_find(sk, out_index, p) \ |
| 1578 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk), (out_index), \ |
| 1579 | CHECKED_CAST(void *, POLICYINFO *, p)) |
| 1580 | |
| 1581 | #define sk_POLICYINFO_shift(sk) \ |
| 1582 | ((POLICYINFO *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk))) |
| 1583 | |
| 1584 | #define sk_POLICYINFO_push(sk, p) \ |
| 1585 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk), \ |
| 1586 | CHECKED_CAST(void *, POLICYINFO *, p)) |
| 1587 | |
| 1588 | #define sk_POLICYINFO_pop(sk) \ |
| 1589 | ((POLICYINFO *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk))) |
| 1590 | |
| 1591 | #define sk_POLICYINFO_dup(sk) \ |
| 1592 | ((STACK_OF(POLICYINFO) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1593 | CHECKED_CAST(const _STACK *, const STACK_OF(POLICYINFO) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1594 | |
| 1595 | #define sk_POLICYINFO_sort(sk) \ |
| 1596 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk)) |
| 1597 | |
| 1598 | #define sk_POLICYINFO_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1599 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(POLICYINFO) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1600 | |
| 1601 | #define sk_POLICYINFO_set_cmp_func(sk, comp) \ |
| 1602 | ((int (*)(const POLICYINFO **a, const POLICYINFO **b))sk_set_cmp_func( \ |
| 1603 | CHECKED_CAST(_STACK *, STACK_OF(POLICYINFO) *, sk), \ |
| 1604 | CHECKED_CAST(stack_cmp_func, \ |
| 1605 | int (*)(const POLICYINFO **a, const POLICYINFO **b), \ |
| 1606 | comp))) |
| 1607 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1608 | #define sk_POLICYINFO_deep_copy(sk, copy_func, free_func) \ |
| 1609 | ((STACK_OF(POLICYINFO) *)sk_deep_copy( \ |
| 1610 | CHECKED_CAST(const _STACK *, const STACK_OF(POLICYINFO) *, sk), \ |
| 1611 | CHECKED_CAST(void *(*)(void *), POLICYINFO *(*)(POLICYINFO *), \ |
| 1612 | copy_func), \ |
| 1613 | CHECKED_CAST(void (*)(void *), void (*)(POLICYINFO *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1614 | |
| 1615 | /* POLICYQUALINFO */ |
| 1616 | #define sk_POLICYQUALINFO_new(comp) \ |
| 1617 | ((STACK_OF(POLICYQUALINFO) *)sk_new(CHECKED_CAST( \ |
| 1618 | stack_cmp_func, \ |
| 1619 | int (*)(const POLICYQUALINFO **a, const POLICYQUALINFO **b), comp))) |
| 1620 | |
| 1621 | #define sk_POLICYQUALINFO_new_null() ((STACK_OF(POLICYQUALINFO) *)sk_new_null()) |
| 1622 | |
| 1623 | #define sk_POLICYQUALINFO_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1624 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(POLICYQUALINFO) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1625 | |
| 1626 | #define sk_POLICYQUALINFO_zero(sk) \ |
| 1627 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk)); |
| 1628 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1629 | #define sk_POLICYQUALINFO_value(sk, i) \ |
| 1630 | ((POLICYQUALINFO *)sk_value( \ |
| 1631 | CHECKED_CAST(const _STACK *, const STACK_OF(POLICYQUALINFO) *, sk), \ |
| 1632 | (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1633 | |
| 1634 | #define sk_POLICYQUALINFO_set(sk, i, p) \ |
| 1635 | ((POLICYQUALINFO *)sk_set( \ |
| 1636 | CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk), (i), \ |
| 1637 | CHECKED_CAST(void *, POLICYQUALINFO *, p))) |
| 1638 | |
| 1639 | #define sk_POLICYQUALINFO_free(sk) \ |
| 1640 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk)) |
| 1641 | |
| 1642 | #define sk_POLICYQUALINFO_pop_free(sk, free_func) \ |
| 1643 | sk_pop_free( \ |
| 1644 | CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk), \ |
| 1645 | CHECKED_CAST(void (*)(void *), void (*)(POLICYQUALINFO *), free_func)) |
| 1646 | |
| 1647 | #define sk_POLICYQUALINFO_insert(sk, p, where) \ |
| 1648 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk), \ |
| 1649 | CHECKED_CAST(void *, POLICYQUALINFO *, p), (where)) |
| 1650 | |
| 1651 | #define sk_POLICYQUALINFO_delete(sk, where) \ |
| 1652 | ((POLICYQUALINFO *)sk_delete( \ |
| 1653 | CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk), (where))) |
| 1654 | |
| 1655 | #define sk_POLICYQUALINFO_delete_ptr(sk, p) \ |
| 1656 | ((POLICYQUALINFO *)sk_delete_ptr( \ |
| 1657 | CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk), \ |
| 1658 | CHECKED_CAST(void *, POLICYQUALINFO *, p))) |
| 1659 | |
| 1660 | #define sk_POLICYQUALINFO_find(sk, out_index, p) \ |
| 1661 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk), (out_index), \ |
| 1662 | CHECKED_CAST(void *, POLICYQUALINFO *, p)) |
| 1663 | |
| 1664 | #define sk_POLICYQUALINFO_shift(sk) \ |
| 1665 | ((POLICYQUALINFO *)sk_shift( \ |
| 1666 | CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk))) |
| 1667 | |
| 1668 | #define sk_POLICYQUALINFO_push(sk, p) \ |
| 1669 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk), \ |
| 1670 | CHECKED_CAST(void *, POLICYQUALINFO *, p)) |
| 1671 | |
| 1672 | #define sk_POLICYQUALINFO_pop(sk) \ |
| 1673 | ((POLICYQUALINFO *)sk_pop( \ |
| 1674 | CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk))) |
| 1675 | |
| 1676 | #define sk_POLICYQUALINFO_dup(sk) \ |
| 1677 | ((STACK_OF(POLICYQUALINFO) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1678 | CHECKED_CAST(const _STACK *, const STACK_OF(POLICYQUALINFO) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1679 | |
| 1680 | #define sk_POLICYQUALINFO_sort(sk) \ |
| 1681 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk)) |
| 1682 | |
| 1683 | #define sk_POLICYQUALINFO_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1684 | sk_is_sorted( \ |
| 1685 | CHECKED_CAST(const _STACK *, const STACK_OF(POLICYQUALINFO) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1686 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1687 | #define sk_POLICYQUALINFO_set_cmp_func(sk, comp) \ |
| 1688 | ((int (*)(const POLICYQUALINFO **a, const POLICYQUALINFO **b)) \ |
| 1689 | sk_set_cmp_func( \ |
| 1690 | CHECKED_CAST(_STACK *, STACK_OF(POLICYQUALINFO) *, sk), \ |
| 1691 | CHECKED_CAST(stack_cmp_func, int (*)(const POLICYQUALINFO **a, \ |
| 1692 | const POLICYQUALINFO **b), \ |
| 1693 | comp))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1694 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1695 | #define sk_POLICYQUALINFO_deep_copy(sk, copy_func, free_func) \ |
| 1696 | ((STACK_OF(POLICYQUALINFO) *)sk_deep_copy( \ |
| 1697 | CHECKED_CAST(const _STACK *, const STACK_OF(POLICYQUALINFO) *, sk), \ |
| 1698 | CHECKED_CAST(void *(*)(void *), POLICYQUALINFO *(*)(POLICYQUALINFO *), \ |
| 1699 | copy_func), \ |
| 1700 | CHECKED_CAST(void (*)(void *), void (*)(POLICYQUALINFO *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1701 | |
| 1702 | /* POLICY_MAPPING */ |
| 1703 | #define sk_POLICY_MAPPING_new(comp) \ |
| 1704 | ((STACK_OF(POLICY_MAPPING) *)sk_new(CHECKED_CAST( \ |
| 1705 | stack_cmp_func, \ |
| 1706 | int (*)(const POLICY_MAPPING **a, const POLICY_MAPPING **b), comp))) |
| 1707 | |
| 1708 | #define sk_POLICY_MAPPING_new_null() ((STACK_OF(POLICY_MAPPING) *)sk_new_null()) |
| 1709 | |
| 1710 | #define sk_POLICY_MAPPING_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1711 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(POLICY_MAPPING) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1712 | |
| 1713 | #define sk_POLICY_MAPPING_zero(sk) \ |
| 1714 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk)); |
| 1715 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1716 | #define sk_POLICY_MAPPING_value(sk, i) \ |
| 1717 | ((POLICY_MAPPING *)sk_value( \ |
| 1718 | CHECKED_CAST(const _STACK *, const STACK_OF(POLICY_MAPPING) *, sk), \ |
| 1719 | (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1720 | |
| 1721 | #define sk_POLICY_MAPPING_set(sk, i, p) \ |
| 1722 | ((POLICY_MAPPING *)sk_set( \ |
| 1723 | CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk), (i), \ |
| 1724 | CHECKED_CAST(void *, POLICY_MAPPING *, p))) |
| 1725 | |
| 1726 | #define sk_POLICY_MAPPING_free(sk) \ |
| 1727 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk)) |
| 1728 | |
| 1729 | #define sk_POLICY_MAPPING_pop_free(sk, free_func) \ |
| 1730 | sk_pop_free( \ |
| 1731 | CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk), \ |
| 1732 | CHECKED_CAST(void (*)(void *), void (*)(POLICY_MAPPING *), free_func)) |
| 1733 | |
| 1734 | #define sk_POLICY_MAPPING_insert(sk, p, where) \ |
| 1735 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk), \ |
| 1736 | CHECKED_CAST(void *, POLICY_MAPPING *, p), (where)) |
| 1737 | |
| 1738 | #define sk_POLICY_MAPPING_delete(sk, where) \ |
| 1739 | ((POLICY_MAPPING *)sk_delete( \ |
| 1740 | CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk), (where))) |
| 1741 | |
| 1742 | #define sk_POLICY_MAPPING_delete_ptr(sk, p) \ |
| 1743 | ((POLICY_MAPPING *)sk_delete_ptr( \ |
| 1744 | CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk), \ |
| 1745 | CHECKED_CAST(void *, POLICY_MAPPING *, p))) |
| 1746 | |
| 1747 | #define sk_POLICY_MAPPING_find(sk, out_index, p) \ |
| 1748 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk), (out_index), \ |
| 1749 | CHECKED_CAST(void *, POLICY_MAPPING *, p)) |
| 1750 | |
| 1751 | #define sk_POLICY_MAPPING_shift(sk) \ |
| 1752 | ((POLICY_MAPPING *)sk_shift( \ |
| 1753 | CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk))) |
| 1754 | |
| 1755 | #define sk_POLICY_MAPPING_push(sk, p) \ |
| 1756 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk), \ |
| 1757 | CHECKED_CAST(void *, POLICY_MAPPING *, p)) |
| 1758 | |
| 1759 | #define sk_POLICY_MAPPING_pop(sk) \ |
| 1760 | ((POLICY_MAPPING *)sk_pop( \ |
| 1761 | CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk))) |
| 1762 | |
| 1763 | #define sk_POLICY_MAPPING_dup(sk) \ |
| 1764 | ((STACK_OF(POLICY_MAPPING) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1765 | CHECKED_CAST(const _STACK *, const STACK_OF(POLICY_MAPPING) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1766 | |
| 1767 | #define sk_POLICY_MAPPING_sort(sk) \ |
| 1768 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk)) |
| 1769 | |
| 1770 | #define sk_POLICY_MAPPING_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1771 | sk_is_sorted( \ |
| 1772 | CHECKED_CAST(const _STACK *, const STACK_OF(POLICY_MAPPING) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1773 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1774 | #define sk_POLICY_MAPPING_set_cmp_func(sk, comp) \ |
| 1775 | ((int (*)(const POLICY_MAPPING **a, const POLICY_MAPPING **b)) \ |
| 1776 | sk_set_cmp_func( \ |
| 1777 | CHECKED_CAST(_STACK *, STACK_OF(POLICY_MAPPING) *, sk), \ |
| 1778 | CHECKED_CAST(stack_cmp_func, int (*)(const POLICY_MAPPING **a, \ |
| 1779 | const POLICY_MAPPING **b), \ |
| 1780 | comp))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1781 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1782 | #define sk_POLICY_MAPPING_deep_copy(sk, copy_func, free_func) \ |
| 1783 | ((STACK_OF(POLICY_MAPPING) *)sk_deep_copy( \ |
| 1784 | CHECKED_CAST(const _STACK *, const STACK_OF(POLICY_MAPPING) *, sk), \ |
| 1785 | CHECKED_CAST(void *(*)(void *), POLICY_MAPPING *(*)(POLICY_MAPPING *), \ |
| 1786 | copy_func), \ |
| 1787 | CHECKED_CAST(void (*)(void *), void (*)(POLICY_MAPPING *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1788 | |
| 1789 | /* SSL_COMP */ |
| 1790 | #define sk_SSL_COMP_new(comp) \ |
| 1791 | ((STACK_OF(SSL_COMP) *)sk_new(CHECKED_CAST( \ |
| 1792 | stack_cmp_func, int (*)(const SSL_COMP **a, const SSL_COMP **b), comp))) |
| 1793 | |
| 1794 | #define sk_SSL_COMP_new_null() ((STACK_OF(SSL_COMP) *)sk_new_null()) |
| 1795 | |
| 1796 | #define sk_SSL_COMP_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1797 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(SSL_COMP) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1798 | |
| 1799 | #define sk_SSL_COMP_zero(sk) \ |
| 1800 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk)); |
| 1801 | |
| 1802 | #define sk_SSL_COMP_value(sk, i) \ |
| 1803 | ((SSL_COMP *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1804 | CHECKED_CAST(const _STACK *, const STACK_OF(SSL_COMP) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1805 | |
| 1806 | #define sk_SSL_COMP_set(sk, i, p) \ |
| 1807 | ((SSL_COMP *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk), (i), \ |
| 1808 | CHECKED_CAST(void *, SSL_COMP *, p))) |
| 1809 | |
| 1810 | #define sk_SSL_COMP_free(sk) \ |
| 1811 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk)) |
| 1812 | |
| 1813 | #define sk_SSL_COMP_pop_free(sk, free_func) \ |
| 1814 | sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk), \ |
| 1815 | CHECKED_CAST(void (*)(void *), void (*)(SSL_COMP *), free_func)) |
| 1816 | |
| 1817 | #define sk_SSL_COMP_insert(sk, p, where) \ |
| 1818 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk), \ |
| 1819 | CHECKED_CAST(void *, SSL_COMP *, p), (where)) |
| 1820 | |
| 1821 | #define sk_SSL_COMP_delete(sk, where) \ |
| 1822 | ((SSL_COMP *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk), \ |
| 1823 | (where))) |
| 1824 | |
| 1825 | #define sk_SSL_COMP_delete_ptr(sk, p) \ |
| 1826 | ((SSL_COMP *)sk_delete_ptr(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk), \ |
| 1827 | CHECKED_CAST(void *, SSL_COMP *, p))) |
| 1828 | |
| 1829 | #define sk_SSL_COMP_find(sk, out_index, p) \ |
| 1830 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk), (out_index), \ |
| 1831 | CHECKED_CAST(void *, SSL_COMP *, p)) |
| 1832 | |
| 1833 | #define sk_SSL_COMP_shift(sk) \ |
| 1834 | ((SSL_COMP *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk))) |
| 1835 | |
| 1836 | #define sk_SSL_COMP_push(sk, p) \ |
| 1837 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk), \ |
| 1838 | CHECKED_CAST(void *, SSL_COMP *, p)) |
| 1839 | |
| 1840 | #define sk_SSL_COMP_pop(sk) \ |
| 1841 | ((SSL_COMP *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk))) |
| 1842 | |
| 1843 | #define sk_SSL_COMP_dup(sk) \ |
| 1844 | ((STACK_OF(SSL_COMP) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1845 | CHECKED_CAST(const _STACK *, const STACK_OF(SSL_COMP) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1846 | |
| 1847 | #define sk_SSL_COMP_sort(sk) \ |
| 1848 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk)) |
| 1849 | |
| 1850 | #define sk_SSL_COMP_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1851 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(SSL_COMP) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1852 | |
| 1853 | #define sk_SSL_COMP_set_cmp_func(sk, comp) \ |
| 1854 | ((int (*)(const SSL_COMP **a, const SSL_COMP **b))sk_set_cmp_func( \ |
| 1855 | CHECKED_CAST(_STACK *, STACK_OF(SSL_COMP) *, sk), \ |
| 1856 | CHECKED_CAST(stack_cmp_func, \ |
| 1857 | int (*)(const SSL_COMP **a, const SSL_COMP **b), comp))) |
| 1858 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 1859 | #define sk_SSL_COMP_deep_copy(sk, copy_func, free_func) \ |
| 1860 | ((STACK_OF(SSL_COMP) *)sk_deep_copy( \ |
| 1861 | CHECKED_CAST(const _STACK *, const STACK_OF(SSL_COMP) *, sk), \ |
| 1862 | CHECKED_CAST(void *(*)(void *), SSL_COMP *(*)(SSL_COMP *), copy_func), \ |
| 1863 | CHECKED_CAST(void (*)(void *), void (*)(SSL_COMP *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1864 | |
Kenny Root | b849459 | 2015-09-25 02:29:14 +0000 | [diff] [blame] | 1865 | /* SSL_CUSTOM_EXTENSION */ |
| 1866 | #define sk_SSL_CUSTOM_EXTENSION_new(comp) \ |
| 1867 | ((STACK_OF(SSL_CUSTOM_EXTENSION) *)sk_new(CHECKED_CAST( \ |
| 1868 | stack_cmp_func, \ |
| 1869 | int (*)(const SSL_CUSTOM_EXTENSION **a, const SSL_CUSTOM_EXTENSION **b), \ |
| 1870 | comp))) |
| 1871 | |
| 1872 | #define sk_SSL_CUSTOM_EXTENSION_new_null() \ |
| 1873 | ((STACK_OF(SSL_CUSTOM_EXTENSION) *)sk_new_null()) |
| 1874 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1875 | #define sk_SSL_CUSTOM_EXTENSION_num(sk) \ |
| 1876 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(SSL_CUSTOM_EXTENSION) *, \ |
| 1877 | sk)) |
Kenny Root | b849459 | 2015-09-25 02:29:14 +0000 | [diff] [blame] | 1878 | |
| 1879 | #define sk_SSL_CUSTOM_EXTENSION_zero(sk) \ |
| 1880 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk)); |
| 1881 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1882 | #define sk_SSL_CUSTOM_EXTENSION_value(sk, i) \ |
| 1883 | ((SSL_CUSTOM_EXTENSION *)sk_value( \ |
| 1884 | CHECKED_CAST(const _STACK *, const STACK_OF(SSL_CUSTOM_EXTENSION) *, \ |
| 1885 | sk), \ |
Kenny Root | b849459 | 2015-09-25 02:29:14 +0000 | [diff] [blame] | 1886 | (i))) |
| 1887 | |
| 1888 | #define sk_SSL_CUSTOM_EXTENSION_set(sk, i, p) \ |
| 1889 | ((SSL_CUSTOM_EXTENSION *)sk_set( \ |
| 1890 | CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk), (i), \ |
| 1891 | CHECKED_CAST(void *, SSL_CUSTOM_EXTENSION *, p))) |
| 1892 | |
| 1893 | #define sk_SSL_CUSTOM_EXTENSION_free(sk) \ |
| 1894 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk)) |
| 1895 | |
| 1896 | #define sk_SSL_CUSTOM_EXTENSION_pop_free(sk, free_func) \ |
| 1897 | sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk), \ |
| 1898 | CHECKED_CAST(void (*)(void *), void (*)(SSL_CUSTOM_EXTENSION *), \ |
| 1899 | free_func)) |
| 1900 | |
| 1901 | #define sk_SSL_CUSTOM_EXTENSION_insert(sk, p, where) \ |
| 1902 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk), \ |
| 1903 | CHECKED_CAST(void *, SSL_CUSTOM_EXTENSION *, p), (where)) |
| 1904 | |
| 1905 | #define sk_SSL_CUSTOM_EXTENSION_delete(sk, where) \ |
| 1906 | ((SSL_CUSTOM_EXTENSION *)sk_delete( \ |
| 1907 | CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk), (where))) |
| 1908 | |
| 1909 | #define sk_SSL_CUSTOM_EXTENSION_delete_ptr(sk, p) \ |
| 1910 | ((SSL_CUSTOM_EXTENSION *)sk_delete_ptr( \ |
| 1911 | CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk), \ |
| 1912 | CHECKED_CAST(void *, SSL_CUSTOM_EXTENSION *, p))) |
| 1913 | |
| 1914 | #define sk_SSL_CUSTOM_EXTENSION_find(sk, out_index, p) \ |
| 1915 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk), \ |
| 1916 | (out_index), CHECKED_CAST(void *, SSL_CUSTOM_EXTENSION *, p)) |
| 1917 | |
| 1918 | #define sk_SSL_CUSTOM_EXTENSION_shift(sk) \ |
| 1919 | ((SSL_CUSTOM_EXTENSION *)sk_shift( \ |
| 1920 | CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk))) |
| 1921 | |
| 1922 | #define sk_SSL_CUSTOM_EXTENSION_push(sk, p) \ |
| 1923 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk), \ |
| 1924 | CHECKED_CAST(void *, SSL_CUSTOM_EXTENSION *, p)) |
| 1925 | |
| 1926 | #define sk_SSL_CUSTOM_EXTENSION_pop(sk) \ |
| 1927 | ((SSL_CUSTOM_EXTENSION *)sk_pop( \ |
| 1928 | CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk))) |
| 1929 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1930 | #define sk_SSL_CUSTOM_EXTENSION_dup(sk) \ |
| 1931 | ((STACK_OF(SSL_CUSTOM_EXTENSION) *)sk_dup(CHECKED_CAST( \ |
| 1932 | const _STACK *, const STACK_OF(SSL_CUSTOM_EXTENSION) *, sk))) |
Kenny Root | b849459 | 2015-09-25 02:29:14 +0000 | [diff] [blame] | 1933 | |
| 1934 | #define sk_SSL_CUSTOM_EXTENSION_sort(sk) \ |
| 1935 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk)) |
| 1936 | |
| 1937 | #define sk_SSL_CUSTOM_EXTENSION_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1938 | sk_is_sorted(CHECKED_CAST(const _STACK *, \ |
| 1939 | const STACK_OF(SSL_CUSTOM_EXTENSION) *, sk)) |
Kenny Root | b849459 | 2015-09-25 02:29:14 +0000 | [diff] [blame] | 1940 | |
| 1941 | #define sk_SSL_CUSTOM_EXTENSION_set_cmp_func(sk, comp) \ |
| 1942 | ((int (*)(const SSL_CUSTOM_EXTENSION **a, const SSL_CUSTOM_EXTENSION **b)) \ |
| 1943 | sk_set_cmp_func( \ |
| 1944 | CHECKED_CAST(_STACK *, STACK_OF(SSL_CUSTOM_EXTENSION) *, sk), \ |
| 1945 | CHECKED_CAST(stack_cmp_func, \ |
| 1946 | int (*)(const SSL_CUSTOM_EXTENSION **a, \ |
| 1947 | const SSL_CUSTOM_EXTENSION **b), \ |
| 1948 | comp))) |
| 1949 | |
| 1950 | #define sk_SSL_CUSTOM_EXTENSION_deep_copy(sk, copy_func, free_func) \ |
| 1951 | ((STACK_OF(SSL_CUSTOM_EXTENSION) *)sk_deep_copy( \ |
| 1952 | CHECKED_CAST(const _STACK *, const STACK_OF(SSL_CUSTOM_EXTENSION) *, \ |
| 1953 | sk), \ |
| 1954 | CHECKED_CAST(void *(*)(void *), \ |
| 1955 | SSL_CUSTOM_EXTENSION *(*)(SSL_CUSTOM_EXTENSION *), \ |
| 1956 | copy_func), \ |
| 1957 | CHECKED_CAST(void (*)(void *), void (*)(SSL_CUSTOM_EXTENSION *), \ |
| 1958 | free_func))) |
| 1959 | |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1960 | /* STACK_OF_X509_NAME_ENTRY */ |
| 1961 | #define sk_STACK_OF_X509_NAME_ENTRY_new(comp) \ |
| 1962 | ((STACK_OF(STACK_OF_X509_NAME_ENTRY) *)sk_new(CHECKED_CAST( \ |
| 1963 | stack_cmp_func, int (*)(const STACK_OF_X509_NAME_ENTRY **a, \ |
| 1964 | const STACK_OF_X509_NAME_ENTRY **b), \ |
| 1965 | comp))) |
| 1966 | |
| 1967 | #define sk_STACK_OF_X509_NAME_ENTRY_new_null() \ |
| 1968 | ((STACK_OF(STACK_OF_X509_NAME_ENTRY) *)sk_new_null()) |
| 1969 | |
| 1970 | #define sk_STACK_OF_X509_NAME_ENTRY_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1971 | sk_num(CHECKED_CAST(const _STACK *, \ |
| 1972 | const STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1973 | |
| 1974 | #define sk_STACK_OF_X509_NAME_ENTRY_zero(sk) \ |
| 1975 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk)); |
| 1976 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 1977 | #define sk_STACK_OF_X509_NAME_ENTRY_value(sk, i) \ |
| 1978 | ((STACK_OF_X509_NAME_ENTRY *)sk_value( \ |
| 1979 | CHECKED_CAST(const _STACK *, const STACK_OF(STACK_OF_X509_NAME_ENTRY) *, \ |
| 1980 | sk), \ |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1981 | (i))) |
| 1982 | |
| 1983 | #define sk_STACK_OF_X509_NAME_ENTRY_set(sk, i, p) \ |
| 1984 | ((STACK_OF_X509_NAME_ENTRY *)sk_set( \ |
| 1985 | CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk), (i), \ |
| 1986 | CHECKED_CAST(void *, STACK_OF_X509_NAME_ENTRY *, p))) |
| 1987 | |
| 1988 | #define sk_STACK_OF_X509_NAME_ENTRY_free(sk) \ |
| 1989 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk)) |
| 1990 | |
| 1991 | #define sk_STACK_OF_X509_NAME_ENTRY_pop_free(sk, free_func) \ |
| 1992 | sk_pop_free( \ |
| 1993 | CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk), \ |
| 1994 | CHECKED_CAST(void (*)(void *), void (*)(STACK_OF_X509_NAME_ENTRY *), \ |
| 1995 | free_func)) |
| 1996 | |
| 1997 | #define sk_STACK_OF_X509_NAME_ENTRY_insert(sk, p, where) \ |
| 1998 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk), \ |
| 1999 | CHECKED_CAST(void *, STACK_OF_X509_NAME_ENTRY *, p), (where)) |
| 2000 | |
| 2001 | #define sk_STACK_OF_X509_NAME_ENTRY_delete(sk, where) \ |
| 2002 | ((STACK_OF_X509_NAME_ENTRY *)sk_delete( \ |
| 2003 | CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk), \ |
| 2004 | (where))) |
| 2005 | |
| 2006 | #define sk_STACK_OF_X509_NAME_ENTRY_delete_ptr(sk, p) \ |
| 2007 | ((STACK_OF_X509_NAME_ENTRY *)sk_delete_ptr( \ |
| 2008 | CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk), \ |
| 2009 | CHECKED_CAST(void *, STACK_OF_X509_NAME_ENTRY *, p))) |
| 2010 | |
| 2011 | #define sk_STACK_OF_X509_NAME_ENTRY_find(sk, out_index, p) \ |
| 2012 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk), \ |
| 2013 | (out_index), CHECKED_CAST(void *, STACK_OF_X509_NAME_ENTRY *, p)) |
| 2014 | |
| 2015 | #define sk_STACK_OF_X509_NAME_ENTRY_shift(sk) \ |
| 2016 | ((STACK_OF_X509_NAME_ENTRY *)sk_shift( \ |
| 2017 | CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk))) |
| 2018 | |
| 2019 | #define sk_STACK_OF_X509_NAME_ENTRY_push(sk, p) \ |
| 2020 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk), \ |
| 2021 | CHECKED_CAST(void *, STACK_OF_X509_NAME_ENTRY *, p)) |
| 2022 | |
| 2023 | #define sk_STACK_OF_X509_NAME_ENTRY_pop(sk) \ |
| 2024 | ((STACK_OF_X509_NAME_ENTRY *)sk_pop( \ |
| 2025 | CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk))) |
| 2026 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2027 | #define sk_STACK_OF_X509_NAME_ENTRY_dup(sk) \ |
| 2028 | ((STACK_OF(STACK_OF_X509_NAME_ENTRY) *)sk_dup(CHECKED_CAST( \ |
| 2029 | const _STACK *, const STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2030 | |
| 2031 | #define sk_STACK_OF_X509_NAME_ENTRY_sort(sk) \ |
| 2032 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk)) |
| 2033 | |
| 2034 | #define sk_STACK_OF_X509_NAME_ENTRY_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2035 | sk_is_sorted(CHECKED_CAST(const _STACK *, \ |
| 2036 | const STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2037 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 2038 | #define sk_STACK_OF_X509_NAME_ENTRY_set_cmp_func(sk, comp) \ |
| 2039 | ((int (*)(const STACK_OF_X509_NAME_ENTRY **a, \ |
| 2040 | const STACK_OF_X509_NAME_ENTRY **b)) \ |
| 2041 | sk_set_cmp_func( \ |
| 2042 | CHECKED_CAST(_STACK *, STACK_OF(STACK_OF_X509_NAME_ENTRY) *, sk), \ |
| 2043 | CHECKED_CAST(stack_cmp_func, \ |
| 2044 | int (*)(const STACK_OF_X509_NAME_ENTRY **a, \ |
| 2045 | const STACK_OF_X509_NAME_ENTRY **b), \ |
| 2046 | comp))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2047 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 2048 | #define sk_STACK_OF_X509_NAME_ENTRY_deep_copy(sk, copy_func, free_func) \ |
| 2049 | ((STACK_OF(STACK_OF_X509_NAME_ENTRY) *)sk_deep_copy( \ |
| 2050 | CHECKED_CAST(const _STACK *, const STACK_OF(STACK_OF_X509_NAME_ENTRY) *, \ |
| 2051 | sk), \ |
| 2052 | CHECKED_CAST(void *(*)(void *), \ |
| 2053 | STACK_OF_X509_NAME_ENTRY *(*)(STACK_OF_X509_NAME_ENTRY *), \ |
| 2054 | copy_func), \ |
| 2055 | CHECKED_CAST(void (*)(void *), void (*)(STACK_OF_X509_NAME_ENTRY *), \ |
| 2056 | free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2057 | |
| 2058 | /* SXNETID */ |
| 2059 | #define sk_SXNETID_new(comp) \ |
| 2060 | ((STACK_OF(SXNETID) *)sk_new(CHECKED_CAST( \ |
| 2061 | stack_cmp_func, int (*)(const SXNETID **a, const SXNETID **b), comp))) |
| 2062 | |
| 2063 | #define sk_SXNETID_new_null() ((STACK_OF(SXNETID) *)sk_new_null()) |
| 2064 | |
| 2065 | #define sk_SXNETID_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2066 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(SXNETID) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2067 | |
| 2068 | #define sk_SXNETID_zero(sk) \ |
| 2069 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk)); |
| 2070 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2071 | #define sk_SXNETID_value(sk, i) \ |
| 2072 | ((SXNETID *)sk_value( \ |
| 2073 | CHECKED_CAST(const _STACK *, const STACK_OF(SXNETID) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2074 | |
| 2075 | #define sk_SXNETID_set(sk, i, p) \ |
| 2076 | ((SXNETID *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk), (i), \ |
| 2077 | CHECKED_CAST(void *, SXNETID *, p))) |
| 2078 | |
| 2079 | #define sk_SXNETID_free(sk) \ |
| 2080 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk)) |
| 2081 | |
| 2082 | #define sk_SXNETID_pop_free(sk, free_func) \ |
| 2083 | sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk), \ |
| 2084 | CHECKED_CAST(void (*)(void *), void (*)(SXNETID *), free_func)) |
| 2085 | |
| 2086 | #define sk_SXNETID_insert(sk, p, where) \ |
| 2087 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk), \ |
| 2088 | CHECKED_CAST(void *, SXNETID *, p), (where)) |
| 2089 | |
| 2090 | #define sk_SXNETID_delete(sk, where) \ |
| 2091 | ((SXNETID *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk), \ |
| 2092 | (where))) |
| 2093 | |
| 2094 | #define sk_SXNETID_delete_ptr(sk, p) \ |
| 2095 | ((SXNETID *)sk_delete_ptr(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk), \ |
| 2096 | CHECKED_CAST(void *, SXNETID *, p))) |
| 2097 | |
| 2098 | #define sk_SXNETID_find(sk, out_index, p) \ |
| 2099 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk), (out_index), \ |
| 2100 | CHECKED_CAST(void *, SXNETID *, p)) |
| 2101 | |
| 2102 | #define sk_SXNETID_shift(sk) \ |
| 2103 | ((SXNETID *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk))) |
| 2104 | |
| 2105 | #define sk_SXNETID_push(sk, p) \ |
| 2106 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk), \ |
| 2107 | CHECKED_CAST(void *, SXNETID *, p)) |
| 2108 | |
| 2109 | #define sk_SXNETID_pop(sk) \ |
| 2110 | ((SXNETID *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk))) |
| 2111 | |
| 2112 | #define sk_SXNETID_dup(sk) \ |
| 2113 | ((STACK_OF(SXNETID) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2114 | CHECKED_CAST(const _STACK *, const STACK_OF(SXNETID) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2115 | |
| 2116 | #define sk_SXNETID_sort(sk) \ |
| 2117 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk)) |
| 2118 | |
| 2119 | #define sk_SXNETID_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2120 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(SXNETID) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2121 | |
| 2122 | #define sk_SXNETID_set_cmp_func(sk, comp) \ |
| 2123 | ((int (*)(const SXNETID **a, const SXNETID **b))sk_set_cmp_func( \ |
| 2124 | CHECKED_CAST(_STACK *, STACK_OF(SXNETID) *, sk), \ |
| 2125 | CHECKED_CAST(stack_cmp_func, \ |
| 2126 | int (*)(const SXNETID **a, const SXNETID **b), comp))) |
| 2127 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 2128 | #define sk_SXNETID_deep_copy(sk, copy_func, free_func) \ |
| 2129 | ((STACK_OF(SXNETID) *)sk_deep_copy( \ |
| 2130 | CHECKED_CAST(const _STACK *, const STACK_OF(SXNETID) *, sk), \ |
| 2131 | CHECKED_CAST(void *(*)(void *), SXNETID *(*)(SXNETID *), copy_func), \ |
| 2132 | CHECKED_CAST(void (*)(void *), void (*)(SXNETID *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2133 | |
| 2134 | /* X509 */ |
| 2135 | #define sk_X509_new(comp) \ |
| 2136 | ((STACK_OF(X509) *)sk_new(CHECKED_CAST( \ |
| 2137 | stack_cmp_func, int (*)(const X509 **a, const X509 **b), comp))) |
| 2138 | |
| 2139 | #define sk_X509_new_null() ((STACK_OF(X509) *)sk_new_null()) |
| 2140 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2141 | #define sk_X509_num(sk) \ |
| 2142 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2143 | |
| 2144 | #define sk_X509_zero(sk) sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk)); |
| 2145 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2146 | #define sk_X509_value(sk, i) \ |
| 2147 | ((X509 *)sk_value(CHECKED_CAST(const _STACK *, const STACK_OF(X509) *, sk), \ |
| 2148 | (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2149 | |
| 2150 | #define sk_X509_set(sk, i, p) \ |
| 2151 | ((X509 *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk), (i), \ |
| 2152 | CHECKED_CAST(void *, X509 *, p))) |
| 2153 | |
| 2154 | #define sk_X509_free(sk) sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk)) |
| 2155 | |
| 2156 | #define sk_X509_pop_free(sk, free_func) \ |
| 2157 | sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk), \ |
| 2158 | CHECKED_CAST(void (*)(void *), void (*)(X509 *), free_func)) |
| 2159 | |
| 2160 | #define sk_X509_insert(sk, p, where) \ |
| 2161 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk), \ |
| 2162 | CHECKED_CAST(void *, X509 *, p), (where)) |
| 2163 | |
| 2164 | #define sk_X509_delete(sk, where) \ |
| 2165 | ((X509 *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk), (where))) |
| 2166 | |
| 2167 | #define sk_X509_delete_ptr(sk, p) \ |
| 2168 | ((X509 *)sk_delete_ptr(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk), \ |
| 2169 | CHECKED_CAST(void *, X509 *, p))) |
| 2170 | |
| 2171 | #define sk_X509_find(sk, out_index, p) \ |
| 2172 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk), (out_index), \ |
| 2173 | CHECKED_CAST(void *, X509 *, p)) |
| 2174 | |
| 2175 | #define sk_X509_shift(sk) \ |
| 2176 | ((X509 *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk))) |
| 2177 | |
| 2178 | #define sk_X509_push(sk, p) \ |
| 2179 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk), \ |
| 2180 | CHECKED_CAST(void *, X509 *, p)) |
| 2181 | |
| 2182 | #define sk_X509_pop(sk) \ |
| 2183 | ((X509 *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk))) |
| 2184 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2185 | #define sk_X509_dup(sk) \ |
| 2186 | ((STACK_OF(X509) *)sk_dup( \ |
| 2187 | CHECKED_CAST(const _STACK *, const STACK_OF(X509) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2188 | |
| 2189 | #define sk_X509_sort(sk) sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk)) |
| 2190 | |
| 2191 | #define sk_X509_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2192 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(X509) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2193 | |
| 2194 | #define sk_X509_set_cmp_func(sk, comp) \ |
| 2195 | ((int (*)(const X509 **a, const X509 **b))sk_set_cmp_func( \ |
| 2196 | CHECKED_CAST(_STACK *, STACK_OF(X509) *, sk), \ |
| 2197 | CHECKED_CAST(stack_cmp_func, int (*)(const X509 **a, const X509 **b), \ |
| 2198 | comp))) |
| 2199 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 2200 | #define sk_X509_deep_copy(sk, copy_func, free_func) \ |
| 2201 | ((STACK_OF(X509) *)sk_deep_copy( \ |
| 2202 | CHECKED_CAST(const _STACK *, const STACK_OF(X509) *, sk), \ |
| 2203 | CHECKED_CAST(void *(*)(void *), X509 *(*)(X509 *), copy_func), \ |
| 2204 | CHECKED_CAST(void (*)(void *), void (*)(X509 *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2205 | |
| 2206 | /* X509V3_EXT_METHOD */ |
| 2207 | #define sk_X509V3_EXT_METHOD_new(comp) \ |
| 2208 | ((STACK_OF(X509V3_EXT_METHOD) *)sk_new(CHECKED_CAST( \ |
| 2209 | stack_cmp_func, \ |
| 2210 | int (*)(const X509V3_EXT_METHOD **a, const X509V3_EXT_METHOD **b), \ |
| 2211 | comp))) |
| 2212 | |
| 2213 | #define sk_X509V3_EXT_METHOD_new_null() \ |
| 2214 | ((STACK_OF(X509V3_EXT_METHOD) *)sk_new_null()) |
| 2215 | |
| 2216 | #define sk_X509V3_EXT_METHOD_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2217 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509V3_EXT_METHOD) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2218 | |
| 2219 | #define sk_X509V3_EXT_METHOD_zero(sk) \ |
| 2220 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk)); |
| 2221 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2222 | #define sk_X509V3_EXT_METHOD_value(sk, i) \ |
| 2223 | ((X509V3_EXT_METHOD *)sk_value( \ |
| 2224 | CHECKED_CAST(const _STACK *, const STACK_OF(X509V3_EXT_METHOD) *, sk), \ |
| 2225 | (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2226 | |
| 2227 | #define sk_X509V3_EXT_METHOD_set(sk, i, p) \ |
| 2228 | ((X509V3_EXT_METHOD *)sk_set( \ |
| 2229 | CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk), (i), \ |
| 2230 | CHECKED_CAST(void *, X509V3_EXT_METHOD *, p))) |
| 2231 | |
| 2232 | #define sk_X509V3_EXT_METHOD_free(sk) \ |
| 2233 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk)) |
| 2234 | |
| 2235 | #define sk_X509V3_EXT_METHOD_pop_free(sk, free_func) \ |
| 2236 | sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk), \ |
| 2237 | CHECKED_CAST(void (*)(void *), void (*)(X509V3_EXT_METHOD *), \ |
| 2238 | free_func)) |
| 2239 | |
| 2240 | #define sk_X509V3_EXT_METHOD_insert(sk, p, where) \ |
| 2241 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk), \ |
| 2242 | CHECKED_CAST(void *, X509V3_EXT_METHOD *, p), (where)) |
| 2243 | |
| 2244 | #define sk_X509V3_EXT_METHOD_delete(sk, where) \ |
| 2245 | ((X509V3_EXT_METHOD *)sk_delete( \ |
| 2246 | CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk), (where))) |
| 2247 | |
| 2248 | #define sk_X509V3_EXT_METHOD_delete_ptr(sk, p) \ |
| 2249 | ((X509V3_EXT_METHOD *)sk_delete_ptr( \ |
| 2250 | CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk), \ |
| 2251 | CHECKED_CAST(void *, X509V3_EXT_METHOD *, p))) |
| 2252 | |
| 2253 | #define sk_X509V3_EXT_METHOD_find(sk, out_index, p) \ |
| 2254 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk), \ |
| 2255 | (out_index), CHECKED_CAST(void *, X509V3_EXT_METHOD *, p)) |
| 2256 | |
| 2257 | #define sk_X509V3_EXT_METHOD_shift(sk) \ |
| 2258 | ((X509V3_EXT_METHOD *)sk_shift( \ |
| 2259 | CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk))) |
| 2260 | |
| 2261 | #define sk_X509V3_EXT_METHOD_push(sk, p) \ |
| 2262 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk), \ |
| 2263 | CHECKED_CAST(void *, X509V3_EXT_METHOD *, p)) |
| 2264 | |
| 2265 | #define sk_X509V3_EXT_METHOD_pop(sk) \ |
| 2266 | ((X509V3_EXT_METHOD *)sk_pop( \ |
| 2267 | CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk))) |
| 2268 | |
| 2269 | #define sk_X509V3_EXT_METHOD_dup(sk) \ |
| 2270 | ((STACK_OF(X509V3_EXT_METHOD) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2271 | CHECKED_CAST(const _STACK *, const STACK_OF(X509V3_EXT_METHOD) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2272 | |
| 2273 | #define sk_X509V3_EXT_METHOD_sort(sk) \ |
| 2274 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk)) |
| 2275 | |
| 2276 | #define sk_X509V3_EXT_METHOD_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2277 | sk_is_sorted( \ |
| 2278 | CHECKED_CAST(const _STACK *, const STACK_OF(X509V3_EXT_METHOD) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2279 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 2280 | #define sk_X509V3_EXT_METHOD_set_cmp_func(sk, comp) \ |
| 2281 | ((int (*)(const X509V3_EXT_METHOD **a, const X509V3_EXT_METHOD **b)) \ |
| 2282 | sk_set_cmp_func( \ |
| 2283 | CHECKED_CAST(_STACK *, STACK_OF(X509V3_EXT_METHOD) *, sk), \ |
| 2284 | CHECKED_CAST(stack_cmp_func, int (*)(const X509V3_EXT_METHOD **a, \ |
| 2285 | const X509V3_EXT_METHOD **b), \ |
| 2286 | comp))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2287 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 2288 | #define sk_X509V3_EXT_METHOD_deep_copy(sk, copy_func, free_func) \ |
| 2289 | ((STACK_OF(X509V3_EXT_METHOD) *)sk_deep_copy( \ |
| 2290 | CHECKED_CAST(const _STACK *, const STACK_OF(X509V3_EXT_METHOD) *, sk), \ |
| 2291 | CHECKED_CAST(void *(*)(void *), \ |
| 2292 | X509V3_EXT_METHOD *(*)(X509V3_EXT_METHOD *), copy_func), \ |
| 2293 | CHECKED_CAST(void (*)(void *), void (*)(X509V3_EXT_METHOD *), \ |
| 2294 | free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2295 | |
| 2296 | /* X509_ALGOR */ |
| 2297 | #define sk_X509_ALGOR_new(comp) \ |
| 2298 | ((STACK_OF(X509_ALGOR) *)sk_new(CHECKED_CAST( \ |
| 2299 | stack_cmp_func, int (*)(const X509_ALGOR **a, const X509_ALGOR **b), \ |
| 2300 | comp))) |
| 2301 | |
| 2302 | #define sk_X509_ALGOR_new_null() ((STACK_OF(X509_ALGOR) *)sk_new_null()) |
| 2303 | |
| 2304 | #define sk_X509_ALGOR_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2305 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_ALGOR) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2306 | |
| 2307 | #define sk_X509_ALGOR_zero(sk) \ |
| 2308 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk)); |
| 2309 | |
| 2310 | #define sk_X509_ALGOR_value(sk, i) \ |
| 2311 | ((X509_ALGOR *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2312 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_ALGOR) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2313 | |
| 2314 | #define sk_X509_ALGOR_set(sk, i, p) \ |
| 2315 | ((X509_ALGOR *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk), \ |
| 2316 | (i), CHECKED_CAST(void *, X509_ALGOR *, p))) |
| 2317 | |
| 2318 | #define sk_X509_ALGOR_free(sk) \ |
| 2319 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk)) |
| 2320 | |
| 2321 | #define sk_X509_ALGOR_pop_free(sk, free_func) \ |
| 2322 | sk_pop_free( \ |
| 2323 | CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk), \ |
| 2324 | CHECKED_CAST(void (*)(void *), void (*)(X509_ALGOR *), free_func)) |
| 2325 | |
| 2326 | #define sk_X509_ALGOR_insert(sk, p, where) \ |
| 2327 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk), \ |
| 2328 | CHECKED_CAST(void *, X509_ALGOR *, p), (where)) |
| 2329 | |
| 2330 | #define sk_X509_ALGOR_delete(sk, where) \ |
| 2331 | ((X509_ALGOR *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk), \ |
| 2332 | (where))) |
| 2333 | |
| 2334 | #define sk_X509_ALGOR_delete_ptr(sk, p) \ |
| 2335 | ((X509_ALGOR *)sk_delete_ptr( \ |
| 2336 | CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk), \ |
| 2337 | CHECKED_CAST(void *, X509_ALGOR *, p))) |
| 2338 | |
| 2339 | #define sk_X509_ALGOR_find(sk, out_index, p) \ |
| 2340 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk), (out_index), \ |
| 2341 | CHECKED_CAST(void *, X509_ALGOR *, p)) |
| 2342 | |
| 2343 | #define sk_X509_ALGOR_shift(sk) \ |
| 2344 | ((X509_ALGOR *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk))) |
| 2345 | |
| 2346 | #define sk_X509_ALGOR_push(sk, p) \ |
| 2347 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk), \ |
| 2348 | CHECKED_CAST(void *, X509_ALGOR *, p)) |
| 2349 | |
| 2350 | #define sk_X509_ALGOR_pop(sk) \ |
| 2351 | ((X509_ALGOR *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk))) |
| 2352 | |
| 2353 | #define sk_X509_ALGOR_dup(sk) \ |
| 2354 | ((STACK_OF(X509_ALGOR) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2355 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_ALGOR) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2356 | |
| 2357 | #define sk_X509_ALGOR_sort(sk) \ |
| 2358 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk)) |
| 2359 | |
| 2360 | #define sk_X509_ALGOR_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2361 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(X509_ALGOR) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2362 | |
| 2363 | #define sk_X509_ALGOR_set_cmp_func(sk, comp) \ |
| 2364 | ((int (*)(const X509_ALGOR **a, const X509_ALGOR **b))sk_set_cmp_func( \ |
| 2365 | CHECKED_CAST(_STACK *, STACK_OF(X509_ALGOR) *, sk), \ |
| 2366 | CHECKED_CAST(stack_cmp_func, \ |
| 2367 | int (*)(const X509_ALGOR **a, const X509_ALGOR **b), \ |
| 2368 | comp))) |
| 2369 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 2370 | #define sk_X509_ALGOR_deep_copy(sk, copy_func, free_func) \ |
| 2371 | ((STACK_OF(X509_ALGOR) *)sk_deep_copy( \ |
| 2372 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_ALGOR) *, sk), \ |
| 2373 | CHECKED_CAST(void *(*)(void *), X509_ALGOR *(*)(X509_ALGOR *), \ |
| 2374 | copy_func), \ |
| 2375 | CHECKED_CAST(void (*)(void *), void (*)(X509_ALGOR *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2376 | |
| 2377 | /* X509_ATTRIBUTE */ |
| 2378 | #define sk_X509_ATTRIBUTE_new(comp) \ |
| 2379 | ((STACK_OF(X509_ATTRIBUTE) *)sk_new(CHECKED_CAST( \ |
| 2380 | stack_cmp_func, \ |
| 2381 | int (*)(const X509_ATTRIBUTE **a, const X509_ATTRIBUTE **b), comp))) |
| 2382 | |
| 2383 | #define sk_X509_ATTRIBUTE_new_null() ((STACK_OF(X509_ATTRIBUTE) *)sk_new_null()) |
| 2384 | |
| 2385 | #define sk_X509_ATTRIBUTE_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2386 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_ATTRIBUTE) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2387 | |
| 2388 | #define sk_X509_ATTRIBUTE_zero(sk) \ |
| 2389 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk)); |
| 2390 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2391 | #define sk_X509_ATTRIBUTE_value(sk, i) \ |
| 2392 | ((X509_ATTRIBUTE *)sk_value( \ |
| 2393 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_ATTRIBUTE) *, sk), \ |
| 2394 | (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2395 | |
| 2396 | #define sk_X509_ATTRIBUTE_set(sk, i, p) \ |
| 2397 | ((X509_ATTRIBUTE *)sk_set( \ |
| 2398 | CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk), (i), \ |
| 2399 | CHECKED_CAST(void *, X509_ATTRIBUTE *, p))) |
| 2400 | |
| 2401 | #define sk_X509_ATTRIBUTE_free(sk) \ |
| 2402 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk)) |
| 2403 | |
| 2404 | #define sk_X509_ATTRIBUTE_pop_free(sk, free_func) \ |
| 2405 | sk_pop_free( \ |
| 2406 | CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk), \ |
| 2407 | CHECKED_CAST(void (*)(void *), void (*)(X509_ATTRIBUTE *), free_func)) |
| 2408 | |
| 2409 | #define sk_X509_ATTRIBUTE_insert(sk, p, where) \ |
| 2410 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk), \ |
| 2411 | CHECKED_CAST(void *, X509_ATTRIBUTE *, p), (where)) |
| 2412 | |
| 2413 | #define sk_X509_ATTRIBUTE_delete(sk, where) \ |
| 2414 | ((X509_ATTRIBUTE *)sk_delete( \ |
| 2415 | CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk), (where))) |
| 2416 | |
| 2417 | #define sk_X509_ATTRIBUTE_delete_ptr(sk, p) \ |
| 2418 | ((X509_ATTRIBUTE *)sk_delete_ptr( \ |
| 2419 | CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk), \ |
| 2420 | CHECKED_CAST(void *, X509_ATTRIBUTE *, p))) |
| 2421 | |
| 2422 | #define sk_X509_ATTRIBUTE_find(sk, out_index, p) \ |
| 2423 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk), (out_index), \ |
| 2424 | CHECKED_CAST(void *, X509_ATTRIBUTE *, p)) |
| 2425 | |
| 2426 | #define sk_X509_ATTRIBUTE_shift(sk) \ |
| 2427 | ((X509_ATTRIBUTE *)sk_shift( \ |
| 2428 | CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk))) |
| 2429 | |
| 2430 | #define sk_X509_ATTRIBUTE_push(sk, p) \ |
| 2431 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk), \ |
| 2432 | CHECKED_CAST(void *, X509_ATTRIBUTE *, p)) |
| 2433 | |
| 2434 | #define sk_X509_ATTRIBUTE_pop(sk) \ |
| 2435 | ((X509_ATTRIBUTE *)sk_pop( \ |
| 2436 | CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk))) |
| 2437 | |
| 2438 | #define sk_X509_ATTRIBUTE_dup(sk) \ |
| 2439 | ((STACK_OF(X509_ATTRIBUTE) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2440 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_ATTRIBUTE) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2441 | |
| 2442 | #define sk_X509_ATTRIBUTE_sort(sk) \ |
| 2443 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk)) |
| 2444 | |
| 2445 | #define sk_X509_ATTRIBUTE_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2446 | sk_is_sorted( \ |
| 2447 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_ATTRIBUTE) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2448 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 2449 | #define sk_X509_ATTRIBUTE_set_cmp_func(sk, comp) \ |
| 2450 | ((int (*)(const X509_ATTRIBUTE **a, const X509_ATTRIBUTE **b)) \ |
| 2451 | sk_set_cmp_func( \ |
| 2452 | CHECKED_CAST(_STACK *, STACK_OF(X509_ATTRIBUTE) *, sk), \ |
| 2453 | CHECKED_CAST(stack_cmp_func, int (*)(const X509_ATTRIBUTE **a, \ |
| 2454 | const X509_ATTRIBUTE **b), \ |
| 2455 | comp))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2456 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 2457 | #define sk_X509_ATTRIBUTE_deep_copy(sk, copy_func, free_func) \ |
| 2458 | ((STACK_OF(X509_ATTRIBUTE) *)sk_deep_copy( \ |
| 2459 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_ATTRIBUTE) *, sk), \ |
| 2460 | CHECKED_CAST(void *(*)(void *), X509_ATTRIBUTE *(*)(X509_ATTRIBUTE *), \ |
| 2461 | copy_func), \ |
| 2462 | CHECKED_CAST(void (*)(void *), void (*)(X509_ATTRIBUTE *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2463 | |
| 2464 | /* X509_CRL */ |
| 2465 | #define sk_X509_CRL_new(comp) \ |
| 2466 | ((STACK_OF(X509_CRL) *)sk_new(CHECKED_CAST( \ |
| 2467 | stack_cmp_func, int (*)(const X509_CRL **a, const X509_CRL **b), comp))) |
| 2468 | |
| 2469 | #define sk_X509_CRL_new_null() ((STACK_OF(X509_CRL) *)sk_new_null()) |
| 2470 | |
| 2471 | #define sk_X509_CRL_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2472 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_CRL) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2473 | |
| 2474 | #define sk_X509_CRL_zero(sk) \ |
| 2475 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk)); |
| 2476 | |
| 2477 | #define sk_X509_CRL_value(sk, i) \ |
| 2478 | ((X509_CRL *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2479 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_CRL) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2480 | |
| 2481 | #define sk_X509_CRL_set(sk, i, p) \ |
| 2482 | ((X509_CRL *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk), (i), \ |
| 2483 | CHECKED_CAST(void *, X509_CRL *, p))) |
| 2484 | |
| 2485 | #define sk_X509_CRL_free(sk) \ |
| 2486 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk)) |
| 2487 | |
| 2488 | #define sk_X509_CRL_pop_free(sk, free_func) \ |
| 2489 | sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk), \ |
| 2490 | CHECKED_CAST(void (*)(void *), void (*)(X509_CRL *), free_func)) |
| 2491 | |
| 2492 | #define sk_X509_CRL_insert(sk, p, where) \ |
| 2493 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk), \ |
| 2494 | CHECKED_CAST(void *, X509_CRL *, p), (where)) |
| 2495 | |
| 2496 | #define sk_X509_CRL_delete(sk, where) \ |
| 2497 | ((X509_CRL *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk), \ |
| 2498 | (where))) |
| 2499 | |
| 2500 | #define sk_X509_CRL_delete_ptr(sk, p) \ |
| 2501 | ((X509_CRL *)sk_delete_ptr(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk), \ |
| 2502 | CHECKED_CAST(void *, X509_CRL *, p))) |
| 2503 | |
| 2504 | #define sk_X509_CRL_find(sk, out_index, p) \ |
| 2505 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk), (out_index), \ |
| 2506 | CHECKED_CAST(void *, X509_CRL *, p)) |
| 2507 | |
| 2508 | #define sk_X509_CRL_shift(sk) \ |
| 2509 | ((X509_CRL *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk))) |
| 2510 | |
| 2511 | #define sk_X509_CRL_push(sk, p) \ |
| 2512 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk), \ |
| 2513 | CHECKED_CAST(void *, X509_CRL *, p)) |
| 2514 | |
| 2515 | #define sk_X509_CRL_pop(sk) \ |
| 2516 | ((X509_CRL *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk))) |
| 2517 | |
| 2518 | #define sk_X509_CRL_dup(sk) \ |
| 2519 | ((STACK_OF(X509_CRL) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2520 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_CRL) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2521 | |
| 2522 | #define sk_X509_CRL_sort(sk) \ |
| 2523 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk)) |
| 2524 | |
| 2525 | #define sk_X509_CRL_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2526 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(X509_CRL) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2527 | |
| 2528 | #define sk_X509_CRL_set_cmp_func(sk, comp) \ |
| 2529 | ((int (*)(const X509_CRL **a, const X509_CRL **b))sk_set_cmp_func( \ |
| 2530 | CHECKED_CAST(_STACK *, STACK_OF(X509_CRL) *, sk), \ |
| 2531 | CHECKED_CAST(stack_cmp_func, \ |
| 2532 | int (*)(const X509_CRL **a, const X509_CRL **b), comp))) |
| 2533 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 2534 | #define sk_X509_CRL_deep_copy(sk, copy_func, free_func) \ |
| 2535 | ((STACK_OF(X509_CRL) *)sk_deep_copy( \ |
| 2536 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_CRL) *, sk), \ |
| 2537 | CHECKED_CAST(void *(*)(void *), X509_CRL *(*)(X509_CRL *), copy_func), \ |
| 2538 | CHECKED_CAST(void (*)(void *), void (*)(X509_CRL *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2539 | |
| 2540 | /* X509_EXTENSION */ |
| 2541 | #define sk_X509_EXTENSION_new(comp) \ |
| 2542 | ((STACK_OF(X509_EXTENSION) *)sk_new(CHECKED_CAST( \ |
| 2543 | stack_cmp_func, \ |
| 2544 | int (*)(const X509_EXTENSION **a, const X509_EXTENSION **b), comp))) |
| 2545 | |
| 2546 | #define sk_X509_EXTENSION_new_null() ((STACK_OF(X509_EXTENSION) *)sk_new_null()) |
| 2547 | |
| 2548 | #define sk_X509_EXTENSION_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2549 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_EXTENSION) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2550 | |
| 2551 | #define sk_X509_EXTENSION_zero(sk) \ |
| 2552 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk)); |
| 2553 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2554 | #define sk_X509_EXTENSION_value(sk, i) \ |
| 2555 | ((X509_EXTENSION *)sk_value( \ |
| 2556 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_EXTENSION) *, sk), \ |
| 2557 | (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2558 | |
| 2559 | #define sk_X509_EXTENSION_set(sk, i, p) \ |
| 2560 | ((X509_EXTENSION *)sk_set( \ |
| 2561 | CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk), (i), \ |
| 2562 | CHECKED_CAST(void *, X509_EXTENSION *, p))) |
| 2563 | |
| 2564 | #define sk_X509_EXTENSION_free(sk) \ |
| 2565 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk)) |
| 2566 | |
| 2567 | #define sk_X509_EXTENSION_pop_free(sk, free_func) \ |
| 2568 | sk_pop_free( \ |
| 2569 | CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk), \ |
| 2570 | CHECKED_CAST(void (*)(void *), void (*)(X509_EXTENSION *), free_func)) |
| 2571 | |
| 2572 | #define sk_X509_EXTENSION_insert(sk, p, where) \ |
| 2573 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk), \ |
| 2574 | CHECKED_CAST(void *, X509_EXTENSION *, p), (where)) |
| 2575 | |
| 2576 | #define sk_X509_EXTENSION_delete(sk, where) \ |
| 2577 | ((X509_EXTENSION *)sk_delete( \ |
| 2578 | CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk), (where))) |
| 2579 | |
| 2580 | #define sk_X509_EXTENSION_delete_ptr(sk, p) \ |
| 2581 | ((X509_EXTENSION *)sk_delete_ptr( \ |
| 2582 | CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk), \ |
| 2583 | CHECKED_CAST(void *, X509_EXTENSION *, p))) |
| 2584 | |
| 2585 | #define sk_X509_EXTENSION_find(sk, out_index, p) \ |
| 2586 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk), (out_index), \ |
| 2587 | CHECKED_CAST(void *, X509_EXTENSION *, p)) |
| 2588 | |
| 2589 | #define sk_X509_EXTENSION_shift(sk) \ |
| 2590 | ((X509_EXTENSION *)sk_shift( \ |
| 2591 | CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk))) |
| 2592 | |
| 2593 | #define sk_X509_EXTENSION_push(sk, p) \ |
| 2594 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk), \ |
| 2595 | CHECKED_CAST(void *, X509_EXTENSION *, p)) |
| 2596 | |
| 2597 | #define sk_X509_EXTENSION_pop(sk) \ |
| 2598 | ((X509_EXTENSION *)sk_pop( \ |
| 2599 | CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk))) |
| 2600 | |
| 2601 | #define sk_X509_EXTENSION_dup(sk) \ |
| 2602 | ((STACK_OF(X509_EXTENSION) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2603 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_EXTENSION) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2604 | |
| 2605 | #define sk_X509_EXTENSION_sort(sk) \ |
| 2606 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk)) |
| 2607 | |
| 2608 | #define sk_X509_EXTENSION_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2609 | sk_is_sorted( \ |
| 2610 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_EXTENSION) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2611 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 2612 | #define sk_X509_EXTENSION_set_cmp_func(sk, comp) \ |
| 2613 | ((int (*)(const X509_EXTENSION **a, const X509_EXTENSION **b)) \ |
| 2614 | sk_set_cmp_func( \ |
| 2615 | CHECKED_CAST(_STACK *, STACK_OF(X509_EXTENSION) *, sk), \ |
| 2616 | CHECKED_CAST(stack_cmp_func, int (*)(const X509_EXTENSION **a, \ |
| 2617 | const X509_EXTENSION **b), \ |
| 2618 | comp))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2619 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 2620 | #define sk_X509_EXTENSION_deep_copy(sk, copy_func, free_func) \ |
| 2621 | ((STACK_OF(X509_EXTENSION) *)sk_deep_copy( \ |
| 2622 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_EXTENSION) *, sk), \ |
| 2623 | CHECKED_CAST(void *(*)(void *), X509_EXTENSION *(*)(X509_EXTENSION *), \ |
| 2624 | copy_func), \ |
| 2625 | CHECKED_CAST(void (*)(void *), void (*)(X509_EXTENSION *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2626 | |
| 2627 | /* X509_INFO */ |
| 2628 | #define sk_X509_INFO_new(comp) \ |
| 2629 | ((STACK_OF(X509_INFO) *)sk_new( \ |
| 2630 | CHECKED_CAST(stack_cmp_func, \ |
| 2631 | int (*)(const X509_INFO **a, const X509_INFO **b), comp))) |
| 2632 | |
| 2633 | #define sk_X509_INFO_new_null() ((STACK_OF(X509_INFO) *)sk_new_null()) |
| 2634 | |
| 2635 | #define sk_X509_INFO_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2636 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_INFO) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2637 | |
| 2638 | #define sk_X509_INFO_zero(sk) \ |
| 2639 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk)); |
| 2640 | |
| 2641 | #define sk_X509_INFO_value(sk, i) \ |
| 2642 | ((X509_INFO *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2643 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_INFO) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2644 | |
| 2645 | #define sk_X509_INFO_set(sk, i, p) \ |
| 2646 | ((X509_INFO *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk), (i), \ |
| 2647 | CHECKED_CAST(void *, X509_INFO *, p))) |
| 2648 | |
| 2649 | #define sk_X509_INFO_free(sk) \ |
| 2650 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk)) |
| 2651 | |
| 2652 | #define sk_X509_INFO_pop_free(sk, free_func) \ |
| 2653 | sk_pop_free( \ |
| 2654 | CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk), \ |
| 2655 | CHECKED_CAST(void (*)(void *), void (*)(X509_INFO *), free_func)) |
| 2656 | |
| 2657 | #define sk_X509_INFO_insert(sk, p, where) \ |
| 2658 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk), \ |
| 2659 | CHECKED_CAST(void *, X509_INFO *, p), (where)) |
| 2660 | |
| 2661 | #define sk_X509_INFO_delete(sk, where) \ |
| 2662 | ((X509_INFO *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk), \ |
| 2663 | (where))) |
| 2664 | |
| 2665 | #define sk_X509_INFO_delete_ptr(sk, p) \ |
| 2666 | ((X509_INFO *)sk_delete_ptr( \ |
| 2667 | CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk), \ |
| 2668 | CHECKED_CAST(void *, X509_INFO *, p))) |
| 2669 | |
| 2670 | #define sk_X509_INFO_find(sk, out_index, p) \ |
| 2671 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk), (out_index), \ |
| 2672 | CHECKED_CAST(void *, X509_INFO *, p)) |
| 2673 | |
| 2674 | #define sk_X509_INFO_shift(sk) \ |
| 2675 | ((X509_INFO *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk))) |
| 2676 | |
| 2677 | #define sk_X509_INFO_push(sk, p) \ |
| 2678 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk), \ |
| 2679 | CHECKED_CAST(void *, X509_INFO *, p)) |
| 2680 | |
| 2681 | #define sk_X509_INFO_pop(sk) \ |
| 2682 | ((X509_INFO *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk))) |
| 2683 | |
| 2684 | #define sk_X509_INFO_dup(sk) \ |
| 2685 | ((STACK_OF(X509_INFO) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2686 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_INFO) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2687 | |
| 2688 | #define sk_X509_INFO_sort(sk) \ |
| 2689 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk)) |
| 2690 | |
| 2691 | #define sk_X509_INFO_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2692 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(X509_INFO) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2693 | |
| 2694 | #define sk_X509_INFO_set_cmp_func(sk, comp) \ |
| 2695 | ((int (*)(const X509_INFO **a, const X509_INFO **b))sk_set_cmp_func( \ |
| 2696 | CHECKED_CAST(_STACK *, STACK_OF(X509_INFO) *, sk), \ |
| 2697 | CHECKED_CAST(stack_cmp_func, \ |
| 2698 | int (*)(const X509_INFO **a, const X509_INFO **b), comp))) |
| 2699 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 2700 | #define sk_X509_INFO_deep_copy(sk, copy_func, free_func) \ |
| 2701 | ((STACK_OF(X509_INFO) *)sk_deep_copy( \ |
| 2702 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_INFO) *, sk), \ |
| 2703 | CHECKED_CAST(void *(*)(void *), X509_INFO *(*)(X509_INFO *), copy_func), \ |
| 2704 | CHECKED_CAST(void (*)(void *), void (*)(X509_INFO *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2705 | |
| 2706 | /* X509_LOOKUP */ |
| 2707 | #define sk_X509_LOOKUP_new(comp) \ |
| 2708 | ((STACK_OF(X509_LOOKUP) *)sk_new(CHECKED_CAST( \ |
| 2709 | stack_cmp_func, int (*)(const X509_LOOKUP **a, const X509_LOOKUP **b), \ |
| 2710 | comp))) |
| 2711 | |
| 2712 | #define sk_X509_LOOKUP_new_null() ((STACK_OF(X509_LOOKUP) *)sk_new_null()) |
| 2713 | |
| 2714 | #define sk_X509_LOOKUP_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2715 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_LOOKUP) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2716 | |
| 2717 | #define sk_X509_LOOKUP_zero(sk) \ |
| 2718 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk)); |
| 2719 | |
| 2720 | #define sk_X509_LOOKUP_value(sk, i) \ |
| 2721 | ((X509_LOOKUP *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2722 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_LOOKUP) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2723 | |
| 2724 | #define sk_X509_LOOKUP_set(sk, i, p) \ |
| 2725 | ((X509_LOOKUP *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk), \ |
| 2726 | (i), CHECKED_CAST(void *, X509_LOOKUP *, p))) |
| 2727 | |
| 2728 | #define sk_X509_LOOKUP_free(sk) \ |
| 2729 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk)) |
| 2730 | |
| 2731 | #define sk_X509_LOOKUP_pop_free(sk, free_func) \ |
| 2732 | sk_pop_free( \ |
| 2733 | CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk), \ |
| 2734 | CHECKED_CAST(void (*)(void *), void (*)(X509_LOOKUP *), free_func)) |
| 2735 | |
| 2736 | #define sk_X509_LOOKUP_insert(sk, p, where) \ |
| 2737 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk), \ |
| 2738 | CHECKED_CAST(void *, X509_LOOKUP *, p), (where)) |
| 2739 | |
| 2740 | #define sk_X509_LOOKUP_delete(sk, where) \ |
| 2741 | ((X509_LOOKUP *)sk_delete( \ |
| 2742 | CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk), (where))) |
| 2743 | |
| 2744 | #define sk_X509_LOOKUP_delete_ptr(sk, p) \ |
| 2745 | ((X509_LOOKUP *)sk_delete_ptr( \ |
| 2746 | CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk), \ |
| 2747 | CHECKED_CAST(void *, X509_LOOKUP *, p))) |
| 2748 | |
| 2749 | #define sk_X509_LOOKUP_find(sk, out_index, p) \ |
| 2750 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk), (out_index), \ |
| 2751 | CHECKED_CAST(void *, X509_LOOKUP *, p)) |
| 2752 | |
| 2753 | #define sk_X509_LOOKUP_shift(sk) \ |
| 2754 | ((X509_LOOKUP *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk))) |
| 2755 | |
| 2756 | #define sk_X509_LOOKUP_push(sk, p) \ |
| 2757 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk), \ |
| 2758 | CHECKED_CAST(void *, X509_LOOKUP *, p)) |
| 2759 | |
| 2760 | #define sk_X509_LOOKUP_pop(sk) \ |
| 2761 | ((X509_LOOKUP *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk))) |
| 2762 | |
| 2763 | #define sk_X509_LOOKUP_dup(sk) \ |
| 2764 | ((STACK_OF(X509_LOOKUP) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2765 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_LOOKUP) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2766 | |
| 2767 | #define sk_X509_LOOKUP_sort(sk) \ |
| 2768 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk)) |
| 2769 | |
| 2770 | #define sk_X509_LOOKUP_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2771 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(X509_LOOKUP) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2772 | |
| 2773 | #define sk_X509_LOOKUP_set_cmp_func(sk, comp) \ |
| 2774 | ((int (*)(const X509_LOOKUP **a, const X509_LOOKUP **b))sk_set_cmp_func( \ |
| 2775 | CHECKED_CAST(_STACK *, STACK_OF(X509_LOOKUP) *, sk), \ |
| 2776 | CHECKED_CAST(stack_cmp_func, \ |
| 2777 | int (*)(const X509_LOOKUP **a, const X509_LOOKUP **b), \ |
| 2778 | comp))) |
| 2779 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 2780 | #define sk_X509_LOOKUP_deep_copy(sk, copy_func, free_func) \ |
| 2781 | ((STACK_OF(X509_LOOKUP) *)sk_deep_copy( \ |
| 2782 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_LOOKUP) *, sk), \ |
| 2783 | CHECKED_CAST(void *(*)(void *), X509_LOOKUP *(*)(X509_LOOKUP *), \ |
| 2784 | copy_func), \ |
| 2785 | CHECKED_CAST(void (*)(void *), void (*)(X509_LOOKUP *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2786 | |
| 2787 | /* X509_NAME */ |
| 2788 | #define sk_X509_NAME_new(comp) \ |
| 2789 | ((STACK_OF(X509_NAME) *)sk_new( \ |
| 2790 | CHECKED_CAST(stack_cmp_func, \ |
| 2791 | int (*)(const X509_NAME **a, const X509_NAME **b), comp))) |
| 2792 | |
| 2793 | #define sk_X509_NAME_new_null() ((STACK_OF(X509_NAME) *)sk_new_null()) |
| 2794 | |
| 2795 | #define sk_X509_NAME_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2796 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_NAME) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2797 | |
| 2798 | #define sk_X509_NAME_zero(sk) \ |
| 2799 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk)); |
| 2800 | |
| 2801 | #define sk_X509_NAME_value(sk, i) \ |
| 2802 | ((X509_NAME *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2803 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_NAME) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2804 | |
| 2805 | #define sk_X509_NAME_set(sk, i, p) \ |
| 2806 | ((X509_NAME *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk), (i), \ |
| 2807 | CHECKED_CAST(void *, X509_NAME *, p))) |
| 2808 | |
| 2809 | #define sk_X509_NAME_free(sk) \ |
| 2810 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk)) |
| 2811 | |
| 2812 | #define sk_X509_NAME_pop_free(sk, free_func) \ |
| 2813 | sk_pop_free( \ |
| 2814 | CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk), \ |
| 2815 | CHECKED_CAST(void (*)(void *), void (*)(X509_NAME *), free_func)) |
| 2816 | |
| 2817 | #define sk_X509_NAME_insert(sk, p, where) \ |
| 2818 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk), \ |
| 2819 | CHECKED_CAST(void *, X509_NAME *, p), (where)) |
| 2820 | |
| 2821 | #define sk_X509_NAME_delete(sk, where) \ |
| 2822 | ((X509_NAME *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk), \ |
| 2823 | (where))) |
| 2824 | |
| 2825 | #define sk_X509_NAME_delete_ptr(sk, p) \ |
| 2826 | ((X509_NAME *)sk_delete_ptr( \ |
| 2827 | CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk), \ |
| 2828 | CHECKED_CAST(void *, X509_NAME *, p))) |
| 2829 | |
| 2830 | #define sk_X509_NAME_find(sk, out_index, p) \ |
| 2831 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk), (out_index), \ |
| 2832 | CHECKED_CAST(void *, X509_NAME *, p)) |
| 2833 | |
| 2834 | #define sk_X509_NAME_shift(sk) \ |
| 2835 | ((X509_NAME *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk))) |
| 2836 | |
| 2837 | #define sk_X509_NAME_push(sk, p) \ |
| 2838 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk), \ |
| 2839 | CHECKED_CAST(void *, X509_NAME *, p)) |
| 2840 | |
| 2841 | #define sk_X509_NAME_pop(sk) \ |
| 2842 | ((X509_NAME *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk))) |
| 2843 | |
| 2844 | #define sk_X509_NAME_dup(sk) \ |
| 2845 | ((STACK_OF(X509_NAME) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2846 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_NAME) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2847 | |
| 2848 | #define sk_X509_NAME_sort(sk) \ |
| 2849 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk)) |
| 2850 | |
| 2851 | #define sk_X509_NAME_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2852 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(X509_NAME) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2853 | |
| 2854 | #define sk_X509_NAME_set_cmp_func(sk, comp) \ |
| 2855 | ((int (*)(const X509_NAME **a, const X509_NAME **b))sk_set_cmp_func( \ |
| 2856 | CHECKED_CAST(_STACK *, STACK_OF(X509_NAME) *, sk), \ |
| 2857 | CHECKED_CAST(stack_cmp_func, \ |
| 2858 | int (*)(const X509_NAME **a, const X509_NAME **b), comp))) |
| 2859 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 2860 | #define sk_X509_NAME_deep_copy(sk, copy_func, free_func) \ |
| 2861 | ((STACK_OF(X509_NAME) *)sk_deep_copy( \ |
| 2862 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_NAME) *, sk), \ |
| 2863 | CHECKED_CAST(void *(*)(void *), X509_NAME *(*)(X509_NAME *), copy_func), \ |
| 2864 | CHECKED_CAST(void (*)(void *), void (*)(X509_NAME *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2865 | |
| 2866 | /* X509_NAME_ENTRY */ |
| 2867 | #define sk_X509_NAME_ENTRY_new(comp) \ |
| 2868 | ((STACK_OF(X509_NAME_ENTRY) *)sk_new(CHECKED_CAST( \ |
| 2869 | stack_cmp_func, \ |
| 2870 | int (*)(const X509_NAME_ENTRY **a, const X509_NAME_ENTRY **b), comp))) |
| 2871 | |
| 2872 | #define sk_X509_NAME_ENTRY_new_null() \ |
| 2873 | ((STACK_OF(X509_NAME_ENTRY) *)sk_new_null()) |
| 2874 | |
| 2875 | #define sk_X509_NAME_ENTRY_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2876 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_NAME_ENTRY) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2877 | |
| 2878 | #define sk_X509_NAME_ENTRY_zero(sk) \ |
| 2879 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk)); |
| 2880 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2881 | #define sk_X509_NAME_ENTRY_value(sk, i) \ |
| 2882 | ((X509_NAME_ENTRY *)sk_value( \ |
| 2883 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_NAME_ENTRY) *, sk), \ |
| 2884 | (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2885 | |
| 2886 | #define sk_X509_NAME_ENTRY_set(sk, i, p) \ |
| 2887 | ((X509_NAME_ENTRY *)sk_set( \ |
| 2888 | CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk), (i), \ |
| 2889 | CHECKED_CAST(void *, X509_NAME_ENTRY *, p))) |
| 2890 | |
| 2891 | #define sk_X509_NAME_ENTRY_free(sk) \ |
| 2892 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk)) |
| 2893 | |
| 2894 | #define sk_X509_NAME_ENTRY_pop_free(sk, free_func) \ |
| 2895 | sk_pop_free( \ |
| 2896 | CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk), \ |
| 2897 | CHECKED_CAST(void (*)(void *), void (*)(X509_NAME_ENTRY *), free_func)) |
| 2898 | |
| 2899 | #define sk_X509_NAME_ENTRY_insert(sk, p, where) \ |
| 2900 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk), \ |
| 2901 | CHECKED_CAST(void *, X509_NAME_ENTRY *, p), (where)) |
| 2902 | |
| 2903 | #define sk_X509_NAME_ENTRY_delete(sk, where) \ |
| 2904 | ((X509_NAME_ENTRY *)sk_delete( \ |
| 2905 | CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk), (where))) |
| 2906 | |
| 2907 | #define sk_X509_NAME_ENTRY_delete_ptr(sk, p) \ |
| 2908 | ((X509_NAME_ENTRY *)sk_delete_ptr( \ |
| 2909 | CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk), \ |
| 2910 | CHECKED_CAST(void *, X509_NAME_ENTRY *, p))) |
| 2911 | |
| 2912 | #define sk_X509_NAME_ENTRY_find(sk, out_index, p) \ |
| 2913 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk), \ |
| 2914 | (out_index), CHECKED_CAST(void *, X509_NAME_ENTRY *, p)) |
| 2915 | |
| 2916 | #define sk_X509_NAME_ENTRY_shift(sk) \ |
| 2917 | ((X509_NAME_ENTRY *)sk_shift( \ |
| 2918 | CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk))) |
| 2919 | |
| 2920 | #define sk_X509_NAME_ENTRY_push(sk, p) \ |
| 2921 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk), \ |
| 2922 | CHECKED_CAST(void *, X509_NAME_ENTRY *, p)) |
| 2923 | |
| 2924 | #define sk_X509_NAME_ENTRY_pop(sk) \ |
| 2925 | ((X509_NAME_ENTRY *)sk_pop( \ |
| 2926 | CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk))) |
| 2927 | |
| 2928 | #define sk_X509_NAME_ENTRY_dup(sk) \ |
| 2929 | ((STACK_OF(X509_NAME_ENTRY) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2930 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_NAME_ENTRY) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2931 | |
| 2932 | #define sk_X509_NAME_ENTRY_sort(sk) \ |
| 2933 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk)) |
| 2934 | |
| 2935 | #define sk_X509_NAME_ENTRY_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2936 | sk_is_sorted( \ |
| 2937 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_NAME_ENTRY) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2938 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 2939 | #define sk_X509_NAME_ENTRY_set_cmp_func(sk, comp) \ |
| 2940 | ((int (*)(const X509_NAME_ENTRY **a, const X509_NAME_ENTRY **b)) \ |
| 2941 | sk_set_cmp_func( \ |
| 2942 | CHECKED_CAST(_STACK *, STACK_OF(X509_NAME_ENTRY) *, sk), \ |
| 2943 | CHECKED_CAST(stack_cmp_func, int (*)(const X509_NAME_ENTRY **a, \ |
| 2944 | const X509_NAME_ENTRY **b), \ |
| 2945 | comp))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2946 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 2947 | #define sk_X509_NAME_ENTRY_deep_copy(sk, copy_func, free_func) \ |
| 2948 | ((STACK_OF(X509_NAME_ENTRY) *)sk_deep_copy( \ |
| 2949 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_NAME_ENTRY) *, sk), \ |
| 2950 | CHECKED_CAST(void *(*)(void *), X509_NAME_ENTRY *(*)(X509_NAME_ENTRY *), \ |
| 2951 | copy_func), \ |
| 2952 | CHECKED_CAST(void (*)(void *), void (*)(X509_NAME_ENTRY *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2953 | |
| 2954 | /* X509_OBJECT */ |
| 2955 | #define sk_X509_OBJECT_new(comp) \ |
| 2956 | ((STACK_OF(X509_OBJECT) *)sk_new(CHECKED_CAST( \ |
| 2957 | stack_cmp_func, int (*)(const X509_OBJECT **a, const X509_OBJECT **b), \ |
| 2958 | comp))) |
| 2959 | |
| 2960 | #define sk_X509_OBJECT_new_null() ((STACK_OF(X509_OBJECT) *)sk_new_null()) |
| 2961 | |
| 2962 | #define sk_X509_OBJECT_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2963 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_OBJECT) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2964 | |
| 2965 | #define sk_X509_OBJECT_zero(sk) \ |
| 2966 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk)); |
| 2967 | |
| 2968 | #define sk_X509_OBJECT_value(sk, i) \ |
| 2969 | ((X509_OBJECT *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 2970 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_OBJECT) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 2971 | |
| 2972 | #define sk_X509_OBJECT_set(sk, i, p) \ |
| 2973 | ((X509_OBJECT *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk), \ |
| 2974 | (i), CHECKED_CAST(void *, X509_OBJECT *, p))) |
| 2975 | |
| 2976 | #define sk_X509_OBJECT_free(sk) \ |
| 2977 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk)) |
| 2978 | |
| 2979 | #define sk_X509_OBJECT_pop_free(sk, free_func) \ |
| 2980 | sk_pop_free( \ |
| 2981 | CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk), \ |
| 2982 | CHECKED_CAST(void (*)(void *), void (*)(X509_OBJECT *), free_func)) |
| 2983 | |
| 2984 | #define sk_X509_OBJECT_insert(sk, p, where) \ |
| 2985 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk), \ |
| 2986 | CHECKED_CAST(void *, X509_OBJECT *, p), (where)) |
| 2987 | |
| 2988 | #define sk_X509_OBJECT_delete(sk, where) \ |
| 2989 | ((X509_OBJECT *)sk_delete( \ |
| 2990 | CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk), (where))) |
| 2991 | |
| 2992 | #define sk_X509_OBJECT_delete_ptr(sk, p) \ |
| 2993 | ((X509_OBJECT *)sk_delete_ptr( \ |
| 2994 | CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk), \ |
| 2995 | CHECKED_CAST(void *, X509_OBJECT *, p))) |
| 2996 | |
| 2997 | #define sk_X509_OBJECT_find(sk, out_index, p) \ |
| 2998 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk), (out_index), \ |
| 2999 | CHECKED_CAST(void *, X509_OBJECT *, p)) |
| 3000 | |
| 3001 | #define sk_X509_OBJECT_shift(sk) \ |
| 3002 | ((X509_OBJECT *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk))) |
| 3003 | |
| 3004 | #define sk_X509_OBJECT_push(sk, p) \ |
| 3005 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk), \ |
| 3006 | CHECKED_CAST(void *, X509_OBJECT *, p)) |
| 3007 | |
| 3008 | #define sk_X509_OBJECT_pop(sk) \ |
| 3009 | ((X509_OBJECT *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk))) |
| 3010 | |
| 3011 | #define sk_X509_OBJECT_dup(sk) \ |
| 3012 | ((STACK_OF(X509_OBJECT) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3013 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_OBJECT) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3014 | |
| 3015 | #define sk_X509_OBJECT_sort(sk) \ |
| 3016 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk)) |
| 3017 | |
| 3018 | #define sk_X509_OBJECT_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3019 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(X509_OBJECT) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3020 | |
| 3021 | #define sk_X509_OBJECT_set_cmp_func(sk, comp) \ |
| 3022 | ((int (*)(const X509_OBJECT **a, const X509_OBJECT **b))sk_set_cmp_func( \ |
| 3023 | CHECKED_CAST(_STACK *, STACK_OF(X509_OBJECT) *, sk), \ |
| 3024 | CHECKED_CAST(stack_cmp_func, \ |
| 3025 | int (*)(const X509_OBJECT **a, const X509_OBJECT **b), \ |
| 3026 | comp))) |
| 3027 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 3028 | #define sk_X509_OBJECT_deep_copy(sk, copy_func, free_func) \ |
| 3029 | ((STACK_OF(X509_OBJECT) *)sk_deep_copy( \ |
| 3030 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_OBJECT) *, sk), \ |
| 3031 | CHECKED_CAST(void *(*)(void *), X509_OBJECT *(*)(X509_OBJECT *), \ |
| 3032 | copy_func), \ |
| 3033 | CHECKED_CAST(void (*)(void *), void (*)(X509_OBJECT *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3034 | |
| 3035 | /* X509_POLICY_DATA */ |
| 3036 | #define sk_X509_POLICY_DATA_new(comp) \ |
| 3037 | ((STACK_OF(X509_POLICY_DATA) *)sk_new(CHECKED_CAST( \ |
| 3038 | stack_cmp_func, \ |
| 3039 | int (*)(const X509_POLICY_DATA **a, const X509_POLICY_DATA **b), comp))) |
| 3040 | |
| 3041 | #define sk_X509_POLICY_DATA_new_null() \ |
| 3042 | ((STACK_OF(X509_POLICY_DATA) *)sk_new_null()) |
| 3043 | |
| 3044 | #define sk_X509_POLICY_DATA_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3045 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_POLICY_DATA) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3046 | |
| 3047 | #define sk_X509_POLICY_DATA_zero(sk) \ |
| 3048 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk)); |
| 3049 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3050 | #define sk_X509_POLICY_DATA_value(sk, i) \ |
| 3051 | ((X509_POLICY_DATA *)sk_value( \ |
| 3052 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_POLICY_DATA) *, sk), \ |
| 3053 | (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3054 | |
| 3055 | #define sk_X509_POLICY_DATA_set(sk, i, p) \ |
| 3056 | ((X509_POLICY_DATA *)sk_set( \ |
| 3057 | CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk), (i), \ |
| 3058 | CHECKED_CAST(void *, X509_POLICY_DATA *, p))) |
| 3059 | |
| 3060 | #define sk_X509_POLICY_DATA_free(sk) \ |
| 3061 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk)) |
| 3062 | |
| 3063 | #define sk_X509_POLICY_DATA_pop_free(sk, free_func) \ |
| 3064 | sk_pop_free( \ |
| 3065 | CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk), \ |
| 3066 | CHECKED_CAST(void (*)(void *), void (*)(X509_POLICY_DATA *), free_func)) |
| 3067 | |
| 3068 | #define sk_X509_POLICY_DATA_insert(sk, p, where) \ |
| 3069 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk), \ |
| 3070 | CHECKED_CAST(void *, X509_POLICY_DATA *, p), (where)) |
| 3071 | |
| 3072 | #define sk_X509_POLICY_DATA_delete(sk, where) \ |
| 3073 | ((X509_POLICY_DATA *)sk_delete( \ |
| 3074 | CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk), (where))) |
| 3075 | |
| 3076 | #define sk_X509_POLICY_DATA_delete_ptr(sk, p) \ |
| 3077 | ((X509_POLICY_DATA *)sk_delete_ptr( \ |
| 3078 | CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk), \ |
| 3079 | CHECKED_CAST(void *, X509_POLICY_DATA *, p))) |
| 3080 | |
| 3081 | #define sk_X509_POLICY_DATA_find(sk, out_index, p) \ |
| 3082 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk), \ |
| 3083 | (out_index), CHECKED_CAST(void *, X509_POLICY_DATA *, p)) |
| 3084 | |
| 3085 | #define sk_X509_POLICY_DATA_shift(sk) \ |
| 3086 | ((X509_POLICY_DATA *)sk_shift( \ |
| 3087 | CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk))) |
| 3088 | |
| 3089 | #define sk_X509_POLICY_DATA_push(sk, p) \ |
| 3090 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk), \ |
| 3091 | CHECKED_CAST(void *, X509_POLICY_DATA *, p)) |
| 3092 | |
| 3093 | #define sk_X509_POLICY_DATA_pop(sk) \ |
| 3094 | ((X509_POLICY_DATA *)sk_pop( \ |
| 3095 | CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk))) |
| 3096 | |
| 3097 | #define sk_X509_POLICY_DATA_dup(sk) \ |
| 3098 | ((STACK_OF(X509_POLICY_DATA) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3099 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_POLICY_DATA) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3100 | |
| 3101 | #define sk_X509_POLICY_DATA_sort(sk) \ |
| 3102 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk)) |
| 3103 | |
| 3104 | #define sk_X509_POLICY_DATA_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3105 | sk_is_sorted( \ |
| 3106 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_POLICY_DATA) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3107 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 3108 | #define sk_X509_POLICY_DATA_set_cmp_func(sk, comp) \ |
| 3109 | ((int (*)(const X509_POLICY_DATA **a, const X509_POLICY_DATA **b)) \ |
| 3110 | sk_set_cmp_func( \ |
| 3111 | CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_DATA) *, sk), \ |
| 3112 | CHECKED_CAST(stack_cmp_func, int (*)(const X509_POLICY_DATA **a, \ |
| 3113 | const X509_POLICY_DATA **b), \ |
| 3114 | comp))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3115 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 3116 | #define sk_X509_POLICY_DATA_deep_copy(sk, copy_func, free_func) \ |
| 3117 | ((STACK_OF(X509_POLICY_DATA) *)sk_deep_copy( \ |
| 3118 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_POLICY_DATA) *, sk), \ |
| 3119 | CHECKED_CAST(void *(*)(void *), \ |
| 3120 | X509_POLICY_DATA *(*)(X509_POLICY_DATA *), copy_func), \ |
| 3121 | CHECKED_CAST(void (*)(void *), void (*)(X509_POLICY_DATA *), \ |
| 3122 | free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3123 | |
| 3124 | /* X509_POLICY_NODE */ |
| 3125 | #define sk_X509_POLICY_NODE_new(comp) \ |
| 3126 | ((STACK_OF(X509_POLICY_NODE) *)sk_new(CHECKED_CAST( \ |
| 3127 | stack_cmp_func, \ |
| 3128 | int (*)(const X509_POLICY_NODE **a, const X509_POLICY_NODE **b), comp))) |
| 3129 | |
| 3130 | #define sk_X509_POLICY_NODE_new_null() \ |
| 3131 | ((STACK_OF(X509_POLICY_NODE) *)sk_new_null()) |
| 3132 | |
| 3133 | #define sk_X509_POLICY_NODE_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3134 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_POLICY_NODE) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3135 | |
| 3136 | #define sk_X509_POLICY_NODE_zero(sk) \ |
| 3137 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk)); |
| 3138 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3139 | #define sk_X509_POLICY_NODE_value(sk, i) \ |
| 3140 | ((X509_POLICY_NODE *)sk_value( \ |
| 3141 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_POLICY_NODE) *, sk), \ |
| 3142 | (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3143 | |
| 3144 | #define sk_X509_POLICY_NODE_set(sk, i, p) \ |
| 3145 | ((X509_POLICY_NODE *)sk_set( \ |
| 3146 | CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk), (i), \ |
| 3147 | CHECKED_CAST(void *, X509_POLICY_NODE *, p))) |
| 3148 | |
| 3149 | #define sk_X509_POLICY_NODE_free(sk) \ |
| 3150 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk)) |
| 3151 | |
| 3152 | #define sk_X509_POLICY_NODE_pop_free(sk, free_func) \ |
| 3153 | sk_pop_free( \ |
| 3154 | CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk), \ |
| 3155 | CHECKED_CAST(void (*)(void *), void (*)(X509_POLICY_NODE *), free_func)) |
| 3156 | |
| 3157 | #define sk_X509_POLICY_NODE_insert(sk, p, where) \ |
| 3158 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk), \ |
| 3159 | CHECKED_CAST(void *, X509_POLICY_NODE *, p), (where)) |
| 3160 | |
| 3161 | #define sk_X509_POLICY_NODE_delete(sk, where) \ |
| 3162 | ((X509_POLICY_NODE *)sk_delete( \ |
| 3163 | CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk), (where))) |
| 3164 | |
| 3165 | #define sk_X509_POLICY_NODE_delete_ptr(sk, p) \ |
| 3166 | ((X509_POLICY_NODE *)sk_delete_ptr( \ |
| 3167 | CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk), \ |
| 3168 | CHECKED_CAST(void *, X509_POLICY_NODE *, p))) |
| 3169 | |
| 3170 | #define sk_X509_POLICY_NODE_find(sk, out_index, p) \ |
| 3171 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk), \ |
| 3172 | (out_index), CHECKED_CAST(void *, X509_POLICY_NODE *, p)) |
| 3173 | |
| 3174 | #define sk_X509_POLICY_NODE_shift(sk) \ |
| 3175 | ((X509_POLICY_NODE *)sk_shift( \ |
| 3176 | CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk))) |
| 3177 | |
| 3178 | #define sk_X509_POLICY_NODE_push(sk, p) \ |
| 3179 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk), \ |
| 3180 | CHECKED_CAST(void *, X509_POLICY_NODE *, p)) |
| 3181 | |
| 3182 | #define sk_X509_POLICY_NODE_pop(sk) \ |
| 3183 | ((X509_POLICY_NODE *)sk_pop( \ |
| 3184 | CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk))) |
| 3185 | |
| 3186 | #define sk_X509_POLICY_NODE_dup(sk) \ |
| 3187 | ((STACK_OF(X509_POLICY_NODE) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3188 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_POLICY_NODE) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3189 | |
| 3190 | #define sk_X509_POLICY_NODE_sort(sk) \ |
| 3191 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk)) |
| 3192 | |
| 3193 | #define sk_X509_POLICY_NODE_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3194 | sk_is_sorted( \ |
| 3195 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_POLICY_NODE) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3196 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 3197 | #define sk_X509_POLICY_NODE_set_cmp_func(sk, comp) \ |
| 3198 | ((int (*)(const X509_POLICY_NODE **a, const X509_POLICY_NODE **b)) \ |
| 3199 | sk_set_cmp_func( \ |
| 3200 | CHECKED_CAST(_STACK *, STACK_OF(X509_POLICY_NODE) *, sk), \ |
| 3201 | CHECKED_CAST(stack_cmp_func, int (*)(const X509_POLICY_NODE **a, \ |
| 3202 | const X509_POLICY_NODE **b), \ |
| 3203 | comp))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3204 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 3205 | #define sk_X509_POLICY_NODE_deep_copy(sk, copy_func, free_func) \ |
| 3206 | ((STACK_OF(X509_POLICY_NODE) *)sk_deep_copy( \ |
| 3207 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_POLICY_NODE) *, sk), \ |
| 3208 | CHECKED_CAST(void *(*)(void *), \ |
| 3209 | X509_POLICY_NODE *(*)(X509_POLICY_NODE *), copy_func), \ |
| 3210 | CHECKED_CAST(void (*)(void *), void (*)(X509_POLICY_NODE *), \ |
| 3211 | free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3212 | |
| 3213 | /* X509_PURPOSE */ |
| 3214 | #define sk_X509_PURPOSE_new(comp) \ |
| 3215 | ((STACK_OF(X509_PURPOSE) *)sk_new(CHECKED_CAST( \ |
| 3216 | stack_cmp_func, int (*)(const X509_PURPOSE **a, const X509_PURPOSE **b), \ |
| 3217 | comp))) |
| 3218 | |
| 3219 | #define sk_X509_PURPOSE_new_null() ((STACK_OF(X509_PURPOSE) *)sk_new_null()) |
| 3220 | |
| 3221 | #define sk_X509_PURPOSE_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3222 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_PURPOSE) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3223 | |
| 3224 | #define sk_X509_PURPOSE_zero(sk) \ |
| 3225 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk)); |
| 3226 | |
| 3227 | #define sk_X509_PURPOSE_value(sk, i) \ |
| 3228 | ((X509_PURPOSE *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3229 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_PURPOSE) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3230 | |
| 3231 | #define sk_X509_PURPOSE_set(sk, i, p) \ |
| 3232 | ((X509_PURPOSE *)sk_set( \ |
| 3233 | CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk), (i), \ |
| 3234 | CHECKED_CAST(void *, X509_PURPOSE *, p))) |
| 3235 | |
| 3236 | #define sk_X509_PURPOSE_free(sk) \ |
| 3237 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk)) |
| 3238 | |
| 3239 | #define sk_X509_PURPOSE_pop_free(sk, free_func) \ |
| 3240 | sk_pop_free( \ |
| 3241 | CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk), \ |
| 3242 | CHECKED_CAST(void (*)(void *), void (*)(X509_PURPOSE *), free_func)) |
| 3243 | |
| 3244 | #define sk_X509_PURPOSE_insert(sk, p, where) \ |
| 3245 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk), \ |
| 3246 | CHECKED_CAST(void *, X509_PURPOSE *, p), (where)) |
| 3247 | |
| 3248 | #define sk_X509_PURPOSE_delete(sk, where) \ |
| 3249 | ((X509_PURPOSE *)sk_delete( \ |
| 3250 | CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk), (where))) |
| 3251 | |
| 3252 | #define sk_X509_PURPOSE_delete_ptr(sk, p) \ |
| 3253 | ((X509_PURPOSE *)sk_delete_ptr( \ |
| 3254 | CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk), \ |
| 3255 | CHECKED_CAST(void *, X509_PURPOSE *, p))) |
| 3256 | |
| 3257 | #define sk_X509_PURPOSE_find(sk, out_index, p) \ |
| 3258 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk), (out_index), \ |
| 3259 | CHECKED_CAST(void *, X509_PURPOSE *, p)) |
| 3260 | |
| 3261 | #define sk_X509_PURPOSE_shift(sk) \ |
| 3262 | ((X509_PURPOSE *)sk_shift( \ |
| 3263 | CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk))) |
| 3264 | |
| 3265 | #define sk_X509_PURPOSE_push(sk, p) \ |
| 3266 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk), \ |
| 3267 | CHECKED_CAST(void *, X509_PURPOSE *, p)) |
| 3268 | |
| 3269 | #define sk_X509_PURPOSE_pop(sk) \ |
| 3270 | ((X509_PURPOSE *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk))) |
| 3271 | |
| 3272 | #define sk_X509_PURPOSE_dup(sk) \ |
| 3273 | ((STACK_OF(X509_PURPOSE) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3274 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_PURPOSE) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3275 | |
| 3276 | #define sk_X509_PURPOSE_sort(sk) \ |
| 3277 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk)) |
| 3278 | |
| 3279 | #define sk_X509_PURPOSE_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3280 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(X509_PURPOSE) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3281 | |
| 3282 | #define sk_X509_PURPOSE_set_cmp_func(sk, comp) \ |
| 3283 | ((int (*)(const X509_PURPOSE **a, const X509_PURPOSE **b))sk_set_cmp_func( \ |
| 3284 | CHECKED_CAST(_STACK *, STACK_OF(X509_PURPOSE) *, sk), \ |
| 3285 | CHECKED_CAST(stack_cmp_func, \ |
| 3286 | int (*)(const X509_PURPOSE **a, const X509_PURPOSE **b), \ |
| 3287 | comp))) |
| 3288 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 3289 | #define sk_X509_PURPOSE_deep_copy(sk, copy_func, free_func) \ |
| 3290 | ((STACK_OF(X509_PURPOSE) *)sk_deep_copy( \ |
| 3291 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_PURPOSE) *, sk), \ |
| 3292 | CHECKED_CAST(void *(*)(void *), X509_PURPOSE *(*)(X509_PURPOSE *), \ |
| 3293 | copy_func), \ |
| 3294 | CHECKED_CAST(void (*)(void *), void (*)(X509_PURPOSE *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3295 | |
| 3296 | /* X509_REVOKED */ |
| 3297 | #define sk_X509_REVOKED_new(comp) \ |
| 3298 | ((STACK_OF(X509_REVOKED) *)sk_new(CHECKED_CAST( \ |
| 3299 | stack_cmp_func, int (*)(const X509_REVOKED **a, const X509_REVOKED **b), \ |
| 3300 | comp))) |
| 3301 | |
| 3302 | #define sk_X509_REVOKED_new_null() ((STACK_OF(X509_REVOKED) *)sk_new_null()) |
| 3303 | |
| 3304 | #define sk_X509_REVOKED_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3305 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_REVOKED) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3306 | |
| 3307 | #define sk_X509_REVOKED_zero(sk) \ |
| 3308 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk)); |
| 3309 | |
| 3310 | #define sk_X509_REVOKED_value(sk, i) \ |
| 3311 | ((X509_REVOKED *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3312 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_REVOKED) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3313 | |
| 3314 | #define sk_X509_REVOKED_set(sk, i, p) \ |
| 3315 | ((X509_REVOKED *)sk_set( \ |
| 3316 | CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk), (i), \ |
| 3317 | CHECKED_CAST(void *, X509_REVOKED *, p))) |
| 3318 | |
| 3319 | #define sk_X509_REVOKED_free(sk) \ |
| 3320 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk)) |
| 3321 | |
| 3322 | #define sk_X509_REVOKED_pop_free(sk, free_func) \ |
| 3323 | sk_pop_free( \ |
| 3324 | CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk), \ |
| 3325 | CHECKED_CAST(void (*)(void *), void (*)(X509_REVOKED *), free_func)) |
| 3326 | |
| 3327 | #define sk_X509_REVOKED_insert(sk, p, where) \ |
| 3328 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk), \ |
| 3329 | CHECKED_CAST(void *, X509_REVOKED *, p), (where)) |
| 3330 | |
| 3331 | #define sk_X509_REVOKED_delete(sk, where) \ |
| 3332 | ((X509_REVOKED *)sk_delete( \ |
| 3333 | CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk), (where))) |
| 3334 | |
| 3335 | #define sk_X509_REVOKED_delete_ptr(sk, p) \ |
| 3336 | ((X509_REVOKED *)sk_delete_ptr( \ |
| 3337 | CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk), \ |
| 3338 | CHECKED_CAST(void *, X509_REVOKED *, p))) |
| 3339 | |
| 3340 | #define sk_X509_REVOKED_find(sk, out_index, p) \ |
| 3341 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk), (out_index), \ |
| 3342 | CHECKED_CAST(void *, X509_REVOKED *, p)) |
| 3343 | |
| 3344 | #define sk_X509_REVOKED_shift(sk) \ |
| 3345 | ((X509_REVOKED *)sk_shift( \ |
| 3346 | CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk))) |
| 3347 | |
| 3348 | #define sk_X509_REVOKED_push(sk, p) \ |
| 3349 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk), \ |
| 3350 | CHECKED_CAST(void *, X509_REVOKED *, p)) |
| 3351 | |
| 3352 | #define sk_X509_REVOKED_pop(sk) \ |
| 3353 | ((X509_REVOKED *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk))) |
| 3354 | |
| 3355 | #define sk_X509_REVOKED_dup(sk) \ |
| 3356 | ((STACK_OF(X509_REVOKED) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3357 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_REVOKED) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3358 | |
| 3359 | #define sk_X509_REVOKED_sort(sk) \ |
| 3360 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk)) |
| 3361 | |
| 3362 | #define sk_X509_REVOKED_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3363 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(X509_REVOKED) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3364 | |
| 3365 | #define sk_X509_REVOKED_set_cmp_func(sk, comp) \ |
| 3366 | ((int (*)(const X509_REVOKED **a, const X509_REVOKED **b))sk_set_cmp_func( \ |
| 3367 | CHECKED_CAST(_STACK *, STACK_OF(X509_REVOKED) *, sk), \ |
| 3368 | CHECKED_CAST(stack_cmp_func, \ |
| 3369 | int (*)(const X509_REVOKED **a, const X509_REVOKED **b), \ |
| 3370 | comp))) |
| 3371 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 3372 | #define sk_X509_REVOKED_deep_copy(sk, copy_func, free_func) \ |
| 3373 | ((STACK_OF(X509_REVOKED) *)sk_deep_copy( \ |
| 3374 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_REVOKED) *, sk), \ |
| 3375 | CHECKED_CAST(void *(*)(void *), X509_REVOKED *(*)(X509_REVOKED *), \ |
| 3376 | copy_func), \ |
| 3377 | CHECKED_CAST(void (*)(void *), void (*)(X509_REVOKED *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3378 | |
| 3379 | /* X509_TRUST */ |
| 3380 | #define sk_X509_TRUST_new(comp) \ |
| 3381 | ((STACK_OF(X509_TRUST) *)sk_new(CHECKED_CAST( \ |
| 3382 | stack_cmp_func, int (*)(const X509_TRUST **a, const X509_TRUST **b), \ |
| 3383 | comp))) |
| 3384 | |
| 3385 | #define sk_X509_TRUST_new_null() ((STACK_OF(X509_TRUST) *)sk_new_null()) |
| 3386 | |
| 3387 | #define sk_X509_TRUST_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3388 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_TRUST) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3389 | |
| 3390 | #define sk_X509_TRUST_zero(sk) \ |
| 3391 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk)); |
| 3392 | |
| 3393 | #define sk_X509_TRUST_value(sk, i) \ |
| 3394 | ((X509_TRUST *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3395 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_TRUST) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3396 | |
| 3397 | #define sk_X509_TRUST_set(sk, i, p) \ |
| 3398 | ((X509_TRUST *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk), \ |
| 3399 | (i), CHECKED_CAST(void *, X509_TRUST *, p))) |
| 3400 | |
| 3401 | #define sk_X509_TRUST_free(sk) \ |
| 3402 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk)) |
| 3403 | |
| 3404 | #define sk_X509_TRUST_pop_free(sk, free_func) \ |
| 3405 | sk_pop_free( \ |
| 3406 | CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk), \ |
| 3407 | CHECKED_CAST(void (*)(void *), void (*)(X509_TRUST *), free_func)) |
| 3408 | |
| 3409 | #define sk_X509_TRUST_insert(sk, p, where) \ |
| 3410 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk), \ |
| 3411 | CHECKED_CAST(void *, X509_TRUST *, p), (where)) |
| 3412 | |
| 3413 | #define sk_X509_TRUST_delete(sk, where) \ |
| 3414 | ((X509_TRUST *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk), \ |
| 3415 | (where))) |
| 3416 | |
| 3417 | #define sk_X509_TRUST_delete_ptr(sk, p) \ |
| 3418 | ((X509_TRUST *)sk_delete_ptr( \ |
| 3419 | CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk), \ |
| 3420 | CHECKED_CAST(void *, X509_TRUST *, p))) |
| 3421 | |
| 3422 | #define sk_X509_TRUST_find(sk, out_index, p) \ |
| 3423 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk), (out_index), \ |
| 3424 | CHECKED_CAST(void *, X509_TRUST *, p)) |
| 3425 | |
| 3426 | #define sk_X509_TRUST_shift(sk) \ |
| 3427 | ((X509_TRUST *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk))) |
| 3428 | |
| 3429 | #define sk_X509_TRUST_push(sk, p) \ |
| 3430 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk), \ |
| 3431 | CHECKED_CAST(void *, X509_TRUST *, p)) |
| 3432 | |
| 3433 | #define sk_X509_TRUST_pop(sk) \ |
| 3434 | ((X509_TRUST *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk))) |
| 3435 | |
| 3436 | #define sk_X509_TRUST_dup(sk) \ |
| 3437 | ((STACK_OF(X509_TRUST) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3438 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_TRUST) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3439 | |
| 3440 | #define sk_X509_TRUST_sort(sk) \ |
| 3441 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk)) |
| 3442 | |
| 3443 | #define sk_X509_TRUST_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3444 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(X509_TRUST) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3445 | |
| 3446 | #define sk_X509_TRUST_set_cmp_func(sk, comp) \ |
| 3447 | ((int (*)(const X509_TRUST **a, const X509_TRUST **b))sk_set_cmp_func( \ |
| 3448 | CHECKED_CAST(_STACK *, STACK_OF(X509_TRUST) *, sk), \ |
| 3449 | CHECKED_CAST(stack_cmp_func, \ |
| 3450 | int (*)(const X509_TRUST **a, const X509_TRUST **b), \ |
| 3451 | comp))) |
| 3452 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 3453 | #define sk_X509_TRUST_deep_copy(sk, copy_func, free_func) \ |
| 3454 | ((STACK_OF(X509_TRUST) *)sk_deep_copy( \ |
| 3455 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_TRUST) *, sk), \ |
| 3456 | CHECKED_CAST(void *(*)(void *), X509_TRUST *(*)(X509_TRUST *), \ |
| 3457 | copy_func), \ |
| 3458 | CHECKED_CAST(void (*)(void *), void (*)(X509_TRUST *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3459 | |
| 3460 | /* X509_VERIFY_PARAM */ |
| 3461 | #define sk_X509_VERIFY_PARAM_new(comp) \ |
| 3462 | ((STACK_OF(X509_VERIFY_PARAM) *)sk_new(CHECKED_CAST( \ |
| 3463 | stack_cmp_func, \ |
| 3464 | int (*)(const X509_VERIFY_PARAM **a, const X509_VERIFY_PARAM **b), \ |
| 3465 | comp))) |
| 3466 | |
| 3467 | #define sk_X509_VERIFY_PARAM_new_null() \ |
| 3468 | ((STACK_OF(X509_VERIFY_PARAM) *)sk_new_null()) |
| 3469 | |
| 3470 | #define sk_X509_VERIFY_PARAM_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3471 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(X509_VERIFY_PARAM) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3472 | |
| 3473 | #define sk_X509_VERIFY_PARAM_zero(sk) \ |
| 3474 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk)); |
| 3475 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3476 | #define sk_X509_VERIFY_PARAM_value(sk, i) \ |
| 3477 | ((X509_VERIFY_PARAM *)sk_value( \ |
| 3478 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_VERIFY_PARAM) *, sk), \ |
| 3479 | (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3480 | |
| 3481 | #define sk_X509_VERIFY_PARAM_set(sk, i, p) \ |
| 3482 | ((X509_VERIFY_PARAM *)sk_set( \ |
| 3483 | CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk), (i), \ |
| 3484 | CHECKED_CAST(void *, X509_VERIFY_PARAM *, p))) |
| 3485 | |
| 3486 | #define sk_X509_VERIFY_PARAM_free(sk) \ |
| 3487 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk)) |
| 3488 | |
| 3489 | #define sk_X509_VERIFY_PARAM_pop_free(sk, free_func) \ |
| 3490 | sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk), \ |
| 3491 | CHECKED_CAST(void (*)(void *), void (*)(X509_VERIFY_PARAM *), \ |
| 3492 | free_func)) |
| 3493 | |
| 3494 | #define sk_X509_VERIFY_PARAM_insert(sk, p, where) \ |
| 3495 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk), \ |
| 3496 | CHECKED_CAST(void *, X509_VERIFY_PARAM *, p), (where)) |
| 3497 | |
| 3498 | #define sk_X509_VERIFY_PARAM_delete(sk, where) \ |
| 3499 | ((X509_VERIFY_PARAM *)sk_delete( \ |
| 3500 | CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk), (where))) |
| 3501 | |
| 3502 | #define sk_X509_VERIFY_PARAM_delete_ptr(sk, p) \ |
| 3503 | ((X509_VERIFY_PARAM *)sk_delete_ptr( \ |
| 3504 | CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk), \ |
| 3505 | CHECKED_CAST(void *, X509_VERIFY_PARAM *, p))) |
| 3506 | |
| 3507 | #define sk_X509_VERIFY_PARAM_find(sk, out_index, p) \ |
| 3508 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk), \ |
| 3509 | (out_index), CHECKED_CAST(void *, X509_VERIFY_PARAM *, p)) |
| 3510 | |
| 3511 | #define sk_X509_VERIFY_PARAM_shift(sk) \ |
| 3512 | ((X509_VERIFY_PARAM *)sk_shift( \ |
| 3513 | CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk))) |
| 3514 | |
| 3515 | #define sk_X509_VERIFY_PARAM_push(sk, p) \ |
| 3516 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk), \ |
| 3517 | CHECKED_CAST(void *, X509_VERIFY_PARAM *, p)) |
| 3518 | |
| 3519 | #define sk_X509_VERIFY_PARAM_pop(sk) \ |
| 3520 | ((X509_VERIFY_PARAM *)sk_pop( \ |
| 3521 | CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk))) |
| 3522 | |
| 3523 | #define sk_X509_VERIFY_PARAM_dup(sk) \ |
| 3524 | ((STACK_OF(X509_VERIFY_PARAM) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3525 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_VERIFY_PARAM) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3526 | |
| 3527 | #define sk_X509_VERIFY_PARAM_sort(sk) \ |
| 3528 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk)) |
| 3529 | |
| 3530 | #define sk_X509_VERIFY_PARAM_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3531 | sk_is_sorted( \ |
| 3532 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_VERIFY_PARAM) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3533 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 3534 | #define sk_X509_VERIFY_PARAM_set_cmp_func(sk, comp) \ |
| 3535 | ((int (*)(const X509_VERIFY_PARAM **a, const X509_VERIFY_PARAM **b)) \ |
| 3536 | sk_set_cmp_func( \ |
| 3537 | CHECKED_CAST(_STACK *, STACK_OF(X509_VERIFY_PARAM) *, sk), \ |
| 3538 | CHECKED_CAST(stack_cmp_func, int (*)(const X509_VERIFY_PARAM **a, \ |
| 3539 | const X509_VERIFY_PARAM **b), \ |
| 3540 | comp))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3541 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 3542 | #define sk_X509_VERIFY_PARAM_deep_copy(sk, copy_func, free_func) \ |
| 3543 | ((STACK_OF(X509_VERIFY_PARAM) *)sk_deep_copy( \ |
| 3544 | CHECKED_CAST(const _STACK *, const STACK_OF(X509_VERIFY_PARAM) *, sk), \ |
| 3545 | CHECKED_CAST(void *(*)(void *), \ |
| 3546 | X509_VERIFY_PARAM *(*)(X509_VERIFY_PARAM *), copy_func), \ |
| 3547 | CHECKED_CAST(void (*)(void *), void (*)(X509_VERIFY_PARAM *), \ |
| 3548 | free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3549 | |
| 3550 | /* void */ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3551 | #define sk_void_new(comp) \ |
| 3552 | ((STACK_OF(void) *)sk_new(CHECKED_CAST( \ |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3553 | stack_cmp_func, int (*)(const void **a, const void **b), comp))) |
| 3554 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3555 | #define sk_void_new_null() ((STACK_OF(void) *)sk_new_null()) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3556 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3557 | #define sk_void_num(sk) \ |
| 3558 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(void) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3559 | |
Kenny Root | b849459 | 2015-09-25 02:29:14 +0000 | [diff] [blame] | 3560 | #define sk_void_zero(sk) sk_zero(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk)); |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3561 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3562 | #define sk_void_value(sk, i) \ |
| 3563 | ((void *)sk_value(CHECKED_CAST(const _STACK *, const STACK_OF(void) *, sk), \ |
| 3564 | (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3565 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3566 | #define sk_void_set(sk, i, p) \ |
| 3567 | ((void *)sk_set(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk), (i), \ |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3568 | CHECKED_CAST(void *, void *, p))) |
| 3569 | |
Kenny Root | b849459 | 2015-09-25 02:29:14 +0000 | [diff] [blame] | 3570 | #define sk_void_free(sk) sk_free(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3571 | |
Kenny Root | b849459 | 2015-09-25 02:29:14 +0000 | [diff] [blame] | 3572 | #define sk_void_pop_free(sk, free_func) \ |
| 3573 | sk_pop_free(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk), \ |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3574 | CHECKED_CAST(void (*)(void *), void (*)(void *), free_func)) |
| 3575 | |
Kenny Root | b849459 | 2015-09-25 02:29:14 +0000 | [diff] [blame] | 3576 | #define sk_void_insert(sk, p, where) \ |
| 3577 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk), \ |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3578 | CHECKED_CAST(void *, void *, p), (where)) |
| 3579 | |
| 3580 | #define sk_void_delete(sk, where) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3581 | ((void *)sk_delete(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk), (where))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3582 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3583 | #define sk_void_delete_ptr(sk, p) \ |
| 3584 | ((void *)sk_delete_ptr(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk), \ |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3585 | CHECKED_CAST(void *, void *, p))) |
| 3586 | |
Kenny Root | b849459 | 2015-09-25 02:29:14 +0000 | [diff] [blame] | 3587 | #define sk_void_find(sk, out_index, p) \ |
| 3588 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk), (out_index), \ |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3589 | CHECKED_CAST(void *, void *, p)) |
| 3590 | |
| 3591 | #define sk_void_shift(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3592 | ((void *)sk_shift(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3593 | |
Kenny Root | b849459 | 2015-09-25 02:29:14 +0000 | [diff] [blame] | 3594 | #define sk_void_push(sk, p) \ |
| 3595 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk), \ |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3596 | CHECKED_CAST(void *, void *, p)) |
| 3597 | |
| 3598 | #define sk_void_pop(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3599 | ((void *)sk_pop(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3600 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3601 | #define sk_void_dup(sk) \ |
| 3602 | ((STACK_OF(void) *)sk_dup( \ |
| 3603 | CHECKED_CAST(const _STACK *, const STACK_OF(void) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3604 | |
Kenny Root | b849459 | 2015-09-25 02:29:14 +0000 | [diff] [blame] | 3605 | #define sk_void_sort(sk) sk_sort(CHECKED_CAST(_STACK *, STACK_OF(void) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3606 | |
| 3607 | #define sk_void_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3608 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(void) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3609 | |
| 3610 | #define sk_void_set_cmp_func(sk, comp) \ |
| 3611 | ((int (*)(const void **a, const void **b))sk_set_cmp_func( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3612 | CHECKED_CAST(_STACK *, STACK_OF(void) *, sk), \ |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3613 | CHECKED_CAST(stack_cmp_func, int (*)(const void **a, const void **b), \ |
| 3614 | comp))) |
| 3615 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 3616 | #define sk_void_deep_copy(sk, copy_func, free_func) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3617 | ((STACK_OF(void) *)sk_deep_copy( \ |
Kenny Root | b849459 | 2015-09-25 02:29:14 +0000 | [diff] [blame] | 3618 | CHECKED_CAST(const _STACK *, const STACK_OF(void) *, sk), \ |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 3619 | CHECKED_CAST(void *(*)(void *), void *(*)(void *), copy_func), \ |
| 3620 | CHECKED_CAST(void (*)(void *), void (*)(void *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3621 | |
| 3622 | /* SRTP_PROTECTION_PROFILE */ |
| 3623 | #define sk_SRTP_PROTECTION_PROFILE_new(comp) \ |
| 3624 | ((STACK_OF(SRTP_PROTECTION_PROFILE) *)sk_new(CHECKED_CAST( \ |
| 3625 | stack_cmp_func, int (*)(const const SRTP_PROTECTION_PROFILE **a, \ |
| 3626 | const const SRTP_PROTECTION_PROFILE **b), \ |
| 3627 | comp))) |
| 3628 | |
| 3629 | #define sk_SRTP_PROTECTION_PROFILE_new_null() \ |
| 3630 | ((STACK_OF(SRTP_PROTECTION_PROFILE) *)sk_new_null()) |
| 3631 | |
| 3632 | #define sk_SRTP_PROTECTION_PROFILE_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3633 | sk_num(CHECKED_CAST(const _STACK *, \ |
| 3634 | const STACK_OF(SRTP_PROTECTION_PROFILE) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3635 | |
| 3636 | #define sk_SRTP_PROTECTION_PROFILE_zero(sk) \ |
| 3637 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk)); |
| 3638 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3639 | #define sk_SRTP_PROTECTION_PROFILE_value(sk, i) \ |
| 3640 | ((const SRTP_PROTECTION_PROFILE *)sk_value( \ |
| 3641 | CHECKED_CAST(const _STACK *, const STACK_OF(SRTP_PROTECTION_PROFILE) *, \ |
| 3642 | sk), \ |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3643 | (i))) |
| 3644 | |
| 3645 | #define sk_SRTP_PROTECTION_PROFILE_set(sk, i, p) \ |
| 3646 | ((const SRTP_PROTECTION_PROFILE *)sk_set( \ |
| 3647 | CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk), (i), \ |
| 3648 | CHECKED_CAST(void *, const SRTP_PROTECTION_PROFILE *, p))) |
| 3649 | |
| 3650 | #define sk_SRTP_PROTECTION_PROFILE_free(sk) \ |
| 3651 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk)) |
| 3652 | |
| 3653 | #define sk_SRTP_PROTECTION_PROFILE_pop_free(sk, free_func) \ |
| 3654 | sk_pop_free( \ |
| 3655 | CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk), \ |
| 3656 | CHECKED_CAST(void (*)(void *), \ |
| 3657 | void (*)(const SRTP_PROTECTION_PROFILE *), free_func)) |
| 3658 | |
| 3659 | #define sk_SRTP_PROTECTION_PROFILE_insert(sk, p, where) \ |
| 3660 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk), \ |
| 3661 | CHECKED_CAST(void *, const SRTP_PROTECTION_PROFILE *, p), (where)) |
| 3662 | |
| 3663 | #define sk_SRTP_PROTECTION_PROFILE_delete(sk, where) \ |
| 3664 | ((const SRTP_PROTECTION_PROFILE *)sk_delete( \ |
| 3665 | CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk), \ |
| 3666 | (where))) |
| 3667 | |
| 3668 | #define sk_SRTP_PROTECTION_PROFILE_delete_ptr(sk, p) \ |
| 3669 | ((const SRTP_PROTECTION_PROFILE *)sk_delete_ptr( \ |
| 3670 | CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk), \ |
| 3671 | CHECKED_CAST(void *, const SRTP_PROTECTION_PROFILE *, p))) |
| 3672 | |
| 3673 | #define sk_SRTP_PROTECTION_PROFILE_find(sk, out_index, p) \ |
| 3674 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk), \ |
| 3675 | (out_index), \ |
| 3676 | CHECKED_CAST(void *, const SRTP_PROTECTION_PROFILE *, p)) |
| 3677 | |
| 3678 | #define sk_SRTP_PROTECTION_PROFILE_shift(sk) \ |
| 3679 | ((const SRTP_PROTECTION_PROFILE *)sk_shift( \ |
| 3680 | CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk))) |
| 3681 | |
| 3682 | #define sk_SRTP_PROTECTION_PROFILE_push(sk, p) \ |
| 3683 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk), \ |
| 3684 | CHECKED_CAST(void *, const SRTP_PROTECTION_PROFILE *, p)) |
| 3685 | |
| 3686 | #define sk_SRTP_PROTECTION_PROFILE_pop(sk) \ |
| 3687 | ((const SRTP_PROTECTION_PROFILE *)sk_pop( \ |
| 3688 | CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk))) |
| 3689 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3690 | #define sk_SRTP_PROTECTION_PROFILE_dup(sk) \ |
| 3691 | ((STACK_OF(SRTP_PROTECTION_PROFILE) *)sk_dup(CHECKED_CAST( \ |
| 3692 | const _STACK *, const STACK_OF(SRTP_PROTECTION_PROFILE) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3693 | |
| 3694 | #define sk_SRTP_PROTECTION_PROFILE_sort(sk) \ |
| 3695 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk)) |
| 3696 | |
| 3697 | #define sk_SRTP_PROTECTION_PROFILE_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3698 | sk_is_sorted(CHECKED_CAST(const _STACK *, \ |
| 3699 | const STACK_OF(SRTP_PROTECTION_PROFILE) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3700 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 3701 | #define sk_SRTP_PROTECTION_PROFILE_set_cmp_func(sk, comp) \ |
| 3702 | ((int (*)(const SRTP_PROTECTION_PROFILE **a, \ |
| 3703 | const SRTP_PROTECTION_PROFILE **b)) \ |
| 3704 | sk_set_cmp_func( \ |
| 3705 | CHECKED_CAST(_STACK *, STACK_OF(SRTP_PROTECTION_PROFILE) *, sk), \ |
| 3706 | CHECKED_CAST(stack_cmp_func, \ |
| 3707 | int (*)(const SRTP_PROTECTION_PROFILE **a, \ |
| 3708 | const SRTP_PROTECTION_PROFILE **b), \ |
| 3709 | comp))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3710 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3711 | #define sk_SRTP_PROTECTION_PROFILE_deep_copy(sk, copy_func, free_func) \ |
| 3712 | ((STACK_OF(SRTP_PROTECTION_PROFILE) *)sk_deep_copy( \ |
| 3713 | CHECKED_CAST(const _STACK *, const STACK_OF(SRTP_PROTECTION_PROFILE) *, \ |
| 3714 | sk), \ |
| 3715 | CHECKED_CAST( \ |
| 3716 | void *(*)(void *), \ |
| 3717 | const SRTP_PROTECTION_PROFILE *(*)(const SRTP_PROTECTION_PROFILE *), \ |
| 3718 | copy_func), \ |
| 3719 | CHECKED_CAST(void (*)(void *), \ |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 3720 | void (*)(const SRTP_PROTECTION_PROFILE *), free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3721 | |
| 3722 | /* SSL_CIPHER */ |
| 3723 | #define sk_SSL_CIPHER_new(comp) \ |
| 3724 | ((STACK_OF(SSL_CIPHER) *)sk_new(CHECKED_CAST( \ |
| 3725 | stack_cmp_func, \ |
| 3726 | int (*)(const const SSL_CIPHER **a, const const SSL_CIPHER **b), comp))) |
| 3727 | |
| 3728 | #define sk_SSL_CIPHER_new_null() ((STACK_OF(SSL_CIPHER) *)sk_new_null()) |
| 3729 | |
| 3730 | #define sk_SSL_CIPHER_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3731 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(SSL_CIPHER) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3732 | |
| 3733 | #define sk_SSL_CIPHER_zero(sk) \ |
| 3734 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk)); |
| 3735 | |
| 3736 | #define sk_SSL_CIPHER_value(sk, i) \ |
| 3737 | ((const SSL_CIPHER *)sk_value( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3738 | CHECKED_CAST(const _STACK *, const STACK_OF(SSL_CIPHER) *, sk), (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3739 | |
| 3740 | #define sk_SSL_CIPHER_set(sk, i, p) \ |
| 3741 | ((const SSL_CIPHER *)sk_set( \ |
| 3742 | CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk), (i), \ |
| 3743 | CHECKED_CAST(void *, const SSL_CIPHER *, p))) |
| 3744 | |
| 3745 | #define sk_SSL_CIPHER_free(sk) \ |
| 3746 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk)) |
| 3747 | |
| 3748 | #define sk_SSL_CIPHER_pop_free(sk, free_func) \ |
| 3749 | sk_pop_free( \ |
| 3750 | CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk), \ |
| 3751 | CHECKED_CAST(void (*)(void *), void (*)(const SSL_CIPHER *), free_func)) |
| 3752 | |
| 3753 | #define sk_SSL_CIPHER_insert(sk, p, where) \ |
| 3754 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk), \ |
| 3755 | CHECKED_CAST(void *, const SSL_CIPHER *, p), (where)) |
| 3756 | |
| 3757 | #define sk_SSL_CIPHER_delete(sk, where) \ |
| 3758 | ((const SSL_CIPHER *)sk_delete( \ |
| 3759 | CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk), (where))) |
| 3760 | |
| 3761 | #define sk_SSL_CIPHER_delete_ptr(sk, p) \ |
| 3762 | ((const SSL_CIPHER *)sk_delete_ptr( \ |
| 3763 | CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk), \ |
| 3764 | CHECKED_CAST(void *, const SSL_CIPHER *, p))) |
| 3765 | |
| 3766 | #define sk_SSL_CIPHER_find(sk, out_index, p) \ |
| 3767 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk), (out_index), \ |
| 3768 | CHECKED_CAST(void *, const SSL_CIPHER *, p)) |
| 3769 | |
| 3770 | #define sk_SSL_CIPHER_shift(sk) \ |
| 3771 | ((const SSL_CIPHER *)sk_shift( \ |
| 3772 | CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk))) |
| 3773 | |
| 3774 | #define sk_SSL_CIPHER_push(sk, p) \ |
| 3775 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk), \ |
| 3776 | CHECKED_CAST(void *, const SSL_CIPHER *, p)) |
| 3777 | |
| 3778 | #define sk_SSL_CIPHER_pop(sk) \ |
| 3779 | ((const SSL_CIPHER *)sk_pop( \ |
| 3780 | CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk))) |
| 3781 | |
| 3782 | #define sk_SSL_CIPHER_dup(sk) \ |
| 3783 | ((STACK_OF(SSL_CIPHER) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3784 | CHECKED_CAST(const _STACK *, const STACK_OF(SSL_CIPHER) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3785 | |
| 3786 | #define sk_SSL_CIPHER_sort(sk) \ |
| 3787 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk)) |
| 3788 | |
| 3789 | #define sk_SSL_CIPHER_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3790 | sk_is_sorted(CHECKED_CAST(const _STACK *, const STACK_OF(SSL_CIPHER) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3791 | |
| 3792 | #define sk_SSL_CIPHER_set_cmp_func(sk, comp) \ |
| 3793 | ((int (*)(const SSL_CIPHER **a, const SSL_CIPHER **b))sk_set_cmp_func( \ |
| 3794 | CHECKED_CAST(_STACK *, STACK_OF(SSL_CIPHER) *, sk), \ |
| 3795 | CHECKED_CAST(stack_cmp_func, \ |
| 3796 | int (*)(const SSL_CIPHER **a, const SSL_CIPHER **b), \ |
| 3797 | comp))) |
| 3798 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 3799 | #define sk_SSL_CIPHER_deep_copy(sk, copy_func, free_func) \ |
| 3800 | ((STACK_OF(SSL_CIPHER) *)sk_deep_copy( \ |
| 3801 | CHECKED_CAST(const _STACK *, const STACK_OF(SSL_CIPHER) *, sk), \ |
| 3802 | CHECKED_CAST(void *(*)(void *), \ |
| 3803 | const SSL_CIPHER *(*)(const SSL_CIPHER *), copy_func), \ |
| 3804 | CHECKED_CAST(void (*)(void *), void (*)(const SSL_CIPHER *), \ |
| 3805 | free_func))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3806 | |
| 3807 | /* OPENSSL_STRING */ |
| 3808 | #define sk_OPENSSL_STRING_new(comp) \ |
| 3809 | ((STACK_OF(OPENSSL_STRING) *)sk_new(CHECKED_CAST( \ |
| 3810 | stack_cmp_func, \ |
| 3811 | int (*)(const OPENSSL_STRING *a, const OPENSSL_STRING *b), comp))) |
| 3812 | |
| 3813 | #define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)sk_new_null()) |
| 3814 | |
| 3815 | #define sk_OPENSSL_STRING_num(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3816 | sk_num(CHECKED_CAST(const _STACK *, const STACK_OF(OPENSSL_STRING) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3817 | |
| 3818 | #define sk_OPENSSL_STRING_zero(sk) \ |
| 3819 | sk_zero(CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk)); |
| 3820 | |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3821 | #define sk_OPENSSL_STRING_value(sk, i) \ |
| 3822 | ((OPENSSL_STRING)sk_value( \ |
| 3823 | CHECKED_CAST(const _STACK *, const STACK_OF(OPENSSL_STRING) *, sk), \ |
| 3824 | (i))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3825 | |
| 3826 | #define sk_OPENSSL_STRING_set(sk, i, p) \ |
| 3827 | ((OPENSSL_STRING)sk_set( \ |
| 3828 | CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk), (i), \ |
| 3829 | CHECKED_CAST(void *, OPENSSL_STRING, p))) |
| 3830 | |
| 3831 | #define sk_OPENSSL_STRING_free(sk) \ |
| 3832 | sk_free(CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk)) |
| 3833 | |
| 3834 | #define sk_OPENSSL_STRING_pop_free(sk, free_func) \ |
| 3835 | sk_pop_free( \ |
| 3836 | CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk), \ |
| 3837 | CHECKED_CAST(void (*)(void *), void (*)(OPENSSL_STRING), free_func)) |
| 3838 | |
| 3839 | #define sk_OPENSSL_STRING_insert(sk, p, where) \ |
| 3840 | sk_insert(CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk), \ |
| 3841 | CHECKED_CAST(void *, OPENSSL_STRING, p), (where)) |
| 3842 | |
| 3843 | #define sk_OPENSSL_STRING_delete(sk, where) \ |
| 3844 | ((OPENSSL_STRING)sk_delete( \ |
| 3845 | CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk), (where))) |
| 3846 | |
| 3847 | #define sk_OPENSSL_STRING_delete_ptr(sk, p) \ |
| 3848 | ((OPENSSL_STRING)sk_delete_ptr( \ |
| 3849 | CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk), \ |
| 3850 | CHECKED_CAST(void *, OPENSSL_STRING, p))) |
| 3851 | |
| 3852 | #define sk_OPENSSL_STRING_find(sk, out_index, p) \ |
| 3853 | sk_find(CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk), (out_index), \ |
| 3854 | CHECKED_CAST(void *, OPENSSL_STRING, p)) |
| 3855 | |
| 3856 | #define sk_OPENSSL_STRING_shift(sk) \ |
| 3857 | ((OPENSSL_STRING)sk_shift( \ |
| 3858 | CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk))) |
| 3859 | |
| 3860 | #define sk_OPENSSL_STRING_push(sk, p) \ |
| 3861 | sk_push(CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk), \ |
| 3862 | CHECKED_CAST(void *, OPENSSL_STRING, p)) |
| 3863 | |
| 3864 | #define sk_OPENSSL_STRING_pop(sk) \ |
| 3865 | ((OPENSSL_STRING)sk_pop( \ |
| 3866 | CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk))) |
| 3867 | |
| 3868 | #define sk_OPENSSL_STRING_dup(sk) \ |
| 3869 | ((STACK_OF(OPENSSL_STRING) *)sk_dup( \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3870 | CHECKED_CAST(const _STACK *, const STACK_OF(OPENSSL_STRING) *, sk))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3871 | |
| 3872 | #define sk_OPENSSL_STRING_sort(sk) \ |
| 3873 | sk_sort(CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk)) |
| 3874 | |
| 3875 | #define sk_OPENSSL_STRING_is_sorted(sk) \ |
David Benjamin | d316cba | 2016-06-02 16:17:39 -0400 | [diff] [blame] | 3876 | sk_is_sorted( \ |
| 3877 | CHECKED_CAST(const _STACK *, const STACK_OF(OPENSSL_STRING) *, sk)) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3878 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 3879 | #define sk_OPENSSL_STRING_set_cmp_func(sk, comp) \ |
| 3880 | ((int (*)(const OPENSSL_STRING **a, const OPENSSL_STRING **b)) \ |
| 3881 | sk_set_cmp_func( \ |
| 3882 | CHECKED_CAST(_STACK *, STACK_OF(OPENSSL_STRING) *, sk), \ |
| 3883 | CHECKED_CAST(stack_cmp_func, int (*)(const OPENSSL_STRING **a, \ |
| 3884 | const OPENSSL_STRING **b), \ |
| 3885 | comp))) |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 3886 | |
Adam Langley | e9ada86 | 2015-05-11 17:20:37 -0700 | [diff] [blame] | 3887 | #define sk_OPENSSL_STRING_deep_copy(sk, copy_func, free_func) \ |
| 3888 | ((STACK_OF(OPENSSL_STRING) *)sk_deep_copy( \ |
| 3889 | CHECKED_CAST(const _STACK *, const STACK_OF(OPENSSL_STRING) *, sk), \ |
| 3890 | CHECKED_CAST(void *(*)(void *), OPENSSL_STRING (*)(OPENSSL_STRING), \ |
| 3891 | copy_func), \ |
| 3892 | CHECKED_CAST(void (*)(void *), void (*)(OPENSSL_STRING), free_func))) |