Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(427)

Unified Diff: ports/gambc_ppapi/gambc.c

Issue 150413008: Initial support for gambit-scheme v4.7.0 Base URL: https://chromium.googlesource.com/external/naclports.git@master
Patch Set: Add support for pnacl Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ports/gambc_ppapi/build.sh ('k') | ports/gambc_ppapi/gambc.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+}
« no previous file with comments | « ports/gambc_ppapi/build.sh ('k') | ports/gambc_ppapi/gambc.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698