hex

hex.git
git clone git://git.lenczewski.org/hex.git
Log | Files | Refs

utils.c (1164B)


      1 #include "hexes.h"
      2 
      3 extern inline void
      4 dbglog(enum log_level, char const *, ...);
      5 
      6 extern inline void
      7 swap(void *restrict lhs, void *restrict rhs, size_t size);
      8 
      9 extern inline void
     10 shuffle(void *arr, size_t size, size_t len);
     11 
     12 extern inline void
     13 difftimespec(struct timespec *restrict lhs, struct timespec *restrict rhs, struct timespec *restrict out);
     14 
     15 extern inline void
     16 arena_reset(struct arena *arena);
     17 
     18 extern inline void *
     19 arena_alloc(struct arena *arena, size_t size, size_t align);
     20 
     21 extern inline list_node_relptr_t
     22 list_node_abs2rel(void const *restrict base, struct list_node *restrict absptr);
     23 
     24 extern inline struct list_node *
     25 list_node_rel2abs(void const *base, list_node_relptr_t relptr);
     26 
     27 extern inline void
     28 list_push_head(struct list *restrict list, struct list_node *restrict node);
     29 
     30 extern inline void
     31 list_push_tail(struct list *restrict list, struct list_node *restrict node);
     32 
     33 extern inline struct list_node *
     34 list_pop_head(struct list *list);
     35 
     36 extern inline struct list_node *
     37 list_pop_tail(struct list *list);
     38 
     39 extern inline enum hex_player
     40 hexopponent(enum hex_player player);
     41 
     42 extern inline char const *
     43 hexplayerstr(enum hex_player val);