Skip to content

[th/platform-obj-rename-pt1] rename objects in Platform an cleanup naming/structure (part 1)

Thomas Haller requested to merge th/platform-obj-rename-pt1 into main

NMPlatform is the platform cache object and (correctly) resides in "nm-platform.c".

However, in "nm-platform.[hc]" we have an abundance of other objects that share the "NMPlatform" prefix in their name. Consequently, we have nm_platform_ip4_address_to_string() and nm_platform_ip4_address_get() (the latter is a method of NMPlatform, the former of NMPlatformIP4Address).

Also, those objects like NMPlatformIP4Address are relatively simple structures. There are some accessor, initializer, to-string, compare, hash functions, but mostly functions that trivially operate on the struct. On the other hand, NMPlatform object is massive and obviously has a lot of non-trivial state.

The end goal will be to move the simpler struct (like NMPlatformIP4Address) out of nm-platform.[hc], and rename them to give them a unique prefix (so that their accessor functions like ${TYPE}_to_string() can clearly be recognized as "methods". Also, these objects have their NMPObject siblings (NMPlatformIP4Address and NMPObjectIP4Address). These names should be unified (and NMPObjectIP4Address has also the problem that it shares a prefix with NMPObject, NMPObjectClass).

This is a long term effort. Here just a first move in that direction.

Merge request reports