sysinstall.h revision 49110
11897Swollman/* 21897Swollman * The new sysinstall program. 31897Swollman * 41897Swollman * This is probably the last attempt in the `sysinstall' line, the next 51897Swollman * generation being slated to essentially a complete rewrite. 61897Swollman * 71897Swollman * $Id: sysinstall.h,v 1.171 1999/07/19 10:06:17 jkh Exp $ 8100441Scharnier * 91897Swollman * Copyright (c) 1995 101897Swollman * Jordan Hubbard. All rights reserved. 111897Swollman * 12100441Scharnier * Redistribution and use in source and binary forms, with or without 131897Swollman * modification, are permitted provided that the following conditions 141897Swollman * are met: 151897Swollman * 1. Redistributions of source code must retain the above copyright 16100441Scharnier * notice, this list of conditions and the following disclaimer, 171897Swollman * verbatim and that no modifications are made prior to this 181897Swollman * point in the file. 191897Swollman * 2. Redistributions in binary form must reproduce the above copyright 20100441Scharnier * notice, this list of conditions and the following disclaimer in the 211897Swollman * documentation and/or other materials provided with the distribution. 221897Swollman * 231897Swollman * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND 24100441Scharnier * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 251897Swollman * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 261897Swollman * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE 271897Swollman * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 281897Swollman * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2912798Swpaul * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION) 30100441Scharnier * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 311897Swollman * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32146833Sstefanf * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3312798Swpaul * SUCH DAMAGE. 341897Swollman * 3527935Scharnier */ 361897Swollman 37100441Scharnier#ifndef _SYSINSTALL_H_INCLUDE 38100441Scharnier#define _SYSINSTALL_H_INCLUDE 39100441Scharnier 401897Swollman#include <sys/types.h> 418874Srgrimes#include <sys/wait.h> 428874Srgrimes#include <errno.h> 431897Swollman#include <setjmp.h> 4427935Scharnier#include <stdio.h> 451897Swollman#include <stdlib.h> 4612798Swpaul#include <string.h> 4712798Swpaul#include <unistd.h> 48149682Sstefanf#include <dialog.h> 491897Swollman#include "ui_objects.h" 501897Swollman#include "dir.h" 5192921Simp#include "colors.h" 5292921Simp#include "libdisk.h" 5392921Simp#include "dist.h" 5492921Simp 5592921Simp/*** Defines ***/ 5692921Simp 5792921Simp/* device limits */ 5892921Simp#define DEV_NAME_MAX 64 /* The maximum length of a device name */ 5992921Simp#define DEV_MAX 100 /* The maximum number of devices we'll deal with */ 6092921Simp#define INTERFACE_MAX 50 /* Maximum number of network interfaces we'll deal with */ 611897Swollman#define IO_ERROR -2 /* Status code for I/O error rather than normal EOF */ 621897Swollman 638874Srgrimes/* Number of seconds to wait for data to come off even the slowest media */ 641897Swollman#define MEDIA_TIMEOUT 300 651897Swollman 66152398Sdwmalone/* 671897Swollman * I make some pretty gross assumptions about having a max of 50 chunks 6812798Swpaul * total - 8 slices and 42 partitions. I can't easily display many more 691897Swollman * than that on the screen at once! 701897Swollman * 7112798Swpaul * For 2.1 I'll revisit this and try to make it more dynamic, but since 7212798Swpaul * this will catch 99.99% of all possible cases, I'm not too worried. 7312798Swpaul */ 7412798Swpaul#define MAX_CHUNKS 40 7512798Swpaul 7612798Swpaul/* Internal environment variable names */ 7712798Swpaul#define DISK_PARTITIONED "_diskPartitioned" 7812798Swpaul#define DISK_LABELLED "_diskLabelled" 7912798Swpaul#define DISK_SELECTED "_diskSelected" 8012798Swpaul#define SYSTEM_STATE "_systemState" 8112798Swpaul#define RUNNING_ON_ROOT "_runningOnRoot" 8212798Swpaul#define TCP_CONFIGURED "_tcpConfigured" 8312798Swpaul 8412798Swpaul/* Ones that can be tweaked from config files */ 851897Swollman#define VAR_BLANKTIME "blanktime" 861897Swollman#define VAR_BOOTMGR "bootManager" 871897Swollman#define VAR_BROWSER_BINARY "browserBinary" 881897Swollman#define VAR_BROWSER_PACKAGE "browserPackage" 891897Swollman#define VAR_CPIO_VERBOSITY "cpioVerbose" 901897Swollman#define VAR_DEBUG "debug" 911897Swollman#define VAR_DESKSTYLE "_deskStyle" 921897Swollman#define VAR_DISK "disk" 931897Swollman#define VAR_DISTS "dists" 941897Swollman#define VAR_DIST_MAIN "distMain" 951897Swollman#define VAR_DIST_DES "distDES" 961897Swollman#define VAR_DIST_SRC "distSRC" 971897Swollman#define VAR_DIST_X11 "distX11" 981897Swollman#define VAR_DIST_XSERVER "distXserver" 9917142Sjkh#define VAR_DIST_XFONTS "distXfonts" 100100441Scharnier#define VAR_DEDICATE_DISK "dedicateDisk" 10199979Salfred#define VAR_DOMAINNAME "domainname" 1021897Swollman#define VAR_EDITOR "editor" 1031897Swollman#define VAR_EXTRAS "ifconfig_" 1041897Swollman#define VAR_COMMAND "command" 1051897Swollman#define VAR_CONFIG_FILE "configFile" 10617142Sjkh#define VAR_FTP_DIR "ftpDirectory" 107152398Sdwmalone#define VAR_FTP_PASS "ftpPass" 1081897Swollman#define VAR_FTP_PATH "_ftpPath" 10912798Swpaul#define VAR_FTP_PORT "ftpPort" 1101897Swollman#define VAR_FTP_STATE "ftpState" 1111897Swollman#define VAR_FTP_USER "ftpUser" 1121897Swollman#define VAR_FTP_HOST "ftpHost" 1131897Swollman#define VAR_GATEWAY "defaultrouter" 1141897Swollman#define VAR_GEOMETRY "geometry" 1151897Swollman#define VAR_HOSTNAME "hostname" 1161897Swollman#define VAR_IFCONFIG "ifconfig_" 11717142Sjkh#define VAR_INTERFACES "network_interfaces" 118152398Sdwmalone#define VAR_INSTALL_CFG "installConfig" 1191897Swollman#define VAR_INSTALL_ROOT "installRoot" 1201897Swollman#define VAR_IPADDR "ipaddr" 1211897Swollman#define VAR_KEYMAP "keymap" 1221897Swollman#define VAR_KGET "kget" 1231897Swollman#define VAR_LABEL "label" 1241897Swollman#define VAR_LABEL_COUNT "labelCount" 1251897Swollman#define VAR_LINUX_ENABLE "linux_enable" 1261897Swollman#define VAR_MEDIA_TYPE "mediaType" 12717142Sjkh#define VAR_MEDIA_TIMEOUT "MEDIA_TIMEOUT" 128152398Sdwmalone#define VAR_MOUSED "moused_enable" 1291897Swollman#define VAR_MOUSED_PORT "moused_port" 13012798Swpaul#define VAR_MOUSED_TYPE "moused_type" 1311897Swollman#define VAR_NAMESERVER "nameserver" 132149709Sstefanf#define VAR_NETINTERACTIVE "netInteractive" 133149710Sstefanf#define VAR_NETMASK "netmask" 134149709Sstefanf#define VAR_NETWORK_DEVICE "netDev" 135149709Sstefanf#define VAR_NFS_PATH "nfs" 136149709Sstefanf#define VAR_NFS_HOST "nfsHost" 137149709Sstefanf#define VAR_NFS_SECURE "nfs_reserved_port_only" 1381897Swollman#define VAR_NFS_SERVER "nfs_server_enable" 1391897Swollman#define VAR_NO_CONFIRM "noConfirm" 14017142Sjkh#define VAR_NO_ERROR "noError" 141152398Sdwmalone#define VAR_NO_WARN "noWarn" 14212798Swpaul#define VAR_NO_USR "noUsr" 14312798Swpaul#define VAR_NONINTERACTIVE "nonInteractive" 14412798Swpaul#define VAR_NOVELL "novell" 14512798Swpaul#define VAR_NTPDATE_FLAGS "ntpdate_flags" 14612798Swpaul#define VAR_PACKAGE "package" 14712798Swpaul#define VAR_PARTITION "partition" 14812798Swpaul#define VAR_PCNFSD "pcnfsd" 149149680Sstefanf#define VAR_PKG_TMPDIR "PKG_TMPDIR" 15012798Swpaul#define VAR_PORTS_PATH "ports" 15112798Swpaul#define VAR_PPP_ENABLE "ppp_enable" 15212798Swpaul#define VAR_PPP_PROFILE "ppp_profile" 15312798Swpaul#define VAR_RELNAME "releaseName" 15412798Swpaul#define VAR_ROOT_SIZE "rootSize" 15517142Sjkh#define VAR_ROUTER "router" 156152398Sdwmalone#define VAR_ROUTER_ENABLE "router_enable" 15712798Swpaul#define VAR_ROUTERFLAGS "routerflags" 15812798Swpaul#define VAR_SERIAL_SPEED "serialSpeed" 15912798Swpaul#define VAR_SLOW_ETHER "slowEthernetCard" 16012798Swpaul#define VAR_SWAP_SIZE "swapSize" 16117142Sjkh#define VAR_TAPE_BLOCKSIZE "tapeBlocksize" 162152398Sdwmalone#define VAR_TRY_DHCP "tryDHCP" 1631897Swollman#define VAR_UFS_PATH "ufs" 1641897Swollman#define VAR_USR_SIZE "usrSize" 1651897Swollman#define VAR_VAR_SIZE "varSize" 1661897Swollman#define VAR_XF86_CONFIG "_xf86config" 1671897Swollman 1681897Swollman#define DEFAULT_TAPE_BLOCKSIZE "20" 16917142Sjkh 170152398Sdwmalone/* One MB worth of blocks */ 1711897Swollman#define ONE_MEG 2048 1721897Swollman 1731897Swollman/* Which selection attributes to use */ 1741897Swollman#define ATTR_SELECTED (ColorDisplay ? item_selected_attr : item_attr) 1751897Swollman#define ATTR_TITLE button_active_attr 17617142Sjkh 177152398Sdwmalone/* Handy strncpy() macro */ 1781897Swollman#define SAFE_STRCPY(to, from) sstrncpy((to), (from), sizeof (to) - 1) 1791897Swollman 1801897Swollman/*** Types ***/ 1811897Swollmantypedef unsigned int Boolean; 18217142Sjkhtypedef struct disk Disk; 183152398Sdwmalonetypedef struct chunk Chunk; 1841897Swollman 18512798Swpaul/* Bitfields for menu options */ 18612798Swpaul#define DMENU_NORMAL_TYPE 0x1 /* Normal dialog menu */ 18712798Swpaul#define DMENU_RADIO_TYPE 0x2 /* Radio dialog menu */ 18812798Swpaul#define DMENU_CHECKLIST_TYPE 0x4 /* Multiple choice menu */ 18912798Swpaul#define DMENU_SELECTION_RETURNS 0x8 /* Immediate return on item selection */ 19012798Swpaul 1911897Swollmantypedef struct _dmenu { 19212798Swpaul int type; /* What sort of menu we are */ 1931897Swollman char *title; /* Our title */ 19412798Swpaul char *prompt; /* Our prompt */ 1951897Swollman char *helpline; /* Line of help at bottom */ 1961897Swollman char *helpfile; /* Help file for "F1" */ 1971897Swollman dialogMenuItem items[0]; /* Array of menu items */ 19812798Swpaul} DMenu; 1991897Swollman 2001897Swollman/* An rc.conf variable */ 2011897Swollmantypedef struct _variable { 20217142Sjkh struct _variable *next; 203173761Sjb char *name; 2041897Swollman char *value; 20512798Swpaul int dirty; 2061897Swollman} Variable; 2071897Swollman 208173761Sjb#define NO_ECHO_OBJ(type) ((type) | (DITEM_NO_ECHO << 16)) 209173761Sjb#define TYPE_OF_OBJ(type) ((type) & 0xff) 2101897Swollman#define ATTR_OF_OBJ(type) ((type) >> 16) 2111897Swollman 21217142Sjkh/* A screen layout structure */ 213152398Sdwmalonetypedef struct _layout { 214152398Sdwmalone int y; /* x & Y co-ordinates */ 2151897Swollman int x; 216152398Sdwmalone int len; /* The size of the dialog on the screen */ 217173761Sjb int maxlen; /* How much the user can type in ... */ 2181897Swollman char *prompt; /* The string for the prompt */ 2191897Swollman char *help; /* The display for the help line */ 2201897Swollman void *var; /* The var to set when this changes */ 221173761Sjb int type; /* The type of the dialog to create */ 222173761Sjb void *obj; /* The obj pointer returned by libdialog */ 223173761Sjb} Layout; 2241897Swollman 2251897Swollmantypedef enum { 226173761Sjb DEVICE_TYPE_NONE, 22712798Swpaul DEVICE_TYPE_DISK, 2281897Swollman DEVICE_TYPE_FLOPPY, 2291897Swollman DEVICE_TYPE_FTP, 2301897Swollman DEVICE_TYPE_NETWORK, 2311897Swollman DEVICE_TYPE_CDROM, 2321897Swollman DEVICE_TYPE_TAPE, 2331897Swollman DEVICE_TYPE_DOS, 2341897Swollman DEVICE_TYPE_UFS, 2351897Swollman DEVICE_TYPE_NFS, 2361897Swollman DEVICE_TYPE_ANY, 2371897Swollman} DeviceType; 2381897Swollman 2391897Swollman/* CDROM mount codes */ 2401897Swollman#define CD_UNMOUNTED 0 2411897Swollman#define CD_ALREADY_MOUNTED 1 2421897Swollman#define CD_WE_MOUNTED_IT 2 2431897Swollman 2441897Swollman/* A "device" from sysinstall's point of view */ 24512798Swpaultypedef struct _device { 2461897Swollman char name[DEV_NAME_MAX]; 2471897Swollman char *description; 2481897Swollman char *devname; 2491897Swollman DeviceType type; 2501897Swollman Boolean enabled; 2511897Swollman Boolean (*init)(struct _device *dev); 2521897Swollman FILE * (*get)(struct _device *dev, char *file, Boolean probe); 2531897Swollman void (*shutdown)(struct _device *dev); 2541897Swollman void *private; 2551897Swollman unsigned int flags; 2561897Swollman} Device; 2571897Swollman 2581897Swollman/* Some internal representations of partitions */ 2591897Swollmantypedef enum { 2601897Swollman PART_NONE, 2611897Swollman PART_SLICE, 2621897Swollman PART_SWAP, 2631897Swollman PART_FILESYSTEM, 2641897Swollman PART_FAT, 26512798Swpaul} PartType; 2661897Swollman 2671897Swollman/* The longest newfs command we'll hand to system() */ 26812798Swpaul#define NEWFS_CMD_MAX 256 26912798Swpaul 2701897Swollmantypedef struct _part_info { 2711897Swollman Boolean newfs; 2721897Swollman char mountpoint[FILENAME_MAX]; 2731897Swollman char newfs_cmd[NEWFS_CMD_MAX]; 2741897Swollman} PartInfo; 27512798Swpaul 2761897Swollman/* An option */ 2771897Swollmantypedef struct _opt { 2781897Swollman char *name; 2791897Swollman char *desc; 2801897Swollman enum { OPT_IS_STRING, OPT_IS_INT, OPT_IS_FUNC, OPT_IS_VAR } type; 2811897Swollman void *data; 2821897Swollman void *aux; 283173761Sjb char *(*check)(); 2841897Swollman} Option; 2851897Swollman 2861897Swollman/* Weird index nodey things we use for keeping track of package information */ 28717142Sjkhtypedef enum { PACKAGE, PLACE } node_type; /* Types of nodes */ 288152398Sdwmalone 2891897Swollmantypedef struct _pkgnode { /* A node in the reconstructed hierarchy */ 2901897Swollman struct _pkgnode *next; /* My next sibling */ 2911897Swollman node_type type; /* What am I? */ 292173761Sjb char *name; /* My name */ 2931897Swollman char *desc; /* My description (Hook) */ 2941897Swollman struct _pkgnode *kids; /* My little children */ 29517142Sjkh void *data; /* A place to hang my data */ 296152398Sdwmalone} PkgNode; 29712798Swpaultypedef PkgNode *PkgNodePtr; 29812798Swpaul 29912798Swpaul/* A single package */ 30012798Swpaultypedef struct _indexEntry { /* A single entry in an INDEX file */ 3011897Swollman char *name; /* name */ 30212798Swpaul char *path; /* full path to port */ 30312798Swpaul char *prefix; /* port prefix */ 30412798Swpaul char *comment; /* one line description */ 30512798Swpaul char *descrfile; /* path to description file */ 30612798Swpaul char *deps; /* packages this depends on */ 30712798Swpaul int depc; /* how many depend on me */ 30812798Swpaul int installed; /* indicates if it is installed */ 30912798Swpaul char *maintainer; /* maintainer */ 31012798Swpaul} IndexEntry; 31112798Swpaultypedef IndexEntry *IndexEntryPtr; 31212798Swpaul 31312798Swpaultypedef int (*commandFunc)(char *key, void *data); 31412798Swpaul 31517142Sjkh#define HOSTNAME_FIELD_LEN 128 316152398Sdwmalone#define IPADDR_FIELD_LEN 16 3171897Swollman#define EXTRAS_FIELD_LEN 128 3181897Swollman 3191897Swollman/* This is the structure that Network devices carry around in their private, erm, structures */ 3201897Swollmantypedef struct _devPriv { 3211897Swollman int use_dhcp; 322152398Sdwmalone char ipaddr[IPADDR_FIELD_LEN]; 323152398Sdwmalone char netmask[IPADDR_FIELD_LEN]; 3241897Swollman char extras[EXTRAS_FIELD_LEN]; 32512798Swpaul} DevInfo; 3261897Swollman 3271897Swollman 32812798Swpaul/*** Externs ***/ 32912798Swpaulextern jmp_buf BailOut; /* Used to get the heck out */ 33012798Swpaulextern int DebugFD; /* Where diagnostic output goes */ 33112798Swpaulextern Boolean Fake; /* Don't actually modify anything - testing */ 3321897Swollmanextern Boolean SystemWasInstalled; /* Did we install it? */ 3331897Swollmanextern Boolean RunningAsInit; /* Are we running stand-alone? */ 334100441Scharnierextern Boolean DialogActive; /* Is the dialog() stuff up? */ 335100441Scharnierextern Boolean ColorDisplay; /* Are we on a color display? */ 33612798Swpaulextern Boolean OnVTY; /* On a syscons VTY? */ 33712798Swpaulextern Variable *VarHead; /* The head of the variable chain */ 33812798Swpaulextern Device *mediaDevice; /* Where we're getting our distribution from */ 33912798Swpaulextern unsigned int Dists; /* Which distributions we want */ 34012798Swpaulextern unsigned int DESDists; /* Which naughty distributions we want */ 34112798Swpaulextern unsigned int SrcDists; /* Which src distributions we want */ 34212798Swpaulextern unsigned int XF86Dists; /* Which XFree86 dists we want */ 34312798Swpaulextern unsigned int XF86ServerDists; /* The XFree86 servers we want */ 34412798Swpaulextern unsigned int XF86FontDists; /* The XFree86 fonts we want */ 3451897Swollmanextern int BootMgr; /* Which boot manager to use */ 3461897Swollmanextern int StatusLine; /* Where to print our status messages */ 3471897Swollmanextern DMenu MenuInitial; /* Initial installation menu */ 3481897Swollmanextern DMenu MenuFixit; /* Fixit repair menu */ 3491897Swollmanextern DMenu MenuMBRType; /* Type of MBR to write on the disk */ 3501897Swollmanextern DMenu MenuConfigure; /* Final configuration menu */ 3511897Swollmanextern DMenu MenuDocumentation; /* Documentation menu */ 3521897Swollmanextern DMenu MenuFTPOptions; /* FTP Installation options */ 353100441Scharnierextern DMenu MenuIndex; /* Index menu */ 354100441Scharnierextern DMenu MenuOptions; /* Installation options */ 35512798Swpaulextern DMenu MenuOptionsLanguage; /* Language options menu */ 35612798Swpaulextern DMenu MenuMedia; /* Media type menu */ 35712798Swpaulextern DMenu MenuMouse; /* Mouse type menu */ 35812798Swpaulextern DMenu MenuMediaCDROM; /* CDROM media menu */ 35912798Swpaulextern DMenu MenuMediaDOS; /* DOS media menu */ 36012798Swpaulextern DMenu MenuMediaFloppy; /* Floppy media menu */ 36112798Swpaulextern DMenu MenuMediaFTP; /* FTP media menu */ 36212798Swpaulextern DMenu MenuMediaTape; /* Tape media menu */ 3631897Swollmanextern DMenu MenuNetworkDevice; /* Network device menu */ 36412798Swpaulextern DMenu MenuNTP; /* NTP time server menu */ 3651897Swollmanextern DMenu MenuStartup; /* Startup services menu */ 3661897Swollmanextern DMenu MenuSyscons; /* System console configuration menu */ 36717142Sjkhextern DMenu MenuSysconsFont; /* System console font configuration menu */ 36817142Sjkhextern DMenu MenuSysconsKeymap; /* System console keymap configuration menu */ 36917142Sjkhextern DMenu MenuSysconsKeyrate; /* System console keyrate configuration menu */ 3701897Swollmanextern DMenu MenuSysconsSaver; /* System console saver configuration menu */ 3711897Swollmanextern DMenu MenuSysconsScrnmap; /* System console screenmap configuration menu */ 3721897Swollmanextern DMenu MenuNetworking; /* Network configuration menu */ 3731897Swollmanextern DMenu MenuInstallCustom; /* Custom Installation menu */ 3741897Swollmanextern DMenu MenuDistributions; /* Distribution menu */ 37512798Swpaulextern DMenu MenuDiskDevices; /* Disk type devices */ 3761897Swollmanextern DMenu MenuSubDistributions; /* Custom distribution menu */ 3771897Swollmanextern DMenu MenuDESDistributions; /* DES distribution menu */ 3781897Swollmanextern DMenu MenuSrcDistributions; /* Source distribution menu */ 37912798Swpaulextern DMenu MenuXF86; /* XFree86 main menu */ 380152398Sdwmaloneextern DMenu MenuXF86Select; /* XFree86 distribution selection menu */ 38112798Swpaulextern DMenu MenuXF86SelectCore; /* XFree86 core distribution menu */ 38212798Swpaulextern DMenu MenuXF86SelectServer; /* XFree86 server distribution menu */ 38312798Swpaulextern DMenu MenuXF86SelectPC98Server; /* XFree86 server distribution menu */ 38412798Swpaulextern DMenu MenuXF86SelectFonts; /* XFree86 font selection menu */ 38512798Swpaulextern DMenu MenuXF86SelectFonts; /* XFree86 font selection menu */ 386152398Sdwmaloneextern DMenu MenuXDesktops; /* Disk devices menu */ 387152398Sdwmaloneextern DMenu MenuHTMLDoc; /* HTML Documentation menu */ 38812798Swpaulextern DMenu MenuUsermgmt; /* User management menu */ 38912798Swpaulextern DMenu MenuFixit; /* Fixit floppy/CDROM/shell menu */ 3901897Swollmanextern DMenu MenuXF86Config; /* Select XFree86 configuration type */ 39199979Salfred 39212798Swpaul/* Stuff from libdialog which isn't properly declared outside */ 39312798Swpaulextern void display_helpfile(void); 39412798Swpaulextern void display_helpline(WINDOW *w, int y, int width); 39512798Swpaul 3961897Swollman/*** Prototypes ***/ 39712798Swpaul 39812798Swpaul/* anonFTP.c */ 39912798Swpaulextern int configAnonFTP(dialogMenuItem *self); 40012798Swpaul 40112798Swpaul/* cdrom.c */ 40212798Swpaulextern Boolean mediaInitCDROM(Device *dev); 40312798Swpaulextern FILE *mediaGetCDROM(Device *dev, char *file, Boolean probe); 40412798Swpaulextern void mediaShutdownCDROM(Device *dev); 40512798Swpaul 40612798Swpaul/* command.c */ 40712798Swpaulextern void command_clear(void); 40812798Swpaulextern void command_sort(void); 40912798Swpaulextern void command_execute(void); 41012798Swpaulextern void command_shell_add(char *key, char *fmt, ...); 41112798Swpaulextern void command_func_add(char *key, commandFunc func, void *data); 41212798Swpaul 41312798Swpaul/* config.c */ 41412798Swpaulextern void configEnvironmentRC_conf(void); 41512798Swpaulextern void configEnvironmentResolv(char *config); 41612798Swpaulextern void configRC_conf(void); 41712798Swpaulextern int configFstab(dialogMenuItem *self); 41812798Swpaulextern int configRC(dialogMenuItem *self); 41912798Swpaulextern int configResolv(dialogMenuItem *self); 42012798Swpaulextern int configPackages(dialogMenuItem *self); 42112798Swpaulextern int configSaver(dialogMenuItem *self); 42212798Swpaulextern int configSaverTimeout(dialogMenuItem *self); 42312798Swpaulextern int configLinux(dialogMenuItem *self); 42412798Swpaulextern int configNTP(dialogMenuItem *self); 42512798Swpaulextern int configUsers(dialogMenuItem *self); 42612798Swpaulextern int configXSetup(dialogMenuItem *self); 42712798Swpaulextern int configXDesktop(dialogMenuItem *self); 428100441Scharnierextern int configRouter(dialogMenuItem *self); 429100441Scharnierextern int configPCNFSD(dialogMenuItem *self); 430100441Scharnierextern int configNFSServer(dialogMenuItem *self); 43112798Swpaulextern int configWriteRC_conf(dialogMenuItem *self); 432100441Scharnier 43312798Swpaul/* crc.c */ 43412798Swpaulextern int crc(int, unsigned long *, unsigned long *); 43512798Swpaul 43612798Swpaul/* devices.c */ 43712798Swpaulextern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogMenuItem *d), 43812798Swpaul int (*check)(dialogMenuItem *d)); 43912798Swpaulextern void deviceGetAll(void); 44048566Sbillfextern void deviceReset(void); 441149680Sstefanfextern void deviceRescan(void); 44212798Swpaulextern Device **deviceFind(char *name, DeviceType type); 44312798Swpaulextern Device **deviceFindDescr(char *name, char *desc, DeviceType class); 444149680Sstefanfextern int deviceCount(Device **devs); 44512798Swpaulextern Device *new_device(char *name); 44612798Swpaulextern Device *deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean enabled, 44712798Swpaul Boolean (*init)(Device *mediadev), 44812798Swpaul FILE * (*get)(Device *dev, char *file, Boolean probe), 44912798Swpaul void (*shutDown)(Device *mediadev), 45012798Swpaul void *private); 45112798Swpaulextern Boolean dummyInit(Device *dev); 45212798Swpaulextern FILE *dummyGet(Device *dev, char *dist, Boolean probe); 45312798Swpaulextern void dummyShutdown(Device *dev); 45412798Swpaul 45512798Swpaul/* dhcp.c */ 45648566Sbillfextern int dhcpParseLeases(char *file, char *hostname, char *domain, char *nameserver, 45712798Swpaul char *ipaddr, char *gateway, char *netmask); 45812798Swpaul 45912798Swpaul/* disks.c */ 46012798Swpaulextern int diskPartitionEditor(dialogMenuItem *self); 46112798Swpaulextern int diskPartitionWrite(dialogMenuItem *self); 46212798Swpaulextern int diskGetSelectCount(Device ***devs); 46312798Swpaulextern void diskPartition(Device *dev); 46412798Swpaul 46512798Swpaul/* dispatch.c */ 46648566Sbillfextern int dispatchCommand(char *command); 46712798Swpaulextern int dispatch_load_floppy(dialogMenuItem *self); 46812798Swpaulextern int dispatch_load_file_int(int); 46912798Swpaulextern int dispatch_load_file(dialogMenuItem *self); 47012798Swpaul 47112798Swpaul 47212798Swpaul/* dist.c */ 47312798Swpaulextern int distReset(dialogMenuItem *self); 47412798Swpaulextern int distConfig(dialogMenuItem *self); 47512798Swpaulextern int distSetCustom(dialogMenuItem *self); 47612798Swpaulextern int distSetDeveloper(dialogMenuItem *self); 47712798Swpaulextern int distSetXDeveloper(dialogMenuItem *self); 47812798Swpaulextern int distSetKernDeveloper(dialogMenuItem *self); 47912798Swpaulextern int distSetXKernDeveloper(dialogMenuItem *self); 48012798Swpaulextern int distSetUser(dialogMenuItem *self); 48112798Swpaulextern int distSetXUser(dialogMenuItem *self); 48212798Swpaulextern int distSetMinimum(dialogMenuItem *self); 48312798Swpaulextern int distSetEverything(dialogMenuItem *self); 48412798Swpaulextern int distSetDES(dialogMenuItem *self); 48512798Swpaulextern int distSetSrc(dialogMenuItem *self); 48612798Swpaulextern int distSetXF86(dialogMenuItem *self); 48712798Swpaulextern int distExtractAll(dialogMenuItem *self); 48812798Swpaul 48948566Sbillf/* dmenu.c */ 49012798Swpaulextern int dmenuDisplayFile(dialogMenuItem *tmp); 49112798Swpaulextern int dmenuSubmenu(dialogMenuItem *tmp); 492207733Sdelphijextern int dmenuSystemCommand(dialogMenuItem *tmp); 49312798Swpaulextern int dmenuSystemCommandBox(dialogMenuItem *tmp); 49412798Swpaulextern int dmenuExit(dialogMenuItem *tmp); 49512798Swpaulextern int dmenuISetVariable(dialogMenuItem *tmp); 49612798Swpaulextern int dmenuSetVariable(dialogMenuItem *tmp); 49712798Swpaulextern int dmenuSetKmapVariable(dialogMenuItem *tmp); 49899979Salfredextern int dmenuSetVariables(dialogMenuItem *tmp); 499149680Sstefanfextern int dmenuToggleVariable(dialogMenuItem *tmp); 500149680Sstefanfextern int dmenuSetFlag(dialogMenuItem *tmp); 50112798Swpaulextern int dmenuSetValue(dialogMenuItem *tmp); 50212798Swpaulextern Boolean dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max, Boolean buttons); 50312798Swpaulextern Boolean dmenuOpenSimple(DMenu *menu, Boolean buttons); 50412798Swpaulextern int dmenuVarCheck(dialogMenuItem *item); 50512798Swpaulextern int dmenuVarsCheck(dialogMenuItem *item); 50612798Swpaulextern int dmenuFlagCheck(dialogMenuItem *item); 50712798Swpaulextern int dmenuRadioCheck(dialogMenuItem *item); 50812798Swpaul 50912798Swpaul/* doc.c */ 51012798Swpaulextern int docBrowser(dialogMenuItem *self); 51112798Swpaulextern int docShowDocument(dialogMenuItem *self); 51212798Swpaul 51312798Swpaul/* dos.c */ 51412798Swpaulextern Boolean mediaCloseDOS(Device *dev, FILE *fp); 51512798Swpaulextern Boolean mediaInitDOS(Device *dev); 51612798Swpaulextern FILE *mediaGetDOS(Device *dev, char *file, Boolean probe); 51712798Swpaulextern void mediaShutdownDOS(Device *dev); 51812798Swpaul 51912798Swpaul/* floppy.c */ 52012798Swpaulextern int getRootFloppy(void); 52112798Swpaulextern Boolean mediaInitFloppy(Device *dev); 52212798Swpaulextern FILE *mediaGetFloppy(Device *dev, char *file, Boolean probe); 52312798Swpaulextern void mediaShutdownFloppy(Device *dev); 52412798Swpaul 52512798Swpaul/* ftp_strat.c */ 52612798Swpaulextern Boolean mediaCloseFTP(Device *dev, FILE *fp); 52712798Swpaulextern Boolean mediaInitFTP(Device *dev); 52812798Swpaulextern FILE *mediaGetFTP(Device *dev, char *file, Boolean probe); 52912798Swpaulextern void mediaShutdownFTP(Device *dev); 53012798Swpaul 53112798Swpaul/* globals.c */ 53212798Swpaulextern void globalsInit(void); 53312798Swpaul 53412798Swpaul/* index.c */ 53599979Salfredint index_read(FILE *fp, PkgNodePtr papa); 53612798Swpaulint index_menu(PkgNodePtr root, PkgNodePtr top, PkgNodePtr plist, int *pos, int *scroll); 53712798Swpaulvoid index_init(PkgNodePtr top, PkgNodePtr plist); 53817142Sjkhvoid index_node_free(PkgNodePtr top, PkgNodePtr plist); 539152398Sdwmalonevoid index_sort(PkgNodePtr top); 5401897Swollmanvoid index_print(PkgNodePtr top, int level); 5411897Swollmanint index_extract(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended); 54217142Sjkhint index_initialize(char *path); 54312798SwpaulPkgNodePtr index_search(PkgNodePtr top, char *str, PkgNodePtr *tp); 54412798Swpaul 5451897Swollman/* install.c */ 546149680Sstefanfextern Boolean checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vdev); 54712798Swpaulextern int installCommit(dialogMenuItem *self); 54812798Swpaulextern int installCustomCommit(dialogMenuItem *self); 54912798Swpaulextern int installExpress(dialogMenuItem *self); 55012798Swpaulextern int installNovice(dialogMenuItem *self); 5511897Swollmanextern int installFixitHoloShell(dialogMenuItem *self); 5521897Swollmanextern int installFixitCDROM(dialogMenuItem *self); 55312798Swpaulextern int installFixitFloppy(dialogMenuItem *self); 55412798Swpaulextern int installFixupBin(dialogMenuItem *self); 55512798Swpaulextern int installFixupXFree(dialogMenuItem *self); 55612798Swpaulextern int installUpgrade(dialogMenuItem *self); 55712798Swpaulextern int installFilesystems(dialogMenuItem *self); 5581897Swollmanextern int installVarDefaults(dialogMenuItem *self); 55912798Swpaulextern void installEnvironment(void); 56012798Swpaulextern Boolean copySelf(void); 56112798Swpaul 56212798Swpaul/* kget.c */ 56312798Swpaulextern int kget(char *out); 56412798Swpaul 56512798Swpaul/* keymap.c */ 56612798Swpaulextern int loadKeymap(const char *lang); 56712798Swpaul 56812798Swpaul/* label.c */ 56912798Swpaulextern int diskLabelEditor(dialogMenuItem *self); 57012798Swpaulextern int diskLabelCommit(dialogMenuItem *self); 57112798Swpaul 57212798Swpaul/* lndir.c */ 57312798Swpaulextern int lndir(char *from, char *to); 57412798Swpaul 57512798Swpaul/* makedevs.c (auto-generated) */ 576149680Sstefanfextern const char termcap_ansi[]; 57712798Swpaulextern const char termcap_vt100[]; 57812798Swpaulextern const char termcap_cons25[]; 57912798Swpaulextern const char termcap_cons25_m[]; 58012798Swpaulextern const char termcap_cons25r[]; 58112798Swpaulextern const char termcap_cons25r_m[]; 582149680Sstefanfextern const char termcap_cons25l1[]; 58312798Swpaulextern const char termcap_cons25l1_m[]; 5841897Swollmanextern const u_char font_iso_8x16[]; 58512798Swpaulextern const u_char font_cp850_8x16[]; 58612798Swpaulextern const u_char font_cp866_8x16[]; 58712798Swpaulextern const u_char koi8_r2cp866[]; 58812798Swpaulextern u_char default_scrnmap[]; 58912798Swpaul 5901897Swollman/* media.c */ 59112798Swpaulextern char *cpioVerbosity(void); 59212798Swpaulextern void mediaClose(void); 59312798Swpaulextern int mediaTimeout(void); 59412798Swpaulextern int mediaSetCDROM(dialogMenuItem *self); 59512798Swpaulextern int mediaSetFloppy(dialogMenuItem *self); 59612798Swpaulextern int mediaSetDOS(dialogMenuItem *self); 59712798Swpaulextern int mediaSetTape(dialogMenuItem *self); 59812798Swpaulextern int mediaSetFTP(dialogMenuItem *self); 59912798Swpaulextern int mediaSetFTPActive(dialogMenuItem *self); 60012798Swpaulextern int mediaSetFTPPassive(dialogMenuItem *self); 60112798Swpaulextern int mediaSetUFS(dialogMenuItem *self); 60212798Swpaulextern int mediaSetNFS(dialogMenuItem *self); 60312798Swpaulextern int mediaSetFTPUserPass(dialogMenuItem *self); 60412798Swpaulextern int mediaSetCPIOVerbosity(dialogMenuItem *self); 60512798Swpaulextern int mediaGetType(dialogMenuItem *self); 60612798Swpaulextern Boolean mediaExtractDist(char *dir, char *dist, FILE *fp); 60717142Sjkhextern Boolean mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpic); 608152398Sdwmaloneextern Boolean mediaExtractDistEnd(int zpid, int cpid); 6091897Swollmanextern Boolean mediaVerify(void); 610152398Sdwmaloneextern FILE *mediaGenericGet(char *base, const char *file); 611152398Sdwmalone 612152398Sdwmalone/* misc.c */ 6131897Swollmanextern Boolean file_readable(char *fname); 6141897Swollmanextern Boolean file_executable(char *fname); 6151897Swollmanextern Boolean directory_exists(const char *dirname); 6161897Swollmanextern char *root_bias(char *path); 6171897Swollmanextern char *itoa(int value); 61817142Sjkhextern char *string_concat(char *p1, char *p2); 619152398Sdwmaloneextern char *string_concat3(char *p1, char *p2, char *p3); 6201897Swollmanextern char *string_prune(char *str); 621152398Sdwmaloneextern char *string_skipwhite(char *str); 622152398Sdwmaloneextern char *string_copy(char *s1, char *s2); 623152398Sdwmaloneextern char *pathBaseName(const char *path); 6241897Swollmanextern void safe_free(void *ptr); 6251897Swollmanextern void *safe_malloc(size_t size); 6261897Swollmanextern void *safe_realloc(void *orig, size_t size); 6271897Swollmanextern dialogMenuItem *item_add(dialogMenuItem *list, char *prompt, char *title, 6281897Swollman int (*checked)(dialogMenuItem *self), 6291897Swollman int (*fire)(dialogMenuItem *self), 6301897Swollman void (*selected)(dialogMenuItem *self, int is_selected), 6311897Swollman void *data, int aux, int *curr, int *max); 63212798Swpaulextern void items_free(dialogMenuItem *list, int *curr, int *max); 6331897Swollmanextern int Mkdir(char *); 63412798Swpaulextern int Mount(char *, void *data); 63512798Swpaulextern WINDOW *openLayoutDialog(char *helpfile, char *title, int x, int y, int width, int height); 636152398Sdwmaloneextern ComposeObj *initLayoutDialog(WINDOW *win, Layout *layout, int x, int y, int *max); 63712798Swpaulextern int layoutDialogLoop(WINDOW *win, Layout *layout, ComposeObj **obj, 63817142Sjkh int *n, int max, int *cbutton, int *cancel); 639152398Sdwmalone 64012798Swpaulextern WINDOW *savescr(void); 64112798Swpaulextern void restorescr(WINDOW *w); 64212798Swpaulextern char *sstrncpy(char *dst, const char *src, int size); 64312798Swpaul 64412798Swpaul/* mouse.c */ 64512798Swpaulextern int mousedTest(dialogMenuItem *self); 64612798Swpaulextern int mousedDisable(dialogMenuItem *self); 64712798Swpaul 64812798Swpaul/* msg.c */ 649149710Sstefanfextern Boolean isDebug(void); 65012798Swpaulextern void msgInfo(char *fmt, ...); 65112798Swpaulextern void msgYap(char *fmt, ...); 65212798Swpaulextern void msgWarn(char *fmt, ...); 65312798Swpaulextern void msgDebug(char *fmt, ...); 65412798Swpaulextern void msgError(char *fmt, ...); 65512798Swpaulextern void msgFatal(char *fmt, ...); 65612798Swpaulextern void msgConfirm(char *fmt, ...); 65712798Swpaulextern void msgNotify(char *fmt, ...); 65812798Swpaulextern void msgWeHaveOutput(char *fmt, ...); 65912798Swpaulextern int msgYesNo(char *fmt, ...); 66099979Salfredextern char *msgGetInput(char *buf, char *fmt, ...); 66117142Sjkhextern int msgSimpleConfirm(char *); 66299979Salfredextern int msgSimpleNotify(char *); 66312798Swpaul 66412798Swpaul/* network.c */ 66512798Swpaulextern Boolean mediaInitNetwork(Device *dev); 66617142Sjkhextern void mediaShutdownNetwork(Device *dev); 667152398Sdwmalone 66812798Swpaul/* nfs.c */ 66912798Swpaulextern Boolean mediaInitNFS(Device *dev); 67012798Swpaulextern FILE *mediaGetNFS(Device *dev, char *file, Boolean probe); 67112798Swpaulextern void mediaShutdownNFS(Device *dev); 67212798Swpaul 67312798Swpaul/* options.c */ 67412798Swpaulextern int optionsEditor(dialogMenuItem *self); 67512798Swpaul 67612798Swpaul/* package.c */ 67712798Swpaulextern int packageAdd(dialogMenuItem *self); 67812798Swpaulextern int package_add(char *name); 67912798Swpaulextern int package_extract(Device *dev, char *name, Boolean depended); 68012798Swpaulextern Boolean package_exists(char *name); 68112798Swpaul 68212798Swpaul/* system.c */ 68312798Swpaulextern void systemInitialize(int argc, char **argv); 68412798Swpaulextern void systemShutdown(int status); 68512798Swpaulextern int execExecute(char *cmd, char *name); 686152398Sdwmaloneextern int systemExecute(char *cmd); 68712798Swpaulextern int systemDisplayHelp(char *file); 68812798Swpaulextern char *systemHelpFile(char *file, char *buf); 68912798Swpaulextern void systemChangeFont(const u_char font[]); 69012798Swpaulextern void systemChangeLang(char *lang); 69112798Swpaulextern void systemChangeTerminal(char *color, const u_char c_termcap[], char *mono, const u_char m_termcap[]); 692152398Sdwmaloneextern void systemChangeScreenmap(const u_char newmap[]); 69312798Swpaulextern void systemCreateHoloshell(void); 69412798Swpaulextern int vsystem(char *fmt, ...); 69512798Swpaul 69612798Swpaul/* tape.c */ 69712798Swpaulextern char *mediaTapeBlocksize(void); 69812798Swpaulextern Boolean mediaInitTape(Device *dev); 69912798Swpaulextern FILE *mediaGetTape(Device *dev, char *file, Boolean probe); 70012798Swpaulextern void mediaShutdownTape(Device *dev); 70112798Swpaul 70212798Swpaul/* tcpip.c */ 703152398Sdwmaloneextern int tcpOpenDialog(Device *dev); 70412798Swpaulextern int tcpMenuSelect(dialogMenuItem *self); 70512798Swpaulextern Device *tcpDeviceSelect(void); 706152398Sdwmalone 707152398Sdwmalone/* termcap.c */ 70812798Swpaulextern int set_termcap(void); 70912798Swpaul 71012798Swpaul/* ufs.c */ 711100441Scharnierextern void mediaShutdownUFS(Device *dev); 71212798Swpaulextern Boolean mediaInitUFS(Device *dev); 71312798Swpaulextern FILE *mediaGetUFS(Device *dev, char *file, Boolean probe); 71412798Swpaul 71512798Swpaul/* user.c */ 71612798Swpaulextern int userAddGroup(dialogMenuItem *self); 71712798Swpaulextern int userAddUser(dialogMenuItem *self); 71812798Swpaul 71912798Swpaul/* variable.c */ 720extern void variable_set(char *var, int dirty); 721extern void variable_set2(char *name, char *value, int dirty); 722extern char *variable_get(char *var); 723extern int variable_cmp(char *var, char *value); 724extern void variable_unset(char *var); 725extern char *variable_get_value(char *var, char *prompt, int dirty); 726extern int variable_check(char *data); 727extern int dump_variables(dialogMenuItem *self); 728 729/* wizard.c */ 730extern void slice_wizard(Disk *d); 731 732#endif 733/* _SYSINSTALL_H_INCLUDE */ 734