4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
35 * Bounds structure for integer and disk input.
43 * List of strings with arbitrary matching values
45 typedef struct slist
{
52 * Input structure for current partition information
54 typedef struct partition_defaults
{
59 typedef struct efi_defaults
{
60 uint64_t start_sector
;
65 * Input parameter can be any one of these types.
67 typedef union input_param
{
68 struct slist
*io_slist
;
70 struct bounds io_bounds
;
74 * These declarations define the legal input types.
76 #define FIO_BN 0 /* block number */
77 #define FIO_INT 1 /* integer input */
78 #define FIO_CSTR 2 /* closed string - exact match */
79 #define FIO_MSTR 3 /* matched string, with abbreviations */
80 #define FIO_OSTR 4 /* open string - anything's legal */
81 #define FIO_BLNK 5 /* blank line */
82 #define FIO_SLIST 6 /* one string out of a list, abbr. */
83 #define FIO_CYL 7 /* nblocks, on cylinder boundary */
84 #define FIO_OPINT 8 /* optional integer input */
85 #define FIO_ECYL 9 /* allows end cylinder input */
86 #define FIO_INT64 10 /* Input for EFI partitions */
87 #define FIO_EFI 11 /* Input EFI part size */
90 * Miscellaneous definitions.
92 #define TOKEN_SIZE 36 /* max length of a token */
93 typedef char TOKEN
[TOKEN_SIZE
+1]; /* token type */
94 #define DATA_INPUT 0 /* 2 modes of input */
96 #define WILD_STRING "$" /* wildcard character */
97 #define COMMENT_CHAR '#' /* comment character */
101 * Prototypes for ANSI C
103 char *gettoken(char *inbuf
);
104 void clean_token(char *cleantoken
, char *token
);
105 int geti(char *str
, int *iptr
, int *wild
);
106 uint64_t input(int, char *, int, u_ioparam_t
*, int *, int);
107 int find_value(slist_t
*slist
, char *match_str
, int *match_value
);
108 char *find_string(slist_t
*slist
, int match_value
);
109 void fmt_print(char *format
, ...);
110 void nolog_print(char *format
, ...);
111 void log_print(char *format
, ...);
112 void err_print(char *format
, ...);
113 void print_buf(char *buf
, int nbytes
);
114 void pr_diskline(struct disk_info
*disk
, int num
);
115 void pr_dblock(void (*func
)(char *, ...), diskaddr_t bn
);
116 int sup_gettoken(char *buf
);
117 void sup_pushtoken(char *token_buf
, int token_type
);
118 void get_inputline(char *, int);
119 int istokenpresent(void);
120 int execute_shell(char *, size_t);
121 void print_efi_string(char *vendor
, char *product
, char *revision
,
125 * Most recent token type
127 extern int last_token_type
;