teken.c (186798) | teken.c (187367) |
---|---|
1/*- 2 * Copyright (c) 2008-2009 Ed Schouten <ed@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2008-2009 Ed Schouten <ed@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/dev/syscons/teken/teken.c 186798 2009-01-05 22:09:46Z ed $ | 26 * $FreeBSD: head/sys/dev/syscons/teken/teken.c 187367 2009-01-17 16:37:13Z ed $ |
27 */ 28 29#include <sys/cdefs.h> 30#if defined(__FreeBSD__) && defined(_KERNEL) 31#include <sys/param.h> 32#include <sys/lock.h> 33#include <sys/systm.h> 34#define teken_assert(x) MPASS(x) --- 16 unchanged lines hidden (view full) --- 51#include "teken.h" 52#ifdef TEKEN_UTF8 53#include "teken_wcwidth.h" 54#else /* !TEKEN_UTF8 */ 55static inline int 56teken_wcwidth(teken_char_t c __unused) 57{ 58 | 27 */ 28 29#include <sys/cdefs.h> 30#if defined(__FreeBSD__) && defined(_KERNEL) 31#include <sys/param.h> 32#include <sys/lock.h> 33#include <sys/systm.h> 34#define teken_assert(x) MPASS(x) --- 16 unchanged lines hidden (view full) --- 51#include "teken.h" 52#ifdef TEKEN_UTF8 53#include "teken_wcwidth.h" 54#else /* !TEKEN_UTF8 */ 55static inline int 56teken_wcwidth(teken_char_t c __unused) 57{ 58 |
59#ifdef TEKEN_CONS25 60 return (1); 61#else /* !TEKEN_CONS25 */ | 59#ifdef TEKEN_XTERM |
62 return (c <= 0x1B) ? -1 : 1; | 60 return (c <= 0x1B) ? -1 : 1; |
63#endif /* TEKEN_CONS25 */ | 61#else /* !TEKEN_XTERM */ 62 return (1); 63#endif /* TEKEN_XTERM */ |
64} 65#endif /* TEKEN_UTF8 */ 66 67/* Private flags for teken_format_t. */ 68#define TF_REVERSE 0x08 69 70/* Private flags for t_stateflags. */ 71#define TS_FIRSTDIGIT 0x01 /* First numeric digit in escape sequence. */ 72#define TS_INSERT 0x02 /* Insert mode. */ 73#define TS_AUTOWRAP 0x04 /* Autowrap. */ 74#define TS_ORIGIN 0x08 /* Origin mode. */ | 64} 65#endif /* TEKEN_UTF8 */ 66 67/* Private flags for teken_format_t. */ 68#define TF_REVERSE 0x08 69 70/* Private flags for t_stateflags. */ 71#define TS_FIRSTDIGIT 0x01 /* First numeric digit in escape sequence. */ 72#define TS_INSERT 0x02 /* Insert mode. */ 73#define TS_AUTOWRAP 0x04 /* Autowrap. */ 74#define TS_ORIGIN 0x08 /* Origin mode. */ |
75#ifdef TEKEN_CONS25 76#define TS_WRAPPED 0x00 /* Simple line wrapping. */ 77#else /* !TEKEN_CONS25 */ | 75#ifdef TEKEN_XTERM |
78#define TS_WRAPPED 0x10 /* Next character should be printed on col 0. */ | 76#define TS_WRAPPED 0x10 /* Next character should be printed on col 0. */ |
79#endif /* TEKEN_CONS25 */ | 77#else /* !TEKEN_XTERM */ 78#define TS_WRAPPED 0x00 /* Simple line wrapping. */ 79#endif /* TEKEN_XTERM */ |
80 81/* Character that blanks a cell. */ 82#define BLANK ' ' 83 84static teken_state_t teken_state_init; 85 86/* 87 * Wrappers for hooks. --- 310 unchanged lines hidden --- | 80 81/* Character that blanks a cell. */ 82#define BLANK ' ' 83 84static teken_state_t teken_state_init; 85 86/* 87 * Wrappers for hooks. --- 310 unchanged lines hidden --- |