aboutsummaryrefslogtreecommitdiffstats
path: root/com32/modules/fancyhello.c
diff options
context:
space:
mode:
authorhpa <hpa>2004-12-01 01:30:07 +0000
committerhpa <hpa>2004-12-01 01:30:07 +0000
commit01c67843bd343499406dd79c7ab8660bcc4b33c6 (patch)
tree50d2fcd0c89177a8782b8ac09a0042019692900e /com32/modules/fancyhello.c
parent7c4d8375a05ffaf58e1b6b5789758a2fcfeb3b87 (diff)
downloadsyslinux-01c67843bd343499406dd79c7ab8660bcc4b33c6.tar.gz
syslinux-01c67843bd343499406dd79c7ab8660bcc4b33c6.tar.xz
syslinux-01c67843bd343499406dd79c7ab8660bcc4b33c6.zip
Utility library which can be compiled either for Linux or for COM32
Diffstat (limited to 'com32/modules/fancyhello.c')
-rw-r--r--com32/modules/fancyhello.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/com32/modules/fancyhello.c b/com32/modules/fancyhello.c
index 5cfc064f..cf255fbc 100644
--- a/com32/modules/fancyhello.c
+++ b/com32/modules/fancyhello.c
@@ -22,40 +22,13 @@
#include <string.h>
#include <stdio.h>
-#ifdef __COM32__
-
-#include <console.h>
-
-static void console_init(void)
-{
- /* Write both to the ANSI console and the serial port, if configured */
- openconsole(&dev_stdcon_r, &dev_ansiserial_w);
-}
-
-#else
-
-#include <termios.h>
-#include <unistd.h>
-
-static void console_init(void)
-{
- struct termios tio;
-
- /* Set the termios flag so we behave the same as libcom32 */
- tcgetattr(0, &tio);
- tio.c_iflag &= ~ICRNL;
- tio.c_iflag |= IGNCR;
- tcsetattr(0, TCSANOW, &tio);
-}
-
-#endif
+#include <consoles.h> /* Provided by libutil */
int main(void)
{
char buffer[1024];
- console_init();
- printf("\033[20h"); /* Automatically convert \r\n -> \n */
+ console_ansi_std();
printf("\033[1;33;44m *** \033[37mHello, World!\033[33m *** \033[0m\n");