Log In | Not a Member? | Support | |
SYNTAX
Gestalt [selector1] [selector2]… [-addr] [-attr] [-c] [-e] [-env] [-h] DESCRIPTION The Gestalt tool generates numerical codes in response to the specified Gestalt selectors or selector aliases. These selectors correspond to features of the operating environment, allowing you to determine which software and hardware features are available for your program's use. To do this, Gestalt uses the Gestalt Manager, available with System 7. In addition to retrieving Gestalt responses under the default behavior, Gestalt allows you to do such things as • limit selectors to those of a specified type (-addr, -attr, -size, -type, -vers) • retrieve information on all active slots in the target machine (-slots) • change the response output from numerical codes to the number of bits in the responses (-c), hexadecimal numbers (-h), or strings (-s) • change the format of the output to include more information (-k or -sel[ector[s]]) or insert tabs or spaces (-t, -t1, or -w) • use the SysEnvirons function instead of the Gestalt Manager to retrieve information on the specified selectors (-env)
Note INPUT Gestalt selectors or their corresponding aliases (selector1 [selector2]…). OUTPUT Standard output. The Gestalt tool writes each selector's title with its value. You can control the spacing between the value and its title by using -t, -t1, or -w. If you specify one or more selectors (selector), Gestalt provides this information for those selectors only. If you do not specify any selectors, Gestalt generates information on all selectors. If you specify only one selector, Gestalt writes only the value of the specified selector, although you can use -k or -sel[ector[s]] to override this. STATUS
Gestalt can return the following status codes:
PARAMETERS [selector1] [selector2]… Specifies one or more Gestalt selectors or their corresponding aliases. Selectors are case-sensitive four-character strings. If a selector contains fewer than four characters, you must supply blanks to pad the string (for example, 'os '). In addition, each selector has one or more aliases that you can specify instead of the selector. Unlike selectors, these aliases are not case sensitive and are of arbitrary length. The following tables contain a complete list of the selectors and their aliases that are supported by Gestalt. Note that the first alias for each selector is the title used to identify it in the output (see "Output"). Although you can use this alias to specify the selector on the command line, it is suggested that you use one of the other aliases or the selector itself. Table 1: Environmental selectors and their aliases
* See Limitations
* See Limitations OPTIONS -addr Provides information for address selectors only (for example, 'ostt' and 'tbtt'). Normally these responses are given as hexadecimal numbers. -attr Provides information for attribute selectors only. Normally these responses are given as binary numbers. -c Writes the number of bits in a Gestalt response instead of the actual response. This is useful, for example, with attribute selectors. -e Generates an error message and skips the selector if it cannot find a specified selector in its database. Normally Gestalt attempts to retrieve responses for all specified selectors so that they can be modified. -env Uses SysEnvirons function call instead of the Gestalt Manager even if the Gestalt Manager exists on the target machine. -h Writes all Gestalt responses as hexadecimal numbers. For instance, $1234. Normally Gestalt responses vary according to the type of selector being evaluated. Hexadecimal numbers are given for address selectors, binary numbers for attribute selectors, and decimal numbers for size, type, and version selectors. -k Forces Gestalt to write the selector's title along with its value even if you specified only one selector. -p Writes version information along with the tool's regular output, which is selector titles and values, to diagnostic output.
Note -s Writes Gestalt responses as alphanumeric strings instead of numerical codes. This applies only if the specified selectors exist in the tool's database. -sel[ector[s]] Writes the four-character selector along with its title and value in the output. -size Provides information for size selectors only (for example, 'lram' and 'pgsz'). Normally, these responses are given as decimal numbers. -slots Provides Slot Manager information for the cards in all active slots of the target machine. -t n Puts tabs in the output using the specified tab value. This applies only if Gestalt generates a title and value for each response and if diagnostic output is not the same as standard output. -type
Provides information for type selectors only (for example, 'fpu ' and -t1 n Inserts one tab of tab value n between the title and its value. This applies only if Gestalt generates a title and value for each response and if diagnostic output is not the same as standard output. -vers Provides information for version selectors only (for example 'sysv' and 'romv'). Normally, these responses are given as decimal numbers. -w n Writes the title as a field of fixed width n, starting at the beginning of the title. This produces trailing blanks before the value, which you can change to tabs by using -t. Note that the default for n is 24. EXAMPLES The following command line names the machine on which the Gestalt tool is running: Gestalt machine -s In the case of a Macintosh IIci, Gestalt writes the following string to standard output: IIci The following command line performs the same function as the previous example, except that the output appears in a different format: Gestalt Machine Instead of writing the output as a string, Gestalt writes the response as a numeric code. For a Macintosh II, Gestalt produces the response: 6 This example uses the Gestalt tool in conjunction with other strings to concatenate the proper ROM map in the MPW folder {MPW}Rom Maps to a previously generated Linker output file called LinkMap : Catenate "{MPW}ROM Maps:Mac`Gestalt 'mach' -s`ROM.map" >> LinkMap When executed on a Macintosh IIci, the script generates a filename of {MPW}ROM Maps:MacIIciROM.map Note that this command would usually be placed in a makefile when using performance measurement tools. On systems that do not support the Gestalt Manager, Gestalt attempts to call SysEnvirons; however, SysEnvirons supports only a small subset of the possible selectors. In Table 1 and Table 2 selectors supported by SysEnvirons are marked * at the right edge of the table. Note that you can use -env to force Gestalt to use the SysEnvirons function even when the Gestalt Manager is available. SEE ALSO The discussion of the Gestalt Manager in Inside Macintosh
|