annotate doc/gnulib.texi @ 7618:549e482b5ecd

* README: Fix typo. * doc/gnulib.texi (Miscellaneous Notes): Likewise, rename... (Miscellanous Notes): ...from this.
author Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
date Tue, 07 Nov 2006 19:51:40 +0000
parents 7caba67886be
children 1736cdb7eda4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5239
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
1 \input texinfo @c -*-texinfo-*-
7618
549e482b5ecd * README: Fix typo.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents: 7548
diff changeset
2 @comment $Id: gnulib.texi,v 1.30 2006-11-07 19:51:40 rwild Exp $
5239
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
3 @comment %**start of header
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
4 @setfilename gnulib.info
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
5 @settitle GNU Gnulib
5256
e23bd8e9d368 import sections from Simon
Karl Berry <karl@freefriends.org>
parents: 5239
diff changeset
6 @syncodeindex fn cp
5239
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
7 @syncodeindex pg cp
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
8 @comment %**end of header
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
9
7618
549e482b5ecd * README: Fix typo.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents: 7548
diff changeset
10 @set UPDATED $Date: 2006-11-07 19:51:40 $
5239
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
11
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
12 @copying
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
13 This manual is for GNU Gnulib (updated @value{UPDATED}),
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
14 which is a library of common routines intended to be shared at the
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
15 source level.
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
16
6764
a156a04768bf gcd in menu
Karl Berry <karl@freefriends.org>
parents: 6762
diff changeset
17 Copyright @copyright{} 2004, 2005, 2006 Free Software Foundation, Inc.
5239
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
18
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
19 @quotation
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
20 Permission is granted to copy, distribute and/or modify this document
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
21 under the terms of the GNU Free Documentation License, Version 1.1 or
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
22 any later version published by the Free Software Foundation; with no
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
23 Invariant Sections, with the Front-Cover Texts being ``A GNU Manual,''
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
24 and with the Back-Cover Texts as in (a) below. A copy of the
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
25 license is included in the section entitled ``GNU Free Documentation
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
26 License.''
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
27
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
28 (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
29 this GNU Manual, like GNU software. Copies published by the Free
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
30 Software Foundation raise funds for GNU development.''
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
31 @end quotation
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
32 @end copying
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
33
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
34 @dircategory Software development
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
35 @direntry
5257
5cde461db6dc direntry
Karl Berry <karl@freefriends.org>
parents: 5256
diff changeset
36 * Gnulib: (gnulib). Source files to share among distributions.
5239
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
37 @end direntry
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
38
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
39 @titlepage
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
40 @title GNU Gnulib
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
41 @subtitle updated @value{UPDATED}
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
42 @author @email{bug-gnulib@@gnu.org}
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
43 @page
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
44 @vskip 0pt plus 1filll
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
45 @insertcopying
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
46 @end titlepage
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
47
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
48 @contents
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
49
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
50 @ifnottex
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
51 @node Top
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
52 @top GNU Gnulib
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
53
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
54 @insertcopying
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
55 @end ifnottex
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
56
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
57 @menu
7546
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
58 * Introduction::
5239
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
59 * Invoking gnulib-tool::
7618
549e482b5ecd * README: Fix typo.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents: 7548
diff changeset
60 * Miscellaneous Notes::
7546
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
61 * Particular Modules:: Documentation of Individual Modules
5239
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
62 * Copying This Manual::
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
63 * Index::
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
64 @end menu
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
65
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
66
7546
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
67 @node Introduction
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
68 @chapter Introduction
5239
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
69
7548
7caba67886be Add an introduction.
Bruno Haible <bruno@clisp.org>
parents: 7546
diff changeset
70 Gnulib is a source code library. It provides basic functionalities to
7caba67886be Add an introduction.
Bruno Haible <bruno@clisp.org>
parents: 7546
diff changeset
71 programs and libraries. Currently (as of October 2006) more than 30
7caba67886be Add an introduction.
Bruno Haible <bruno@clisp.org>
parents: 7546
diff changeset
72 packages make use of Gnulib.
7caba67886be Add an introduction.
Bruno Haible <bruno@clisp.org>
parents: 7546
diff changeset
73
7caba67886be Add an introduction.
Bruno Haible <bruno@clisp.org>
parents: 7546
diff changeset
74 Resources:
5239
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
75
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
76 @itemize
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
77 @item Gnulib is hosted at Savannah:
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
78 @url{http://savannah.gnu.org/projects/gnulib}. Get the sources
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
79 through CVS from there.
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
80 @item The Gnulib home page:
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
81 @url{http://www.gnu.org/software/gnulib/}.
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
82 @end itemize
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
83
7548
7caba67886be Add an introduction.
Bruno Haible <bruno@clisp.org>
parents: 7546
diff changeset
84 @menu
7caba67886be Add an introduction.
Bruno Haible <bruno@clisp.org>
parents: 7546
diff changeset
85 * Library vs. Reusable Code::
7caba67886be Add an introduction.
Bruno Haible <bruno@clisp.org>
parents: 7546
diff changeset
86 * Portability and Application Code::
7caba67886be Add an introduction.
Bruno Haible <bruno@clisp.org>
parents: 7546
diff changeset
87 * Modules::
7caba67886be Add an introduction.
Bruno Haible <bruno@clisp.org>
parents: 7546
diff changeset
88 * Various Kinds of Modules::
7caba67886be Add an introduction.
Bruno Haible <bruno@clisp.org>
parents: 7546
diff changeset
89 * Collaborative Development::
7caba67886be Add an introduction.
Bruno Haible <bruno@clisp.org>
parents: 7546
diff changeset
90 * Copyright::
7caba67886be Add an introduction.
Bruno Haible <bruno@clisp.org>
parents: 7546
diff changeset
91 * Steady Development::
7caba67886be Add an introduction.
Bruno Haible <bruno@clisp.org>
parents: 7546
diff changeset
92 * Openness::
7caba67886be Add an introduction.
Bruno Haible <bruno@clisp.org>
parents: 7546
diff changeset
93 @end menu
7caba67886be Add an introduction.
Bruno Haible <bruno@clisp.org>
parents: 7546
diff changeset
94
7caba67886be Add an introduction.
Bruno Haible <bruno@clisp.org>
parents: 7546
diff changeset
95 @include gnulib-intro.texi
7caba67886be Add an introduction.
Bruno Haible <bruno@clisp.org>
parents: 7546
diff changeset
96
7546
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
97
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
98 @include gnulib-tool.texi
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
99
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
100
7618
549e482b5ecd * README: Fix typo.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents: 7548
diff changeset
101 @node Miscellaneous Notes
549e482b5ecd * README: Fix typo.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents: 7548
diff changeset
102 @chapter Miscellaneous Notes
7546
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
103
5239
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
104 @menu
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
105 * Comments::
5260
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
106 * Header files::
5239
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
107 * Out of memory handling::
5938
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
108 * Library version handling::
6852
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
109 * Windows sockets::
6962
e33f191db3d6 2006-07-14 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6945
diff changeset
110 * Libtool and Windows::
7334
c7c3e5be0d91 note about the license texinfo files
Karl Berry <karl@freefriends.org>
parents: 6989
diff changeset
111 * License Texinfo sources::
5239
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
112 @end menu
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
113
5982
8f55c4ac38d6 updates from Patrice, start at quoting
Karl Berry <karl@freefriends.org>
parents: 5938
diff changeset
114
5239
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
115 @node Comments
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
116 @section Comments
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
117
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
118 @cindex comments describing functions
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
119 @cindex describing functions, locating
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
120 Where to put comments describing functions: Because of risk of
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
121 divergence, we prefer to keep most function describing comments in
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
122 only one place: just above the actual function definition. Some
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
123 people prefer to put that documentation in the .h file. In any case,
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
124 it should appear in just one place unless you can ensure that the
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
125 multiple copies will always remain identical.
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
126
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
127
5260
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
128 @node Header files
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
129 @section Header files
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
130
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
131 @cindex double inclusion of header files
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
132 @cindex header file include protection
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
133 It is a tradition to use CPP tricks to avoid parsing the same header
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
134 file more than once, which might cause warnings. The trick is to wrap
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
135 the content of the header file (say, @file{foo.h}) in a block, as in:
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
136
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
137 @example
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
138 #ifndef FOO_H
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
139 # define FOO_H
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
140 ...
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
141 body of header file goes here
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
142 ...
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
143 #endif /* FOO_H */
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
144 @end example
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
145
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
146 Whether to use @code{FOO_H} or @code{_FOO_H} is a matter of taste and
5261
95f7304acdac Minor fixups to previous patch.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5260
diff changeset
147 style. The C89 and C99 standards reserve all identifiers that begin with an
5260
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
148 underscore and either an uppercase letter or another underscore, for
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
149 any use. Thus, in theory, an application might not safely assume that
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
150 @code{_FOO_H} has not already been defined by a library. On the other
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
151 hand, using @code{FOO_H} will likely lead the higher risk of
5269
7ce2f4babcdc Mention also KEY_H.
Bruno Haible <bruno@clisp.org>
parents: 5261
diff changeset
152 collisions with other symbols (e.g., @code{KEY_H}, @code{XK_H}, @code{BPF_H},
7ce2f4babcdc Mention also KEY_H.
Bruno Haible <bruno@clisp.org>
parents: 5261
diff changeset
153 which are CPP macro constants, or @code{COFF_LONG_H}, which is a CPP
7ce2f4babcdc Mention also KEY_H.
Bruno Haible <bruno@clisp.org>
parents: 5261
diff changeset
154 macro function). Your preference may depend on whether you consider
5260
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
155 the header file under discussion as part of the application (which has
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
156 its own namespace for CPP symbols) or a supporting library (that
5261
95f7304acdac Minor fixups to previous patch.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5260
diff changeset
157 shouldn't interfere with the application's CPP symbol namespace).
5260
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
158
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
159 @cindex C++ header files
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
160 @cindex Header files and C++
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
161 Adapting C header files for use in C++ applications can use another
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
162 CPP trick, as in:
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
163
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
164 @example
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
165 # ifdef __cplusplus
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
166 extern "C"
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
167 @{
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
168 # endif
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
169 ...
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
170 body of header file goes here
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
171 ...
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
172 # ifdef __cplusplus
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
173 @}
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
174 # endif
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
175 @end example
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
176
5261
95f7304acdac Minor fixups to previous patch.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5260
diff changeset
177 The idea here is that @code{__cplusplus} is defined only by C++
95f7304acdac Minor fixups to previous patch.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5260
diff changeset
178 implementations, which will wrap the header file in an @samp{extern "C"}
5260
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
179 block. Again, whether to use this trick is a matter of taste and
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
180 style. While the above can be seen as harmless, it could be argued
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
181 that the header file is written in C, and any C++ application using it
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
182 should explicitly use the @samp{extern "C"} block itself. Your
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
183 preference might depend on whether you consider the API exported by
5261
95f7304acdac Minor fixups to previous patch.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5260
diff changeset
184 your header file as something available for C programs only, or for C
5260
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
185 and C++ programs alike.
5a0174704b16 header files, from simon
Karl Berry <karl@freefriends.org>
parents: 5257
diff changeset
186
5982
8f55c4ac38d6 updates from Patrice, start at quoting
Karl Berry <karl@freefriends.org>
parents: 5938
diff changeset
187 @subheading Include ordering
5883
19bb5e876a29 Add "Include ordering", based on e-mail from Bruno.
Simon Josefsson <simon@josefsson.org>
parents: 5870
diff changeset
188
19bb5e876a29 Add "Include ordering", based on e-mail from Bruno.
Simon Josefsson <simon@josefsson.org>
parents: 5870
diff changeset
189 When writing a gnulib module, or even in general, a good way to order
19bb5e876a29 Add "Include ordering", based on e-mail from Bruno.
Simon Josefsson <simon@josefsson.org>
parents: 5870
diff changeset
190 the @samp{#include} directives is the following.
19bb5e876a29 Add "Include ordering", based on e-mail from Bruno.
Simon Josefsson <simon@josefsson.org>
parents: 5870
diff changeset
191
19bb5e876a29 Add "Include ordering", based on e-mail from Bruno.
Simon Josefsson <simon@josefsson.org>
parents: 5870
diff changeset
192 @itemize
19bb5e876a29 Add "Include ordering", based on e-mail from Bruno.
Simon Josefsson <simon@josefsson.org>
parents: 5870
diff changeset
193 @item First comes the #include "..." specifying the module being implemented.
19bb5e876a29 Add "Include ordering", based on e-mail from Bruno.
Simon Josefsson <simon@josefsson.org>
parents: 5870
diff changeset
194 @item Then come all the #include <...> of system or system-replacement headers,
19bb5e876a29 Add "Include ordering", based on e-mail from Bruno.
Simon Josefsson <simon@josefsson.org>
parents: 5870
diff changeset
195 in arbitrary order.
19bb5e876a29 Add "Include ordering", based on e-mail from Bruno.
Simon Josefsson <simon@josefsson.org>
parents: 5870
diff changeset
196 @item Then come all the #include "..." of gnulib and private headers, in
19bb5e876a29 Add "Include ordering", based on e-mail from Bruno.
Simon Josefsson <simon@josefsson.org>
parents: 5870
diff changeset
197 arbitrary order.
19bb5e876a29 Add "Include ordering", based on e-mail from Bruno.
Simon Josefsson <simon@josefsson.org>
parents: 5870
diff changeset
198 @end itemize
19bb5e876a29 Add "Include ordering", based on e-mail from Bruno.
Simon Josefsson <simon@josefsson.org>
parents: 5870
diff changeset
199
5982
8f55c4ac38d6 updates from Patrice, start at quoting
Karl Berry <karl@freefriends.org>
parents: 5938
diff changeset
200
5239
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
201 @node Out of memory handling
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
202 @section Out of memory handling
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
203
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
204 @cindex Out of Memory handling
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
205 @cindex Memory allocation failure
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
206 The GSS API does not have a standard error code for the out of memory
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
207 error condition. Instead of adding a non-standard error code, this
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
208 library has chosen to adopt a different strategy. Out of memory
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
209 handling happens in rare situations, but performing the out of memory
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
210 error handling after almost all API function invocations pollute your
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
211 source code and might make it harder to spot more serious problems.
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
212 The strategy chosen improve code readability and robustness.
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
213
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
214 @cindex Aborting execution
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
215 For most applications, aborting the application with an error message
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
216 when the out of memory situation occur is the best that can be wished
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
217 for. This is how the library behaves by default.
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
218
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
219 @vindex xalloc_fail_func
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
220 However, we realize that some applications may not want to have the
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
221 GSS library abort execution in any situation. The GSS library support
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
222 a hook to let the application regain control and perform its own
6945
aa195d9ecb02 * functions.texi, gnulib-tool.texi, gnulib.texi: Fix some typos.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents: 6852
diff changeset
223 cleanups when an out of memory situation has occurred. The application
5239
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
224 can define a function (having a @code{void} prototype, i.e., no return
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
225 value and no parameters) and set the library variable
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
226 @code{xalloc_fail_func} to that function. The variable should be
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
227 declared as follows.
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
228
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
229 @example
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
230 extern void (*xalloc_fail_func) (void);
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
231 @end example
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
232
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
233 The GSS library will invoke this function if an out of memory error
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
234 occurs. Note that after this the GSS library is in an undefined
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
235 state, so you must unload or restart the application to continue call
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
236 GSS library functions. The hook is only intended to allow the
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
237 application to log the situation in a special way. Of course, care
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
238 must be taken to not allocate more memory, as that will likely also
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
239 fail.
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
240
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
241
5938
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
242 @node Library version handling
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
243 @section Library version handling
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
244
5992
6cf595732ddb gnulib.texi (Library version handling): Add ELF symbol collision
Simon Josefsson <simon@josefsson.org>
parents: 5983
diff changeset
245 The module @samp{check-version} can be useful when your gnulib
5938
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
246 application is a system library. You will typically wrap the call to
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
247 the @code{check_version} function through a library API, your library
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
248 header file may contain:
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
249
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
250 @example
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
251 #define STRINGPREP_VERSION "0.5.18"
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
252 ...
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
253 extern const char *stringprep_check_version (const char *req_version);
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
254 @end example
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
255
5992
6cf595732ddb gnulib.texi (Library version handling): Add ELF symbol collision
Simon Josefsson <simon@josefsson.org>
parents: 5983
diff changeset
256 To avoid ELF symbol collisions with other libraries that use the
6cf595732ddb gnulib.texi (Library version handling): Add ELF symbol collision
Simon Josefsson <simon@josefsson.org>
parents: 5983
diff changeset
257 @samp{check-version} module, add to @file{config.h} through a
6cf595732ddb gnulib.texi (Library version handling): Add ELF symbol collision
Simon Josefsson <simon@josefsson.org>
parents: 5983
diff changeset
258 AC_DEFINE something like:
6cf595732ddb gnulib.texi (Library version handling): Add ELF symbol collision
Simon Josefsson <simon@josefsson.org>
parents: 5983
diff changeset
259
6cf595732ddb gnulib.texi (Library version handling): Add ELF symbol collision
Simon Josefsson <simon@josefsson.org>
parents: 5983
diff changeset
260 @example
6842
1b6de7675435 mention that Gnulib takes over LIBOBJS
Karl Berry <karl@freefriends.org>
parents: 6764
diff changeset
261 AC_DEFINE(check_version, stringprep_check_version,
1b6de7675435 mention that Gnulib takes over LIBOBJS
Karl Berry <karl@freefriends.org>
parents: 6764
diff changeset
262 [Rename check_version.])
5992
6cf595732ddb gnulib.texi (Library version handling): Add ELF symbol collision
Simon Josefsson <simon@josefsson.org>
parents: 5983
diff changeset
263 @end example
6cf595732ddb gnulib.texi (Library version handling): Add ELF symbol collision
Simon Josefsson <simon@josefsson.org>
parents: 5983
diff changeset
264
6cf595732ddb gnulib.texi (Library version handling): Add ELF symbol collision
Simon Josefsson <simon@josefsson.org>
parents: 5983
diff changeset
265 The @code{stringprep_check_version} function will thus be implemented
6cf595732ddb gnulib.texi (Library version handling): Add ELF symbol collision
Simon Josefsson <simon@josefsson.org>
parents: 5983
diff changeset
266 by the @code{check_version} module.
5938
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
267
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
268 There are two uses of the interface. The first is a way to provide
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
269 for applications to find out the version number of the library it
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
270 uses. The application may contain diagnostic code such as:
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
271
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
272 @example
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
273 printf ("Stringprep version: header %s library %s",
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
274 STRINGPREP_VERSION,
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
275 stringprep_check_version (NULL));
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
276 @end example
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
277
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
278 Separating the library and header file version can be useful when
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
279 searching for version mismatch related problems.
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
280
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
281 The second uses is as a rudimentary test of proper library version, by
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
282 making sure the application get a library version that is the same, or
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
283 newer, than the header file used when building the application. This
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
284 doesn't catch all problems, libraries may change backwards incompatibly
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
285 in later versions, but enable applications to require a certain
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
286 minimum version before it may proceed.
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
287
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
288 Typical uses look like:
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
289
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
290 @example
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
291 /* Check version of libgcrypt. */
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
292 if (!gcry_check_version (GCRYPT_VERSION))
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
293 die ("version mismatch\n");
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
294 @end example
14697da96543 2005-06-28 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5883
diff changeset
295
5982
8f55c4ac38d6 updates from Patrice, start at quoting
Karl Berry <karl@freefriends.org>
parents: 5938
diff changeset
296
6852
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
297 @node Windows sockets
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
298 @section Windows sockets
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
299
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
300 There are several issues when building applications that should work
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
301 under Windows. The most problematic part is for applications that use
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
302 sockets.
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
303
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
304 Hopefully, we can add helpful notes to this section that will help you
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
305 port your application to Windows using gnulib.
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
306
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
307 @subsection Getaddrinfo and WINVER
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
308
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
309 This was written for the getaddrinfo module, but may be applicable to
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
310 other functions too.
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
311
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
312 The getaddrinfo function exists in ws2tcpip.h and -lws2_32 on Windows
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
313 XP. The function declaration is present if @code{WINVER >= 0x0501}.
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
314 Windows 2000 does not have getaddrinfo in its @file{WS2_32.dll}.
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
315
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
316 Thus, if you want to assume Windows XP or later, you can add
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
317 AC_DEFINE(WINVER, 0x0501) to avoid compiling to (partial) getaddrinfo
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
318 implementation.
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
319
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
320 If you want to support Windows 2000, don't do anything, but be aware
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
321 that gnulib will use its own (partial) getaddrinfo implementation even
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
322 on Windows XP. Currently the code does not attempt to determine if
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
323 the getaddrinfo function is available during runtime.
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
324
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
325 Todo: Make getaddrinfo.c open the WS2_32.DLL and check for the
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
326 getaddrinfo symbol and use it if present, otherwise fall back to our
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
327 own implementation.
9582dd5af1a5 Fix getaddrinfo on Windows 2000.
Simon Josefsson <simon@josefsson.org>
parents: 6842
diff changeset
328
7546
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
329
6962
e33f191db3d6 2006-07-14 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6945
diff changeset
330 @node Libtool and Windows
e33f191db3d6 2006-07-14 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6945
diff changeset
331 @section Libtool and Windows
e33f191db3d6 2006-07-14 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6945
diff changeset
332
e33f191db3d6 2006-07-14 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6945
diff changeset
333 If you want it to be possible to cross-compile your program to MinGW
e33f191db3d6 2006-07-14 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6945
diff changeset
334 and you use Libtool, you need to put:
e33f191db3d6 2006-07-14 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6945
diff changeset
335
e33f191db3d6 2006-07-14 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6945
diff changeset
336 @example
e33f191db3d6 2006-07-14 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6945
diff changeset
337 AC_LIBTOOL_WIN32_DLL
e33f191db3d6 2006-07-14 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6945
diff changeset
338 @end example
e33f191db3d6 2006-07-14 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6945
diff changeset
339
6989
d4c72f8cb784 * gnulib.texi (Libtool and Windows): Eliminate passive voice. Correct
Derek R. Price <derek@ximbiot.com>
parents: 6962
diff changeset
340 in your @file{configure.ac}. This sets the correct names for the
d4c72f8cb784 * gnulib.texi (Libtool and Windows): Eliminate passive voice. Correct
Derek R. Price <derek@ximbiot.com>
parents: 6962
diff changeset
341 @code{OBJDUMP}, @code{DLLTOOL}, and @code{AS} tools for the build.
6962
e33f191db3d6 2006-07-14 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6945
diff changeset
342
e33f191db3d6 2006-07-14 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6945
diff changeset
343 If you are building a library, you will also need to pass
6989
d4c72f8cb784 * gnulib.texi (Libtool and Windows): Eliminate passive voice. Correct
Derek R. Price <derek@ximbiot.com>
parents: 6962
diff changeset
344 @code{-no-undefined} to make sure Libtool produces a DLL for your
6962
e33f191db3d6 2006-07-14 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6945
diff changeset
345 library. From a @file{Makefile.am}:
e33f191db3d6 2006-07-14 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6945
diff changeset
346
e33f191db3d6 2006-07-14 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6945
diff changeset
347 @example
e33f191db3d6 2006-07-14 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6945
diff changeset
348 libgsasl_la_LDFLAGS += -no-undefined
e33f191db3d6 2006-07-14 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6945
diff changeset
349 @end example
e33f191db3d6 2006-07-14 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6945
diff changeset
350
7334
c7c3e5be0d91 note about the license texinfo files
Karl Berry <karl@freefriends.org>
parents: 6989
diff changeset
351
c7c3e5be0d91 note about the license texinfo files
Karl Berry <karl@freefriends.org>
parents: 6989
diff changeset
352 @node License Texinfo sources
c7c3e5be0d91 note about the license texinfo files
Karl Berry <karl@freefriends.org>
parents: 6989
diff changeset
353 @section License Texinfo sources
c7c3e5be0d91 note about the license texinfo files
Karl Berry <karl@freefriends.org>
parents: 6989
diff changeset
354
c7c3e5be0d91 note about the license texinfo files
Karl Berry <karl@freefriends.org>
parents: 6989
diff changeset
355 Gnulib provides copies of the GNU GPL, GNU LGPL, and GNU FDL licenses
c7c3e5be0d91 note about the license texinfo files
Karl Berry <karl@freefriends.org>
parents: 6989
diff changeset
356 in Texinfo form. (The master location is
c7c3e5be0d91 note about the license texinfo files
Karl Berry <karl@freefriends.org>
parents: 6989
diff changeset
357 @url{http://www.gnu.org/licenses/}). These Texinfo documents have
c7c3e5be0d91 note about the license texinfo files
Karl Berry <karl@freefriends.org>
parents: 6989
diff changeset
358 various node names and structures built into them; for your manual,
c7c3e5be0d91 note about the license texinfo files
Karl Berry <karl@freefriends.org>
parents: 6989
diff changeset
359 you might like to change these. It's ok to do this, and a convenient
c7c3e5be0d91 note about the license texinfo files
Karl Berry <karl@freefriends.org>
parents: 6989
diff changeset
360 way to do so is to use a context diff and the @option{--local-dir}
c7c3e5be0d91 note about the license texinfo files
Karl Berry <karl@freefriends.org>
parents: 6989
diff changeset
361 option to @command{gnulib-tool}.
c7c3e5be0d91 note about the license texinfo files
Karl Berry <karl@freefriends.org>
parents: 6989
diff changeset
362
c7c3e5be0d91 note about the license texinfo files
Karl Berry <karl@freefriends.org>
parents: 6989
diff changeset
363 Of course the license texts themselves should not be changed at all.
c7c3e5be0d91 note about the license texinfo files
Karl Berry <karl@freefriends.org>
parents: 6989
diff changeset
364
c7c3e5be0d91 note about the license texinfo files
Karl Berry <karl@freefriends.org>
parents: 6989
diff changeset
365
7546
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
366 @node Particular Modules
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
367 @chapter Particular Modules
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
368
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
369 @menu
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
370 * Quoting::
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
371 * ctime::
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
372 * gcd::
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
373 * inet_ntoa::
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
374 * Regular expressions::
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
375 @end menu
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
376
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
377 @include quote.texi
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
378
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
379 @include ctime.texi
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
380
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
381 @include gcd.texi
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
382
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
383 @include inet_ntoa.texi
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
384
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
385 @node Regular expressions
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
386 @section Regular expressions
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
387
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
388 Gnulib supports many different types of regular expressions; although
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
389 the underlying features are the same or identical, the syntax used
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
390 varies. The descriptions given here for the different types are
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
391 generated automatically.
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
392
de9055fd713b Split the chapter "Gnulib" into 3 chapters "Introduction",
Bruno Haible <bruno@clisp.org>
parents: 7334
diff changeset
393 @include regexprops-generic.texi
5256
e23bd8e9d368 import sections from Simon
Karl Berry <karl@freefriends.org>
parents: 5239
diff changeset
394
5239
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
395
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
396 @node Copying This Manual
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
397 @appendix Copying This Manual
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
398
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
399 @menu
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
400 * GNU Free Documentation License:: License for copying this manual.
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
401 @end menu
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
402
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
403 @include fdl.texi
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
404
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
405
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
406 @node Index
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
407 @unnumbered Index
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
408
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
409 @printindex cp
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
410
9056ec9c4b2b skeleton manual
Karl Berry <karl@freefriends.org>
parents:
diff changeset
411 @bye