aboutsummaryrefslogtreecommitdiff
path: root/src/nissy.c
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-04-22 14:47:25 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-04-22 14:47:25 +0200
commit93522effba2f200257141189de5925a23fca93b8 (patch)
tree96d94b56017f1448832b5dc9e24bfcb31183f13c /src/nissy.c
parent1fb55fe25b3dd5ef61dbc38290fbba2e233dc6b6 (diff)
downloadnissy-core-93522effba2f200257141189de5925a23fca93b8.tar.gz
nissy-core-93522effba2f200257141189de5925a23fca93b8.zip
Remove compose from the public API
Diffstat (limited to '')
-rw-r--r--src/nissy.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/nissy.c b/src/nissy.c
index 8aa0334..bf56f40 100644
--- a/src/nissy.c
+++ b/src/nissy.c
@@ -142,47 +142,6 @@ my_strnlen(const char *str, size_t maxlen)
142} 142}
143 143
144long long 144long long
145nissy_compose(
146 const char cube[static NISSY_SIZE_CUBE],
147 const char permutation[static NISSY_SIZE_CUBE],
148 char result[static NISSY_SIZE_CUBE]
149)
150{
151 cube_t c, p, res;
152 long long err;
153
154 c = readcube(cube);
155
156 if (!isconsistent(c)) {
157 LOG("[compose] Error: the given cube is invalid\n");
158 err = NISSY_ERROR_INVALID_CUBE;
159 goto nissy_compose_error;
160 }
161
162 p = readcube(permutation);
163
164 if (!isconsistent(p)) {
165 LOG("[compose] Error: given permutation is invalid\n");
166 err = NISSY_ERROR_INVALID_CUBE;
167 goto nissy_compose_error;
168 }
169
170 res = compose(c, p);
171
172 if (!isconsistent(res)) {
173 LOG("[compose] Unknown error: resulting cube is invalid\n");
174 err = NISSY_ERROR_UNKNOWN;
175 goto nissy_compose_error;
176 }
177
178 return write_result(res, result);
179
180nissy_compose_error:
181 writecube(ZERO_CUBE, NISSY_SIZE_CUBE, result);
182 return err;
183}
184
185long long
186nissy_inverse( 145nissy_inverse(
187 const char cube[static NISSY_SIZE_CUBE], 146 const char cube[static NISSY_SIZE_CUBE],
188 char result[static NISSY_SIZE_CUBE] 147 char result[static NISSY_SIZE_CUBE]

Generated with cgit - Back to sebastiano.tronto.net