blob: 01dcbb89923b07f9b918742daac8d92254737375 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
#ifndef L2SU_VERSION_H_INCLUDED
#define L2SU_VERSION_H_INCLUDED
#include "digest/digest.h"
#include <time.h>
#include <jansson.h>
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 */
|