summaryrefslogtreecommitdiffstats
path: root/src/extension/script/InkscapeScript.cpp
diff options
context:
space:
mode:
authorBob Jamison <ishmalius@gmail.com>2006-05-06 21:45:01 +0000
committerishmal <ishmal@users.sourceforge.net>2006-05-06 21:45:01 +0000
commitb151fcd87bfd5892dc3cd166a0944d12666aefab (patch)
tree0d2e099f46dcc747a4685727c3408c23efcdc544 /src/extension/script/InkscapeScript.cpp
parentr11769@tres: ted | 2006-05-06 09:09:59 -0700 (diff)
downloadinkscape-b151fcd87bfd5892dc3cd166a0944d12666aefab.tar.gz
inkscape-b151fcd87bfd5892dc3cd166a0944d12666aefab.zip
const types
(bzr r754)
Diffstat (limited to 'src/extension/script/InkscapeScript.cpp')
-rw-r--r--src/extension/script/InkscapeScript.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/extension/script/InkscapeScript.cpp b/src/extension/script/InkscapeScript.cpp
index cc9271caa..87d120245 100644
--- a/src/extension/script/InkscapeScript.cpp
+++ b/src/extension/script/InkscapeScript.cpp
@@ -32,9 +32,6 @@ namespace Script {
*/
InkscapeScript::InkscapeScript()
{
-
-
-
}
@@ -45,24 +42,22 @@ InkscapeScript::InkscapeScript()
*/
InkscapeScript::~InkscapeScript()
{
-
-
}
/**
- *
+ * Interprets the script in the 'script' buffer,
+ * storing the stdout output in 'output', and any
+ * error messages in 'error.' Language is one of the
+ * enumerated types in ScriptLanguage above.
*/
-bool InkscapeScript::interpretScript(Glib::ustring &script,
+bool InkscapeScript::interpretScript(const Glib::ustring &script,
Glib::ustring &output,
Glib::ustring &error,
ScriptLanguage language)
{
-#ifndef __GNUC__
- static char const __FUNCTION__[] = "interpretScript";
-#endif
char * langname=NULL;
InkscapeInterpreter *interp = NULL;
//if() instead of switch() lets us scope vars
@@ -82,35 +77,37 @@ bool InkscapeScript::interpretScript(Glib::ustring &script,
}
else
{
- //replace with g_error
- fprintf(stderr, "%s: Unknown Script Language type: %d\n",
- __FUNCTION__, language);
+ g_error("interpretScript: Unknown Script Language type: %d\n",
+ language);
return false;
}
-
+
if (!interp)
{
- fprintf(stderr, "%s: error starting Language '%s'\n",
- __FUNCTION__, langname);
+ g_error("interpretScript: error starting Language '%s'\n",
+ langname);
return false;
}
if (!interp->interpretScript(script, output, error))
{
- fprintf(stderr, "%s: error in executing %s script\n",
- __FUNCTION__, langname);
+ g_error("interpretScript: error in executing %s script\n",
+ langname);
return false;
}
-
+
delete interp;
-
+
return true;
}
/**
- *
+ * Interprets the script in the 'script' buffer,
+ * storing the stdout output in 'output', and any
+ * error messages in 'error.' Language is one of the
+ * enumerated types in ScriptLanguage above.
*/
-bool InkscapeScript::interpretUri(Glib::ustring &uri,
+bool InkscapeScript::interpretUri(const Glib::ustring &uri,
Glib::ustring &output,
Glib::ustring &error,
ScriptLanguage language)
@@ -132,20 +129,23 @@ bool InkscapeScript::interpretUri(Glib::ustring &uri,
}
else
{
- //replace with g_error
- fprintf(stderr, "Unknown Script Language type:%d\n", language);
+ g_error("interpretUri: Unknown Script Language type:%d\n",
+ language);
return false;
}
-
+
if (!interp)
return false;
if (!interp->interpretUri(uri, output, error))
{
- fprintf(stderr, "error in executing script '%s'\n", uri.raw().c_str());
+ g_error("interpretUri: error in executing script '%s'\n",
+ uri.raw().c_str());
return false;
}
-
+
+ delete interp;
+
return true;
}