From 64330cc768c6a780e6aaf4dca4237fdd16c128c9 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Sun, 7 May 1995 02:04:29 +0000 Subject: Print sizes of partitions now. --- usr.sbin/sade/disks.c | 43 +++++++++++++++++++++++++++------------- usr.sbin/sade/sade.h | 3 ++- usr.sbin/sysinstall/disks.c | 43 +++++++++++++++++++++++++++------------- usr.sbin/sysinstall/sysinstall.h | 3 ++- 4 files changed, 62 insertions(+), 30 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c index 7d843a132021..39b5d445fc78 100644 --- a/usr.sbin/sade/disks.c +++ b/usr.sbin/sade/disks.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: disks.c,v 1.2 1995/05/05 23:47:40 jkh Exp $ + * $Id: disks.c,v 1.3 1995/05/06 09:34:11 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -216,9 +216,12 @@ get_partition_type(struct chunk *c) return PART_NONE; } +#define MAX_MOUNT_NAME 12 + #define PART_PART_COL 0 #define PART_MOUNT_COL 8 -#define PART_NEWFS_COL 32 +#define PART_SIZE_COL (PART_MOUNT_COL + MAX_MOUNT_NAME + 4) +#define PART_NEWFS_COL (PART_SIZE_COL + 8) #define PART_OFF 40 static void @@ -242,6 +245,10 @@ print_fbsd_chunks(void) "Mount"); attrset(A_NORMAL); + attrset(A_UNDERLINE); + mvaddstr(CHUNK_PART_START_ROW - 1, PART_SIZE_COL + (i * PART_OFF), + "Size"); + attrset(A_UNDERLINE); mvaddstr(CHUNK_PART_START_ROW - 1, PART_NEWFS_COL + (i * PART_OFF), "Newfs"); @@ -253,7 +260,8 @@ print_fbsd_chunks(void) for (i = 0; fbsd_chunk_info[i].d; i++) { if (i == current_chunk) - attrset(A_BOLD); + attrset(ColorDisplay ? A_BOLD : A_UNDERLINE); + /* Is it a slice entry displayed at the top? */ if (fbsd_chunk_info[i].type == PART_SLICE) { sz = space_free(fbsd_chunk_info[i].c); mvprintw(srow++, 0, @@ -261,7 +269,10 @@ print_fbsd_chunks(void) fbsd_chunk_info[i].d->name, fbsd_chunk_info[i].c->name, sz, (sz / 2048)); } + /* Otherwise it's a swap or filesystem entry, at the bottom */ else { + char *mountpoint, *newfs; + /* Go for two columns */ if (prow == (CHUNK_PART_START_ROW + 9)) pcol = PART_OFF; @@ -269,21 +280,25 @@ print_fbsd_chunks(void) pcol = 0; mvaddstr(prow, pcol + PART_PART_COL, fbsd_chunk_info[i].c->name); if (fbsd_chunk_info[i].type == PART_FILESYSTEM) { - char *mountpoint, *newfs; - - if (fbsd_chunk_info[i].c->private) { - mountpoint = ((PartInfo *)fbsd_chunk_info[i].c->private)->mountpoint; - newfs = ((PartInfo *)fbsd_chunk_info[i].c->private)->newfs ? "Y" : "N"; + if (fbsd_chunk_info[i].p) { + mountpoint = fbsd_chunk_info[i].p->mountpoint; + newfs = fbsd_chunk_info[i].p->newfs ? "Y" : "N"; } else { - mountpoint = "?"; - newfs = ""; + mountpoint = " "; + newfs = " "; } - mvaddstr(prow, pcol + PART_MOUNT_COL, mountpoint); - mvaddstr(prow, pcol + PART_NEWFS_COL, newfs); } - else - mvaddstr(prow, pcol + PART_MOUNT_COL, "swap"); + else { + mountpoint = "swap"; + newfs = " "; + } + for (i = 0; i < MAX_MOUNT_NAME && mountpoint[i]; i++) + mvaddch(prow, pcol + PART_MOUNT_COL + i, mountpoint[i]); + mvprintw(prow, pcol + PART_SIZE_COL, "%4dMB", + fbsd_chunk_info[i].c->size ? + fbsd_chunk_info[i].c->size / 2048 : 0); + mvaddstr(prow, pcol + PART_NEWFS_COL, newfs); ++prow; } if (i == current_chunk) diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h index 285bf7041526..ad9417db3d30 100644 --- a/usr.sbin/sade/sade.h +++ b/usr.sbin/sade/sade.h @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: sysinstall.h,v 1.8 1995/05/05 23:47:45 jkh Exp $ + * $Id: sysinstall.h,v 1.9 1995/05/06 09:34:20 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -266,6 +266,7 @@ extern void msgWarn(char *fmt, ...); extern void msgError(char *fmt, ...); extern void msgFatal(char *fmt, ...); extern void msgConfirm(char *fmt, ...); +extern void msgNotify(char *fmt, ...); extern int msgYesNo(char *fmt, ...); extern char *msgGetInput(char *buf, char *fmt, ...); diff --git a/usr.sbin/sysinstall/disks.c b/usr.sbin/sysinstall/disks.c index 7d843a132021..39b5d445fc78 100644 --- a/usr.sbin/sysinstall/disks.c +++ b/usr.sbin/sysinstall/disks.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: disks.c,v 1.2 1995/05/05 23:47:40 jkh Exp $ + * $Id: disks.c,v 1.3 1995/05/06 09:34:11 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -216,9 +216,12 @@ get_partition_type(struct chunk *c) return PART_NONE; } +#define MAX_MOUNT_NAME 12 + #define PART_PART_COL 0 #define PART_MOUNT_COL 8 -#define PART_NEWFS_COL 32 +#define PART_SIZE_COL (PART_MOUNT_COL + MAX_MOUNT_NAME + 4) +#define PART_NEWFS_COL (PART_SIZE_COL + 8) #define PART_OFF 40 static void @@ -242,6 +245,10 @@ print_fbsd_chunks(void) "Mount"); attrset(A_NORMAL); + attrset(A_UNDERLINE); + mvaddstr(CHUNK_PART_START_ROW - 1, PART_SIZE_COL + (i * PART_OFF), + "Size"); + attrset(A_UNDERLINE); mvaddstr(CHUNK_PART_START_ROW - 1, PART_NEWFS_COL + (i * PART_OFF), "Newfs"); @@ -253,7 +260,8 @@ print_fbsd_chunks(void) for (i = 0; fbsd_chunk_info[i].d; i++) { if (i == current_chunk) - attrset(A_BOLD); + attrset(ColorDisplay ? A_BOLD : A_UNDERLINE); + /* Is it a slice entry displayed at the top? */ if (fbsd_chunk_info[i].type == PART_SLICE) { sz = space_free(fbsd_chunk_info[i].c); mvprintw(srow++, 0, @@ -261,7 +269,10 @@ print_fbsd_chunks(void) fbsd_chunk_info[i].d->name, fbsd_chunk_info[i].c->name, sz, (sz / 2048)); } + /* Otherwise it's a swap or filesystem entry, at the bottom */ else { + char *mountpoint, *newfs; + /* Go for two columns */ if (prow == (CHUNK_PART_START_ROW + 9)) pcol = PART_OFF; @@ -269,21 +280,25 @@ print_fbsd_chunks(void) pcol = 0; mvaddstr(prow, pcol + PART_PART_COL, fbsd_chunk_info[i].c->name); if (fbsd_chunk_info[i].type == PART_FILESYSTEM) { - char *mountpoint, *newfs; - - if (fbsd_chunk_info[i].c->private) { - mountpoint = ((PartInfo *)fbsd_chunk_info[i].c->private)->mountpoint; - newfs = ((PartInfo *)fbsd_chunk_info[i].c->private)->newfs ? "Y" : "N"; + if (fbsd_chunk_info[i].p) { + mountpoint = fbsd_chunk_info[i].p->mountpoint; + newfs = fbsd_chunk_info[i].p->newfs ? "Y" : "N"; } else { - mountpoint = "?"; - newfs = ""; + mountpoint = " "; + newfs = " "; } - mvaddstr(prow, pcol + PART_MOUNT_COL, mountpoint); - mvaddstr(prow, pcol + PART_NEWFS_COL, newfs); } - else - mvaddstr(prow, pcol + PART_MOUNT_COL, "swap"); + else { + mountpoint = "swap"; + newfs = " "; + } + for (i = 0; i < MAX_MOUNT_NAME && mountpoint[i]; i++) + mvaddch(prow, pcol + PART_MOUNT_COL + i, mountpoint[i]); + mvprintw(prow, pcol + PART_SIZE_COL, "%4dMB", + fbsd_chunk_info[i].c->size ? + fbsd_chunk_info[i].c->size / 2048 : 0); + mvaddstr(prow, pcol + PART_NEWFS_COL, newfs); ++prow; } if (i == current_chunk) diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h index 285bf7041526..ad9417db3d30 100644 --- a/usr.sbin/sysinstall/sysinstall.h +++ b/usr.sbin/sysinstall/sysinstall.h @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: sysinstall.h,v 1.8 1995/05/05 23:47:45 jkh Exp $ + * $Id: sysinstall.h,v 1.9 1995/05/06 09:34:20 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -266,6 +266,7 @@ extern void msgWarn(char *fmt, ...); extern void msgError(char *fmt, ...); extern void msgFatal(char *fmt, ...); extern void msgConfirm(char *fmt, ...); +extern void msgNotify(char *fmt, ...); extern int msgYesNo(char *fmt, ...); extern char *msgGetInput(char *buf, char *fmt, ...); -- cgit v1.2.3