mirror of https://github.com/minexew/Shrine.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
359 B
25 lines
359 B
// vim: set ft=cpp: |
|
|
|
#include "::/Adam/Net/Url" |
|
|
|
I64 Wget(U8* url, U8* saveas = NULL) { |
|
SocketInit(); |
|
|
|
U8* data; |
|
I64 len; |
|
I64 error = UrlGet(url, &data, &len); |
|
|
|
if (!error) { |
|
if (saveas) { |
|
FileWrite(saveas, data, len); |
|
} |
|
else { |
|
"%s\n", data; |
|
} |
|
} |
|
else { |
|
"$FG,4$Wget: error %d\n$FG$", error; |
|
} |
|
|
|
return error; |
|
}
|
|
|