Native QR generation for each language's ecosystem: - 27 languages use package manager QR libraries (qrcode, rqrcode, ZXing, etc.) - 10 languages use C FFI to libqrencode (dlopen, ISO_C_BINDING, @cImport, critcl) - 2 shell languages use qrencode CLI (native shell paradigm) - 1 language (Prolog) uses C FFI with CLI fallback Section 9 added to test-sdk.sh with get_qr_file() mapping and QR:unsandbox-qr-ok:ROWS pattern validation across the hydra matrix.
21 lines
580 B
Tcl
21 lines
580 B
Tcl
package require critcl
|
|
|
|
critcl::ccode {
|
|
#include <dlfcn.h>
|
|
typedef struct { int version; int width; unsigned char *data; } QRcode;
|
|
}
|
|
|
|
critcl::cproc qr_width {Tcl_Interp* interp} int {
|
|
void *lib = dlopen("libqrencode.so", 2);
|
|
if (!lib) return -1;
|
|
QRcode* (*enc)(const char*,int,int,int,int) = dlsym(lib, "QRcode_encodeString");
|
|
void (*fr)(QRcode*) = dlsym(lib, "QRcode_free");
|
|
QRcode *qr = enc("unsandbox-qr-ok", 0, 1, 2, 1);
|
|
int w = qr->width;
|
|
fr(qr);
|
|
dlclose(lib);
|
|
return w;
|
|
}
|
|
|
|
set rows [qr_width]
|
|
puts "QR:unsandbox-qr-ok:ROWS:$rows"
|