X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Furllib.qh;h=d58a0b1aaf7eb4955bf3e87bd6fcf3db036782c5;hp=a7735ed4f3f9ee1b05d279366125e7dfe0dd4a05;hb=82dbcadfd0556053b74638f2e3ae2e57103ddf26;hpb=f15ff9f0d34d7f4aff3de7542b923ef53694a0e5 diff --git a/qcsrc/common/urllib.qh b/qcsrc/common/urllib.qh index a7735ed4f..d58a0b1aa 100644 --- a/qcsrc/common/urllib.qh +++ b/qcsrc/common/urllib.qh @@ -1,16 +1,22 @@ -float URL_READY_ERROR = -1; -float URL_READY_CLOSED = 0; -float URL_READY_CANWRITE = 1; -float URL_READY_CANREAD = 2; +#ifndef URLLIB_H +#define URLLIB_H + +const float URL_READY_ERROR = -1; +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; -void url_fopen(string url, float mode, url_ready_func rdy, entity pass); -void url_fclose(entity e, url_ready_func rdy, entity pass); +void url_single_fopen(string url, float mode, url_ready_func rdy, entity pass); +void url_fclose(entity e); string url_fgets(entity e); void url_fputs(entity e, string s); // returns true if handled -float url_URI_Get_Callback(float id, float status, string data); -#define MIN_URL_ID 128 -#define NUM_URL_ID 64 +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) + +void url_multi_fopen(string url, float mode, url_ready_func rdy, entity pass); +#endif