2020-10-18 13:18:51 +02:00
|
|
|
#include <conio.h>
|
2020-05-16 10:07:10 +02:00
|
|
|
#include <kos/http.h>
|
|
|
|
#include <kos/inputbox.h>
|
|
|
|
|
|
|
|
int main() {
|
2020-10-18 13:18:51 +02:00
|
|
|
if (con_init_console_dll()) return 1; // init fail
|
2020-05-19 11:38:59 +02:00
|
|
|
con_write_asciiz("Wait, I'll ask you... when I'll done to fetch one site...\n");
|
2020-05-16 10:07:10 +02:00
|
|
|
con_set_title("Dynamicaly linked app");
|
2020-05-19 11:38:59 +02:00
|
|
|
http_msg *h = get("http://example.com", 0, HTTP_FLAG_BLOCK, "");
|
2020-05-16 10:07:10 +02:00
|
|
|
if (!receive(h)) {
|
2020-05-19 11:38:59 +02:00
|
|
|
con_printf("%s\n", h->content_ptr);
|
2020-05-16 10:07:10 +02:00
|
|
|
} else {
|
2020-05-19 11:38:59 +02:00
|
|
|
con_write_asciiz("Oops! Can't access to the page.\n");
|
2020-05-16 10:07:10 +02:00
|
|
|
}
|
|
|
|
char buffer[256];
|
2020-05-19 11:38:59 +02:00
|
|
|
InputBox(buffer, "Hay!", "How do you do?", "Hmm?", 0, 256, 0);
|
|
|
|
con_printf("Your answer is \"%s\"\n", buffer);
|
|
|
|
con_write_string("It's surprising, isn't it?", 26);
|
2020-05-16 10:07:10 +02:00
|
|
|
con_exit(0);
|
|
|
|
return 0;
|
|
|
|
}
|