Index: ports/gambc_ppapi/gambc.c |
diff --git a/ports/gambc_ppapi/gambc.c b/ports/gambc_ppapi/gambc.c |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c39c7504454bb77ddbb24d91302a7d5ea04aa9b2 |
--- /dev/null |
+++ b/ports/gambc_ppapi/gambc.c |
@@ -0,0 +1,43 @@ |
+#include <stdio.h> |
+#include <pthread.h> |
+ |
+/* |
+ * ___VERSION must match the version number of the Gambit header file. |
+ */ |
+ |
+#define ___VERSION 407000 |
+#include "gambit.h" |
+ |
+extern void repl(); |
+ |
+/* |
+ * Define SCHEME_LIBRARY_LINKER as the name of the Scheme library |
+ * prefixed with "____20_" and suffixed with "__". This is the |
+ * function that initializes the Scheme library. |
+ */ |
+ |
+#define SCHEME_LIBRARY_LINKER ____20_repl__ |
+ |
+___BEGIN_C_LINKAGE |
+extern ___mod_or_lnk SCHEME_LIBRARY_LINKER (___global_state_struct*); |
+___END_C_LINKAGE |
+ |
+int gambc_main(int argc, char **argv) |
+{ |
+ /* |
+ * Setup the Scheme library by calling "___setup" with appropriate |
+ * parameters. The call to "___setup_params_reset" sets all parameters |
+ * to their default setting. |
+ */ |
+ |
+ ___setup_params_struct setup_params; |
+ ___setup_params_reset (&setup_params); |
+ setup_params.version = ___VERSION; |
+ setup_params.linker = SCHEME_LIBRARY_LINKER; |
+ ___setup (&setup_params); |
+ |
+ repl(); |
+ |
+ ___cleanup (); |
+ return 0; |
+} |