diff options
-rw-r--r-- | include/manifest.h | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/include/manifest.h b/include/manifest.h index a6445d8..e3e756e 100644 --- a/include/manifest.h +++ b/include/manifest.h @@ -3,34 +3,28 @@ #define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2) + 1 -#define PACKAGE_MEMBER_SIZE 0xff -#define PACKAGE_MEMBER_ORIGIN_SIZE PATH_MAX -#define PACKAGE_MEMBER_SEPARATOR '-' -#define PACKAGE_MEMBER_SEPARATOR_PLACEHOLD '*' - #define SPM_MANIFEST_SEPARATOR '|' #define SPM_MANIFEST_SEPARATOR_MAX 7 #define SPM_MANIFEST_NODATA "*" #define SPM_MANIFEST_HEADER "# SPM PACKAGE MANIFEST" #define SPM_MANIFEST_FILENAME "manifest.dat" -#define SPM_PACKAGE_EXTENSION ".tar.gz" typedef struct { char **requirements; size_t requirements_records; size_t size; - char archive[PACKAGE_MEMBER_SIZE]; - char name[PACKAGE_MEMBER_SIZE]; - char version[PACKAGE_MEMBER_SIZE]; - char revision[PACKAGE_MEMBER_SIZE]; + char archive[SPM_PACKAGE_MEMBER_SIZE]; + char name[SPM_PACKAGE_MEMBER_SIZE]; + char version[SPM_PACKAGE_MEMBER_SIZE]; + char revision[SPM_PACKAGE_MEMBER_SIZE]; char checksum_sha256[SHA256_DIGEST_STRING_LENGTH]; - char origin[PACKAGE_MEMBER_ORIGIN_SIZE]; + char origin[SPM_PACKAGE_MEMBER_ORIGIN_SIZE]; } ManifestPackage; typedef struct { size_t records; ManifestPackage **packages; - char origin[PACKAGE_MEMBER_ORIGIN_SIZE]; + char origin[SPM_PACKAGE_MEMBER_ORIGIN_SIZE]; } Manifest; typedef struct { @@ -40,6 +34,7 @@ typedef struct { } ManifestList; int fetch(const char *url, const char *dest); +int manifest_package_cmp(ManifestPackage *a, ManifestPackage *b); void manifest_package_separator_swap(char **name); void manifest_package_separator_restore(char **name); Manifest *manifest_from(const char *package_dir); |