version 1.2, 1995/12/26 18:00:35 |
version 1.3, 1996/02/23 14:10:55 |
|
|
/* $NetBSD: wwopen.c,v 1.5 1995/12/21 10:46:19 mycroft Exp $ */ |
/* $NetBSD: wwopen.c,v 1.6 1996/02/08 21:08:04 mycroft Exp $ */ |
|
|
/* |
/* |
* Copyright (c) 1983, 1993 |
* Copyright (c) 1983, 1993 |
|
|
#if 0 |
#if 0 |
static char sccsid[] = "@(#)wwopen.c 8.2 (Berkeley) 4/28/95"; |
static char sccsid[] = "@(#)wwopen.c 8.2 (Berkeley) 4/28/95"; |
#else |
#else |
static char rcsid[] = "$NetBSD: wwopen.c,v 1.5 1995/12/21 10:46:19 mycroft Exp $"; |
static char rcsid[] = "$NetBSD: wwopen.c,v 1.6 1996/02/08 21:08:04 mycroft Exp $"; |
#endif |
#endif |
#endif /* not lint */ |
#endif /* not lint */ |
|
|
|
|
#include <fcntl.h> |
#include <fcntl.h> |
|
|
struct ww * |
struct ww * |
wwopen(type, flags, nrow, ncol, row, col, nline) |
wwopen(type, oflags, nrow, ncol, row, col, nline) |
{ |
{ |
register struct ww *w; |
register struct ww *w; |
register i, j; |
register i, j; |
|
|
if (w->ww_win == 0) |
if (w->ww_win == 0) |
goto bad; |
goto bad; |
m = 0; |
m = 0; |
if (flags & WWO_GLASS) |
if (oflags & WWO_GLASS) |
m |= WWM_GLS; |
m |= WWM_GLS; |
if (flags & WWO_REVERSE) |
if (oflags & WWO_REVERSE) |
if (wwavailmodes & WWM_REV) |
if (wwavailmodes & WWM_REV) |
m |= WWM_REV; |
m |= WWM_REV; |
else |
else |
flags &= ~WWO_REVERSE; |
oflags &= ~WWO_REVERSE; |
for (i = w->ww_w.t; i < w->ww_w.b; i++) |
for (i = w->ww_w.t; i < w->ww_w.b; i++) |
for (j = w->ww_w.l; j < w->ww_w.r; j++) |
for (j = w->ww_w.l; j < w->ww_w.r; j++) |
w->ww_win[i][j] = m; |
w->ww_win[i][j] = m; |
|
|
if (flags & WWO_FRAME) { |
if (oflags & WWO_FRAME) { |
w->ww_fmap = wwalloc(w->ww_w.t, w->ww_w.l, |
w->ww_fmap = wwalloc(w->ww_w.t, w->ww_w.l, |
w->ww_w.nr, w->ww_w.nc, sizeof (char)); |
w->ww_w.nr, w->ww_w.nc, sizeof (char)); |
if (w->ww_fmap == 0) |
if (w->ww_fmap == 0) |
|
|
w->ww_nvis[i] = nvis; |
w->ww_nvis[i] = nvis; |
|
|
w->ww_state = WWS_INITIAL; |
w->ww_state = WWS_INITIAL; |
w->ww_oflags = flags; |
CLR(w->ww_oflags, WWO_ALLFLAGS); |
|
SET(w->ww_oflags, oflags); |
return wwindex[w->ww_index] = w; |
return wwindex[w->ww_index] = w; |
bad: |
bad: |
if (w != 0) { |
if (w != 0) { |