diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-02-24 00:19:16 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-02-24 00:19:16 -0500 |
commit | 1eb1d56f1ea6dc33ee3a7088d0d28edbe3ad6178 (patch) | |
tree | a72b17129c4078ba4a2c4336b8f3d67ad9a00ee0 /include/manifest.h | |
parent | 9220ab72133fdc7cf59c1bfd08ef6f7ee4350988 (diff) | |
download | spmc-1eb1d56f1ea6dc33ee3a7088d0d28edbe3ad6178.tar.gz |
Use package.h
Diffstat (limited to 'include/manifest.h')
-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); |