Move the asynchronous IO code from src/test_async.c to ext/async/. Refactor it to be a standalone module and to support windows. (CVS 6539)

FossilOrigin-Name: e71fb0fb8d83b4453c3c1e84606bf58d04926809
diff --git a/ext/async/sqlite3async.h b/ext/async/sqlite3async.h
new file mode 100644
index 0000000..c057432
--- /dev/null
+++ b/ext/async/sqlite3async.h
@@ -0,0 +1,44 @@
+
+#ifndef __SQLITEASYNC_H_
+#define __SQLITEASYNC_H_ 1
+
+#define SQLITEASYNC_VFSNAME "sqlite3async"
+
+/*
+** Install the asynchronous IO VFS.
+*/ 
+int sqlite3async_initialize(const char *zParent, int isDefault);
+
+/*
+** Uninstall the asynchronous IO VFS.
+*/ 
+void sqlite3async_shutdown();
+
+/*
+** Process events on the write-queue.
+*/
+void sqlite3async_run();
+
+/*
+** Control/configure the asynchronous IO system.
+*/
+int sqlite3async_control(int op, ...);
+
+/*
+** Values that can be used as the first argument to sqlite3async_control().
+*/
+#define SQLITEASYNC_HALT       1
+#define SQLITEASYNC_DELAY      2
+#define SQLITEASYNC_GET_HALT   3
+#define SQLITEASYNC_GET_DELAY  4
+
+/*
+** If the first argument to sqlite3async_control() is SQLITEASYNC_HALT,
+** the second argument should be one of the following.
+*/
+#define SQLITEASYNC_HALT_NEVER 0       /* Never halt (default value) */
+#define SQLITEASYNC_HALT_NOW   1       /* Halt as soon as possible */
+#define SQLITEASYNC_HALT_IDLE  2       /* Halt when write-queue is empty */
+
+#endif        /* ifndef __SQLITEASYNC_H_ */
+