#ifndef L2SU_VERSION_H_INCLUDED #define L2SU_VERSION_H_INCLUDED #include "digest/digest.h" #include #include enum { VERSION_SUCCESS, VERSION_EFORMAT, VERSION_EJSON, VERSION_EALLOC, VERSION_ERRNO, VERSION_EDOWNLOAD }; struct l2_version_remote { struct l2_version_remote *next; struct l2_version_remote *prev; char *id; char *type; char *url; l2_sha1_digest_t sha1; json_int_t compliance_level; time_t update_time; time_t release_time; }; enum { VERSION_ARG_ACTION_ALLOW, VERSION_ARG_ACTION_DISALLOW }; #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) struct l2_version_download { char *url; l2_sha1_digest_t sha1; 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, */ }; extern const char *const l2_version__messages[]; #define l2_version_strerror(_en) l2_version__messages[(_en)] unsigned l2_version_load_remote(void); unsigned l2_version_load_local(const char *name); #endif /* include guard */