aboutsummaryrefslogtreecommitdiff
path: root/python
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 /python
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--python/nissy_module.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/python/nissy_module.c b/python/nissy_module.c
index db63dbb..da0b1c5 100644
--- a/python/nissy_module.c
+++ b/python/nissy_module.c
@@ -235,7 +235,7 @@ solverinfo(PyObject *self, PyObject *args)
235{ 235{
236 long long result; 236 long long result;
237 const char *solver; 237 const char *solver;
238 char buf[NISSY_DATAID_SIZE]; 238 char buf[NISSY_SIZE_DATAID];
239 PyObject *py_result, *py_buf; 239 PyObject *py_result, *py_buf;
240 240
241 if (!PyArg_ParseTuple(args, "s", &solver)) 241 if (!PyArg_ParseTuple(args, "s", &solver))
@@ -263,7 +263,7 @@ gendata(PyObject *self, PyObject *args)
263{ 263{
264 long long size, err; 264 long long size, err;
265 const char *solver; 265 const char *solver;
266 char *buf, dataid[NISSY_DATAID_SIZE]; 266 char *buf, dataid[NISSY_SIZE_DATAID];
267 267
268 if (!PyArg_ParseTuple(args, "s", &solver)) 268 if (!PyArg_ParseTuple(args, "s", &solver))
269 return NULL; 269 return NULL;
@@ -421,13 +421,9 @@ static struct PyModuleDef nissy_python_module = {
421}; 421};
422 422
423static void 423static void
424log_stdout(const char *str, ...) 424log_stdout(const char *str)
425{ 425{
426 va_list args; 426 fprintf(stderr, "%s", str);
427
428 va_start(args, str);
429 vfprintf(stderr, str, args);
430 va_end(args);
431} 427}
432 428
433PyMODINIT_FUNC PyInit_nissy_python_module(void) { 429PyMODINIT_FUNC PyInit_nissy_python_module(void) {

Generated with cgit - Back to sebastiano.tronto.net