Lines Matching refs:data
29 const void **data; member
65 ret->data = NULL; in OPENSSL_sk_dup()
71 ret->data = OPENSSL_malloc(sizeof(*ret->data) * sk->num_alloc); in OPENSSL_sk_dup()
72 if (ret->data == NULL) in OPENSSL_sk_dup()
74 memcpy(ret->data, sk->data, sizeof(void *) * sk->num); in OPENSSL_sk_dup()
103 ret->data = NULL; in OPENSSL_sk_deep_copy()
109 ret->data = OPENSSL_zalloc(sizeof(*ret->data) * ret->num_alloc); in OPENSSL_sk_deep_copy()
110 if (ret->data == NULL) in OPENSSL_sk_deep_copy()
114 if (sk->data[i] == NULL) in OPENSSL_sk_deep_copy()
116 if ((ret->data[i] = copy_func(sk->data[i])) == NULL) { in OPENSSL_sk_deep_copy()
118 if (ret->data[i] != NULL) in OPENSSL_sk_deep_copy()
119 free_func((void *)ret->data[i]); in OPENSSL_sk_deep_copy()
194 if (st->data == NULL) { in sk_reserve()
199 if ((st->data = OPENSSL_zalloc(sizeof(void *) * num_alloc)) == NULL) in sk_reserve()
217 tmpdata = OPENSSL_realloc((void *)st->data, sizeof(void *) * num_alloc); in sk_reserve()
221 st->data = tmpdata; in sk_reserve()
258 int OPENSSL_sk_insert(OPENSSL_STACK *st, const void *data, int loc) in OPENSSL_sk_insert() argument
273 st->data[st->num] = data; in OPENSSL_sk_insert()
275 memmove(&st->data[loc + 1], &st->data[loc], in OPENSSL_sk_insert()
276 sizeof(st->data[0]) * (st->num - loc)); in OPENSSL_sk_insert()
277 st->data[loc] = data; in OPENSSL_sk_insert()
286 const void *ret = st->data[loc]; in internal_delete()
289 memmove(&st->data[loc], &st->data[loc + 1], in internal_delete()
290 sizeof(st->data[0]) * (st->num - loc - 1)); in internal_delete()
304 if (st->data[i] == p) in OPENSSL_sk_delete_ptr()
317 static int internal_find(OPENSSL_STACK *st, const void *data, in internal_find() argument
332 if (st->data[i] == data) { in internal_find()
340 if (data == NULL) in internal_find()
347 if (st->comp(&data, st->data + i) == 0) { in internal_find()
362 r = ossl_bsearch(&data, st->data, st->num, sizeof(void *), st->comp, in internal_find()
370 while (p < st->data + st->num) { in internal_find()
371 if (st->comp(&data, p) != 0) in internal_find()
379 return r == NULL ? -1 : (int)((const void **)r - st->data); in internal_find()
382 int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data) in OPENSSL_sk_find() argument
384 return internal_find(st, data, OSSL_BSEARCH_FIRST_VALUE_ON_MATCH, NULL); in OPENSSL_sk_find()
387 int OPENSSL_sk_find_ex(OPENSSL_STACK *st, const void *data) in OPENSSL_sk_find_ex() argument
389 return internal_find(st, data, OSSL_BSEARCH_VALUE_ON_NOMATCH, NULL); in OPENSSL_sk_find_ex()
392 int OPENSSL_sk_find_all(OPENSSL_STACK *st, const void *data, int *pnum) in OPENSSL_sk_find_all() argument
394 return internal_find(st, data, OSSL_BSEARCH_FIRST_VALUE_ON_MATCH, pnum); in OPENSSL_sk_find_all()
397 int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data) in OPENSSL_sk_push() argument
401 return OPENSSL_sk_insert(st, data, st->num); in OPENSSL_sk_push()
404 int OPENSSL_sk_unshift(OPENSSL_STACK *st, const void *data) in OPENSSL_sk_unshift() argument
406 return OPENSSL_sk_insert(st, data, 0); in OPENSSL_sk_unshift()
427 memset(st->data, 0, sizeof(*st->data) * st->num); in OPENSSL_sk_zero()
438 if (st->data[i] != NULL) in OPENSSL_sk_pop_free()
439 func((char *)st->data[i]); in OPENSSL_sk_pop_free()
447 OPENSSL_free(st->data); in OPENSSL_sk_free()
460 return (void *)st->data[i]; in OPENSSL_sk_value()
463 void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data) in OPENSSL_sk_set() argument
474 st->data[i] = data; in OPENSSL_sk_set()
476 return (void *)st->data[i]; in OPENSSL_sk_set()
483 qsort(st->data, st->num, sizeof(void *), st->comp); in OPENSSL_sk_sort()