diff options
| author | 2023-12-31 02:39:11 -0600 | |
|---|---|---|
| committer | 2023-12-31 02:39:11 -0600 | |
| commit | 7c95357610f722db4ee1f684086fb4478e3875c3 (patch) | |
| tree | a9464f42f256467eaac96ef29ec75acfcbb7b046 /src/version.h | |
| parent | add a little version stuff (diff) | |
downloads versions now
Diffstat (limited to 'src/version.h')
| -rw-r--r-- | src/version.h | 103 |
1 files changed, 17 insertions, 86 deletions
diff --git a/src/version.h b/src/version.h index 01dcbb8..7b02c21 100644 --- a/src/version.h +++ b/src/version.h @@ -11,7 +11,9 @@ enum { VERSION_EJSON, VERSION_EALLOC, VERSION_ERRNO, - VERSION_EDOWNLOAD + VERSION_EDOWNLOAD, + VERSION_ENOTFOUND, + VERSION_ERECURSE }; struct l2_version_remote { @@ -34,6 +36,15 @@ enum { VERSION_ARG_ACTION_DISALLOW }; +enum { + VERSION_DOWNLOAD_CLIENT, + VERSION_DOWNLOAD_SERVER, + VERSION_DOWNLOAD_WINDOWS_SERVER, + VERSION_DOWNLOAD_CLIENT_MAPPINGS, + VERSION_DOWNLOAD_SERVER_MAPPINGS, + VERSION_DOWNLOAD_MAX +}; + #define FEATURE_DEMO (1u << 0) #define FEATURE_CUSTOM_RES (1u << 1) #define FEATURE_QUICK_PLAY_SUPPORTED (1u << 2) @@ -47,91 +58,9 @@ struct l2_version_download { size_t size; }; -struct l2_version_rule { - unsigned action; - unsigned features; - - struct l2_version_argument_rule_os { - char *name; /* exact match */ - char *arch; /* regex */ - char *version; /* regex */ - } os; - - struct l2_version_argument_rule *next; -}; - -struct l2_version_argument { - char **value; /* ends with NULL */ - - struct l2_version_rule *rules; - - struct l2_version_argument *next; -}; - struct l2_version { - struct l2_version_argument *game; - struct l2_version_argument *jvm; - - struct l2_version_asset_index { - char *id; - struct l2_version_download download; - size_t total_size; - } asset_index; - - char *assets; /* should equal asset_index.id */ - json_int_t compliance_level; - - struct l2_version_jar_download { - char *id; - struct l2_version_jar { - char *name; - struct l2_version_download download; - struct l2_version_jar *next; - } *jars; - } downloads; - - struct l2_version_java_version { - char *component; - json_int_t major_version; - } java_version; - - struct l2_version_library { - char *name; - - struct l2_version_library_download { - struct l2_version_library_artifact { - char *path; - struct l2_version_download download; - } *artifact; - - struct l2_version_download_classifier { - char *name; - char *path; - struct l2_version_download download; - struct l2_version_download_classifier *next; - } *classifiers; - } downloads; - - struct l2_version_library_extract { - char **exclude; /* ends with NULL */ - } *extract; - - struct l2_version_rule *rules; - - struct l2_version_native { - char *os; - char *name; - struct l2_version_native *next; - } *natives; - } *libraries; - - char *main_class; - char *type; - time_t release_time; - time_t time; - - struct l2_version *inherits; - /* minecraftArguments, */ + json_t *data; + struct l2_version *inherit; }; extern const char *const l2_version__messages[]; @@ -140,6 +69,8 @@ extern const char *const l2_version__messages[]; unsigned l2_version_load_remote(void); -unsigned l2_version_load_local(const char *name); +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); #endif /* include guard */ |
