1*43901Sbostic INFORMATION ABOUT ADB INTERNALS 2*43901Sbostic 3*43901Sbostic 23 August 1988, Chris Torek 4*43901Sbostic 5*43901Sbostic (This file is incomplete.) 6*43901Sbostic 7*43901SbosticTYPES 8*43901Sbostic write something here. 9*43901Sbostic 10*43901SbosticFORMATTED OUTPUT 11*43901Sbostic Adb has a simplified, and slightly extended, version of printf, 12*43901Sbosticcalled adbprintf(). adbprintf() conversion specifiers are introduced by 13*43901Sbosticthe usual `%' escape. (Beware of SCCS eating 5 and escapes.) The 14*43901Sbosticformat of a conversion-specifier is: 15*43901Sbostic 16*43901Sbostic [flags] [width] [`.' precision] conversion-character 17*43901Sbostic 18*43901SbosticThe default width is 0; the default precision is -1. The available 19*43901Sbosticflags are `-', for right adjustment within the field, and `+', which 20*43901Sbosticforces a sign on numeric conversions. If the result of a conversion 21*43901Sbosticis narrower than the specified width, it is passed on the right (or 22*43901Sbosticleft if `-') with blanks. If a precision is given, and is not negative, 23*43901Sbosticthe result of a conversion will be truncated after precision characters. 24*43901SbosticWidth and precision may be given as `*', in which case they are taken 25*43901Sbosticfrom an integer argument a la printf(). 26*43901Sbostic 27*43901SbosticThe conversion-characters, and the types they expect, are: 28*43901Sbostic 29*43901Sbostic [numeric] 30*43901Sbostic d prints an hword_t value as a signed decimal integer. 31*43901Sbostic D prints an expr_t value as a signed decimal integer. 32*43901Sbostic u prints an hword_t value as an unsigned decimal integer. 33*43901Sbostic U prints an expr_t value as an unsigned decimal integer. 34*43901Sbostic q prints an hword_t value as a signed octal integer. 35*43901Sbostic Q prints an expr_t value as a signed octal integer. 36*43901Sbostic o prints an hword_t value as an unsigned octal integer. 37*43901Sbostic O prints an expr_t value as an unsigned octal integer. 38*43901Sbostic z prints an hword_t value as a signed hexadecimal integer. 39*43901Sbostic Z prints an expr_t value as a signed hexadecimal integer. 40*43901Sbostic x prints an hword_t value as an unsigned hexadecimal integer. 41*43901Sbostic X prints an expr_t value as an unsigned hexadecimal integer. 42*43901Sbostic r prints an hword_t value in the current radix. 43*43901Sbostic R prints an expr_t value in the current radix. 44*43901Sbostic v prints an hword_t value in signed variant of current radix. 45*43901Sbostic V prints an expr_t value in signed variant of current radix. 46*43901Sbostic 47*43901Sbostic [non-numeric] 48*43901Sbostic c prints a character. 49*43901Sbostic 50*43901Sbostic s prints a string. 51*43901Sbostic 52*43901Sbostic m prints nothing; hence %<width>m prints <width> spaces. 53*43901Sbostic 54*43901Sbostic t prints nothing, but adjusts the width such that it 55*43901Sbostic becomes a tabstop. Thus %24t moves to the next column 56*43901Sbostic that is a multiple of 24, and %8t acts like \t would 57*43901Sbostic if \t were implemented in adb. 58*43901Sbostic 59*43901Sbostic [special] 60*43901Sbostic ? converts an integer value, then applies a second 61*43901Sbostic conversion-specifier. If integer was zero, the 62*43901Sbostic output from the second conversion-specifier is 63*43901Sbostic suppressed. For instance, %?s converts one integer 64*43901Sbostic and one string, and prints the string only if the 65*43901Sbostic integer is nonzero (and the pointer is not evaluated). 66*43901Sbostic Thus `adbprintf("%?s", s!=NULL, s)' prints the string 67*43901Sbostic s if and only if the pointer s is not NULL. `?' 68*43901Sbostic conversions may be nested: ("%??x", a, b, c) prints 69*43901Sbostic c only if both a and b are nonzero. 70