aboutsummaryrefslogtreecommitdiff
path: root/src/lib/core
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2026-02-04 10:36:38 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2026-04-07 09:48:08 -0400
commitd3a39e32a33b7268b6c9329398efa2d12466feb7 (patch)
tree86ce5bdf8dc50c2a1bd57a78515083273d39a345 /src/lib/core
parentd01b465eee667e8efa4aa7c3088dc7af18ea2ab2 (diff)
downloadstasis-d3a39e32a33b7268b6c9329398efa2d12466feb7.tar.gz
Rename wheel.c and wheel.h to wheelinfo.c and wheelinfo.h
* Refactor wheel struct as WheelInfo * Refactor wheel_* functions as wheelinfo_* # Conflicts: # src/lib/core/wheelinfo.c
Diffstat (limited to 'src/lib/core')
-rw-r--r--src/lib/core/CMakeLists.txt2
-rw-r--r--src/lib/core/include/wheelinfo.h (renamed from src/lib/core/include/wheel.h)6
-rw-r--r--src/lib/core/wheelinfo.c (renamed from src/lib/core/wheel.c)18
3 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/core/CMakeLists.txt b/src/lib/core/CMakeLists.txt
index eb7a908..d264010 100644
--- a/src/lib/core/CMakeLists.txt
+++ b/src/lib/core/CMakeLists.txt
@@ -11,7 +11,7 @@ add_library(stasis_core STATIC
download.c
recipe.c
relocation.c
- wheel.c
+ wheelinfo.c
copy.c
artifactory.c
template.c
diff --git a/src/lib/core/include/wheel.h b/src/lib/core/include/wheelinfo.h
index 1a689e9..8009e91 100644
--- a/src/lib/core/include/wheel.h
+++ b/src/lib/core/include/wheelinfo.h
@@ -9,7 +9,7 @@
#define WHEEL_MATCH_EXACT 0 ///< Match when all patterns are present
#define WHEEL_MATCH_ANY 1 ///< Match when any patterns are present
-struct Wheel {
+struct WheelInfo {
char *distribution; ///< Package name
char *version; ///< Package version
char *build_tag; ///< Package build tag (optional)
@@ -31,6 +31,6 @@ struct Wheel {
* @return pointer to populated Wheel on success
* @return NULL on error
*/
-struct Wheel *get_wheel_info(const char *basepath, const char *name, char *to_match[], unsigned match_mode);
-void wheel_free(struct Wheel **wheel);
+struct WheelInfo *wheelinfo_get(const char *basepath, const char *name, char *to_match[], unsigned match_mode);
+void wheelinfo_free(struct WheelInfo **wheel);
#endif //STASIS_WHEEL_H
diff --git a/src/lib/core/wheel.c b/src/lib/core/wheelinfo.c
index 79b5a21..1a93a82 100644
--- a/src/lib/core/wheel.c
+++ b/src/lib/core/wheelinfo.c
@@ -1,8 +1,8 @@
-#include "wheel.h"
+#include "wheelinfo.h"
-struct Wheel *get_wheel_info(const char *basepath, const char *name, char *to_match[], unsigned match_mode) {
+struct WheelInfo *wheelinfo_get(const char *basepath, const char *name, char *to_match[], unsigned match_mode) {
struct dirent *rec;
- struct Wheel *result = NULL;
+ struct WheelInfo *result = NULL;
char package_path[PATH_MAX];
char package_name[NAME_MAX];
@@ -55,14 +55,14 @@ struct Wheel *get_wheel_info(const char *basepath, const char *name, char *to_ma
result->path_name = realpath(package_path, NULL);
if (!result->path_name) {
SYSERROR("Unable to resolve absolute path to %s: %s", filename, strerror(errno));
- wheel_free(&result);
+ wheelinfo_free(&result);
closedir(dp);
return NULL;
}
result->file_name = strdup(rec->d_name);
if (!result->file_name) {
SYSERROR("Unable to allocate bytes for %s: %s", rec->d_name, strerror(errno));
- wheel_free(&result);
+ wheelinfo_free(&result);
closedir(dp);
return NULL;
}
@@ -74,7 +74,7 @@ struct Wheel *get_wheel_info(const char *basepath, const char *name, char *to_ma
// directory with a malformed file name, or we've managed to
// exhaust the system's memory
SYSERROR("%s has no '-' separators! (Delete this file and try again)", filename);
- wheel_free(&result);
+ wheelinfo_free(&result);
closedir(dp);
return NULL;
}
@@ -100,7 +100,7 @@ struct Wheel *get_wheel_info(const char *basepath, const char *name, char *to_ma
SYSERROR("Unknown wheel name format: %s. Expected 5 or 6 strings "
"separated by '-', but got %zu instead", filename, parts_total);
guard_array_free(parts);
- wheel_free(&result);
+ wheelinfo_free(&result);
closedir(dp);
return NULL;
}
@@ -111,8 +111,8 @@ struct Wheel *get_wheel_info(const char *basepath, const char *name, char *to_ma
return result;
}
-void wheel_free(struct Wheel **wheel) {
- struct Wheel *w = (*wheel);
+void wheelinfo_free(struct WheelInfo **wheel) {
+ struct WheelInfo *w = (*wheel);
if (!w) {
return;
}