summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2010-12-19 16:12:02 +0000
committerChristian Pointner <equinox@spreadspace.org>2010-12-19 16:12:02 +0000
commita8ffa6ef4d593b4228b0c921741c65d1f8a2891b (patch)
treeadfafbf89d5516a7a56933f39e9236a929d6b6dc /examples
parentupdated TODO (diff)
loading comamnds and response table form file
git-svn-id: https://svn.spreadspace.org/gcsd/trunk@70 ac14a137-c7f1-4531-abe0-07747231d213
Diffstat (limited to 'examples')
-rw-r--r--examples/basic_mode.lua8
-rw-r--r--examples/dynamic_dispatch_table.lua6
2 files changed, 12 insertions, 2 deletions
diff --git a/examples/basic_mode.lua b/examples/basic_mode.lua
index 04c16df..97cccd1 100644
--- a/examples/basic_mode.lua
+++ b/examples/basic_mode.lua
@@ -1,6 +1,12 @@
-return {
+local commands = {
["%w+%s*\n"] = function(match)
command_queue:enqueue(string.match(match , "(%w+)%s*"))
end,
[".*\n"] = function(match) end
}
+
+local responses = {
+ [".*\n"] = function(match) end
+}
+
+return commands, responses \ No newline at end of file
diff --git a/examples/dynamic_dispatch_table.lua b/examples/dynamic_dispatch_table.lua
index c515621..4d94fa2 100644
--- a/examples/dynamic_dispatch_table.lua
+++ b/examples/dynamic_dispatch_table.lua
@@ -13,4 +13,8 @@ local get_length_table = {
end
}
-return get_length_table
+local responses = {
+ [".*\n"] = function(match) end
+}
+
+return get_length_table, responses