Modules determine their own compatibility with the library
A module is built against the system-installed libdpm-core.so and is responsible for being correct against it. Where it needs to act on the version it is running under, dpm_core_version() reports that and the module decides for itself. dpm_module_core_min() is removed. It was a declaration handed to the library to enforce on the module's behalf, and enforcement of that kind belongs nowhere in a library that routes and hosts. The contract is now three reserved symbols and load validation is two steps: the reserved symbols resolve, and the version and description probes return well-formed values. compare_versions had no remaining caller and is removed; parse_version stays for the well-formedness probe. The core_too_new fixture went with the handshake it existed to exercise.
This commit is contained in:
@@ -34,7 +34,6 @@ struct dpm_module {
|
||||
void* handle = nullptr;
|
||||
std::string version;
|
||||
std::string description;
|
||||
std::string core_min;
|
||||
int (*execute)(dpm_ctx*, const char*, int, char**) = nullptr;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file version.hpp
|
||||
* @brief X.Y.Z version parsing and comparison
|
||||
* @brief X.Y.Z version parsing
|
||||
*
|
||||
* @copyright Copyright (c) 2026 SILO GROUP LLC
|
||||
* @author Chris Punches <chris.punches@silogroup.org>
|
||||
@@ -33,13 +33,4 @@ namespace dpmcore {
|
||||
*/
|
||||
bool parse_version(const char* s, long out[3]);
|
||||
|
||||
/**
|
||||
* @brief Compares two valid X.Y.Z version strings
|
||||
*
|
||||
* @param a First version
|
||||
* @param b Second version
|
||||
* @return -1 if a < b, 0 if equal, 1 if a > b
|
||||
*/
|
||||
int compare_versions(const char* a, const char* b);
|
||||
|
||||
} // namespace dpmcore
|
||||
|
||||
Reference in New Issue
Block a user