sade.h revision 15416
1279377Simp/* 2279377Simp * The new sysinstall program. 3279377Simp * 4279377Simp * This is probably the last attempt in the `sysinstall' line, the next 5279377Simp * generation being slated to essentially a complete rewrite. 6279377Simp * 7279377Simp * $Id: sysinstall.h,v 1.52 1996/04/25 17:31:26 jkh Exp $ 8279377Simp * 9279377Simp * Copyright (c) 1995 10279377Simp * Jordan Hubbard. All rights reserved. 11279377Simp * 12279377Simp * Redistribution and use in source and binary forms, with or without 13279377Simp * modification, are permitted provided that the following conditions 14279377Simp * are met: 15279377Simp * 1. Redistributions of source code must retain the above copyright 16279377Simp * notice, this list of conditions and the following disclaimer, 17279377Simp * verbatim and that no modifications are made prior to this 18279377Simp * point in the file. 19279377Simp * 2. Redistributions in binary form must reproduce the above copyright 20279377Simp * notice, this list of conditions and the following disclaimer in the 21279377Simp * documentation and/or other materials provided with the distribution. 22279377Simp * 23279377Simp * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND 24279377Simp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25279377Simp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26279377Simp * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE 27279377Simp * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28279377Simp * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29279377Simp * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION) 30279377Simp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31279377Simp * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32279377Simp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33279377Simp * SUCH DAMAGE. 34279377Simp * 35279377Simp */ 36279377Simp 37279377Simp#ifndef _SYSINSTALL_H_INCLUDE 38279377Simp#define _SYSINSTALL_H_INCLUDE 39279377Simp 40279377Simp#include <stdio.h> 41279377Simp#include <stdlib.h> 42279377Simp#include <string.h> 43279377Simp#include <unistd.h> 44279377Simp#include <dialog.h> 45279377Simp#include <sys/types.h> 46279377Simp#include <sys/wait.h> 47279377Simp#include "libdisk.h" 48279377Simp#include "dist.h" 49279377Simp#include "version.h" 50279377Simp 51279377Simp/*** Defines ***/ 52279377Simp 53279377Simp/* variable limits */ 54279377Simp#define VAR_NAME_MAX 128 55279377Simp#define VAR_VALUE_MAX 1024 56279377Simp 57279377Simp/* device limits */ 58279377Simp#define DEV_NAME_MAX 64 /* The maximum length of a device name */ 59279377Simp#define DEV_MAX 100 /* The maximum number of devices we'll deal with */ 60279377Simp#define INTERFACE_MAX 50 /* Maximum number of network interfaces we'll deal with */ 61279377Simp#define MAX_FTP_RETRIES "4" /* How many times to beat our heads against the wall */ 62279377Simp 63279377Simp/* 64279377Simp * I make some pretty gross assumptions about having a max of 50 chunks 65279377Simp * total - 8 slices and 42 partitions. I can't easily display many more 66279377Simp * than that on the screen at once! 67279377Simp * 68279377Simp * For 2.1 I'll revisit this and try to make it more dynamic, but since 69279377Simp * this will catch 99.99% of all possible cases, I'm not too worried. 70279377Simp */ 71279377Simp#define MAX_CHUNKS 40 72279377Simp 73279377Simp/* Internal environment variable names */ 74279377Simp#define DISK_PARTITIONED "_diskPartitioned" 75279377Simp#define DISK_LABELLED "_diskLabelled" 76279377Simp#define DISK_SELECTED "_diskSelected" 77279377Simp#define SYSTEM_STATE "_systemState" 78279377Simp#define RUNNING_ON_ROOT "_runningOnRoot" 79279377Simp#define TCP_CONFIGURED "_tcpConfigured" 80279377Simp 81279377Simp/* Ones that can be tweaked from config files */ 82279377Simp#define VAR_BLANKTIME "blanktime" 83279377Simp#define VAR_BOOTMGR "bootManager" 84279377Simp#define VAR_BROWSER_BINARY "browserBinary" 85279377Simp#define VAR_BROWSER_PACKAGE "browserPackage" 86279377Simp#define VAR_CONFIG_FILE "configFile" 87279377Simp#define VAR_CPIO_VERBOSITY "cpioVerbose" 88279377Simp#define VAR_DEBUG "debug" 89279377Simp#define VAR_DISK "disk" 90279377Simp#define VAR_DISKSPACE "diskSpace" 91279377Simp#define VAR_DOMAINNAME "domainname" 92279377Simp#define VAR_EDITOR "editor" 93279377Simp#define VAR_EXTRAS "ifconfig_" 94279377Simp#define VAR_FTP_ONERROR "ftpOnError" 95279377Simp#define VAR_FTP_PASS "ftpPass" 96279377Simp#define VAR_FTP_PATH "ftp" 97279377Simp#define VAR_FTP_RETRIES "ftpRetryCount" 98279377Simp#define VAR_FTP_STATE "ftpState" 99279377Simp#define VAR_FTP_USER "ftpUser" 100279377Simp#define VAR_GATEWAY "defaultrouter" 101279377Simp#define VAR_GEOMETRY "geometry" 102279377Simp#define VAR_HOSTNAME "hostname" 103279377Simp#define VAR_IFCONFIG "ifconfig_" 104279377Simp#define VAR_INTERFACES "network_interfaces" 105279377Simp#define VAR_IPADDR "ipaddr" 106279377Simp#define VAR_LABEL "label" 107279377Simp#define VAR_LABEL_COUNT "labelCount" 108279377Simp#define VAR_MEDIA_TYPE "mediaType" 109279377Simp#define VAR_NAMESERVER "nameserver" 110279377Simp#define VAR_NETMASK "netmask" 111279377Simp#define VAR_NFS_PATH "nfs" 112279377Simp#define VAR_NFS_SECURE "nfsSecure" 113279377Simp#define VAR_NO_CONFIRM "noConfirm" 114279377Simp#define VAR_NTPDATE "ntpDate" 115279377Simp#define VAR_PORTS_PATH "ports" 116279377Simp#define VAR_RELNAME "releaseName" 117279377Simp#define VAR_ROOT_SIZE "rootSize" 118279377Simp#define VAR_ROUTEDFLAGS "routedflags" 119279377Simp#define VAR_SLOW_ETHER "slowEthernetCard" 120279377Simp#define VAR_SWAP_SIZE "swapSize" 121279377Simp#define VAR_TAPE_BLOCKSIZE "tapeBlocksize" 122279377Simp#define VAR_UFS_PATH "ufs" 123279377Simp#define VAR_USR_SIZE "usrSize" 124279377Simp#define VAR_VAR_SIZE "varSize" 125279377Simp#define VAR_SERIAL_SPEED "serialSpeed" 126279377Simp 127279377Simp#define DEFAULT_TAPE_BLOCKSIZE "20" 128279377Simp 129279377Simp/* One MB worth of blocks */ 130279377Simp#define ONE_MEG 2048 131279377Simp 132279377Simp/*** Types ***/ 133279377Simptypedef unsigned int Boolean; 134279377Simptypedef struct disk Disk; 135279377Simptypedef struct chunk Chunk; 136279377Simp 137279377Simp/* Bitfields for menu options */ 138279377Simp#define DMENU_NORMAL_TYPE 0x1 /* Normal dialog menu */ 139279377Simp#define DMENU_RADIO_TYPE 0x2 /* Radio dialog menu */ 140279377Simp#define DMENU_CHECKLIST_TYPE 0x4 /* Multiple choice menu */ 141279377Simp#define DMENU_SELECTION_RETURNS 0x8 /* Immediate return on item selection */ 142279377Simp 143279377Simptypedef struct _dmenu { 144279377Simp int type; /* What sort of menu we are */ 145279377Simp char *title; /* Our title */ 146279377Simp char *prompt; /* Our prompt */ 147279377Simp char *helpline; /* Line of help at bottom */ 148279377Simp char *helpfile; /* Help file for "F1" */ 149279377Simp dialogMenuItem items[0]; /* Array of menu items */ 150279377Simp} DMenu; 151279377Simp 152279377Simp/* A sysconfig variable */ 153279377Simptypedef struct _variable { 154279377Simp struct _variable *next; 155279377Simp char name[VAR_NAME_MAX]; 156279377Simp char value[VAR_VALUE_MAX]; 157279377Simp} Variable; 158279377Simp 159279377Simp/* For attribs */ 160279377Simp#define MAX_ATTRIBS 200 161279377Simp#define MAX_NAME 64 162279377Simp#define MAX_VALUE 256 163279377Simp 164279377Simptypedef struct _attribs { 165279377Simp char name[MAX_NAME]; 166279377Simp char value[MAX_VALUE]; 167279377Simp} Attribs; 168279377Simp 169279377Simptypedef enum { 170279377Simp DEVICE_TYPE_NONE, 171279377Simp DEVICE_TYPE_DISK, 172279377Simp DEVICE_TYPE_FLOPPY, 173279377Simp DEVICE_TYPE_FTP, 174279377Simp DEVICE_TYPE_NETWORK, 175279377Simp DEVICE_TYPE_CDROM, 176279377Simp DEVICE_TYPE_TAPE, 177279377Simp DEVICE_TYPE_DOS, 178279377Simp DEVICE_TYPE_UFS, 179279377Simp DEVICE_TYPE_NFS, 180279377Simp DEVICE_TYPE_ANY, 181279377Simp} DeviceType; 182279377Simp 183279377Simp/* A "device" from sysinstall's point of view */ 184279377Simptypedef struct _device { 185279377Simp char name[DEV_NAME_MAX]; 186279377Simp char *description; 187279377Simp char *devname; 188279377Simp DeviceType type; 189279377Simp Boolean enabled; 190279377Simp Boolean (*init)(struct _device *dev); 191279377Simp int (*get)(struct _device *dev, char *file, Boolean probe); 192279377Simp Boolean (*close)(struct _device *dev, int fd); 193279377Simp void (*shutdown)(struct _device *dev); 194279377Simp void *private; 195279377Simp unsigned int flags; 196279377Simp} Device; 197279377Simp 198279377Simp/* Some internal representations of partitions */ 199279377Simptypedef enum { 200279377Simp PART_NONE, 201279377Simp PART_SLICE, 202279377Simp PART_SWAP, 203279377Simp PART_FILESYSTEM, 204279377Simp PART_FAT, 205279377Simp} PartType; 206279377Simp 207279377Simp/* The longest newfs command we'll hand to system() */ 208279377Simp#define NEWFS_CMD_MAX 256 209279377Simp 210279377Simptypedef struct _part_info { 211279377Simp Boolean newfs; 212279377Simp char mountpoint[FILENAME_MAX]; 213279377Simp char newfs_cmd[NEWFS_CMD_MAX]; 214279377Simp} PartInfo; 215279377Simp 216279377Simp/* An option */ 217279377Simptypedef struct _opt { 218279377Simp char *name; 219279377Simp char *desc; 220279377Simp enum { OPT_IS_STRING, OPT_IS_INT, OPT_IS_FUNC, OPT_IS_VAR } type; 221279377Simp void *data; 222279377Simp void *aux; 223279377Simp char *(*check)(); 224279377Simp} Option; 225279377Simp 226279377Simp/* Weird index nodey things we use for keeping track of package information */ 227279377Simptypedef enum { PACKAGE, PLACE } node_type; /* Types of nodes */ 228279377Simp 229279377Simptypedef struct _pkgnode { /* A node in the reconstructed hierarchy */ 230279377Simp struct _pkgnode *next; /* My next sibling */ 231279377Simp node_type type; /* What am I? */ 232279377Simp char *name; /* My name */ 233279377Simp char *desc; /* My description (Hook) */ 234279377Simp struct _pkgnode *kids; /* My little children */ 235279377Simp void *data; /* A place to hang my data */ 236279377Simp} PkgNode; 237279377Simptypedef PkgNode *PkgNodePtr; 238279377Simp 239279377Simp/* A single package */ 240279377Simptypedef struct _indexEntry { /* A single entry in an INDEX file */ 241279377Simp char *name; /* name */ 242279377Simp char *path; /* full path to port */ 243279377Simp char *prefix; /* port prefix */ 244279377Simp char *comment; /* one line description */ 245279377Simp char *descrfile; /* path to description file */ 246279377Simp char *deps; /* packages this depends on */ 247279377Simp char *maintainer; /* maintainer */ 248279377Simp} IndexEntry; 249279377Simptypedef IndexEntry *IndexEntryPtr; 250279377Simp 251279377Simptypedef int (*commandFunc)(char *key, void *data); 252279377Simp 253279377Simp#define HOSTNAME_FIELD_LEN 128 254279377Simp#define IPADDR_FIELD_LEN 16 255279377Simp#define EXTRAS_FIELD_LEN 128 256279377Simp 257279377Simp/* Verbosity levels for CPIO as expressed by cpio arguments - yuck */ 258279377Simp#define CPIO_VERBOSITY (!strcmp(variable_get(CPIO_VERBOSITY_LEVEL), "low") ? "" : \ 259279377Simp !strcmp(variable_get(CPIO_VERBOSITY_LEVEL), "medium") ? "-V" : "-v") 260279377Simp 261279377Simp/* This is the structure that Network devices carry around in their private, erm, structures */ 262279377Simptypedef struct _devPriv { 263279377Simp char ipaddr[IPADDR_FIELD_LEN]; 264279377Simp char netmask[IPADDR_FIELD_LEN]; 265279377Simp char extras[EXTRAS_FIELD_LEN]; 266279377Simp} DevInfo; 267279377Simp 268279377Simp 269279377Simp/*** Externs ***/ 270279377Simpextern int DebugFD; /* Where diagnostic output goes */ 271279377Simpextern Boolean SystemWasInstalled; /* Did we install it? */ 272279377Simpextern Boolean RunningAsInit; /* Are we running stand-alone? */ 273279377Simpextern Boolean DialogActive; /* Is the dialog() stuff up? */ 274279377Simpextern Boolean ColorDisplay; /* Are we on a color display? */ 275279377Simpextern Boolean OnVTY; /* On a syscons VTY? */ 276279377Simpextern Variable *VarHead; /* The head of the variable chain */ 277279377Simpextern Device *mediaDevice; /* Where we're getting our distribution from */ 278279377Simpextern unsigned int Dists; /* Which distributions we want */ 279279377Simpextern unsigned int DESDists; /* Which naughty distributions we want */ 280279377Simpextern unsigned int SrcDists; /* Which src distributions we want */ 281279377Simpextern unsigned int XF86Dists; /* Which XFree86 dists we want */ 282279377Simpextern unsigned int XF86ServerDists; /* The XFree86 servers we want */ 283279377Simpextern unsigned int XF86FontDists; /* The XFree86 fonts we want */ 284279377Simpextern int BootMgr; /* Which boot manager to use */ 285279377Simp 286279377Simp 287279377Simpextern DMenu MenuInitial; /* Initial installation menu */ 288279377Simpextern DMenu MenuFixit; /* Fixit repair menu */ 289279377Simpextern DMenu MenuMBRType; /* Type of MBR to write on the disk */ 290279377Simpextern DMenu MenuConfigure; /* Final configuration menu */ 291279377Simpextern DMenu MenuDocumentation; /* Documentation menu */ 292279377Simpextern DMenu MenuFTPOptions; /* FTP Installation options */ 293279377Simpextern DMenu MenuOptions; /* Installation options */ 294279377Simpextern DMenu MenuOptionsLanguage; /* Language options menu */ 295279377Simpextern DMenu MenuMedia; /* Media type menu */ 296279377Simpextern DMenu MenuMouse; /* Mouse type menu */ 297279377Simpextern DMenu MenuMediaCDROM; /* CDROM media menu */ 298279377Simpextern DMenu MenuMediaDOS; /* DOS media menu */ 299279377Simpextern DMenu MenuMediaFloppy; /* Floppy media menu */ 300279377Simpextern DMenu MenuMediaFTP; /* FTP media menu */ 301279377Simpextern DMenu MenuMediaTape; /* Tape media menu */ 302279377Simpextern DMenu MenuNetworkDevice; /* Network device menu */ 303279377Simpextern DMenu MenuNTP; /* NTP time server menu */ 304279377Simpextern DMenu MenuSyscons; /* System console configuration menu */ 305279377Simpextern DMenu MenuSysconsKeymap; /* System console keymap configuration menu */ 306279377Simpextern DMenu MenuSysconsKeyrate; /* System console keyrate configuration menu */ 307279377Simpextern DMenu MenuSysconsSaver; /* System console saver configuration menu */ 308279377Simpextern DMenu MenuNetworking; /* Network configuration menu */ 309279377Simpextern DMenu MenuInstallCustom; /* Custom Installation menu */ 310279377Simpextern DMenu MenuDistributions; /* Distribution menu */ 311279377Simpextern DMenu MenuSubDistributions; /* Custom distribution menu */ 312279377Simpextern DMenu MenuDESDistributions; /* DES distribution menu */ 313279377Simpextern DMenu MenuSrcDistributions; /* Source distribution menu */ 314279377Simpextern DMenu MenuXF86; /* XFree86 main menu */ 315279377Simpextern DMenu MenuXF86Select; /* XFree86 distribution selection menu */ 316279377Simpextern DMenu MenuXF86SelectCore; /* XFree86 core distribution menu */ 317279377Simpextern DMenu MenuXF86SelectServer; /* XFree86 server distribution menu */ 318279377Simpextern DMenu MenuXF86SelectFonts; /* XFree86 font selection menu */ 319279377Simpextern DMenu MenuDiskDevices; /* Disk devices menu */ 320279377Simpextern DMenu MenuHTMLDoc; /* HTML Documentation menu */ 321279377Simp 322279377Simp 323279377Simp/*** Prototypes ***/ 324279377Simp 325279377Simp/* apache.c */ 326279377Simpextern int configApache(dialogMenuItem *self); 327279377Simp 328279377Simp/* anonFTP.c */ 329279377Simpextern int configAnonFTP(dialogMenuItem *self); 330279377Simp 331279377Simp/* attrs.c */ 332279377Simpextern char *attr_match(Attribs *attr, char *name); 333279377Simpextern int attr_parse_file(Attribs *attr, char *file); 334279377Simpextern int attr_parse(Attribs *attr, int fd); 335279377Simp 336279377Simp/* cdrom.c */ 337279377Simpextern Boolean mediaInitCDROM(Device *dev); 338279377Simpextern int mediaGetCDROM(Device *dev, char *file, Boolean probe); 339279377Simpextern void mediaShutdownCDROM(Device *dev); 340279377Simp 341279377Simp/* command.c */ 342279377Simpextern void command_clear(void); 343279377Simpextern void command_sort(void); 344279377Simpextern void command_execute(void); 345279377Simpextern void command_shell_add(char *key, char *fmt, ...); 346279377Simpextern void command_func_add(char *key, commandFunc func, void *data); 347279377Simp 348279377Simp/* config.c */ 349279377Simpextern int configFstab(void); 350279377Simpextern void configSysconfig(void); 351279377Simpextern void configResolv(void); 352279377Simpextern int configPorts(dialogMenuItem *self); 353279377Simpextern int configPackages(dialogMenuItem *self); 354279377Simpextern int configSaverTimeout(dialogMenuItem *self); 355279377Simpextern int configNTP(dialogMenuItem *self); 356279377Simpextern int configXFree86(dialogMenuItem *self); 357279377Simpextern int configRoutedFlags(dialogMenuItem *self); 358279377Simp 359279377Simp/* crc.c */ 360279377Simpextern int crc(int, unsigned long *, unsigned long *); 361279377Simp 362279377Simp/* devices.c */ 363279377Simpextern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogMenuItem *d), 364279377Simp int (*check)(dialogMenuItem *d)); 365279377Simpextern void deviceGetAll(void); 366279377Simpextern Device **deviceFind(char *name, DeviceType type); 367279377Simpextern int deviceCount(Device **devs); 368279377Simpextern Device *new_device(char *name); 369279377Simpextern Device *deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean enabled, 370279377Simp Boolean (*init)(Device *mediadev), int (*get)(Device *dev, char *file, Boolean probe), 371279377Simp Boolean (*close)(Device *mediadev, int fd), void (*shutDown)(Device *mediadev), 372279377Simp void *private); 373279377Simpextern Boolean dummyInit(Device *dev); 374279377Simpextern int dummyGet(Device *dev, char *dist, Boolean probe); 375279377Simpextern Boolean dummyClose(Device *dev, int fd); 376279377Simpextern void dummyShutdown(Device *dev); 377279377Simp 378279377Simp/* disks.c */ 379279377Simpextern int diskPartitionEditor(dialogMenuItem *self); 380279377Simpextern int diskPartitionWrite(dialogMenuItem *self); 381279377Simpextern void diskPartition(Device *dev, Disk *d); 382279377Simp 383279377Simp/* dist.c */ 384279377Simpextern int distReset(dialogMenuItem *self); 385279377Simpextern int distSetCustom(char *str); 386279377Simpextern int distSetDeveloper(dialogMenuItem *self); 387279377Simpextern int distSetXDeveloper(dialogMenuItem *self); 388279377Simpextern int distSetKernDeveloper(dialogMenuItem *self); 389279377Simpextern int distSetUser(dialogMenuItem *self); 390279377Simpextern int distSetXUser(dialogMenuItem *self); 391279377Simpextern int distSetMinimum(dialogMenuItem *self); 392279377Simpextern int distSetEverything(dialogMenuItem *self); 393279377Simpextern int distSetDES(dialogMenuItem *self); 394279377Simpextern int distSetSrc(dialogMenuItem *self); 395279377Simpextern int distSetXF86(dialogMenuItem *self); 396279377Simpextern int distExtractAll(dialogMenuItem *self); 397279377Simp 398279377Simp/* dmenu.c */ 399279377Simpextern int dmenuDisplayFile(dialogMenuItem *tmp); 400279377Simpextern int dmenuSubmenu(dialogMenuItem *tmp); 401279377Simpextern int dmenuSystemCommand(dialogMenuItem *tmp); 402279377Simpextern int dmenuSystemCommandBox(dialogMenuItem *tmp); 403279377Simpextern int dmenuExit(dialogMenuItem *tmp); 404279377Simpextern int dmenuSetVariable(dialogMenuItem *tmp); 405279377Simpextern int dmenuSetFlag(dialogMenuItem *tmp); 406279377Simpextern int dmenuSetValue(dialogMenuItem *tmp); 407279377Simpextern Boolean dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max); 408279377Simpextern Boolean dmenuOpenSimple(DMenu *menu); 409279377Simpextern int dmenuVarCheck(dialogMenuItem *item); 410279377Simpextern int dmenuFlagCheck(dialogMenuItem *item); 411279377Simpextern int dmenuRadioCheck(dialogMenuItem *item); 412279377Simp 413279377Simp/* doc.c */ 414279377Simpextern int docBrowser(dialogMenuItem *self); 415279377Simpextern int docShowDocument(dialogMenuItem *self); 416279377Simp 417279377Simp/* dos.c */ 418279377Simpextern Boolean mediaInitDOS(Device *dev); 419279377Simpextern int mediaGetDOS(Device *dev, char *file, Boolean probe); 420279377Simpextern void mediaShutdownDOS(Device *dev); 421279377Simp 422279377Simp/* floppy.c */ 423279377Simpextern int getRootFloppy(void); 424279377Simpextern Boolean mediaInitFloppy(Device *dev); 425279377Simpextern int mediaGetFloppy(Device *dev, char *file, Boolean probe); 426279377Simpextern void mediaShutdownFloppy(Device *dev); 427279377Simp 428279377Simp/* ftp_strat.c */ 429279377Simpextern Boolean mediaCloseFTP(Device *dev, int fd); 430279377Simpextern Boolean mediaInitFTP(Device *dev); 431279377Simpextern int mediaGetFTP(Device *dev, char *file, Boolean probe); 432279377Simpextern void mediaShutdownFTP(Device *dev); 433279377Simp 434279377Simp/* globals.c */ 435279377Simpextern void globalsInit(void); 436279377Simp 437279377Simp/* index.c */ 438279377Simpint index_get(char *fname, PkgNodePtr papa); 439279377Simpint index_read(int fd, PkgNodePtr papa); 440279377Simpint index_menu(PkgNodePtr top, PkgNodePtr plist, int *pos, int *scroll); 441279377Simpvoid index_init(PkgNodePtr top, PkgNodePtr plist); 442279377Simpvoid index_node_free(PkgNodePtr top, PkgNodePtr plist); 443279377Simpvoid index_sort(PkgNodePtr top); 444279377Simpvoid index_print(PkgNodePtr top, int level); 445279377Simpint index_extract(Device *dev, PkgNodePtr top, PkgNodePtr plist); 446279377Simp 447279377Simp/* install.c */ 448279377Simpextern int installCommit(dialogMenuItem *self); 449279377Simpextern int installExpress(dialogMenuItem *self); 450279377Simpextern int installNovice(dialogMenuItem *self); 451279377Simpextern int installFixitCDROM(dialogMenuItem *self); 452279377Simpextern int installFixitFloppy(dialogMenuItem *self); 453279377Simpextern int installFixup(dialogMenuItem *self); 454279377Simpextern int installUpgrade(dialogMenuItem *self); 455279377Simpextern int installFilesystems(dialogMenuItem *self); 456279377Simpextern int installVarDefaults(dialogMenuItem *self); 457279377Simpextern Boolean copySelf(void); 458279377Simpextern Boolean rootExtract(void); 459279377Simp 460279377Simp/* installFinal.c */ 461279377Simpextern int configGated(dialogMenuItem *self); 462279377Simpextern int configSamba(dialogMenuItem *self); 463279377Simpextern int configPCNFSD(dialogMenuItem *self); 464279377Simpextern int configNFSServer(dialogMenuItem *self); 465279377Simp 466279377Simp/* label.c */ 467279377Simpextern int diskLabelEditor(dialogMenuItem *self); 468279377Simpextern int diskLabelCommit(dialogMenuItem *self); 469279377Simp 470279377Simp/* lndir.c */ 471279377Simpextern int lndir(char *from, char *to); 472279377Simp 473279377Simp/* makedevs.c (auto-generated) */ 474279377Simpextern const char termcap_vt100[]; 475279377Simpextern const char termcap_cons25[]; 476279377Simpextern const char termcap_cons25_m[]; 477279377Simpextern const char termcap_cons25r[]; 478279377Simpextern const char termcap_cons25r_m[]; 479279377Simpextern const char termcap_cons25l1[]; 480279377Simpextern const char termcap_cons25l1_m[]; 481279377Simpextern const u_char font_iso_8x16[]; 482279377Simpextern const u_char font_cp850_8x16[]; 483279377Simpextern const u_char font_cp866_8x16[]; 484279377Simpextern const u_char koi8_r2cp866[]; 485279377Simpextern u_char default_scrnmap[]; 486279377Simp 487279377Simp/* media.c */ 488279377Simpextern char *cpioVerbosity(void); 489279377Simpextern int mediaSetCDROM(dialogMenuItem *self); 490279377Simpextern int mediaSetFloppy(dialogMenuItem *self); 491279377Simpextern int mediaSetDOS(dialogMenuItem *self); 492279377Simpextern int mediaSetTape(dialogMenuItem *self); 493279377Simpextern int mediaSetFTP(dialogMenuItem *self); 494279377Simpextern int mediaSetFTPActive(dialogMenuItem *self); 495279377Simpextern int mediaSetFTPPassive(dialogMenuItem *self); 496279377Simpextern int mediaSetUFS(dialogMenuItem *self); 497279377Simpextern int mediaSetNFS(dialogMenuItem *self); 498279377Simpextern int mediaSetFtpOnError(dialogMenuItem *self); 499279377Simpextern int mediaSetFtpUserPass(dialogMenuItem *self); 500279377Simpextern int mediaSetCPIOVerbosity(dialogMenuItem *self); 501279377Simpextern int mediaGetType(dialogMenuItem *self); 502279377Simpextern Boolean mediaExtractDist(char *dir, int fd); 503279377Simpextern Boolean mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpic); 504279377Simpextern Boolean mediaExtractDistEnd(int zpid, int cpid); 505279377Simpextern Boolean mediaVerify(void); 506279377Simp 507279377Simp/* misc.c */ 508279377Simpextern Boolean file_readable(char *fname); 509279377Simpextern Boolean file_executable(char *fname); 510279377Simpextern Boolean directory_exists(const char *dirname); 511279377Simpextern char *string_concat(char *p1, char *p2); 512279377Simpextern char *string_concat3(char *p1, char *p2, char *p3); 513279377Simpextern char *string_prune(char *str); 514279377Simpextern char *string_skipwhite(char *str); 515279377Simpextern char *string_copy(char *s1, char *s2); 516279377Simpextern char *pathBaseName(const char *path); 517279377Simpextern void safe_free(void *ptr); 518279377Simpextern void *safe_malloc(size_t size); 519279377Simpextern void *safe_realloc(void *orig, size_t size); 520279377Simpextern dialogMenuItem *item_add(dialogMenuItem *list, char *prompt, char *title, 521279377Simp int (*checked)(dialogMenuItem *self), 522279377Simp int (*fire)(dialogMenuItem *self), 523279377Simp void (*selected)(dialogMenuItem *self, int is_selected), 524279377Simp void *data, int aux, int *curr, int *max); 525279377Simpextern void items_free(dialogMenuItem *list, int *curr, int *max); 526279377Simpextern int Mkdir(char *, void *data); 527279377Simpextern int Mount(char *, void *data); 528279377Simpextern WINDOW *savescr(void); 529279377Simpextern void restorescr(WINDOW *w); 530279377Simp 531279377Simp/* msg.c */ 532279377Simpextern Boolean isDebug(void); 533279377Simpextern void msgInfo(char *fmt, ...); 534279377Simpextern void msgYap(char *fmt, ...); 535279377Simpextern void msgWarn(char *fmt, ...); 536279377Simpextern void msgDebug(char *fmt, ...); 537279377Simpextern void msgError(char *fmt, ...); 538279377Simpextern void msgFatal(char *fmt, ...); 539279377Simpextern void msgConfirm(char *fmt, ...); 540279377Simpextern void msgNotify(char *fmt, ...); 541279377Simpextern void msgWeHaveOutput(char *fmt, ...); 542279377Simpextern int msgYesNo(char *fmt, ...); 543279377Simpextern char *msgGetInput(char *buf, char *fmt, ...); 544279377Simpextern int msgSimpleConfirm(char *); 545279377Simpextern int msgSimpleNotify(char *); 546279377Simp 547279377Simp/* network.c */ 548279377Simpextern Boolean mediaInitNetwork(Device *dev); 549279377Simpextern void mediaShutdownNetwork(Device *dev); 550279377Simp 551279377Simp/* nfs.c */ 552279377Simpextern Boolean mediaInitNFS(Device *dev); 553279377Simpextern int mediaGetNFS(Device *dev, char *file, Boolean probe); 554279377Simpextern void mediaShutdownNFS(Device *dev); 555279377Simp 556279377Simp/* options.c */ 557279377Simpextern int optionsEditor(dialogMenuItem *self); 558279377Simp 559279377Simp/* package.c */ 560279377Simpextern int package_add(char *name); 561279377Simpextern int package_extract(Device *dev, char *name, Boolean depended); 562279377Simp 563279377Simp/* system.c */ 564279377Simpextern void systemInitialize(int argc, char **argv); 565279377Simpextern void systemShutdown(void); 566279377Simpextern int execExecute(char *cmd, char *name); 567279377Simpextern int systemExecute(char *cmd); 568279377Simpextern int systemDisplayHelp(char *file); 569279377Simpextern char *systemHelpFile(char *file, char *buf); 570279377Simpextern void systemChangeFont(const u_char font[]); 571279377Simpextern void systemChangeLang(char *lang); 572279377Simpextern void systemChangeTerminal(char *color, const u_char c_termcap[], char *mono, const u_char m_termcap[]); 573279377Simpextern void systemChangeScreenmap(const u_char newmap[]); 574279377Simpextern void systemCreateHoloshell(void); 575279377Simpextern int vsystem(char *fmt, ...); 576279377Simp 577279377Simp/* tape.c */ 578279377Simpextern char *mediaTapeBlocksize(void); 579279377Simpextern Boolean mediaInitTape(Device *dev); 580279377Simpextern int mediaGetTape(Device *dev, char *file, Boolean probe); 581279377Simpextern void mediaShutdownTape(Device *dev); 582279377Simp 583279377Simp/* tcpip.c */ 584279377Simpextern int tcpOpenDialog(Device *dev); 585279377Simpextern int tcpMenuSelect(dialogMenuItem *self); 586279377Simpextern int tcpInstallDevice(char *str); 587279377Simpextern Boolean tcpDeviceSelect(void); 588279377Simp 589279377Simp/* termcap.c */ 590279377Simpextern int set_termcap(void); 591279377Simp 592279377Simp/* ufs.c */ 593279377Simpextern void mediaShutdownUFS(Device *dev); 594279377Simpextern Boolean mediaInitUFS(Device *dev); 595279377Simpextern int mediaGetUFS(Device *dev, char *file, Boolean probe); 596279377Simp 597279377Simp/* variable.c */ 598279377Simpextern void variable_set(char *var); 599279377Simpextern void variable_set2(char *name, char *value); 600279377Simpextern char *variable_get(char *var); 601279377Simpextern void variable_unset(char *var); 602279377Simpextern char *variable_get_value(char *var, char *prompt); 603279377Simp 604279377Simp/* wizard.c */ 605279377Simpextern void slice_wizard(Disk *d); 606279377Simp 607279377Simp#endif 608279377Simp/* _SYSINSTALL_H_INCLUDE */ 609279377Simp