sfml3-rb 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +9 -0
- data/CHANGELOG.md +43 -17
- data/README.md +97 -29
- data/ext/audio/audio_enums.c +58 -20
- data/ext/audio/listener.c +89 -6
- data/ext/audio/music.c +206 -5
- data/ext/audio/sound.c +175 -5
- data/ext/audio/sound_buffer.c +189 -47
- data/ext/audio/sound_buffer_recorder.c +83 -16
- data/ext/audio/sound_recorder.c +172 -52
- data/ext/audio/sound_source_cone.c +108 -29
- data/ext/audio/sound_stream.c +178 -5
- data/ext/core/exceptions.c +10 -8
- data/ext/core/unicode.c +12 -2
- data/ext/ext.c +4 -0
- data/ext/graphics/blend_mode.c +203 -53
- data/ext/graphics/circle.c +271 -4
- data/ext/graphics/color.c +240 -90
- data/ext/graphics/drawable.c +15 -4
- data/ext/graphics/font.c +138 -25
- data/ext/graphics/glyph.c +31 -8
- data/ext/graphics/image.c +180 -37
- data/ext/graphics/polygon.c +293 -26
- data/ext/graphics/rect.c +211 -54
- data/ext/graphics/rectangle.c +279 -26
- data/ext/graphics/render_state.c +116 -2
- data/ext/graphics/render_texture.c +163 -2
- data/ext/graphics/shader.c +283 -17
- data/ext/graphics/shape.c +252 -26
- data/ext/graphics/sprite.c +216 -25
- data/ext/graphics/stencil_mode.c +148 -39
- data/ext/graphics/target.c +67 -22
- data/ext/graphics/target.h +15 -15
- data/ext/graphics/text.c +306 -6
- data/ext/graphics/texture.c +257 -3
- data/ext/graphics/transform.c +178 -5
- data/ext/graphics/transformable.c +126 -2
- data/ext/graphics/vertex.c +79 -2
- data/ext/graphics/vertex_array.c +128 -16
- data/ext/graphics/vertex_buffer.c +124 -2
- data/ext/graphics/view.c +130 -2
- data/ext/network/ftp.c +249 -10
- data/ext/network/http.c +156 -38
- data/ext/network/ip_address.c +107 -26
- data/ext/network/network_enums.c +248 -141
- data/ext/network/packet.c +273 -39
- data/ext/network/socket_selector.c +91 -19
- data/ext/network/tcp_listener.c +75 -16
- data/ext/network/tcp_socket.c +128 -25
- data/ext/network/udp_socket.c +122 -26
- data/ext/ports.rb +7 -0
- data/ext/system/buffer.c +41 -12
- data/ext/system/clock.c +68 -9
- data/ext/system/input_stream.c +94 -42
- data/ext/system/sleep.c +10 -2
- data/ext/system/time.c +172 -34
- data/ext/system/vec2.c +156 -35
- data/ext/system/vec3.c +166 -35
- data/ext/window/clipboard.c +47 -17
- data/ext/window/context.c +59 -9
- data/ext/window/context_settings.c +116 -38
- data/ext/window/cursor.c +39 -9
- data/ext/window/event.c +163 -42
- data/ext/window/joystick.c +69 -3
- data/ext/window/keyboard.c +168 -116
- data/ext/window/mouse.c +36 -2
- data/ext/window/sensor.c +28 -2
- data/ext/window/touch.c +20 -2
- data/ext/window/video_mode.c +90 -19
- data/ext/window/vulkan.c +34 -6
- data/ext/window/window.c +340 -16
- data/lib/sfml/version.rb +1 -1
- data/sig/audio/audio_enums.rbs +30 -0
- data/sig/audio/listener.rbs +16 -0
- data/sig/audio/music.rbs +56 -0
- data/sig/audio/sound.rbs +51 -0
- data/sig/audio/sound_buffer.rbs +17 -0
- data/sig/audio/sound_buffer_recorder.rbs +14 -0
- data/sig/audio/sound_recorder.rbs +17 -0
- data/sig/audio/sound_source_cone.rbs +14 -0
- data/sig/audio/sound_stream.rbs +51 -0
- data/sig/graphics/blend_mode.rbs +29 -0
- data/sig/graphics/circle.rbs +44 -0
- data/sig/graphics/color.rbs +39 -0
- data/sig/graphics/drawable.rbs +5 -0
- data/sig/graphics/font.rbs +20 -0
- data/sig/graphics/glyph.rbs +7 -0
- data/sig/graphics/image.rbs +22 -0
- data/sig/graphics/polygon.rbs +42 -0
- data/sig/graphics/rect.rbs +33 -0
- data/sig/graphics/rectangle.rbs +42 -0
- data/sig/graphics/render_state.rbs +21 -0
- data/sig/graphics/render_texture.rbs +37 -0
- data/sig/graphics/shader.rbs +39 -0
- data/sig/graphics/shape.rbs +38 -0
- data/sig/graphics/sprite.rbs +34 -0
- data/sig/graphics/stencil_mode.rbs +18 -0
- data/sig/graphics/target.rbs +10 -0
- data/sig/graphics/text.rbs +48 -0
- data/sig/graphics/texture.rbs +34 -0
- data/sig/graphics/transform.rbs +37 -0
- data/sig/graphics/transformable.rbs +25 -0
- data/sig/graphics/vertex.rbs +17 -0
- data/sig/graphics/vertex_array.rbs +17 -0
- data/sig/graphics/vertex_buffer.rbs +22 -0
- data/sig/graphics/view.rbs +24 -0
- data/sig/network/ftp.rbs +46 -0
- data/sig/network/http.rbs +27 -0
- data/sig/network/ip_address.rbs +22 -0
- data/sig/network/network_enums.rbs +95 -0
- data/sig/network/packet.rbs +40 -0
- data/sig/network/socket_selector.rbs +14 -0
- data/sig/network/tcp_listener.rbs +13 -0
- data/sig/network/tcp_socket.rbs +18 -0
- data/sig/network/udp_socket.rbs +17 -0
- data/sig/system/buffer.rbs +11 -0
- data/sig/system/clock.rbs +13 -0
- data/sig/system/input_stream.rbs +7 -0
- data/sig/system/sleep.rbs +3 -0
- data/sig/system/time.rbs +28 -0
- data/sig/system/vec2.rbs +26 -0
- data/sig/system/vec3.rbs +27 -0
- data/sig/window/clipboard.rbs +8 -0
- data/sig/window/context.rbs +11 -0
- data/sig/window/context_settings.rbs +20 -0
- data/sig/window/cursor.rbs +6 -0
- data/sig/window/event.rbs +20 -0
- data/sig/window/joystick.rbs +15 -0
- data/sig/window/keyboard.rbs +10 -0
- data/sig/window/mouse.rbs +9 -0
- data/sig/window/sensor.rbs +8 -0
- data/sig/window/touch.rbs +6 -0
- data/sig/window/video_mode.rbs +16 -0
- data/sig/window/vulkan.rbs +7 -0
- data/sig/window/window.rbs +57 -0
- metadata +66 -2
data/ext/network/network_enums.c
CHANGED
|
@@ -3,42 +3,41 @@
|
|
|
3
3
|
#include <ruby.h>
|
|
4
4
|
#include <string.h>
|
|
5
5
|
|
|
6
|
-
static const char
|
|
7
|
-
|
|
8
|
-
static const char
|
|
6
|
+
static const char* socket_status_names[] = {"done", "not_ready", "partial", "disconnected",
|
|
7
|
+
"error"};
|
|
8
|
+
static const char* http_method_names[] = {"get", "post", "head", "put", "delete"};
|
|
9
|
+
static const char* ftp_transfer_mode_names[] = {"binary", "ascii", "ebcdic"};
|
|
9
10
|
|
|
10
11
|
typedef struct {
|
|
11
12
|
int value;
|
|
12
|
-
const char
|
|
13
|
+
const char* name;
|
|
13
14
|
} EnumName;
|
|
14
15
|
|
|
15
16
|
/* The HTTP and FTP status enums are sparse and mostly meaningful by number,
|
|
16
17
|
so they are stored as value/name pairs and looked up linearly. */
|
|
17
|
-
static const EnumName http_status_names[] = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
{sfHttpConnectionFailed, "connection_failed"}
|
|
41
|
-
};
|
|
18
|
+
static const EnumName http_status_names[] = {{sfHttpOk, "ok"},
|
|
19
|
+
{sfHttpCreated, "created"},
|
|
20
|
+
{sfHttpAccepted, "accepted"},
|
|
21
|
+
{sfHttpNoContent, "no_content"},
|
|
22
|
+
{sfHttpResetContent, "reset_content"},
|
|
23
|
+
{sfHttpPartialContent, "partial_content"},
|
|
24
|
+
{sfHttpMultipleChoices, "multiple_choices"},
|
|
25
|
+
{sfHttpMovedPermanently, "moved_permanently"},
|
|
26
|
+
{sfHttpMovedTemporarily, "moved_temporarily"},
|
|
27
|
+
{sfHttpNotModified, "not_modified"},
|
|
28
|
+
{sfHttpBadRequest, "bad_request"},
|
|
29
|
+
{sfHttpUnauthorized, "unauthorized"},
|
|
30
|
+
{sfHttpForbidden, "forbidden"},
|
|
31
|
+
{sfHttpNotFound, "not_found"},
|
|
32
|
+
{sfHttpRangeNotSatisfiable, "range_not_satisfiable"},
|
|
33
|
+
{sfHttpInternalServerError, "internal_server_error"},
|
|
34
|
+
{sfHttpNotImplemented, "not_implemented"},
|
|
35
|
+
{sfHttpBadGateway, "bad_gateway"},
|
|
36
|
+
{sfHttpServiceNotAvailable, "service_not_available"},
|
|
37
|
+
{sfHttpGatewayTimeout, "gateway_timeout"},
|
|
38
|
+
{sfHttpVersionNotSupported, "version_not_supported"},
|
|
39
|
+
{sfHttpInvalidResponse, "invalid_response"},
|
|
40
|
+
{sfHttpConnectionFailed, "connection_failed"}};
|
|
42
41
|
|
|
43
42
|
static const EnumName ftp_status_names[] = {
|
|
44
43
|
{sfFtpRestartMarkerReply, "restart_marker_reply"},
|
|
@@ -83,11 +82,10 @@ static const EnumName ftp_status_names[] = {
|
|
|
83
82
|
{sfFtpInvalidResponse, "invalid_response"},
|
|
84
83
|
{sfFtpConnectionFailed, "connection_failed"},
|
|
85
84
|
{sfFtpConnectionClosed, "connection_closed"},
|
|
86
|
-
{sfFtpInvalidFile, "invalid_file"}
|
|
87
|
-
};
|
|
85
|
+
{sfFtpInvalidFile, "invalid_file"}};
|
|
88
86
|
|
|
89
|
-
static int symbol_index(VALUE rb_symbol, const char *
|
|
90
|
-
const char
|
|
87
|
+
static int symbol_index(VALUE rb_symbol, const char* const* names, size_t count) {
|
|
88
|
+
const char* name;
|
|
91
89
|
size_t i;
|
|
92
90
|
|
|
93
91
|
if (!SYMBOL_P(rb_symbol)) {
|
|
@@ -98,14 +96,14 @@ static int symbol_index(VALUE rb_symbol, const char *const *names, size_t count)
|
|
|
98
96
|
|
|
99
97
|
for (i = 0; i < count; i++) {
|
|
100
98
|
if (strcmp(name, names[i]) == 0) {
|
|
101
|
-
return (int)
|
|
99
|
+
return (int)i;
|
|
102
100
|
}
|
|
103
101
|
}
|
|
104
102
|
|
|
105
103
|
return -1;
|
|
106
104
|
}
|
|
107
105
|
|
|
108
|
-
const char
|
|
106
|
+
const char* socket_status_name(sfSocketStatus status) {
|
|
109
107
|
if (status >= sfSocketDone && status <= sfSocketError) {
|
|
110
108
|
return socket_status_names[status];
|
|
111
109
|
}
|
|
@@ -117,7 +115,7 @@ sfSocketStatus socket_status_from_rb(VALUE rb_status) {
|
|
|
117
115
|
int index;
|
|
118
116
|
|
|
119
117
|
if (RB_INTEGER_TYPE_P(rb_status)) {
|
|
120
|
-
return (sfSocketStatus)
|
|
118
|
+
return (sfSocketStatus)NUM2INT(rb_status);
|
|
121
119
|
}
|
|
122
120
|
|
|
123
121
|
index = symbol_index(rb_status, socket_status_names, 5);
|
|
@@ -126,10 +124,10 @@ sfSocketStatus socket_status_from_rb(VALUE rb_status) {
|
|
|
126
124
|
rb_raise(rb_eArgError, "unknown socket status");
|
|
127
125
|
}
|
|
128
126
|
|
|
129
|
-
return (sfSocketStatus)
|
|
127
|
+
return (sfSocketStatus)index;
|
|
130
128
|
}
|
|
131
129
|
|
|
132
|
-
const char
|
|
130
|
+
const char* http_method_name(sfHttpMethod method) {
|
|
133
131
|
if (method >= sfHttpGet && method <= sfHttpDelete) {
|
|
134
132
|
return http_method_names[method];
|
|
135
133
|
}
|
|
@@ -141,7 +139,7 @@ sfHttpMethod http_method_from_rb(VALUE rb_method) {
|
|
|
141
139
|
int index;
|
|
142
140
|
|
|
143
141
|
if (RB_INTEGER_TYPE_P(rb_method)) {
|
|
144
|
-
return (sfHttpMethod)
|
|
142
|
+
return (sfHttpMethod)NUM2INT(rb_method);
|
|
145
143
|
}
|
|
146
144
|
|
|
147
145
|
index = symbol_index(rb_method, http_method_names, 5);
|
|
@@ -150,10 +148,10 @@ sfHttpMethod http_method_from_rb(VALUE rb_method) {
|
|
|
150
148
|
rb_raise(rb_eArgError, "unknown HTTP method");
|
|
151
149
|
}
|
|
152
150
|
|
|
153
|
-
return (sfHttpMethod)
|
|
151
|
+
return (sfHttpMethod)index;
|
|
154
152
|
}
|
|
155
153
|
|
|
156
|
-
static const char
|
|
154
|
+
static const char* lookup_name(const EnumName* table, size_t count, int value) {
|
|
157
155
|
size_t i;
|
|
158
156
|
|
|
159
157
|
for (i = 0; i < count; i++) {
|
|
@@ -165,14 +163,14 @@ static const char *lookup_name(const EnumName *table, size_t count, int value) {
|
|
|
165
163
|
return NULL;
|
|
166
164
|
}
|
|
167
165
|
|
|
168
|
-
const char
|
|
169
|
-
const char
|
|
170
|
-
|
|
166
|
+
const char* http_status_name(sfHttpStatus status) {
|
|
167
|
+
const char* name = lookup_name(
|
|
168
|
+
http_status_names, sizeof(http_status_names) / sizeof(http_status_names[0]), status);
|
|
171
169
|
|
|
172
170
|
return name != NULL ? name : "unknown";
|
|
173
171
|
}
|
|
174
172
|
|
|
175
|
-
const char
|
|
173
|
+
const char* ftp_transfer_mode_name(sfFtpTransferMode mode) {
|
|
176
174
|
if (mode >= sfFtpBinary && mode <= sfFtpEbcdic) {
|
|
177
175
|
return ftp_transfer_mode_names[mode];
|
|
178
176
|
}
|
|
@@ -184,7 +182,7 @@ sfFtpTransferMode ftp_transfer_mode_from_rb(VALUE rb_mode) {
|
|
|
184
182
|
int index;
|
|
185
183
|
|
|
186
184
|
if (RB_INTEGER_TYPE_P(rb_mode)) {
|
|
187
|
-
return (sfFtpTransferMode)
|
|
185
|
+
return (sfFtpTransferMode)NUM2INT(rb_mode);
|
|
188
186
|
}
|
|
189
187
|
|
|
190
188
|
index = symbol_index(rb_mode, ftp_transfer_mode_names, 3);
|
|
@@ -193,106 +191,215 @@ sfFtpTransferMode ftp_transfer_mode_from_rb(VALUE rb_mode) {
|
|
|
193
191
|
rb_raise(rb_eArgError, "unknown FTP transfer mode");
|
|
194
192
|
}
|
|
195
193
|
|
|
196
|
-
return (sfFtpTransferMode)
|
|
194
|
+
return (sfFtpTransferMode)index;
|
|
197
195
|
}
|
|
198
196
|
|
|
199
|
-
const char
|
|
200
|
-
const char
|
|
197
|
+
const char* ftp_status_name(sfFtpStatus status) {
|
|
198
|
+
const char* name = lookup_name(ftp_status_names,
|
|
201
199
|
sizeof(ftp_status_names) / sizeof(ftp_status_names[0]), status);
|
|
202
200
|
|
|
203
201
|
return name != NULL ? name : "unknown";
|
|
204
202
|
}
|
|
205
203
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
VALUE
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
204
|
+
void Init_NetworkEnums(VALUE rb_mSFML) {
|
|
205
|
+
/* Document-module: SFML::SocketStatus
|
|
206
|
+
* Status codes returned by socket send/receive/connect operations.
|
|
207
|
+
*/
|
|
208
|
+
VALUE rb_mSocketStatus = rb_define_module_under(rb_mSFML, "SocketStatus");
|
|
209
|
+
|
|
210
|
+
/* Document-module: SFML::HttpMethod
|
|
211
|
+
* The method (verb) of an HttpRequest.
|
|
212
|
+
*/
|
|
213
|
+
VALUE rb_mHttpMethod = rb_define_module_under(rb_mSFML, "HttpMethod");
|
|
214
|
+
|
|
215
|
+
/* Document-module: SFML::HttpStatus
|
|
216
|
+
* Status codes returned by an HttpResponse, mirroring standard HTTP
|
|
217
|
+
* status codes with a few SFML-specific additions (1000+) for local
|
|
218
|
+
* connection failures.
|
|
219
|
+
*/
|
|
220
|
+
VALUE rb_mHttpStatus = rb_define_module_under(rb_mSFML, "HttpStatus");
|
|
221
|
+
|
|
222
|
+
/* Document-module: SFML::FtpTransferMode
|
|
223
|
+
* The data transfer mode used by Ftp#download and Ftp#upload.
|
|
224
|
+
*/
|
|
225
|
+
VALUE rb_mFtpTransferMode = rb_define_module_under(rb_mSFML, "FtpTransferMode");
|
|
226
|
+
|
|
227
|
+
/* Document-module: SFML::FtpStatus
|
|
228
|
+
* Status codes returned by an FtpResponse, mirroring standard FTP
|
|
229
|
+
* reply codes with a few SFML-specific additions (1000+) for local
|
|
230
|
+
* connection failures.
|
|
231
|
+
*/
|
|
232
|
+
VALUE rb_mFtpStatus = rb_define_module_under(rb_mSFML, "FtpStatus");
|
|
233
|
+
|
|
234
|
+
/* The socket has sent or received the data. */
|
|
235
|
+
rb_define_const(rb_mSocketStatus, "DONE", INT2NUM(sfSocketDone));
|
|
236
|
+
/* The socket is not ready to send or receive data yet. */
|
|
237
|
+
rb_define_const(rb_mSocketStatus, "NOT_READY", INT2NUM(sfSocketNotReady));
|
|
238
|
+
/* The socket sent a part of the data. */
|
|
239
|
+
rb_define_const(rb_mSocketStatus, "PARTIAL", INT2NUM(sfSocketPartial));
|
|
240
|
+
/* The TCP socket has been disconnected. */
|
|
241
|
+
rb_define_const(rb_mSocketStatus, "DISCONNECTED", INT2NUM(sfSocketDisconnected));
|
|
242
|
+
/* An unexpected error happened. */
|
|
243
|
+
rb_define_const(rb_mSocketStatus, "ERROR", INT2NUM(sfSocketError));
|
|
244
|
+
|
|
245
|
+
/* Request in GET mode, the standard method to retrieve a page. */
|
|
246
|
+
rb_define_const(rb_mHttpMethod, "GET", INT2NUM(sfHttpGet));
|
|
247
|
+
/* Request in POST mode, usually to send data to a page. */
|
|
248
|
+
rb_define_const(rb_mHttpMethod, "POST", INT2NUM(sfHttpPost));
|
|
249
|
+
/* Request a page's header only. */
|
|
250
|
+
rb_define_const(rb_mHttpMethod, "HEAD", INT2NUM(sfHttpHead));
|
|
251
|
+
/* Request in PUT mode, useful for a REST API. */
|
|
252
|
+
rb_define_const(rb_mHttpMethod, "PUT", INT2NUM(sfHttpPut));
|
|
253
|
+
/* Request in DELETE mode, useful for a REST API. */
|
|
254
|
+
rb_define_const(rb_mHttpMethod, "DELETE", INT2NUM(sfHttpDelete));
|
|
255
|
+
|
|
256
|
+
/* 200: most common code, returned when the operation was successful. */
|
|
257
|
+
rb_define_const(rb_mHttpStatus, "OK", INT2NUM(sfHttpOk));
|
|
258
|
+
/* 201: the resource has successfully been created. */
|
|
259
|
+
rb_define_const(rb_mHttpStatus, "CREATED", INT2NUM(sfHttpCreated));
|
|
260
|
+
/* 202: the request has been accepted, but will be processed later by the server. */
|
|
261
|
+
rb_define_const(rb_mHttpStatus, "ACCEPTED", INT2NUM(sfHttpAccepted));
|
|
262
|
+
/* 204: the server didn't send any data in return. */
|
|
263
|
+
rb_define_const(rb_mHttpStatus, "NO_CONTENT", INT2NUM(sfHttpNoContent));
|
|
264
|
+
/* 205: the server informs the client that it should clear the view (form) that caused the
|
|
265
|
+
* request to be sent. */
|
|
266
|
+
rb_define_const(rb_mHttpStatus, "RESET_CONTENT", INT2NUM(sfHttpResetContent));
|
|
267
|
+
/* 206: the server has sent a part of the resource, as a response to a partial GET request. */
|
|
268
|
+
rb_define_const(rb_mHttpStatus, "PARTIAL_CONTENT", INT2NUM(sfHttpPartialContent));
|
|
269
|
+
/* 300: the requested page can be accessed from several locations. */
|
|
270
|
+
rb_define_const(rb_mHttpStatus, "MULTIPLE_CHOICES", INT2NUM(sfHttpMultipleChoices));
|
|
271
|
+
/* 301: the requested page has permanently moved to a new location. */
|
|
272
|
+
rb_define_const(rb_mHttpStatus, "MOVED_PERMANENTLY", INT2NUM(sfHttpMovedPermanently));
|
|
273
|
+
/* 302: the requested page has temporarily moved to a new location. */
|
|
274
|
+
rb_define_const(rb_mHttpStatus, "MOVED_TEMPORARILY", INT2NUM(sfHttpMovedTemporarily));
|
|
275
|
+
/* 304: for conditional requests, the requested page hasn't changed and doesn't need to be
|
|
276
|
+
* refreshed. */
|
|
277
|
+
rb_define_const(rb_mHttpStatus, "NOT_MODIFIED", INT2NUM(sfHttpNotModified));
|
|
278
|
+
/* 400: the server couldn't understand the request (syntax error). */
|
|
279
|
+
rb_define_const(rb_mHttpStatus, "BAD_REQUEST", INT2NUM(sfHttpBadRequest));
|
|
280
|
+
/* 401: the requested page needs an authentication to be accessed. */
|
|
281
|
+
rb_define_const(rb_mHttpStatus, "UNAUTHORIZED", INT2NUM(sfHttpUnauthorized));
|
|
282
|
+
/* 403: the requested page cannot be accessed at all, even with authentication. */
|
|
283
|
+
rb_define_const(rb_mHttpStatus, "FORBIDDEN", INT2NUM(sfHttpForbidden));
|
|
284
|
+
/* 404: the requested page doesn't exist. */
|
|
285
|
+
rb_define_const(rb_mHttpStatus, "NOT_FOUND", INT2NUM(sfHttpNotFound));
|
|
286
|
+
/* 407: the server can't satisfy the partial GET request (with a "Range" header field). */
|
|
287
|
+
rb_define_const(rb_mHttpStatus, "RANGE_NOT_SATISFIABLE", INT2NUM(sfHttpRangeNotSatisfiable));
|
|
288
|
+
/* 500: the server encountered an unexpected error. */
|
|
289
|
+
rb_define_const(rb_mHttpStatus, "INTERNAL_SERVER_ERROR", INT2NUM(sfHttpInternalServerError));
|
|
290
|
+
/* 501: the server doesn't implement this request method. */
|
|
291
|
+
rb_define_const(rb_mHttpStatus, "NOT_IMPLEMENTED", INT2NUM(sfHttpNotImplemented));
|
|
292
|
+
/* 502: the gateway server has received an error from the source server. */
|
|
293
|
+
rb_define_const(rb_mHttpStatus, "BAD_GATEWAY", INT2NUM(sfHttpBadGateway));
|
|
294
|
+
/* 503: the service has not been found. */
|
|
295
|
+
rb_define_const(rb_mHttpStatus, "SERVICE_NOT_AVAILABLE", INT2NUM(sfHttpServiceNotAvailable));
|
|
296
|
+
/* 504: the gateway server didn't receive a response from the source server in a proper delay.
|
|
297
|
+
*/
|
|
298
|
+
rb_define_const(rb_mHttpStatus, "GATEWAY_TIMEOUT", INT2NUM(sfHttpGatewayTimeout));
|
|
299
|
+
/* 505: the server doesn't support the version of the HTTP protocol used. */
|
|
300
|
+
rb_define_const(rb_mHttpStatus, "VERSION_NOT_SUPPORTED", INT2NUM(sfHttpVersionNotSupported));
|
|
301
|
+
/* 1000 (SFML-specific): the response is not a valid HTTP one. */
|
|
302
|
+
rb_define_const(rb_mHttpStatus, "INVALID_RESPONSE", INT2NUM(sfHttpInvalidResponse));
|
|
303
|
+
/* 1001 (SFML-specific): the connection with the server failed. */
|
|
304
|
+
rb_define_const(rb_mHttpStatus, "CONNECTION_FAILED", INT2NUM(sfHttpConnectionFailed));
|
|
305
|
+
|
|
306
|
+
/* Binary transfer mode: files are transferred as raw bytes, unmodified. */
|
|
307
|
+
rb_define_const(rb_mFtpTransferMode, "BINARY", INT2NUM(sfFtpBinary));
|
|
308
|
+
/* Text (ASCII) transfer mode: files are converted to/from the text format of the receiving
|
|
309
|
+
* system. */
|
|
310
|
+
rb_define_const(rb_mFtpTransferMode, "ASCII", INT2NUM(sfFtpAscii));
|
|
311
|
+
/* EBCDIC text transfer mode. */
|
|
312
|
+
rb_define_const(rb_mFtpTransferMode, "EBCDIC", INT2NUM(sfFtpEbcdic));
|
|
313
|
+
|
|
314
|
+
/* 110: restart marker reply. */
|
|
315
|
+
rb_define_const(rb_mFtpStatus, "RESTART_MARKER_REPLY", INT2NUM(sfFtpRestartMarkerReply));
|
|
316
|
+
/* 120: service ready in N minutes. */
|
|
317
|
+
rb_define_const(rb_mFtpStatus, "SERVICE_READY_SOON", INT2NUM(sfFtpServiceReadySoon));
|
|
318
|
+
/* 125: data connection already opened, transfer starting. */
|
|
319
|
+
rb_define_const(rb_mFtpStatus, "DATA_CONNECTION_ALREADY_OPENED",
|
|
320
|
+
INT2NUM(sfFtpDataConnectionAlreadyOpened));
|
|
321
|
+
/* 150: file status ok, about to open data connection. */
|
|
322
|
+
rb_define_const(rb_mFtpStatus, "OPENING_DATA_CONNECTION", INT2NUM(sfFtpOpeningDataConnection));
|
|
323
|
+
/* 200: command ok. */
|
|
324
|
+
rb_define_const(rb_mFtpStatus, "OK", INT2NUM(sfFtpOk));
|
|
325
|
+
/* 202: command not implemented. */
|
|
326
|
+
rb_define_const(rb_mFtpStatus, "POINTLESS_COMMAND", INT2NUM(sfFtpPointlessCommand));
|
|
327
|
+
/* 211: system status, or system help reply. */
|
|
328
|
+
rb_define_const(rb_mFtpStatus, "SYSTEM_STATUS", INT2NUM(sfFtpSystemStatus));
|
|
329
|
+
/* 212: directory status. */
|
|
330
|
+
rb_define_const(rb_mFtpStatus, "DIRECTORY_STATUS", INT2NUM(sfFtpDirectoryStatus));
|
|
331
|
+
/* 213: file status. */
|
|
332
|
+
rb_define_const(rb_mFtpStatus, "FILE_STATUS", INT2NUM(sfFtpFileStatus));
|
|
333
|
+
/* 214: help message. */
|
|
334
|
+
rb_define_const(rb_mFtpStatus, "HELP_MESSAGE", INT2NUM(sfFtpHelpMessage));
|
|
335
|
+
/* 215: NAME system type, where NAME is an official system name from the Assigned Numbers
|
|
336
|
+
* document. */
|
|
337
|
+
rb_define_const(rb_mFtpStatus, "SYSTEM_TYPE", INT2NUM(sfFtpSystemType));
|
|
338
|
+
/* 220: service ready for a new user. */
|
|
339
|
+
rb_define_const(rb_mFtpStatus, "SERVICE_READY", INT2NUM(sfFtpServiceReady));
|
|
340
|
+
/* 221: service closing the control connection. */
|
|
341
|
+
rb_define_const(rb_mFtpStatus, "CLOSING_CONNECTION", INT2NUM(sfFtpClosingConnection));
|
|
342
|
+
/* 225: data connection open, no transfer in progress. */
|
|
343
|
+
rb_define_const(rb_mFtpStatus, "DATA_CONNECTION_OPENED", INT2NUM(sfFtpDataConnectionOpened));
|
|
344
|
+
/* 226: closing data connection, requested file action successful. */
|
|
345
|
+
rb_define_const(rb_mFtpStatus, "CLOSING_DATA_CONNECTION", INT2NUM(sfFtpClosingDataConnection));
|
|
346
|
+
/* 227: entering passive mode. */
|
|
347
|
+
rb_define_const(rb_mFtpStatus, "ENTERING_PASSIVE_MODE", INT2NUM(sfFtpEnteringPassiveMode));
|
|
348
|
+
/* 230: user logged in, proceed (logged out if appropriate). */
|
|
349
|
+
rb_define_const(rb_mFtpStatus, "LOGGED_IN", INT2NUM(sfFtpLoggedIn));
|
|
350
|
+
/* 250: requested file action ok. */
|
|
351
|
+
rb_define_const(rb_mFtpStatus, "FILE_ACTION_OK", INT2NUM(sfFtpFileActionOk));
|
|
352
|
+
/* 257: PATHNAME created. */
|
|
353
|
+
rb_define_const(rb_mFtpStatus, "DIRECTORY_OK", INT2NUM(sfFtpDirectoryOk));
|
|
354
|
+
/* 331: user name ok, password needed. */
|
|
355
|
+
rb_define_const(rb_mFtpStatus, "NEED_PASSWORD", INT2NUM(sfFtpNeedPassword));
|
|
356
|
+
/* 332: account needed for login. */
|
|
357
|
+
rb_define_const(rb_mFtpStatus, "NEED_ACCOUNT_TO_LOG_IN", INT2NUM(sfFtpNeedAccountToLogIn));
|
|
358
|
+
/* 350: requested file action pending further information. */
|
|
359
|
+
rb_define_const(rb_mFtpStatus, "NEED_INFORMATION", INT2NUM(sfFtpNeedInformation));
|
|
360
|
+
/* 421: service not available, closing the control connection. */
|
|
361
|
+
rb_define_const(rb_mFtpStatus, "SERVICE_UNAVAILABLE", INT2NUM(sfFtpServiceUnavailable));
|
|
362
|
+
/* 425: can't open the data connection. */
|
|
363
|
+
rb_define_const(rb_mFtpStatus, "DATA_CONNECTION_UNAVAILABLE",
|
|
364
|
+
INT2NUM(sfFtpDataConnectionUnavailable));
|
|
365
|
+
/* 426: connection closed, transfer aborted. */
|
|
366
|
+
rb_define_const(rb_mFtpStatus, "TRANSFER_ABORTED", INT2NUM(sfFtpTransferAborted));
|
|
367
|
+
/* 450: requested file action not taken. */
|
|
368
|
+
rb_define_const(rb_mFtpStatus, "FILE_ACTION_ABORTED", INT2NUM(sfFtpFileActionAborted));
|
|
369
|
+
/* 451: requested action aborted, local error in processing. */
|
|
370
|
+
rb_define_const(rb_mFtpStatus, "LOCAL_ERROR", INT2NUM(sfFtpLocalError));
|
|
371
|
+
/* 452: requested action not taken; insufficient storage space in system, file unavailable. */
|
|
372
|
+
rb_define_const(rb_mFtpStatus, "INSUFFICIENT_STORAGE_SPACE",
|
|
373
|
+
INT2NUM(sfFtpInsufficientStorageSpace));
|
|
374
|
+
/* 500: syntax error, command unrecognized. */
|
|
375
|
+
rb_define_const(rb_mFtpStatus, "COMMAND_UNKNOWN", INT2NUM(sfFtpCommandUnknown));
|
|
376
|
+
/* 501: syntax error in parameters or arguments. */
|
|
377
|
+
rb_define_const(rb_mFtpStatus, "PARAMETERS_UNKNOWN", INT2NUM(sfFtpParametersUnknown));
|
|
378
|
+
/* 502: command not implemented. */
|
|
379
|
+
rb_define_const(rb_mFtpStatus, "COMMAND_NOT_IMPLEMENTED", INT2NUM(sfFtpCommandNotImplemented));
|
|
380
|
+
/* 503: bad sequence of commands. */
|
|
381
|
+
rb_define_const(rb_mFtpStatus, "BAD_COMMAND_SEQUENCE", INT2NUM(sfFtpBadCommandSequence));
|
|
382
|
+
/* 504: command not implemented for that parameter. */
|
|
383
|
+
rb_define_const(rb_mFtpStatus, "PARAMETER_NOT_IMPLEMENTED",
|
|
384
|
+
INT2NUM(sfFtpParameterNotImplemented));
|
|
385
|
+
/* 530: not logged in. */
|
|
386
|
+
rb_define_const(rb_mFtpStatus, "NOT_LOGGED_IN", INT2NUM(sfFtpNotLoggedIn));
|
|
387
|
+
/* 532: account needed for storing files. */
|
|
388
|
+
rb_define_const(rb_mFtpStatus, "NEED_ACCOUNT_TO_STORE", INT2NUM(sfFtpNeedAccountToStore));
|
|
389
|
+
/* 550: requested action not taken, file unavailable. */
|
|
390
|
+
rb_define_const(rb_mFtpStatus, "FILE_UNAVAILABLE", INT2NUM(sfFtpFileUnavailable));
|
|
391
|
+
/* 551: requested action aborted, page type unknown. */
|
|
392
|
+
rb_define_const(rb_mFtpStatus, "PAGE_TYPE_UNKNOWN", INT2NUM(sfFtpPageTypeUnknown));
|
|
393
|
+
/* 552: requested file action aborted, exceeded storage allocation. */
|
|
394
|
+
rb_define_const(rb_mFtpStatus, "NOT_ENOUGH_MEMORY", INT2NUM(sfFtpNotEnoughMemory));
|
|
395
|
+
/* 553: requested action not taken, file name not allowed. */
|
|
396
|
+
rb_define_const(rb_mFtpStatus, "FILENAME_NOT_ALLOWED", INT2NUM(sfFtpFilenameNotAllowed));
|
|
397
|
+
/* 1000 (SFML-specific): the response is not a valid FTP one. */
|
|
398
|
+
rb_define_const(rb_mFtpStatus, "INVALID_RESPONSE", INT2NUM(sfFtpInvalidResponse));
|
|
399
|
+
/* 1001 (SFML-specific): the connection with the server failed. */
|
|
400
|
+
rb_define_const(rb_mFtpStatus, "CONNECTION_FAILED", INT2NUM(sfFtpConnectionFailed));
|
|
401
|
+
/* 1002 (SFML-specific): the connection with the server closed. */
|
|
402
|
+
rb_define_const(rb_mFtpStatus, "CONNECTION_CLOSED", INT2NUM(sfFtpConnectionClosed));
|
|
403
|
+
/* 1003 (SFML-specific): invalid file for upload/download. */
|
|
404
|
+
rb_define_const(rb_mFtpStatus, "INVALID_FILE", INT2NUM(sfFtpInvalidFile));
|
|
298
405
|
}
|