19428323dSchristos // 29428323dSchristos // io.h - simple io and input parsing routines 39428323dSchristos // 49428323dSchristos // Written by Eryk Vershen 59428323dSchristos // 69428323dSchristos 79428323dSchristos /* 89428323dSchristos * Copyright 1996,1997,1998 by Apple Computer, Inc. 99428323dSchristos * All Rights Reserved 109428323dSchristos * 119428323dSchristos * Permission to use, copy, modify, and distribute this software and 129428323dSchristos * its documentation for any purpose and without fee is hereby granted, 139428323dSchristos * provided that the above copyright notice appears in all copies and 149428323dSchristos * that both the copyright notice and this permission notice appear in 159428323dSchristos * supporting documentation. 169428323dSchristos * 179428323dSchristos * APPLE COMPUTER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE 189428323dSchristos * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 199428323dSchristos * FOR A PARTICULAR PURPOSE. 209428323dSchristos * 219428323dSchristos * IN NO EVENT SHALL APPLE COMPUTER BE LIABLE FOR ANY SPECIAL, INDIRECT, OR 229428323dSchristos * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 239428323dSchristos * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT, 249428323dSchristos * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 259428323dSchristos * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 269428323dSchristos */ 279428323dSchristos 289428323dSchristos #ifndef __io__ 299428323dSchristos #define __io__ 309428323dSchristos 319428323dSchristos 329428323dSchristos // 339428323dSchristos // Defines 349428323dSchristos // 359428323dSchristos #define MAXIOSIZE 2048 369428323dSchristos 379428323dSchristos 389428323dSchristos // 399428323dSchristos // Types 409428323dSchristos // 419428323dSchristos 429428323dSchristos 439428323dSchristos // 449428323dSchristos // Global Constants 459428323dSchristos // 469428323dSchristos extern const long kDefault; 479428323dSchristos 489428323dSchristos 499428323dSchristos // 509428323dSchristos // Global Variables 519428323dSchristos // 529428323dSchristos 539428323dSchristos 549428323dSchristos // 559428323dSchristos // Forward declarations 569428323dSchristos // 57*48a628aeSchristos void bad_input(const char *fmt, ...) __printflike(1, 2); 589428323dSchristos void flush_to_newline(int keep_newline); 59*48a628aeSchristos int get_command(const char *prompt, int promptBeforeGet, int *command); 60*48a628aeSchristos uint32_t get_multiplier(long divisor); 61*48a628aeSchristos int get_number_argument(const char *prompt, long *number, long default_value); 62*48a628aeSchristos int get_okay(const char *prompt, int default_value); 639428323dSchristos int get_partition_modifier(void); 64*48a628aeSchristos int get_string_argument(const char *prompt, char **string, int reprompt); 65*48a628aeSchristos int number_of_digits(uint32_t value); 669428323dSchristos 679428323dSchristos #endif /* __io__ */ 68