Subzero: Allow overriding command-line args from the browser.
In the browser build only, allows arguments to be explicitly passed to pnacl-sz, in two ways:
1. The SZARGFILE envvar contains the name of a file with arguments, one per line. For each line, initial whitespace is ignored, and lines starting with the '#' comment character are also ignored.
2. The SZARGLIST envvar contains all the arguments, separated by the '|' character.
Chrome needs to be started with special options to allow the envvars to be passed through, and also to allow access to the local file system.
In addition, specifying "-log=/dev/stderr" or "-o /dev/stderr" gets mapped to std::cerr, in the same way "-" gets mapped to std::cout.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4370
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/1903553004 .
diff --git a/src/IceRangeSpec.h b/src/IceRangeSpec.h
index cdd9c35..244fe4a 100644
--- a/src/IceRangeSpec.h
+++ b/src/IceRangeSpec.h
@@ -59,6 +59,12 @@
// matching on function name works correctly. Note that this is not
// thread-safe, so we count on all this being handled by the startup thread.
static bool hasNames() { return HasNames; }
+ // Helper function to tokenize a string into a vector of string tokens, given
+ // a single delimiter character. An empty string produces an empty token
+ // vector. Zero-length tokens are allowed, e.g. ",a,,,b," may tokenize to
+ // {"","a","","","b",""}.
+ static std::vector<std::string> tokenize(const std::string &Spec,
+ char Delimiter);
private:
void include(const std::string &Token);