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

Unified Diff: ports/gambc_ppapi/main.c

Issue 150413008: Initial support for gambit-scheme v4.7.0 Base URL: https://chromium.googlesource.com/external/naclports.git@master
Patch Set: Add gambc_ppapi 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/index.html ('k') | ports/gambc_ppapi/manifest.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ports/gambc_ppapi/main.c
diff --git a/ports/lua_ppapi/main.c b/ports/gambc_ppapi/main.c
similarity index 57%
copy from ports/lua_ppapi/main.c
copy to ports/gambc_ppapi/main.c
index 6e612ccf40ad173063f109b9d978ee2e6c570762..627ca05564bd42eedf00dbdb7fc6ec63224fe61a 100644
--- a/ports/lua_ppapi/main.c
+++ b/ports/gambc_ppapi/main.c
@@ -4,7 +4,6 @@
#include <assert.h>
#include <fcntl.h>
-#include <libtar.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
@@ -14,9 +13,9 @@
#include "ppapi_simple/ps_main.h"
-int lua_main(int argc, char **argv);
+int gambc_main(int argc, char **argv);
-static int setup_unix_environment(const char* tarfile) {
+static int setup_unix_environment() {
int ret = umount("/");
if (ret) {
printf("unmounting root fs failed\n");
@@ -36,11 +35,7 @@ static int setup_unix_environment(const char* tarfile) {
mkdir("/mnt/http", 0777);
mkdir("/mnt/html5", 0777);
- const char* data_url = getenv("DATA_URL");
- if (!data_url)
- data_url = "./";
-
- ret = mount(data_url, "/mnt/http", "httpfs", 0,
+ ret = mount("http://mzh.im/gambit-in-nacl/scm", "/mnt/http", "httpfs", 0,
"allow_cross_origin_requests=true,allow_credentials=false");
if (ret) {
printf("mounting http filesystem failed\n");
@@ -51,28 +46,6 @@ static int setup_unix_environment(const char* tarfile) {
// fail in incognito mode.
mount("/", "/mnt/html5", "html5fs", 0, "");
- // Extra tar achive from http filesystem.
- if (tarfile) {
- TAR* tar;
- char filename[PATH_MAX];
- strcpy(filename, "/mnt/http/");
- strcat(filename, tarfile);
- ret = tar_open(&tar, filename, NULL, O_RDONLY, 0, 0);
- if (ret) {
- printf("error opening: %s\n", filename);
- return 1;
- }
-
- ret = tar_extract_all(tar, "/");
- if (ret) {
- printf("error extracting: %s\n", filename);
- return 1;
- }
-
- ret = tar_close(tar);
- assert(ret == 0);
- }
-
// Setup environment
setenv("HOME", "/home", 1);
setenv("PATH", "/bin", 1);
@@ -81,13 +54,11 @@ static int setup_unix_environment(const char* tarfile) {
return 0;
}
-int lua_ppapi_main(int argc, char **argv) {
- if (setup_unix_environment("luadata.tar"))
+int gambc_ppapi_main(int argc, char **argv) {
+ if (setup_unix_environment())
return 1;
- chdir("/lua-5.2.2-tests");
-
- return lua_main(argc, argv);
+ return gambc_main(argc, argv);
}
-PPAPI_SIMPLE_REGISTER_MAIN(lua_ppapi_main)
+PPAPI_SIMPLE_REGISTER_MAIN(gambc_ppapi_main)
« no previous file with comments | « ports/gambc_ppapi/index.html ('k') | ports/gambc_ppapi/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698