From c8e1897c969ce43b551c29d65bc605f175c01263 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Thu, 2 Jul 2009 19:48:34 +0000 Subject: Update trio to CVS checkout of 2009-07-02. svn path=/branches/BRANCH_6-3/; revision=5370 --- trio/doc/doc.h | 13 ++++++++++- trio/doc/doc_nan.h | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ trio/doc/doc_printf.h | 8 +++---- trio/doc/doc_register.h | 45 ++++++++++++++++++++++++++++++-------- trio/doc/footer.html | 2 +- 5 files changed, 111 insertions(+), 15 deletions(-) create mode 100644 trio/doc/doc_nan.h (limited to 'trio/doc') diff --git a/trio/doc/doc.h b/trio/doc/doc.h index 4b368f46..49de1466 100644 --- a/trio/doc/doc.h +++ b/trio/doc/doc.h @@ -1,6 +1,6 @@ /************************************************************************* * - * $Id: doc.h,v 1.12 2002/12/08 10:42:49 breese Exp $ + * $Id: doc.h,v 1.20 2006/08/18 11:32:08 breese Exp $ * * Copyright (C) 2001 Bjorn Reese and Daniel Stenberg. * @@ -135,24 +135,35 @@ We have received contributions from the following persons (in alphabetic order sorted by surname) @li Craig Berry +@li Karl Bochert @li Stan Boehm +@li David Byron +@li Brian Chapman @li Robert Collins @li Danny Dulai +@li Bob Friesenhahn +@li Jon Foster @li John Fotheringham @li Markus Henke @li Ken Gibson @li Paul Janzen +@li Patrick Jessee @li Richard Jinks @li Tero Jänkä @li Howard Kapustein @li Rune Enggaard Lausen @li Mehdi Lavasani @li Alexander Lukyanov +@li Andreas Maus +@li Mikey Menezes @li Emmanuel Mogenet @li Jacob Navia @li Jose Ortiz @li Joe Orton @li Gisli Ottarsson +@li Mark Pickelmann +@li Olli Savia +@li Shaun Tancheff @li Marc Werwerft @li Igor Zlatkovic diff --git a/trio/doc/doc_nan.h b/trio/doc/doc_nan.h new file mode 100644 index 00000000..bfb3ffc9 --- /dev/null +++ b/trio/doc/doc_nan.h @@ -0,0 +1,58 @@ +/************************************************************************* + * + * $Id: doc_nan.h,v 1.1 2001/12/30 12:47:41 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 SpecialQuantities Special Quantifies. +Functions to detect and fabricate special quantities in floating-point +numbers. + +@b SYNOPSIS + +@verbatim +cc ... -ltrio -lm + +#include +@endverbatim + +@b DESCRIPTION + +Certain arithmetical operations does not result in normal numbers. Instead +they result in special quantities that must be handled differently by the +floating-point hardware. These includes Infinity and Not-A-Number (NaN). + +For example, 0/0 (zero divided by zero) yields NaN. Any operation which +involves a NaN will result in NaN. Any comparison involving NaN will be +unsuccessful, even if NaN is compared to NaN. + +These special quantities are represented with special bit patterns by the +floating-point hardware, and this bit patterns depend on the hardware. +There may even be hardware that does not support special quantities, so +the functions in this module are not guaranteed to work on all platforms. + +The approach used in this module is to (in decreasing order of importance) +@li Use C99 functionality when available. +@li Use IEEE 754-1985 bit patterns if possible. +@li Use platform-specific techniques. + +@b NOTES + +This module does not depend on the rest of trio, and can thus be reused +separately. The following files are necessary: +@li @c triodef.h +@li @c trionan.h +@li @c trionan.c + +*/ diff --git a/trio/doc/doc_printf.h b/trio/doc/doc_printf.h index 4321cd5c..32439e26 100644 --- a/trio/doc/doc_printf.h +++ b/trio/doc/doc_printf.h @@ -1,6 +1,6 @@ /************************************************************************* * - * $Id: doc_printf.h,v 1.3 2002/05/07 16:26:00 breese Exp $ + * $Id: doc_printf.h,v 1.5 2008/10/12 12:09:51 breese Exp $ * * Copyright (C) 2001 Bjorn Reese and Daniel Stenberg. * @@ -57,8 +57,8 @@ 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. +@ref trio_asprintf, @ref trio_vasprintf, and @ref trio_asprintfv allocates +and returns an allocated string in @p buffer containing the formatted text. @b FORMATTING @@ -249,7 +249,7 @@ Corresponds to the size_t modifier ( @c z ). Prepend radix indicator for hexadecimal, octal, and binary integer numbers and for pointers. -Always add a decimal-pointer for floating-point numbers. +Always add a decimal-point for floating-point numbers. Escape non-printable characters for strings. @em Spacing ( ) diff --git a/trio/doc/doc_register.h b/trio/doc/doc_register.h index 03610bfa..3ce86c57 100644 --- a/trio/doc/doc_register.h +++ b/trio/doc/doc_register.h @@ -1,6 +1,6 @@ /************************************************************************* * - * $Id: doc_register.h,v 1.2 2002/04/20 13:28:09 breese Exp $ + * $Id: doc_register.h,v 1.3 2008/10/12 12:09:51 breese Exp $ * * Copyright (C) 2001 Bjorn Reese and Daniel Stenberg. * @@ -35,24 +35,51 @@ This documentation is incomplete. The user-defined specifier consists of a start character (\074 = '<'), an optional namespace string followed by a namespace separator (\072 = ':'), -a format string, and an end character (\076 = '>'). +a format string, an optional skipping separator (\174 = '|'), and an end +character (\076 = '>'). The namespace string can consist of alphanumeric characters, and is used to define a named reference (see below). The namespace is case-sensitive. If no namespace is specified, then we use an unnamed reference (see below). The format can consist of any character except the end character ('>'), the -namespace separator (':'), and the nil character (\000). +namespace separator (':'), the skipping separator ('|'), and the nil character +(\000). Any modifier can be used together with the user-defined specifier. +There are two formats for invoking a user-defined specifier. The first format +is an extension of the normal printf/scanf formatting. It uses the percent +character (\045 = '%') followed by optional qualifiers and a specifier. For +example: + +@verbatim + trio_printf("%\n", my_handle, my_data); +@endverbatim + +Some C compilers can issue a warning if there is a mismatch between specifiers +and arguments. Unfortunately, these warnings does not work with the first +format for user-defined specifiers. Therefore the second format has been +introduced. The second format can only be applied to user-defined specifiers. + +The second format starts with a dollar character (\044 = '$') instead of the +percent character, and is followed by optional qualifiers and the user-defined +specifier. If the specifier contains a pipe character (\174 = '|'), then +everything between the pipe character and the end character ('>') is ignored. +The ignored part can be used to list the normal specifiers that the C compiler +uses to determine mismatches. For example: + +@verbatim + trio_printf("$\n", my_handle, my_data); +@endverbatim + @b Registering A user-defined specifier must be registered before it can be used. Unregistered user-defined specifiers are ignored. The @ref trio_register function is used to register a user-defined specifier. It takes two argument, a callback function and a namespace, and it returns a handle. The handle must -be used to unregister the specifier later. +be used to unregister the specifier later. The following example registers a user-define specifier with the "my_namespace" namespace: @@ -79,7 +106,7 @@ If the namespace is used, then a user-defined pointer must be passed as an argument: @verbatim - trio_printf("\n", my_data); + trio_printf("%\n", my_data); @endverbatim If the handle is used, then the user-defined specifier must not contain a @@ -87,7 +114,7 @@ namespace. Instead the handle must be passed as an argument, followed by a user-defined pointer: @verbatim - trio_printf("\n", my_handle, my_data); + trio_printf("%\n", my_handle, my_data); @endverbatim The two examples above are equivalent. @@ -107,7 +134,7 @@ No namespace can be specified. @verbatim anon_handle = trio_register(callback, NULL); - trio_printf("\n", anon_handle, my_data); + trio_printf("%\n", anon_handle, my_data); @endverbatim @b Restrictions @@ -166,7 +193,7 @@ equivalents. @verbatim trio_print_ref(ref, "There are %d towels\n", 42); - trio_print_ref(ref, "%\n", recursive_writer, trio_get_argument()); + trio_print_ref(ref, "%\n", recursive_writer, trio_get_argument(ref)); @endverbatim @b GETTER @b AND @b SETTER @b FUNCTIONS @@ -218,7 +245,7 @@ Print the time in the format "HOUR:MINUTE:SECOND" if "time" is specified inside the user-defined specifier. @verbatim - static int time_writer(void *ref) + static int time_print(void *ref) { const char *format; time_t *data; diff --git a/trio/doc/footer.html b/trio/doc/footer.html index 0e97ca00..f149fa2a 100644 --- a/trio/doc/footer.html +++ b/trio/doc/footer.html @@ -1,4 +1,4 @@
- + -- cgit v1.2.3