/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* This file contains the code to add new disk_type and partition
* definitions to a format data file.
*/
#include "global.h"
#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <memory.h>
#include <time.h>
#include <stdarg.h>
#include "add_definition.h"
#include "misc.h"
#include "partition.h"
#include "menu_command.h"
#include "startup.h"
extern struct ctlr_type ctlr_types[];
extern int nctypes;
extern int errno;
/* Function prototypes */
#ifdef __STDC__
struct partition_info *);
#else /* __STDC__ */
static void add_disktype();
static void add_partition();
static int add_entry();
#endif /* __STDC__ */
/*
*/
int
{
char *filename;
char *prompt;
union {
int xfoo;
} x;
/*
* There must be a current disk and partition table
*/
err_print("No Current Disk.\n");
return (0);
}
err_print("Current disk type is not set.\n");
return (-1);
}
err_print("Current partition is not set.\n");
return (-1);
}
/*
* If neither the disk definition nor the partition
* information has been changed, there's nothing to save.
*/
err_print("\
Neither the disk type nor the partitioning has been changed.\n");
return (-1);
}
/*
* If saving the partition, and it's unnamed, the user should name
* it first.
*/
err_print("Please name this partition type before saving it\n");
return (-1);
}
/*
* Let the user know what we're doing
*/
fmt_print("Saving new disk and partition definitions\n");
fmt_print("Saving new disk definition\n");
} else {
fmt_print("Saving new partition definition\n");
}
/*
* Ask for the file to which to append the new definitions
*/
prompt = "Enter file name";
/*
* Open the file in append mode, or create it, if necessary
*/
return (-1);
}
/*
* Write a header for the new definitions
*/
} else {
}
/*
* Save the new definitions
*/
}
}
/*
* We're finished. Clean up
*/
return (0);
}
/*
* Add a disk_type definition to the file fd
*/
static void
{
int col;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
/*
* Terminate the last line, and print one blank line
*/
}
/*
* Once we exceed this length, wrap to a new line
*/
/*
* Add a partition definition to the file fd
*/
static void
struct partition_info *part;
{
int col;
int i;
char *s;
#if defined(_SUNOS_VTOC_8)
#elif defined(_SUNOS_VTOC_16)
#else
#endif /* defined (_SUNOS_VTOC_8) */
/*
* Print the specifications for each useful partition
*/
col = 0;
i + PARTITION_BASE);
s = find_string(ptag_choices,
if (s != NULL) {
}
s = find_string(pflag_choices,
if (s != NULL) {
}
}
}
}
/*
* Terminate the last line, and print one blank line
*/
}
/*
* Add an entry to the file fd. col is the current starting column.
* Return the resulting new column position.
*/
/*PRINTFLIKE3*/
static int
{
if (col > MAX_COLUMNS) {
col = 0;
}
if (col == 0) {
}
return (col);
}