Deleted Added
full compact
teken.c (256281) teken.c (262861)
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: stable/10/sys/teken/teken.c 223574 2011-06-26 18:25:10Z ed $
26 * $FreeBSD: stable/10/sys/teken/teken.c 262861 2014-03-06 18:30:56Z jhb $
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)

--- 298 unchanged lines hidden (view full) ---

333
334const teken_pos_t *
335teken_get_winsize(teken_t *t)
336{
337
338 return (&t->t_winsize);
339}
340
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)

--- 298 unchanged lines hidden (view full) ---

333
334const teken_pos_t *
335teken_get_winsize(teken_t *t)
336{
337
338 return (&t->t_winsize);
339}
340
341static void
342teken_trim_cursor_pos(teken_t *t, const teken_pos_t *new)
343{
344 const teken_pos_t *cur;
345
346 cur = &t->t_winsize;
347
348 if (cur->tp_row < new->tp_row || cur->tp_col < new->tp_col)
349 return;
350 if (t->t_cursor.tp_row >= new->tp_row)
351 t->t_cursor.tp_row = new->tp_row - 1;
352 if (t->t_cursor.tp_col >= new->tp_col)
353 t->t_cursor.tp_col = new->tp_col - 1;
354}
355
341void
342teken_set_winsize(teken_t *t, const teken_pos_t *p)
343{
344
356void
357teken_set_winsize(teken_t *t, const teken_pos_t *p)
358{
359
360 teken_trim_cursor_pos(t, p);
345 t->t_winsize = *p;
346 teken_subr_do_reset(t);
347}
348
349void
361 t->t_winsize = *p;
362 teken_subr_do_reset(t);
363}
364
365void
366teken_set_winsize_noreset(teken_t *t, const teken_pos_t *p)
367{
368
369 teken_trim_cursor_pos(t, p);
370 t->t_winsize = *p;
371 teken_subr_do_resize(t);
372}
373
374void
350teken_set_8bit(teken_t *t)
351{
352
353 t->t_stateflags |= TS_8BIT;
354}
355
356void
357teken_set_cons25(teken_t *t)

--- 176 unchanged lines hidden ---
375teken_set_8bit(teken_t *t)
376{
377
378 t->t_stateflags |= TS_8BIT;
379}
380
381void
382teken_set_cons25(teken_t *t)

--- 176 unchanged lines hidden ---