SourceForge Logo


From now on, get all released files from

trio 1.12 was uploaded on November 26, 2006. Get more recent fixes off the CVS server.



  • LynxOS support
  • minor fixes


  • Patrick Jessee Fixed width calculation for %g.
  • Added macros for internal features.
  • Jon Foster Added macros for conditional compilation of many features. Documented all the features.
  • Karl Bochert Fixed problem with Borland C++, which changes the floating-point precision for certain math functions (log10() and _flclass()).
  • Karl Bochert Fixed compilation warnings on Borland C++.
  • Removed any occurrence of #elif because Borland C++ reports wrong line numbers when they are present (reported by Karl Bochert).
  • David Byron Added trio_asprintfv.
  • Brian Chapman Fixed Mac OS X compilation.
  • David Byron Fixed several compiler warnings.
  • Fixed printing of out-of-range arguments for %hhd and %hd. These arguments can be out of range because of default integer promotion.
  • Bob Friesenhahn Fixed installation of header files.
  • Joe Orton Added SHELL to to avoid problems with CShells.
  • Shaun Tancheff Fixed regresion tests for MSVC.
  • Craig Berry Fixed the VMS C99 workaround.


  • Rearranged some include files to accommodate large file support (reported by Albert Chin-A-Young).
  • Added support for SunOS 4.1.x lack of strerror, tolower, and toupper (reported by Peter McCluskey).
  • Fixed pedantic compilation with TRIO_MINIMAL.
  • Jose Kahan Moved to avoid redefinition problems.
  • Fixed hex-float exponents (reported by Matthias Clasen).
  • Fixed handling of negative width and precision via paramters (reported by Jacob Navia).
  • Nigel Hall Fixed TRIO_VA_START for VMS.
  • Rune Enggaard Lausen Fixed compilation for Borland C++ Builder.
  • Fixed precision of hex-float numbers (reported by James Antill).
  • Fixed plus sign only to be added for signed numbers.
  • Fixed printing of integers with value and precision of zero (reported by James Antill).
  • Fixed %#.o to only print one zero if the value is zero (reported by James Antill).
  • Rewrote check for IEEE compilation option to remove dependency on additional scripts.
  • Mehdi Lavasani Makefile install target fixed to work with older install programs.
  • Collapsed the DECC, MSVC, HP-UX, and AIX code for trio_fpclassify_and_sign() with further preprocessing.


  • Fixed trio_fpclassify_and_signbit on AIX 3.2
  • Added configure check for -ieee/-mieee compilation option for Alpha machines.
  • Craig Berry Fixed compilation on VMS.
  • Albert Chin-A-Young Fixed incorrect conditional expression in trio_isinf.
  • Fixed the warnings about uninitialized va_list in the printfv and scanfv family without the use of compiler specific pragmas (suggested by Ian Pilcher).
  • Fixed space flag for floating-point numbers (reported by Ian Main).


  • Fixed infinite loop in multibyte handling (reported by Gisli Ottarsson).
  • Added the customizable cprintf/cscanf family which enables to user to specify input and output stream functions (suggested by Florian Schulze).
  • Fixed trio_isinf by removing the HP-UX workaround, and instead making sure that the C99 macro will adhere to the trio return values (reported by Luke Dunstan).
  • Alexander Lukyanov Fixed boundary case for scanning and EOF.
  • Jacob Navia Enabled the L modifier for formatting.
  • Added TRIO_MINIMAL to build trio without the string functions.
  • Added the R modifier to print rounded floating-point numbers.
  • Added trio_to_long_double and long double scanning (the L modifier).
  • Added trio_locale_decimal_point, trio_locale_thousand_separator, trio_locale_grouping to overwrite locale settings.
  • Rewrote TrioWriteDouble to avoid temporary buffers and thus the danger of buffer overflows (for instance %.5000f).
  • Improved floating-point formatting accuracy.
  • Fixed formatting of non-decimal exponents.
  • Fixed thousand separator checking.
  • Fixed %f scanning to get a float and %lf to get a double.
  • Fixed WIN32 compilation (reported by Emmanuel Mogenet)
  • Fixed regression test cases to exclude disabled features.


  • new functions: trio_isfinite, trio_signbit, trio_fpclassify
  • formatting of floating-point numbers beyond their accuracy
  • K&R compatibility
  • autoconf used to create Makefile
  • many bug fixes


  • Added dynamic string functions.
  • Rewrote and extended documentation in JavaDoc (using Doxygen).
  • Moved and renamed strio functions to triostr.
  • Robert Collins Added definition for Cygwin.
  • Markus Henke Added long double workaround for the HP C/iX compiler.
  • Marc Verwerft Improved error handling for dynamically allocated strings.
  • John Fotheringham Made trionan compile on OpenVMS.
  • Added 'd' and 'D' as exponent letters when using TRIO_MICROSOFT.
  • Fixed uninitial memory read for the parameter modifiers.


  • Merged with libxml changes
  • Moved NaN and Inf handling to separate file to enable reuse in other projects.
  • Fixed TrioGenerateNan for MSVC.
  • Fixed lots of preprocessor macros and internal data structure names.


  • Added hex-float (%a and %A) for scanning.
  • Added wide character arguments (%ls, %ws, %S, %lc, %wc, and %C) for both printf and scanf.
  • Added mutex callbacks for user-specified specifiers to enable applications to add thread-safety. These are registered with trio_register, where the namespace is set to either ":enter" to lock a mutex, or ":leave" to unlock a mutex.
  • Added equivalence class expressions for scanning. For example, %[[=a=]] scans for all letters in the same equivalence class as the letter 'a' as defined by the locale.
  • Changed character class expressions for scanning. The expressions must now be embedded withing an extra set of brackets, e.g. %[[:alpha:]]. This was done to adhere to the syntax of UNIX98 regular expressions.
  • Added the possibility to specify standard support (TRIO_C99 etc.) as compiler options.
  • Fixed conversion of hex-float in StrToDouble.
  • Fixed formatting of hex-float numbers.
  • Fixed crash on QNX, which happend because some buffers on the stack were too big.
  • Fixed default precision for %f and %g (reported by Jose Ortiz)
  • Added the I8, I16, I32, and I64 modifiers.
  • Fixed rounding problem for %e.
  • Fixed various problems with the xlC and Sun C++ compilers.


  • trio's treatment of the field width when the %e code was used was not correct (Gisli Ottarsson reported). It turns out the fraction part should be zero-padded by default and the exponent part should be zero-prefixed if it is only one digit. At least that's how the GNU and Sun libc's work. The trio floating point output looks identical to them now.
  • Fixed group scanning with modifiers.
  • Igor Zlatkovic Fixed compilation of dprintf, which uses read/write, for MSCC.
  • Fixed various compilation problems on Digital Unix (mainly associated with va_list).


  • Added autoconf integration. If compiled with HAVE_CONFIG_H the following happens. Firstly, is included. Secondly, trio will only be compiled if WITH_TRIO is defined herein. Thirdly, if TRIO_REPLACE_STDIO is defined, only stdio functions that have not been detected by autoconf, i.e. those not defined by HAVE_PRINTF or similar, will be replaced by trio functions (suggested by Daniel Veillard).
  • Fixed '' output. Previously trio did not treat the width properly in all cases (reported by Gisli Ottarsson).
  • Added explicit promotion for the scanfv family.
  • Fixed more C++ compilation warnings.


  • Added explicit promotion for the printfv familiy. A float must be specified by %hf.
  • Fixed positionals for printfv (reported by Gisli Ottarsson).
  • Fixed an integer to pointer conversion problem on the SGI MIPS C compiler (reported by Gisli Ottarsson).
  • Fixed ANSI C++ warnings (type casting, and namespace is a reserved keyword).
  • Added \n to all examples in the documentation to prevent confusion.
  • Fixed StrSubstringMax


  • More documentation
  • Fixed C99 support
  • Improved NaN support


  • User-defined specifier with callback function
  • printfv: an argument array implementation


  • Added width to scanning of floating-point numbers.
  • Wrote more documentation on trio_printf.
  • Fixed problem with trailing zeroes after decimal-point.


  • Added LC_CTYPE locale dependent character class expressions to scan lists. Included are [:alnum:], [:alpha:], [:cntrl:], [:digit:], [:graph:], [:lower:], [:print:], [:punct:], [:space:], [:upper:], [:xdigit:]
  • Added C escapes to alternative string formatting and scanning.
  • Added StrSubstringMax.
  • Wrote a little more documentation.
  • Fixed scanf return values.
  • Fixed a sign error for non-ascii characters.


  • Converted the documentation to TeX. With latex2man the documentation can automatically be converted into man pages.
  • Added trio_scanf, trio_vscanf, trio_fscanf, and trio_vfscanf.
  • Added trio_dprintf, trio_vdprintf, trio_dscanf, and trio_vdscanf. These functions can be used to write and read directly to pipes and sockets (the assume blocking sockets). Stdio buffering is surpassed, so the functions are async-safe. However, reading from stdin (STDIN_FILENO) or writing to stdout (STDOUT_FILENO) reintroduces the buffering.
  • Added trio_dprintf and trio_vdprintf. These can be used to write directly to pipes and sockets.
  • Paul Janzen Added trio_asprintf and trio_vasprintf, which are compatible with the GNU and BSD interfaces.
  • Added scanlist ranges for group scanning (%[]).
  • Added width for scanning (missing for floating-point numbers though).
  • Added variable size modifier (&) to handle system defined types of unknown size. This modifier makes certain assumptions about the integer sizes, which may not be valid on any machine. Consequently, the modifier will remain undocumented, as it may be removed later.
  • Added \777 and \xFF to alternative string scanning (%#s)
  • Added the TRIO_REPLACE_STDIO check in the header.
  • Improved performance of the multibyte character parsing.
  • Fixed positionals (%n$) which had stopped working.
  • Fixed hh and ll modifiers to allow exactly two letters and no more.
  • Fixed ANSI C++ warnings. Also fixed the compiler warning about casting between integer and pointer (this has been annoying me for ages).
  • Fixed snprintf and vsnprintf with zero buffer size.
  • Fixed NAN problems (reported by Keith Briggs).
  • Fixed parsing of multibyte characters. The format string was not correctly advanced in case of a multibyte character.
  • Renamed many of the internal functions to have more consistant names.
  • Removed the <quote=c> and <fill=c> modifiers. They are not really worth including. The other <> modifiers may disappear as well.


  • Sticky flag to allow reuse of modifiers
  • Double-dot notation for radix
  • Uses LC_NUMERIC grouping
  • Fixed parameters to use positional, ie. *n$, and to accept an arbitrary number
  • intmax_t and ptrdiff_t supported


  • Bjorn Reese rewrote the entire floating-point formatting function.
  • Changed the parsing of the format string to be multibyte aware.
  • Added INF, -INF, and NAN for floating-point numbers.
  • Fixed %#.9g -- alternative with precision.
  • Ken Gibson Fixed printing of negative hex numbers
  • Joerg Fixed convertion of non-ASCII characters
  • Danny Dulai noticed another difference to the standard printf(), when you used ("%.0f", 3.0) or ("%#.0f", 3.0). I think I corrected the problems and I added tests for these outputs to the regression test.
  • TrioFormat() is now available "publicly".


  • Danny Dulai fixed several problems with the floating point precision. The regression tests are updated to check for this and also some new test cases that 0.14 didn't handle well.

Web page edited by daniel at, modified January 08, 2008