Subversion Repositories Kolibri OS

Rev

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

  1. #include <conio.h>
  2. #include <clayer/http.h>
  3. #include <clayer/inputbox.h>
  4.  
  5. #define OK 200
  6.  
  7. int main() {
  8.     if (con_init_console_dll()) return 1; // init fail
  9.     con_write_asciiz("Wait, I'll ask you... when I'll done to fetch one site...\n");
  10.     con_set_title("Dynamicaly linked app");
  11.    
  12.     http_msg *h = http_get("http://kolibrios.org/en/", 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);
  17.     } else {
  18.         con_write_asciiz("Oops! Can't access to the page.\n");
  19.     }
  20.     char buffer[256];
  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);
  24.     con_exit(0);
  25.     return 0;
  26. }
  27.