diff options
author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2024-10-04 16:12:26 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-04 16:12:26 -0400 |
commit | 70f76b377e2d35fa097b65a82fc7cac4f5f172d4 (patch) | |
tree | 7ff5169c28b1c14d91ab00452806a087d1562690 /include | |
parent | 6e72330a3cc8d571b14f2234ed8fc2778b5e9b86 (diff) | |
parent | bf1ecd2deb3c2d777efe93c0da6212bdbcc2240e (diff) | |
download | stasis-70f76b377e2d35fa097b65a82fc7cac4f5f172d4.tar.gz |
Merge pull request #51 from jhunkeler/wheel-funcs-clean-up
Clean up get_wheel_info
Diffstat (limited to 'include')
-rw-r--r-- | include/wheel.h | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/include/wheel.h b/include/wheel.h index 619e0f7..b394b55 100644 --- a/include/wheel.h +++ b/include/wheel.h @@ -5,20 +5,31 @@ #include <string.h> #include <stdio.h> #include "str.h" - -#define WHEEL_MATCH_EXACT 0 -#define WHEEL_MATCH_ANY 1 +#define WHEEL_MATCH_EXACT 0 ///< Match when all patterns are present +#define WHEEL_MATCH_ANY 1 ///< Match when any patterns are present struct Wheel { - char *distribution; - char *version; - char *build_tag; - char *python_tag; - char *abi_tag; - char *platform_tag; - char *path_name; - char *file_name; + char *distribution; ///< Package name + char *version; ///< Package version + char *build_tag; ///< Package build tag (optional) + char *python_tag; ///< Package Python tag (pyXY) + char *abi_tag; ///< Package ABI tag (cpXY, abiX, none) + char *platform_tag; ///< Package platform tag (linux_x86_64, any) + char *path_name; ///< Path to package on-disk + char *file_name; ///< Name of package on-disk }; -struct Wheel *get_wheel_file(const char *basepath, const char *name, char *to_match[], unsigned match_mode); +/** + * Extract metadata from a Python Wheel file name + * + * @param basepath directory containing a wheel file + * @param name of wheel file + * @param to_match a NULL terminated array of patterns (i.e. platform, arch, version, etc) + * @param match_mode WHEEL_MATCH_EXACT + * @param match_mode WHEEL_MATCH ANY + * @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); #endif //STASIS_WHEEL_H |