summaryrefslogtreecommitdiffstats
path: root/core/device.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-10-25 07:53:40 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-10-25 13:59:04 -0700
commitfaebb539091ca5550bb6b60280d692c50d547bc0 (patch)
tree785284eedbc783bfd0f02318c05cabf48712e8ed /core/device.cpp
parent572e2678a0c5e1a9c2a947e4a9a86f35cec125eb (diff)
downloadsubsurface-faebb539091ca5550bb6b60280d692c50d547bc0.tar.gz
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>
Diffstat (limited to 'core/device.cpp')
-rw-r--r--core/device.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/device.cpp b/core/device.cpp
index bd1d75416..47ce72b17 100644
--- a/core/device.cpp
+++ b/core/device.cpp
@@ -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;