Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/dvi/dvilib/dl-dvi-program.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dvi/dvilib/dl-dvi-program.cc')
-rwxr-xr-xdvi/dvilib/dl-dvi-program.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/dvi/dvilib/dl-dvi-program.cc b/dvi/dvilib/dl-dvi-program.cc
new file mode 100755
index 0000000..cb1f07f
--- /dev/null
+++ b/dvi/dvilib/dl-dvi-program.cc
@@ -0,0 +1,30 @@
+#include "dl-dvi-program.hh"
+#include <algorithm>
+
+using namespace DviLib;
+
+typedef vector<DviCommand *>::iterator It;
+
+void
+DviProgram::execute (DviRuntime& runtime)
+{
+ for (It i = commands.begin(); i != commands.end(); ++i)
+ {
+ (*i)->execute (runtime);
+ }
+}
+
+void
+DviProgram::add_command (DviCommand *cmd)
+{
+ cmd->ref();
+ commands.push_back (cmd);
+}
+
+DviProgram::~DviProgram (void)
+{
+ for (It i = commands.begin(); i != commands.end(); ++i)
+ {
+ (*i)->unref ();
+ }
+}