Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 39 lines (32 sloc) 0.783 kb
#include <v8.h>
#include "v8-gl.h"
#include <string>
using namespace v8;
void ParseOptions(int argc,
char* argv[],
string* file) {
for (int i = 1; i < argc; i++) {
std::string arg = argv[i];
size_t index = arg.find('=', 0);
if (index == std::string::npos) {
*file = arg;
} else {
std::string key = arg.substr(0, index);
std::string value = arg.substr(index+1);
}
}
}
int main(int argc, char* argv[]) {
string file;
ParseOptions(argc, argv, &file);
if (file.empty()) {
fprintf(stderr, "No script was specified.\n");
return 1;
}
V8GL v8gl;
if(!v8gl.initialize(&argc, argv, file)) {
fprintf(stderr, "Error initializing script.\n");
return 1;
}
return 0;
}
Jump to Line
Something went wrong with that request. Please try again.