Rename the usage of private' to private_data' to cope with the

recent libdisk changes.  (sysinstall is guilty of using `private' in
quite more places, but since this ain't in library code, it's not that
important.)

Whenever possible, better not use C++ reserved words...
This commit is contained in:
Joerg Wunsch 1996-03-24 18:57:37 +00:00
parent e2c8e21d6b
commit 948aa2a132
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=14793
12 changed files with 135 additions and 138 deletions

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: config.c,v 1.20 1996/03/19 11:51:36 jkh Exp $
* $Id: config.c,v 1.21 1996/03/21 09:30:08 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -58,14 +58,14 @@ chunk_compare(Chunk *c1, Chunk *c2)
return 1;
else if (c1 && !c2)
return -1;
else if (!c1->private && !c2->private)
else if (!c1->private_data && !c2->private_data)
return 0;
else if (c1->private && !c2->private)
else if (c1->private_data && !c2->private_data)
return 1;
else if (!c1->private && c2->private)
else if (!c1->private_data && c2->private_data)
return -1;
else
return strcmp(((PartInfo *)(c1->private))->mountpoint, ((PartInfo *)(c2->private))->mountpoint);
return strcmp(((PartInfo *)(c1->private_data))->mountpoint, ((PartInfo *)(c2->private_data))->mountpoint);
}
static void
@ -105,7 +105,7 @@ mount_point(Chunk *c1)
if (c1->type == part && c1->subtype == FS_SWAP)
return "none";
else if (c1->type == part || c1->type == fat)
return ((PartInfo *)c1->private)->mountpoint;
return ((PartInfo *)c1->private_data)->mountpoint;
return "/bogus";
}
@ -183,11 +183,11 @@ configFstab(void)
for (c1 = disk->chunks->part; c1; c1 = c1->next) {
if (c1->type == freebsd) {
for (c2 = c1->part; c2; c2 = c2->next) {
if (c2->type == part && (c2->subtype == FS_SWAP || c2->private))
if (c2->type == part && (c2->subtype == FS_SWAP || c2->private_data))
chunk_list[nchunks++] = c2;
}
}
else if (c1->type == fat && c1->private)
else if (c1->type == fat && c1->private_data)
chunk_list[nchunks++] = c1;
}
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: disks.c,v 1.36 1996/03/18 15:27:49 jkh Exp $
* $Id: disks.c,v 1.37 1996/03/20 14:11:21 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -586,7 +586,6 @@ diskPartitionEditor(char *str)
int
diskPartitionWrite(char *str)
{
extern u_char boot1[], boot2[];
Device **devs;
char *cp;
int i;

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: install.c,v 1.79 1996/03/23 07:28:22 jkh Exp $
* $Id: install.c,v 1.80 1996/03/24 09:43:53 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -83,7 +83,7 @@ checkLabels(Chunk **rdev, Chunk **sdev, Chunk **udev)
for (c1 = disk->chunks->part; c1; c1 = c1->next) {
if (c1->type == freebsd) {
for (c2 = c1->part; c2; c2 = c2->next) {
if (c2->type == part && c2->subtype != FS_SWAP && c2->private) {
if (c2->type == part && c2->subtype != FS_SWAP && c2->private_data) {
if (c2->flags & CHUNK_IS_ROOT) {
if (rootdev) {
dialog_clear();
@ -95,7 +95,7 @@ checkLabels(Chunk **rdev, Chunk **sdev, Chunk **udev)
if (isDebug())
msgDebug("Found rootdev at %s!\n", rootdev->name);
}
else if (!strcmp(((PartInfo *)c2->private)->mountpoint, "/usr")) {
else if (!strcmp(((PartInfo *)c2->private_data)->mountpoint, "/usr")) {
if (usrdev) {
dialog_clear();
msgConfirm("WARNING: You have more than one /usr filesystem.\n"
@ -639,7 +639,7 @@ installFilesystems(char *str)
if (!(str && !strcmp(str, "script")) && !checkLabels(&rootdev, &swapdev, &usrdev))
return RET_FAIL;
root = (PartInfo *)rootdev->private;
root = (PartInfo *)rootdev->private_data;
command_clear();
upgrade = str && !strcmp(str, "upgrade");
@ -726,8 +726,8 @@ installFilesystems(char *str)
for (c1 = disk->chunks->part; c1; c1 = c1->next) {
if (c1->type == freebsd) {
for (c2 = c1->part; c2; c2 = c2->next) {
if (c2->type == part && c2->subtype != FS_SWAP && c2->private) {
PartInfo *tmp = (PartInfo *)c2->private;
if (c2->type == part && c2->subtype != FS_SWAP && c2->private_data) {
PartInfo *tmp = (PartInfo *)c2->private_data;
/* Already did root */
if (c2 == rootdev)
@ -756,10 +756,10 @@ installFilesystems(char *str)
}
}
}
else if (c1->type == fat && c1->private && (root->newfs || upgrade)) {
else if (c1->type == fat && c1->private_data && (root->newfs || upgrade)) {
char name[FILENAME_MAX];
sprintf(name, "/mnt%s", ((PartInfo *)c1->private)->mountpoint);
sprintf(name, "/mnt%s", ((PartInfo *)c1->private_data)->mountpoint);
Mkdir(name, NULL);
}
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: label.c,v 1.38 1996/03/18 15:27:58 jkh Exp $
* $Id: label.c,v 1.39 1996/03/20 14:11:22 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -198,8 +198,8 @@ check_conflict(char *name)
int i;
for (i = 0; label_chunk_info[i].c; i++)
if (label_chunk_info[i].type == PART_FILESYSTEM && label_chunk_info[i].c->private
&& !strcmp(((PartInfo *)label_chunk_info[i].c->private)->mountpoint, name))
if (label_chunk_info[i].type == PART_FILESYSTEM && label_chunk_info[i].c->private_data
&& !strcmp(((PartInfo *)label_chunk_info[i].c->private_data)->mountpoint, name))
return TRUE;
return FALSE;
}
@ -312,8 +312,8 @@ get_mountpoint(struct chunk *old)
char *val;
PartInfo *tmp;
if (old && old->private)
tmp = old->private;
if (old && old->private_data)
tmp = old->private_data;
else
tmp = NULL;
val = msgGetInput(tmp ? tmp->mountpoint : NULL, "Please specify a mount point for the partition");
@ -321,8 +321,8 @@ get_mountpoint(struct chunk *old)
if (!old)
return NULL;
else {
free(old->private);
old->private = NULL;
free(old->private_data);
old->private_data = NULL;
}
return NULL;
}
@ -354,7 +354,7 @@ get_mountpoint(struct chunk *old)
safe_free(tmp);
tmp = new_part(val, TRUE, 0);
if (old) {
old->private = tmp;
old->private_data = tmp;
old->private_free = safe_free;
}
return tmp;
@ -469,7 +469,7 @@ scriptLabel(char *str)
break;
}
else {
tmp->private = new_part(mpoint, TRUE, sz);
tmp->private_data = new_part(mpoint, TRUE, sz);
tmp->private_free = safe_free;
status = RET_SUCCESS;
}
@ -491,13 +491,13 @@ scriptLabel(char *str)
continue;
}
newfs = toupper(nwfs[0]) == 'Y' ? TRUE : FALSE;
if (c1->private) {
p = c1->private;
if (c1->private_data) {
p = c1->private_data;
p->newfs = newfs;
strcpy(p->mountpoint, mpoint);
}
else {
c1->private = new_part(mpoint, newfs, 0);
c1->private_data = new_part(mpoint, newfs, 0);
c1->private_free = safe_free;
}
if (!strcmp(mpoint, "/"))
@ -578,17 +578,17 @@ print_label_chunks(void)
}
memcpy(onestr + PART_PART_COL, label_chunk_info[i].c->name, strlen(label_chunk_info[i].c->name));
/* If it's a filesystem, display the mountpoint */
if (label_chunk_info[i].c->private
if (label_chunk_info[i].c->private_data
&& (label_chunk_info[i].type == PART_FILESYSTEM || label_chunk_info[i].type == PART_FAT))
mountpoint = ((PartInfo *)label_chunk_info[i].c->private)->mountpoint;
mountpoint = ((PartInfo *)label_chunk_info[i].c->private_data)->mountpoint;
else
mountpoint = "<none>";
/* Now display the newfs field */
if (label_chunk_info[i].type == PART_FAT)
newfs = "DOS";
else if (label_chunk_info[i].c->private && label_chunk_info[i].type == PART_FILESYSTEM)
newfs = ((PartInfo *)label_chunk_info[i].c->private)->newfs ? "UFS Y" : "UFS N";
else if (label_chunk_info[i].c->private_data && label_chunk_info[i].type == PART_FILESYSTEM)
newfs = ((PartInfo *)label_chunk_info[i].c->private_data)->newfs ? "UFS Y" : "UFS N";
else if (label_chunk_info[i].type == PART_SWAP)
newfs = "SWAP";
else
@ -739,7 +739,7 @@ diskLabel(char *str)
msgConfirm("Unable to create the root partition. Too big?");
break;
}
tmp->private = new_part("/", TRUE, tmp->size);
tmp->private_data = new_part("/", TRUE, tmp->size);
tmp->private_free = safe_free;
record_label_chunks(devs);
@ -763,7 +763,7 @@ diskLabel(char *str)
break;
}
tmp->private = 0;
tmp->private_data = 0;
tmp->private_free = safe_free;
record_label_chunks(devs);
@ -777,7 +777,7 @@ diskLabel(char *str)
"partition your disk manually with a custom install!", (cp ? atoi(cp) : VAR_MIN_SIZE));
break;
}
tmp->private = new_part("/var", TRUE, tmp->size);
tmp->private_data = new_part("/var", TRUE, tmp->size);
tmp->private_free = safe_free;
record_label_chunks(devs);
@ -804,7 +804,7 @@ diskLabel(char *str)
}
/* At this point, we're reasonably "labelled" */
variable_set2(DISK_LABELLED, "yes");
tmp->private = new_part("/usr", TRUE, tmp->size);
tmp->private_data = new_part("/usr", TRUE, tmp->size);
tmp->private_free = safe_free;
record_label_chunks(devs);
}
@ -907,11 +907,11 @@ diskLabel(char *str)
}
if (type != PART_SWAP) {
/* This is needed to tell the newfs -u about the size */
tmp->private = new_part(p->mountpoint, p->newfs, tmp->size);
tmp->private_data = new_part(p->mountpoint, p->newfs, tmp->size);
tmp->private_free = safe_free;
safe_free(p);
} else {
tmp->private = p;
tmp->private_data = p;
}
tmp->private_free = safe_free;
variable_set2(DISK_LABELLED, "yes");
@ -946,7 +946,7 @@ diskLabel(char *str)
case PART_FAT:
case PART_FILESYSTEM:
oldp = label_chunk_info[here].c->private;
oldp = label_chunk_info[here].c->private_data;
p = get_mountpoint(label_chunk_info[here].c);
if (p) {
if (!oldp)
@ -969,17 +969,17 @@ diskLabel(char *str)
break;
case 'N': /* Set newfs options */
if (label_chunk_info[here].c->private &&
((PartInfo *)label_chunk_info[here].c->private)->newfs)
getNewfsCmd(label_chunk_info[here].c->private);
if (label_chunk_info[here].c->private_data &&
((PartInfo *)label_chunk_info[here].c->private_data)->newfs)
getNewfsCmd(label_chunk_info[here].c->private_data);
else
msg = MSG_NOT_APPLICABLE;
break;
case 'T': /* Toggle newfs state */
if (label_chunk_info[here].type == PART_FILESYSTEM) {
PartInfo *pi = ((PartInfo *)label_chunk_info[here].c->private);
label_chunk_info[here].c->private = new_part(pi ? pi->mountpoint : NULL, pi ? !pi->newfs : TRUE, label_chunk_info[here].c->size);
PartInfo *pi = ((PartInfo *)label_chunk_info[here].c->private_data);
label_chunk_info[here].c->private_data = new_part(pi ? pi->mountpoint : NULL, pi ? !pi->newfs : TRUE, label_chunk_info[here].c->size);
safe_free(pi);
label_chunk_info[here].c->private_free = safe_free;
variable_set2(DISK_LABELLED, "yes");

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: config.c,v 1.20 1996/03/19 11:51:36 jkh Exp $
* $Id: config.c,v 1.21 1996/03/21 09:30:08 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -58,14 +58,14 @@ chunk_compare(Chunk *c1, Chunk *c2)
return 1;
else if (c1 && !c2)
return -1;
else if (!c1->private && !c2->private)
else if (!c1->private_data && !c2->private_data)
return 0;
else if (c1->private && !c2->private)
else if (c1->private_data && !c2->private_data)
return 1;
else if (!c1->private && c2->private)
else if (!c1->private_data && c2->private_data)
return -1;
else
return strcmp(((PartInfo *)(c1->private))->mountpoint, ((PartInfo *)(c2->private))->mountpoint);
return strcmp(((PartInfo *)(c1->private_data))->mountpoint, ((PartInfo *)(c2->private_data))->mountpoint);
}
static void
@ -105,7 +105,7 @@ mount_point(Chunk *c1)
if (c1->type == part && c1->subtype == FS_SWAP)
return "none";
else if (c1->type == part || c1->type == fat)
return ((PartInfo *)c1->private)->mountpoint;
return ((PartInfo *)c1->private_data)->mountpoint;
return "/bogus";
}
@ -183,11 +183,11 @@ configFstab(void)
for (c1 = disk->chunks->part; c1; c1 = c1->next) {
if (c1->type == freebsd) {
for (c2 = c1->part; c2; c2 = c2->next) {
if (c2->type == part && (c2->subtype == FS_SWAP || c2->private))
if (c2->type == part && (c2->subtype == FS_SWAP || c2->private_data))
chunk_list[nchunks++] = c2;
}
}
else if (c1->type == fat && c1->private)
else if (c1->type == fat && c1->private_data)
chunk_list[nchunks++] = c1;
}
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: disks.c,v 1.36 1996/03/18 15:27:49 jkh Exp $
* $Id: disks.c,v 1.37 1996/03/20 14:11:21 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -586,7 +586,6 @@ diskPartitionEditor(char *str)
int
diskPartitionWrite(char *str)
{
extern u_char boot1[], boot2[];
Device **devs;
char *cp;
int i;

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: install.c,v 1.79 1996/03/23 07:28:22 jkh Exp $
* $Id: install.c,v 1.80 1996/03/24 09:43:53 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -83,7 +83,7 @@ checkLabels(Chunk **rdev, Chunk **sdev, Chunk **udev)
for (c1 = disk->chunks->part; c1; c1 = c1->next) {
if (c1->type == freebsd) {
for (c2 = c1->part; c2; c2 = c2->next) {
if (c2->type == part && c2->subtype != FS_SWAP && c2->private) {
if (c2->type == part && c2->subtype != FS_SWAP && c2->private_data) {
if (c2->flags & CHUNK_IS_ROOT) {
if (rootdev) {
dialog_clear();
@ -95,7 +95,7 @@ checkLabels(Chunk **rdev, Chunk **sdev, Chunk **udev)
if (isDebug())
msgDebug("Found rootdev at %s!\n", rootdev->name);
}
else if (!strcmp(((PartInfo *)c2->private)->mountpoint, "/usr")) {
else if (!strcmp(((PartInfo *)c2->private_data)->mountpoint, "/usr")) {
if (usrdev) {
dialog_clear();
msgConfirm("WARNING: You have more than one /usr filesystem.\n"
@ -639,7 +639,7 @@ installFilesystems(char *str)
if (!(str && !strcmp(str, "script")) && !checkLabels(&rootdev, &swapdev, &usrdev))
return RET_FAIL;
root = (PartInfo *)rootdev->private;
root = (PartInfo *)rootdev->private_data;
command_clear();
upgrade = str && !strcmp(str, "upgrade");
@ -726,8 +726,8 @@ installFilesystems(char *str)
for (c1 = disk->chunks->part; c1; c1 = c1->next) {
if (c1->type == freebsd) {
for (c2 = c1->part; c2; c2 = c2->next) {
if (c2->type == part && c2->subtype != FS_SWAP && c2->private) {
PartInfo *tmp = (PartInfo *)c2->private;
if (c2->type == part && c2->subtype != FS_SWAP && c2->private_data) {
PartInfo *tmp = (PartInfo *)c2->private_data;
/* Already did root */
if (c2 == rootdev)
@ -756,10 +756,10 @@ installFilesystems(char *str)
}
}
}
else if (c1->type == fat && c1->private && (root->newfs || upgrade)) {
else if (c1->type == fat && c1->private_data && (root->newfs || upgrade)) {
char name[FILENAME_MAX];
sprintf(name, "/mnt%s", ((PartInfo *)c1->private)->mountpoint);
sprintf(name, "/mnt%s", ((PartInfo *)c1->private_data)->mountpoint);
Mkdir(name, NULL);
}
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: label.c,v 1.38 1996/03/18 15:27:58 jkh Exp $
* $Id: label.c,v 1.39 1996/03/20 14:11:22 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -198,8 +198,8 @@ check_conflict(char *name)
int i;
for (i = 0; label_chunk_info[i].c; i++)
if (label_chunk_info[i].type == PART_FILESYSTEM && label_chunk_info[i].c->private
&& !strcmp(((PartInfo *)label_chunk_info[i].c->private)->mountpoint, name))
if (label_chunk_info[i].type == PART_FILESYSTEM && label_chunk_info[i].c->private_data
&& !strcmp(((PartInfo *)label_chunk_info[i].c->private_data)->mountpoint, name))
return TRUE;
return FALSE;
}
@ -312,8 +312,8 @@ get_mountpoint(struct chunk *old)
char *val;
PartInfo *tmp;
if (old && old->private)
tmp = old->private;
if (old && old->private_data)
tmp = old->private_data;
else
tmp = NULL;
val = msgGetInput(tmp ? tmp->mountpoint : NULL, "Please specify a mount point for the partition");
@ -321,8 +321,8 @@ get_mountpoint(struct chunk *old)
if (!old)
return NULL;
else {
free(old->private);
old->private = NULL;
free(old->private_data);
old->private_data = NULL;
}
return NULL;
}
@ -354,7 +354,7 @@ get_mountpoint(struct chunk *old)
safe_free(tmp);
tmp = new_part(val, TRUE, 0);
if (old) {
old->private = tmp;
old->private_data = tmp;
old->private_free = safe_free;
}
return tmp;
@ -469,7 +469,7 @@ scriptLabel(char *str)
break;
}
else {
tmp->private = new_part(mpoint, TRUE, sz);
tmp->private_data = new_part(mpoint, TRUE, sz);
tmp->private_free = safe_free;
status = RET_SUCCESS;
}
@ -491,13 +491,13 @@ scriptLabel(char *str)
continue;
}
newfs = toupper(nwfs[0]) == 'Y' ? TRUE : FALSE;
if (c1->private) {
p = c1->private;
if (c1->private_data) {
p = c1->private_data;
p->newfs = newfs;
strcpy(p->mountpoint, mpoint);
}
else {
c1->private = new_part(mpoint, newfs, 0);
c1->private_data = new_part(mpoint, newfs, 0);
c1->private_free = safe_free;
}
if (!strcmp(mpoint, "/"))
@ -578,17 +578,17 @@ print_label_chunks(void)
}
memcpy(onestr + PART_PART_COL, label_chunk_info[i].c->name, strlen(label_chunk_info[i].c->name));
/* If it's a filesystem, display the mountpoint */
if (label_chunk_info[i].c->private
if (label_chunk_info[i].c->private_data
&& (label_chunk_info[i].type == PART_FILESYSTEM || label_chunk_info[i].type == PART_FAT))
mountpoint = ((PartInfo *)label_chunk_info[i].c->private)->mountpoint;
mountpoint = ((PartInfo *)label_chunk_info[i].c->private_data)->mountpoint;
else
mountpoint = "<none>";
/* Now display the newfs field */
if (label_chunk_info[i].type == PART_FAT)
newfs = "DOS";
else if (label_chunk_info[i].c->private && label_chunk_info[i].type == PART_FILESYSTEM)
newfs = ((PartInfo *)label_chunk_info[i].c->private)->newfs ? "UFS Y" : "UFS N";
else if (label_chunk_info[i].c->private_data && label_chunk_info[i].type == PART_FILESYSTEM)
newfs = ((PartInfo *)label_chunk_info[i].c->private_data)->newfs ? "UFS Y" : "UFS N";
else if (label_chunk_info[i].type == PART_SWAP)
newfs = "SWAP";
else
@ -739,7 +739,7 @@ diskLabel(char *str)
msgConfirm("Unable to create the root partition. Too big?");
break;
}
tmp->private = new_part("/", TRUE, tmp->size);
tmp->private_data = new_part("/", TRUE, tmp->size);
tmp->private_free = safe_free;
record_label_chunks(devs);
@ -763,7 +763,7 @@ diskLabel(char *str)
break;
}
tmp->private = 0;
tmp->private_data = 0;
tmp->private_free = safe_free;
record_label_chunks(devs);
@ -777,7 +777,7 @@ diskLabel(char *str)
"partition your disk manually with a custom install!", (cp ? atoi(cp) : VAR_MIN_SIZE));
break;
}
tmp->private = new_part("/var", TRUE, tmp->size);
tmp->private_data = new_part("/var", TRUE, tmp->size);
tmp->private_free = safe_free;
record_label_chunks(devs);
@ -804,7 +804,7 @@ diskLabel(char *str)
}
/* At this point, we're reasonably "labelled" */
variable_set2(DISK_LABELLED, "yes");
tmp->private = new_part("/usr", TRUE, tmp->size);
tmp->private_data = new_part("/usr", TRUE, tmp->size);
tmp->private_free = safe_free;
record_label_chunks(devs);
}
@ -907,11 +907,11 @@ diskLabel(char *str)
}
if (type != PART_SWAP) {
/* This is needed to tell the newfs -u about the size */
tmp->private = new_part(p->mountpoint, p->newfs, tmp->size);
tmp->private_data = new_part(p->mountpoint, p->newfs, tmp->size);
tmp->private_free = safe_free;
safe_free(p);
} else {
tmp->private = p;
tmp->private_data = p;
}
tmp->private_free = safe_free;
variable_set2(DISK_LABELLED, "yes");
@ -946,7 +946,7 @@ diskLabel(char *str)
case PART_FAT:
case PART_FILESYSTEM:
oldp = label_chunk_info[here].c->private;
oldp = label_chunk_info[here].c->private_data;
p = get_mountpoint(label_chunk_info[here].c);
if (p) {
if (!oldp)
@ -969,17 +969,17 @@ diskLabel(char *str)
break;
case 'N': /* Set newfs options */
if (label_chunk_info[here].c->private &&
((PartInfo *)label_chunk_info[here].c->private)->newfs)
getNewfsCmd(label_chunk_info[here].c->private);
if (label_chunk_info[here].c->private_data &&
((PartInfo *)label_chunk_info[here].c->private_data)->newfs)
getNewfsCmd(label_chunk_info[here].c->private_data);
else
msg = MSG_NOT_APPLICABLE;
break;
case 'T': /* Toggle newfs state */
if (label_chunk_info[here].type == PART_FILESYSTEM) {
PartInfo *pi = ((PartInfo *)label_chunk_info[here].c->private);
label_chunk_info[here].c->private = new_part(pi ? pi->mountpoint : NULL, pi ? !pi->newfs : TRUE, label_chunk_info[here].c->size);
PartInfo *pi = ((PartInfo *)label_chunk_info[here].c->private_data);
label_chunk_info[here].c->private_data = new_part(pi ? pi->mountpoint : NULL, pi ? !pi->newfs : TRUE, label_chunk_info[here].c->size);
safe_free(pi);
label_chunk_info[here].c->private_free = safe_free;
variable_set2(DISK_LABELLED, "yes");

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: config.c,v 1.20 1996/03/19 11:51:36 jkh Exp $
* $Id: config.c,v 1.21 1996/03/21 09:30:08 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -58,14 +58,14 @@ chunk_compare(Chunk *c1, Chunk *c2)
return 1;
else if (c1 && !c2)
return -1;
else if (!c1->private && !c2->private)
else if (!c1->private_data && !c2->private_data)
return 0;
else if (c1->private && !c2->private)
else if (c1->private_data && !c2->private_data)
return 1;
else if (!c1->private && c2->private)
else if (!c1->private_data && c2->private_data)
return -1;
else
return strcmp(((PartInfo *)(c1->private))->mountpoint, ((PartInfo *)(c2->private))->mountpoint);
return strcmp(((PartInfo *)(c1->private_data))->mountpoint, ((PartInfo *)(c2->private_data))->mountpoint);
}
static void
@ -105,7 +105,7 @@ mount_point(Chunk *c1)
if (c1->type == part && c1->subtype == FS_SWAP)
return "none";
else if (c1->type == part || c1->type == fat)
return ((PartInfo *)c1->private)->mountpoint;
return ((PartInfo *)c1->private_data)->mountpoint;
return "/bogus";
}
@ -183,11 +183,11 @@ configFstab(void)
for (c1 = disk->chunks->part; c1; c1 = c1->next) {
if (c1->type == freebsd) {
for (c2 = c1->part; c2; c2 = c2->next) {
if (c2->type == part && (c2->subtype == FS_SWAP || c2->private))
if (c2->type == part && (c2->subtype == FS_SWAP || c2->private_data))
chunk_list[nchunks++] = c2;
}
}
else if (c1->type == fat && c1->private)
else if (c1->type == fat && c1->private_data)
chunk_list[nchunks++] = c1;
}
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: disks.c,v 1.36 1996/03/18 15:27:49 jkh Exp $
* $Id: disks.c,v 1.37 1996/03/20 14:11:21 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -586,7 +586,6 @@ diskPartitionEditor(char *str)
int
diskPartitionWrite(char *str)
{
extern u_char boot1[], boot2[];
Device **devs;
char *cp;
int i;

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: install.c,v 1.79 1996/03/23 07:28:22 jkh Exp $
* $Id: install.c,v 1.80 1996/03/24 09:43:53 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -83,7 +83,7 @@ checkLabels(Chunk **rdev, Chunk **sdev, Chunk **udev)
for (c1 = disk->chunks->part; c1; c1 = c1->next) {
if (c1->type == freebsd) {
for (c2 = c1->part; c2; c2 = c2->next) {
if (c2->type == part && c2->subtype != FS_SWAP && c2->private) {
if (c2->type == part && c2->subtype != FS_SWAP && c2->private_data) {
if (c2->flags & CHUNK_IS_ROOT) {
if (rootdev) {
dialog_clear();
@ -95,7 +95,7 @@ checkLabels(Chunk **rdev, Chunk **sdev, Chunk **udev)
if (isDebug())
msgDebug("Found rootdev at %s!\n", rootdev->name);
}
else if (!strcmp(((PartInfo *)c2->private)->mountpoint, "/usr")) {
else if (!strcmp(((PartInfo *)c2->private_data)->mountpoint, "/usr")) {
if (usrdev) {
dialog_clear();
msgConfirm("WARNING: You have more than one /usr filesystem.\n"
@ -639,7 +639,7 @@ installFilesystems(char *str)
if (!(str && !strcmp(str, "script")) && !checkLabels(&rootdev, &swapdev, &usrdev))
return RET_FAIL;
root = (PartInfo *)rootdev->private;
root = (PartInfo *)rootdev->private_data;
command_clear();
upgrade = str && !strcmp(str, "upgrade");
@ -726,8 +726,8 @@ installFilesystems(char *str)
for (c1 = disk->chunks->part; c1; c1 = c1->next) {
if (c1->type == freebsd) {
for (c2 = c1->part; c2; c2 = c2->next) {
if (c2->type == part && c2->subtype != FS_SWAP && c2->private) {
PartInfo *tmp = (PartInfo *)c2->private;
if (c2->type == part && c2->subtype != FS_SWAP && c2->private_data) {
PartInfo *tmp = (PartInfo *)c2->private_data;
/* Already did root */
if (c2 == rootdev)
@ -756,10 +756,10 @@ installFilesystems(char *str)
}
}
}
else if (c1->type == fat && c1->private && (root->newfs || upgrade)) {
else if (c1->type == fat && c1->private_data && (root->newfs || upgrade)) {
char name[FILENAME_MAX];
sprintf(name, "/mnt%s", ((PartInfo *)c1->private)->mountpoint);
sprintf(name, "/mnt%s", ((PartInfo *)c1->private_data)->mountpoint);
Mkdir(name, NULL);
}
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: label.c,v 1.38 1996/03/18 15:27:58 jkh Exp $
* $Id: label.c,v 1.39 1996/03/20 14:11:22 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -198,8 +198,8 @@ check_conflict(char *name)
int i;
for (i = 0; label_chunk_info[i].c; i++)
if (label_chunk_info[i].type == PART_FILESYSTEM && label_chunk_info[i].c->private
&& !strcmp(((PartInfo *)label_chunk_info[i].c->private)->mountpoint, name))
if (label_chunk_info[i].type == PART_FILESYSTEM && label_chunk_info[i].c->private_data
&& !strcmp(((PartInfo *)label_chunk_info[i].c->private_data)->mountpoint, name))
return TRUE;
return FALSE;
}
@ -312,8 +312,8 @@ get_mountpoint(struct chunk *old)
char *val;
PartInfo *tmp;
if (old && old->private)
tmp = old->private;
if (old && old->private_data)
tmp = old->private_data;
else
tmp = NULL;
val = msgGetInput(tmp ? tmp->mountpoint : NULL, "Please specify a mount point for the partition");
@ -321,8 +321,8 @@ get_mountpoint(struct chunk *old)
if (!old)
return NULL;
else {
free(old->private);
old->private = NULL;
free(old->private_data);
old->private_data = NULL;
}
return NULL;
}
@ -354,7 +354,7 @@ get_mountpoint(struct chunk *old)
safe_free(tmp);
tmp = new_part(val, TRUE, 0);
if (old) {
old->private = tmp;
old->private_data = tmp;
old->private_free = safe_free;
}
return tmp;
@ -469,7 +469,7 @@ scriptLabel(char *str)
break;
}
else {
tmp->private = new_part(mpoint, TRUE, sz);
tmp->private_data = new_part(mpoint, TRUE, sz);
tmp->private_free = safe_free;
status = RET_SUCCESS;
}
@ -491,13 +491,13 @@ scriptLabel(char *str)
continue;
}
newfs = toupper(nwfs[0]) == 'Y' ? TRUE : FALSE;
if (c1->private) {
p = c1->private;
if (c1->private_data) {
p = c1->private_data;
p->newfs = newfs;
strcpy(p->mountpoint, mpoint);
}
else {
c1->private = new_part(mpoint, newfs, 0);
c1->private_data = new_part(mpoint, newfs, 0);
c1->private_free = safe_free;
}
if (!strcmp(mpoint, "/"))
@ -578,17 +578,17 @@ print_label_chunks(void)
}
memcpy(onestr + PART_PART_COL, label_chunk_info[i].c->name, strlen(label_chunk_info[i].c->name));
/* If it's a filesystem, display the mountpoint */
if (label_chunk_info[i].c->private
if (label_chunk_info[i].c->private_data
&& (label_chunk_info[i].type == PART_FILESYSTEM || label_chunk_info[i].type == PART_FAT))
mountpoint = ((PartInfo *)label_chunk_info[i].c->private)->mountpoint;
mountpoint = ((PartInfo *)label_chunk_info[i].c->private_data)->mountpoint;
else
mountpoint = "<none>";
/* Now display the newfs field */
if (label_chunk_info[i].type == PART_FAT)
newfs = "DOS";
else if (label_chunk_info[i].c->private && label_chunk_info[i].type == PART_FILESYSTEM)
newfs = ((PartInfo *)label_chunk_info[i].c->private)->newfs ? "UFS Y" : "UFS N";
else if (label_chunk_info[i].c->private_data && label_chunk_info[i].type == PART_FILESYSTEM)
newfs = ((PartInfo *)label_chunk_info[i].c->private_data)->newfs ? "UFS Y" : "UFS N";
else if (label_chunk_info[i].type == PART_SWAP)
newfs = "SWAP";
else
@ -739,7 +739,7 @@ diskLabel(char *str)
msgConfirm("Unable to create the root partition. Too big?");
break;
}
tmp->private = new_part("/", TRUE, tmp->size);
tmp->private_data = new_part("/", TRUE, tmp->size);
tmp->private_free = safe_free;
record_label_chunks(devs);
@ -763,7 +763,7 @@ diskLabel(char *str)
break;
}
tmp->private = 0;
tmp->private_data = 0;
tmp->private_free = safe_free;
record_label_chunks(devs);
@ -777,7 +777,7 @@ diskLabel(char *str)
"partition your disk manually with a custom install!", (cp ? atoi(cp) : VAR_MIN_SIZE));
break;
}
tmp->private = new_part("/var", TRUE, tmp->size);
tmp->private_data = new_part("/var", TRUE, tmp->size);
tmp->private_free = safe_free;
record_label_chunks(devs);
@ -804,7 +804,7 @@ diskLabel(char *str)
}
/* At this point, we're reasonably "labelled" */
variable_set2(DISK_LABELLED, "yes");
tmp->private = new_part("/usr", TRUE, tmp->size);
tmp->private_data = new_part("/usr", TRUE, tmp->size);
tmp->private_free = safe_free;
record_label_chunks(devs);
}
@ -907,11 +907,11 @@ diskLabel(char *str)
}
if (type != PART_SWAP) {
/* This is needed to tell the newfs -u about the size */
tmp->private = new_part(p->mountpoint, p->newfs, tmp->size);
tmp->private_data = new_part(p->mountpoint, p->newfs, tmp->size);
tmp->private_free = safe_free;
safe_free(p);
} else {
tmp->private = p;
tmp->private_data = p;
}
tmp->private_free = safe_free;
variable_set2(DISK_LABELLED, "yes");
@ -946,7 +946,7 @@ diskLabel(char *str)
case PART_FAT:
case PART_FILESYSTEM:
oldp = label_chunk_info[here].c->private;
oldp = label_chunk_info[here].c->private_data;
p = get_mountpoint(label_chunk_info[here].c);
if (p) {
if (!oldp)
@ -969,17 +969,17 @@ diskLabel(char *str)
break;
case 'N': /* Set newfs options */
if (label_chunk_info[here].c->private &&
((PartInfo *)label_chunk_info[here].c->private)->newfs)
getNewfsCmd(label_chunk_info[here].c->private);
if (label_chunk_info[here].c->private_data &&
((PartInfo *)label_chunk_info[here].c->private_data)->newfs)
getNewfsCmd(label_chunk_info[here].c->private_data);
else
msg = MSG_NOT_APPLICABLE;
break;
case 'T': /* Toggle newfs state */
if (label_chunk_info[here].type == PART_FILESYSTEM) {
PartInfo *pi = ((PartInfo *)label_chunk_info[here].c->private);
label_chunk_info[here].c->private = new_part(pi ? pi->mountpoint : NULL, pi ? !pi->newfs : TRUE, label_chunk_info[here].c->size);
PartInfo *pi = ((PartInfo *)label_chunk_info[here].c->private_data);
label_chunk_info[here].c->private_data = new_part(pi ? pi->mountpoint : NULL, pi ? !pi->newfs : TRUE, label_chunk_info[here].c->size);
safe_free(pi);
label_chunk_info[here].c->private_free = safe_free;
variable_set2(DISK_LABELLED, "yes");