rcutils
is a C API consisting of macros, functions, and data structures used through out the ROS 2 code base.
The API is a combination of parts:
- Allocator concept, used to inject the allocating and deallocating methods into a function or type.
- Command line interface utilities:
- Utilities for setting error states (error message, file, and line number) like
strerror
for errno
:
- Some basic filesystem utilities like checking for path existence, getting the cwd, etc...:
- A C string find method:
- A convenient string formatting function, which takes a custom allocator:
- A function to get an environment variable's value:
- Extensible logging macros:
- A string replacement function which takes an allocator, based on http://creativeandcritical.net/str-replace-c:
- String splitting functions which take a custom allocator:
- A version of
strdup
which takes an allocator:
- Portable implementations of "get system time" and "get steady time":
- Some useful data structures:
- A "string array" data structure (analogous to
std::vector<std::string>
):
- A "string-string map" data structure (analogous to
std::map<std::string, std::string>
)
- Macros for controlling symbol visibility and linkage for this library: