Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: f5eac259a03c68c96c77f9b998b1b9c16a8439e7
      
https://github.com/openssl/openssl/commit/f5eac259a03c68c96c77f9b998b1b9c16a8439e7
  Author: Pauli <pa...@openssl.org>
  Date:   2022-09-05 (Mon, 05 Sep 2022)

  Changed paths:
    A doc/internal/man3/DEFINE_LIST_OF.pod
    A include/internal/list.h
    M test/build.info
    A test/list_test.c
    A test/recipes/02-test_list.t

  Log Message:
  -----------
  list: add a doubly linked list type.

These list can be embedded into structures and structures can be members of
multiple lists.  Moreover, this is done without dynamic memory allocation.
That is, this is legal:

    typedef struct item_st ITEM;

    struct item_st {
        ...
        OSSL_LIST_MEMBER(new_items, ITEM);
        OSSL_LIST_MEMBER(failed_items, ITEM);
        ...
    };

    DEFINE_LIST_OF(new_items, TESTL);
    DEFINE_LIST_OF(failed_items, TESTL);

    struct {
        ...
        OSSL_LIST(new_items) new;
        OSSL_LIST(failed_items) failed;
        ...
    } *st;

    ITEM *p;

    for (p = ossl_list_new_items_head(&st->new); p != NULL;
         p = ossl_list_new_items_next(p))
        /* do something */

Reviewed-by: Shane Lontis <shane.lon...@oracle.com>
Reviewed-by: Richard Levitte <levi...@openssl.org>
Reviewed-by: Tomas Mraz <to...@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19115)


Reply via email to