diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/nissy.h | 186 |
1 files changed, 93 insertions, 93 deletions
diff --git a/src/nissy.h b/src/nissy.h index 42429d3..a6a0ac1 100644 --- a/src/nissy.h +++ b/src/nissy.h | |||
| @@ -40,6 +40,99 @@ for example 'rotation UF' or 'mirrored BL'. | |||
| 40 | #define NISSY_SOLVED_CUBE "ABCDEFGH=ABCDEFGHIJKL" | 40 | #define NISSY_SOLVED_CUBE "ABCDEFGH=ABCDEFGHIJKL" |
| 41 | 41 | ||
| 42 | 42 | ||
| 43 | /* Error codes ***************************************************************/ | ||
| 44 | |||
| 45 | /* | ||
| 46 | The value NISSY_OK denotes a success. If returned by solve, it means | ||
| 47 | that no solution has been found. | ||
| 48 | */ | ||
| 49 | #define NISSY_OK 0LL | ||
| 50 | |||
| 51 | /* | ||
| 52 | The value NISSY_WARNING_UNSOLVABLE is a warning. It means that the | ||
| 53 | operation was completed succesfully, but the resulting cube is in an | ||
| 54 | unsolvable state. This could be intended, for example if the user has | ||
| 55 | provided an unsolvable cube as input. | ||
| 56 | */ | ||
| 57 | #define NISSY_WARNING_UNSOLVABLE -1LL | ||
| 58 | |||
| 59 | /* | ||
| 60 | The value NISSY_ERROR_INVALID_CUBE means that the provided cube is | ||
| 61 | invalid. It could be written in an unknown format, or in a format | ||
| 62 | different from what specified, or simply ill-formed. | ||
| 63 | */ | ||
| 64 | #define NISSY_ERROR_INVALID_CUBE -10LL | ||
| 65 | |||
| 66 | /* | ||
| 67 | The value NISSY_ERROR_UNSOLVABLE_CUBE means that the provided cube is in | ||
| 68 | an unsolvable state for the given solver. This could mean either that the | ||
| 69 | cube is not solvable at all (for example in case it has a single twisted | ||
| 70 | corner), or that it is not ready for the given step (for example if the | ||
| 71 | caller wants to solve a DR finish without the cube being in DR state). | ||
| 72 | */ | ||
| 73 | #define NISSY_ERROR_UNSOLVABLE_CUBE -11LL | ||
| 74 | |||
| 75 | /* | ||
| 76 | The value NISSY_ERROR_INVALID_MOVES means that the given moves are | ||
| 77 | invalid. | ||
| 78 | */ | ||
| 79 | #define NISSY_ERROR_INVALID_MOVES -20LL | ||
| 80 | |||
| 81 | /* | ||
| 82 | The value NISSY_ERROR_INVALID_TRANS means that the given transformation | ||
| 83 | is invalid. | ||
| 84 | */ | ||
| 85 | #define NISSY_ERROR_INVALID_TRANS -30LL | ||
| 86 | |||
| 87 | /* | ||
| 88 | The value NISSY_ERROR_INVALID_FORMAT means that the given format is | ||
| 89 | not known. | ||
| 90 | */ | ||
| 91 | #define NISSY_ERROR_INVALID_FORMAT -40LL | ||
| 92 | |||
| 93 | /* | ||
| 94 | The value NISSY_ERROR_INVALID_SOLVER means that the given solver is | ||
| 95 | not known. | ||
| 96 | */ | ||
| 97 | #define NISSY_ERROR_INVALID_SOLVER -50LL | ||
| 98 | |||
| 99 | /* | ||
| 100 | The value NISSY_ERROR_NULL_POINTER means that one of the provided pointer | ||
| 101 | arguments is NULL. For example, it may be returned by solve when called | ||
| 102 | with a solver that requires some pre-computed data, but the provided | ||
| 103 | data is NULL. | ||
| 104 | */ | ||
| 105 | #define NISSY_ERROR_NULL_POINTER -60LL | ||
| 106 | |||
| 107 | /* | ||
| 108 | The value NISSY_ERROR_BUFFER_SIZE means that one of the buffers provided | ||
| 109 | is too small. For example, it could be too small to hold the result or | ||
| 110 | too small to hold the data generated by gendata. | ||
| 111 | */ | ||
| 112 | #define NISSY_ERROR_BUFFER_SIZE -61LL | ||
| 113 | |||
| 114 | /* | ||
| 115 | The value NISSY_ERROR_DATA means that the provided data is invalid. For | ||
| 116 | example, it may be returned by solve when called with incompatible solver | ||
| 117 | and data arguments. | ||
| 118 | */ | ||
| 119 | #define NISSY_ERROR_DATA -70LL | ||
| 120 | |||
| 121 | /* | ||
| 122 | The value NISSY_ERROR_OPTIONS means that one or more of the given options | ||
| 123 | are invalid. For example, it may be returned by solve when called with | ||
| 124 | a negative maximum number of solutions. | ||
| 125 | */ | ||
| 126 | #define NISSY_ERROR_OPTIONS -80LL | ||
| 127 | |||
| 128 | /* | ||
| 129 | The value NISSY_ERROR_UNKNOWN denotes an unexpected error. It probably | ||
| 130 | means that there some bug in this library. If you can, report any error | ||
| 131 | of this kind to sebastiano@tronto.net. Thanks! | ||
| 132 | */ | ||
| 133 | #define NISSY_ERROR_UNKNOWN -999LL | ||
| 134 | |||
| 135 | |||
| 43 | /* Library functions *********************************************************/ | 136 | /* Library functions *********************************************************/ |
| 44 | 137 | ||
| 45 | /* | 138 | /* |
| @@ -338,96 +431,3 @@ long long | |||
| 338 | nissy_setlogger( | 431 | nissy_setlogger( |
| 339 | void (*logger_function)(const char *) | 432 | void (*logger_function)(const char *) |
| 340 | ); | 433 | ); |
| 341 | |||
| 342 | |||
| 343 | /* Error codes ***************************************************************/ | ||
| 344 | |||
| 345 | /* | ||
| 346 | The value NISSY_OK denotes a success. If returned by solve, it means | ||
| 347 | that no solution has been found. | ||
| 348 | */ | ||
| 349 | #define NISSY_OK 0LL | ||
| 350 | |||
| 351 | /* | ||
| 352 | The value NISSY_WARNING_UNSOLVABLE is a warning. It means that the | ||
| 353 | operation was completed succesfully, but the resulting cube is in an | ||
| 354 | unsolvable state. This could be intended, for example if the user has | ||
| 355 | provided an unsolvable cube as input. | ||
| 356 | */ | ||
| 357 | #define NISSY_WARNING_UNSOLVABLE -1LL | ||
| 358 | |||
| 359 | /* | ||
| 360 | The value NISSY_ERROR_INVALID_CUBE means that the provided cube is | ||
| 361 | invalid. It could be written in an unknown format, or in a format | ||
| 362 | different from what specified, or simply ill-formed. | ||
| 363 | */ | ||
| 364 | #define NISSY_ERROR_INVALID_CUBE -10LL | ||
| 365 | |||
| 366 | /* | ||
| 367 | The value NISSY_ERROR_UNSOLVABLE_CUBE means that the provided cube is in | ||
| 368 | an unsolvable state for the given solver. This could mean either that the | ||
| 369 | cube is not solvable at all (for example in case it has a single twisted | ||
| 370 | corner), or that it is not ready for the given step (for example if the | ||
| 371 | caller wants to solve a DR finish without the cube being in DR state). | ||
| 372 | */ | ||
| 373 | #define NISSY_ERROR_UNSOLVABLE_CUBE -11LL | ||
| 374 | |||
| 375 | /* | ||
| 376 | The value NISSY_ERROR_INVALID_MOVES means that the given moves are | ||
| 377 | invalid. | ||
| 378 | */ | ||
| 379 | #define NISSY_ERROR_INVALID_MOVES -20LL | ||
| 380 | |||
| 381 | /* | ||
| 382 | The value NISSY_ERROR_INVALID_TRANS means that the given transformation | ||
| 383 | is invalid. | ||
| 384 | */ | ||
| 385 | #define NISSY_ERROR_INVALID_TRANS -30LL | ||
| 386 | |||
| 387 | /* | ||
| 388 | The value NISSY_ERROR_INVALID_FORMAT means that the given format is | ||
| 389 | not known. | ||
| 390 | */ | ||
| 391 | #define NISSY_ERROR_INVALID_FORMAT -40LL | ||
| 392 | |||
| 393 | /* | ||
| 394 | The value NISSY_ERROR_INVALID_SOLVER means that the given solver is | ||
| 395 | not known. | ||
| 396 | */ | ||
| 397 | #define NISSY_ERROR_INVALID_SOLVER -50LL | ||
| 398 | |||
| 399 | /* | ||
| 400 | The value NISSY_ERROR_NULL_POINTER means that one of the provided pointer | ||
| 401 | arguments is NULL. For example, it may be returned by solve when called | ||
| 402 | with a solver that requires some pre-computed data, but the provided | ||
| 403 | data is NULL. | ||
| 404 | */ | ||
| 405 | #define NISSY_ERROR_NULL_POINTER -60LL | ||
| 406 | |||
| 407 | /* | ||
| 408 | The value NISSY_ERROR_BUFFER_SIZE means that one of the buffers provided | ||
| 409 | is too small. For example, it could be too small to hold the result or | ||
| 410 | too small to hold the data generated by gendata. | ||
| 411 | */ | ||
| 412 | #define NISSY_ERROR_BUFFER_SIZE -61LL | ||
| 413 | |||
| 414 | /* | ||
| 415 | The value NISSY_ERROR_DATA means that the provided data is invalid. For | ||
| 416 | example, it may be returned by solve when called with incompatible solver | ||
| 417 | and data arguments. | ||
| 418 | */ | ||
| 419 | #define NISSY_ERROR_DATA -70LL | ||
| 420 | |||
| 421 | /* | ||
| 422 | The value NISSY_ERROR_OPTIONS means that one or more of the given options | ||
| 423 | are invalid. For example, it may be returned by solve when called with | ||
| 424 | a negative maximum number of solutions. | ||
| 425 | */ | ||
| 426 | #define NISSY_ERROR_OPTIONS -80LL | ||
| 427 | |||
| 428 | /* | ||
| 429 | The value NISSY_ERROR_UNKNOWN denotes an unexpected error. It probably | ||
| 430 | means that there some bug in this library. If you can, report any error | ||
| 431 | of this kind to sebastiano@tronto.net. Thanks! | ||
| 432 | */ | ||
| 433 | #define NISSY_ERROR_UNKNOWN -999LL | ||
