Rework management of configuration files.
Closed this issue · 2 comments
Every configuration file is in JSON format.
So far, we used cjson to handle them.
This leads to a lot of code for the serialization stuff, which is not interesting to read/write.
So lets switch to what Azy (maelstrom) can do to make things easier!
Azy will allow us to automatically write C code to handle serialization of JSON data.
And im always happier when i have less code to maintain, for the same result.
One problem that shows up is the use of eina_array, eina_hash and eina_inlist while azy will only allow us to do serialization over eina_list.
Lots of breakage will have to be done if we move thoses.
the sysinfo module cant use azy as its conf file isnt good.
Example file :
{
"hw" : [{
"manufacturer" : "dmidecode -t system | grep 'Manufacturer:' | cut -d: -f2",
"product_name" : "dmidecode -t system | grep 'Product Name:' | cut -d: -f2",
"serial_number" : "dmidecode -t system | grep 'Serial Number:' | cut -d: -f2"
}],
"commands" : [{
".uptime" : "uptime",
".psax" : "ps ax",
".reboot" : "reboot"
}],
"vars" : [
]
}
The Commands array contains and object having strings of random names.
Impossible to write a .azy file from that.
This module will need a complete rework on this part if we want to be able to use Azy for serialization.