aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/SQLTester/touint8array.c
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2023-08-30 00:22:54 +0000
committerstephan <stephan@noemail.net>2023-08-30 00:22:54 +0000
commitac5e1f82ce5e4103bf31882252587f3cbb2a564b (patch)
tree7c267dd8b847cc375a7ab68ec1aaca16e5adcd6f /ext/wasm/SQLTester/touint8array.c
parent4f1387e9ab1b5aed8c1c901be23eb02af47854d6 (diff)
downloadsqlite-ac5e1f82ce5e4103bf31882252587f3cbb2a564b.tar.gz
sqlite-ac5e1f82ce5e4103bf31882252587f3cbb2a564b.zip
Add a mechanism with which to import external SQLTester scripts into the JS testing tool.
FossilOrigin-Name: bb08ba020ce1d86ca6aa92f43d5ae915f67d08fa73120e1f603d150e76166624
Diffstat (limited to 'ext/wasm/SQLTester/touint8array.c')
-rw-r--r--ext/wasm/SQLTester/touint8array.c29
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;
+}