diff options
author | Christian Pointner <equinox@spreadspace.org> | 2010-11-08 20:17:55 +0000 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2010-11-08 20:17:55 +0000 |
commit | 167b2aed3a358eb840c573832c1b382f3f91487d (patch) | |
tree | 68b5506eea8c4d2ed9074f2f7121c11f081aa593 | |
parent | moved debug shell to modules (diff) |
dummy module cleanup
git-svn-id: https://svn.spreadspace.org/gcsd/trunk@11 ac14a137-c7f1-4531-abe0-07747231d213
-rw-r--r-- | src/modules/dummy.lua | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/src/modules/dummy.lua b/src/modules/dummy.lua index 0f05cbe..291378b 100644 --- a/src/modules/dummy.lua +++ b/src/modules/dummy.lua @@ -30,35 +30,34 @@ -- along with gcsd. If not, see <http://www.gnu.org/licenses/>. -- -local dummy = { - properties = { input=true, output=true, max_instances=-1 }, - new = function(config) - local handle = {} - handle.fd = 0 - function handle:getfd() return self.fd end - function handle:dirty() return 0 end - function handle:read() end - function handle:write(data) end +local dummy = {} +dummy.properties = { input=true, output=true, max_instances=-1 } +function dummy:new(config) + local handle = {} + handle.fd = 0 + function handle:getfd() return self.fd end + function handle:dirty() return 0 end + function handle:read() end + function handle:write() end + + local client = {} + function client:process_response() end + function client:process_timeout() end + function client:get_read_handles() return handle end + function client:get_write_handles() return {} end + function client:cleanup() end + + local inst = { + cleanup = function() end, + get_read_handles = function() + return {} + end, + get_write_handles = function() + return {} + end + } + metatable(inst).__gc = inst.cleanup() + return inst +end - local client = {} - function client:process_response() end - function client:process_timeout() end - function client:read_command() end - function client:get_read_handles() return handle end - function client:get_write_handles() return {} end - - local inst = { - cleanup = function() end, - get_read_handles = function() - return {} - end, - get_write_handles = function() - return {} - end - } - metatable(inst).__gc = inst.cleanup() - return inst - end -} - -return dummy
\ No newline at end of file +return dummy |