Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Version bump. | Eric S. Raymond | 1999-09-29 | 1 | -2/+2 |
| | | | | svn path=/trunk/; revision=2622 | ||||
* | Tolerate more than one authorization failure. | Eric S. Raymond | 1999-09-28 | 1 | -1/+3 |
| | | | | svn path=/trunk/; revision=2621 | ||||
* | Fix a logfile dump bug. | Eric S. Raymond | 1999-09-27 | 1 | -1/+2 |
| | | | | svn path=/trunk/; revision=2614 | ||||
* | Prevent Pehr Anderson's goof. | Eric S. Raymond | 1999-09-26 | 1 | -9/+2 |
| | | | | svn path=/trunk/; revision=2613 | ||||
* | WEe have as much size info as we're going to get. | Eric S. Raymond | 1999-09-25 | 1 | -10/+10 |
| | | | | svn path=/trunk/; revision=2605 | ||||
* | Added line counts. | Eric S. Raymond | 1999-09-25 | 1 | -121/+123 |
| | | | | svn path=/trunk/; revision=2604 | ||||
* | Plotting is working pretty well. | Eric S. Raymond | 1999-09-24 | 1 | -32/+32 |
| | | | | svn path=/trunk/; revision=2601 | ||||
* | Low-level corrections. | Eric S. Raymond | 1999-09-23 | 1 | -0/+1 |
| | | | | svn path=/trunk/; revision=2593 | ||||
* | Czech internationalization update. | Eric S. Raymond | 1999-09-23 | 1 | -2/+2 |
| | | | | svn path=/trunk/; revision=2589 | ||||
* | Canonicalize both name and password. | Eric S. Raymond | 1999-09-23 | 1 | -0/+1 |
| | | | | svn path=/trunk/; revision=2588 | ||||
* | Workaround for GroupWise. | Eric S. Raymond | 1999-09-23 | 1 | -1/+1 |
| | | | | svn path=/trunk/; revision=2586 | ||||
* | Plugin time-in patch. | Eric S. Raymond | 1999-09-23 | 1 | -0/+1 |
| | | | | svn path=/trunk/; revision=2585 | ||||
* | MRC's comment. | Eric S. Raymond | 1999-09-23 | 1 | -0/+8 |
| | | | | svn path=/trunk/; revision=2583 | ||||
* | Get the right version. | Eric S. Raymond | 1999-09-22 | 1 | -1/+1 |
| | | | | svn path=/trunk/; revision=2575 | ||||
* | Version bump. | Eric S. Raymond | 1999-09-22 | 1 | -4/+5 |
| | | | | svn path=/trunk/; revision=2573 | ||||
* | Added Todd Sabin's new protocol options. | Eric S. Raymond | 1999-09-22 | 1 | -0/+3 |
| | | | | svn path=/trunk/; revision=2571 | ||||
* | Correct return value for bad fuile permissions. | Eric S. Raymond | 1999-09-20 | 1 | -0/+1 |
| | | | | svn path=/trunk/; revision=2567 | ||||
* | auth->preauth, second step. | Eric S. Raymond | 1999-09-16 | 1 | -1/+1 |
| | | | | svn path=/trunk/; revision=2565 | ||||
* | auth -> preauth. | Eric S. Raymond | 1999-09-16 | 1 | -0/+1 |
| | | | | svn path=/trunk/; revision=2564 | ||||
* | Minor fixes. | Eric S. Raymond | 1999-09-16 | 1 | -0/+8 |
| | | | | svn path=/trunk/; revision=2563 | ||||
* | Ready to ship. | Eric S. Raymond | 1999-09-14 | 1 | -2/+2 |
| | | | | svn path=/trunk/; revision=2561 | ||||
* | Disable l;iteralization after `password' when it's an authentication | Eric S. Raymond | 1999-09-14 | 1 | -0/+1 |
| | | | | | | type value. svn path=/trunk/; revision=2555 | ||||
* | NTLM support integrated. | Eric S. Raymond | 1999-09-14 | 1 | -1/+4 |
| | | | | svn path=/trunk/; revision=2554 | ||||
* | Duplicate suppression. | Eric S. Raymond | 1999-09-14 | 1 | -0/+1 |
| | | | | svn path=/trunk/; revision=2553 | ||||
* | Code changes needed for next release. | Eric S. Raymond | 1999-09-11 | 1 | -0/+4 |
| | | | | svn path=/trunk/; revision=2552 | ||||
* | Version bump. | Eric S. Raymond | 1999-08-28 | 1 | -1/+1 |
| | | | | svn path=/trunk/; revision=2549 | ||||
* | Date stamp. | Eric S. Raymond | 1999-08-21 | 1 | -3/+1 |
| | | | | svn path=/trunk/; revision=2547 | ||||
* /*************************************************************************
*
* $Id: doc_printf.h,v 1.3 2002/05/07 16:26:00 breese Exp $
*
* Copyright (C) 2001 Bjorn Reese and Daniel Stenberg.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
*
************************************************************************/
/** @addtogroup Printf Formatted Printing Functions.
Variations of formatted printing functions.
@b SYNOPSIS
@verbatim
cc ... -ltrio -lm
#include <trio.h>
@endverbatim
@b DESCRIPTION
This documentation is incomplete.
The documentation of the printf family in [C99] and [UNIX98] also applies
to the trio counterparts.
All these functions outputs a string which is formatted according to the
@p format string and the consecutive arguments. The @p format string is
described in the Formatting section below.
@ref trio_printf, @ref trio_vprintf, and @ref trio_printfv writes the
output to the standard output stream (stdout).
@ref trio_fprintf, @ref trio_vfprintf, and @ref trio_fprintfv writes the
output to a given output stream.
@ref trio_dprintf, @ref trio_vdprintf, and @ref trio_dprintfv writes the
output to a file descriptor (this includes, for example, sockets).
@ref trio_sprintf, @ref trio_vsprintf, and @ref trio_sprintfv writes the
output into @p buffer.
@ref trio_snprintf, @ref trio_vsnprintf, and @ref trio_snprintfv writes @p
max - 1 characters into @p buffer followed by a terminating zero character.
If @p max is 1, then @p buffer will be an empty string. If @p max is 0,
then @p buffer is left untouched, and can consequently be NULL. The number
of characters that would have been written to @p buffer, had there been
sufficient space, is returned.
@ref trio_snprintfcat appends the formatted text at the end of @p buffer.
@ref trio_asprintf and @ref trio_vasprintf allocates and returns an
allocated string in @p buffer containing the formatted text.
@b FORMATTING
The @p format string can contain normal text and conversion indicators.
The normal text can be any character except the nil character (\000 =
'\0') and the percent character (\045 = '%'). Conversion indicators
consists of an indication character (%), followed by zero or more conversion
modifiers, and exactly one conversion specifier.
@b Modifiers
Some modifiers exhibit the same behaviour for all specifiers, other modifiers
indicate different behaviours for different specifiers, and other modifiers
are only applicable to certain specifiers. The relationship is described for
each modifier. The number 9 is used to denotes an arbitrary integer.
@em Positional ( @c 9$ ) [UNIX98]
Normally the arguments supplied to these functions are interpreted
incrementially from left to right. Arguments can be referenced specifically in
the format string. The modifier n$ selects the nth argument. The first
argument is referred as 1$. If this modifier is used, it must be the first
modifier after the indication character. n$ can also be used for argument
width, precision, and base.
The performance penalty of using positionals is almost neglible (contrary to
most other printf implementations).
@li @em Reference @em Mix.
Mixing normal and positional specifiers is allowed [TRIO]. For example,
@verbatim
trio_printf("%d %3$d %2$d\n", 1, 2, 3);
@endverbatim
results in
@verbatim
1 3 2
@endverbatim
Arguments for the printf family are passed on the stack. On most platforms it
is not possible to determine the size of individual stack elements, so it is
essential that the format string corresponds exactly to the passed arguments.
If this is not the case, incorrect values may be put into the result.
@li @em Reference @em Gap.
For the same reason it is also essential that the format string does not
contain any "gaps" in the positional arguments. For example,
@verbatim
trio_printf("%1$d %3$d\n", 1, 2, 3);
@endverbatim
is NOT allowed. The format string parser has no knowledge about whether the
second argument is, say, an integer or a long double (which have different
sizes).
@verbatim
@endverbatim
[UNIX98] describes this as unspecified behaviour. [TRIO] will detect reference
gaps and return an error.
@li @em Double @em Reference.
It is also not allowed to reference an argument twice or more. For example,
@verbatim
trio_printf("%1$d %1$lf\n", 1);
@endverbatim
is NOT allowed, because it references the first argument as two differently
sized objects.
@verbatim
@endverbatim
[UNIX98] describes this as unspecified behaviour. [TRIO] will detect double
references and return an error.
The following two statements are equivalent
@verbatim
trio_printf("|%d %s\n|", 42, "meanings");
|42 meanings|
trio_printf("|%1$d %2$s|\n", 42, "meanings");
|42 meanings|
@endverbatim
@em Width ( @c 9 )
Specifies the minimum width of a field. If the fields has less characters than
specified by the width, the field will be left adjusted and padded by spaces.
The adjustment and padding can be changed by the Alignment ( @c - ) and
Padding ( @c 0 ) modifiers.
The width is specified as a number. If an asterix ( @c * ) is used instead, the
width will be read from the argument list.
Prefixes, such as 0x for hexadecimal integers, are part of width.
@verbatim
trio_printf("|%10i|\n", 42);
| 42|
@endverbatim
@em Precision ( @c .9 )
The precision has different semantics for the various data types.
The precision specifies the maximum number of printed characters for strings,
the number of digits after the decimal-point for floating-point numbers,
the number of significant digits for the @c g (and @c G) representation of
floating-point numbers, the minimum number of printed digits for integers.
@verbatim
trio_printf("|%10.8i|%.8i|\n", 42, 42);
| 00000042|00000042|
@endverbatim
@em Base ( @c ..9 ) [TRIO]
Sets the base that the ass | |||||
| | | | | svn path=/trunk/; revision=2499 |