diff options
Diffstat (limited to 'src/cubetypes.h')
| -rw-r--r-- | src/cubetypes.h | 64 |
1 files changed, 14 insertions, 50 deletions
diff --git a/src/cubetypes.h b/src/cubetypes.h index cf6b7d5..fa19f6c 100644 --- a/src/cubetypes.h +++ b/src/cubetypes.h | |||
| @@ -84,7 +84,7 @@ trans | |||
| 84 | typedef struct alg Alg; | 84 | typedef struct alg Alg; |
| 85 | typedef struct alglist AlgList; | 85 | typedef struct alglist AlgList; |
| 86 | typedef struct alglistnode AlgListNode; | 86 | typedef struct alglistnode AlgListNode; |
| 87 | typedef struct block Block; | 87 | typedef struct choicestep ChoiceStep; |
| 88 | typedef struct command Command; | 88 | typedef struct command Command; |
| 89 | typedef struct commandargs CommandArgs; | 89 | typedef struct commandargs CommandArgs; |
| 90 | typedef struct coordinate Coordinate; | 90 | typedef struct coordinate Coordinate; |
| @@ -97,13 +97,14 @@ typedef struct pdgendata PDGenData; | |||
| 97 | typedef struct prunedata PruneData; | 97 | typedef struct prunedata PruneData; |
| 98 | typedef struct solveoptions SolveOptions; | 98 | typedef struct solveoptions SolveOptions; |
| 99 | typedef struct step Step; | 99 | typedef struct step Step; |
| 100 | typedef struct stepalt StepAlt; | ||
| 101 | typedef struct symdata SymData; | 100 | typedef struct symdata SymData; |
| 102 | typedef struct threaddatasolve ThreadDataSolve; | 101 | typedef struct threaddatasolve ThreadDataSolve; |
| 103 | typedef struct threaddatagenpt ThreadDataGenpt; | 102 | typedef struct threaddatagenpt ThreadDataGenpt; |
| 104 | typedef struct transgroup TransGroup; | 103 | typedef struct transgroup TransGroup; |
| 105 | 104 | ||
| 106 | typedef bool (*Checker) (Cube *); | 105 | typedef bool (*Checker) (Cube *); |
| 106 | typedef bool (*DfsMover) (DfsArg *); | ||
| 107 | typedef void (*DfsExtraCopier) (void *, void *); | ||
| 107 | typedef bool (*Validator) (Alg *); | 108 | typedef bool (*Validator) (Alg *); |
| 108 | typedef void (*Exec) (CommandArgs *); | 109 | typedef void (*Exec) (CommandArgs *); |
| 109 | typedef CommandArgs * (*ArgParser) (int, char **); | 110 | typedef CommandArgs * (*ArgParser) (int, char **); |
| @@ -137,11 +138,13 @@ alglistnode | |||
| 137 | }; | 138 | }; |
| 138 | 139 | ||
| 139 | struct | 140 | struct |
| 140 | block | 141 | choicestep |
| 141 | { | 142 | { |
| 142 | bool edge[12]; | 143 | char * shortname; |
| 143 | bool corner[8]; | 144 | char * name; |
| 144 | bool center[6]; | 145 | Step * step[99]; |
| 146 | Trans t[99]; | ||
| 147 | char * ready_msg; | ||
| 145 | }; | 148 | }; |
| 146 | 149 | ||
| 147 | struct | 150 | struct |
| @@ -160,7 +163,7 @@ commandargs | |||
| 160 | bool success; | 163 | bool success; |
| 161 | Alg * scramble; | 164 | Alg * scramble; |
| 162 | SolveOptions * opts; | 165 | SolveOptions * opts; |
| 163 | Step * step; | 166 | ChoiceStep * cs; |
| 164 | Command * command; /* For help */ | 167 | Command * command; /* For help */ |
| 165 | int n; | 168 | int n; |
| 166 | char scrtype[20]; | 169 | char scrtype[20]; |
| @@ -210,7 +213,7 @@ dfsarg | |||
| 210 | Cube * cube; | 213 | Cube * cube; |
| 211 | Movable ind[MAX_N_COORD]; | 214 | Movable ind[MAX_N_COORD]; |
| 212 | Trans t; | 215 | Trans t; |
| 213 | StepAlt * sa; | 216 | Step * s; |
| 214 | SolveOptions * opts; | 217 | SolveOptions * opts; |
| 215 | int d; | 218 | int d; |
| 216 | int bound; | 219 | int bound; |
| @@ -220,6 +223,7 @@ dfsarg | |||
| 220 | AlgList * sols; | 223 | AlgList * sols; |
| 221 | pthread_mutex_t * sols_mutex; | 224 | pthread_mutex_t * sols_mutex; |
| 222 | Alg * current_alg; | 225 | Alg * current_alg; |
| 226 | void * extra; | ||
| 223 | }; | 227 | }; |
| 224 | 228 | ||
| 225 | struct | 229 | struct |
| @@ -245,7 +249,6 @@ pdgendata | |||
| 245 | { | 249 | { |
| 246 | Coordinate * coord; | 250 | Coordinate * coord; |
| 247 | Moveset * moveset; | 251 | Moveset * moveset; |
| 248 | bool compact; | ||
| 249 | PruneData * pd; | 252 | PruneData * pd; |
| 250 | }; | 253 | }; |
| 251 | 254 | ||
| @@ -256,10 +259,7 @@ prunedata | |||
| 256 | uint64_t n; | 259 | uint64_t n; |
| 257 | Coordinate * coord; | 260 | Coordinate * coord; |
| 258 | Moveset * moveset; | 261 | Moveset * moveset; |
| 259 | bool compact; | ||
| 260 | int base; | ||
| 261 | uint64_t count[16]; | 262 | uint64_t count[16]; |
| 262 | uint64_t fbmod; | ||
| 263 | }; | 263 | }; |
| 264 | 264 | ||
| 265 | struct | 265 | struct |
| @@ -280,54 +280,18 @@ solveoptions | |||
| 280 | struct | 280 | struct |
| 281 | step | 281 | step |
| 282 | { | 282 | { |
| 283 | char * shortname; | ||
| 284 | char * name; | ||
| 285 | StepAlt * alt[99]; | ||
| 286 | Trans t[99]; | ||
| 287 | char * ready_msg; | ||
| 288 | }; | ||
| 289 | |||
| 290 | struct | ||
| 291 | stepalt | ||
| 292 | { | ||
| 293 | Checker ready; | 283 | Checker ready; |
| 294 | bool final; | 284 | bool final; |
| 295 | Moveset * moveset; | 285 | Moveset * moveset; |
| 296 | /* Just a comment, (TODO: remove this): moveset is really a stepalt | ||
| 297 | * property, because for example we may want to define a "fingertrick | ||
| 298 | * friendly ZBLL" step, where we allow either <R U D> or <R U F> as | ||
| 299 | * movesets (or similar) */ | ||
| 300 | int n_coord; | 286 | int n_coord; |
| 301 | Coordinate * coord[MAX_N_COORD]; | 287 | Coordinate * coord[MAX_N_COORD]; |
| 302 | Trans coord_trans[MAX_N_COORD]; | 288 | Trans coord_trans[MAX_N_COORD]; |
| 303 | PruneData * pd[MAX_N_COORD]; | 289 | PruneData * pd[MAX_N_COORD]; |
| 304 | bool compact_pd[MAX_N_COORD]; | ||
| 305 | Coordinate * fallback_coord[MAX_N_COORD]; | ||
| 306 | PruneData * fallback_pd[MAX_N_COORD]; | ||
| 307 | uint64_t fbmod[MAX_N_COORD]; | ||
| 308 | int n_dbtrick; | ||
| 309 | int dbtrick[MAX_N_COORD][3]; | ||
| 310 | Validator is_valid; | 290 | Validator is_valid; |
| 291 | DfsMover custom_move_checkstop; | ||
| 292 | DfsExtraCopier copy_extra; | ||
| 311 | }; | 293 | }; |
| 312 | 294 | ||
| 313 | /* | ||
| 314 | struct | ||
| 315 | symdata | ||
| 316 | { | ||
| 317 | char * filename; | ||
| 318 | bool generated; | ||
| 319 | Coordinate * coord; | ||
| 320 | Coordinate * sym_coord; | ||
| 321 | int ntrans; | ||
| 322 | Trans * trans; | ||
| 323 | uint64_t * class; | ||
| 324 | uint64_t * unsym; | ||
| 325 | Trans * transtorep; | ||
| 326 | uint64_t * selfsim; | ||
| 327 | }; | ||
| 328 | */ | ||
| 329 | |||
| 330 | |||
| 331 | struct | 295 | struct |
| 332 | threaddatasolve | 296 | threaddatasolve |
| 333 | { | 297 | { |
