diff options
| author | 2024-01-01 03:44:59 -0600 | |
|---|---|---|
| committer | 2024-01-01 03:44:59 -0600 | |
| commit | 12d53b3661231650c7563be9ddd2cd3cbfafeec1 (patch) | |
| tree | ebfbc4220fa64e139df84714928bd67d51231232 /src/version.h | |
| parent | downloads versions now (diff) | |
now loads libraries
Diffstat (limited to 'src/version.h')
| -rw-r--r-- | src/version.h | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/src/version.h b/src/version.h index 7b02c21..c3448eb 100644 --- a/src/version.h +++ b/src/version.h @@ -4,6 +4,7 @@ #include "digest/digest.h" #include <time.h> #include <jansson.h> +#include <stdbool.h> enum { VERSION_SUCCESS, @@ -45,12 +46,7 @@ enum { VERSION_DOWNLOAD_MAX }; -#define FEATURE_DEMO (1u << 0) -#define FEATURE_CUSTOM_RES (1u << 1) -#define FEATURE_QUICK_PLAY_SUPPORTED (1u << 2) -#define FEATURE_QUICK_PLAY_SINGLEPLAYER (1u << 3) -#define FEATURE_QUICK_PLAY_MULTIPLAYER (1u << 4) -#define FEATURE_QUICK_PLAY_REALMS (1u << 5) +typedef bool (l2_version_feature_match_proc_t)(const char *name, json_t *val); struct l2_version_download { char *url; @@ -58,6 +54,26 @@ struct l2_version_download { size_t size; }; +struct l2_version_library { + char *url; + char *artifactpath; + + l2_sha1_digest_t digest; + bool has_digest; + size_t size; + + struct { + enum { + EXTRACT_NONE, /* do not extract anything */ + EXTRACT_OLD, /* extract whole jar, preserving entries that are not excluded */ + EXTRACT_NEW /* extract only .dll, .so, .dylib from jar */ + } extracttype; + char **exclude; + } extract; + + struct l2_version_library *next; +}; + struct l2_version { json_t *data; struct l2_version *inherit; @@ -73,4 +89,11 @@ unsigned l2_version_load_local(const char *name, json_t **ojs); int l2_version_check_integrity(FILE *fp, l2_sha1_digest_t *digest, size_t sz); +enum l2_version_check_result { + RULE_CHECK_ERROR = -1, + RULE_CHECK_DEFAULT, + RULE_CHECK_ALLOW, + RULE_CHECK_DISALLOW, +} l2_version_check_rules(json_t *rules, l2_version_feature_match_proc_t *matcher); + #endif /* include guard */ |
