diff options
author | stephan <stephan@noemail.net> | 2023-08-30 13:07:35 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2023-08-30 13:07:35 +0000 |
commit | 24c32c2e390de4116ba9e768cff9bcd3ad4f5dc6 (patch) | |
tree | 9561e6297623c6a2afa457483632fdf06e42be5b /ext/wasm/SQLTester/touint8array.c | |
parent | a910f3f1c5b8d2e131949719b2985ed3f17e6e1d (diff) | |
parent | e621556724c044aa09e7c4fdab4e8407df83d216 (diff) | |
download | sqlite-24c32c2e390de4116ba9e768cff9bcd3ad4f5dc6.tar.gz sqlite-24c32c2e390de4116ba9e768cff9bcd3ad4f5dc6.zip |
Add a JS implementation of Java's SQLTester.
FossilOrigin-Name: b530792a514d95c4e8f93cf2170d9fc4de367055fa1704fc171551c946024fa9
Diffstat (limited to 'ext/wasm/SQLTester/touint8array.c')
-rw-r--r-- | ext/wasm/SQLTester/touint8array.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ext/wasm/SQLTester/touint8array.c b/ext/wasm/SQLTester/touint8array.c new file mode 100644 index 000000000..b03ad42f0 --- /dev/null +++ b/ext/wasm/SQLTester/touint8array.c @@ -0,0 +1,29 @@ +/* +** 2023-08-29 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** This file contains a tool for writing out the contents of stdin as +** a comma-separated list of numbers, one per byte. +*/ + +#include <stdio.h> +int main(int argc, char const **argv){ + int i; + int rc = 0, colWidth = 30; + int ch; + printf("["); + for( i=0; EOF!=(ch = fgetc(stdin)); ++i ){ + if( 0!=i ) printf(","); + if( i && 0==(i%colWidth) ) puts(""); + printf("%d",ch); + } + printf("]"); + return rc; +} |