Avoid appending null byte to RTMP method name.
[gnash.git] / libbase / rc.cpp
blob68a90f14ac3437748ba73c6121e1613351786f4b
1 // rc.cpp: "Run Command" configuration file, for Gnash.
2 //
3 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
4 // Foundation, Inc
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 // This is generated by autoconf
22 #ifdef HAVE_CONFIG_H
23 # include "gnashconfig.h"
24 #endif
26 #include "StringPredicates.h"
27 #include "log.h"
28 #include "rc.h"
30 #ifdef HAVE_PWD_H
31 # include <pwd.h>
32 #endif
34 #include <boost/cstdint.hpp>
35 #include <sys/types.h>
36 #include <unistd.h> // for getuid()
37 #include <sys/stat.h>
38 #include <limits>
39 #include <cstdlib> // getenv
40 #include <string>
41 #include <list>
42 #include <iostream>
43 #include <fstream>
44 #include <sstream>
46 #include <boost/format.hpp>
48 #ifdef HAIKU_HOST
49 # include <Path.h>
50 # include <FindDirectory.h>
51 #endif
53 using std::endl;
54 using std::cout;
55 using std::cerr;
57 namespace gnash {
59 RcInitFile&
60 RcInitFile::getDefaultInstance()
62 // TODO: allocate on the heap and provide a destroyDefaultInstance,
63 // for finer control of destruction order
64 static RcInitFile rcfile;
65 return rcfile;
69 RcInitFile::RcInitFile()
71 _delay(0),
72 _movieLibraryLimit(8),
73 _debug(false),
74 _debugger(false),
75 _verbosity(-1),
76 // will be reset to something else if __OS2__x is defined:
77 _urlOpenerFormat("firefox -remote 'openurl(%u)'"),
78 _flashVersionString(
79 DEFAULT_FLASH_PLATFORM_ID" "\
80 DEFAULT_FLASH_MAJOR_VERSION","\
81 DEFAULT_FLASH_MINOR_VERSION","\
82 DEFAULT_FLASH_REV_NUMBER ",0"),
83 // An empty string leaves detection to VM.cpp:
84 _flashSystemOS(""),
85 _flashSystemManufacturer("Gnash "DEFAULT_FLASH_SYSTEM_OS),
86 _actionDump(false),
87 _parserDump(false),
88 _verboseASCodingErrors(false),
89 _verboseMalformedSWF(false),
90 _verboseMalformedAMF(false),
91 _splashScreen(true),
92 _localdomainOnly(false),
93 _localhostOnly(false),
94 _log("gnash-dbg.log"),
95 _writeLog(false),
96 _sound(true),
97 _pluginSound(true),
98 _extensionsEnabled(false),
99 _startStopped(false),
100 _insecureSSL(false),
101 _streamsTimeout(DEFAULT_STREAMS_TIMEOUT),
102 _solsandbox(DEFAULT_SOL_SAFEDIR),
103 _solreadonly(false),
104 _sollocaldomain(false),
105 _lcdisabled(false),
106 _lctrace(true),
107 // TODO: give a default value, and let 0 mean "disabled" -- 0
108 // currently is overridden by libbase/shm.cpp
109 _lcshmkey(0),
110 _ignoreFSCommand(true),
111 _quality(-1),
112 _saveStreamingMedia(false),
113 _saveLoadedMedia(false),
114 _popups(true),
115 _useXv(false),
116 _webcamDevice(-1),
117 _microphoneDevice(-1),
118 _certfile("client.pem"),
119 _certdir("/etc/pki/tls"),
120 _rootcert("rootcert.pem"),
121 _ignoreShowMenu(true)
123 expandPath(_solsandbox);
124 loadFiles();
126 #ifdef __OS2__x
127 _urlOpenerFormat = PrfQueryProfileString(HINI_USER, (PSZ)
128 "WPURLDEFAULTSETTINGS",
129 (PSZ) "DefaultBrowserExe", NULL,
130 (PVOID) browserExe, (LONG)sizeof(browserExe));
131 _urlOpenerFormat += " -remote 'openurl(%u)'";
132 #endif
134 // TODO: fetch GNASH_URLOPENER_FORMAT from the environment
137 RcInitFile::~RcInitFile()
141 // Look for a config file in the likely places.
142 void
143 RcInitFile::loadFiles()
145 // Note: This used to be bool but the return value was (a) never used
146 // and (b) only returned true if a gnashrc set by environment variable
147 // was successfully parsed. It seems we don't care whether a file
148 // actually exists or not anyway.
150 // Check the default system location
151 std::string loadfile = SYSCONFDIR;
153 #if !defined(__OS2__ ) && ! defined(__amigaos4__)
154 // On OS/2 only look in %HOME%
155 loadfile.append("/gnashrc");
156 parseFile(loadfile);
157 #endif
159 // Check the users home directory
160 const char *home = 0;
161 #if defined (__amigaos4__)
162 //on AmigaOS we have a GNASH: assign that point to program dir
163 home = "/gnash";
164 #elif defined(HAIKU_HOST)
165 BPath bp;
166 if (B_OK != find_directory(B_USER_SETTINGS_DIRECTORY, &bp)) {
167 log_error(_("Failed to find user settings directory"));
168 } else {
169 bp.Append("Gnash");
170 home = bp.Path();
172 #else
173 home = std::getenv("HOME");
174 #endif
175 if (home) {
176 loadfile = home;
177 #ifdef HAIKU_HOST
178 loadfile.append("/gnashrc");
179 #else
180 loadfile.append("/.gnashrc");
181 #endif
182 parseFile(loadfile);
185 // Check the GNASHRC environment variable
186 // Parse each file only once
187 char *gnashrc = std::getenv("GNASHRC");
188 if (gnashrc) {
189 std::string paths(gnashrc);
190 Tok t(paths, Sep(":"));
192 std::list<std::string> l;
194 for (Tok::iterator i = t.begin(), e = t.end(); i != e; ++i) {
195 l.remove(*i);
196 l.push_back(*i);
199 for (std::list<std::string>::const_iterator i = l.begin(), e = l.end(); i != e; ++i) {
200 parseFile(*i);
205 bool
206 RcInitFile::extractSetting(bool &var, const std::string &pattern,
207 const std::string &variable, const std::string &value)
210 StringNoCaseEqual noCaseCompare;
211 if ( noCaseCompare(variable, pattern) ) {
212 if ( noCaseCompare(value, "on") || noCaseCompare(value, "yes") ||
213 noCaseCompare(value, "true")) {
214 var = true;
216 if (noCaseCompare(value, "off") || noCaseCompare(value, "no") ||
217 noCaseCompare(value, "false")) {
218 var = false;
220 return true;
223 return false;
227 void
228 RcInitFile::parseList(PathList &list, const std::string &action,
229 const std::string &items)
232 if (action == "set") {
233 // Clear array of hosts in previously parsed
234 // rc files.
235 list.clear();
237 StringNoCaseEqual noCaseCompare;
239 if (noCaseCompare(items, "off") || noCaseCompare(items, "no") ||
240 noCaseCompare(items, "false")) {
241 // Return empty array (allows disabling of global
242 // whitelists in favour of a blacklist)
243 return;
247 Tok t(items, Sep(" "));
249 for (Tok::iterator i = t.begin(), e = t.end(); i != e; ++i)
251 list.push_back(*i);
256 bool
257 RcInitFile::extractDouble(double& out, const std::string &pattern,
258 const std::string &variable, const std::string &value)
261 StringNoCaseEqual noCaseCompare;
263 if ( noCaseCompare(variable, pattern) ) {
264 std::istringstream in(value);
265 if (in >> out) return true;
267 // If the assignment fails, set the double to 0.
268 out = 0;
269 return true;
272 return false;
275 void
276 RcInitFile::expandPath (std::string& path)
279 // Leaves path unchanged on systems without
280 // POSIX tilde expansion.
282 #ifdef HAVE_PWD_H
283 //Don't build tilde expansion on systems without pwd.h
285 //Only if path starts with "~"
286 if (path[0] == '~') {
288 // Initial "~" followed by "/"
289 if (path.substr(1,1) == "/") {
291 const char *home = std::getenv("HOME");
292 if (home) {
293 // if HOME set in env, replace ~ with HOME
294 path.replace(0, 1, home);
297 # ifdef HAVE_GETPWNAM //Don't try this on systems without getpwnam
299 // HOME not found in env: try using pwd
300 else {
301 struct passwd *password = getpwuid(getuid());
302 const char *pwdhome = password->pw_dir;
303 if (home) {
304 path.replace(0, 1, pwdhome);
306 //If all that fails, leave path alone
310 //Initial "~" is not followed by "/"
311 else {
313 std::string::size_type firstslash =
314 path.find_first_of("/");
315 std::string user;
316 if (firstslash != std::string::npos) {
317 // everything between initial ~ and /
318 user = path.substr(1, firstslash - 1 );
320 else user = path.substr(1);
322 // find user using pwd
323 const char *userhome = NULL;
324 struct passwd *password = getpwnam(user.c_str());
325 if (password) {
326 userhome = password->pw_dir;
327 if (userhome) {
328 path.replace(0, firstslash, userhome);
331 # endif
334 #endif
338 void
339 RcInitFile::writeList (const PathList& list, std::ostream& o)
341 for (PathList::const_iterator it = list.begin();
342 it != list.end(); ++it) {
343 o << *it << " ";
345 o << endl;
348 // Parse the config file and set the variables.
349 bool
350 RcInitFile::parseFile(const std::string& filespec)
353 struct stat stats;
354 std::string action;
355 std::string variable;
356 std::string value;
357 std::ifstream in;
358 std::string line;
360 StringNoCaseEqual noCaseCompare;
362 if (filespec.empty()) {
363 cerr << "RcInitFile::parseFile: empty filespec" << endl;
364 return false;
367 if (stat(filespec.c_str(), &stats) != 0)
369 // This is a normal case, since we check many places for an RC file.
370 // So don't complain bitterly every time we run gnash!
371 // cerr << _("RcInitFile: couldn't open file: ") << filespec << endl;
372 return false;
375 in.open(filespec.c_str());
377 if (!in) {
378 cerr << _("RcInitFile: couldn't open file: ") << filespec << endl;
379 return false;
382 //cout << _("RcInitFile: parsing ") << filespec << endl;
384 // Read in each line and parse it
385 size_t lineno = 0;
386 while (std::getline(in, line)) {
388 ++lineno;
390 // Ignore comment and empty lines
391 if (line.empty() || line[0] == '#') {
392 continue;
395 std::istringstream ss(line);
397 // Get the first token
398 if (! (ss >> action)) {
399 // Empty line
400 continue;
403 // 'action' should never be empty, or (ss >> action)
404 // above would have failed
406 if ( action[0] == '#' ) continue; // discard comments
408 // Get second token
409 if (! (ss >> variable)) {
410 // Do we need to warn here as well?
411 continue;
414 if (noCaseCompare(action, "set") || noCaseCompare(action, "append")) {
416 // The rest of the line is the value
417 if (!std::getline (ss, value)) {
418 cerr << boost::format(_("Warning: missing value for "
419 "variable \"%s\" in rcfile %s, line %d"))
420 % variable % filespec % lineno << endl;
421 continue;
424 // Erase leading spaces.
425 // If there are nothing but spaces in the value,
426 // e.g. "set writelog ", value should be an empty string,
427 // so value.erase(0, string::npos) is correct.
428 value.erase(0, value.find_first_not_of(' '));
430 if (noCaseCompare(variable, "urlOpenerFormat")) {
431 _urlOpenerFormat = value;
432 continue;
435 if (noCaseCompare(variable, "flashVersionString")) {
436 _flashVersionString = value;
437 continue;
440 if(noCaseCompare(variable, "GSTAudioSink")) {
441 _gstaudiosink = value;
442 continue;
445 if (noCaseCompare(variable, "flashSystemOS")) {
446 _flashSystemOS = value;
447 continue;
450 if (noCaseCompare(variable, "flashSystemManufacturer")) {
451 _flashSystemManufacturer = value;
452 continue;
455 if (noCaseCompare(variable, "debuglog")) {
456 expandPath (value);
457 _log = value;
458 continue;
461 if (noCaseCompare(variable, "mediaDir") ) {
462 expandPath(value);
463 _mediaCacheDir = value;
464 continue;
467 if (noCaseCompare(variable, "documentroot") ) {
468 _wwwroot = value;
469 continue;
472 if (noCaseCompare(variable, "blacklist") ) {
473 parseList(_blacklist, action, value);
474 continue;
477 if (noCaseCompare(variable, "whitelist")) {
478 parseList(_whitelist, action, value);
479 continue;
482 if (noCaseCompare(variable, "localSandboxPath")) {
483 parseList(_localSandboxPath, action, value);
484 continue;
487 if (noCaseCompare(variable, "SOLSafeDir")) {
488 expandPath (value);
489 _solsandbox = value;
490 continue;
493 if(noCaseCompare(variable, "HWAccel")) {
494 _hwaccel = value;
495 continue;
498 if(noCaseCompare(variable, "Renderer")) {
499 _renderer = value;
500 continue;
503 if(noCaseCompare(variable, "MediaHandler")) {
504 _mediahandler = value;
505 continue;
508 if (noCaseCompare(variable, "CertDir") ) {
509 expandPath(value);
510 _certdir = value;
511 continue;
514 if (noCaseCompare(variable, "CertFile") ) {
515 expandPath(value);
516 _certfile = value;
517 continue;
520 if (noCaseCompare(variable, "RootCert") ) {
521 _rootcert = value;
522 continue;
525 if (noCaseCompare(action , "set") ) {
526 extractSetting(_splashScreen, "splashScreen", variable,
527 value)
529 extractSetting(_localhostOnly, "localhost", variable,
530 value)
532 extractSetting(_localdomainOnly, "localdomain", variable,
533 value)
535 extractSetting(_insecureSSL, "insecureSSL", variable,
536 value)
538 extractSetting(_debugger, "debugger", variable, value)
540 extractSetting(_actionDump, "actionDump", variable, value)
542 extractSetting(_parserDump, "parserDump", variable, value)
544 extractSetting(_writeLog, "writelog", variable, value)
546 extractSetting(_popups, "popupMessages", variable, value)
548 extractSetting(_sound, "sound", variable, value)
550 extractSetting(_pluginSound, "pluginsound", variable, value)
552 extractSetting(_verboseASCodingErrors,
553 "ASCodingErrorsVerbosity", variable, value)
555 extractSetting(_verboseMalformedSWF, "MalformedSWFVerbosity",
556 variable, value)
558 extractSetting(_verboseMalformedAMF, "MalformedAMFVerbosity",
559 variable, value)
561 extractSetting(_extensionsEnabled, "EnableExtensions",
562 variable, value)
564 extractSetting(_startStopped, "StartStopped", variable, value)
566 extractSetting(_solreadonly, "SOLReadOnly", variable,
567 value)
569 extractSetting(_sollocaldomain, "solLocalDomain", variable,
570 value)
572 extractSetting(_lcdisabled, "LocalConnection", variable,
573 value)
575 extractSetting(_lctrace, "LCTrace", variable,
576 value)
578 extractNumber(_movieLibraryLimit, "movieLibraryLimit",
579 variable, value)
581 extractNumber(_delay, "delay", variable, value)
583 extractNumber(_verbosity, "verbosity", variable, value)
585 extractNumber(_lcshmkey, "LCShmkey", variable, value)
587 extractDouble(_streamsTimeout, "streamsTimeout", variable,
588 value)
590 extractNumber(_quality, "quality", variable, value)
592 extractSetting(_saveLoadedMedia, "saveLoadedMedia",
593 variable, value)
595 extractSetting(_saveStreamingMedia, "saveStreamingMedia",
596 variable, value)
598 extractSetting(_ignoreFSCommand, "ignoreFsCommand", variable,
599 value)
601 extractNumber(_webcamDevice, "webcamDevice", variable,
602 value)
604 extractNumber(_microphoneDevice, "microphoneDevice", variable, value)
606 extractSetting(_ignoreShowMenu, "ignoreShowMenu", variable,
607 value)
609 cerr << boost::format(_("Warning: unrecognized directive "
610 "\"%s\" in rcfile %s line %d"))
611 % variable % filespec % lineno << endl;
613 } else if (noCaseCompare(action, "include")) {
614 //cout << "Include directive in " << filespec << endl;
615 // TODO: resolve relative paths ?
616 // TODO: skip parsing if already parsed ?
617 // (would mess up user-requested parsing order, but
618 // would be safe in case of circular includes)
620 if (variable.empty()) {
621 cerr << boost::format(_("Warning: empty include "
622 "specification in rcfile %s, line %d"))
623 % filespec % lineno << endl;
624 } else {
625 if ( variable[0] != '/' ) {
626 cerr << boost::format(_("Warning: include specification "
627 "must be an absolute path in rcfile %s, "
628 "line %d")) % filespec % lineno << endl;
630 else {
631 parseFile(variable);
634 } else {
635 cerr << boost::format(_("Warning: unrecognized action \"%s\" in "
636 "rcfile %s, line %d")) % action % filespec % lineno << endl;
640 if (in) {
641 in.close();
644 return true;
647 bool
648 RcInitFile::updateFile()
651 // We don't want to try writing to /etc/ et cetera, since
652 // these are likely to be system-wide defaults set by administrators
653 // or distros, useful for a model rcfile. They are likely to have
654 // no write permission anyway unless you are running Gnash with
655 // administrative privileges, and that is a bad idea.
657 std::string writefile;
659 // The file specified in GNASHRC environment variable
660 // should be written first.
661 // If you name an important file in GNASHRC and 'save' the
662 // preferences, you'll obviously overwrite that file.
663 char *gnashrc = std::getenv("GNASHRC");
664 if (gnashrc) {
665 std::string filelist(gnashrc);
667 if (filelist.empty()) return false;
669 std::string::size_type pos = filelist.find_last_of(':');
671 if (pos == std::string::npos) {
672 // no separator: just one file.
673 writefile = filelist;
674 } else {
675 writefile = filelist.substr(pos + 1);
677 } else {
678 // Check the users home directory
679 const char *home = NULL;
680 #if defined(__amigaos4__)
681 //on AmigaOS we have a GNASH: assign that point to program dir
682 home = "/gnash";
683 #elif defined(HAIKU_HOST)
684 BPath bp;
685 if (B_OK != find_directory(B_USER_SETTINGS_DIRECTORY, &bp)) {
686 log_error(_("Failed to find user settings directory"));
687 } else {
688 bp.Append("Gnash");
689 home = bp.Path();
691 #else
692 home = std::getenv("HOME");
693 #endif
694 if (home) {
695 writefile = home;
696 #ifdef HAIKU_HOST
697 writefile.append("/gnashrc");
698 #else
699 writefile.append("/.gnashrc");
700 #endif
704 if (writefile.empty()) {
705 return false;
708 return updateFile(writefile);
713 // Write the changed settings to the config file
714 bool
715 RcInitFile::updateFile(const std::string& filespec)
718 if (filespec.empty()) {
719 return false;
722 std::ofstream out;
724 out.open(filespec.c_str());
726 if (!out) {
727 cerr << boost::format(_("Couldn't open file %s for writing")) % filespec << endl;
728 return false;
731 const std::string cmd = "set ";
733 // Bools and numbers. We want boolean values written as words, hex values
734 // prefixed with '0x'.
735 out << std::boolalpha << std::showbase <<
736 _("# Generated by Gnash. Manual changes to this file may be overridden.")
737 << endl <<
738 cmd << "splashScreen " << _splashScreen << endl <<
739 cmd << "localHost " << _localhostOnly << endl <<
740 cmd << "localDomain " << _localdomainOnly << endl <<
741 cmd << "insecureSSL " << _insecureSSL << endl <<
742 cmd << "debugger " << _debugger << endl <<
743 cmd << "actionDump " << _actionDump << endl <<
744 cmd << "parserDump " << _parserDump << endl <<
745 cmd << "writeLog " << _writeLog << endl <<
746 cmd << "sound " << _sound << endl <<
747 cmd << "popupMessages " << _popups << endl <<
748 cmd << "pluginSound " << _pluginSound << endl <<
749 cmd << "ASCodingErrorsVerbosity " << _verboseASCodingErrors << endl <<
750 cmd << "malformedSWFVerbosity " << _verboseMalformedSWF << endl <<
751 cmd << "malformedAMFVerbosity " << _verboseMalformedAMF << endl <<
752 cmd << "enableExtensions " << _extensionsEnabled << endl <<
753 cmd << "startStopped " << _startStopped << endl <<
754 cmd << "streamsTimeout " << _streamsTimeout << endl <<
755 cmd << "movieLibraryLimit " << _movieLibraryLimit << endl <<
756 cmd << "quality " << _quality << endl <<
757 cmd << "delay " << _delay << endl <<
758 cmd << "verbosity " << _verbosity << endl <<
759 cmd << "solReadOnly " << _solreadonly << endl <<
760 cmd << "solLocalDomain " << _sollocaldomain << endl <<
761 cmd << "SOLSafeDir " << _solsandbox << endl <<
762 cmd << "localConnection " << _lcdisabled << endl <<
763 cmd << "LCTrace " << _lctrace << endl <<
764 cmd << "LCShmkey " << std::hex << (boost::uint32_t) _lcshmkey << endl <<
765 cmd << "ignoreFSCommand " << _ignoreFSCommand << endl <<
766 cmd << "ignoreShowMenu " << _ignoreShowMenu << endl <<
767 cmd << "saveStreamingMedia " << _saveStreamingMedia << endl <<
768 cmd << "saveLoadedMedia " << _saveLoadedMedia << endl <<
770 // Strings.
772 // If a string is empty, Gnash defaults to the values set in the
773 // constructor.
775 // This might be irritating for users who, for instance, set
776 // debuglog to nothing, only to find it returns to "gnash-debug.log"
777 // at the next run (even though that's not the way to use it...)
779 cmd << "mediaDir " << _mediaCacheDir << endl <<
780 cmd << "debuglog " << _log << endl <<
781 cmd << "documentroot " << _wwwroot << endl <<
782 cmd << "flashSystemOS " << _flashSystemOS << endl <<
783 cmd << "flashVersionString " << _flashVersionString << endl <<
784 cmd << "urlOpenerFormat " << _urlOpenerFormat << endl <<
785 cmd << "GSTAudioSink " << _gstaudiosink << endl;
787 // Lists. These can't be handled very well at the moment. The main
788 // inconvenience would be that disabling a list makes it an empty
789 // array in the rc class, and writing that to a file would lose that
790 // blacklist you'd spent ages collecting.
792 // For now we'll just make sure lists that gnashrc finds are written.
793 // Commented out lists in gnashrc will be deleted!
795 // The difference between append and set also can't be used without
796 // a bit of trickery. It would be possible, for instance, to pass a
797 // special character (e.g. '+') as the first element of an array from
798 // the gui. However, this is possibly not all that useful anyway,
799 // as lists in other parsed rcfiles would be taken over and written
800 // as part of the new file.
802 // It might be necessary to have a 'useWhitelist' flag as well
803 // as a whitelist. This would allow rcfile to keep a whitelist and write
804 // it to disk, but not have to use it.
806 out << cmd << "whitelist ";
807 writeList (_whitelist, out);
809 out << cmd << "blacklist ";
810 writeList (_blacklist, out);
812 // This also adds the base URL of the current SWF, as that gets
813 // added to the path automatically...
814 //out << cmd << "localSandboxPath ";
815 //writeList (_localSandboxPath, out);
817 out.close();
819 return true;
822 void
823 RcInitFile::useSplashScreen(bool value)
825 _splashScreen = value;
828 void
829 RcInitFile::useLocalDomain(bool value)
831 _localdomainOnly = value;
834 void
835 RcInitFile::useLocalHost(bool value)
837 _localhostOnly = value;
840 void
841 RcInitFile::useActionDump(bool value)
843 _actionDump = value;
846 void
847 RcInitFile::showASCodingErrors(bool value)
849 _verboseASCodingErrors = value;
852 void
853 RcInitFile::showMalformedSWFErrors(bool value)
855 _verboseMalformedSWF = value;
858 void
859 RcInitFile::useParserDump(bool value)
861 _parserDump = value;
864 void
865 RcInitFile::useWriteLog(bool value)
867 _writeLog = value;
870 void
871 RcInitFile::dump()
874 cerr << endl << "Dump RcInitFile:" << endl;
875 cerr << "\tTimer interupt delay value: " << _delay << endl;
876 cerr << "\tFlash debugger: "
877 << ((_debugger)?"enabled":"disabled") << endl;
878 cerr << "\tVerbosity Level: " << _verbosity << endl;
879 cerr << "\tDump ActionScript processing: "
880 << ((_actionDump)?"enabled":"disabled") << endl;
881 cerr << "\tDump parser info: "
882 << ((_parserDump)?"enabled":"disabled") << endl;
883 cerr << "\tActionScript coding errors verbosity: "
884 << ((_verboseASCodingErrors)?"enabled":"disabled") << endl;
885 cerr << "\tMalformed SWF verbosity: "
886 << ((_verboseASCodingErrors)?"enabled":"disabled") << endl;
887 cerr << "\tUse Splash Screen: "
888 << ((_splashScreen)?"enabled":"disabled") << endl;
889 cerr << "\tUse Local Domain Only: "
890 << ((_localdomainOnly)?"enabled":"disabled") << endl;
891 cerr << "\tUse Localhost Only: "
892 << ((_localhostOnly)?"enabled":"disabled") << endl;
893 cerr << "\tWrite Debug Log To Disk: "
894 << ((_writeLog)?"enabled":"disabled") << endl;
895 cerr << "\tAllow insecure SSL connections: "
896 << ((_insecureSSL)?"yes":"no") << endl;
897 cerr << "\tEnable sound: "
898 << ((_sound)?"enabled":"disabled") << endl;
899 cerr << "\tEnable Plugin sound: "
900 << ((_pluginSound)?"enabled":"disabled") << endl;
901 cerr << "\tEnable Extensions: "
902 << ((_extensionsEnabled)?"enabled":"disabled") << endl;
904 if (!_log.empty()) {
905 cerr << "\tDebug Log name is: " << _log << endl;
908 if (!_flashVersionString.empty()) {
909 cerr << "\tFlash Version String is: " << _flashVersionString << endl;
912 if(!_gstaudiosink.empty()) {
913 cerr << "\tGST Audio Sink is: " << _gstaudiosink << endl;
916 cerr << "\tWhitelist: ";
917 writeList (_whitelist, cerr);
919 cerr << "\tBlacklist: ";
920 writeList (_blacklist, cerr);
922 cerr << "\tSandbox: ";
923 writeList (_localSandboxPath, cerr);
927 } // end of namespace gnash
929 // local Variables:
930 // mode: C++
931 // indent-tabs-mode: t
932 // End: