undo: add device related undo commands

Add commands for deleting devices and editing device nicknames
to include the device-handling in the undo system.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-10-25 07:53:40 +01:00 committed by Dirk Hohndel
parent 572e2678a0
commit faebb53909
9 changed files with 140 additions and 1 deletions

View file

@ -392,6 +392,13 @@ extern "C" const struct device *get_device(const struct device_table *table, int
return &table->devices[i];
}
extern "C" struct device *get_device_mutable(struct device_table *table, int i)
{
if (i < 0 || i > nr_devices(table))
return NULL;
return &table->devices[i];
}
extern "C" const char *device_get_model(const struct device *dev)
{
return dev ? dev->model.c_str() : NULL;