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