Replace old ANSI helper macros with libite/conio.h

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2016-08-18 00:39:59 +02:00
1 parent cec1c64755
commit 77561b6071
2 files changed
+1 -14

No files matched your search

+1
View File
@@ -32,6 +32,7 @@
#include <stdarg.h>
#include <sys/ioctl.h>
#include <lite/lite.h>
#include <lite/conio.h>
#include "finit.h"
#include "helpers.h"
-14
View File
@@ -43,20 +43,6 @@ do { \
#define FLOG_ERROR(fmt, args...) DO_LOG(LOG_CRIT, fmt, ##args)
#define FLOG_PERROR(fmt, args...) DO_LOG(LOG_CRIT, fmt ". Error %d: %s", ##args, errno, strerror(errno))
/* Esc[2JEsc[1;1H Clear screen and move cursor to 1,1 (upper left) pos. */
#define clrscr() fputs("\e[2J\e[1;1H", stderr)
/* Esc[K Erases from the current cursor position to the end of the current line. */
#define clreol() fputs("\e[K", stderr)
/* Esc[2K Erases the entire current line. */
#define delline() fputs("\e[2K", stderr)
/* Esc[Line;ColumnH Moves the cursor to the specified position (coordinates) */
#define gotoxy(x,y) fprintf(stderr, "\e[%d;%dH", y, x)
/* Esc[?25l (lower case L) Hide Cursor */
#define hidecursor() fputs("\e[?25l", stderr)
/* Esc[?25h (lower case H) Show Cursor */
#define showcursor() fputs("\e[?25h", stderr)
#define echo(fmt, args...) do { fprintf(stderr, fmt "\n", ##args); } while (0)
#define _d(fmt, args...) do { if (debug) { fprintf(stderr, "finit:%s:%s() - " fmt "\n", __FILE__, __func__, ##args); } } while (0)
#define _e(fmt, args...) do { fprintf(stderr, "finit:%s:%s() - " fmt "\n", __FILE__, __func__, ##args); } while (0)