new RT/PC entries, 5 small fixes, removed aaa-29-np, I? means IBM now
[unix-history] / usr / src / usr.bin / window / startup.c
CommitLineData
34ac147f 1#ifndef lint
a6833679 2static char sccsid[] = "@(#)startup.c 3.18 %G%";
34ac147f
EW
3#endif
4
60de5df9
EW
5/*
6 * Copyright (c) 1983 Regents of the University of California,
7 * All rights reserved. Redistribution permitted subject to
8 * the terms of the Berkeley Software License Agreement.
9 */
10
34ac147f 11#include "defs.h"
6e1c2156
EW
12#include "value.h"
13#include "var.h"
0e64e422 14#include "char.h"
7c38ad4d 15#include "local.h"
34ac147f 16
34ac147f
EW
17doconfig()
18{
19 char buf[100];
20 char *home;
7c38ad4d 21 static char runcom[] = RUNCOM;
34ac147f
EW
22
23 if ((home = getenv("HOME")) == 0)
f828d428 24 home = ".";
e1b16bc3 25 return dosource(sprintf(buf, "%.*s/%s",
f828d428
EW
26 (sizeof buf - sizeof runcom) / sizeof (char) - 1,
27 home, runcom));
34ac147f
EW
28}
29
30/*
e1b16bc3 31 * The default is two windows of equal size.
34ac147f
EW
32 */
33dodefault()
34{
35 struct ww *w;
3acb719c 36 register r = wwnrow / 2 - 1;
34ac147f 37
63b87416 38 if (openwin(1, r + 2, 0, wwnrow - r - 2, wwncol, nbufline,
f828d428 39 (char *) 0, 1, 1, shellfile, shell) == 0)
e1b16bc3 40 return;
63b87416 41 if ((w = openwin(0, 1, 0, r, wwncol, nbufline,
a9e3b681
EW
42 (char *) 0, 1, 1, shellfile, shell)) == 0)
43 return;
b1189050 44 wwprintf(w, "Escape character is %s.\r\n", unctrl(escapec));
34ac147f 45}
6e1c2156
EW
46
47setvars()
48{
0e64e422 49 /* try to use a random ordering to balance the tree */
6e1c2156 50 (void) var_setnum("nrow", wwnrow);
78be6843 51 (void) var_setnum("ncol", wwncol);
6e1c2156
EW
52 (void) var_setnum("baud", wwbaud);
53 (void) var_setnum("m_rev", WWM_REV);
54 (void) var_setnum("m_blk", WWM_BLK);
55 (void) var_setnum("m_ul", WWM_UL);
78be6843 56 (void) var_setnum("m_grp", WWM_GRP);
a6833679
EW
57 (void) var_setnum("m_dim", WWM_DIM);
58 (void) var_setnum("m_usr", WWM_USR);
6e1c2156 59 (void) var_setstr("term", wwterm);
0e64e422 60 (void) var_setnum("modes", wwavailmodes);
6e1c2156 61}