Source file: /~heha/hs/gputils64-210929.zip/libgputils/gplist.h

/* Double linked list support
   Copyright 2016	Molnár Károly
*/

#pragma once

typedef void (*gp_node_del_t)(void *);

#define GPNodeHeader(Type) \
  Type         *prev;      \
  Type         *next;      \
  unsigned  list_id

#define GPListHeader(Type)  \
  Type          *first;     \
  Type          *curr;      \
  Type          *last;      \
  size_t         num_nodes; \
  gp_node_del_t  node_del;  \
  unsigned   serial_id

FUNC(void*) gp_list_node_new(size_t Item_size);
FUNC(void)  gp_list_node_free(void *List, void *Node);
FUNC(void*) gp_list_node_append(void *List, void *Node);
extern void *gp_list_node_insert_after(void *List, void *Node, void *Node_new);
extern void *gp_list_node_insert_before(void *List, void *Node, void *Node_new);
FUNC(void*) gp_list_node_remove(void *List, void *Node);
extern void *gp_list_node_move(void *Dst, void *Src, void *Node);
FUNC(void)  gp_list_node_delete(void *List, void *Node);

FUNC(void)  gp_list_set_delete_node_func(void *List, gp_node_del_t Function);
extern void **gp_list_make_block(void *List, size_t Num_nodes, size_t Item_size);
extern void gp_list_move(void *Dst, void *Src);
extern void *gp_list_clone_list(const void *List, int (_cdecl Cmp_func)(const void *, const void *));
extern void gp_list_reset(void *List);
extern void gp_list_set_access_point(void *List, void *Node);
extern void gp_list_clear(void *List);
FUNC(void)  gp_list_delete(void *List);
Detected encoding: UTF-80