29 lines
754 B
C
29 lines
754 B
C
|
/* This software is licensed by the MIT License, see LICENSE file */
|
||
|
/* Copyright © 2022 Gregory Lirent */
|
||
|
|
||
|
#include "../../include/extra/list.h"
|
||
|
#include "../__internal/vnode.h"
|
||
|
|
||
|
#ifndef LIBCDSB_SRC_LIST_INCLUDE_H
|
||
|
#define LIBCDSB_SRC_LIST_INCLUDE_H
|
||
|
|
||
|
typedef enum libcdsb_list_direction {
|
||
|
LD_PREV = 1,
|
||
|
LD_NEXT = 2
|
||
|
} ldir_t;
|
||
|
|
||
|
typedef struct libcdsb_list_node {
|
||
|
struct libcdsb_list_node* prev;
|
||
|
struct libcdsb_list_node* next;
|
||
|
|
||
|
vnode_t node;
|
||
|
vtype type;
|
||
|
} lnode_t;
|
||
|
|
||
|
#define ldir_dir(cur, d) (&((cur)->prev))[(d)>>1]
|
||
|
#define ldir_inv(cur, d) (&((cur)->prev))[(d)&1]
|
||
|
|
||
|
#define lnode_compare(s0, s1) vnode_compare((s0)->node, (s0)->type, (s1)->node, (s1)->type)
|
||
|
|
||
|
#endif /* LIBCDSB_SRC_LIST_INCLUDE_H */
|