entity url_fromid[NUM_URL_ID];
int autocvar__urllib_nextslot;
+ERASEABLE
float url_URI_Get_Callback(int id, float status, string data)
{
if (id < MIN_URL_ID) return 0;
LOG_INFO("url_URI_Get_Callback: out of memory in buf_create\n");
e.url_ready(e, e.url_ready_pass, URL_READY_ERROR);
strunzone(e.url_url);
- remove(e);
+ delete(e);
return 1;
}
e.url_rbufpos = 0;
LOG_INFO("url_URI_Get_Callback: out of memory in buf_create\n");
e.url_ready(e, e.url_ready_pass, URL_READY_ERROR);
strunzone(e.url_url);
- remove(e);
+ delete(e);
return 1;
}
for (i = 0; i < n; ++i)
// an ERROR
e.url_ready(e, e.url_ready_pass, -fabs(status));
strunzone(e.url_url);
- remove(e);
+ delete(e);
return 1;
}
}
+ERASEABLE
void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
{
entity e;
LOG_INFO("url_single_fopen: out of memory in buf_create\n");
rdy(e, pass, URL_READY_ERROR);
strunzone(e.url_url);
- remove(e);
+ delete(e);
return;
}
e.url_wbufpos = 0;
}
// close a file
+ERASEABLE
void url_fclose(entity e)
{
int i;
e.url_ready(e, e.url_ready_pass, URL_READY_ERROR);
buf_del(e.url_wbuf);
strunzone(e.url_url);
- remove(e);
+ delete(e);
return;
}
}
e.url_ready(e, e.url_ready_pass, URL_READY_ERROR);
buf_del(e.url_wbuf);
strunzone(e.url_url);
- remove(e);
+ delete(e);
return;
}
e.url_ready(e, e.url_ready_pass, URL_READY_CLOSED);
buf_del(e.url_rbuf);
strunzone(e.url_url);
- remove(e);
+ delete(e);
}
}
else if (e.url_fh == URL_FH_STDOUT)
{
e.url_ready(e, e.url_ready_pass, URL_READY_CLOSED); // closing creates no reading handle
- remove(e);
+ delete(e);
}
else
{
// file
fclose(e.url_fh);
e.url_ready(e, e.url_ready_pass, URL_READY_CLOSED); // closing creates no reading handle
- remove(e);
+ delete(e);
}
}
// with \n (blame FRIK_FILE)
+ERASEABLE
string url_fgets(entity e)
{
if (e.url_fh == URL_FH_CURL)
}
// without \n (blame FRIK_FILE)
+ERASEABLE
void url_fputs(entity e, string s)
{
if (e.url_fh == URL_FH_CURL)
else if (e.url_fh == URL_FH_STDOUT)
{
// stdout
- LOG_INFO(s);
+ print(s);
}
else
{
}
// multi URL object, tries URLs separated by space in sequence
+ERASEABLE
void url_multi_ready(entity fh, entity me, float status)
{
float n;
LOG_INFO("uri_multi_ready: got HTTP error 422, data is in unusable format - not continuing\n");
me.url_ready(fh, me.url_ready_pass, status);
strunzone(me.url_url);
- remove(me);
+ delete(me);
return;
}
me.url_attempt += 1;
{
me.url_ready(fh, me.url_ready_pass, status);
strunzone(me.url_url);
- remove(me);
+ delete(me);
return;
}
url_single_fopen(argv(me.url_attempt), me.url_mode, url_multi_ready, me);
}
me.url_ready(fh, me.url_ready_pass, status);
}
+
+ERASEABLE
void url_multi_fopen(string url, int mode, url_ready_func rdy, entity pass)
{
float n;