types_macros.h (1312B)
1 #define COORD_INDEX(i) ((i)/2) 2 #define COORD_SHIFT(i) (UINT8_C(4) * (uint8_t)((i) % 2)) 3 #define COORD_MASK(i) (UINT8_C(0xF) << COORD_SHIFT(i)) 4 5 #define COORD_CLASS_SHIFT UINT32_C(16) 6 #define COORD_CLASS_MASK (UINT32_C(0xFFFF) << COORD_CLASS_SHIFT) 7 #define COORD_CLASS(d) (((d) & COORD_CLASS_MASK) >> COORD_CLASS_SHIFT) 8 9 #define COORD_TTREP_SHIFT UINT32_C(0) 10 #define COORD_TTREP_MASK (UINT32_C(0xFF) << COORD_TTREP_SHIFT) 11 #define COORD_TTREP(d) (((d) & COORD_TTREP_MASK) >> COORD_TTREP_SHIFT) 12 13 #define COORD_ISNASTY_SHIFT UINT32_C(8) 14 #define COORD_ISNASTY_MASK (UINT32_C(0xFF) << COORD_ISNASTY_SHIFT) 15 #define COORD_ISNASTY(d) (((d) & COORD_ISNASTY_MASK) >> COORD_ISNASTY_SHIFT) 16 17 typedef struct { 18 const char name[255]; 19 uint64_t (*coord)(cube_t, const void *); 20 cube_t (*cube)(uint64_t, const void *); 21 bool (*isnasty)(uint64_t, const void *); 22 size_t (*gendata)(void *); 23 uint64_t max; 24 uint32_t moves_mask; 25 uint64_t trans_mask; 26 uint8_t axistrans[3]; 27 bool (*is_admissible)(const solution_moves_t[static 1]); 28 bool (*is_solvable)(cube_t); 29 struct { 30 size_t classes; 31 uint64_t max; 32 uint64_t (*coord)(cube_t); 33 cube_t (*cube)(uint64_t); 34 uint64_t max2; 35 uint64_t (*coord2)(cube_t); 36 cube_t (*cube2)(uint64_t); 37 cube_t (*merge)(cube_t, cube_t); 38 } sym; 39 } coord_t;