]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/lib/urllib.qh
6f196785177dc6e1617cdf5b09d2c7b5e6a80ee6
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / urllib.qh
1 #ifndef URLLIB_H
2 #define URLLIB_H
3
4 #include "../common/util.qh"
5
6 // URI handles
7 const int URI_GET_DISCARD = 0;
8 const int URI_GET_IPBAN = 1;
9 const int URI_GET_IPBAN_END = 16;
10 const int URI_GET_CURL = 17;
11 const int URI_GET_CURL_END = 32;
12 const int URI_GET_UPDATENOTIFICATION = 33;
13 const int URI_GET_URLLIB = 128;
14 const int URI_GET_URLLIB_END = 191;
15
16 const float URL_READY_ERROR    = -1;
17 const float URL_READY_CLOSED   =  0;
18 const float URL_READY_CANWRITE =  1;
19 const float URL_READY_CANREAD  =  2;
20 // errors: -1, or negative HTTP status code
21 typedef void(entity handle, entity pass, float status) url_ready_func;
22
23 void url_single_fopen(string url, float mode, url_ready_func rdy, entity pass);
24 void url_fclose(entity e);
25 string url_fgets(entity e);
26 void url_fputs(entity e, string s);
27
28 // returns true if handled
29 float url_URI_Get_Callback(int id, float status, string data);
30 #define MIN_URL_ID URI_GET_URLLIB
31 #define NUM_URL_ID (URI_GET_URLLIB_END - URI_GET_URLLIB + 1)
32
33 void url_multi_fopen(string url, float mode, url_ready_func rdy, entity pass);
34 #endif