2022-02-10 23:07:11 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
* Copyright 2001-2002 NaN Holding BV. All rights reserved. */
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2019-02-17 22:08:12 +01:00
|
|
|
/** \file
|
|
|
|
* \ingroup DNA
|
2019-03-02 15:05:58 +01:00
|
|
|
* \brief These structs are the foundation for all linked lists in the library system.
|
2013-02-22 15:12:55 +01:00
|
|
|
*
|
|
|
|
* Doubly-linked lists start from a ListBase and contain elements beginning
|
|
|
|
* with Link.
|
2011-02-17 21:48:12 +01:00
|
|
|
*/
|
|
|
|
|
2012-02-17 19:59:41 +01:00
|
|
|
#pragma once
|
2011-12-30 08:25:49 +01:00
|
|
|
|
2002-10-12 13:37:38 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2019-03-02 15:05:58 +01:00
|
|
|
/** Generic - all structs which are put into linked lists begin with this. */
|
2012-06-07 00:38:39 +02:00
|
|
|
typedef struct Link {
|
2012-04-29 17:47:02 +02:00
|
|
|
struct Link *next, *prev;
|
2002-10-12 13:37:38 +02:00
|
|
|
} Link;
|
|
|
|
|
2019-03-02 15:05:58 +01:00
|
|
|
/** Simple subclass of Link. Use this when it is not worth defining a custom one. */
|
2012-06-07 00:38:39 +02:00
|
|
|
typedef struct LinkData {
|
2007-12-13 03:08:47 +01:00
|
|
|
struct LinkData *next, *prev;
|
|
|
|
void *data;
|
|
|
|
} LinkData;
|
|
|
|
|
2019-03-02 15:05:58 +01:00
|
|
|
/** Never change the size of this! dna_genfile.c detects pointer_size with it. */
|
2012-06-07 00:38:39 +02:00
|
|
|
typedef struct ListBase {
|
2002-10-12 13:37:38 +02:00
|
|
|
void *first, *last;
|
|
|
|
} ListBase;
|
|
|
|
|
|
|
|
/* 8 byte alignment! */
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|