home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3s / printf.z / printf
Encoding:
Text File  |  2002-10-03  |  30.7 KB  |  461 lines

  1.  
  2.  
  3.  
  4. pppprrrriiiinnnnttttffff((((3333SSSS))))                                                          pppprrrriiiinnnnttttffff((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _pppp_rrrr_iiii_nnnn_tttt_ffff, _ffff_pppp_rrrr_iiii_nnnn_tttt_ffff, _ssss_nnnn_pppp_rrrr_iiii_nnnn_tttt_ffff, _ssss_pppp_rrrr_iiii_nnnn_tttt_ffff - print formatted output
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_tttt_dddd_iiii_oooo_...._hhhh_>>>>
  13.      _iiii_nnnn_tttt _pppp_rrrr_iiii_nnnn_tttt_ffff_((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_ffff_oooo_rrrr_mmmm_aaaa_tttt_,,,, _...._...._...._////_**** _aaaa_rrrr_gggg_ssss _****_////_))))_;;;;
  14.      _iiii_nnnn_tttt _ffff_pppp_rrrr_iiii_nnnn_tttt_ffff_((((_FFFF_IIII_LLLL_EEEE _****_ssss_tttt_rrrr_mmmm_,,,, _cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_ffff_oooo_rrrr_mmmm_aaaa_tttt_,,,, _...._...._...._////_**** _aaaa_rrrr_gggg_ssss _****_////_))))_;;;;
  15.      _iiii_nnnn_tttt _ssss_nnnn_pppp_rrrr_iiii_nnnn_tttt_ffff_((((_cccc_hhhh_aaaa_rrrr _****_ssss_,,,, _ssss_iiii_zzzz_eeee______tttt _llll_eeee_nnnn_,,,, _cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_ffff_oooo_rrrr_mmmm_aaaa_tttt_,,,, _...._...._...._////_**** _aaaa_rrrr_gggg_ssss _****_////_))))_;;;;
  16.      _iiii_nnnn_tttt _ssss_pppp_rrrr_iiii_nnnn_tttt_ffff_((((_cccc_hhhh_aaaa_rrrr _****_ssss_,,,, _cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_ffff_oooo_rrrr_mmmm_aaaa_tttt_,,,, _...._...._...._////_**** _aaaa_rrrr_gggg_ssss _****_////_))))_;;;;
  17.  
  18. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.      _pppp_rrrr_iiii_nnnn_tttt_ffff places output on the standard output stream _ssss_tttt_dddd_oooo_uuuu_tttt.
  20.  
  21.      _ffff_pppp_rrrr_iiii_nnnn_tttt_ffff places output on _s_t_r_m.
  22.  
  23.      _ssss_pppp_rrrr_iiii_nnnn_tttt_ffff places output, followed by a null character (_\\\\_0000), in consecutive
  24.      bytes starting at _s.  It is the user's responsibility to ensure that
  25.      enough storage is available.
  26.  
  27.      _ssss_nnnn_pppp_rrrr_iiii_nnnn_tttt_ffff places output, followed by a null character (_\\\\_0000), in consecutive
  28.      bytes starting at _s.  If more than _l_e_n bytes of output would be
  29.      generated, the output is truncated at _l_e_n bytes, including the trailing
  30.      null character.
  31.  
  32.      Each function returns the number of characters transmitted (not including
  33.      the terminating null character in the case of _ssss_nnnn_pppp_rrrr_iiii_nnnn_tttt_ffff and _ssss_pppp_rrrr_iiii_nnnn_tttt_ffff) or a
  34.      negative value if an output error was encountered.  If _ssss_nnnn_pppp_rrrr_iiii_nnnn_tttt_ffff is used
  35.      in strict Unix98 compliance mode (_XOPEN_SOURCE >= 500) and more than len
  36.      bytes of output would be generated, the return value will be the number
  37.      of bytes that would be written to _s had _l_e_n been sufficiently large (not
  38.      including the terminating null character.)
  39.  
  40.      Each of these functions converts, formats, and prints its _a_r_g_s under
  41.      control of the _f_o_r_m_a_t.  The results are undefined if there are
  42.      insufficient arguments for the format.  If the format is exhausted while
  43.      arguments remain, the excess arguments are simply ignored.  The _f_o_r_m_a_t is
  44.      a character string that contains two types of objects defined below:
  45.  
  46.           1.  plain characters that are simply copied to the output stream;
  47.  
  48.           2.  conversion specifications.
  49.  
  50.      All forms of the _pppp_rrrr_iiii_nnnn_tttt_ffff functions allow for the insertion of a language-
  51.      dependent decimal-point character.  The decimal-point character is
  52.      defined by the program's locale (category _LLLL_CCCC______NNNN_UUUU_MMMM_EEEE_RRRR_IIII_CCCC).  In the _""""_CCCC_""""
  53.      locale, or in a locale where the decimal-point character is not defined,
  54.      the decimal-point character defaults to a period (_....).
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                                                                         PPPPaaaaggggeeee 1111
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68. pppprrrriiiinnnnttttffff((((3333SSSS))))                                                          pppprrrriiiinnnnttttffff((((3333SSSS))))
  69.  
  70.  
  71.  
  72.      Each conversion specification is introduced by the character _%%%%, and takes
  73.      the following general form and sequence:
  74.  
  75.           _%%%%[_p_o_s_p_$$$$][_f_l_a_g_s][_w_i_d_t_h][_...._p_r_e_c_i_s_i_o_n][_s_i_z_e]_f_m_t
  76.  
  77.      _p_o_s_p_$$$$ An optional entry, consisting of one or more decimal digits
  78.            followed by a _$$$$ character, specifying the number of the next _a_r_g to
  79.            access.  The first _a_r_g (just after _f_o_r_m_a_t) is numbered 1.  If this
  80.            field is not specified, the _a_r_g following the most recently used
  81.            _a_r_g will be used.
  82.  
  83.      _f_l_a_g_s Zero or more characters that modify the meaning of the conversion
  84.            specification.  The _f_l_a_g characters and their meanings are:
  85.  
  86.            _''''    The integer portion of the result of a decimal conversion (for
  87.                 _bbbb, _BBBB, _iiii, _dddd, _uuuu, _ffff, _gggg, or _GGGG conversions) will be formatted with
  88.                 the thousands' grouping characters.  The non-monetary grouping
  89.                 character will be used.
  90.  
  91.            _----    The result of the conversion will be left-justified within the
  92.                 field.  (It will be right-justified if this flag is not
  93.                 specified.)
  94.  
  95.            _++++    The result of a signed conversion will always begin with a
  96.                 sign (+ or -).  (It will begin with a sign only when a
  97.                 negative value is converted if this flag is not specified.)
  98.  
  99.            _s_p_a_c_e
  100.                 If the first character of a signed conversion is not a sign,
  101.                 or if a signed conversion results in no characters, a space
  102.                 will be prefixed to the result.  If the _s_p_a_c_e and + flags both
  103.                 appear, the _s_p_a_c_e flag will be ignored.
  104.  
  105.            _####    The value is to be converted to an alternate form.  For an _oooo
  106.                 conversion, it increases the precision (if necessary) to force
  107.                 the first digit of the result to be a zero.  For _xxxx (or _XXXX)
  108.                 conversion, a nonzero result will have _0000_xxxx (or _0000_XXXX) prefixed to
  109.                 it.  For _bbbb, _BBBB, _eeee, _EEEE, _ffff, _gggg, and _GGGG conversions, the result will
  110.                 always contain a decimal-point character, even if no digits
  111.                 follow it.  (Normally, a decimal point appears in the result
  112.                 of these conversions only if a digit follows it.)  For _gggg and _GGGG
  113.                 conversions, trailing zeros will not be removed from the
  114.                 result (as they normally are).  For _cccc, _dddd, _iiii, _ssss, and _uuuu
  115.                 conversions, the flag has no effect.
  116.  
  117.            _0000    For _bbbb, _BBBB, _dddd, _iiii, _oooo, _uuuu, _xxxx, _XXXX, _eeee, _EEEE, _ffff, _gggg, and _GGGG conversions,
  118.                 leading zeros (following any indication of sign or base) are
  119.                 used to pad to the field width; no space padding is performed.
  120.                 If the _0000 and _---- flags both appear, the _0000 flag will be ignored.
  121.                 For _dddd, _iiii, _oooo, _uuuu, _xxxx, and _XXXX conversions, if a precision is
  122.                 specified, the _0000 flag will be ignored.  For other conversions,
  123.                 the behavior is undefined.
  124.  
  125.  
  126.  
  127.                                                                         PPPPaaaaggggeeee 2222
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134. pppprrrriiiinnnnttttffff((((3333SSSS))))                                                          pppprrrriiiinnnnttttffff((((3333SSSS))))
  135.  
  136.  
  137.  
  138.      _w_i_d_t_h An optional entry that consists of either one or more decimal
  139.            digits, or an asterisk (_****), or an asterisk followed by one or more
  140.            decimal digits and a _$$$$.  It specifies the minimum field width:  If
  141.            the converted value has fewer characters than the field width, it
  142.            will be padded (with space by default) on the left or right (see
  143.            the above _f_l_a_g_s description) to the field width.
  144.  
  145.      _...._p_r_e_c An optional entry that consists of a period (_....) followed by either
  146.            zero or more decimal digits, or an asterisk (_****), or an asterisk
  147.            followed by one or more decimal digits and a _$$$$.  It specifies the
  148.            minimum number of digits to appear for the _dddd, _iiii, _oooo, _uuuu, _xxxx, and _XXXX
  149.            conversions, the number of digits to appear after the decimal-point
  150.            character for the _bbbb, _BBBB, _eeee, _EEEE, and _ffff conversions, the maximum number
  151.            of significant digits for the _gggg and _GGGG conversions, or the maximum
  152.            number of characters to be written from a string for an _ssss
  153.            conversion.  For other conversions, the behavior is undefined.  If
  154.            only a period is specified, the precision is taken as zero.
  155.  
  156.      _s_i_z_e  An optional _hhhh, _llll (ell), _llll_llll (ell ell), or _LLLL that specifies other
  157.            than the default argument type of _iiii_nnnn_tttt for _dddd and _iiii; _uuuu_nnnn_ssss_iiii_gggg_nnnn_eeee_dddd _iiii_nnnn_tttt for
  158.            _oooo, _uuuu, _xxxx, and _XXXX; pointer to _iiii_nnnn_tttt for _nnnn; and _dddd_oooo_uuuu_bbbb_llll_eeee for _bbbb, _BBBB, _eeee, _EEEE, _ffff,
  159.            _gggg, and _GGGG.  If a _s_i_z_e appears other than in the following
  160.            combinations, the behavior is undefined.
  161.  
  162.            _hhhh    For _nnnn, the argument has type pointer to _ssss_hhhh_oooo_rrrr_tttt _iiii_nnnn_tttt; for _dddd and
  163.                 _iiii, _ssss_hhhh_oooo_rrrr_tttt _iiii_nnnn_tttt; and for _oooo, _uuuu, _xxxx, and _XXXX, _uuuu_nnnn_ssss_iiii_gggg_nnnn_eeee_dddd _ssss_hhhh_oooo_rrrr_tttt _iiii_nnnn_tttt.
  164.                 (For _dddd, _iiii, _oooo, _uuuu, _xxxx, and _XXXX, the argument will have been
  165.                 promoted according to the integral promotions, and its value
  166.                 will be narrowed to _ssss_hhhh_oooo_rrrr_tttt or _uuuu_nnnn_ssss_iiii_gggg_nnnn_eeee_dddd _ssss_hhhh_oooo_rrrr_tttt before printing.)
  167.  
  168.            _llll    For _nnnn, the argument has type pointer to _llll_oooo_nnnn_gggg _iiii_nnnn_tttt; for _dddd and _iiii,
  169.                 _llll_oooo_nnnn_gggg _iiii_nnnn_tttt; and for _oooo, _uuuu, _xxxx, and _XXXX, _uuuu_nnnn_ssss_iiii_gggg_nnnn_eeee_dddd _llll_oooo_nnnn_gggg _iiii_nnnn_tttt.
  170.  
  171.            _llll_llll   For _nnnn, the argument has type pointer to _llll_oooo_nnnn_gggg _llll_oooo_nnnn_gggg _iiii_nnnn_tttt; for _dddd
  172.                 and _iiii, _llll_oooo_nnnn_gggg _llll_oooo_nnnn_gggg _iiii_nnnn_tttt; and for _oooo, _uuuu, _xxxx, and _XXXX, _uuuu_nnnn_ssss_iiii_gggg_nnnn_eeee_dddd _llll_oooo_nnnn_gggg
  173.                 _llll_oooo_nnnn_gggg _iiii_nnnn_tttt.
  174.  
  175.            _LLLL    For _bbbb, _BBBB, _eeee, _EEEE, _ffff, _gggg, and _GGGG, the argument has type _llll_oooo_nnnn_gggg
  176.                 _dddd_oooo_uuuu_bbbb_llll_eeee.
  177.  
  178.      _f_m_t   A conversion character (described below) that indicates the type of
  179.            conversion to be applied.
  180.  
  181.      When a _w_i_d_t_h or _...._p_r_e_c includes an asterisk (_****), an _iiii_nnnn_tttt _a_r_g supplies the
  182.      width or precision.  When they do not include a _$$$$, the arguments
  183.      specifying a field width, or precision, or both must appear (in that
  184.      order) before the argument (if any) to be converted.  If the conversion
  185.      specification includes _p_o_s_p_$$$$, the field width and precision may include a
  186.      _$$$$.  The decimal digits that precede the _$$$$ similarly specify the number of
  187.      the _a_r_g that contains the field width or precision.  (In this case, _p_o_s_p_$$$$
  188.      specifies the number of the _a_r_g to convert.)  A negative field width
  189.      argument is taken as a _---- flag followed by a positive field width.  If the
  190.  
  191.  
  192.  
  193.                                                                         PPPPaaaaggggeeee 3333
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200. pppprrrriiiinnnnttttffff((((3333SSSS))))                                                          pppprrrriiiinnnnttttffff((((3333SSSS))))
  201.  
  202.  
  203.  
  204.      precision argument is negative, it will be taken as zero.
  205.  
  206.      When numbered argument specifications are used, specifying the _Nth
  207.      argument requires that all the leading arguments, from the first to the
  208.      (_N-1)th, be specified at least once, in a consistent manner, in the
  209.      format string.
  210.  
  211.      The conversion characters and their meanings are:
  212.  
  213.      _bbbb, _BBBB      The floating _a_r_g is first converted to human readable byte
  214.                counts.  _A_r_g is repeatedly divided by 1024 (_%%%%_bbbb) or 1000 (_%%%%_BBBB)
  215.                until the value is less than 1000.  The value is then printed
  216.                as with the _%%%%_ffff format except that there is a one character
  217.                postfix of ' ', _KKKK, _MMMM, _GGGG, _TTTT, _PPPP, _EEEE, _ZZZZ, or _YYYY.  The postfix is
  218.                lower case for _%%%%_bbbb and upper case for _%%%%_BBBB.  The postfix tag
  219.                corresponds to bytes, kilobytes, megabytes, gigabytes, etc.
  220.                The definition of kilobyte is 2^10 for _%%%%_bbbb and 10^3 for _%%%%_BBBB, the
  221.                definition of megabyte is 2^20 for _%%%%_bbbb and 10^6 for _%%%%_BBBB, and so
  222.                on.  The full table is:
  223.  
  224.                _%%%%_bbbb   _MMMM_uuuu_llll_tttt_iiii_pppp_llll_iiii_eeee_rrrr     _FFFF_rrrr_oooo_mmmm     _%%%%_BBBB    _MMMM_uuuu_llll_tttt_iiii_pppp_llll_iiii_eeee_rrrr
  225.                _----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----_----
  226.                _'''' _''''    _1111                     _'''' _''''     _1111
  227.                 _kkkk     _2222_^^^^_1111_0000 _((((_1111_0000_2222_4444_))))  _kkkk_iiii_llll_oooo      _KKKK      _1111_0000_^^^^_3333 _((((_1111_0000_0000_0000_))))
  228.                 _mmmm     _2222_^^^^_2222_0000         _mmmm_eeee_gggg_aaaa      _MMMM      _1111_0000_^^^^_6666
  229.                 _gggg     _2222_^^^^_3333_0000         _gggg_iiii_gggg_aaaa      _GGGG      _1111_0000_^^^^_9999
  230.                 _tttt     _2222_^^^^_4444_0000         _tttt_eeee_rrrr_aaaa      _TTTT      _1111_0000_^^^^_1111_2222
  231.                 _pppp     _2222_^^^^_5555_0000         _pppp_eeee_tttt_aaaa      _PPPP      _1111_0000_^^^^_1111_5555
  232.                 _eeee     _2222_^^^^_6666_0000         _eeee_xxxx_aaaa       _EEEE      _1111_0000_^^^^_1111_8888
  233.                 _zzzz     _2222_^^^^_7777_0000         _zzzz_eeee_tttt_tttt_aaaa     _ZZZZ      _1111_0000_^^^^_2222_1111
  234.                 _yyyy     _2222_^^^^_8888_0000         _yyyy_oooo_tttt_tttt_aaaa     _YYYY      _1111_0000_^^^^_2222_4444
  235.  
  236.  
  237.                The default precision is 3, i.e., 1024 printed with _%%%%_bbbb is
  238.                printed as if it were _%%%%_...._3333_ffff_kkkk and will yield _1111_...._0000_0000_0000_kkkk.
  239.  
  240.      _dddd, _iiii      The integer _a_r_g is converted to signed decimal.  The precision
  241.                specifies the minimum number of digits to appear; if the value
  242.                being converted can be represented in fewer digits, it will be
  243.                expanded with leading zeros.  The default precision is 1.  The
  244.                result of converting a zero value with a precision of zero is
  245.                no characters.
  246.  
  247.      _oooo, _uuuu, _xxxx, _XXXX
  248.                The unsigned integer _a_r_g is converted to unsigned octal (_oooo),
  249.                unsigned decimal (_uuuu), or unsigned hexadecimal notation (_xxxx and
  250.                _XXXX).  The _xxxx conversion uses the letters _aaaa_bbbb_cccc_dddd_eeee_ffff and the _XXXX
  251.                conversion uses the letters _AAAA_BBBB_CCCC_DDDD_EEEE_FFFF.  The precision specifies
  252.                the minimum number of digits to appear; if the value being
  253.                converted can be represented in fewer digits, it will be
  254.                expanded with leading zeros.  The default precision is 1.  The
  255.                result of converting a zero value with a precision of zero is
  256.  
  257.  
  258.  
  259.                                                                         PPPPaaaaggggeeee 4444
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266. pppprrrriiiinnnnttttffff((((3333SSSS))))                                                          pppprrrriiiinnnnttttffff((((3333SSSS))))
  267.  
  268.  
  269.  
  270.                no characters.
  271.  
  272.      _ffff         The floating _a_r_g is converted to decimal notation in the style
  273.                _[[[[_----_]]]]_d_d_d_...._d_d_d, where the number of digits after the decimal-point
  274.                character [see _ssss_eeee_tttt_llll_oooo_cccc_aaaa_llll_eeee(3C)] is equal to the precision
  275.                specification.  If the precision is missing, it is taken as 6;
  276.                if the precision is zero and the _#### flag is not specified, no
  277.                decimal-point character appears.  If a decimal-point character
  278.                appears, at least one digit appears before it.  The value is
  279.                rounded to the appropriate number of digits.
  280.  
  281.      _eeee, _EEEE      The floating _a_r_g is converted to the style _[[[[_----_]]]]_d_...._d_d_d_eeee+__d_d, where
  282.                there is one digit before the decimal-point character (which is
  283.                nonzero if the argument is nonzero) and the number of digits
  284.                after it is equal to the precision.  If the precision is
  285.                missing, it is taken as 6; if the precision is zero and the _####
  286.                flag is not specified, no decimal-point character appears.  The
  287.                value is rounded to the appropriate number of digits.  The _EEEE
  288.                conversion character will produce a number with _EEEE instead of _eeee
  289.                introducing the exponent.  The exponent always contains at
  290.                least two digits.  If the value is zero, the exponent is zero.
  291.  
  292.      _gggg, _GGGG      The floating _a_r_g is converted in style _ffff or _eeee (or in style _EEEE in
  293.                the case of a _GGGG conversion character), with the precision
  294.                specifying the number of significant digits.  If the precision
  295.                is zero, it is taken as one.  The style used depends on the
  296.                value converted; style _eeee (or _EEEE) will be used only if the
  297.                exponent resulting from the conversion is less than -4 or
  298.                greater than or equal to the precision.  Trailing zeros are
  299.                removed from the fractional part of the result; a decimal-point
  300.                character appears only if it is followed by a digit.
  301.  
  302.      _cccc         The integer _a_r_g is converted to an _uuuu_nnnn_ssss_iiii_gggg_nnnn_eeee_dddd _cccc_hhhh_aaaa_rrrr, and the
  303.                resulting character is written.
  304.  
  305.      _CCCC         _a_r_g is interpreted as a _wwww_cccc_hhhh_aaaa_rrrr______tttt, converted to a multi-byte
  306.                sequence, and the resulting byte(s) are written.
  307.  
  308.      _ssss         The _a_r_g is taken to be a pointer to an array of characters.
  309.                Characters from the array are written up to (but not including)
  310.                a terminating null character; if a precision is specified, no
  311.                more than that many characters are written.  If a precision is
  312.                not specified or is greater than the size of the array, the
  313.                array must contain a terminating null character.  (A null
  314.                pointer for _a_r_g will yield undefined results.)
  315.  
  316.      _SSSS         The _a_r_g is taken to be a pointer to an array of wide characters
  317.                (_wwww_cccc_hhhh_aaaa_rrrr______tttt).  Each character from the array is converted to a
  318.                multi-byte sequence and the resulting byte(s) are written.
  319.                Conversion stops when there is a null wide character in the
  320.                array.  If a precision is specified, no more than that many
  321.                characters are written.  If a precision is not specified or is
  322.  
  323.  
  324.  
  325.                                                                         PPPPaaaaggggeeee 5555
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332. pppprrrriiiinnnnttttffff((((3333SSSS))))                                                          pppprrrriiiinnnnttttffff((((3333SSSS))))
  333.  
  334.  
  335.  
  336.                greater than the size of the array, the array must contain a
  337.                terminating null character.  (A null pointer for _a_r_g will yield
  338.                undefined results.)
  339.  
  340.      _pppp         The _a_r_g is taken to be a pointer to _vvvv_oooo_iiii_dddd.  The value of the
  341.                pointer is converted to an implementation-defined sequence of
  342.                printable characters, which matches those read by the _%%%%_pppp
  343.                conversion of the _ssss_cccc_aaaa_nnnn_ffff function.
  344.  
  345.      _nnnn         The _a_r_g is taken to be a pointer to an integer into which is
  346.                written the number of characters written so far by this call to
  347.                _pppp_rrrr_iiii_nnnn_tttt_ffff, _ffff_pppp_rrrr_iiii_nnnn_tttt_ffff, _ssss_nnnn_pppp_rrrr_iiii_nnnn_tttt_ffff, or _ssss_pppp_rrrr_iiii_nnnn_tttt_ffff.  No argument is
  348.                converted.
  349.  
  350.      _%%%%         Print a _%%%%; no argument is converted.  The complete
  351.                specification must be simply _%%%%_%%%%.
  352.  
  353.      If the form of the conversion specification does not match any of the
  354.      above, the results of the conversion are undefined.  Similarly, the
  355.      results are undefined if there are insufficient _a_r_g_s for the format.  If
  356.      the format is exhausted while _a_r_g_s remain, the excess _a_r_g_s are ignored.
  357.  
  358.      If a floating-point value is the internal representation for infinity,
  359.      the output is [+_]_i_n_f, where _i_n_f is either _iiii_nnnn_ffff or _IIII_NNNN_FFFF, depending on
  360.      whether the conversion character is lowercase or uppercase.  Printing of
  361.      the sign follows the rules described above.
  362.  
  363.      If a floating-point value is the internal representation for ``not-a-
  364.      number,'' the output is [+_]_n_a_n_0000_x_m.  Depending on the conversion
  365.      character, _n_a_n is either _nnnn_aaaa_nnnn or _NNNN_AAAA_NNNN.  Additionally, _0000_x_m represents the
  366.      most significant part of the mantissa.  Again depending on the conversion
  367.      character, _x will be _xxxx or _XXXX, and _m will use the letters _aaaa_bbbb_cccc_dddd_eeee_ffff or _AAAA_BBBB_CCCC_DDDD_EEEE_FFFF.
  368.      Printing of the sign follows the rules described above.
  369.  
  370.      In no case does a nonexistent or small field width cause truncation of a
  371.      field; if the result of a conversion is wider than the field width, the
  372.      field is expanded to contain the conversion result.  Characters generated
  373.      by _pppp_rrrr_iiii_nnnn_tttt_ffff and _ffff_pppp_rrrr_iiii_nnnn_tttt_ffff are printed as if the _pppp_uuuu_tttt_cccc routine had been called
  374.      repeatedly.
  375.  
  376. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  377.      To print a date and time in the form ``Sunday, July 3, 10:02,'' where
  378.      _wwww_eeee_eeee_kkkk_dddd_aaaa_yyyy and _mmmm_oooo_nnnn_tttt_hhhh are pointers to null-terminated strings:
  379.  
  380.           _pppp_rrrr_iiii_nnnn_tttt_ffff_((((_""""_%%%%_ssss_,,,, _%%%%_ssss _%%%%_iiii_,,,, _%%%%_dddd_::::_%%%%_...._2222_dddd_""""_,,,,
  381.                   _wwww_eeee_eeee_kkkk_dddd_aaaa_yyyy_,,,, _mmmm_oooo_nnnn_tttt_hhhh_,,,, _dddd_aaaa_yyyy_,,,, _hhhh_oooo_uuuu_rrrr_,,,, _mmmm_iiii_nnnn_))))_;;;;
  382.  
  383.      To print pi to 5 decimal places:
  384.  
  385.           _pppp_rrrr_iiii_nnnn_tttt_ffff_((((_""""_pppp_iiii _==== _%%%%_...._5555_ffff_""""_,,,, _4444 _**** _aaaa_tttt_aaaa_nnnn_((((_1111_...._0000_))))_))))_;;;;
  386.  
  387.  
  388.  
  389.  
  390.  
  391.                                                                         PPPPaaaaggggeeee 6666
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398. pppprrrriiiinnnnttttffff((((3333SSSS))))                                                          pppprrrriiiinnnnttttffff((((3333SSSS))))
  399.  
  400.  
  401.  
  402.      The following two calls to _pppp_rrrr_iiii_nnnn_tttt_ffff both produce the same result of
  403.      _1111_0000 _1111_0000 _0000_0000_3333_0000_0000 _1111_0000:
  404.  
  405.           _pppp_rrrr_iiii_nnnn_tttt_ffff_((((_""""_%%%%_dddd _%%%%_1111_$$$$_dddd _%%%%_...._****_dddd _%%%%_1111_$$$$_dddd_""""_,,,, _1111_0000_,,,, _5555_,,,, _3333_0000_0000_))))_;;;;
  406.           _pppp_rrrr_iiii_nnnn_tttt_ffff_((((_""""_%%%%_dddd _%%%%_1111_$$$$_dddd _%%%%_3333_$$$$_...._****_2222_$$$$_dddd _%%%%_1111_$$$$_dddd_""""_,,,, _1111_0000_,,,, _5555_,,,, _3333_0000_0000_))))_;;;;
  407.  
  408. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  409.      _eeee_xxxx_iiii_tttt(2), _llll_ssss_eeee_eeee_kkkk(2), _wwww_rrrr_iiii_tttt_eeee(2), _aaaa_bbbb_oooo_rrrr_tttt(3C), _eeee_cccc_vvvv_tttt(3C), _ssss_eeee_tttt_llll_oooo_cccc_aaaa_llll_eeee(3C),
  410.      _pppp_uuuu_tttt_cccc(3S), _ssss_cccc_aaaa_nnnn_ffff(3S), _ssss_tttt_dddd_iiii_oooo(3S).
  411.  
  412. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  413.      _pppp_rrrr_iiii_nnnn_tttt_ffff, _ffff_pppp_rrrr_iiii_nnnn_tttt_ffff, _ssss_nnnn_pppp_rrrr_iiii_nnnn_tttt_ffff, and _ssss_pppp_rrrr_iiii_nnnn_tttt_ffff return the number of characters
  414.      transmitted (not counting the terminating null character for _ssss_nnnn_pppp_rrrr_iiii_nnnn_tttt_ffff and
  415.      _ssss_pppp_rrrr_iiii_nnnn_tttt_ffff), or return a negative value if an error was encountered.
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.                                                                         PPPPaaaaggggeeee 7777
  458.  
  459.  
  460.  
  461.