Subversion Repositories Kolibri OS

Rev

Rev 7948 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. #include <conio.h>
  2. #include <kos/http.h>
  3. #include <kos/inputbox.h>
  4.  
  5. int main() {
  6.     if (con_init_console_dll()) return 1; // init fail
  7.     con_write_asciiz("Wait, I'll ask you... when I'll done to fetch one site...\n");
  8.     con_set_title("Dynamicaly linked app");
  9.     http_msg *h = get("http://example.com", 0, HTTP_FLAG_BLOCK, "");
  10.     if (!receive(h)) {
  11.         con_printf("%s\n", h->content_ptr);
  12.     } else {
  13.         con_write_asciiz("Oops! Can't access to the page.\n");
  14.     }
  15.     char buffer[256];
  16.     InputBox(buffer, "Hay!", "How do you do?", "Hmm?", 0, 256, 0);
  17.     con_printf("Your answer is \"%s\"\n", buffer);
  18.     con_write_string("It's surprising, isn't it?", 26);
  19.     con_exit(0);
  20.     return 0;
  21. }
  22.