aboutsummaryrefslogtreecommitdiff
path: root/src/nissy.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-04-08 15:16:21 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-04-08 15:16:21 +0200
commite4f356b9592599ad91aac34bf2265c9bcdfbb81f (patch)
tree5a95908f9cb9cf5ad7d7802661e1d0c3bc2a0e3a /src/nissy.h
parentc5a6ff0443fc9e5e890fe72cb13ea78d4fe2bbcb (diff)
downloadnissy-core-e4f356b9592599ad91aac34bf2265c9bcdfbb81f.tar.gz
nissy-core-e4f356b9592599ad91aac34bf2265c9bcdfbb81f.zip
Some minor changes to the interface.
- Simplified logger to accept only a string, not a variadic list of args like printf(). This can still use some improvement, but now it is easier to use from other languages. - Fixed some misuses of the logger (wrong types etc) - Renamed some constants - Fixed some typos in comments.
Diffstat (limited to '')
-rw-r--r--src/nissy.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/nissy.h b/src/nissy.h
index add88e4..42429d3 100644
--- a/src/nissy.h
+++ b/src/nissy.h
@@ -25,7 +25,7 @@ for example 'rotation UF' or 'mirrored BL'.
25#define NISSY_SIZE_H48 88U 25#define NISSY_SIZE_H48 88U
26#define NISSY_SIZE_TRANSFORMATION 12U 26#define NISSY_SIZE_TRANSFORMATION 12U
27#define NISSY_SIZE_SOLVE_STATS 10U 27#define NISSY_SIZE_SOLVE_STATS 10U
28#define NISSY_DATAID_SIZE 255U 28#define NISSY_SIZE_DATAID 255U
29 29
30/* Flags for NISS options */ 30/* Flags for NISS options */
31#define NISSY_NISSFLAG_NORMAL 1U 31#define NISSY_NISSFLAG_NORMAL 1U
@@ -141,7 +141,7 @@ Parameters:
141 format_in - The input format. 141 format_in - The input format.
142 format_out - The output format. 142 format_out - The output format.
143 cube_string - The cube, in format_in format. 143 cube_string - The cube, in format_in format.
144 retult_size - The allocated size of the result array. 144 result_size - The allocated size of the result array.
145 result - Return parameter for the cube in format_out format. 145 result - Return parameter for the cube in format_out format.
146 146
147Return values: 147Return values:
@@ -198,7 +198,7 @@ the given solver, and other useful information.
198Parameters: 198Parameters:
199 solver - The name of the solver. 199 solver - The name of the solver.
200 dataid - An identifier for the data computed for the solver. Different 200 dataid - An identifier for the data computed for the solver. Different
201 solver may use equivalent data. This identifier can be used 201 solvers may use equivalent data. This identifier can be used
202 e.g. as a filename or database key to save and retrieve the 202 e.g. as a filename or database key to save and retrieve the
203 correct data for each solver, without duplication. 203 correct data for each solver, without duplication.
204 204
@@ -211,7 +211,7 @@ Return values:
211long long 211long long
212nissy_solverinfo( 212nissy_solverinfo(
213 const char *solver, 213 const char *solver,
214 char dataid[static NISSY_DATAID_SIZE] 214 char dataid[static NISSY_SIZE_DATAID]
215); 215);
216 216
217/* 217/*
@@ -219,8 +219,8 @@ Compute the data for the given solver and store it in generated_data.
219 219
220Parameters: 220Parameters:
221 solver - The name of the solver. 221 solver - The name of the solver.
222 data_size - The size of the data buffer. It is advised to use nissy_datasize 222 data_size - The size of the data buffer. It is advised to use
223 to check how much memory is needed. 223 nissy_solverinfo to check how much memory is needed.
224 data - The return parameter for the generated data. 224 data - The return parameter for the generated data.
225 This buffer must have 8-byte alignment. 225 This buffer must have 8-byte alignment.
226 226
@@ -324,18 +324,19 @@ nissy_countmoves(
324); 324);
325 325
326/* 326/*
327Set a global logger function used by this library. 327Set a global logger function used by this library. Setting the logger to NULL
328disables logging.
328 329
329Parameters: 330Parameters:
330 write - A callback writer with the same signature as printf(3). 331 write - A callback writer with the same signature as printf(3).
331 332
332Return values: 333Return values:
333 NISSY_OK - Logger set succesfully. No warning or error is goind to be given 334 NISSY_OK - Logger set succesfully. No warning or error is going to be given
334 if the logger is NULL or invalid. 335 if the logger is invalid.
335*/ 336*/
336long long 337long long
337nissy_setlogger( 338nissy_setlogger(
338 void (*logger_function)(const char *, ...) 339 void (*logger_function)(const char *)
339); 340);
340 341
341 342

Generated with cgit - Back to sebastiano.tronto.net