Use the type command to display the type of an expression or the declared type of a symbol. Using the declare and undeclare commands to display the type modified or reset:
type expression /* Show type of expression */ declare C declaration... /* Give a system variable a type */ undeclare [*|variables...] /* Undeclare system variables */It can be useful to determine the type of an expression in case there is some question. For instance, if a symbol is not in the varidef file, it will hold a default type:
debug0:1>If it is in the varidef file, it is shown with the proper type:
type u"u" is int
debug0:2>If the type of a symbol is not included in the varidef file and it would be useful to use the symbol properly, use the declare command to override the original type assigned to the symbol:
type u"u" is struct user
debug0:3>It is not necessary to specify number of elements when declaring an array.
type cdevsw"cdevsw" is int debug0:4>
declare struct cdevsw cdevsw[3C]debug0:5>
type cdevsw"cdevsw" is struct cdevsw [3C]
Use undeclare to return the type of a symbol to its original state, if it is not in the varidef file:
debug0:6>This is usually done to free space in the declaration table.
type cdevsw"cdevsw" is int
undeclare can also be used to prevent SCODB from printing the return value after a function call. For example:
debug0:8>The same effect can be made more permanent by placing a void definition of the function in the SCODB extra file.
declare void patch_nop()debug0:10>