Put all variables in VAR_ #define's to force a single location for all

of these magic knobs.  This is purely cosmetic and a documentation issue
so we don't have to glop through the source code looking for gems.
This commit is contained in:
pst 1997-09-17 16:18:22 +00:00
parent 0dfe9b61e4
commit 4f718b5d5d
16 changed files with 67 additions and 38 deletions

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: config.c,v 1.102 1997/08/17 10:08:25 jkh Exp $
* $Id: config.c,v 1.103 1997/08/18 21:47:31 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -469,7 +469,8 @@ configSaver(dialogMenuItem *self)
int
configSaverTimeout(dialogMenuItem *self)
{
return (variable_get_value(VAR_BLANKTIME, "Enter time-out period in seconds for screen saver") ?
return (variable_get_value(VAR_BLANKTIME,
"Enter time-out period in seconds for screen saver") ?
DITEM_SUCCESS : DITEM_FAILURE) | DITEM_RESTORE;
}
@ -484,11 +485,14 @@ configNTP(dialogMenuItem *self)
{
int status;
status = variable_get_value("ntpdate_flags", "Enter the name of an NTP server") ? DITEM_SUCCESS : DITEM_FAILURE;
status = variable_get_value(VAR_NTPDATE_FLAGS,
"Enter the name of an NTP server")
? DITEM_SUCCESS : DITEM_FAILURE;
if (status == DITEM_SUCCESS) {
static char tmp[255];
snprintf(tmp, 255, "ntpdate_enable=YES,ntpdate_flags=%s", variable_get("ntpdate_flags"));
snprintf(tmp, sizeof(tmp), "ntpdate_enable=YES,ntpdate_flags=%s",
variable_get(VAR_NTPDATE_FLAGS));
self->data = tmp;
dmenuSetVariables(self);
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: dispatch.c,v 1.22 1997/09/08 11:09:08 jkh Exp $
* $Id: dispatch.c,v 1.23 1997/09/16 18:57:08 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -173,7 +173,7 @@ dispatch_shutdown(dialogMenuItem *unused)
static int
dispatch_systemExecute(dialogMenuItem *unused)
{
char *cmd = variable_get("command");
char *cmd = variable_get(VAR_COMMAND);
if (cmd)
return systemExecute(cmd) ? DITEM_FAILURE : DITEM_SUCCESS;

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated for what's essentially a complete rewrite.
*
* $Id: dmenu.c,v 1.32 1997/02/22 14:11:35 peter Exp $
* $Id: dmenu.c,v 1.33 1997/06/13 14:21:19 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -115,7 +115,7 @@ dmenuSetKmapVariable(dialogMenuItem *tmp)
int err;
variable_set((char *)tmp->data);
lang = variable_get("keymap");
lang = variable_get(VAR_KEYMAP);
if (lang != NULL)
{
err = loadKeymap(lang);

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: package.c,v 1.62 1997/06/13 17:55:32 jkh Exp $
* $Id: package.c,v 1.63 1997/09/16 10:14:22 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -64,7 +64,7 @@ packageAdd(dialogMenuItem *self)
{
char *cp;
cp = variable_get("package");
cp = variable_get(VAR_PACKAGE);
if (!cp) {
msgDebug("packageAdd: No package name passed in package variable\n");
return DITEM_FAILURE;

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
* $Id: sysinstall.h,v 1.139 1997/07/31 11:08:41 jkh Exp $
* $Id: sysinstall.h,v 1.140 1997/09/16 18:57:17 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -106,6 +106,7 @@
#define VAR_DOMAINNAME "domainname"
#define VAR_EDITOR "editor"
#define VAR_EXTRAS "ifconfig_"
#define VAR_COMMAND "command"
#define VAR_CONFIG_FILE "configFile"
#define VAR_FTP_DIR "ftpDirectory"
#define VAR_FTP_PASS "ftpPass"
@ -123,11 +124,13 @@
#define VAR_INSTALL_CFG "installConfig"
#define VAR_INSTALL_ROOT "installRoot"
#define VAR_IPADDR "ipaddr"
#define VAR_KEYMAP "keymap"
#define VAR_LABEL "label"
#define VAR_LABEL_COUNT "labelCount"
#define VAR_MEDIA_TYPE "mediaType"
#define VAR_MEDIA_TIMEOUT "MEDIA_TIMEOUT"
#define VAR_NAMESERVER "nameserver"
#define VAR_NETINTERACTIVE "netInteractive"
#define VAR_NETMASK "netmask"
#define VAR_NETWORK_DEVICE "netDev"
#define VAR_NFS_PATH "nfs"
@ -139,6 +142,8 @@
#define VAR_NO_WARN "noWarn"
#define VAR_NONINTERACTIVE "nonInteractive"
#define VAR_NOVELL "novell"
#define VAR_NTPDATE_FLAGS "ntpdate_flags"
#define VAR_PACKAGE "package"
#define VAR_PARTITION "partition"
#define VAR_PCNFSD "pcnfsd"
#define VAR_PCNFSD_PKG "pcnfsd_pkg"

View File

@ -1,5 +1,5 @@
/*
* $Id: tcpip.c,v 1.70 1997/09/08 11:09:11 jkh Exp $
* $Id: tcpip.c,v 1.71 1997/09/17 13:33:14 jkh Exp $
*
* Copyright (c) 1995
* Gary J Palmer. All rights reserved.
@ -211,7 +211,8 @@ tcpOpenDialog(Device *devp)
save = savescr();
/* If non-interactive, jump straight over the dialog crap and into config section */
if (variable_get(VAR_NONINTERACTIVE) && !variable_get("netInteractive")) {
if (variable_get(VAR_NONINTERACTIVE) &&
!variable_get(VAR_NETINTERACTIVE)) {
if (!hostname[0])
msgConfirm("WARNING: hostname variable not set and is a non-optional\n"
"parameter. Please add this to your installation script\n"

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: config.c,v 1.102 1997/08/17 10:08:25 jkh Exp $
* $Id: config.c,v 1.103 1997/08/18 21:47:31 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -469,7 +469,8 @@ configSaver(dialogMenuItem *self)
int
configSaverTimeout(dialogMenuItem *self)
{
return (variable_get_value(VAR_BLANKTIME, "Enter time-out period in seconds for screen saver") ?
return (variable_get_value(VAR_BLANKTIME,
"Enter time-out period in seconds for screen saver") ?
DITEM_SUCCESS : DITEM_FAILURE) | DITEM_RESTORE;
}
@ -484,11 +485,14 @@ configNTP(dialogMenuItem *self)
{
int status;
status = variable_get_value("ntpdate_flags", "Enter the name of an NTP server") ? DITEM_SUCCESS : DITEM_FAILURE;
status = variable_get_value(VAR_NTPDATE_FLAGS,
"Enter the name of an NTP server")
? DITEM_SUCCESS : DITEM_FAILURE;
if (status == DITEM_SUCCESS) {
static char tmp[255];
snprintf(tmp, 255, "ntpdate_enable=YES,ntpdate_flags=%s", variable_get("ntpdate_flags"));
snprintf(tmp, sizeof(tmp), "ntpdate_enable=YES,ntpdate_flags=%s",
variable_get(VAR_NTPDATE_FLAGS));
self->data = tmp;
dmenuSetVariables(self);
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: dispatch.c,v 1.22 1997/09/08 11:09:08 jkh Exp $
* $Id: dispatch.c,v 1.23 1997/09/16 18:57:08 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -173,7 +173,7 @@ dispatch_shutdown(dialogMenuItem *unused)
static int
dispatch_systemExecute(dialogMenuItem *unused)
{
char *cmd = variable_get("command");
char *cmd = variable_get(VAR_COMMAND);
if (cmd)
return systemExecute(cmd) ? DITEM_FAILURE : DITEM_SUCCESS;

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated for what's essentially a complete rewrite.
*
* $Id: dmenu.c,v 1.32 1997/02/22 14:11:35 peter Exp $
* $Id: dmenu.c,v 1.33 1997/06/13 14:21:19 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -115,7 +115,7 @@ dmenuSetKmapVariable(dialogMenuItem *tmp)
int err;
variable_set((char *)tmp->data);
lang = variable_get("keymap");
lang = variable_get(VAR_KEYMAP);
if (lang != NULL)
{
err = loadKeymap(lang);

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
* $Id: sysinstall.h,v 1.139 1997/07/31 11:08:41 jkh Exp $
* $Id: sysinstall.h,v 1.140 1997/09/16 18:57:17 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -106,6 +106,7 @@
#define VAR_DOMAINNAME "domainname"
#define VAR_EDITOR "editor"
#define VAR_EXTRAS "ifconfig_"
#define VAR_COMMAND "command"
#define VAR_CONFIG_FILE "configFile"
#define VAR_FTP_DIR "ftpDirectory"
#define VAR_FTP_PASS "ftpPass"
@ -123,11 +124,13 @@
#define VAR_INSTALL_CFG "installConfig"
#define VAR_INSTALL_ROOT "installRoot"
#define VAR_IPADDR "ipaddr"
#define VAR_KEYMAP "keymap"
#define VAR_LABEL "label"
#define VAR_LABEL_COUNT "labelCount"
#define VAR_MEDIA_TYPE "mediaType"
#define VAR_MEDIA_TIMEOUT "MEDIA_TIMEOUT"
#define VAR_NAMESERVER "nameserver"
#define VAR_NETINTERACTIVE "netInteractive"
#define VAR_NETMASK "netmask"
#define VAR_NETWORK_DEVICE "netDev"
#define VAR_NFS_PATH "nfs"
@ -139,6 +142,8 @@
#define VAR_NO_WARN "noWarn"
#define VAR_NONINTERACTIVE "nonInteractive"
#define VAR_NOVELL "novell"
#define VAR_NTPDATE_FLAGS "ntpdate_flags"
#define VAR_PACKAGE "package"
#define VAR_PARTITION "partition"
#define VAR_PCNFSD "pcnfsd"
#define VAR_PCNFSD_PKG "pcnfsd_pkg"

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: config.c,v 1.102 1997/08/17 10:08:25 jkh Exp $
* $Id: config.c,v 1.103 1997/08/18 21:47:31 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -469,7 +469,8 @@ configSaver(dialogMenuItem *self)
int
configSaverTimeout(dialogMenuItem *self)
{
return (variable_get_value(VAR_BLANKTIME, "Enter time-out period in seconds for screen saver") ?
return (variable_get_value(VAR_BLANKTIME,
"Enter time-out period in seconds for screen saver") ?
DITEM_SUCCESS : DITEM_FAILURE) | DITEM_RESTORE;
}
@ -484,11 +485,14 @@ configNTP(dialogMenuItem *self)
{
int status;
status = variable_get_value("ntpdate_flags", "Enter the name of an NTP server") ? DITEM_SUCCESS : DITEM_FAILURE;
status = variable_get_value(VAR_NTPDATE_FLAGS,
"Enter the name of an NTP server")
? DITEM_SUCCESS : DITEM_FAILURE;
if (status == DITEM_SUCCESS) {
static char tmp[255];
snprintf(tmp, 255, "ntpdate_enable=YES,ntpdate_flags=%s", variable_get("ntpdate_flags"));
snprintf(tmp, sizeof(tmp), "ntpdate_enable=YES,ntpdate_flags=%s",
variable_get(VAR_NTPDATE_FLAGS));
self->data = tmp;
dmenuSetVariables(self);
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: dispatch.c,v 1.22 1997/09/08 11:09:08 jkh Exp $
* $Id: dispatch.c,v 1.23 1997/09/16 18:57:08 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -173,7 +173,7 @@ dispatch_shutdown(dialogMenuItem *unused)
static int
dispatch_systemExecute(dialogMenuItem *unused)
{
char *cmd = variable_get("command");
char *cmd = variable_get(VAR_COMMAND);
if (cmd)
return systemExecute(cmd) ? DITEM_FAILURE : DITEM_SUCCESS;

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated for what's essentially a complete rewrite.
*
* $Id: dmenu.c,v 1.32 1997/02/22 14:11:35 peter Exp $
* $Id: dmenu.c,v 1.33 1997/06/13 14:21:19 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -115,7 +115,7 @@ dmenuSetKmapVariable(dialogMenuItem *tmp)
int err;
variable_set((char *)tmp->data);
lang = variable_get("keymap");
lang = variable_get(VAR_KEYMAP);
if (lang != NULL)
{
err = loadKeymap(lang);

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: package.c,v 1.62 1997/06/13 17:55:32 jkh Exp $
* $Id: package.c,v 1.63 1997/09/16 10:14:22 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -64,7 +64,7 @@ packageAdd(dialogMenuItem *self)
{
char *cp;
cp = variable_get("package");
cp = variable_get(VAR_PACKAGE);
if (!cp) {
msgDebug("packageAdd: No package name passed in package variable\n");
return DITEM_FAILURE;

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
* $Id: sysinstall.h,v 1.139 1997/07/31 11:08:41 jkh Exp $
* $Id: sysinstall.h,v 1.140 1997/09/16 18:57:17 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -106,6 +106,7 @@
#define VAR_DOMAINNAME "domainname"
#define VAR_EDITOR "editor"
#define VAR_EXTRAS "ifconfig_"
#define VAR_COMMAND "command"
#define VAR_CONFIG_FILE "configFile"
#define VAR_FTP_DIR "ftpDirectory"
#define VAR_FTP_PASS "ftpPass"
@ -123,11 +124,13 @@
#define VAR_INSTALL_CFG "installConfig"
#define VAR_INSTALL_ROOT "installRoot"
#define VAR_IPADDR "ipaddr"
#define VAR_KEYMAP "keymap"
#define VAR_LABEL "label"
#define VAR_LABEL_COUNT "labelCount"
#define VAR_MEDIA_TYPE "mediaType"
#define VAR_MEDIA_TIMEOUT "MEDIA_TIMEOUT"
#define VAR_NAMESERVER "nameserver"
#define VAR_NETINTERACTIVE "netInteractive"
#define VAR_NETMASK "netmask"
#define VAR_NETWORK_DEVICE "netDev"
#define VAR_NFS_PATH "nfs"
@ -139,6 +142,8 @@
#define VAR_NO_WARN "noWarn"
#define VAR_NONINTERACTIVE "nonInteractive"
#define VAR_NOVELL "novell"
#define VAR_NTPDATE_FLAGS "ntpdate_flags"
#define VAR_PACKAGE "package"
#define VAR_PARTITION "partition"
#define VAR_PCNFSD "pcnfsd"
#define VAR_PCNFSD_PKG "pcnfsd_pkg"

View File

@ -1,5 +1,5 @@
/*
* $Id: tcpip.c,v 1.70 1997/09/08 11:09:11 jkh Exp $
* $Id: tcpip.c,v 1.71 1997/09/17 13:33:14 jkh Exp $
*
* Copyright (c) 1995
* Gary J Palmer. All rights reserved.
@ -211,7 +211,8 @@ tcpOpenDialog(Device *devp)
save = savescr();
/* If non-interactive, jump straight over the dialog crap and into config section */
if (variable_get(VAR_NONINTERACTIVE) && !variable_get("netInteractive")) {
if (variable_get(VAR_NONINTERACTIVE) &&
!variable_get(VAR_NETINTERACTIVE)) {
if (!hostname[0])
msgConfirm("WARNING: hostname variable not set and is a non-optional\n"
"parameter. Please add this to your installation script\n"