ueventd: replace char** links with std::vector<std::string>
Additionally replace the associated C string parsing with C++ and write
unit tests.
Bug: 33785894
Bug: 36250207
Test: Boot bullhead + unit tests
Change-Id: Iee1f72d248bca3bd2e1227045628935b3dd6195a
diff --git a/init/devices.h b/init/devices.h
index abf1e7c..f6183c9 100644
--- a/init/devices.h
+++ b/init/devices.h
@@ -20,6 +20,8 @@
#include <sys/stat.h>
#include <functional>
+#include <string>
+#include <vector>
enum coldboot_action_t {
// coldboot continues without creating the device for the uevent
@@ -59,8 +61,8 @@
// Exposed for testing
void add_platform_device(const char* path);
void remove_platform_device(const char* path);
-char** get_character_device_symlinks(uevent* uevent);
-char** get_block_device_symlinks(struct uevent* uevent);
-void sanitize_partition_name(char* s);
+std::vector<std::string> get_character_device_symlinks(uevent* uevent);
+std::vector<std::string> get_block_device_symlinks(uevent* uevent);
+void sanitize_partition_name(std::string* string);
#endif /* _INIT_DEVICES_H */