Merge from vendor branch LESS:
[dragonfly.git] / release / sysinstall / globals.c
1 /*
2  * The new sysinstall program.
3  *
4  * This is probably the last program in the `sysinstall' line - the next
5  * generation being essentially a complete rewrite.
6  *
7  * $FreeBSD: src/release/sysinstall/globals.c,v 1.24.2.2 2001/10/26 08:26:34 jkh Exp $
8  * $DragonFly: src/release/sysinstall/Attic/globals.c,v 1.2 2003/06/17 04:27:21 dillon Exp $
9  *
10  * Copyright (c) 1995
11  *      Jordan Hubbard.  All rights reserved.
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions
15  * are met:
16  * 1. Redistributions of source code must retain the above copyright
17  *    notice, this list of conditions and the following disclaimer,
18  *    verbatim and that no modifications are made prior to this
19  *    point in the file.
20  * 2. Redistributions in binary form must reproduce the above copyright
21  *    notice, this list of conditions and the following disclaimer in the
22  *    documentation and/or other materials provided with the distribution.
23  *
24  * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
25  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27  * ARE DISCLAIMED.  IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE
28  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30  * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
31  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34  * SUCH DAMAGE.
35  *
36  */
37
38 #include "sysinstall.h"
39
40 /*
41  * Various global variables and an initialization hook to set them to
42  * whatever values we feel are appropriate.
43  */
44
45 int             DebugFD;        /* Where diagnostic output goes */
46 Boolean         Fake;           /* Only pretend to be useful */
47 Boolean         RunningAsInit;  /* Are we running as init? */
48 Boolean         DialogActive;   /* Is libdialog initialized? */
49 Boolean         ColorDisplay;   /* Are we on a color display? */
50 Boolean         OnVTY;          /* Are we on a VTY? */
51 Boolean         Restarting;     /* Are we restarting sysinstall? */
52 Variable        *VarHead;       /* The head of the variable chain */
53 Device          *mediaDevice;   /* Where we're installing from */
54 int             BootMgr;        /* Which boot manager we're using */
55 int             StatusLine;     /* Where to stick our status messages */
56 jmp_buf         BailOut;        /* Beam me up, scotty! The natives are pissed! */
57
58 /*
59  * Yes, I know some of these are already automatically initialized as
60  * globals.  I simply find it clearer to set everything explicitly.
61  */
62 void
63 globalsInit(void)
64 {
65     DebugFD = -1;
66     ColorDisplay = FALSE;
67     Fake = FALSE;
68     Restarting = FALSE;
69     OnVTY = FALSE;
70     DialogActive = FALSE;
71     VarHead = NULL;
72     mediaDevice = NULL;
73     RunningAsInit = FALSE;
74 }