]>
git.saurik.com Git - apple/boot.git/blob - i386/testmodule/install/mode.c
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.1 (the "License"). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
14 * The Original Code and all software distributed under the License are
15 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
22 * @APPLE_LICENSE_HEADER_END@
28 void install_enterInstallMode(void)
30 int answer
, count
, size
;
31 char *LanguageTable
, *val
;
32 char *LoadableFamilies
;
34 /* Load language choice table */
35 loadConfigFile("/usr/standalone/i386/Language.table",
38 /* Get language choices. */
40 getValueForStringTableKey(
41 LanguageTable
, "Languages", &val
, &count
))
43 char *string
, *languages
[16], *language_strings
[16];
46 while (string
= (char *)newStringFromList(&val
, &count
)) {
47 languages
[nlang
] = string
;
48 language_strings
[nlang
++] = (char *)
49 newStringForStringTableKey(
50 LanguageTable
, string
);
53 for(answer
= -1; answer
== -1;) {
54 install_clearScreen();
55 answer
= install_choose(language_strings
, nlang
,
58 setLanguage(languages
[answer
- 1]);
60 zfree(language_strings
[nlang
--]);
61 /* Don't bother freeing the language names. */
65 printf("Could not load language choice file; "
66 "defaulting to English.\n");
67 setLanguage("English");
70 /* Now save the language in the "Language" key,
71 * which has cleverly been made large for us.
73 if (getValueForKey("Language", &val
, &size
)) {
74 char *Language
= getLanguage();
75 if ((strlen(Language
)+2) < size
) {
76 strcpy(val
, Language
);
77 val
+= strlen(Language
);
81 size
-= strlen(Language
) + 1;
87 /* Now limit the families we look for when considering
88 * drivers during installation.
90 if (getValueForKey("Installation Driver Families",
92 LoadableFamilies
= zalloc(size
+1);
93 strncpy(LoadableFamilies
,val
,size
);