From d1c1af1664c330dab04b87fbf06dd0c67de2e846 Mon Sep 17 00:00:00 2001 From: andreas Date: Sun, 31 May 2026 13:27:30 +0200 Subject: Cleanup, INCLUDING BREAKING CHANGES. --- include/qntan/Qntan.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/include/qntan/Qntan.h b/include/qntan/Qntan.h index 8ed8788..be08b0f 100644 --- a/include/qntan/Qntan.h +++ b/include/qntan/Qntan.h @@ -19,7 +19,7 @@ #endif -#ifdef Qntan_USERCONFIG +#if !defined(Qntan_USERCONFIG) || Qntan_USERCONFIG != 0 # include "qntan_userconfig.h" #endif @@ -714,17 +714,21 @@ struct Qntan_FileSystem { #ifndef Qntan_FourierTransform_transform -# define Qntan_FourierTransform_transform(A, B, C, D) (*A)->transform(A, B, C, D) +# define Qntan_FourierTransform_transform(A, B, C, D, E, F) (*A)->transform(A, B, C, D, E, F) #endif struct Qntan_FourierTransform { /**/ - int (*transform)( struct Qntan_FourierTransform**, float*samples, size_t samples_cnt, float*output ); + void (*transform)( struct Qntan_FourierTransform**, float*samples, size_t samples_cnt, float*output, + void(*onDone)(int err,float*out,Qntan_Cls), Qntan_Cls ); /* WARN: There may be implementations producing odd results if * 'samples' and 'output' overlap. - * @return negative values on erorr. Zero on success. - * - * TODO: Make this async. + * `samples`: Input data to process. + * `output`: An array, at least as large as `samples` where the result + * will be written to. + * `onDone` called when action is done. + * `err` negative values on erorr. Zero on success. + * `out` just the same reference given in `output`, for convencience reasons. */ }; @@ -1319,7 +1323,7 @@ struct Qntan_CsvEnc { # define Qntan_JsonEnc_reset(A) (*A)->reset(A) #endif #ifndef Qntan_JsonEnc_flush -# define Qntan_JsonEnc_flush(A) (*A)->flush(A) +# define Qntan_JsonEnc_flush(A, B, C) (*A)->flush(A, B, C) #endif #ifndef Qntan_JsonEnc_objBeg # define Qntan_JsonEnc_objBeg(A) (*A)->objBeg(A) @@ -1354,9 +1358,8 @@ struct Qntan_JsonEnc { void (*reset)( struct Qntan_JsonEnc** ); /* throws away the current state and sets the encoder for a new run. */ - void (*flush)( struct Qntan_JsonEnc** ); - /* TODO: to me, looks like this should be async and take an 'onDone' cback. - */ + void (*flush)( struct Qntan_JsonEnc**, void(*onDone)(int,Qntan_Cls), Qntan_Cls ); + /**/ void (*objBeg)( struct Qntan_JsonEnc** ); /**/ void (*objEnd)( struct Qntan_JsonEnc** ); -- cgit v1.3.1