From 4f64827f3a395072f300b86ef17f730805b47048 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 May 2024 04:20:21 +0200 Subject: Adding upstream version 4.6.2. Signed-off-by: Daniel Baumann --- ansi.h | 175 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 ansi.h (limited to 'ansi.h') diff --git a/ansi.h b/ansi.h new file mode 100644 index 0000000..72992b4 --- /dev/null +++ b/ansi.h @@ -0,0 +1,175 @@ +/* Copyright (c) 2008, 2009 + * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) + * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) + * Micah Cowan (micah@cowan.name) + * Sadrul Habib Chowdhury (sadrul@users.sourceforge.net) + * Copyright (c) 1993-2002, 2003, 2005, 2006, 2007 + * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) + * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) + * Copyright (c) 1987 Oliver Laumann + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program (see the file COPYING); if not, see + * http://www.gnu.org/licenses/, or contact Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA + * + **************************************************************** + * $Id$ GNU + */ + +#define NATTR 6 + +#define ATTR_DI 0 /* Dim mode */ +#define ATTR_US 1 /* Underscore mode */ +#define ATTR_BD 2 /* Bold mode */ +#define ATTR_RV 3 /* Reverse mode */ +#define ATTR_SO 4 /* Standout mode */ +#define ATTR_BL 5 /* Blinking */ + +#define A_DI (1<font[(x) + 1] == 0xff && (unsigned char)(ml)->image[(x) + 1] == 0xff : \ + ((unsigned char)(ml)->font[x] & 0x1f) != 0 && ((unsigned char)(ml)->font[x] & 0xe0) == 0 \ + ) +# define dw_right(ml, x, enc) ((enc == UTF8) ? \ + (unsigned char)(ml)->font[x] == 0xff && (unsigned char)(ml)->image[x] == 0xff : \ + ((unsigned char)(ml)->font[x] & 0xe0) == 0x80 \ + ) +# else +# define dw_left(ml, x, enc) ( \ + ((unsigned char)(ml)->font[x] & 0x1f) != 0 && ((unsigned char)(ml)->font[x] & 0xe0) == 0 \ + ) +# define dw_right(ml, x, enc) ( \ + ((unsigned char)(ml)->font[x] & 0xe0) == 0x80 \ + ) +# endif /* UTF8 */ +#else +# define dw_left(ml, x, enc) 0 +# define dw_right(ml, x, enc) 0 +#endif -- cgit v1.2.3