2020-10-18 13:18:51 +02:00
|
|
|
#include <conio.h>
|
2021-01-26 09:40:56 +01:00
|
|
|
#include <clayer/http.h>
|
|
|
|
#include <clayer/inputbox.h>
|
|
|
|
|
|
|
|
#define OK 200
|
2020-05-16 10:07:10 +02:00
|
|
|
|
|
|
|
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");
|
2021-01-26 09:40:56 +01:00
|
|
|
|
2021-01-26 09:56:59 +01:00
|
|
|
http_msg *h = http_get("http://kolibrios.org/en/", 0, HTTP_FLAG_BLOCK, "");
|
2021-01-26 09:40:56 +01:00
|
|
|
http_long_receive(h);
|
|
|
|
|
|
|
|
if (h->status == OK) {
|
|
|
|
con_write_string(h->content_ptr, h->content_length);
|
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;
|
|
|
|
}
|