home *** CD-ROM | disk | FTP | other *** search
- int ansi_mode = 1;
- char *ansibold = "\033[1m";
- char *ansinorm = "\033[0m";
-
- void ansi(char *s)
- {
- if (ansi_mode)
- fputs(s, stdout);
- }
-
- void ansidetect()
- {
- union REGS r;
- int oldp;
- r.h.ah = 3;
- r.h.bh = 0;
- int86(0x10, &r, &r);
- oldp = r.x.dx;
- printf("\033[0m");
- r.h.ah = 3;
- r.h.bh = 0;
- int86(0x10, &r, &r);
- if (r.x.dx == oldp)
- return;
- printf("\r \r");
- ansi_mode = 0;
- ansibold = "";
- ansinorm = "";
- }
-