X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Flib%2Furllib.qh;h=639b5db73e0615f6caa49b1cc494892faf38ab0f;hb=90ac5f4f1f4aa420546283c58953f387b82e33ba;hp=e4b8a8f27312f5d096817262abb6e1908363a057;hpb=18e2cd311a581f77ba8eb9c5421dd219ff5d760d;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/lib/urllib.qh b/qcsrc/lib/urllib.qh index e4b8a8f27..639b5db73 100644 --- a/qcsrc/lib/urllib.qh +++ b/qcsrc/lib/urllib.qh @@ -1,5 +1,4 @@ -#ifndef URLLIB_H -#define URLLIB_H +#pragma once // URI handles const int URI_GET_DISCARD = 0; @@ -8,6 +7,7 @@ const int URI_GET_IPBAN_END = 16; const int URI_GET_CURL = 17; const int URI_GET_CURL_END = 32; const int URI_GET_UPDATENOTIFICATION = 33; +const int URI_GET_TOS = 34; const int URI_GET_URLLIB = 128; const int URI_GET_URLLIB_END = 191; @@ -16,17 +16,22 @@ const float URL_READY_CLOSED = 0; const float URL_READY_CANWRITE = 1; const float URL_READY_CANREAD = 2; // errors: -1, or negative HTTP status code -typedef void(entity handle, entity pass, float status) url_ready_func; +USING(url_ready_func, void (entity handle, entity pass, float status)); +ERASEABLE void url_single_fopen(string url, float mode, url_ready_func rdy, entity pass); +ERASEABLE void url_fclose(entity e); +ERASEABLE string url_fgets(entity e); +ERASEABLE void url_fputs(entity e, string s); // returns true if handled +ERASEABLE float url_URI_Get_Callback(int id, float status, string data); #define MIN_URL_ID URI_GET_URLLIB #define NUM_URL_ID (URI_GET_URLLIB_END - URI_GET_URLLIB + 1) +ERASEABLE void url_multi_fopen(string url, float mode, url_ready_func rdy, entity pass); -#endif