<div dir="ltr"><div>Hello,<br><br><br>Here are new commits, this time I am trying to do the transition to the T4K library, and particularly the debug part as debug macros are used in a lot of functions (so the real transition can't begin until  it's done) ; T4K use also the debug_status variable, defined in t4k_main.c, that can be used through t4k_common.h. So I did like in Tux Maths, and included t4k_common.h in globals.h ; obviously the compiler told me there were few redefinitions of macros, structures, so I commented these portions of Tux Typing code (first commit: <a href="https://github.com/OjeromeO/tuxtype/commit/8a9c0c0f4b0d4178af7b4fa532abeac655e3de05">https://github.com/OjeromeO/tuxtype/commit/8a9c0c0f4b0d4178af7b4fa532abeac655e3de05</a>).<br>
<br><br>Now about the debug macros themselves, T4K uses :<br>#define DEBUGCODE(mask) if((mask) & debug_status)<br><br>whereas Tux Typing uses :<br>#define DEBUGCODE if (settings.debug_on) <br><br>To make sure the behaviour will be the same, I commented the DEBUGCODE macro, replaced all the DEBUGCODE with DEBUGCODE(mask), and I used debug_all, a constant of t4k_common.h, as the mask ; obviously I set debug_status to debug_all when the "-d" option is given to tuxtype (second commit: <a href="https://github.com/OjeromeO/tuxtype/commit/be81afd791552784635cc9503a7a872802c4aa88">https://github.com/OjeromeO/tuxtype/commit/be81afd791552784635cc9503a7a872802c4aa88</a>).<br>
<br><br></div><div>And it works well, I built tuxtype and ran it with and without -d, and it works as expected :)<br></div><div><br><br>I will have to repeat the same procedure for,<br>in T4K :<br>#define DEBUGMSG(mask, ...) \<br>
    if((mask) & debug_status) \<br>{ \<br>    fprintf(stderr, __VA_ARGS__); fflush(stderr); \<br>}<br><br>and in Tux Typing :<br>#define LOG( str ) if (settings.debug_on) fprintf( stderr, str );<br><br><br><br>Jerome<br>
</div></div>