From 93522effba2f200257141189de5925a23fca93b8 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 22 Apr 2025 14:47:25 +0200 Subject: Remove compose from the public API --- src/nissy.c | 41 ----------------------------------------- src/nissy.h | 25 ------------------------- 2 files changed, 66 deletions(-) (limited to 'src') diff --git a/src/nissy.c b/src/nissy.c index 8aa0334..bf56f40 100644 --- a/src/nissy.c +++ b/src/nissy.c @@ -141,47 +141,6 @@ my_strnlen(const char *str, size_t maxlen) return maxlen; } -long long -nissy_compose( - const char cube[static NISSY_SIZE_CUBE], - const char permutation[static NISSY_SIZE_CUBE], - char result[static NISSY_SIZE_CUBE] -) -{ - cube_t c, p, res; - long long err; - - c = readcube(cube); - - if (!isconsistent(c)) { - LOG("[compose] Error: the given cube is invalid\n"); - err = NISSY_ERROR_INVALID_CUBE; - goto nissy_compose_error; - } - - p = readcube(permutation); - - if (!isconsistent(p)) { - LOG("[compose] Error: given permutation is invalid\n"); - err = NISSY_ERROR_INVALID_CUBE; - goto nissy_compose_error; - } - - res = compose(c, p); - - if (!isconsistent(res)) { - LOG("[compose] Unknown error: resulting cube is invalid\n"); - err = NISSY_ERROR_UNKNOWN; - goto nissy_compose_error; - } - - return write_result(res, result); - -nissy_compose_error: - writecube(ZERO_CUBE, NISSY_SIZE_CUBE, result); - return err; -} - long long nissy_inverse( const char cube[static NISSY_SIZE_CUBE], diff --git a/src/nissy.h b/src/nissy.h index 4b2d1eb..e7ae50e 100644 --- a/src/nissy.h +++ b/src/nissy.h @@ -125,31 +125,6 @@ of this kind to sebastiano@tronto.net. Thanks! /* Library functions *********************************************************/ -/* -Apply the secod argument as a permutation on the first argument. - -Parameters: - cube - The first cube. - permutation - The second cub. This cube is treated as a permutation and - "applied" to the first cube. - result - The return parameter for the resulting cube. - -Return values: - NISSY_OK - The cubes were composed succesfully. - NISSY_WARNING_UNSOLVABLE - The resulting cube is not solvable. This is - either because at least on of the given cubes - was not solvable, or due to an unknown internal - error. - NISSY_ERROR_INVALID_CUBE - At least one of the given cubes is invalid. - NISSY_ERROR_UNKNOWN - An unknown error occurred. -*/ -long long -nissy_compose( - const char cube[static NISSY_SIZE_CUBE], - const char permutation[static NISSY_SIZE_CUBE], - char result[static NISSY_SIZE_CUBE] -); - /* Compute the inverse of the given cube. -- cgit v1.3