webmcp
diff libraries/mondelefant/mondelefant_atom_connector.lua @ 374:11ef7ab67e43
Added mutability state handlers in mondelefant_atom_connector.lua and prepare its usage in mondelefant_native.c
author | jbe |
---|---|
date | Sat Nov 14 14:15:31 2015 +0100 (2015-11-14) |
parents | 1a85110cdbe2 |
children | fb98b17056e5 |
line diff
1.1 --- a/libraries/mondelefant/mondelefant_atom_connector.lua Sat Nov 14 02:11:44 2015 +0100 1.2 +++ b/libraries/mondelefant/mondelefant_atom_connector.lua Sat Nov 14 14:15:31 2015 +0100 1.3 @@ -179,6 +179,22 @@ 1.4 end 1.5 end 1.6 1.7 + 1.8 +function mondelefant.save_mutability_state(value) 1.9 + local jsontype = json.type(value) 1.10 + if jsontype == "object" or jsontype == "array" then 1.11 + return tostring(value) 1.12 + end 1.13 +end 1.14 + 1.15 +function mondelefant.verify_mutability_state(value, state) 1.16 + if state and tostring(value) ~= state then 1.17 + return true 1.18 + else 1.19 + return false 1.20 + end 1.21 +end 1.22 + 1.23 return _M 1.24 1.25