Adding upstream version 3.30~pre4.
[syslinux-debian/hramrach.git] / com32 / samples / hello.c
blobf7f72496b6e0666290fe98b652745f804b291f67
1 /* ----------------------------------------------------------------------- *
3 * Copyright 2004 H. Peter Anvin - All Rights Reserved
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 * Boston MA 02111-1307, USA; either version 2 of the License, or
9 * (at your option) any later version; incorporated herein by reference.
11 * ----------------------------------------------------------------------- */
14 * hello.c
16 * Hello, World! using libcom32
19 #include <string.h>
20 #include <stdio.h>
21 #include <console.h>
23 int main(void)
25 char buffer[1024];
27 openconsole(&dev_stdcon_r, &dev_stdcon_w);
29 printf("Hello, World!\n");
31 for (;;) {
32 printf("> ");
33 fgets(buffer, sizeof buffer, stdin);
34 if ( !strncmp(buffer, "exit", 4) )
35 break;
36 printf(": %s", buffer);
39 return 0;