Deleted Added
full compact
teken_demo.c (186681) teken_demo.c (186729)
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_demo.c 186681 2009-01-01 13:26:53Z ed $
26 * $FreeBSD: head/sys/dev/syscons/teken/teken_demo.c 186729 2009-01-03 22:51:54Z ed $
27 */
28
29#include <sys/ioctl.h>
30
31#include <assert.h>
32#include <errno.h>
33#include <inttypes.h>
34#include <stdio.h>

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

65};
66
67struct pixel {
68 teken_char_t c;
69 teken_attr_t a;
70};
71
72#define NCOLS 80
27 */
28
29#include <sys/ioctl.h>
30
31#include <assert.h>
32#include <errno.h>
33#include <inttypes.h>
34#include <stdio.h>

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

65};
66
67struct pixel {
68 teken_char_t c;
69 teken_attr_t a;
70};
71
72#define NCOLS 80
73#define NROWS 24
73#define NROWS 25
74struct pixel buffer[NCOLS][NROWS];
75
76static int ptfd;
77
78static void
79printchar(const teken_pos_t *p)
80{
81 int y, x, attr = 0;

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

274 tp.tp_row = ws.ws_row = NROWS;
275 tp.tp_col = ws.ws_col = NCOLS;
276
277 switch (forkpty(&ptfd, NULL, NULL, &ws)) {
278 case -1:
279 perror("forkpty");
280 exit(1);
281 case 0:
74struct pixel buffer[NCOLS][NROWS];
75
76static int ptfd;
77
78static void
79printchar(const teken_pos_t *p)
80{
81 int y, x, attr = 0;

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

274 tp.tp_row = ws.ws_row = NROWS;
275 tp.tp_col = ws.ws_col = NCOLS;
276
277 switch (forkpty(&ptfd, NULL, NULL, &ws)) {
278 case -1:
279 perror("forkpty");
280 exit(1);
281 case 0:
282 setenv("TERM", "xterm-color", 1);
282 setenv("TERM", "cons25", 1);
283 setenv("LC_CTYPE", "UTF-8", 0);
284 execlp("zsh", "-zsh", NULL);
285 execlp("bash", "-bash", NULL);
286 execlp("sh", "-sh", NULL);
287 _exit(1);
288 }
289
290 teken_init(&t, &tf, NULL);

--- 46 unchanged lines hidden ---
283 setenv("LC_CTYPE", "UTF-8", 0);
284 execlp("zsh", "-zsh", NULL);
285 execlp("bash", "-bash", NULL);
286 execlp("sh", "-sh", NULL);
287 _exit(1);
288 }
289
290 teken_init(&t, &tf, NULL);

--- 46 unchanged lines hidden ---