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

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 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/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 62%
copy from ports/lua_ppapi/main.c
copy to ports/gambc_ppapi/main.c
index 6e612ccf40ad173063f109b9d978ee2e6c570762..ab840ffb6d1320f455847ec3dd47cb362765c283 100644
--- a/ports/lua_ppapi/main.c
+++ b/ports/gambc_ppapi/main.c
@@ -4,19 +4,19 @@
#include <assert.h>
#include <fcntl.h>
-#include <libtar.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mount.h>
+#include <sys/stat.h>
#include <unistd.h>
#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");
@@ -38,7 +38,7 @@ static int setup_unix_environment(const char* tarfile) {
const char* data_url = getenv("DATA_URL");
if (!data_url)
- data_url = "./";
+ data_url = "./scm";
ret = mount(data_url, "/mnt/http", "httpfs", 0,
"allow_cross_origin_requests=true,allow_credentials=false");
@@ -51,28 +51,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 +59,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