• Home
  • History
  • Annotate
  • only in this directory
NameDateSize

..02-May-201738

aclocal.m4H A D19-Dec-201136.4 KiB

alloca.in.hH A D19-Dec-20112.3 KiB

asnprintf.cH A D19-Dec-20111.1 KiB

asprintf.cH A D19-Dec-20111.1 KiB

AUTHORSH A D19-Dec-201133

autosprintf.ccH A D19-Dec-20112.2 KiB

autosprintf.h.inH A D19-Dec-20112.2 KiB

autosprintf.infoH A D19-Dec-20114.7 KiB

autosprintf.texiH A D19-Dec-20116.4 KiB

autosprintf_all.htmlH A D19-Dec-20115.2 KiB

ChangeLogH A D19-Dec-201126.9 KiB

config.hH A D19-Dec-20114 KiB

config.h.inH A D19-Dec-20113.8 KiB

config.logH A D28-Dec-201143.8 KiB

config.statusH A D19-Dec-201133.3 KiB

configureH A D19-Dec-2011734 KiB

configure.acH A D19-Dec-20112.6 KiB

COPYINGH A D19-Dec-201165

COPYING.LIBH A D19-Dec-201124.7 KiB

INSTALLH A D19-Dec-201110.5 KiB

lib-asprintf.cH A D19-Dec-20111.3 KiB

lib-asprintf.hH A D19-Dec-20111.1 KiB

libtoolH A D19-Dec-2011224.4 KiB

MakefileH A D19-Dec-201133.6 KiB

Makefile.amH A D19-Dec-20114.9 KiB

Makefile.inH A D19-Dec-201132.9 KiB

NEWSH A D19-Dec-20110

printf-args.cH A D19-Dec-20115.7 KiB

printf-args.hH A D19-Dec-20113.4 KiB

printf-parse.cH A D19-Dec-201113.5 KiB

printf-parse.hH A D19-Dec-20112.1 KiB

READMEH A D19-Dec-20112.6 KiB

README.woe32H A D19-Dec-2011174

stamp-h1H A D19-Dec-201123

texi2htmlH A D19-Dec-201156.1 KiB

vasnprintf.cH A D19-Dec-2011116.4 KiB

vasnprintf.hH A D19-Dec-20112.8 KiB

vasprintf.cH A D19-Dec-20111.5 KiB

vasprintf.hH A D19-Dec-20112 KiB

xsize.hH A D19-Dec-20113.5 KiB

README

1            GNU libasprintf - automatic formatted output to strings
2
3This package makes the C formatted output routines (fprintf et al.) usable
4in C++ programs.
5
6
7Sample use
8----------
9
10  char *pathname = autosprintf ("%s/%s", directory, filename);
11  cerr << autosprintf ("syntax error in %s:%d: %s", filename, line, errstring);
12
13
14Benefits
15--------
16
17The benefits of autosprintf over the usual "piecewise meal" idiom
18
19  cerr << "syntax error in " << filename << ":" << line << ": " << errstring;
20
21are:
22
23  - Reuses of the standard POSIX printf facility. Easy migration from C to C++.
24
25  - English sentences are kept together.
26
27  - Internationalization requires format strings, because
28    1. Internationalization requires the ability for the translator to change
29       the order of parts of a sentence. The POSIX printf formatted output
30       functions (and thus also autosprintf) support this through the %m$ and
31       *m$ syntax.
32    2. Translators are used to translate one string per sentence, not
33       multiple strings per sentence, and not C++ code statements.
34
35  - Reduces the risk of programming errors due to forgotten state in the
36    output stream (e.g.  'cout << hex;'  not followed by  'cout << dec;').
37
38The benefits of autosprintf over C sprintf are:
39
40  - Autosprintf avoids buffer overruns and truncated results.
41    The C sprintf() function often leads to buffer overruns. On the other
42    hand, the C snprintf() function requires extra coding for an a priori
43    estimate of the result's size and truncates the result if the estimate
44    was too low.
45
46  - Autosprintf avoids memory leaks.
47    Temporarily allocated memory is cleaned up automatically.
48
49
50Installation
51------------
52
53See INSTALL. Usually "./configure; make; make install" should work.
54
55The installed files are:
56  - An include file "autosprintf.h" which defines the class 'autosprintf',
57    in the namespace 'gnu'.
58  - A library libasprintf containing this class.
59
60
61Use
62---
63
64To use the class autosprintf, use
65
66  #include "autosprintf.h"
67  using gnu::autosprintf;
68
69and link with the linker option
70
71  -lasprintf
72
73
74Misc notes
75----------
76
77An instance of class 'autosprintf' contains the formatted output result;
78this string is freed when the instance's destructor is run.
79
80The class name 'autosprintf' is meant to remind the C function sprintf(),
81the GNU C library function asprintf(), and the C++ autoptr programming idiom.
82
83
84Distribution
85------------
86    http://www.haible.de/bruno/gnu/libasprintf-1.0.tar.gz
87
88Homepage
89--------
90    http://www.haible.de/bruno/packages-libasprintf.html
91
92Bug reports to:
93---------------
94    <bug-gnu-gettext@gnu.org>
95
96
97Bruno Haible <brunoe@clisp.org>
98

README.woe32

1Installation on Woe32 (WinNT/2000/XP, Win95/98/ME):
2
3Building requires the mingw development environment (includes gcc).
4MS Visual C/C++ with "nmake" is no longer supported.
5