2 * The new sysinstall program.
4 * This is probably the last attempt in the `sysinstall' line, the next
5 * generation being slated to essentially a complete rewrite.
10 * Jordan Hubbard. All rights reserved.
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer,
17 * verbatim and that no modifications are made prior to this
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
23 * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 #ifndef _SYSINSTALL_H_INCLUDE
38 #define _SYSINSTALL_H_INCLUDE
40 #include <sys/types.h>
49 #include "ui_objects.h"
57 #if defined(__i386__) || defined(PC98)
58 #define PCCARD_ARCH 1 /* Support PCCARD installations */
61 #define DEV_NAME_MAX 64 /* The maximum length of a device name */
62 #define DEV_MAX 100 /* The maximum number of devices we'll deal with */
63 #define INTERFACE_MAX 50 /* Maximum number of network interfaces we'll deal with */
64 #define IO_ERROR -2 /* Status code for I/O error rather than normal EOF */
66 /* Number of seconds to wait for data to come off even the slowest media */
67 #define MEDIA_TIMEOUT 300
70 * I make some pretty gross assumptions about having a max of 50 chunks
71 * total - 8 slices and 42 partitions. I can't easily display many more
72 * than that on the screen at once!
74 * For 2.1 I'll revisit this and try to make it more dynamic, but since
75 * this will catch 99.99% of all possible cases, I'm not too worried.
79 /* Internal environment variable names */
80 #define DISK_PARTITIONED "_diskPartitioned"
81 #define DISK_LABELLED "_diskLabelled"
82 #define DISK_SELECTED "_diskSelected"
83 #define SYSTEM_STATE "_systemState"
84 #define RUNNING_ON_ROOT "_runningOnRoot"
85 #define TCP_CONFIGURED "_tcpConfigured"
87 /* Ones that can be tweaked from config files */
88 #define VAR_BLANKTIME "blanktime"
89 #define VAR_BOOTMGR "bootManager"
90 #define VAR_BROWSER_BINARY "browserBinary"
91 #define VAR_BROWSER_PACKAGE "browserPackage"
92 #define VAR_CPIO_VERBOSITY "cpioVerbose"
93 #define VAR_DEBUG "debug"
94 #define VAR_DESKSTYLE "_deskStyle"
95 #define VAR_DISK "disk"
96 #define VAR_DISTS "dists"
97 #define VAR_DIST_MAIN "distMain"
98 #define VAR_DIST_CRYPTO "distCRYPTO"
99 #define VAR_DIST_SRC "distSRC"
100 #define VAR_DIST_X11 "distX11"
101 #define VAR_DIST_XSERVER "distXserver"
102 #define VAR_DIST_XFONTS "distXfonts"
103 #define VAR_DEDICATE_DISK "dedicateDisk"
104 #define VAR_DOMAINNAME "domainname"
105 #define VAR_EDITOR "editor"
106 #define VAR_EXTRAS "ifconfig_"
107 #define VAR_COMMAND "command"
108 #define VAR_CONFIG_FILE "configFile"
109 #define VAR_FIXIT_TTY "fixitTty"
110 #define VAR_FTP_DIR "ftpDirectory"
111 #define VAR_FTP_PASS "ftpPass"
112 #define VAR_FTP_PATH "_ftpPath"
113 #define VAR_FTP_PORT "ftpPort"
114 #define VAR_FTP_STATE "ftpState"
115 #define VAR_FTP_USER "ftpUser"
116 #define VAR_FTP_HOST "ftpHost"
117 #define VAR_HTTP_PATH "_httpPath"
118 #define VAR_HTTP_PROXY "httpProxy"
119 #define VAR_HTTP_PORT "httpPort"
120 #define VAR_HTTP_HOST "httpHost"
121 #define VAR_HTTP_FTP_MODE "httpFtpMode"
122 #define VAR_GATEWAY "defaultrouter"
123 #define VAR_GEOMETRY "geometry"
124 #define VAR_HOSTNAME "hostname"
125 #define VAR_IFCONFIG "ifconfig_"
126 #define VAR_INSTALL_CFG "installConfig"
127 #define VAR_INSTALL_ROOT "installRoot"
128 #define VAR_IPADDR "ipaddr"
129 #define VAR_IPV6_ENABLE "ipv6_enable"
130 #define VAR_IPV6ADDR "ipv6addr"
131 #define VAR_KEYMAP "keymap"
132 #define VAR_LABEL "label"
133 #define VAR_LABEL_COUNT "labelCount"
134 #define VAR_LINUX_ENABLE "linux_enable"
135 #define VAR_MEDIA_TYPE "mediaType"
136 #define VAR_MEDIA_TIMEOUT "MEDIA_TIMEOUT"
137 #define VAR_MOUSED "moused_enable"
138 #define VAR_MOUSED_FLAGS "moused_flags"
139 #define VAR_MOUSED_PORT "moused_port"
140 #define VAR_MOUSED_TYPE "moused_type"
141 #define VAR_NAMESERVER "nameserver"
142 #define VAR_NETINTERACTIVE "netInteractive"
143 #define VAR_NETMASK "netmask"
144 #define VAR_NETWORK_DEVICE "netDev"
145 #define VAR_NEWFS_ARGS "newfsArgs"
146 #define VAR_NFS_PATH "nfs"
147 #define VAR_NFS_HOST "nfsHost"
148 #define VAR_NFS_SECURE "nfs_reserved_port_only"
149 #define VAR_NFS_SERVER "nfs_server_enable"
150 #define VAR_NO_CONFIRM "noConfirm"
151 #define VAR_NO_ERROR "noError"
152 #define VAR_NO_HOLOSHELL "noHoloShell"
153 #define VAR_NO_WARN "noWarn"
154 #define VAR_NO_USR "noUsr"
155 #define VAR_NO_TMP "noTmp"
156 #define VAR_NO_HOME "noHome"
157 #define VAR_NONINTERACTIVE "nonInteractive"
158 #define VAR_NOVELL "novell"
159 #define VAR_NTPDATE_FLAGS "ntpdate_flags"
160 #define VAR_PACKAGE "package"
161 #define VAR_PARTITION "partition"
162 #define VAR_PCNFSD "pcnfsd"
163 #define VAR_PKG_TMPDIR "PKG_TMPDIR"
164 #define VAR_PORTS_PATH "ports"
165 #define VAR_PPP_ENABLE "ppp_enable"
166 #define VAR_PPP_PROFILE "ppp_profile"
167 #define VAR_RELNAME "releaseName"
168 #define VAR_ROOT_SIZE "rootSize"
169 #define VAR_ROUTER "router"
170 #define VAR_ROUTER_ENABLE "router_enable"
171 #define VAR_ROUTERFLAGS "router_flags"
172 #define VAR_SERIAL_SPEED "serialSpeed"
173 #define VAR_SLOW_ETHER "slowEthernetCard"
174 #define VAR_SWAP_SIZE "swapSize"
175 #define VAR_TAPE_BLOCKSIZE "tapeBlocksize"
176 #define VAR_TRY_DHCP "tryDHCP"
177 #define VAR_TRY_RTSOL "tryRTSOL"
178 #define VAR_UFS_PATH "ufs"
179 #define VAR_USR_SIZE "usrSize"
180 #define VAR_VAR_SIZE "varSize"
181 #define VAR_TMP_SIZE "tmpSize"
182 #define VAR_HOME_SIZE "homeSize"
183 #define VAR_XF86_CONFIG "_xf86config"
184 #define VAR_TERM "TERM"
185 #define VAR_CONSTERM "_consterm"
187 #define DEFAULT_TAPE_BLOCKSIZE "20"
189 /* One MB worth of blocks */
191 #define ONE_GIG (ONE_MEG * 1024)
193 /* Which selection attributes to use */
194 #define ATTR_SELECTED (ColorDisplay ? item_selected_attr : item_attr)
195 #define ATTR_TITLE button_active_attr
197 /* Handy strncpy() macro */
198 #define SAFE_STRCPY(to, from) sstrncpy((to), (from), sizeof (to) - 1)
202 typedef struct disk Disk;
203 typedef struct chunk Chunk;
205 /* Bitfields for menu options */
206 #define DMENU_NORMAL_TYPE 0x1 /* Normal dialog menu */
207 #define DMENU_RADIO_TYPE 0x2 /* Radio dialog menu */
208 #define DMENU_CHECKLIST_TYPE 0x4 /* Multiple choice menu */
209 #define DMENU_SELECTION_RETURNS 0x8 /* Immediate return on item selection */
211 typedef struct _dmenu {
212 int type; /* What sort of menu we are */
213 char *title; /* Our title */
214 char *prompt; /* Our prompt */
215 char *helpline; /* Line of help at bottom */
216 char *helpfile; /* Help file for "F1" */
217 #if (__STDC_VERSION__ >= 199901L) || (__GNUC__ >= 3)
218 dialogMenuItem items[]; /* Array of menu items */
220 dialogMenuItem items[0]; /* Array of menu items */
222 #error "Create hack for C89 and K&R compilers."
226 /* An rc.conf variable */
227 typedef struct _variable {
228 struct _variable *next;
234 #define NO_ECHO_OBJ(type) ((type) | (DITEM_NO_ECHO << 16))
235 #define TYPE_OF_OBJ(type) ((type) & 0xff)
236 #define ATTR_OF_OBJ(type) ((type) >> 16)
238 /* A screen layout structure */
239 typedef struct _layout {
240 int y; /* x & Y co-ordinates */
242 int len; /* The size of the dialog on the screen */
243 int maxlen; /* How much the user can type in ... */
244 char *prompt; /* The string for the prompt */
245 char *help; /* The display for the help line */
246 void *var; /* The var to set when this changes */
247 int type; /* The type of the dialog to create */
248 void *obj; /* The obj pointer returned by libdialog */
266 /* CDROM mount codes */
267 #define CD_UNMOUNTED 0
268 #define CD_ALREADY_MOUNTED 1
269 #define CD_WE_MOUNTED_IT 2
271 /* A "device" from sysinstall's point of view */
272 typedef struct _device {
273 char name[DEV_NAME_MAX];
278 Boolean (*init)(struct _device *dev);
279 FILE * (*get)(struct _device *dev, char *file, Boolean probe);
280 void (*shutdown)(struct _device *dev);
285 /* Some internal representations of partitions */
294 /* The longest newfs command we'll hand to system() */
295 #define NEWFS_CMD_MAX 256
297 typedef struct _part_info {
299 char mountpoint[FILENAME_MAX];
300 char newfs_cmd[NEWFS_CMD_MAX];
305 typedef struct _opt {
308 enum { OPT_IS_STRING, OPT_IS_INT, OPT_IS_FUNC, OPT_IS_VAR } type;
314 /* Weird index nodey things we use for keeping track of package information */
315 typedef enum { PACKAGE, PLACE } node_type; /* Types of nodes */
317 typedef struct _pkgnode { /* A node in the reconstructed hierarchy */
318 struct _pkgnode *next; /* My next sibling */
319 node_type type; /* What am I? */
320 char *name; /* My name */
321 char *desc; /* My description (Hook) */
322 struct _pkgnode *kids; /* My little children */
323 void *data; /* A place to hang my data */
325 typedef PkgNode *PkgNodePtr;
327 /* A single package */
328 typedef struct _indexEntry { /* A single entry in an INDEX file */
329 char *name; /* name */
330 char *path; /* full path to port */
331 char *prefix; /* port prefix */
332 char *comment; /* one line description */
333 char *descrfile; /* path to description file */
334 char *deps; /* packages this depends on */
335 int depc; /* how many depend on me */
336 int installed; /* indicates if it is installed */
337 char *maintainer; /* maintainer */
339 typedef IndexEntry *IndexEntryPtr;
341 typedef int (*commandFunc)(char *key, void *data);
343 #define HOSTNAME_FIELD_LEN 128
344 #define IPADDR_FIELD_LEN 16
345 #define EXTRAS_FIELD_LEN 128
347 /* This is the structure that Network devices carry around in their private, erm, structures */
348 typedef struct _devPriv {
351 char ipaddr[IPADDR_FIELD_LEN];
352 char netmask[IPADDR_FIELD_LEN];
353 char extras[EXTRAS_FIELD_LEN];
358 extern jmp_buf BailOut; /* Used to get the heck out */
359 extern int DebugFD; /* Where diagnostic output goes */
360 extern Boolean Fake; /* Don't actually modify anything - testing */
361 extern Boolean Restarting; /* Are we restarting sysinstall? */
362 extern Boolean SystemWasInstalled; /* Did we install it? */
363 extern Boolean RunningAsInit; /* Are we running stand-alone? */
364 extern Boolean DialogActive; /* Is the dialog() stuff up? */
365 extern Boolean ColorDisplay; /* Are we on a color display? */
366 extern Boolean OnVTY; /* On a syscons VTY? */
367 extern Variable *VarHead; /* The head of the variable chain */
368 extern Device *mediaDevice; /* Where we're getting our distribution from */
369 extern unsigned int Dists; /* Which distributions we want */
370 extern unsigned int CRYPTODists; /* Which naughty distributions we want */
371 extern unsigned int SrcDists; /* Which src distributions we want */
372 extern unsigned int XF86Dists; /* Which XFree86 dists we want */
373 extern unsigned int XF86ServerDists; /* The XFree86 servers we want */
374 extern unsigned int XF86FontDists; /* The XFree86 fonts we want */
375 extern int BootMgr; /* Which boot manager to use */
376 extern int StatusLine; /* Where to print our status messages */
377 extern DMenu MenuInitial; /* Initial installation menu */
378 extern DMenu MenuFixit; /* Fixit repair menu */
379 extern DMenu MenuMBRType; /* Type of MBR to write on the disk */
380 extern DMenu MenuConfigure; /* Final configuration menu */
381 extern DMenu MenuDocumentation; /* Documentation menu */
382 extern DMenu MenuFTPOptions; /* FTP Installation options */
383 extern DMenu MenuIndex; /* Index menu */
384 extern DMenu MenuOptions; /* Installation options */
385 extern DMenu MenuOptionsLanguage; /* Language options menu */
386 extern DMenu MenuKLD; /* Prototype KLD menu */
387 extern DMenu MenuMedia; /* Media type menu */
388 extern DMenu MenuMouse; /* Mouse type menu */
389 extern DMenu MenuMediaCDROM; /* CDROM media menu */
390 extern DMenu MenuMediaDOS; /* DOS media menu */
391 extern DMenu MenuMediaFloppy; /* Floppy media menu */
392 extern DMenu MenuMediaFTP; /* FTP media menu */
393 extern DMenu MenuMediaTape; /* Tape media menu */
394 extern DMenu MenuNetworkDevice; /* Network device menu */
395 extern DMenu MenuNTP; /* NTP time server menu */
396 extern DMenu MenuSecurity; /* System security options menu */
397 extern DMenu MenuSecurityProfile; /* Security profile menu */
398 extern DMenu MenuStartup; /* Startup services menu */
399 extern DMenu MenuSyscons; /* System console configuration menu */
400 extern DMenu MenuSysconsFont; /* System console font configuration menu */
401 extern DMenu MenuSysconsKeymap; /* System console keymap configuration menu */
402 extern DMenu MenuSysconsKeyrate; /* System console keyrate configuration menu */
403 extern DMenu MenuSysconsSaver; /* System console saver configuration menu */
404 extern DMenu MenuSysconsScrnmap; /* System console screenmap configuration menu */
405 extern DMenu MenuSysconsTtys; /* System console terminal type menu */
406 extern DMenu MenuNetworking; /* Network configuration menu */
407 extern DMenu MenuInstallCustom; /* Custom Installation menu */
408 extern DMenu MenuDistributions; /* Distribution menu */
409 extern DMenu MenuDiskDevices; /* Disk type devices */
410 extern DMenu MenuSubDistributions; /* Custom distribution menu */
411 extern DMenu MenuSrcDistributions; /* Source distribution menu */
412 extern DMenu MenuXF86; /* XFree86 main menu */
413 extern DMenu MenuXF86Select; /* XFree86 distribution selection menu */
414 extern DMenu MenuXF86SelectCore; /* XFree86 core distribution menu */
415 extern DMenu MenuXF86SelectServer; /* XFree86 server distribution menu */
416 extern DMenu MenuXF86SelectPC98Server; /* XFree86 server distribution menu */
417 extern DMenu MenuXF86SelectFonts; /* XFree86 font selection menu */
418 extern DMenu MenuXF86SelectFonts; /* XFree86 font selection menu */
419 extern DMenu MenuXDesktops; /* Disk devices menu */
420 extern DMenu MenuHTMLDoc; /* HTML Documentation menu */
421 extern DMenu MenuUsermgmt; /* User management menu */
422 extern DMenu MenuFixit; /* Fixit floppy/CDROM/shell menu */
423 extern DMenu MenuXF86Config; /* Select XFree86 configuration type */
424 extern int FixItMode; /* FixItMode starts shell onc urrent device (ie Serial port) */
425 extern const char * StartName; /* Which name we were started as */
427 /* Stuff from libdialog which isn't properly declared outside */
428 extern void display_helpfile(void);
429 extern void display_helpline(WINDOW *w, int y, int width);
434 extern int configAnonFTP(dialogMenuItem *self);
437 extern Boolean mediaInitCDROM(Device *dev);
438 extern FILE *mediaGetCDROM(Device *dev, char *file, Boolean probe);
439 extern void mediaShutdownCDROM(Device *dev);
442 extern void command_clear(void);
443 extern void command_sort(void);
444 extern void command_execute(void);
445 extern void command_shell_add(char *key, char *fmt, ...) __printflike(2, 3);
446 extern void command_func_add(char *key, commandFunc func, void *data);
449 extern void configEnvironmentRC_conf(void);
450 extern void configEnvironmentResolv(char *config);
451 extern void configRC_conf(void);
452 extern int configFstab(dialogMenuItem *self);
453 extern int configRC(dialogMenuItem *self);
454 extern int configResolv(dialogMenuItem *self);
455 extern int configPackages(dialogMenuItem *self);
456 extern int configSaver(dialogMenuItem *self);
457 extern int configSaverTimeout(dialogMenuItem *self);
458 extern int configLinux(dialogMenuItem *self);
459 extern int configNTP(dialogMenuItem *self);
460 extern int configUsers(dialogMenuItem *self);
461 extern int configXSetup(dialogMenuItem *self);
462 extern int configXDesktop(dialogMenuItem *self);
463 extern int configRouter(dialogMenuItem *self);
464 extern int configPCNFSD(dialogMenuItem *self);
465 extern int configInetd(dialogMenuItem *self);
466 extern int configNFSServer(dialogMenuItem *self);
467 extern int configWriteRC_conf(dialogMenuItem *self);
468 extern int configSecurityProfile(dialogMenuItem *self);
469 extern int configSecurityExtreme(dialogMenuItem *self);
470 extern int configSecurityModerate(dialogMenuItem *self);
471 extern int configEtcTtys(dialogMenuItem *self);
474 extern int crc(int, unsigned long *, unsigned long *);
477 extern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogMenuItem *d),
478 int (*check)(dialogMenuItem *d));
479 extern void deviceGetAll(void);
480 extern void deviceReset(void);
481 extern void deviceRescan(void);
482 extern Device **deviceFind(char *name, DeviceType type);
483 extern Device **deviceFindDescr(char *name, char *desc, DeviceType class);
484 extern int deviceCount(Device **devs);
485 extern Device *new_device(char *name);
486 extern Device *deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean enabled,
487 Boolean (*init)(Device *mediadev),
488 FILE * (*get)(Device *dev, char *file, Boolean probe),
489 void (*shutDown)(Device *mediadev),
491 extern Boolean dummyInit(Device *dev);
492 extern FILE *dummyGet(Device *dev, char *dist, Boolean probe);
493 extern void dummyShutdown(Device *dev);
496 extern int dhcpParseLeases(char *file, char *hostname, char *domain, char *nameserver,
497 char *ipaddr, char *gateway, char *netmask);
500 extern int diskPartitionEditor(dialogMenuItem *self);
501 extern int diskPartitionWrite(dialogMenuItem *self);
502 extern int diskGetSelectCount(Device ***devs);
503 extern void diskPartition(Device *dev);
506 extern int dispatchCommand(char *command);
507 extern int dispatch_load_floppy(dialogMenuItem *self);
508 extern int dispatch_load_file_int(int);
509 extern int dispatch_load_file(dialogMenuItem *self);
513 extern int distReset(dialogMenuItem *self);
514 extern int distConfig(dialogMenuItem *self);
515 extern int distSetCustom(dialogMenuItem *self);
516 extern int distUnsetCustom(dialogMenuItem *self);
517 extern int distSetDeveloper(dialogMenuItem *self);
518 extern int distSetXDeveloper(dialogMenuItem *self);
519 extern int distSetKernDeveloper(dialogMenuItem *self);
520 extern int distSetXKernDeveloper(dialogMenuItem *self);
521 extern int distSetUser(dialogMenuItem *self);
522 extern int distSetXUser(dialogMenuItem *self);
523 extern int distSetMinimum(dialogMenuItem *self);
524 extern int distSetEverything(dialogMenuItem *self);
525 extern int distSetSrc(dialogMenuItem *self);
526 extern int distSetXF86(dialogMenuItem *self);
527 extern int distExtractAll(dialogMenuItem *self);
530 extern int dmenuDisplayFile(dialogMenuItem *tmp);
531 extern int dmenuSubmenu(dialogMenuItem *tmp);
532 extern int dmenuSystemCommand(dialogMenuItem *tmp);
533 extern int dmenuSystemCommandBox(dialogMenuItem *tmp);
534 extern int dmenuExit(dialogMenuItem *tmp);
535 extern int dmenuISetVariable(dialogMenuItem *tmp);
536 extern int dmenuSetVariable(dialogMenuItem *tmp);
537 extern int dmenuSetKmapVariable(dialogMenuItem *tmp);
538 extern int dmenuSetVariables(dialogMenuItem *tmp);
539 extern int dmenuToggleVariable(dialogMenuItem *tmp);
540 extern int dmenuSetFlag(dialogMenuItem *tmp);
541 extern int dmenuSetValue(dialogMenuItem *tmp);
542 extern Boolean dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max, Boolean buttons);
543 extern Boolean dmenuOpenSimple(DMenu *menu, Boolean buttons);
544 extern int dmenuVarCheck(dialogMenuItem *item);
545 extern int dmenuVarsCheck(dialogMenuItem *item);
546 extern int dmenuFlagCheck(dialogMenuItem *item);
547 extern int dmenuRadioCheck(dialogMenuItem *item);
550 extern int docBrowser(dialogMenuItem *self);
551 extern int docShowDocument(dialogMenuItem *self);
554 extern Boolean mediaCloseDOS(Device *dev, FILE *fp);
555 extern Boolean mediaInitDOS(Device *dev);
556 extern FILE *mediaGetDOS(Device *dev, char *file, Boolean probe);
557 extern void mediaShutdownDOS(Device *dev);
560 extern int getRootFloppy(void);
561 extern Boolean mediaInitFloppy(Device *dev);
562 extern FILE *mediaGetFloppy(Device *dev, char *file, Boolean probe);
563 extern void mediaShutdownFloppy(Device *dev);
566 extern Boolean mediaCloseFTP(Device *dev, FILE *fp);
567 extern Boolean mediaInitFTP(Device *dev);
568 extern FILE *mediaGetFTP(Device *dev, char *file, Boolean probe);
569 extern void mediaShutdownFTP(Device *dev);
572 extern Boolean mediaInitHTTP(Device *dev);
573 extern FILE *mediaGetHTTP(Device *dev, char *file, Boolean probe);
576 extern void globalsInit(void);
579 int index_read(FILE *fp, PkgNodePtr papa);
580 int index_menu(PkgNodePtr root, PkgNodePtr top, PkgNodePtr plist, int *pos, int *scroll);
581 void index_init(PkgNodePtr top, PkgNodePtr plist);
582 void index_node_free(PkgNodePtr top, PkgNodePtr plist);
583 void index_sort(PkgNodePtr top);
584 void index_print(PkgNodePtr top, int level);
585 int index_extract(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended);
586 int index_initialize(char *path);
587 PkgNodePtr index_search(PkgNodePtr top, char *str, PkgNodePtr *tp);
590 extern Boolean checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vdev, Chunk **vtdev, Chunk **hdev);
591 extern int installCommit(dialogMenuItem *self);
592 extern int installCustomCommit(dialogMenuItem *self);
593 extern int installExpress(dialogMenuItem *self);
594 extern int installStandard(dialogMenuItem *self);
595 extern int installFixitHoloShell(dialogMenuItem *self);
596 extern int installFixitCDROM(dialogMenuItem *self);
597 extern int installFixitFloppy(dialogMenuItem *self);
598 extern int installFixupBin(dialogMenuItem *self);
599 extern int installFixupXFree(dialogMenuItem *self);
600 extern int installUpgrade(dialogMenuItem *self);
601 extern int installFilesystems(dialogMenuItem *self);
602 extern int installVarDefaults(dialogMenuItem *self);
603 extern void installEnvironment(void);
604 extern int installX11package(dialogMenuItem *self);
605 extern Boolean copySelf(void);
608 extern int kget(char *out);
611 extern int loadKeymap(const char *lang);
614 extern int diskLabelEditor(dialogMenuItem *self);
615 extern int diskLabelCommit(dialogMenuItem *self);
617 /* makedevs.c (auto-generated) */
618 extern const char termcap_ansi[];
619 extern const char termcap_vt100[];
620 extern const char termcap_cons25w[];
621 extern const char termcap_cons25[];
622 extern const char termcap_cons25_m[];
623 extern const char termcap_cons25r[];
624 extern const char termcap_cons25r_m[];
625 extern const char termcap_cons25l1[];
626 extern const char termcap_cons25l1_m[];
627 extern const char termcap_xterm[];
628 extern const u_char font_iso_8x16[];
629 extern const u_char font_cp850_8x16[];
630 extern const u_char font_cp866_8x16[];
631 extern const u_char koi8_r2cp866[];
632 extern u_char default_scrnmap[];
635 extern char *cpioVerbosity(void);
636 extern void mediaClose(void);
637 extern int mediaTimeout(void);
638 extern int mediaSetCDROM(dialogMenuItem *self);
639 extern int mediaSetFloppy(dialogMenuItem *self);
640 extern int mediaSetDOS(dialogMenuItem *self);
641 extern int mediaSetTape(dialogMenuItem *self);
642 extern int mediaSetFTP(dialogMenuItem *self);
643 extern int mediaSetFTPActive(dialogMenuItem *self);
644 extern int mediaSetFTPPassive(dialogMenuItem *self);
645 extern int mediaSetHTTP(dialogMenuItem *self);
646 extern int mediaSetUFS(dialogMenuItem *self);
647 extern int mediaSetNFS(dialogMenuItem *self);
648 extern int mediaSetFTPUserPass(dialogMenuItem *self);
649 extern int mediaSetCPIOVerbosity(dialogMenuItem *self);
650 extern int mediaGetType(dialogMenuItem *self);
651 extern Boolean mediaExtractDist(char *dir, char *dist, FILE *fp);
652 extern Boolean mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpic);
653 extern Boolean mediaExtractDistEnd(int zpid, int cpid);
654 extern Boolean mediaVerify(void);
655 extern FILE *mediaGenericGet(char *base, const char *file);
658 extern Boolean file_readable(char *fname);
659 extern Boolean file_executable(char *fname);
660 extern Boolean directory_exists(const char *dirname);
661 extern char *root_bias(char *path);
662 extern char *itoa(int value);
663 extern char *string_concat(char *p1, char *p2);
664 extern char *string_concat3(char *p1, char *p2, char *p3);
665 extern char *string_prune(char *str);
666 extern char *string_skipwhite(char *str);
667 extern char *string_copy(char *s1, char *s2);
668 extern char *pathBaseName(const char *path);
669 extern void safe_free(void *ptr);
670 extern void *safe_malloc(size_t size);
671 extern void *safe_realloc(void *orig, size_t size);
672 extern dialogMenuItem *item_add(dialogMenuItem *list, char *prompt, char *title,
673 int (*checked)(dialogMenuItem *self),
674 int (*fire)(dialogMenuItem *self),
675 void (*selected)(dialogMenuItem *self, int is_selected),
676 void *data, int *aux, int *curr, int *max);
677 extern void items_free(dialogMenuItem *list, int *curr, int *max);
678 extern int Mkdir(char *);
679 extern int Mount(char *, void *data);
680 extern WINDOW *openLayoutDialog(char *helpfile, char *title, int x, int y, int width, int height);
681 extern ComposeObj *initLayoutDialog(WINDOW *win, Layout *layout, int x, int y, int *max);
682 extern int layoutDialogLoop(WINDOW *win, Layout *layout, ComposeObj **obj,
683 int *n, int max, int *cbutton, int *cancel);
685 extern WINDOW *savescr(void);
686 extern void restorescr(WINDOW *w);
687 extern char *sstrncpy(char *dst, const char *src, int size);
690 extern void moduleInitialize(void);
691 extern int kldBrowser(dialogMenuItem *self);
694 extern int mousedTest(dialogMenuItem *self);
695 extern int mousedDisable(dialogMenuItem *self);
696 extern int setMouseFlags(dialogMenuItem *self);
699 extern Boolean isDebug(void);
700 extern void msgInfo(char *fmt, ...) __printf0like(1, 2);
701 extern void msgYap(char *fmt, ...) __printflike(1, 2);
702 extern void msgWarn(char *fmt, ...) __printflike(1, 2);
703 extern void msgDebug(char *fmt, ...) __printflike(1, 2);
704 extern void msgError(char *fmt, ...) __printflike(1, 2);
705 extern void msgFatal(char *fmt, ...) __printflike(1, 2);
706 extern void msgConfirm(char *fmt, ...) __printflike(1, 2);
707 extern void msgNotify(char *fmt, ...) __printflike(1, 2);
708 extern void msgWeHaveOutput(char *fmt, ...) __printflike(1, 2);
709 extern int msgYesNo(char *fmt, ...) __printflike(1, 2);
710 extern int msgNoYes(char *fmt, ...) __printflike(1, 2);
711 extern char *msgGetInput(char *buf, char *fmt, ...) __printflike(2, 3);
712 extern int msgSimpleConfirm(char *);
713 extern int msgSimpleNotify(char *);
716 extern Boolean mediaInitNetwork(Device *dev);
717 extern void mediaShutdownNetwork(Device *dev);
720 extern Boolean mediaInitNFS(Device *dev);
721 extern FILE *mediaGetNFS(Device *dev, char *file, Boolean probe);
722 extern void mediaShutdownNFS(Device *dev);
725 extern int optionsEditor(dialogMenuItem *self);
728 extern int packageAdd(dialogMenuItem *self);
729 extern int package_add(char *name);
730 extern int package_extract(Device *dev, char *name, Boolean depended);
731 extern Boolean package_exists(char *name);
734 extern void pccardInitialize(void);
737 extern void systemInitialize(int argc, char **argv);
738 extern void systemShutdown(int status);
739 extern int execExecute(char *cmd, char *name);
740 extern int systemExecute(char *cmd);
741 extern void systemSuspendDialog(void);
742 extern void systemResumeDialog(void);
743 extern int systemDisplayHelp(char *file);
744 extern char *systemHelpFile(char *file, char *buf);
745 extern void systemChangeFont(const u_char font[]);
746 extern void systemChangeLang(char *lang);
747 extern void systemChangeTerminal(char *color, const u_char c_termcap[], char *mono, const u_char m_termcap[]);
748 extern void systemChangeScreenmap(const u_char newmap[]);
749 extern void systemCreateHoloshell(void);
750 extern int vsystem(char *fmt, ...) __printflike(1, 2);
753 extern char *mediaTapeBlocksize(void);
754 extern Boolean mediaInitTape(Device *dev);
755 extern FILE *mediaGetTape(Device *dev, char *file, Boolean probe);
756 extern void mediaShutdownTape(Device *dev);
759 extern int tcpOpenDialog(Device *dev);
760 extern int tcpMenuSelect(dialogMenuItem *self);
761 extern Device *tcpDeviceSelect(void);
764 extern int set_termcap(void);
767 extern void configTtys(void);
770 extern void mediaShutdownUFS(Device *dev);
771 extern Boolean mediaInitUFS(Device *dev);
772 extern FILE *mediaGetUFS(Device *dev, char *file, Boolean probe);
775 extern void usbInitialize(void);
778 extern int userAddGroup(dialogMenuItem *self);
779 extern int userAddUser(dialogMenuItem *self);
782 extern void variable_set(char *var, int dirty);
783 extern void variable_set2(char *name, char *value, int dirty);
784 extern char *variable_get(char *var);
785 extern int variable_cmp(char *var, char *value);
786 extern void variable_unset(char *var);
787 extern char *variable_get_value(char *var, char *prompt, int dirty);
788 extern int variable_check(char *data);
789 extern int dump_variables(dialogMenuItem *self);
790 extern void free_variables(void);
791 extern void pvariable_set(char *var);
792 extern char *pvariable_get(char *var);
795 extern void slice_wizard(Disk *d);
798 * Macros. Please find a better place for us!
800 #define DEVICE_INIT(d) ((d) != NULL ? (d)->init((d)) : NULL)
801 #define DEVICE_GET(d, b, f) ((d) != NULL ? (d)->get((d), (b), (f)) : NULL)
802 #define DEVICE_SHUTDOWN(d) ((d) != NULL ? (d)->shutdown((d)) : (void)0)
805 /* _SYSINSTALL_H_INCLUDE */