Subversion Repositories Kolibri OS

Rev

Rev 8109 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
8109 maxcodehac 1
#include 
8549 superturbo 2
#include 
3
#include 
7925 Boppan 4
 
8549 superturbo 5
#define OK 200
6
 
7925 Boppan 7
int main() {
8109 maxcodehac 8
    if (con_init_console_dll()) return 1; // init fail
7948 Boppan 9
    con_write_asciiz("Wait, I'll ask you... when I'll done to fetch one site...\n");
7925 Boppan 10
    con_set_title("Dynamicaly linked app");
8549 superturbo 11
 
12
    http_msg *h = http_get("http://kolibri.org/", 0,  HTTP_FLAG_BLOCK, "");
13
    http_long_receive(h);
14
 
15
    if (h->status == OK) {
16
       con_write_string(h->content_ptr, h->content_length);
7925 Boppan 17
    } else {
7948 Boppan 18
        con_write_asciiz("Oops! Can't access to the page.\n");
7925 Boppan 19
    }
20
    char buffer[256];
7948 Boppan 21
    InputBox(buffer, "Hay!", "How do you do?", "Hmm?", 0, 256, 0);
22
    con_printf("Your answer is \"%s\"\n", buffer);
23
    con_write_string("It's surprising, isn't it?", 26);
7925 Boppan 24
    con_exit(0);
25
    return 0;
26
}