Adding upstream version 3.61+dfsg.
[syslinux-debian/hramrach.git] / com32 / samples / fancyhello.c
bloba6c5a375cb52ba242e1df84dee99da09e225e5e3
2 /* ----------------------------------------------------------------------- *
4 * Copyright 2004-2008 H. Peter Anvin - All Rights Reserved
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
9 * Boston MA 02111-1307, USA; either version 2 of the License, or
10 * (at your option) any later version; incorporated herein by reference.
12 * ----------------------------------------------------------------------- */
15 * fancyhello.c
17 * Hello, World! using libcom32 and ANSI console; also possible to compile
18 * as a Linux application for testing.
21 #include <string.h>
22 #include <stdio.h>
24 #include <consoles.h> /* Provided by libutil */
26 int main(void)
28 char buffer[1024];
30 console_ansi_std();
32 printf("\033[1;33;44m *** \033[37mHello, World!\033[33m *** \033[0m\n");
34 for (;;) {
35 printf("\033[1;36m>\033[0m ");
36 fgets(buffer, sizeof buffer, stdin);
37 if ( !strncmp(buffer, "exit", 4) )
38 break;
39 printf("\033[1m:\033[0m %s", buffer);
41 return 0;