Codebase list eclipse-linuxtools / c3071e4
Imported Upstream version 1.2.1+dfsg Jakub Adam 11 years ago
179 changed file(s) with 0 addition(s) and 48110 deletion(s). Raw diff Collapse all Expand all
+0
-2
.gitignore less more
0 target/
1 bin/
+0
-2
changelog/.gitignore less more
0 org.eclipse.linuxtools.changelog-site
1 /target
+0
-5
changelog/org.eclipse.linuxtools.changelog-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
changelog/org.eclipse.linuxtools.changelog.c-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
changelog/org.eclipse.linuxtools.changelog.core/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
changelog/org.eclipse.linuxtools.changelog.cparser/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
changelog/org.eclipse.linuxtools.changelog.doc/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
changelog/org.eclipse.linuxtools.changelog.java-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
changelog/org.eclipse.linuxtools.changelog.javaparser/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
changelog/org.eclipse.linuxtools.changelog.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-7
changelog/org.eclipse.linuxtools.changelog.ui.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
5 screenshots
6 swtbot_tests.log
+0
-1
gcov/.gitignore less more
0 /target
+0
-5
gcov/org.eclipse.linuxtools.gcov-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
gcov/org.eclipse.linuxtools.gcov.core/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-7
gcov/org.eclipse.linuxtools.gcov.test/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
5 screenshots
6 *.jpg
+0
-1
gprof/.gitignore less more
0 /target
+0
-5
gprof/org.eclipse.linuxtools.gprof/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
gprof/org.eclipse.linuxtools.gprof-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-9
gprof/org.eclipse.linuxtools.gprof.test/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
5 bigtest_gprof_input/gmon.sum
6 foocpp_gprof_input/gmon.sum
7 foox_gprof_input/gmon.sum
8 partially-pg-build_gprof_input/gmon.sum
+0
-1
gprof/org.eclipse.linuxtools.gprof.test/bigtest_gprof_input/.gitignore less more
0 gmon.sum
gprof/org.eclipse.linuxtools.gprof.test/bigtest_gprof_input/a.out less more
Binary diff not shown
+0
-1
gprof/org.eclipse.linuxtools.gprof.test/foocpp_gprof_input/.gitignore less more
0 gmon.sum
gprof/org.eclipse.linuxtools.gprof.test/foocpp_gprof_input/a.out less more
Binary diff not shown
+0
-1
gprof/org.eclipse.linuxtools.gprof.test/foox_gprof_input/.gitignore less more
0 gmon.sum
gprof/org.eclipse.linuxtools.gprof.test/foox_gprof_input/a.out less more
Binary diff not shown
+0
-1
gprof/org.eclipse.linuxtools.gprof.test/partially-pg-build_gprof_input/.gitignore less more
0 gmon.sum
gprof/org.eclipse.linuxtools.gprof.test/partially-pg-build_gprof_input/a.out less more
Binary diff not shown
+0
-1
libhover/.gitignore less more
0 /target
+0
-5
libhover/org.eclipse.linuxtools.cdt.libhover/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
libhover/org.eclipse.linuxtools.cdt.libhover-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-1
libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/.gitignore less more
0 bin
+0
-1
libhover/org.eclipse.linuxtools.cdt.libhover.devhelp.tests/.gitignore less more
0 bin
+0
-5
libhover/org.eclipse.linuxtools.cdt.libhover.glibc/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
libhover/org.eclipse.linuxtools.cdt.libhover.glibc/data/glibc-2.14.libhover less more
Binary diff not shown
+0
-33624
libhover/org.eclipse.linuxtools.cdt.libhover.glibc/data/glibc-2.14.xml less more
0 <!-- This file automatically generated by an Eclipse utility -->
1 <!DOCTYPE descriptions [
2
3 <!ELEMENT descriptions (construct)*>
4
5 <!ELEMENT construct (structure|function)*>
6 <!ATTLIST construct
7 id ID #REQUIRED
8 type CDATA #REQUIRED
9 >
10
11 <!ELEMENT structure (synopsis?, elements?)?>
12
13 <!ELEMENT elements (element*)>
14
15 <!ELEMENT element (synopsis*)>
16 <!ATTLIST element
17 content CDATA #REQUIRED
18 >
19
20 <!ELEMENT synopsis (#PCDATA)*>
21
22 <!ELEMENT function (prototype,headers?,synopsis)>
23 <!ATTLIST function
24 returntype CDATA #REQUIRED
25 >
26
27 <!ELEMENT prototype (parameter+)?>
28
29 <!ELEMENT parameter (#PCDATA)*>
30 <!ATTLIST parameter
31 content CDATA #REQUIRED
32 >
33
34 <!ELEMENT headers (header+)?>
35
36 <!ELEMENT header (#PCDATA)*>
37 <!ATTLIST header
38 filename CDATA #REQUIRED
39 >
40
41 ]>
42
43 <descriptions>
44 <!-- Following is needed to comply with the GFDL regarding modification and invariant sections. -->
45 <construct id="function-0-REQUIRED-SECTIONS" type="function">
46 <function returntype="void">
47 <prototype>
48 </prototype>
49 <synopsis>
50 The GNU C Library (Eclipse Libhover Version)
51
52 Based on The GNU C Library
53 EDITION 0.12
54 VERSION 2.8
55 UPDATED 2007-10-27
56 ISBN 1-882114-55-8
57
58 This file documents the GNU C library.
59
60 This is based on Edition 0.12, last updated 2007-10-27
61 of The GNU C Library Reference Manual, for version 2.8.
62
63 Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002,
64 2003, 2007, 2008, 2010 Free Software Foundation, Inc.
65
66 Permission is granted to copy, distribute and/or modify this document
67 under the terms of the GNU Free Documentation License, Version 1.3 or
68 any later version published by the Free Software Foundation; with the
69 Invariant Sections being ``Free Software Needs Free Documentation''
70 and ``GNU Lesser General Public License'', the Front-Cover texts being
71 ``A GNU Manual'', and with the Back-Cover Texts as in (a) below. A
72 copy of the license is included in the section entitled "GNU Free
73 Documentation License".
74
75 (a) The FSF's Back-Cover Text is: ``You have the freedom to
76 copy and modify this GNU manual. Buying copies from the FSF
77 supports it in developing GNU and promoting software freedom.''
78
79 Authors
80 Sandra Loosemore
81 with
82 Richard M. Stallman, Roland McGrath, Andrew Oram, and Ulrich Drepper
83 Edition 0.12
84 last updated 2007-10-27
85 for version 2.8
86
87 Modified for use with Eclipse libhover plug-in by Jeff Johnston.
88
89 Modified documentation published by Eclipse Linux Tools project
90
91 Cover art for the Free Software Foundation's printed edition
92 by Etienne Suvasa.
93
94 ==================================================================================================
95
96 Free Software Needs Free Documentation
97
98 The biggest deficiency in the free software community today is not in
99 the software---it is the lack of good free documentation that we can
100 include with the free software. Many of our most important
101 programs do not come with free reference manuals and free introductory
102 texts. Documentation is an essential part of any software package;
103 when an important free software package does not come with a free
104 manual and a free tutorial, that is a major gap. We have many such
105 gaps today.
106
107 Consider Perl, for instance. The tutorial manuals that people
108 normally use are non-free. How did this come about? Because the
109 authors of those manuals published them with restrictive terms---no
110 copying, no modification, source files not available---which exclude
111 them from the free software world.
112
113 That wasn't the first time this sort of thing happened, and it was far
114 from the last. Many times we have heard a GNU user eagerly describe a
115 manual that he is writing, his intended contribution to the community,
116 only to learn that he had ruined everything by signing a publication
117 contract to make it non-free.
118
119 Free documentation, like free software, is a matter of freedom, not
120 price. The problem with the non-free manual is not that publishers
121 charge a price for printed copies---that in itself is fine. (The Free
122 Software Foundation sells printed copies of manuals, too.) The
123 problem is the restrictions on the use of the manual. Free manuals
124 are available in source code form, and give you permission to copy and
125 modify. Non-free manuals do not allow this.
126
127 The criteria of freedom for a free manual are roughly the same as for
128 free software. Redistribution (including the normal kinds of
129 commercial redistribution) must be permitted, so that the manual can
130 accompany every copy of the program, both on-line and on paper.
131
132 Permission for modification of the technical content is crucial too.
133 When people modify the software, adding or changing features, if they
134 are conscientious they will change the manual too---so they can
135 provide accurate and clear documentation for the modified program. A
136 manual that leaves you no choice but to write a new manual to document
137 a changed version of the program is not really available to our
138 community.
139
140 Some kinds of limits on the way modification is handled are
141 acceptable. For example, requirements to preserve the original
142 author's copyright notice, the distribution terms, or the list of
143 authors, are ok. It is also no problem to require modified versions
144 to include notice that they were modified. Even entire sections that
145 may not be deleted or changed are acceptable, as long as they deal
146 with nontechnical topics (like this one). These kinds of restrictions
147 are acceptable because they don't obstruct the community's normal use
148 of the manual.
149
150 However, it must be possible to modify all the @emph{technical}
151 content of the manual, and then distribute the result in all the usual
152 media, through all the usual channels. Otherwise, the restrictions
153 obstruct the use of the manual, it is not free, and we need another
154 manual to replace it.
155
156 Please spread the word about this issue. Our community continues to
157 lose manuals to proprietary publishing. If we spread the word that
158 free software needs free reference manuals and free tutorials, perhaps
159 the next person who wants to contribute by writing documentation will
160 realize, before it is too late, that only free manuals contribute to
161 the free software community.
162
163 If you are writing documentation, please insist on publishing it under
164 the GNU Free Documentation License or another free documentation
165 license. Remember that this decision requires your approval---you
166 don't have to let the publisher decide. Some commercial publishers
167 will use a free license if you insist, but they will not propose the
168 option; it is up to you to raise the issue and say firmly that this is
169 what you want. If the publisher you are dealing with refuses, please
170 try other publishers. If you're not sure whether a proposed license
171 is free, write to @email{licensing@@gnu.org}.
172
173 You can encourage commercial publishers to sell more free, copylefted
174 manuals and tutorials by buying them, and particularly by buying
175 copies from the publishers that paid for their writing or for major
176 improvements. Meanwhile, try to avoid buying non-free documentation
177 at all. Check the distribution terms of a manual before you buy it,
178 and insist that whoever seeks your business must respect your freedom.
179 Check the history of the book, and try reward the publishers that have
180 paid or pay the authors to work on it.
181
182 The Free Software Foundation maintains a list of free documentation
183 published by other publishers, at
184 http://www.fsf.org/doc/other-free-books.html.
185
186 ====================================================================================================
187
188 GNU Lesser General Public License
189
190 Version 2.1, February 1999
191
192 Copyright @copyright{} 1991, 1999 Free Software Foundation, Inc.
193 59 Temple Place -- Suite 330, Boston, MA 02111-1307, USA
194
195 Everyone is permitted to copy and distribute verbatim copies
196 of this license document, but changing it is not allowed.
197
198 [This is the first released version of the Lesser GPL. It also counts
199 as the successor of the GNU Library Public License, version 2, hence the
200 version number 2.1.]
201
202 Preamble
203
204 The licenses for most software are designed to take away your
205 freedom to share and change it. By contrast, the GNU General Public
206 Licenses are intended to guarantee your freedom to share and change
207 free software---to make sure the software is free for all its users.
208
209 This license, the Lesser General Public License, applies to some
210 specially designated software---typically libraries---of the Free
211 Software Foundation and other authors who decide to use it. You can use
212 it too, but we suggest you first think carefully about whether this
213 license or the ordinary General Public License is the better strategy to
214 use in any particular case, based on the explanations below.
215
216 When we speak of free software, we are referring to freedom of use,
217 not price. Our General Public Licenses are designed to make sure that
218 you have the freedom to distribute copies of free software (and charge
219 for this service if you wish); that you receive source code or can get
220 it if you want it; that you can change the software and use pieces of it
221 in new free programs; and that you are informed that you can do these
222 things.
223
224 To protect your rights, we need to make restrictions that forbid
225 distributors to deny you these rights or to ask you to surrender these
226 rights. These restrictions translate to certain responsibilities for
227 you if you distribute copies of the library or if you modify it.
228
229 For example, if you distribute copies of the library, whether gratis
230 or for a fee, you must give the recipients all the rights that we gave
231 you. You must make sure that they, too, receive or can get the source
232 code. If you link other code with the library, you must provide
233 complete object files to the recipients, so that they can relink them
234 with the library after making changes to the library and recompiling
235 it. And you must show them these terms so they know their rights.
236
237 We protect your rights with a two-step method: (1) we copyright the
238 library, and (2) we offer you this license, which gives you legal
239 permission to copy, distribute and/or modify the library.
240
241 To protect each distributor, we want to make it very clear that
242 there is no warranty for the free library. Also, if the library is
243 modified by someone else and passed on, the recipients should know
244 that what they have is not the original version, so that the original
245 author's reputation will not be affected by problems that might be
246 introduced by others.
247
248 Finally, software patents pose a constant threat to the existence of
249 any free program. We wish to make sure that a company cannot
250 effectively restrict the users of a free program by obtaining a
251 restrictive license from a patent holder. Therefore, we insist that
252 any patent license obtained for a version of the library must be
253 consistent with the full freedom of use specified in this license.
254
255 Most GNU software, including some libraries, is covered by the
256 ordinary GNU General Public License. This license, the GNU Lesser
257 General Public License, applies to certain designated libraries, and
258 is quite different from the ordinary General Public License. We use
259 this license for certain libraries in order to permit linking those
260 libraries into non-free programs.
261
262 When a program is linked with a library, whether statically or using
263 a shared library, the combination of the two is legally speaking a
264 combined work, a derivative of the original library. The ordinary
265 General Public License therefore permits such linking only if the
266 entire combination fits its criteria of freedom. The Lesser General
267 Public License permits more lax criteria for linking other code with
268 the library.
269
270 We call this license the @dfn{Lesser} General Public License because it
271 does @emph{Less} to protect the user's freedom than the ordinary General
272 Public License. It also provides other free software developers Less
273 of an advantage over competing non-free programs. These disadvantages
274 are the reason we use the ordinary General Public License for many
275 libraries. However, the Lesser license provides advantages in certain
276 special circumstances.
277
278 For example, on rare occasions, there may be a special need to
279 encourage the widest possible use of a certain library, so that it becomes
280 a de-facto standard. To achieve this, non-free programs must be
281 allowed to use the library. A more frequent case is that a free
282 library does the same job as widely used non-free libraries. In this
283 case, there is little to gain by limiting the free library to free
284 software only, so we use the Lesser General Public License.
285
286 In other cases, permission to use a particular library in non-free
287 programs enables a greater number of people to use a large body of
288 free software. For example, permission to use the GNU C Library in
289 non-free programs enables many more people to use the whole GNU
290 operating system, as well as its variant, the GNU/Linux operating
291 system.
292
293 Although the Lesser General Public License is Less protective of the
294 users' freedom, it does ensure that the user of a program that is
295 linked with the Library has the freedom and the wherewithal to run
296 that program using a modified version of the Library.
297
298 The precise terms and conditions for copying, distribution and
299 modification follow. Pay close attention to the difference between a
300 ``work based on the library'' and a ``work that uses the library''. The
301 former contains code derived from the library, whereas the latter must
302 be combined with the library in order to run.
303
304 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
305
306 0.
307 This License Agreement applies to any software library or other program
308 which contains a notice placed by the copyright holder or other
309 authorized party saying it may be distributed under the terms of this
310 Lesser General Public License (also called ``this License''). Each
311 licensee is addressed as ``you''.
312
313 A ``library'' means a collection of software functions and/or data
314 prepared so as to be conveniently linked with application programs
315 (which use some of those functions and data) to form executables.
316
317 The ``Library'', below, refers to any such software library or work
318 which has been distributed under these terms. A ``work based on the
319 Library'' means either the Library or any derivative work under
320 copyright law: that is to say, a work containing the Library or a
321 portion of it, either verbatim or with modifications and/or translated
322 straightforwardly into another language. (Hereinafter, translation is
323 included without limitation in the term ``modification''.)
324
325 ``Source code'' for a work means the preferred form of the work for
326 making modifications to it. For a library, complete source code means
327 all the source code for all modules it contains, plus any associated
328 interface definition files, plus the scripts used to control compilation
329 and installation of the library.
330
331 Activities other than copying, distribution and modification are not
332 covered by this License; they are outside its scope. The act of
333 running a program using the Library is not restricted, and output from
334 such a program is covered only if its contents constitute a work based
335 on the Library (independent of the use of the Library in a tool for
336 writing it). Whether that is true depends on what the Library does
337 and what the program that uses the Library does.
338
339 1.
340 You may copy and distribute verbatim copies of the Library's
341 complete source code as you receive it, in any medium, provided that
342 you conspicuously and appropriately publish on each copy an
343 appropriate copyright notice and disclaimer of warranty; keep intact
344 all the notices that refer to this License and to the absence of any
345 warranty; and distribute a copy of this License along with the
346 Library.
347
348 You may charge a fee for the physical act of transferring a copy,
349 and you may at your option offer warranty protection in exchange for a
350 fee.
351
352 2.
353 You may modify your copy or copies of the Library or any portion
354 of it, thus forming a work based on the Library, and copy and
355 distribute such modifications or work under the terms of Section 1
356 above, provided that you also meet all of these conditions:
357
358 a. The modified work must itself be a software library.
359
360 b. You must cause the files modified to carry prominent notices
361 stating that you changed the files and the date of any change.
362
363 c. You must cause the whole of the work to be licensed at no
364 charge to all third parties under the terms of this License.
365
366 d. If a facility in the modified Library refers to a function or a
367 table of data to be supplied by an application program that uses
368 the facility, other than as an argument passed when the facility
369 is invoked, then you must make a good faith effort to ensure that,
370 in the event an application does not supply such function or
371 table, the facility still operates, and performs whatever part of
372 its purpose remains meaningful.
373
374 (For example, a function in a library to compute square roots has
375 a purpose that is entirely well-defined independent of the
376 application. Therefore, Subsection 2d requires that any
377 application-supplied function or table used by this function must
378 be optional: if the application does not supply it, the square
379 root function must still compute square roots.)
380 @end enumerate
381
382 These requirements apply to the modified work as a whole. If
383 identifiable sections of that work are not derived from the Library,
384 and can be reasonably considered independent and separate works in
385 themselves, then this License, and its terms, do not apply to those
386 sections when you distribute them as separate works. But when you
387 distribute the same sections as part of a whole which is a work based
388 on the Library, the distribution of the whole must be on the terms of
389 this License, whose permissions for other licensees extend to the
390 entire whole, and thus to each and every part regardless of who wrote
391 it.
392
393 Thus, it is not the intent of this section to claim rights or contest
394 your rights to work written entirely by you; rather, the intent is to
395 exercise the right to control the distribution of derivative or
396 collective works based on the Library.
397
398 In addition, mere aggregation of another work not based on the Library
399 with the Library (or with a work based on the Library) on a volume of
400 a storage or distribution medium does not bring the other work under
401 the scope of this License.
402
403 3.
404 You may opt to apply the terms of the ordinary GNU General Public
405 License instead of this License to a given copy of the Library. To do
406 this, you must alter all the notices that refer to this License, so
407 that they refer to the ordinary GNU General Public License, version 2,
408 instead of to this License. (If a newer version than version 2 of the
409 ordinary GNU General Public License has appeared, then you can specify
410 that version instead if you wish.) Do not make any other change in
411 these notices.
412
413 Once this change is made in a given copy, it is irreversible for
414 that copy, so the ordinary GNU General Public License applies to all
415 subsequent copies and derivative works made from that copy.
416
417 This option is useful when you wish to copy part of the code of
418 the Library into a program that is not a library.
419
420 4.
421 You may copy and distribute the Library (or a portion or
422 derivative of it, under Section 2) in object code or executable form
423 under the terms of Sections 1 and 2 above provided that you accompany
424 it with the complete corresponding machine-readable source code, which
425 must be distributed under the terms of Sections 1 and 2 above on a
426 medium customarily used for software interchange.
427
428 If distribution of object code is made by offering access to copy
429 from a designated place, then offering equivalent access to copy the
430 source code from the same place satisfies the requirement to
431 distribute the source code, even though third parties are not
432 compelled to copy the source along with the object code.
433
434 5.
435 A program that contains no derivative of any portion of the
436 Library, but is designed to work with the Library by being compiled or
437 linked with it, is called a ``work that uses the Library''. Such a
438 work, in isolation, is not a derivative work of the Library, and
439 therefore falls outside the scope of this License.
440
441 However, linking a ``work that uses the Library'' with the Library
442 creates an executable that is a derivative of the Library (because it
443 contains portions of the Library), rather than a ``work that uses the
444 library''. The executable is therefore covered by this License.
445 Section 6 states terms for distribution of such executables.
446
447 When a ``work that uses the Library'' uses material from a header file
448 that is part of the Library, the object code for the work may be a
449 derivative work of the Library even though the source code is not.
450 Whether this is true is especially significant if the work can be
451 linked without the Library, or if the work is itself a library. The
452 threshold for this to be true is not precisely defined by law.
453
454 If such an object file uses only numerical parameters, data
455 structure layouts and accessors, and small macros and small inline
456 functions (ten lines or less in length), then the use of the object
457 file is unrestricted, regardless of whether it is legally a derivative
458 work. (Executables containing this object code plus portions of the
459 Library will still fall under Section 6.)
460
461 Otherwise, if the work is a derivative of the Library, you may
462 distribute the object code for the work under the terms of Section 6.
463 Any executables containing that work also fall under Section 6,
464 whether or not they are linked directly with the Library itself.
465
466 6.
467 As an exception to the Sections above, you may also combine or
468 link a ``work that uses the Library'' with the Library to produce a
469 work containing portions of the Library, and distribute that work
470 under terms of your choice, provided that the terms permit
471 modification of the work for the customer's own use and reverse
472 engineering for debugging such modifications.
473
474 You must give prominent notice with each copy of the work that the
475 Library is used in it and that the Library and its use are covered by
476 this License. You must supply a copy of this License. If the work
477 during execution displays copyright notices, you must include the
478 copyright notice for the Library among them, as well as a reference
479 directing the user to the copy of this License. Also, you must do one
480 of these things:
481
482 a. Accompany the work with the complete corresponding
483 machine-readable source code for the Library including whatever
484 changes were used in the work (which must be distributed under
485 Sections 1 and 2 above); and, if the work is an executable linked
486 with the Library, with the complete machine-readable ``work that
487 uses the Library'', as object code and/or source code, so that the
488 user can modify the Library and then relink to produce a modified
489 executable containing the modified Library. (It is understood
490 that the user who changes the contents of definitions files in the
491 Library will not necessarily be able to recompile the application
492 to use the modified definitions.)
493
494 b. Use a suitable shared library mechanism for linking with the Library. A
495 suitable mechanism is one that (1) uses at run time a copy of the
496 library already present on the user's computer system, rather than
497 copying library functions into the executable, and (2) will operate
498 properly with a modified version of the library, if the user installs
499 one, as long as the modified version is interface-compatible with the
500 version that the work was made with.
501
502 c. Accompany the work with a written offer, valid for at
503 least three years, to give the same user the materials
504 specified in Subsection 6a, above, for a charge no more
505 than the cost of performing this distribution.
506
507 d. If distribution of the work is made by offering access to copy
508 from a designated place, offer equivalent access to copy the above
509 specified materials from the same place.
510
511 e. Verify that the user has already received a copy of these
512 materials or that you have already sent this user a copy.
513 @end enumerate
514
515 For an executable, the required form of the ``work that uses the
516 Library'' must include any data and utility programs needed for
517 reproducing the executable from it. However, as a special exception,
518 the materials to be distributed need not include anything that is
519 normally distributed (in either source or binary form) with the major
520 components (compiler, kernel, and so on) of the operating system on
521 which the executable runs, unless that component itself accompanies the
522 executable.
523
524 It may happen that this requirement contradicts the license
525 restrictions of other proprietary libraries that do not normally
526 accompany the operating system. Such a contradiction means you cannot
527 use both them and the Library together in an executable that you
528 distribute.
529
530 7.
531 You may place library facilities that are a work based on the
532 Library side-by-side in a single library together with other library
533 facilities not covered by this License, and distribute such a combined
534 library, provided that the separate distribution of the work based on
535 the Library and of the other library facilities is otherwise
536 permitted, and provided that you do these two things:
537
538 a. Accompany the combined library with a copy of the same work
539 based on the Library, uncombined with any other library
540 facilities. This must be distributed under the terms of the
541 Sections above.
542
543 b. Give prominent notice with the combined library of the fact
544 that part of it is a work based on the Library, and explaining
545 where to find the accompanying uncombined form of the same work.
546
547 8.
548 You may not copy, modify, sublicense, link with, or distribute
549 the Library except as expressly provided under this License. Any
550 attempt otherwise to copy, modify, sublicense, link with, or
551 distribute the Library is void, and will automatically terminate your
552 rights under this License. However, parties who have received copies,
553 or rights, from you under this License will not have their licenses
554 terminated so long as such parties remain in full compliance.
555
556 9.
557 You are not required to accept this License, since you have not
558 signed it. However, nothing else grants you permission to modify or
559 distribute the Library or its derivative works. These actions are
560 prohibited by law if you do not accept this License. Therefore, by
561 modifying or distributing the Library (or any work based on the
562 Library), you indicate your acceptance of this License to do so, and
563 all its terms and conditions for copying, distributing or modifying
564 the Library or works based on it.
565
566 10.
567 Each time you redistribute the Library (or any work based on the
568 Library), the recipient automatically receives a license from the
569 original licensor to copy, distribute, link with or modify the Library
570 subject to these terms and conditions. You may not impose any further
571 restrictions on the recipients' exercise of the rights granted herein.
572 You are not responsible for enforcing compliance by third parties with
573 this License.
574
575 11.
576 If, as a consequence of a court judgment or allegation of patent
577 infringement or for any other reason (not limited to patent issues),
578 conditions are imposed on you (whether by court order, agreement or
579 otherwise) that contradict the conditions of this License, they do not
580 excuse you from the conditions of this License. If you cannot
581 distribute so as to satisfy simultaneously your obligations under this
582 License and any other pertinent obligations, then as a consequence you
583 may not distribute the Library at all. For example, if a patent
584 license would not permit royalty-free redistribution of the Library by
585 all those who receive copies directly or indirectly through you, then
586 the only way you could satisfy both it and this License would be to
587 refrain entirely from distribution of the Library.
588
589 If any portion of this section is held invalid or unenforceable under any
590 particular circumstance, the balance of the section is intended to apply,
591 and the section as a whole is intended to apply in other circumstances.
592
593 It is not the purpose of this section to induce you to infringe any
594 patents or other property right claims or to contest validity of any
595 such claims; this section has the sole purpose of protecting the
596 integrity of the free software distribution system which is
597 implemented by public license practices. Many people have made
598 generous contributions to the wide range of software distributed
599 through that system in reliance on consistent application of that
600 system; it is up to the author/donor to decide if he or she is willing
601 to distribute software through any other system and a licensee cannot
602 impose that choice.
603
604 This section is intended to make thoroughly clear what is believed to
605 be a consequence of the rest of this License.
606
607 12.
608 If the distribution and/or use of the Library is restricted in
609 certain countries either by patents or by copyrighted interfaces, the
610 original copyright holder who places the Library under this License may add
611 an explicit geographical distribution limitation excluding those countries,
612 so that distribution is permitted only in or among countries not thus
613 excluded. In such case, this License incorporates the limitation as if
614 written in the body of this License.
615
616 13.
617 The Free Software Foundation may publish revised and/or new
618 versions of the Lesser General Public License from time to time.
619 Such new versions will be similar in spirit to the present version,
620 but may differ in detail to address new problems or concerns.
621
622 Each version is given a distinguishing version number. If the Library
623 specifies a version number of this License which applies to it and
624 ``any later version'', you have the option of following the terms and
625 conditions either of that version or of any later version published by
626 the Free Software Foundation. If the Library does not specify a
627 license version number, you may choose any version ever published by
628 the Free Software Foundation.
629
630 14.
631 If you wish to incorporate parts of the Library into other free
632 programs whose distribution conditions are incompatible with these,
633 write to the author to ask for permission. For software which is
634 copyrighted by the Free Software Foundation, write to the Free
635 Software Foundation; we sometimes make exceptions for this. Our
636 decision will be guided by the two goals of preserving the free status
637 of all derivatives of our free software and of promoting the sharing
638 and reuse of software generally.
639
640 NO WARRANTY
641
642 15.
643 BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
644 WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
645 EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
646 OTHER PARTIES PROVIDE THE LIBRARY ``AS IS'' WITHOUT WARRANTY OF ANY
647 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
648 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
649 PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
650 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
651 THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
652
653 16.
654 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
655 WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
656 AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
657 FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
658 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
659 LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
660 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
661 FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
662 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
663 DAMAGES.
664
665 END OF TERMS AND CONDITIONS
666
667 How to Apply These Terms to Your New Libraries
668
669 If you develop a new library, and you want it to be of the greatest
670 possible use to the public, we recommend making it free software that
671 everyone can redistribute and change. You can do so by permitting
672 redistribution under these terms (or, alternatively, under the terms of the
673 ordinary General Public License).
674
675 To apply these terms, attach the following notices to the library. It is
676 safest to attach them to the start of each source file to most effectively
677 convey the exclusion of warranty; and each file should have at least the
678 ``copyright'' line and a pointer to where the full notice is found.
679
680 one line to give the library's name and an idea of what it does.
681 Copyright (C) year name of author
682
683 This library is free software; you can redistribute it and/or modify it
684 under the terms of the GNU Lesser General Public License as published by
685 the Free Software Foundation; either version 2.1 of the License, or (at
686 your option) any later version.
687
688 This library is distributed in the hope that it will be useful, but
689 WITHOUT ANY WARRANTY; without even the implied warranty of
690 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
691 Lesser General Public License for more details.
692
693 You should have received a copy of the GNU Lesser General Public
694 License along with this library; if not, write to the Free Software
695 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
696 USA.
697
698 Also add information on how to contact you by electronic and paper mail.
699
700 You should also get your employer (if you work as a programmer) or your
701 school, if any, to sign a ``copyright disclaimer'' for the library, if
702 necessary. Here is a sample; alter the names:
703
704 Yoyodyne, Inc., hereby disclaims all copyright interest in the library
705 `Frob' (a library for tweaking knobs) written by James Random Hacker.
706
707 signature of Ty Coon, 1 April 1990
708 Ty Coon, President of Vice
709
710 That's all there is to it!
711
712 ====================================================================================================
713
714 GNU Free Documentation License
715
716 Version 1.1, March 2000
717
718 Copyright @copyright{} 2000 Free Software Foundation, Inc.
719 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
720
721 Everyone is permitted to copy and distribute verbatim copies
722 of this license document, but changing it is not allowed.
723 @end display
724
725 0.
726 PREAMBLE
727
728 The purpose of this License is to make a manual, textbook, or other
729 written document @dfn{free} in the sense of freedom: to assure everyone
730 the effective freedom to copy and redistribute it, with or without
731 modifying it, either commercially or noncommercially. Secondarily,
732 this License preserves for the author and publisher a way to get
733 credit for their work, while not being considered responsible for
734 modifications made by others.
735
736 This License is a kind of ``copyleft'', which means that derivative
737 works of the document must themselves be free in the same sense. It
738 complements the GNU General Public License, which is a copyleft
739 license designed for free software.
740
741 We have designed this License in order to use it for manuals for free
742 software, because free software needs free documentation: a free
743 program should come with manuals providing the same freedoms that the
744 software does. But this License is not limited to software manuals;
745 it can be used for any textual work, regardless of subject matter or
746 whether it is published as a printed book. We recommend this License
747 principally for works whose purpose is instruction or reference.
748
749 1.
750 APPLICABILITY AND DEFINITIONS
751
752 This License applies to any manual or other work that contains a
753 notice placed by the copyright holder saying it can be distributed
754 under the terms of this License. The ``Document'', below, refers to any
755 such manual or work. Any member of the public is a licensee, and is
756 addressed as ``you''.
757
758 A ``Modified Version'' of the Document means any work containing the
759 Document or a portion of it, either copied verbatim, or with
760 modifications and/or translated into another language.
761
762 A ``Secondary Section'' is a named appendix or a front-matter section of
763 the Document that deals exclusively with the relationship of the
764 publishers or authors of the Document to the Document's overall subject
765 (or to related matters) and contains nothing that could fall directly
766 within that overall subject. (For example, if the Document is in part a
767 textbook of mathematics, a Secondary Section may not explain any
768 mathematics.) The relationship could be a matter of historical
769 connection with the subject or with related matters, or of legal,
770 commercial, philosophical, ethical or political position regarding
771 them.
772
773 The ``Invariant Sections'' are certain Secondary Sections whose titles
774 are designated, as being those of Invariant Sections, in the notice
775 that says that the Document is released under this License.
776
777 The ``Cover Texts'' are certain short passages of text that are listed,
778 as Front-Cover Texts or Back-Cover Texts, in the notice that says that
779 the Document is released under this License.
780
781 A ``Transparent'' copy of the Document means a machine-readable copy,
782 represented in a format whose specification is available to the
783 general public, whose contents can be viewed and edited directly and
784 straightforwardly with generic text editors or (for images composed of
785 pixels) generic paint programs or (for drawings) some widely available
786 drawing editor, and that is suitable for input to text formatters or
787 for automatic translation to a variety of formats suitable for input
788 to text formatters. A copy made in an otherwise Transparent file
789 format whose markup has been designed to thwart or discourage
790 subsequent modification by readers is not Transparent. A copy that is
791 not ``Transparent'' is called ``Opaque''.
792
793 Examples of suitable formats for Transparent copies include plain
794 @sc{ascii} without markup, Texinfo input format, La@TeX{} input format,
795 @acronym{SGML} or @acronym{XML} using a publicly available
796 @acronym{DTD}, and standard-conforming simple @acronym{HTML} designed
797 for human modification. Opaque formats include PostScript,
798 @acronym{PDF}, proprietary formats that can be read and edited only by
799 proprietary word processors, @acronym{SGML} or @acronym{XML} for which
800 the @acronym{DTD} and/or processing tools are not generally available,
801 and the machine-generated @acronym{HTML} produced by some word
802 processors for output purposes only.
803
804 The ``Title Page'' means, for a printed book, the title page itself,
805 plus such following pages as are needed to hold, legibly, the material
806 this License requires to appear in the title page. For works in
807 formats which do not have any title page as such, ``Title Page'' means
808 the text near the most prominent appearance of the work's title,
809 preceding the beginning of the body of the text.
810
811 2.
812 VERBATIM COPYING
813
814 You may copy and distribute the Document in any medium, either
815 commercially or noncommercially, provided that this License, the
816 copyright notices, and the license notice saying this License applies
817 to the Document are reproduced in all copies, and that you add no other
818 conditions whatsoever to those of this License. You may not use
819 technical measures to obstruct or control the reading or further
820 copying of the copies you make or distribute. However, you may accept
821 compensation in exchange for copies. If you distribute a large enough
822 number of copies you must also follow the conditions in section 3.
823
824 You may also lend copies, under the same conditions stated above, and
825 you may publicly display copies.
826
827 3.
828 COPYING IN QUANTITY
829
830 If you publish printed copies of the Document numbering more than 100,
831 and the Document's license notice requires Cover Texts, you must enclose
832 the copies in covers that carry, clearly and legibly, all these Cover
833 Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
834 the back cover. Both covers must also clearly and legibly identify
835 you as the publisher of these copies. The front cover must present
836 the full title with all words of the title equally prominent and
837 visible. You may add other material on the covers in addition.
838 Copying with changes limited to the covers, as long as they preserve
839 the title of the Document and satisfy these conditions, can be treated
840 as verbatim copying in other respects.
841
842 If the required texts for either cover are too voluminous to fit
843 legibly, you should put the first ones listed (as many as fit
844 reasonably) on the actual cover, and continue the rest onto adjacent
845 pages.
846
847 If you publish or distribute Opaque copies of the Document numbering
848 more than 100, you must either include a machine-readable Transparent
849 copy along with each Opaque copy, or state in or with each Opaque copy
850 a publicly-accessible computer-network location containing a complete
851 Transparent copy of the Document, free of added material, which the
852 general network-using public has access to download anonymously at no
853 charge using public-standard network protocols. If you use the latter
854 option, you must take reasonably prudent steps, when you begin
855 distribution of Opaque copies in quantity, to ensure that this
856 Transparent copy will remain thus accessible at the stated location
857 until at least one year after the last time you distribute an Opaque
858 copy (directly or through your agents or retailers) of that edition to
859 the public.
860
861 It is requested, but not required, that you contact the authors of the
862 Document well before redistributing any large number of copies, to give
863 them a chance to provide you with an updated version of the Document.
864
865 4.
866 MODIFICATIONS
867
868 You may copy and distribute a Modified Version of the Document under
869 the conditions of sections 2 and 3 above, provided that you release
870 the Modified Version under precisely this License, with the Modified
871 Version filling the role of the Document, thus licensing distribution
872 and modification of the Modified Version to whoever possesses a copy
873 of it. In addition, you must do these things in the Modified Version:
874
875 A.
876 Use in the Title Page (and on the covers, if any) a title distinct
877 from that of the Document, and from those of previous versions
878 (which should, if there were any, be listed in the History section
879 of the Document). You may use the same title as a previous version
880 if the original publisher of that version gives permission.
881
882 B.
883 List on the Title Page, as authors, one or more persons or entities
884 responsible for authorship of the modifications in the Modified
885 Version, together with at least five of the principal authors of the
886 Document (all of its principal authors, if it has less than five).
887
888 C.
889 State on the Title page the name of the publisher of the
890 Modified Version, as the publisher.
891
892 D.
893 Preserve all the copyright notices of the Document.
894
895 E.
896 Add an appropriate copyright notice for your modifications
897 adjacent to the other copyright notices.
898
899 F.
900 Include, immediately after the copyright notices, a license notice
901 giving the public permission to use the Modified Version under the
902 terms of this License, in the form shown in the Addendum below.
903
904 G.
905 Preserve in that license notice the full lists of Invariant Sections
906 and required Cover Texts given in the Document's license notice.
907
908 H.
909 Include an unaltered copy of this License.
910
911 I.
912 Preserve the section entitled ``History'', and its title, and add to
913 it an item stating at least the title, year, new authors, and
914 publisher of the Modified Version as given on the Title Page. If
915 there is no section entitled ``History'' in the Document, create one
916 stating the title, year, authors, and publisher of the Document as
917 given on its Title Page, then add an item describing the Modified
918 Version as stated in the previous sentence.
919
920 J.
921 Preserve the network location, if any, given in the Document for
922 public access to a Transparent copy of the Document, and likewise
923 the network locations given in the Document for previous versions
924 it was based on. These may be placed in the ``History'' section.
925 You may omit a network location for a work that was published at
926 least four years before the Document itself, or if the original
927 publisher of the version it refers to gives permission.
928
929 K.
930 In any section entitled ``Acknowledgments'' or ``Dedications'',
931 preserve the section's title, and preserve in the section all the
932 substance and tone of each of the contributor acknowledgments
933 and/or dedications given therein.
934
935 L.
936 Preserve all the Invariant Sections of the Document,
937 unaltered in their text and in their titles. Section numbers
938 or the equivalent are not considered part of the section titles.
939
940 M.
941 Delete any section entitled ``Endorsements''. Such a section
942 may not be included in the Modified Version.
943
944 N.
945 Do not retitle any existing section as ``Endorsements''
946 or to conflict in title with any Invariant Section.
947
948 If the Modified Version includes new front-matter sections or
949 appendices that qualify as Secondary Sections and contain no material
950 copied from the Document, you may at your option designate some or all
951 of these sections as invariant. To do this, add their titles to the
952 list of Invariant Sections in the Modified Version's license notice.
953 These titles must be distinct from any other section titles.
954
955 You may add a section entitled ``Endorsements'', provided it contains
956 nothing but endorsements of your Modified Version by various
957 parties---for example, statements of peer review or that the text has
958 been approved by an organization as the authoritative definition of a
959 standard.
960
961 You may add a passage of up to five words as a Front-Cover Text, and a
962 passage of up to 25 words as a Back-Cover Text, to the end of the list
963 of Cover Texts in the Modified Version. Only one passage of
964 Front-Cover Text and one of Back-Cover Text may be added by (or
965 through arrangements made by) any one entity. If the Document already
966 includes a cover text for the same cover, previously added by you or
967 by arrangement made by the same entity you are acting on behalf of,
968 you may not add another; but you may replace the old one, on explicit
969 permission from the previous publisher that added the old one.
970
971 The author(s) and publisher(s) of the Document do not by this License
972 give permission to use their names for publicity for or to assert or
973 imply endorsement of any Modified Version.
974
975 5.
976 COMBINING DOCUMENTS
977
978 You may combine the Document with other documents released under this
979 License, under the terms defined in section 4 above for modified
980 versions, provided that you include in the combination all of the
981 Invariant Sections of all of the original documents, unmodified, and
982 list them all as Invariant Sections of your combined work in its
983 license notice.
984
985 The combined work need only contain one copy of this License, and
986 multiple identical Invariant Sections may be replaced with a single
987 copy. If there are multiple Invariant Sections with the same name but
988 different contents, make the title of each such section unique by
989 adding at the end of it, in parentheses, the name of the original
990 author or publisher of that section if known, or else a unique number.
991 Make the same adjustment to the section titles in the list of
992 Invariant Sections in the license notice of the combined work.
993
994 In the combination, you must combine any sections entitled ``History''
995 in the various original documents, forming one section entitled
996 ``History''; likewise combine any sections entitled ``Acknowledgments'',
997 and any sections entitled ``Dedications''. You must delete all sections
998 entitled ``Endorsements.''
999
1000 6.
1001 COLLECTIONS OF DOCUMENTS
1002
1003 You may make a collection consisting of the Document and other documents
1004 released under this License, and replace the individual copies of this
1005 License in the various documents with a single copy that is included in
1006 the collection, provided that you follow the rules of this License for
1007 verbatim copying of each of the documents in all other respects.
1008
1009 You may extract a single document from such a collection, and distribute
1010 it individually under this License, provided you insert a copy of this
1011 License into the extracted document, and follow this License in all
1012 other respects regarding verbatim copying of that document.
1013
1014 7.
1015 AGGREGATION WITH INDEPENDENT WORKS
1016
1017 A compilation of the Document or its derivatives with other separate
1018 and independent documents or works, in or on a volume of a storage or
1019 distribution medium, does not as a whole count as a Modified Version
1020 of the Document, provided no compilation copyright is claimed for the
1021 compilation. Such a compilation is called an ``aggregate'', and this
1022 License does not apply to the other self-contained works thus compiled
1023 with the Document, on account of their being thus compiled, if they
1024 are not themselves derivative works of the Document.
1025
1026 If the Cover Text requirement of section 3 is applicable to these
1027 copies of the Document, then if the Document is less than one quarter
1028 of the entire aggregate, the Document's Cover Texts may be placed on
1029 covers that surround only the Document within the aggregate.
1030 Otherwise they must appear on covers around the whole aggregate.
1031
1032 8.
1033 TRANSLATION
1034
1035 Translation is considered a kind of modification, so you may
1036 distribute translations of the Document under the terms of section 4.
1037 Replacing Invariant Sections with translations requires special
1038 permission from their copyright holders, but you may include
1039 translations of some or all Invariant Sections in addition to the
1040 original versions of these Invariant Sections. You may include a
1041 translation of this License provided that you also include the
1042 original English version of this License. In case of a disagreement
1043 between the translation and the original English version of this
1044 License, the original English version will prevail.
1045
1046 9.
1047 TERMINATION
1048
1049 You may not copy, modify, sublicense, or distribute the Document except
1050 as expressly provided for under this License. Any other attempt to
1051 copy, modify, sublicense or distribute the Document is void, and will
1052 automatically terminate your rights under this License. However,
1053 parties who have received copies, or rights, from you under this
1054 License will not have their licenses terminated so long as such
1055 parties remain in full compliance.
1056
1057 10.
1058 FUTURE REVISIONS OF THIS LICENSE
1059
1060 The Free Software Foundation may publish new, revised versions
1061 of the GNU Free Documentation License from time to time. Such new
1062 versions will be similar in spirit to the present version, but may
1063 differ in detail to address new problems or concerns. See
1064 @uref{http://www.gnu.org/copyleft/}.
1065
1066 Each version of the License is given a distinguishing version number.
1067 If the Document specifies that a particular numbered version of this
1068 License ``or any later version'' applies to it, you have the option of
1069 following the terms and conditions either of that specified version or
1070 of any later version that has been published (not as a draft) by the
1071 Free Software Foundation. If the Document does not specify a version
1072 number of this License, you may choose any version ever published (not
1073 as a draft) by the Free Software Foundation.
1074 @end enumerate
1075
1076 ADDENDUM: How to use this License for your documents
1077
1078 To use this License in a document you have written, include a copy of
1079 the License in the document and put the following copyright and
1080 license notices just after the title page:
1081
1082 Copyright (C) year your name.
1083 Permission is granted to copy, distribute and/or modify this document
1084 under the terms of the GNU Free Documentation License, Version 1.1
1085 or any later version published by the Free Software Foundation;
1086 with the Invariant Sections being @var{list their titles}, with the
1087 Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}.
1088 A copy of the license is included in the section entitled ``GNU
1089 Free Documentation License''.
1090
1091 If you have no Invariant Sections, write ``with no Invariant Sections''
1092 instead of saying which ones are invariant. If you have no
1093 Front-Cover Texts, write ``no Front-Cover Texts'' instead of
1094 ``Front-Cover Texts being @var{list}''; likewise for Back-Cover Texts.
1095
1096 If your document contains nontrivial examples of program code, we
1097 recommend releasing these examples in parallel under your choice of
1098 free software license, such as the GNU General Public License,
1099 to permit their use in free software.
1100
1101 ========================================================================================
1102
1103 A transparent copy of this modified document can be found along-side the binary .libhover file
1104 in the org.eclipse.cdt.libhover.glibc plug-in jar under the data directory. The plug-in can be
1105 unzipped via "unzip". The original un-modified document can be generated from the sources which
1106 can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
1107
1108 </synopsis>
1109 </function>
1110 </construct>
1111 <construct id="function-getpass" type="function">
1112 <function returntype="char *">
1113 <prototype>
1114 <parameter content="const char *prompt"/>
1115 </prototype>
1116 <headers>
1117 <header filename = "unistd.h"/>
1118 </headers>
1119 <synopsis>
1120 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;getpass&lt;/CODE&gt; outputs &lt;VAR&gt;prompt&lt;/VAR&gt;, then reads a string in from the
1121 terminal without echoing it. It tries to connect to the real terminal,
1122 &lt;TT&gt;/dev/tty&lt;/TT&gt;, if possible, to encourage users not to put plaintext
1123 passwords in files; otherwise, it uses &lt;CODE&gt;stdin&lt;/CODE&gt; and &lt;CODE&gt;stderr&lt;/CODE&gt;.
1124 &lt;CODE&gt;getpass&lt;/CODE&gt; also disables the INTR, QUIT, and SUSP characters on the
1125 terminal using the &lt;CODE&gt;ISIG&lt;/CODE&gt; terminal attribute .
1126 The terminal is flushed before and after &lt;CODE&gt;getpass&lt;/CODE&gt;, so that
1127 characters of a mistyped password are not accidentally visible.
1128 &lt;br&gt;&lt;br&gt; In other C libraries, &lt;CODE&gt;getpass&lt;/CODE&gt; may only return the first
1129 &lt;CODE&gt;PASS_MAX&lt;/CODE&gt; bytes of a password. The GNU C library has no limit, so
1130 &lt;CODE&gt;PASS_MAX&lt;/CODE&gt; is undefined.
1131 &lt;br&gt;&lt;br&gt; The prototype for this function is in &lt;TT&gt;unistd.h&lt;/TT&gt;. &lt;CODE&gt;PASS_MAX&lt;/CODE&gt;
1132 would be defined in &lt;TT&gt;limits.h&lt;/TT&gt;.
1133 </synopsis>
1134 </function>
1135 </construct>
1136 <construct id="function-crypt" type="function">
1137 <function returntype="char *">
1138 <prototype>
1139 <parameter content="const char *key"/>
1140 <parameter content="const char *salt"/>
1141 </prototype>
1142 <headers>
1143 <header filename = "crypt.h"/>
1144 </headers>
1145 <synopsis>
1146 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;crypt&lt;/CODE&gt; function takes a password, &lt;VAR&gt;key&lt;/VAR&gt;, as a string, and
1147 a &lt;VAR&gt;salt&lt;/VAR&gt; character array which is described below, and returns a
1148 printable ASCII string which starts with another salt. It is believed
1149 that, given the output of the function, the best way to find a &lt;VAR&gt;key&lt;/VAR&gt;
1150 that will produce that output is to guess values of &lt;VAR&gt;key&lt;/VAR&gt; until the
1151 original value of &lt;VAR&gt;key&lt;/VAR&gt; is found.
1152 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;salt&lt;/VAR&gt; parameter does two things. Firstly, it selects which
1153 algorithm is used, the MD5-based one or the DES-based one. Secondly, it
1154 makes life harder for someone trying to guess passwords against a file
1155 containing many passwords; without a &lt;VAR&gt;salt&lt;/VAR&gt;, an intruder can make a
1156 guess, run &lt;CODE&gt;crypt&lt;/CODE&gt; on it once, and compare the result with all the
1157 passwords. With a &lt;VAR&gt;salt&lt;/VAR&gt;, the intruder must run &lt;CODE&gt;crypt&lt;/CODE&gt; once
1158 for each different salt.
1159 &lt;br&gt;&lt;br&gt; For the MD5-based algorithm, the &lt;VAR&gt;salt&lt;/VAR&gt; should consist of the string
1160 &lt;CODE&gt;$1$&lt;/CODE&gt;, followed by up to 8 characters, terminated by either
1161 another &lt;CODE&gt;$&lt;/CODE&gt; or the end of the string. The result of &lt;CODE&gt;crypt&lt;/CODE&gt;
1162 will be the &lt;VAR&gt;salt&lt;/VAR&gt;, followed by a &lt;CODE&gt;$&lt;/CODE&gt; if the salt didn't end
1163 with one, followed by 22 characters from the alphabet
1164 &lt;CODE&gt;./0-9A-Za-z&lt;/CODE&gt;, up to 34 characters total. Every character in the
1165 &lt;VAR&gt;key&lt;/VAR&gt; is significant.
1166 &lt;br&gt;&lt;br&gt; For the DES-based algorithm, the &lt;VAR&gt;salt&lt;/VAR&gt; should consist of two
1167 characters from the alphabet &lt;CODE&gt;./0-9A-Za-z&lt;/CODE&gt;, and the result of
1168 &lt;CODE&gt;crypt&lt;/CODE&gt; will be those two characters followed by 11 more from the
1169 same alphabet, 13 in total. Only the first 8 characters in the
1170 &lt;VAR&gt;key&lt;/VAR&gt; are significant.
1171 &lt;br&gt;&lt;br&gt; The MD5-based algorithm has no limit on the useful length of the
1172 password used, and is slightly more secure. It is therefore preferred
1173 over the DES-based algorithm.
1174 &lt;br&gt;&lt;br&gt; When the user enters their password for the first time, the &lt;VAR&gt;salt&lt;/VAR&gt;
1175 should be set to a new string which is reasonably random. To verify a
1176 password against the result of a previous call to &lt;CODE&gt;crypt&lt;/CODE&gt;, pass
1177 the result of the previous call as the &lt;VAR&gt;salt&lt;/VAR&gt;.
1178 </synopsis>
1179 </function>
1180 </construct>
1181 <construct id="function-crypt_r" type="function">
1182 <function returntype="char *">
1183 <prototype>
1184 <parameter content="const char *key"/>
1185 <parameter content="const char *salt"/>
1186 <parameter content="{struct crypt_data *} data"/>
1187 </prototype>
1188 <headers>
1189 <header filename = "crypt.h"/>
1190 </headers>
1191 <synopsis>
1192 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;crypt_r&lt;/CODE&gt; function does the same thing as &lt;CODE&gt;crypt&lt;/CODE&gt;, but
1193 takes an extra parameter which includes space for its result (among
1194 other things), so it can be reentrant. &lt;CODE&gt;data-&gt;&lt;/CODE&gt;initialized must be
1195 cleared to zero before the first time &lt;CODE&gt;crypt_r&lt;/CODE&gt; is called.
1196 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;crypt_r&lt;/CODE&gt; function is a GNU extension.
1197 </synopsis>
1198 </function>
1199 </construct>
1200 <construct id="function-setkey" type="function">
1201 <function returntype="void">
1202 <prototype>
1203 <parameter content="const char *key"/>
1204 </prototype>
1205 <headers>
1206 <header filename = "crypt.h"/>
1207 </headers>
1208 <synopsis>
1209 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;setkey&lt;/CODE&gt; function sets an internal data structure to be an
1210 expanded form of &lt;VAR&gt;key&lt;/VAR&gt;. &lt;VAR&gt;key&lt;/VAR&gt; is specified as an array of 64
1211 bits each stored in a &lt;CODE&gt;char&lt;/CODE&gt;, the first bit is &lt;CODE&gt;key[0]&lt;/CODE&gt; and
1212 the 64th bit is &lt;CODE&gt;key[63]&lt;/CODE&gt;. The &lt;VAR&gt;key&lt;/VAR&gt; should have the correct
1213 parity.
1214 </synopsis>
1215 </function>
1216 </construct>
1217 <construct id="function-encrypt" type="function">
1218 <function returntype="void">
1219 <prototype>
1220 <parameter content="char *block"/>
1221 <parameter content="int edflag"/>
1222 </prototype>
1223 <headers>
1224 <header filename = "crypt.h"/>
1225 </headers>
1226 <synopsis>
1227 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;encrypt&lt;/CODE&gt; function encrypts &lt;VAR&gt;block&lt;/VAR&gt; if
1228 &lt;VAR&gt;edflag&lt;/VAR&gt; is 0, otherwise it decrypts &lt;VAR&gt;block&lt;/VAR&gt;, using a key
1229 previously set by &lt;CODE&gt;setkey&lt;/CODE&gt;. The result is
1230 placed in &lt;VAR&gt;block&lt;/VAR&gt;.
1231 &lt;br&gt;&lt;br&gt; Like &lt;CODE&gt;setkey&lt;/CODE&gt;, &lt;VAR&gt;block&lt;/VAR&gt; is specified as an array of 64 bits each
1232 stored in a &lt;CODE&gt;char&lt;/CODE&gt;, but there are no parity bits in &lt;VAR&gt;block&lt;/VAR&gt;.
1233 </synopsis>
1234 </function>
1235 </construct>
1236 <construct id="function-setkey_r" type="function">
1237 <function returntype="void">
1238 <prototype>
1239 <parameter content="const char *key"/>
1240 <parameter content="{struct crypt_data *} data"/>
1241 </prototype>
1242 <headers>
1243 <header filename = "crypt.h"/>
1244 </headers>
1245 <synopsis>
1246 &lt;br&gt;&lt;br&gt; These are reentrant versions of &lt;CODE&gt;setkey&lt;/CODE&gt; and &lt;CODE&gt;encrypt&lt;/CODE&gt;. The
1247 only difference is the extra parameter, which stores the expanded
1248 version of &lt;VAR&gt;key&lt;/VAR&gt;. Before calling &lt;CODE&gt;setkey_r&lt;/CODE&gt; the first time,
1249 &lt;CODE&gt;data-&gt;initialized&lt;/CODE&gt; must be cleared to zero.
1250 </synopsis>
1251 </function>
1252 </construct>
1253 <construct id="function-encrypt_r" type="function">
1254 <function returntype="void">
1255 <prototype>
1256 <parameter content="char *block"/>
1257 <parameter content="int edflag"/>
1258 <parameter content="{struct crypt_data *} data"/>
1259 </prototype>
1260 <headers>
1261 <header filename = "crypt.h"/>
1262 </headers>
1263 <synopsis>
1264 &lt;br&gt;&lt;br&gt; These are reentrant versions of &lt;CODE&gt;setkey&lt;/CODE&gt; and &lt;CODE&gt;encrypt&lt;/CODE&gt;. The
1265 only difference is the extra parameter, which stores the expanded
1266 version of &lt;VAR&gt;key&lt;/VAR&gt;. Before calling &lt;CODE&gt;setkey_r&lt;/CODE&gt; the first time,
1267 &lt;CODE&gt;data-&gt;initialized&lt;/CODE&gt; must be cleared to zero.
1268 </synopsis>
1269 </function>
1270 </construct>
1271 <construct id="function-ecb_crypt" type="function">
1272 <function returntype="int">
1273 <prototype>
1274 <parameter content="char *key"/>
1275 <parameter content="char *blocks"/>
1276 <parameter content="unsigned len"/>
1277 <parameter content="unsigned mode"/>
1278 </prototype>
1279 <headers>
1280 <header filename = "rpc/des_crypt.h"/>
1281 </headers>
1282 <synopsis>
1283 &lt;br&gt;&lt;br&gt; The function &lt;CODE&gt;ecb_crypt&lt;/CODE&gt; encrypts or decrypts one or more blocks
1284 using DES. Each block is encrypted independently.
1285 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;blocks&lt;/VAR&gt; and the &lt;VAR&gt;key&lt;/VAR&gt; are stored packed in 8-bit bytes, so
1286 that the first bit of the key is the most-significant bit of
1287 &lt;CODE&gt;key[0]&lt;/CODE&gt; and the 63rd bit of the key is stored as the
1288 least-significant bit of &lt;CODE&gt;key[7]&lt;/CODE&gt;. The &lt;VAR&gt;key&lt;/VAR&gt; should have the
1289 correct parity.
1290 &lt;br&gt;&lt;br&gt; &lt;VAR&gt;len&lt;/VAR&gt; is the number of bytes in &lt;VAR&gt;blocks&lt;/VAR&gt;. It should be a
1291 multiple of 8 (so that there is a whole number of blocks to encrypt).
1292 &lt;VAR&gt;len&lt;/VAR&gt; is limited to a maximum of &lt;CODE&gt;DES_MAXDATA&lt;/CODE&gt; bytes.
1293 &lt;br&gt;&lt;br&gt; The result of the encryption replaces the input in &lt;VAR&gt;blocks&lt;/VAR&gt;.
1294 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;mode&lt;/VAR&gt; parameter is the bitwise OR of two of the following:
1295 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
1296
1297 &lt;DT&gt;&lt;CODE&gt;DES_ENCRYPT&lt;/CODE&gt;
1298 &lt;DD&gt;
1299 This constant, used in the &lt;VAR&gt;mode&lt;/VAR&gt; parameter, specifies that
1300 &lt;VAR&gt;blocks&lt;/VAR&gt; is to be encrypted.
1301 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;DES_DECRYPT&lt;/CODE&gt;
1302 &lt;DD&gt;
1303 This constant, used in the &lt;VAR&gt;mode&lt;/VAR&gt; parameter, specifies that
1304 &lt;VAR&gt;blocks&lt;/VAR&gt; is to be decrypted.
1305 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;DES_HW&lt;/CODE&gt;
1306 &lt;DD&gt;
1307 This constant, used in the &lt;VAR&gt;mode&lt;/VAR&gt; parameter, asks to use a hardware
1308 device. If no hardware device is available, encryption happens anyway,
1309 but in software.
1310 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;DES_SW&lt;/CODE&gt;
1311 &lt;DD&gt;
1312 This constant, used in the &lt;VAR&gt;mode&lt;/VAR&gt; parameter, specifies that no
1313 hardware device is to be used.
1314 &lt;/DL&gt;
1315 &lt;br&gt;&lt;br&gt; The result of the function will be one of these values:
1316 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
1317
1318 &lt;DT&gt;&lt;CODE&gt;DESERR_NONE&lt;/CODE&gt;
1319 &lt;DD&gt;
1320 The encryption succeeded.
1321 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;DESERR_NOHWDEVICE&lt;/CODE&gt;
1322 &lt;DD&gt;
1323 The encryption succeeded, but there was no hardware device available.
1324 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;DESERR_HWERROR&lt;/CODE&gt;
1325 &lt;DD&gt;
1326 The encryption failed because of a hardware problem.
1327 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;DESERR_BADPARAM&lt;/CODE&gt;
1328 &lt;DD&gt;
1329 The encryption failed because of a bad parameter, for instance &lt;VAR&gt;len&lt;/VAR&gt;
1330 is not a multiple of 8 or &lt;VAR&gt;len&lt;/VAR&gt; is larger than &lt;CODE&gt;DES_MAXDATA&lt;/CODE&gt;.
1331 &lt;/DL&gt;
1332 </synopsis>
1333 </function>
1334 </construct>
1335 <construct id="function-DES_FAILED" type="function">
1336 <function returntype="int">
1337 <prototype>
1338 <parameter content="int err"/>
1339 </prototype>
1340 <headers>
1341 <header filename = "rpc/des_crypt.h"/>
1342 </headers>
1343 <synopsis>
1344 This macro returns 1 if &lt;VAR&gt;err&lt;/VAR&gt; is a `success' result code from
1345 &lt;CODE&gt;ecb_crypt&lt;/CODE&gt; or &lt;CODE&gt;cbc_crypt&lt;/CODE&gt;, and 0 otherwise.
1346 </synopsis>
1347 </function>
1348 </construct>
1349 <construct id="function-cbc_crypt" type="function">
1350 <function returntype="int">
1351 <prototype>
1352 <parameter content="char *key"/>
1353 <parameter content="char *blocks"/>
1354 <parameter content="unsigned len"/>
1355 <parameter content="unsigned mode"/>
1356 <parameter content="char *ivec"/>
1357 </prototype>
1358 <headers>
1359 <header filename = "rpc/des_crypt.h"/>
1360 </headers>
1361 <synopsis>
1362 &lt;br&gt;&lt;br&gt; The function &lt;CODE&gt;cbc_crypt&lt;/CODE&gt; encrypts or decrypts one or more blocks
1363 using DES in Cipher Block Chaining mode.
1364 &lt;br&gt;&lt;br&gt; For encryption in CBC mode, each block is exclusive-ored with &lt;VAR&gt;ivec&lt;/VAR&gt;
1365 before being encrypted, then &lt;VAR&gt;ivec&lt;/VAR&gt; is replaced with the result of
1366 the encryption, then the next block is processed. Decryption is the
1367 reverse of this process.
1368 &lt;br&gt;&lt;br&gt; This has the advantage that blocks which are the same before being
1369 encrypted are very unlikely to be the same after being encrypted, making
1370 it much harder to detect patterns in the data.
1371 &lt;br&gt;&lt;br&gt; Usually, &lt;VAR&gt;ivec&lt;/VAR&gt; is set to 8 random bytes before encryption starts.
1372 Then the 8 random bytes are transmitted along with the encrypted data
1373 (without themselves being encrypted), and passed back in as &lt;VAR&gt;ivec&lt;/VAR&gt;
1374 for decryption. Another possibility is to set &lt;VAR&gt;ivec&lt;/VAR&gt; to 8 zeroes
1375 initially, and have the first the block encrypted consist of 8 random
1376 bytes.
1377 &lt;br&gt;&lt;br&gt; Otherwise, all the parameters are similar to those for &lt;CODE&gt;ecb_crypt&lt;/CODE&gt;.
1378 </synopsis>
1379 </function>
1380 </construct>
1381 <construct id="function-des_setparity" type="function">
1382 <function returntype="void">
1383 <prototype>
1384 <parameter content="char *key"/>
1385 </prototype>
1386 <headers>
1387 <header filename = "rpc/des_crypt.h"/>
1388 </headers>
1389 <synopsis>
1390 &lt;br&gt;&lt;br&gt; The function &lt;CODE&gt;des_setparity&lt;/CODE&gt; changes the 64-bit &lt;VAR&gt;key&lt;/VAR&gt;, stored
1391 packed in 8-bit bytes, to have odd parity by altering the low bits of
1392 each byte.
1393 </synopsis>
1394 </function>
1395 </construct>
1396 <construct id="function-gethostname" type="function">
1397 <function returntype="int">
1398 <prototype>
1399 <parameter content="char *name"/>
1400 <parameter content="size_t size"/>
1401 </prototype>
1402 <headers>
1403 <header filename = "unistd.h"/>
1404 </headers>
1405 <synopsis>
1406 This function returns the host name of the system on which it is called,
1407 in the array &lt;VAR&gt;name&lt;/VAR&gt;. The &lt;VAR&gt;size&lt;/VAR&gt; argument specifies the size of
1408 this array, in bytes. Note that this is &lt;EM&gt;not&lt;/EM&gt; the DNS hostname.
1409 If the system participates in DNS, this is the FQDN (see above).
1410 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt; on failure. In
1411 the GNU C library, &lt;CODE&gt;gethostname&lt;/CODE&gt; fails if &lt;VAR&gt;size&lt;/VAR&gt; is not large
1412 enough; then you can try again with a larger array. The following
1413 &lt;CODE&gt;errno&lt;/CODE&gt; error condition is defined for this function:
1414 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
1415
1416 &lt;DT&gt;&lt;CODE&gt;ENAMETOOLONG&lt;/CODE&gt;
1417 &lt;DD&gt;
1418 The &lt;VAR&gt;size&lt;/VAR&gt; argument is less than the size of the host name plus one.
1419
1420 &lt;br&gt;&lt;br&gt; On some systems, there is a symbol for the maximum possible host name
1421 length: &lt;CODE&gt;MAXHOSTNAMELEN&lt;/CODE&gt;. It is defined in &lt;TT&gt;sys/param.h&lt;/TT&gt;.
1422 But you can't count on this to exist, so it is cleaner to handle
1423 failure and try again.
1424 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;gethostname&lt;/CODE&gt; stores the beginning of the host name in &lt;VAR&gt;name&lt;/VAR&gt;
1425 even if the host name won't entirely fit. For some purposes, a
1426 truncated host name is good enough. If it is, you can ignore the
1427 error code.
1428 </synopsis>
1429 </function>
1430 </construct>
1431 <construct id="function-sethostname" type="function">
1432 <function returntype="int">
1433 <prototype>
1434 <parameter content="const char *name"/>
1435 <parameter content="size_t length"/>
1436 </prototype>
1437 <headers>
1438 <header filename = "unistd.h"/>
1439 </headers>
1440 <synopsis>
1441 The &lt;CODE&gt;sethostname&lt;/CODE&gt; function sets the host name of the system that
1442 calls it to &lt;VAR&gt;name&lt;/VAR&gt;, a string with length &lt;VAR&gt;length&lt;/VAR&gt;. Only
1443 privileged processes are permitted to do this.
1444 &lt;br&gt;&lt;br&gt; Usually &lt;CODE&gt;sethostname&lt;/CODE&gt; gets called just once, at system boot time.
1445 Often, the program that calls it sets it to the value it finds in the
1446 file &lt;CODE&gt;/etc/hostname&lt;/CODE&gt;.
1447 /etc/hostname
1448 &lt;br&gt;&lt;br&gt; Be sure to set the host name to the full host name, not just the DNS
1449 hostname (see above).
1450 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt; on failure.
1451 The following &lt;CODE&gt;errno&lt;/CODE&gt; error condition is defined for this function:
1452 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
1453
1454 &lt;DT&gt;&lt;CODE&gt;EPERM&lt;/CODE&gt;
1455 &lt;DD&gt;
1456 This process cannot set the host name because it is not privileged.
1457
1458 </synopsis>
1459 </function>
1460 </construct>
1461 <construct id="function-getdomainnname" type="function">
1462 <function returntype="int">
1463 <prototype>
1464 <parameter content="char *name"/>
1465 <parameter content="size_t length"/>
1466 </prototype>
1467 <headers>
1468 <header filename = "unistd.h"/>
1469 </headers>
1470 <synopsis>
1471 domain name
1472 domain name
1473 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;getdomainname&lt;/CODE&gt; returns the NIS (aka YP) domain name of the system
1474 on which it is called. Note that this is not the more popular DNS
1475 domain name. Get that with &lt;CODE&gt;gethostname&lt;/CODE&gt;.
1476 &lt;br&gt;&lt;br&gt; The specifics of this function are analogous to &lt;CODE&gt;gethostname&lt;/CODE&gt;, above.
1477 &lt;br&gt;&lt;br&gt;
1478 </synopsis>
1479 </function>
1480 </construct>
1481 <construct id="function-setdomainname" type="function">
1482 <function returntype="int">
1483 <prototype>
1484 <parameter content="const char *name"/>
1485 <parameter content="size_t length"/>
1486 </prototype>
1487 <headers>
1488 <header filename = "unistd.h"/>
1489 </headers>
1490 <synopsis>
1491 domain name
1492 domain name
1493 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;getdomainname&lt;/CODE&gt; sets the NIS (aka YP) domain name of the system
1494 on which it is called. Note that this is not the more popular DNS
1495 domain name. Set that with &lt;CODE&gt;sethostname&lt;/CODE&gt;.
1496 &lt;br&gt;&lt;br&gt; The specifics of this function are analogous to &lt;CODE&gt;sethostname&lt;/CODE&gt;, above.
1497 &lt;br&gt;&lt;br&gt;
1498 </synopsis>
1499 </function>
1500 </construct>
1501 <construct id="function-gethostid" type="function">
1502 <function returntype="long int">
1503 <prototype>
1504 <parameter content="void"/>
1505 </prototype>
1506 <headers>
1507 <header filename = "unistd.h"/>
1508 </headers>
1509 <synopsis>
1510 This function returns the ``host ID'' of the machine the program is
1511 running on. By convention, this is usually the primary Internet IP address
1512 of that machine, converted to a &lt;CODE&gt;long int&lt;/CODE&gt;. However, on some
1513 systems it is a meaningless but unique number which is hard-coded for
1514 each machine.
1515 &lt;br&gt;&lt;br&gt; This is not widely used. It arose in BSD 4.2, but was dropped in BSD 4.4.
1516 It is not required by POSIX.
1517 &lt;br&gt;&lt;br&gt; The proper way to query the IP address is to use &lt;CODE&gt;gethostbyname&lt;/CODE&gt;
1518 on the results of &lt;CODE&gt;gethostname&lt;/CODE&gt;. For more information on IP addresses,
1519 .
1520 </synopsis>
1521 </function>
1522 </construct>
1523 <construct id="function-sethostid" type="function">
1524 <function returntype="int">
1525 <prototype>
1526 <parameter content="long int id"/>
1527 </prototype>
1528 <headers>
1529 <header filename = "unistd.h"/>
1530 </headers>
1531 <synopsis>
1532 The &lt;CODE&gt;sethostid&lt;/CODE&gt; function sets the ``host ID'' of the host machine
1533 to &lt;VAR&gt;id&lt;/VAR&gt;. Only privileged processes are permitted to do this. Usually
1534 it happens just once, at system boot time.
1535 &lt;br&gt;&lt;br&gt; The proper way to establish the primary IP address of a system
1536 is to configure the IP address resolver to associate that IP address with
1537 the system's host name as returned by &lt;CODE&gt;gethostname&lt;/CODE&gt;. For example,
1538 put a record for the system in &lt;TT&gt;/etc/hosts&lt;/TT&gt;.
1539 &lt;br&gt;&lt;br&gt; See &lt;CODE&gt;gethostid&lt;/CODE&gt; above for more information on host ids.
1540 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt; on failure.
1541 The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
1542 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
1543
1544 &lt;DT&gt;&lt;CODE&gt;EPERM&lt;/CODE&gt;
1545 &lt;DD&gt;
1546 This process cannot set the host name because it is not privileged.
1547 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOSYS
1548 The operating system does not support setting the host ID. On some
1549 systems, the host ID is a meaningless but unique number hard-coded for
1550 each machine.
1551
1552 </synopsis>
1553 </function>
1554 </construct>
1555 <construct id="struct-utsname" type="struct">
1556 <structure>
1557 <synopsis>
1558 The &lt;CODE&gt;utsname&lt;/CODE&gt; structure is used to hold information returned
1559 by the &lt;CODE&gt;uname&lt;/CODE&gt; function. It has the following members:
1560 &lt;br&gt;&lt;br&gt;
1561 </synopsis>
1562 <elements>
1563 <element content="char sysname[]">
1564 <synopsis>
1565 This is the name of the operating system in use.
1566 &lt;br&gt;&lt;br&gt;
1567 </synopsis>
1568 </element>
1569 <element content="char release[]">
1570 <synopsis>
1571 This is the current release level of the operating system implementation.
1572 &lt;br&gt;&lt;br&gt;
1573 </synopsis>
1574 </element>
1575 <element content="char version[]">
1576 <synopsis>
1577 This is the current version level within the release of the operating
1578 system.
1579 &lt;br&gt;&lt;br&gt;
1580 </synopsis>
1581 </element>
1582 <element content="char machine[]">
1583 <synopsis>
1584 This is a description of the type of hardware that is in use.
1585 &lt;br&gt;&lt;br&gt; Some systems provide a mechanism to interrogate the kernel directly for
1586 this information. On systems without such a mechanism, the GNU C
1587 library fills in this field based on the configuration name that was
1588 specified when building and installing the library.
1589 &lt;br&gt;&lt;br&gt; GNU uses a three-part name to describe a system configuration; the three
1590 parts are &lt;VAR&gt;cpu&lt;/VAR&gt;, &lt;VAR&gt;manufacturer&lt;/VAR&gt; and &lt;VAR&gt;system-type&lt;/VAR&gt;, and they
1591 are separated with dashes. Any possible combination of three names is
1592 potentially meaningful, but most such combinations are meaningless in
1593 practice and even the meaningful ones are not necessarily supported by
1594 any particular GNU program.
1595 &lt;br&gt;&lt;br&gt; Since the value in &lt;CODE&gt;machine&lt;/CODE&gt; is supposed to describe just the
1596 hardware, it consists of the first two parts of the configuration name:
1597 &lt;samp&gt;&lt;VAR&gt;cpu&lt;/VAR&gt;-&lt;VAR&gt;manufacturer&lt;/VAR&gt;&lt;/samp&gt;. For example, it might be one of these:
1598 &lt;br&gt;&lt;br&gt;
1599 &lt;CODE&gt;"sparc-sun"&lt;/CODE&gt;,
1600 &lt;CODE&gt;"i386-&lt;VAR&gt;anything&lt;/VAR&gt;"&lt;/CODE&gt;,
1601 &lt;CODE&gt;"m68k-hp"&lt;/CODE&gt;,
1602 &lt;CODE&gt;"m68k-sony"&lt;/CODE&gt;,
1603 &lt;CODE&gt;"m68k-sun"&lt;/CODE&gt;,
1604 &lt;CODE&gt;"mips-dec"&lt;/CODE&gt;
1605
1606 &lt;br&gt;&lt;br&gt;
1607 </synopsis>
1608 </element>
1609 <element content="char nodename[]">
1610 <synopsis>
1611 This is the host name of this particular computer. In the GNU C
1612 library, the value is the same as that returned by &lt;CODE&gt;gethostname&lt;/CODE&gt;;
1613 see Host Identification.
1614 &lt;br&gt;&lt;br&gt; @ gethostname() is implemented with a call to uname().
1615 &lt;br&gt;&lt;br&gt;
1616 </synopsis>
1617 </element>
1618 </elements>
1619 </structure>
1620 </construct>
1621 <construct id="function-uname" type="function">
1622 <function returntype="int">
1623 <prototype>
1624 <parameter content="struct utsname *info"/>
1625 </prototype>
1626 <headers>
1627 <header filename = "sys/utsname.h"/>
1628 </headers>
1629 <synopsis>
1630 The &lt;CODE&gt;uname&lt;/CODE&gt; function fills in the structure pointed to by
1631 &lt;VAR&gt;info&lt;/VAR&gt; with information about the operating system and host machine.
1632 A non-negative value indicates that the data was successfully stored.
1633 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;-1&lt;/CODE&gt; as the value indicates an error. The only error possible is
1634 &lt;CODE&gt;EFAULT&lt;/CODE&gt;, which we normally don't mention as it is always a
1635 possibility.
1636 </synopsis>
1637 </function>
1638 </construct>
1639 <construct id="struct-fstab" type="struct">
1640 <structure>
1641 <synopsis>
1642 This structure is used with the &lt;CODE&gt;getfsent&lt;/CODE&gt;, &lt;CODE&gt;getfsspec&lt;/CODE&gt;, and
1643 &lt;CODE&gt;getfsfile&lt;/CODE&gt; functions.
1644 &lt;br&gt;&lt;br&gt;
1645 </synopsis>
1646 <elements>
1647 <element content="char *fs_spec">
1648 <synopsis>
1649 This element describes the device from which the filesystem is mounted.
1650 Normally this is the name of a special device, such as a hard disk
1651 partition, but it could also be a more or less generic string. For
1652 NFS it would be a hostname and directory name combination.
1653 &lt;br&gt;&lt;br&gt; Even though the element is not declared &lt;CODE&gt;const&lt;/CODE&gt; it shouldn't be
1654 modified. The missing &lt;CODE&gt;const&lt;/CODE&gt; has historic reasons, since this
1655 function predates ISO C. The same is true for the other string
1656 elements of this structure.
1657 &lt;br&gt;&lt;br&gt;
1658 </synopsis>
1659 </element>
1660 <element content="char *fs_file">
1661 <synopsis>
1662 This describes the mount point on the local system. I.e., accessing any
1663 file in this filesystem has implicitly or explicitly this string as a
1664 prefix.
1665 &lt;br&gt;&lt;br&gt;
1666 </synopsis>
1667 </element>
1668 <element content="char *fs_vfstype">
1669 <synopsis>
1670 This is the type of the filesystem. Depending on what the underlying
1671 kernel understands it can be any string.
1672 &lt;br&gt;&lt;br&gt;
1673 </synopsis>
1674 </element>
1675 <element content="char *fs_mntops">
1676 <synopsis>
1677 This is a string containing options passed to the kernel with the
1678 &lt;CODE&gt;mount&lt;/CODE&gt; call. Again, this can be almost anything. There can be
1679 more than one option, separated from the others by a comma. Each option
1680 consists of a name and an optional value part, introduced by an &lt;CODE&gt;=&lt;/CODE&gt;
1681 character.
1682 &lt;br&gt;&lt;br&gt; If the value of this element must be processed it should ideally be done
1683 using the &lt;CODE&gt;getsubopt&lt;/CODE&gt; function; see Suboptions.
1684 &lt;br&gt;&lt;br&gt;
1685 </synopsis>
1686 </element>
1687 <element content="const char *fs_type">
1688 <synopsis>
1689 This name is poorly chosen. This element points to a string (possibly
1690 in the &lt;CODE&gt;fs_mntops&lt;/CODE&gt; string) which describes the modes with which the
1691 filesystem is mounted. &lt;TT&gt;fstab&lt;/TT&gt; defines five macros to describe the
1692 possible values:
1693 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
1694
1695 </synopsis>
1696 </element>
1697 <element content="FSTAB_RW">
1698 <synopsis>
1699 The filesystems gets mounted with read and write enabled.
1700 </synopsis>
1701 </element>
1702 <element content="FSTAB_RQ">
1703 <synopsis>
1704 The filesystems gets mounted with read and write enabled. Write access
1705 is restricted by quotas.
1706 </synopsis>
1707 </element>
1708 <element content="FSTAB_RO">
1709 <synopsis>
1710 The filesystem gets mounted read-only.
1711 </synopsis>
1712 </element>
1713 <element content="FSTAB_SW">
1714 <synopsis>
1715 This is not a real filesystem, it is a swap device.
1716 </synopsis>
1717 </element>
1718 <element content="FSTAB_XX">
1719 <synopsis>
1720 This entry from the &lt;TT&gt;fstab&lt;/TT&gt; file is totally ignored.
1721 &lt;/DL&gt;
1722 &lt;br&gt;&lt;br&gt; Testing for equality with these value must happen using &lt;CODE&gt;strcmp&lt;/CODE&gt;
1723 since these are all strings. Comparing the pointer will probably always
1724 fail.
1725 &lt;br&gt;&lt;br&gt;
1726 </synopsis>
1727 </element>
1728 <element content="int fs_freq">
1729 <synopsis>
1730 This element describes the dump frequency in days.
1731 &lt;br&gt;&lt;br&gt;
1732 </synopsis>
1733 </element>
1734 </elements>
1735 </structure>
1736 </construct>
1737 <construct id="function-setfsent" type="function">
1738 <function returntype="int">
1739 <prototype>
1740 <parameter content="void"/>
1741 </prototype>
1742 <headers>
1743 <header filename = "fstab.h"/>
1744 </headers>
1745 <synopsis>
1746 This function makes sure that the internal read pointer for the
1747 &lt;TT&gt;fstab&lt;/TT&gt; file is at the beginning of the file. This is done by
1748 either opening the file or resetting the read pointer.
1749 &lt;br&gt;&lt;br&gt; Since the file handle is internal to the libc this function is not
1750 thread-safe.
1751 &lt;br&gt;&lt;br&gt; This function returns a non-zero value if the operation was successful
1752 and the &lt;CODE&gt;getfs*&lt;/CODE&gt; functions can be used to read the entries of the
1753 file.
1754 </synopsis>
1755 </function>
1756 </construct>
1757 <construct id="function-endfsent" type="function">
1758 <function returntype="void">
1759 <prototype>
1760 <parameter content="void"/>
1761 </prototype>
1762 <headers>
1763 <header filename = "fstab.h"/>
1764 </headers>
1765 <synopsis>
1766 This function makes sure that all resources acquired by a prior call to
1767 &lt;CODE&gt;setfsent&lt;/CODE&gt; (explicitly or implicitly by calling &lt;CODE&gt;getfsent&lt;/CODE&gt;) are
1768 freed.
1769 </synopsis>
1770 </function>
1771 </construct>
1772 <construct id="function-getfsent" type="function">
1773 <function returntype="struct fstab *">
1774 <prototype>
1775 <parameter content="void"/>
1776 </prototype>
1777 <headers>
1778 <header filename = "fstab.h"/>
1779 </headers>
1780 <synopsis>
1781 This function returns the next entry of the &lt;TT&gt;fstab&lt;/TT&gt; file. If this
1782 is the first call to any of the functions handling &lt;TT&gt;fstab&lt;/TT&gt; since
1783 program start or the last call of &lt;CODE&gt;endfsent&lt;/CODE&gt;, the file will be
1784 opened.
1785 &lt;br&gt;&lt;br&gt; The function returns a pointer to a variable of type &lt;CODE&gt;struct
1786 fstab&lt;/CODE&gt;. This variable is shared by all threads and therefore this
1787 function is not thread-safe. If an error occurred &lt;CODE&gt;getfsent&lt;/CODE&gt;
1788 returns a &lt;CODE&gt;NULL&lt;/CODE&gt; pointer.
1789 </synopsis>
1790 </function>
1791 </construct>
1792 <construct id="function-getfsspec" type="function">
1793 <function returntype="struct fstab *">
1794 <prototype>
1795 <parameter content="const char *name"/>
1796 </prototype>
1797 <headers>
1798 <header filename = "fstab.h"/>
1799 </headers>
1800 <synopsis>
1801 This function returns the next entry of the &lt;TT&gt;fstab&lt;/TT&gt; file which has
1802 a string equal to &lt;VAR&gt;name&lt;/VAR&gt; pointed to by the &lt;CODE&gt;fs_spec&lt;/CODE&gt; element.
1803 Since there is normally exactly one entry for each special device it
1804 makes no sense to call this function more than once for the same
1805 argument. If this is the first call to any of the functions handling
1806 &lt;TT&gt;fstab&lt;/TT&gt; since program start or the last call of &lt;CODE&gt;endfsent&lt;/CODE&gt;,
1807 the file will be opened.
1808 &lt;br&gt;&lt;br&gt; The function returns a pointer to a variable of type &lt;CODE&gt;struct
1809 fstab&lt;/CODE&gt;. This variable is shared by all threads and therefore this
1810 function is not thread-safe. If an error occurred &lt;CODE&gt;getfsent&lt;/CODE&gt;
1811 returns a &lt;CODE&gt;NULL&lt;/CODE&gt; pointer.
1812 </synopsis>
1813 </function>
1814 </construct>
1815 <construct id="function-getfsfile" type="function">
1816 <function returntype="struct fstab *">
1817 <prototype>
1818 <parameter content="const char *name"/>
1819 </prototype>
1820 <headers>
1821 <header filename = "fstab.h"/>
1822 </headers>
1823 <synopsis>
1824 This function returns the next entry of the &lt;TT&gt;fstab&lt;/TT&gt; file which has
1825 a string equal to &lt;VAR&gt;name&lt;/VAR&gt; pointed to by the &lt;CODE&gt;fs_file&lt;/CODE&gt; element.
1826 Since there is normally exactly one entry for each mount point it
1827 makes no sense to call this function more than once for the same
1828 argument. If this is the first call to any of the functions handling
1829 &lt;TT&gt;fstab&lt;/TT&gt; since program start or the last call of &lt;CODE&gt;endfsent&lt;/CODE&gt;,
1830 the file will be opened.
1831 &lt;br&gt;&lt;br&gt; The function returns a pointer to a variable of type &lt;CODE&gt;struct
1832 fstab&lt;/CODE&gt;. This variable is shared by all threads and therefore this
1833 function is not thread-safe. If an error occurred &lt;CODE&gt;getfsent&lt;/CODE&gt;
1834 returns a &lt;CODE&gt;NULL&lt;/CODE&gt; pointer.
1835 </synopsis>
1836 </function>
1837 </construct>
1838 <construct id="struct-mntent" type="struct">
1839 <structure>
1840 <synopsis>
1841 This structure is used with the &lt;CODE&gt;getmntent&lt;/CODE&gt;, &lt;CODE&gt;getmntent_t&lt;/CODE&gt;,
1842 &lt;CODE&gt;addmntent&lt;/CODE&gt;, and &lt;CODE&gt;hasmntopt&lt;/CODE&gt; functions.
1843 &lt;br&gt;&lt;br&gt;
1844 </synopsis>
1845 <elements>
1846 <element content="char *mnt_fsname">
1847 <synopsis>
1848 This element contains a pointer to a string describing the name of the
1849 special device from which the filesystem is mounted. It corresponds to
1850 the &lt;CODE&gt;fs_spec&lt;/CODE&gt; element in &lt;CODE&gt;struct fstab&lt;/CODE&gt;.
1851 &lt;br&gt;&lt;br&gt;
1852 </synopsis>
1853 </element>
1854 <element content="char *mnt_dir">
1855 <synopsis>
1856 This element points to a string describing the mount point of the
1857 filesystem. It corresponds to the &lt;CODE&gt;fs_file&lt;/CODE&gt; element in
1858 &lt;CODE&gt;struct fstab&lt;/CODE&gt;.
1859 &lt;br&gt;&lt;br&gt;
1860 </synopsis>
1861 </element>
1862 <element content="char *mnt_type">
1863 <synopsis>
1864 &lt;CODE&gt;mnt_type&lt;/CODE&gt; describes the filesystem type and is therefore
1865 equivalent to &lt;CODE&gt;fs_vfstype&lt;/CODE&gt; in &lt;CODE&gt;struct fstab&lt;/CODE&gt;. &lt;TT&gt;mntent.h&lt;/TT&gt;
1866 defines a few symbolic names for some of the values this string can have.
1867 But since the kernel can support arbitrary filesystems it does not
1868 make much sense to give them symbolic names. If one knows the symbol
1869 name one also knows the filesystem name. Nevertheless here follows the
1870 list of the symbols provided in &lt;TT&gt;mntent.h&lt;/TT&gt;.
1871 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
1872
1873 </synopsis>
1874 </element>
1875 <element content="MNTTYPE_IGNORE">
1876 <synopsis>
1877 This symbol expands to &lt;CODE&gt;"ignore"&lt;/CODE&gt;. The value is sometime used in
1878 &lt;TT&gt;fstab&lt;/TT&gt; files to make sure entries are not used without removing them.
1879 </synopsis>
1880 </element>
1881 <element content="MNTTYPE_NFS">
1882 <synopsis>
1883 Expands to &lt;CODE&gt;"nfs"&lt;/CODE&gt;. Using this macro sometimes could make sense
1884 since it names the default NFS implementation, in case both version 2
1885 and 3 are supported.
1886 </synopsis>
1887 </element>
1888 <element content="MNTTYPE_SWAP">
1889 <synopsis>
1890 This symbol expands to &lt;CODE&gt;"swap"&lt;/CODE&gt;. It names the special &lt;TT&gt;fstab&lt;/TT&gt;
1891 entry which names one of the possibly multiple swap partitions.
1892 &lt;/DL&gt;
1893 &lt;br&gt;&lt;br&gt;
1894 </synopsis>
1895 </element>
1896 <element content="char *mnt_opts">
1897 <synopsis>
1898 The element contains a string describing the options used while mounting
1899 the filesystem. As for the equivalent element &lt;CODE&gt;fs_mntops&lt;/CODE&gt; of
1900 &lt;CODE&gt;struct fstab&lt;/CODE&gt; it is best to use the function &lt;CODE&gt;getsubopt&lt;/CODE&gt;
1901 to access the parts of this string.
1902 &lt;br&gt;&lt;br&gt; The &lt;TT&gt;mntent.h&lt;/TT&gt; file defines a number of macros with string values
1903 which correspond to some of the options understood by the kernel. There
1904 might be many more options which are possible so it doesn't make much sense
1905 to rely on these macros but to be consistent here is the list:
1906 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
1907
1908 </synopsis>
1909 </element>
1910 <element content="MNTOPT_DEFAULTS">
1911 <synopsis>
1912 Expands to &lt;CODE&gt;"defaults"&lt;/CODE&gt;. This option should be used alone since it
1913 indicates all values for the customizable values are chosen to be the
1914 default.
1915 </synopsis>
1916 </element>
1917 <element content="MNTOPT_RO">
1918 <synopsis>
1919 Expands to &lt;CODE&gt;"ro"&lt;/CODE&gt;. See the &lt;CODE&gt;FSTAB_RO&lt;/CODE&gt; value, it means the
1920 filesystem is mounted read-only.
1921 </synopsis>
1922 </element>
1923 <element content="MNTOPT_RW">
1924 <synopsis>
1925 Expand to &lt;CODE&gt;"rw"&lt;/CODE&gt;. See the &lt;CODE&gt;FSTAB_RW&lt;/CODE&gt; value, it means the
1926 filesystem is mounted with read and write permissions.
1927 </synopsis>
1928 </element>
1929 <element content="MNTOPT_SUID">
1930 <synopsis>
1931 Expands to &lt;CODE&gt;"suid"&lt;/CODE&gt;. This means that the SUID bit is respected when a program from the filesystem is
1932 started.
1933 </synopsis>
1934 </element>
1935 <element content="MNTOPT_NOSUID">
1936 <synopsis>
1937 Expands to &lt;CODE&gt;"nosuid"&lt;/CODE&gt;. This is the opposite of &lt;CODE&gt;MNTOPT_SUID&lt;/CODE&gt;,
1938 the SUID bit for all files from the filesystem is ignored.
1939 </synopsis>
1940 </element>
1941 <element content="MNTOPT_NOAUTO">
1942 <synopsis>
1943 Expands to &lt;CODE&gt;"noauto"&lt;/CODE&gt;. At startup time the &lt;CODE&gt;mount&lt;/CODE&gt; program
1944 will ignore this entry if it is started with the &lt;CODE&gt;-a&lt;/CODE&gt; option to
1945 mount all filesystems mentioned in the &lt;TT&gt;fstab&lt;/TT&gt; file.
1946 &lt;/DL&gt;
1947 &lt;br&gt;&lt;br&gt; As for the &lt;CODE&gt;FSTAB_*&lt;/CODE&gt; entries introduced above it is important to
1948 use &lt;CODE&gt;strcmp&lt;/CODE&gt; to check for equality.
1949 &lt;br&gt;&lt;br&gt;
1950 </synopsis>
1951 </element>
1952 <element content="mnt_freq">
1953 <synopsis>
1954 This elements corresponds to &lt;CODE&gt;fs_freq&lt;/CODE&gt; and also specifies the
1955 frequency in days in which dumps are made.
1956 &lt;br&gt;&lt;br&gt;
1957 </synopsis>
1958 </element>
1959 </elements>
1960 </structure>
1961 </construct>
1962 <construct id="function-setmntent" type="function">
1963 <function returntype="FILE *">
1964 <prototype>
1965 <parameter content="const char *file"/>
1966 <parameter content="const char *mode"/>
1967 </prototype>
1968 <headers>
1969 <header filename = "mntent.h"/>
1970 </headers>
1971 <synopsis>
1972 The &lt;CODE&gt;setmntent&lt;/CODE&gt; function prepares the file named &lt;VAR&gt;FILE&lt;/VAR&gt; which
1973 must be in the format of a &lt;TT&gt;fstab&lt;/TT&gt; and &lt;TT&gt;mtab&lt;/TT&gt; file for the
1974 upcoming processing through the other functions of the family. The
1975 &lt;VAR&gt;mode&lt;/VAR&gt; parameter can be chosen in the way the &lt;VAR&gt;opentype&lt;/VAR&gt;
1976 parameter for &lt;CODE&gt;fopen&lt;/CODE&gt; can be chosen. If
1977 the file is opened for writing the file is also allowed to be empty.
1978 &lt;br&gt;&lt;br&gt; If the file was successfully opened &lt;CODE&gt;setmntent&lt;/CODE&gt; returns a file
1979 descriptor for future use. Otherwise the return value is &lt;CODE&gt;NULL&lt;/CODE&gt;
1980 and &lt;CODE&gt;errno&lt;/CODE&gt; is set accordingly.
1981 </synopsis>
1982 </function>
1983 </construct>
1984 <construct id="function-endmntent" type="function">
1985 <function returntype="int">
1986 <prototype>
1987 <parameter content="FILE *stream"/>
1988 </prototype>
1989 <headers>
1990 <header filename = "mntent.h"/>
1991 </headers>
1992 <synopsis>
1993 This function takes for the &lt;VAR&gt;stream&lt;/VAR&gt; parameter a file handle which
1994 previously was returned from the &lt;CODE&gt;setmntent&lt;/CODE&gt; call.
1995 &lt;CODE&gt;endmntent&lt;/CODE&gt; closes the stream and frees all resources.
1996 &lt;br&gt;&lt;br&gt; The return value is 1 unless an error occurred in which case it
1997 is 0.
1998 </synopsis>
1999 </function>
2000 </construct>
2001 <construct id="function-getmntent" type="function">
2002 <function returntype="struct mntent *">
2003 <prototype>
2004 <parameter content="FILE *stream"/>
2005 </prototype>
2006 <headers>
2007 <header filename = "mntent.h"/>
2008 </headers>
2009 <synopsis>
2010 The &lt;CODE&gt;getmntent&lt;/CODE&gt; function takes as the parameter a file handle
2011 previously returned by successful call to &lt;CODE&gt;setmntent&lt;/CODE&gt;. It returns
2012 a pointer to a static variable of type &lt;CODE&gt;struct mntent&lt;/CODE&gt; which is
2013 filled with the information from the next entry from the file currently
2014 read.
2015 &lt;br&gt;&lt;br&gt; The file format used prescribes the use of spaces or tab characters to
2016 separate the fields. This makes it harder to use name containing one
2017 of these characters (e.g., mount points using spaces). Therefore
2018 these characters are encoded in the files and the &lt;CODE&gt;getmntent&lt;/CODE&gt;
2019 function takes care of the decoding while reading the entries back in.
2020 &lt;CODE&gt;'\040'&lt;/CODE&gt; is used to encode a space character, &lt;CODE&gt;'\011'&lt;/CODE&gt; to
2021 encode a tab character, &lt;CODE&gt;'\012'&lt;/CODE&gt; to encode a newline character,
2022 and &lt;CODE&gt;'\\'&lt;/CODE&gt; to encode a backslash.
2023 &lt;br&gt;&lt;br&gt; If there was an error or the end of the file is reached the return value
2024 is &lt;CODE&gt;NULL&lt;/CODE&gt;.
2025 &lt;br&gt;&lt;br&gt; This function is not thread-safe since all calls to this function return
2026 a pointer to the same static variable. &lt;CODE&gt;getmntent_r&lt;/CODE&gt; should be
2027 used in situations where multiple threads access the file.
2028 </synopsis>
2029 </function>
2030 </construct>
2031 <construct id="function-getmntent_r" type="function">
2032 <function returntype="struct mntent *">
2033 <prototype>
2034 <parameter content="FILE *stream"/>
2035 <parameter content="struct mentent *result"/>
2036 <parameter content="char *buffer"/>
2037 <parameter content="int bufsize"/>
2038 </prototype>
2039 <headers>
2040 <header filename = "mntent.h"/>
2041 </headers>
2042 <synopsis>
2043 The &lt;CODE&gt;getmntent_r&lt;/CODE&gt; function is the reentrant variant of
2044 &lt;CODE&gt;getmntent&lt;/CODE&gt;. It also returns the next entry from the file and
2045 returns a pointer. The actual variable the values are stored in is not
2046 static, though. Instead the function stores the values in the variable
2047 pointed to by the &lt;VAR&gt;result&lt;/VAR&gt; parameter. Additional information (e.g.,
2048 the strings pointed to by the elements of the result) are kept in the
2049 buffer of size &lt;VAR&gt;bufsize&lt;/VAR&gt; pointed to by &lt;VAR&gt;buffer&lt;/VAR&gt;.
2050 &lt;br&gt;&lt;br&gt; Escaped characters (space, tab, backslash) are converted back in the
2051 same way as it happens for &lt;CODE&gt;getmentent&lt;/CODE&gt;.
2052 &lt;br&gt;&lt;br&gt; The function returns a &lt;CODE&gt;NULL&lt;/CODE&gt; pointer in error cases. Errors could be:
2053 &lt;OL&gt;
2054 &lt;LI&gt;
2055 error while reading the file,
2056 &lt;LI&gt;
2057 end of file reached,
2058 &lt;LI&gt;
2059 &lt;VAR&gt;bufsize&lt;/VAR&gt; is too small for reading a complete new entry.
2060 &lt;/OL&gt;
2061 </synopsis>
2062 </function>
2063 </construct>
2064 <construct id="function-addmntent" type="function">
2065 <function returntype="int">
2066 <prototype>
2067 <parameter content="FILE *stream"/>
2068 <parameter content="const struct mntent *mnt"/>
2069 </prototype>
2070 <headers>
2071 <header filename = "mntent.h"/>
2072 </headers>
2073 <synopsis>
2074 The &lt;CODE&gt;addmntent&lt;/CODE&gt; function allows adding a new entry to the file
2075 previously opened with &lt;CODE&gt;setmntent&lt;/CODE&gt;. The new entries are always
2076 appended. I.e., even if the position of the file descriptor is not at
2077 the end of the file this function does not overwrite an existing entry
2078 following the current position.
2079 &lt;br&gt;&lt;br&gt; The implication of this is that to remove an entry from a file one has
2080 to create a new file while leaving out the entry to be removed and after
2081 closing the file remove the old one and rename the new file to the
2082 chosen name.
2083 &lt;br&gt;&lt;br&gt; This function takes care of spaces and tab characters in the names to be
2084 written to the file. It converts them and the backslash character into
2085 the format describe in the &lt;CODE&gt;getmntent&lt;/CODE&gt; description above.
2086 &lt;br&gt;&lt;br&gt; This function returns 0 in case the operation was successful.
2087 Otherwise the return value is 1 and &lt;CODE&gt;errno&lt;/CODE&gt; is set
2088 appropriately.
2089 </synopsis>
2090 </function>
2091 </construct>
2092 <construct id="function-hasmntopt" type="function">
2093 <function returntype="char *">
2094 <prototype>
2095 <parameter content="const struct mntent *mnt"/>
2096 <parameter content="const char *opt"/>
2097 </prototype>
2098 <headers>
2099 <header filename = "mntent.h"/>
2100 </headers>
2101 <synopsis>
2102 This function can be used to check whether the string pointed to by the
2103 &lt;CODE&gt;mnt_opts&lt;/CODE&gt; element of the variable pointed to by &lt;VAR&gt;mnt&lt;/VAR&gt; contains
2104 the option &lt;VAR&gt;opt&lt;/VAR&gt;. If this is true a pointer to the beginning of the
2105 option in the &lt;CODE&gt;mnt_opts&lt;/CODE&gt; element is returned. If no such option
2106 exists the function returns &lt;CODE&gt;NULL&lt;/CODE&gt;.
2107 &lt;br&gt;&lt;br&gt; This function is useful to test whether a specific option is present but
2108 when all options have to be processed one is better off with using the
2109 &lt;CODE&gt;getsubopt&lt;/CODE&gt; function to iterate over all options in the string.
2110 </synopsis>
2111 </function>
2112 </construct>
2113 <construct id="function-mount" type="function">
2114 <function returntype="int">
2115 <prototype>
2116 <parameter content="const char *special_file"/>
2117 <parameter content="const char *dir"/>
2118 <parameter content="const char *fstype"/>
2119 <parameter content="unsigned long int options"/>
2120 <parameter content="const void *data"/>
2121 </prototype>
2122 <headers>
2123 <header filename = "sys/mount.h"/>
2124 </headers>
2125 <synopsis>
2126 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;mount&lt;/CODE&gt; mounts or remounts a filesystem. The two operations are
2127 quite different and are merged rather unnaturally into this one function.
2128 The &lt;CODE&gt;MS_REMOUNT&lt;/CODE&gt; option, explained below, determines whether
2129 &lt;CODE&gt;mount&lt;/CODE&gt; mounts or remounts.
2130 &lt;br&gt;&lt;br&gt; For a mount, the filesystem on the block device represented by the
2131 device special file named &lt;VAR&gt;special_file&lt;/VAR&gt; gets mounted over the mount
2132 point &lt;VAR&gt;dir&lt;/VAR&gt;. This means that the directory &lt;VAR&gt;dir&lt;/VAR&gt; (along with any
2133 files in it) is no longer visible; in its place (and still with the name
2134 &lt;VAR&gt;dir&lt;/VAR&gt;) is the root directory of the filesystem on the device.
2135 &lt;br&gt;&lt;br&gt; As an exception, if the filesystem type (see below) is one which is not
2136 based on a device (e.g. ``proc''), &lt;CODE&gt;mount&lt;/CODE&gt; instantiates a
2137 filesystem and mounts it over &lt;VAR&gt;dir&lt;/VAR&gt; and ignores &lt;VAR&gt;special_file&lt;/VAR&gt;.
2138 &lt;br&gt;&lt;br&gt; For a remount, &lt;VAR&gt;dir&lt;/VAR&gt; specifies the mount point where the filesystem
2139 to be remounted is (and remains) mounted and &lt;VAR&gt;special_file&lt;/VAR&gt; is
2140 ignored. Remounting a filesystem means changing the options that control
2141 operations on the filesystem while it is mounted. It does not mean
2142 unmounting and mounting again.
2143 &lt;br&gt;&lt;br&gt; For a mount, you must identify the type of the filesystem as
2144 &lt;VAR&gt;fstype&lt;/VAR&gt;. This type tells the kernel how to access the filesystem
2145 and can be thought of as the name of a filesystem driver. The
2146 acceptable values are system dependent. On a system with a Linux kernel
2147 and the &lt;CODE&gt;proc&lt;/CODE&gt; filesystem, the list of possible values is in the
2148 file &lt;TT&gt;filesystems&lt;/TT&gt; in the &lt;CODE&gt;proc&lt;/CODE&gt; filesystem (e.g. type
2149 &lt;KBD&gt;cat /proc/filesystems&lt;/KBD&gt; to see the list). With a Linux kernel, the
2150 types of filesystems that &lt;CODE&gt;mount&lt;/CODE&gt; can mount, and their type names,
2151 depends on what filesystem drivers are configured into the kernel or
2152 loaded as loadable kernel modules. An example of a common value for
2153 &lt;VAR&gt;fstype&lt;/VAR&gt; is &lt;CODE&gt;ext2&lt;/CODE&gt;.
2154 &lt;br&gt;&lt;br&gt; For a remount, &lt;CODE&gt;mount&lt;/CODE&gt; ignores &lt;VAR&gt;fstype&lt;/VAR&gt;.
2155 &lt;br&gt;&lt;br&gt; &lt;VAR&gt;options&lt;/VAR&gt; specifies a variety of options that apply until the
2156 filesystem is unmounted or remounted. The precise meaning of an option
2157 depends on the filesystem and with some filesystems, an option may have
2158 no effect at all. Furthermore, for some filesystems, some of these
2159 options (but never &lt;CODE&gt;MS_RDONLY&lt;/CODE&gt;) can be overridden for individual
2160 file accesses via &lt;CODE&gt;ioctl&lt;/CODE&gt;.
2161 &lt;br&gt;&lt;br&gt; &lt;VAR&gt;options&lt;/VAR&gt; is a bit string with bit fields defined using the
2162 following mask and masked value macros:
2163 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
2164
2165 &lt;DT&gt;&lt;CODE&gt;MS_MGC_MASK&lt;/CODE&gt;
2166 &lt;DD&gt;
2167 This multibit field contains a magic number. If it does not have the value
2168 &lt;CODE&gt;MS_MGC_VAL&lt;/CODE&gt;, &lt;CODE&gt;mount&lt;/CODE&gt; assumes all the following bits are zero and
2169 the &lt;VAR&gt;data&lt;/VAR&gt; argument is a null string, regardless of their actual values.
2170 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;MS_REMOUNT&lt;/CODE&gt;
2171 &lt;DD&gt;
2172 This bit on means to remount the filesystem. Off means to mount it.
2173 &lt;br&gt;&lt;br&gt; &lt;LI&gt; MS_RDONLY
2174 This bit on specifies that no writing to the filesystem shall be allowed
2175 while it is mounted. This cannot be overridden by &lt;CODE&gt;ioctl&lt;/CODE&gt;. This
2176 option is available on nearly all filesystems.
2177 &lt;br&gt;&lt;br&gt; &lt;LI&gt; S_IMMUTABLE
2178 This bit on specifies that no writing to the files in the filesystem
2179 shall be allowed while it is mounted. This can be overridden for a
2180 particular file access by a properly privileged call to &lt;CODE&gt;ioctl&lt;/CODE&gt;.
2181 This option is a relatively new invention and is not available on many
2182 filesystems.
2183 &lt;br&gt;&lt;br&gt; &lt;LI&gt; S_APPEND
2184 This bit on specifies that the only file writing that shall be allowed
2185 while the filesystem is mounted is appending. Some filesystems allow
2186 this to be overridden for a particular process by a properly privileged
2187 call to &lt;CODE&gt;ioctl&lt;/CODE&gt;. This is a relatively new invention and is not
2188 available on many filesystems.
2189 &lt;br&gt;&lt;br&gt; &lt;LI&gt; MS_NOSUID
2190 This bit on specifies that Setuid and Setgid permissions on files in the
2191 filesystem shall be ignored while it is mounted.
2192 &lt;br&gt;&lt;br&gt; &lt;LI&gt; MS_NOEXEC
2193 This bit on specifies that no files in the filesystem shall be executed
2194 while the filesystem is mounted.
2195 &lt;br&gt;&lt;br&gt; &lt;LI&gt; MS_NODEV
2196 This bit on specifies that no device special files in the filesystem
2197 shall be accessible while the filesystem is mounted.
2198 &lt;br&gt;&lt;br&gt; &lt;LI&gt; MS_SYNCHRONOUS
2199 This bit on specifies that all writes to the filesystem while it is
2200 mounted shall be synchronous; i.e., data shall be synced before each
2201 write completes rather than held in the buffer cache.
2202 &lt;br&gt;&lt;br&gt; &lt;LI&gt; MS_MANDLOCK
2203 This bit on specifies that mandatory locks on files shall be permitted while
2204 the filesystem is mounted.
2205 &lt;br&gt;&lt;br&gt; &lt;LI&gt; MS_NOATIME
2206 This bit on specifies that access times of files shall not be updated when
2207 the files are accessed while the filesystem is mounted.
2208 &lt;br&gt;&lt;br&gt; &lt;LI&gt; MS_NODIRATIME
2209 This bit on specifies that access times of directories shall not be updated
2210 when the directories are accessed while the filesystem in mounted.
2211 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt;
2212 &lt;br&gt;&lt;br&gt; Any bits not covered by the above masks should be set off; otherwise,
2213 results are undefined.
2214 &lt;br&gt;&lt;br&gt; The meaning of &lt;VAR&gt;data&lt;/VAR&gt; depends on the filesystem type and is controlled
2215 entirely by the filesystem driver in the kernel.
2216 &lt;br&gt;&lt;br&gt; Example:
2217 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
2218 &lt;br&gt;
2219 #include &lt;sys/mount.h&gt;&lt;br&gt;
2220 &lt;br&gt;&lt;br&gt; mount("/dev/hdb", "/cdrom", MS_MGC_VAL | MS_RDONLY | MS_NOSUID, "");&lt;br&gt;
2221 &lt;br&gt;&lt;br&gt; mount("/dev/hda2", "/mnt", MS_MGC_VAL | MS_REMOUNT, "");&lt;br&gt;
2222 &lt;br&gt;&lt;br&gt; &lt;br&gt;
2223 &lt;/pre&gt;
2224 &lt;br&gt;&lt;br&gt; Appropriate arguments for &lt;CODE&gt;mount&lt;/CODE&gt; are conventionally recorded in
2225 the &lt;TT&gt;fstab&lt;/TT&gt; table. .
2226 &lt;br&gt;&lt;br&gt; The return value is zero if the mount or remount is successful. Otherwise,
2227 it is &lt;CODE&gt;-1&lt;/CODE&gt; and &lt;CODE&gt;errno&lt;/CODE&gt; is set appropriately. The values of
2228 &lt;CODE&gt;errno&lt;/CODE&gt; are filesystem dependent, but here is a general list:
2229 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
2230
2231 &lt;LI&gt; EPERM
2232 The process is not superuser.
2233 &lt;LI&gt; ENODEV
2234 The file system type &lt;VAR&gt;fstype&lt;/VAR&gt; is not known to the kernel.
2235 &lt;LI&gt; ENOTBLK
2236 The file &lt;VAR&gt;dev&lt;/VAR&gt; is not a block device special file.
2237 &lt;LI&gt; EBUSY
2238 &lt;br&gt;&lt;br&gt; &lt;OL&gt;
2239 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
2240 The device is already mounted.
2241 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
2242 The mount point is busy. (E.g. it is some process' working directory or
2243 has a filesystem mounted on it already).
2244 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
2245 The request is to remount read-only, but there are files open for write.
2246 &lt;/OL&gt;
2247 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
2248 &lt;OL&gt;
2249 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
2250 A remount was attempted, but there is no filesystem mounted over the
2251 specified mount point.
2252 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
2253 The supposed filesystem has an invalid superblock.
2254 &lt;br&gt;&lt;br&gt; &lt;/OL&gt;
2255 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EACCES
2256 &lt;OL&gt;
2257 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
2258 The filesystem is inherently read-only (possibly due to a switch on the
2259 device) and the process attempted to mount it read/write (by setting the
2260 &lt;CODE&gt;MS_RDONLY&lt;/CODE&gt; bit off).
2261 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
2262 &lt;VAR&gt;special_file&lt;/VAR&gt; or &lt;VAR&gt;dir&lt;/VAR&gt; is not accessible due to file permissions.
2263 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
2264 &lt;VAR&gt;special_file&lt;/VAR&gt; is not accessible because it is in a filesystem that is
2265 mounted with the &lt;CODE&gt;MS_NODEV&lt;/CODE&gt; option.
2266 &lt;br&gt;&lt;br&gt; &lt;/OL&gt;
2267 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EM_FILE
2268 The table of dummy devices is full. &lt;CODE&gt;mount&lt;/CODE&gt; needs to create a
2269 dummy device (aka ``unnamed'' device) if the filesystem being mounted is
2270 not one that uses a device.
2271 &lt;br&gt;&lt;br&gt;
2272 &lt;br&gt;&lt;br&gt;
2273 </synopsis>
2274 </function>
2275 </construct>
2276 <construct id="function-umount2" type="function">
2277 <function returntype="int">
2278 <prototype>
2279 <parameter content="const char *file"/>
2280 <parameter content="int flags"/>
2281 </prototype>
2282 <headers>
2283 <header filename = "sys/mount.h"/>
2284 </headers>
2285 <synopsis>
2286 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;umount2&lt;/CODE&gt; unmounts a filesystem.
2287 &lt;br&gt;&lt;br&gt; You can identify the filesystem to unmount either by the device special
2288 file that contains the filesystem or by the mount point. The effect is
2289 the same. Specify either as the string &lt;VAR&gt;file&lt;/VAR&gt;.
2290 &lt;br&gt;&lt;br&gt; &lt;VAR&gt;flags&lt;/VAR&gt; contains the one-bit field identified by the following
2291 mask macro:
2292 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
2293
2294 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;MNT_FORCE&lt;/CODE&gt;
2295 &lt;DD&gt;
2296 This bit on means to force the unmounting even if the filesystem is
2297 busy, by making it unbusy first. If the bit is off and the filesystem is
2298 busy, &lt;CODE&gt;umount2&lt;/CODE&gt; fails with &lt;CODE&gt;errno&lt;/CODE&gt; = &lt;CODE&gt;EBUSY&lt;/CODE&gt;. Depending
2299 on the filesystem, this may override all, some, or no busy conditions.
2300 &lt;br&gt;&lt;br&gt;
2301 &lt;br&gt;&lt;br&gt; All other bits in &lt;VAR&gt;flags&lt;/VAR&gt; should be set to zero; otherwise, the result
2302 is undefined.
2303 &lt;br&gt;&lt;br&gt; Example:
2304 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
2305 &lt;br&gt;
2306 #include &lt;sys/mount.h&gt;&lt;br&gt;
2307 &lt;br&gt;&lt;br&gt; umount2("/mnt", MNT_FORCE);&lt;br&gt;
2308 &lt;br&gt;&lt;br&gt; umount2("/dev/hdd1", 0);&lt;br&gt;
2309 &lt;br&gt;&lt;br&gt; &lt;br&gt;
2310 &lt;/pre&gt;
2311 &lt;br&gt;&lt;br&gt; After the filesystem is unmounted, the directory that was the mount point
2312 is visible, as are any files in it.
2313 &lt;br&gt;&lt;br&gt; As part of unmounting, &lt;CODE&gt;umount2&lt;/CODE&gt; syncs the filesystem.
2314 &lt;br&gt;&lt;br&gt; If the unmounting is successful, the return value is zero. Otherwise, it
2315 is &lt;CODE&gt;-1&lt;/CODE&gt; and &lt;CODE&gt;errno&lt;/CODE&gt; is set accordingly:
2316 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
2317
2318 &lt;LI&gt; EPERM
2319 The process is not superuser.
2320 &lt;LI&gt; EBUSY
2321 The filesystem cannot be unmounted because it is busy. E.g. it contains
2322 a directory that is some process's working directory or a file that some
2323 process has open. With some filesystems in some cases, you can avoid
2324 this failure with the &lt;CODE&gt;MNT_FORCE&lt;/CODE&gt; option.
2325 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
2326 &lt;VAR&gt;file&lt;/VAR&gt; validly refers to a file, but that file is neither a mount
2327 point nor a device special file of a currently mounted filesystem.
2328 &lt;br&gt;&lt;br&gt;
2329 &lt;/DL&gt;
2330 &lt;br&gt;&lt;br&gt; This function is not available on all systems.
2331 </synopsis>
2332 </function>
2333 </construct>
2334 <construct id="function-umount" type="function">
2335 <function returntype="int">
2336 <prototype>
2337 <parameter content="const char *file"/>
2338 </prototype>
2339 <headers>
2340 <header filename = "sys/mount.h"/>
2341 </headers>
2342 <synopsis>
2343 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;umount&lt;/CODE&gt; does the same thing as &lt;CODE&gt;umount2&lt;/CODE&gt; with &lt;VAR&gt;flags&lt;/VAR&gt; set
2344 to zeroes. It is more widely available than &lt;CODE&gt;umount2&lt;/CODE&gt; but since it
2345 lacks the possibility to forcefully unmount a filesystem is deprecated
2346 when &lt;CODE&gt;umount2&lt;/CODE&gt; is also available.
2347 </synopsis>
2348 </function>
2349 </construct>
2350 <construct id="function-sysctl" type="function">
2351 <function returntype="int">
2352 <prototype>
2353 <parameter content="int *names"/>
2354 <parameter content="int nlen"/>
2355 <parameter content="void *oldval"/>
2356 <parameter content="size_t *oldlenp"/>
2357 <parameter content="void *newval"/>
2358 <parameter content="size_t newlen"/>
2359 </prototype>
2360 <headers>
2361 <header filename = "sysctl.h"/>
2362 </headers>
2363 <synopsis>
2364 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;sysctl&lt;/CODE&gt; gets or sets a specified system parameter. There are so
2365 many of these parameters that it is not practical to list them all here,
2366 but here are some examples:
2367 &lt;br&gt;&lt;br&gt; &lt;OL&gt;
2368 &lt;LI&gt; network domain name
2369 &lt;LI&gt; paging parameters
2370 &lt;LI&gt; network Address Resolution Protocol timeout time
2371 &lt;LI&gt; maximum number of files that may be open
2372 &lt;LI&gt; root filesystem device
2373 &lt;LI&gt; when kernel was built
2374 &lt;/OL&gt;
2375 &lt;br&gt;&lt;br&gt; The set of available parameters depends on the kernel configuration and
2376 can change while the system is running, particularly when you load and
2377 unload loadable kernel modules.
2378 &lt;br&gt;&lt;br&gt; The system parameters with which &lt;CODE&gt;syslog&lt;/CODE&gt; is concerned are arranged
2379 in a hierarchical structure like a hierarchical filesystem. To identify
2380 a particular parameter, you specify a path through the structure in a
2381 way analogous to specifying the pathname of a file. Each component of
2382 the path is specified by an integer and each of these integers has a
2383 macro defined for it by &lt;TT&gt;sysctl.h&lt;/TT&gt;. &lt;VAR&gt;names&lt;/VAR&gt; is the path, in
2384 the form of an array of integers. Each component of the path is one
2385 element of the array, in order. &lt;VAR&gt;nlen&lt;/VAR&gt; is the number of components
2386 in the path.
2387 &lt;br&gt;&lt;br&gt; For example, the first component of the path for all the paging
2388 parameters is the value &lt;CODE&gt;CTL_VM&lt;/CODE&gt;. For the free page thresholds, the
2389 second component of the path is &lt;CODE&gt;VM_FREEPG&lt;/CODE&gt;. So to get the free
2390 page threshold values, make &lt;VAR&gt;names&lt;/VAR&gt; an array containing the two
2391 elements &lt;CODE&gt;CTL_VM&lt;/CODE&gt; and &lt;CODE&gt;VM_FREEPG&lt;/CODE&gt; and make &lt;VAR&gt;nlen&lt;/VAR&gt; = 2.
2392 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt; The format of the value of a parameter depends on the parameter.
2393 Sometimes it is an integer; sometimes it is an ASCII string; sometimes
2394 it is an elaborate structure. In the case of the free page thresholds
2395 used in the example above, the parameter value is a structure containing
2396 several integers.
2397 &lt;br&gt;&lt;br&gt; In any case, you identify a place to return the parameter's value with
2398 &lt;VAR&gt;oldval&lt;/VAR&gt; and specify the amount of storage available at that
2399 location as *&lt;VAR&gt;oldlenp&lt;/VAR&gt;. *&lt;VAR&gt;oldlenp&lt;/VAR&gt; does double duty because it
2400 is also the output location that contains the actual length of the
2401 returned value.
2402 &lt;br&gt;&lt;br&gt; If you don't want the parameter value returned, specify a null pointer
2403 for &lt;VAR&gt;oldval&lt;/VAR&gt;.
2404 &lt;br&gt;&lt;br&gt; To set the parameter, specify the address and length of the new value
2405 as &lt;VAR&gt;newval&lt;/VAR&gt; and &lt;VAR&gt;newlen&lt;/VAR&gt;. If you don't want to set the parameter,
2406 specify a null pointer as &lt;VAR&gt;newval&lt;/VAR&gt;.
2407 &lt;br&gt;&lt;br&gt; If you get and set a parameter in the same &lt;CODE&gt;sysctl&lt;/CODE&gt; call, the value
2408 returned is the value of the parameter before it was set.
2409 &lt;br&gt;&lt;br&gt; Each system parameter has a set of permissions similar to the
2410 permissions for a file (including the permissions on directories in its
2411 path) that determine whether you may get or set it. For the purposes of
2412 these permissions, every parameter is considered to be owned by the
2413 superuser and Group 0 so processes with that effective uid or gid may
2414 have more access to system parameters. Unlike with files, the superuser
2415 does not invariably have full permission to all system parameters, because
2416 some of them are designed not to be changed ever.
2417 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt; &lt;CODE&gt;sysctl&lt;/CODE&gt; returns a zero return value if it succeeds. Otherwise, it
2418 returns &lt;CODE&gt;-1&lt;/CODE&gt; and sets &lt;CODE&gt;errno&lt;/CODE&gt; appropriately. Besides the
2419 failures that apply to all system calls, the following are the
2420 &lt;CODE&gt;errno&lt;/CODE&gt; codes for all possible failures:
2421 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
2422
2423 &lt;DT&gt;&lt;CODE&gt;EPERM&lt;/CODE&gt;
2424 &lt;DD&gt;
2425 The process is not permitted to access one of the components of the
2426 path of the system parameter or is not permitted to access the system parameter
2427 itself in the way (read or write) that it requested.
2428 &lt;LI&gt; ENOTDIR
2429 There is no system parameter corresponding to &lt;VAR&gt;name&lt;/VAR&gt;.
2430 &lt;LI&gt; EFAULT
2431 &lt;VAR&gt;oldval&lt;/VAR&gt; is not null, which means the process wanted to read the parameter,
2432 but *&lt;VAR&gt;oldlenp&lt;/VAR&gt; is zero, so there is no place to return it.
2433 &lt;LI&gt; EINVAL
2434 &lt;OL&gt;
2435 &lt;LI&gt;
2436 The process attempted to set a system parameter to a value that is not valid
2437 for that parameter.
2438 &lt;LI&gt;
2439 The space provided for the return of the system parameter is not the right
2440 size for that parameter.
2441 &lt;/OL&gt;
2442 &lt;LI&gt; ENOMEM
2443 This value may be returned instead of the more correct &lt;CODE&gt;EINVAL&lt;/CODE&gt; in some
2444 cases where the space provided for the return of the system parameter is too
2445 small.
2446 &lt;br&gt;&lt;br&gt;
2447 &lt;br&gt;&lt;br&gt;
2448 </synopsis>
2449 </function>
2450 </construct>
2451 <construct id="dtype-uid_t" type="dtype">
2452 <structure>
2453 </structure>
2454 </construct>
2455 <construct id="dtype-gid_t" type="dtype">
2456 <structure>
2457 </structure>
2458 </construct>
2459 <construct id="function-getuid" type="function">
2460 <function returntype="uid_t">
2461 <prototype>
2462 <parameter content="void"/>
2463 </prototype>
2464 <headers>
2465 <header filename = "sys/types.h"/>
2466 <header filename = "unistd.h"/>
2467 </headers>
2468 <synopsis>
2469 The &lt;CODE&gt;getuid&lt;/CODE&gt; function returns the real user ID of the process.
2470 </synopsis>
2471 </function>
2472 </construct>
2473 <construct id="function-getgid" type="function">
2474 <function returntype="gid_t">
2475 <prototype>
2476 <parameter content="void"/>
2477 </prototype>
2478 <headers>
2479 <header filename = "unistd.h"/>
2480 </headers>
2481 <synopsis>
2482 The &lt;CODE&gt;getgid&lt;/CODE&gt; function returns the real group ID of the process.
2483 </synopsis>
2484 </function>
2485 </construct>
2486 <construct id="function-geteuid" type="function">
2487 <function returntype="uid_t">
2488 <prototype>
2489 <parameter content="void"/>
2490 </prototype>
2491 <headers>
2492 <header filename = "unistd.h"/>
2493 </headers>
2494 <synopsis>
2495 The &lt;CODE&gt;geteuid&lt;/CODE&gt; function returns the effective user ID of the process.
2496 </synopsis>
2497 </function>
2498 </construct>
2499 <construct id="function-getegid" type="function">
2500 <function returntype="gid_t">
2501 <prototype>
2502 <parameter content="void"/>
2503 </prototype>
2504 <headers>
2505 <header filename = "unistd.h"/>
2506 </headers>
2507 <synopsis>
2508 The &lt;CODE&gt;getegid&lt;/CODE&gt; function returns the effective group ID of the process.
2509 </synopsis>
2510 </function>
2511 </construct>
2512 <construct id="function-getgroups" type="function">
2513 <function returntype="int">
2514 <prototype>
2515 <parameter content="int count"/>
2516 <parameter content="gid_t *groups"/>
2517 </prototype>
2518 <headers>
2519 <header filename = "unistd.h"/>
2520 </headers>
2521 <synopsis>
2522 The &lt;CODE&gt;getgroups&lt;/CODE&gt; function is used to inquire about the supplementary
2523 group IDs of the process. Up to &lt;VAR&gt;count&lt;/VAR&gt; of these group IDs are
2524 stored in the array &lt;VAR&gt;groups&lt;/VAR&gt;; the return value from the function is
2525 the number of group IDs actually stored. If &lt;VAR&gt;count&lt;/VAR&gt; is smaller than
2526 the total number of supplementary group IDs, then &lt;CODE&gt;getgroups&lt;/CODE&gt;
2527 returns a value of &lt;CODE&gt;-1&lt;/CODE&gt; and &lt;CODE&gt;errno&lt;/CODE&gt; is set to &lt;CODE&gt;EINVAL&lt;/CODE&gt;.
2528 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;count&lt;/VAR&gt; is zero, then &lt;CODE&gt;getgroups&lt;/CODE&gt; just returns the total
2529 number of supplementary group IDs. On systems that do not support
2530 supplementary groups, this will always be zero.
2531 &lt;br&gt;&lt;br&gt; Here's how to use &lt;CODE&gt;getgroups&lt;/CODE&gt; to read all the supplementary group
2532 IDs:
2533 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
2534 &lt;br&gt;
2535 gid_t *&lt;br&gt;
2536 read_all_groups (void)&lt;br&gt;
2537 {&lt;br&gt;
2538 int ngroups = getgroups (0, NULL);&lt;br&gt;
2539 gid_t *groups&lt;br&gt;
2540 = (gid_t *) xmalloc (ngroups * sizeof (gid_t));&lt;br&gt;
2541 int val = getgroups (ngroups, groups);&lt;br&gt;
2542 if (val &lt; 0)&lt;br&gt;
2543 {&lt;br&gt;
2544 free (groups);&lt;br&gt;
2545 return NULL;&lt;br&gt;
2546 }&lt;br&gt;
2547 return groups;&lt;br&gt;
2548 }&lt;br&gt;
2549 &lt;br&gt;
2550 &lt;/pre&gt;
2551 </synopsis>
2552 </function>
2553 </construct>
2554 <construct id="function-seteuid" type="function">
2555 <function returntype="int">
2556 <prototype>
2557 <parameter content="uid_t neweuid"/>
2558 </prototype>
2559 <headers>
2560 <header filename = "unistd.h"/>
2561 </headers>
2562 <synopsis>
2563 This function sets the effective user ID of a process to &lt;VAR&gt;newuid&lt;/VAR&gt;,
2564 provided that the process is allowed to change its effective user ID. A
2565 privileged process (effective user ID zero) can change its effective
2566 user ID to any legal value. An unprivileged process with a file user ID
2567 can change its effective user ID to its real user ID or to its file user
2568 ID. Otherwise, a process may not change its effective user ID at all.
2569 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;seteuid&lt;/CODE&gt; function returns a value of &lt;CODE&gt;0&lt;/CODE&gt; to indicate
2570 successful completion, and a value of &lt;CODE&gt;-1&lt;/CODE&gt; to indicate an error.
2571 The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this
2572 function:
2573 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
2574
2575 &lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
2576 &lt;DD&gt;
2577 The value of the &lt;VAR&gt;newuid&lt;/VAR&gt; argument is invalid.
2578 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EPERM
2579 The process may not change to the specified ID.
2580
2581 &lt;br&gt;&lt;br&gt; Older systems (those without the &lt;CODE&gt;_POSIX_SAVED_IDS&lt;/CODE&gt; feature) do not
2582 have this function.
2583 </synopsis>
2584 </function>
2585 </construct>
2586 <construct id="function-setuid" type="function">
2587 <function returntype="int">
2588 <prototype>
2589 <parameter content="uid_t newuid"/>
2590 </prototype>
2591 <headers>
2592 <header filename = "unistd.h"/>
2593 </headers>
2594 <synopsis>
2595 If the calling process is privileged, this function sets both the real
2596 and effective user ID of the process to &lt;VAR&gt;newuid&lt;/VAR&gt;. It also deletes
2597 the file user ID of the process, if any. &lt;VAR&gt;newuid&lt;/VAR&gt; may be any
2598 legal value. (Once this has been done, there is no way to recover the
2599 old effective user ID.)
2600 &lt;br&gt;&lt;br&gt; If the process is not privileged, and the system supports the
2601 &lt;CODE&gt;_POSIX_SAVED_IDS&lt;/CODE&gt; feature, then this function behaves like
2602 &lt;CODE&gt;seteuid&lt;/CODE&gt;.
2603 &lt;br&gt;&lt;br&gt; The return values and error conditions are the same as for &lt;CODE&gt;seteuid&lt;/CODE&gt;.
2604 </synopsis>
2605 </function>
2606 </construct>
2607 <construct id="function-setreuid" type="function">
2608 <function returntype="int">
2609 <prototype>
2610 <parameter content="uid_t ruid"/>
2611 <parameter content="uid_t euid"/>
2612 </prototype>
2613 <headers>
2614 <header filename = "unistd.h"/>
2615 </headers>
2616 <synopsis>
2617 This function sets the real user ID of the process to &lt;VAR&gt;ruid&lt;/VAR&gt; and the
2618 effective user ID to &lt;VAR&gt;euid&lt;/VAR&gt;. If &lt;VAR&gt;ruid&lt;/VAR&gt; is &lt;CODE&gt;-1&lt;/CODE&gt;, it means
2619 not to change the real user ID; likewise if &lt;VAR&gt;euid&lt;/VAR&gt; is &lt;CODE&gt;-1&lt;/CODE&gt;, it
2620 means not to change the effective user ID.
2621 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;setreuid&lt;/CODE&gt; function exists for compatibility with 4.3 BSD Unix,
2622 which does not support file IDs. You can use this function to swap the
2623 effective and real user IDs of the process. (Privileged processes are
2624 not limited to this particular usage.) If file IDs are supported, you
2625 should use that feature instead of this function. .
2626 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt; on failure.
2627 The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this
2628 function:
2629 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
2630
2631 &lt;DT&gt;&lt;CODE&gt;EPERM&lt;/CODE&gt;
2632 &lt;DD&gt;
2633 The process does not have the appropriate privileges; you do not
2634 have permission to change to the specified ID.
2635
2636 </synopsis>
2637 </function>
2638 </construct>
2639 <construct id="function-setegid" type="function">
2640 <function returntype="int">
2641 <prototype>
2642 <parameter content="gid_t newgid"/>
2643 </prototype>
2644 <headers>
2645 <header filename = "unistd.h"/>
2646 </headers>
2647 <synopsis>
2648 This function sets the effective group ID of the process to
2649 &lt;VAR&gt;newgid&lt;/VAR&gt;, provided that the process is allowed to change its group
2650 ID. Just as with &lt;CODE&gt;seteuid&lt;/CODE&gt;, if the process is privileged it may
2651 change its effective group ID to any value; if it isn't, but it has a
2652 file group ID, then it may change to its real group ID or file group ID;
2653 otherwise it may not change its effective group ID.
2654 &lt;br&gt;&lt;br&gt; Note that a process is only privileged if its effective &lt;EM&gt;user&lt;/EM&gt; ID
2655 is zero. The effective group ID only affects access permissions.
2656 &lt;br&gt;&lt;br&gt; The return values and error conditions for &lt;CODE&gt;setegid&lt;/CODE&gt; are the same
2657 as those for &lt;CODE&gt;seteuid&lt;/CODE&gt;.
2658 &lt;br&gt;&lt;br&gt; This function is only present if &lt;CODE&gt;_POSIX_SAVED_IDS&lt;/CODE&gt; is defined.
2659 </synopsis>
2660 </function>
2661 </construct>
2662 <construct id="function-setgid" type="function">
2663 <function returntype="int">
2664 <prototype>
2665 <parameter content="gid_t newgid"/>
2666 </prototype>
2667 <headers>
2668 <header filename = "unistd.h"/>
2669 </headers>
2670 <synopsis>
2671 This function sets both the real and effective group ID of the process
2672 to &lt;VAR&gt;newgid&lt;/VAR&gt;, provided that the process is privileged. It also
2673 deletes the file group ID, if any.
2674 &lt;br&gt;&lt;br&gt; If the process is not privileged, then &lt;CODE&gt;setgid&lt;/CODE&gt; behaves like
2675 &lt;CODE&gt;setegid&lt;/CODE&gt;.
2676 &lt;br&gt;&lt;br&gt; The return values and error conditions for &lt;CODE&gt;setgid&lt;/CODE&gt; are the same
2677 as those for &lt;CODE&gt;seteuid&lt;/CODE&gt;.
2678 </synopsis>
2679 </function>
2680 </construct>
2681 <construct id="function-setregid" type="function">
2682 <function returntype="int">
2683 <prototype>
2684 <parameter content="gid_t rgid"/>
2685 <parameter content="gid_t egid"/>
2686 </prototype>
2687 <headers>
2688 <header filename = "unistd.h"/>
2689 </headers>
2690 <synopsis>
2691 This function sets the real group ID of the process to &lt;VAR&gt;rgid&lt;/VAR&gt; and
2692 the effective group ID to &lt;VAR&gt;egid&lt;/VAR&gt;. If &lt;VAR&gt;rgid&lt;/VAR&gt; is &lt;CODE&gt;-1&lt;/CODE&gt;, it
2693 means not to change the real group ID; likewise if &lt;VAR&gt;egid&lt;/VAR&gt; is
2694 &lt;CODE&gt;-1&lt;/CODE&gt;, it means not to change the effective group ID.
2695 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;setregid&lt;/CODE&gt; function is provided for compatibility with 4.3 BSD
2696 Unix, which does not support file IDs. You can use this function to
2697 swap the effective and real group IDs of the process. (Privileged
2698 processes are not limited to this usage.) If file IDs are supported,
2699 you should use that feature instead of using this function.
2700 .
2701 &lt;br&gt;&lt;br&gt; The return values and error conditions for &lt;CODE&gt;setregid&lt;/CODE&gt; are the same
2702 as those for &lt;CODE&gt;setreuid&lt;/CODE&gt;.
2703 </synopsis>
2704 </function>
2705 </construct>
2706 <construct id="function-setgroups" type="function">
2707 <function returntype="int">
2708 <prototype>
2709 <parameter content="size_t count"/>
2710 <parameter content="gid_t *groups"/>
2711 </prototype>
2712 <headers>
2713 <header filename = "grp.h"/>
2714 </headers>
2715 <synopsis>
2716 This function sets the process's supplementary group IDs. It can only
2717 be called from privileged processes. The &lt;VAR&gt;count&lt;/VAR&gt; argument specifies
2718 the number of group IDs in the array &lt;VAR&gt;groups&lt;/VAR&gt;.
2719 &lt;br&gt;&lt;br&gt; This function returns &lt;CODE&gt;0&lt;/CODE&gt; if successful and &lt;CODE&gt;-1&lt;/CODE&gt; on error.
2720 The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this
2721 function:
2722 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
2723
2724 &lt;DT&gt;&lt;CODE&gt;EPERM&lt;/CODE&gt;
2725 &lt;DD&gt;
2726 The calling process is not privileged.
2727
2728 </synopsis>
2729 </function>
2730 </construct>
2731 <construct id="function-initgroups" type="function">
2732 <function returntype="int">
2733 <prototype>
2734 <parameter content="const char *user"/>
2735 <parameter content="gid_t group"/>
2736 </prototype>
2737 <headers>
2738 <header filename = "grp.h"/>
2739 </headers>
2740 <synopsis>
2741 The &lt;CODE&gt;initgroups&lt;/CODE&gt; function sets the process's supplementary group
2742 IDs to be the normal default for the user name &lt;VAR&gt;user&lt;/VAR&gt;. The group
2743 &lt;VAR&gt;group&lt;/VAR&gt; is automatically included.
2744 &lt;br&gt;&lt;br&gt; This function works by scanning the group database for all the groups
2745 &lt;VAR&gt;user&lt;/VAR&gt; belongs to. It then calls &lt;CODE&gt;setgroups&lt;/CODE&gt; with the list it
2746 has constructed.
2747 &lt;br&gt;&lt;br&gt; The return values and error conditions are the same as for
2748 &lt;CODE&gt;setgroups&lt;/CODE&gt;.
2749 </synopsis>
2750 </function>
2751 </construct>
2752 <construct id="function-getgrouplist" type="function">
2753 <function returntype="int">
2754 <prototype>
2755 <parameter content="const char *user"/>
2756 <parameter content="gid_t group"/>
2757 <parameter content="gid_t *groups"/>
2758 <parameter content="int *ngroups"/>
2759 </prototype>
2760 <headers>
2761 <header filename = "grp.h"/>
2762 </headers>
2763 <synopsis>
2764 The &lt;CODE&gt;getgrouplist&lt;/CODE&gt; function scans the group database for all the
2765 groups &lt;VAR&gt;user&lt;/VAR&gt; belongs to. Up to *&lt;VAR&gt;ngroups&lt;/VAR&gt; group IDs
2766 corresponding to these groups are stored in the array &lt;VAR&gt;groups&lt;/VAR&gt;; the
2767 return value from the function is the number of group IDs actually
2768 stored. If *&lt;VAR&gt;ngroups&lt;/VAR&gt; is smaller than the total number of groups
2769 found, then &lt;CODE&gt;getgrouplist&lt;/CODE&gt; returns a value of &lt;CODE&gt;-1&lt;/CODE&gt; and stores
2770 the actual number of groups in *&lt;VAR&gt;ngroups&lt;/VAR&gt;. The group &lt;VAR&gt;group&lt;/VAR&gt; is
2771 automatically included in the list of groups returned by
2772 &lt;CODE&gt;getgrouplist&lt;/CODE&gt;.
2773 &lt;br&gt;&lt;br&gt; Here's how to use &lt;CODE&gt;getgrouplist&lt;/CODE&gt; to read all supplementary groups
2774 for &lt;VAR&gt;user&lt;/VAR&gt;:
2775 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
2776 &lt;br&gt;
2777 gid_t *&lt;br&gt;
2778 supplementary_groups (char *user)&lt;br&gt;
2779 {&lt;br&gt;
2780 int ngroups = 16;&lt;br&gt;
2781 gid_t *groups&lt;br&gt;
2782 = (gid_t *) xmalloc (ngroups * sizeof (gid_t));&lt;br&gt;
2783 struct passwd *pw = getpwnam (user);&lt;br&gt;
2784 &lt;br&gt;&lt;br&gt; if (pw == NULL)&lt;br&gt;
2785 return NULL;&lt;br&gt;
2786 &lt;br&gt;&lt;br&gt; if (getgrouplist (pw-&gt;pw_name, pw-&gt;pw_gid, groups, &amp;ngroups) &lt; 0)&lt;br&gt;
2787 {&lt;br&gt;
2788 groups = xrealloc (ngroups * sizeof (gid_t));&lt;br&gt;
2789 getgrouplist (pw-&gt;pw_name, pw-&gt;pw_gid, groups, &amp;ngroups);&lt;br&gt;
2790 }&lt;br&gt;
2791 return groups;&lt;br&gt;
2792 }&lt;br&gt;
2793 &lt;br&gt;
2794 &lt;/pre&gt;
2795 </synopsis>
2796 </function>
2797 </construct>
2798 <construct id="function-getlogin" type="function">
2799 <function returntype="char *">
2800 <prototype>
2801 <parameter content="void"/>
2802 </prototype>
2803 <headers>
2804 <header filename = "unistd.h"/>
2805 </headers>
2806 <synopsis>
2807 The &lt;CODE&gt;getlogin&lt;/CODE&gt; function returns a pointer to a string containing the
2808 name of the user logged in on the controlling terminal of the process,
2809 or a null pointer if this information cannot be determined. The string
2810 is statically allocated and might be overwritten on subsequent calls to
2811 this function or to &lt;CODE&gt;cuserid&lt;/CODE&gt;.
2812 </synopsis>
2813 </function>
2814 </construct>
2815 <construct id="function-cuserid" type="function">
2816 <function returntype="char *">
2817 <prototype>
2818 <parameter content="char *string"/>
2819 </prototype>
2820 <headers>
2821 <header filename = "stdio.h"/>
2822 </headers>
2823 <synopsis>
2824 The &lt;CODE&gt;cuserid&lt;/CODE&gt; function returns a pointer to a string containing a
2825 user name associated with the effective ID of the process. If
2826 &lt;VAR&gt;string&lt;/VAR&gt; is not a null pointer, it should be an array that can hold
2827 at least &lt;CODE&gt;L_cuserid&lt;/CODE&gt; characters; the string is returned in this
2828 array. Otherwise, a pointer to a string in a static area is returned.
2829 This string is statically allocated and might be overwritten on
2830 subsequent calls to this function or to &lt;CODE&gt;getlogin&lt;/CODE&gt;.
2831 &lt;br&gt;&lt;br&gt; The use of this function is deprecated since it is marked to be
2832 withdrawn in XPG4.2 and has already been removed from newer revisions of
2833 POSIX.1.
2834 </synopsis>
2835 </function>
2836 </construct>
2837 <construct id="struct-exit_status" type="struct">
2838 <structure>
2839 <synopsis>
2840 The &lt;CODE&gt;exit_status&lt;/CODE&gt; data structure is used to hold information about
2841 the exit status of processes marked as &lt;CODE&gt;DEAD_PROCESS&lt;/CODE&gt; in the user
2842 accounting database.
2843 &lt;br&gt;&lt;br&gt;
2844 </synopsis>
2845 <elements>
2846 <element content="short int e_termination">
2847 <synopsis>
2848 The exit status of the process.
2849 &lt;br&gt;&lt;br&gt;
2850 </synopsis>
2851 </element>
2852 </elements>
2853 </structure>
2854 </construct>
2855 <construct id="struct-utmp" type="struct">
2856 <structure>
2857 <synopsis>
2858 The &lt;CODE&gt;utmp&lt;/CODE&gt; data structure is used to hold information about entries
2859 in the user accounting database. On the GNU system it has the following
2860 members:
2861 &lt;br&gt;&lt;br&gt;
2862 </synopsis>
2863 <elements>
2864 <element content="short int ut_type">
2865 <synopsis>
2866 Specifies the type of login; one of &lt;CODE&gt;EMPTY&lt;/CODE&gt;, &lt;CODE&gt;RUN_LVL&lt;/CODE&gt;,
2867 &lt;CODE&gt;BOOT_TIME&lt;/CODE&gt;, &lt;CODE&gt;OLD_TIME&lt;/CODE&gt;, &lt;CODE&gt;NEW_TIME&lt;/CODE&gt;, &lt;CODE&gt;INIT_PROCESS&lt;/CODE&gt;,
2868 &lt;CODE&gt;LOGIN_PROCESS&lt;/CODE&gt;, &lt;CODE&gt;USER_PROCESS&lt;/CODE&gt;, &lt;CODE&gt;DEAD_PROCESS&lt;/CODE&gt; or
2869 &lt;CODE&gt;ACCOUNTING&lt;/CODE&gt;.
2870 &lt;br&gt;&lt;br&gt;
2871 </synopsis>
2872 </element>
2873 <element content="pid_t ut_pid">
2874 <synopsis>
2875 The process ID number of the login process.
2876 &lt;br&gt;&lt;br&gt;
2877 </synopsis>
2878 </element>
2879 <element content="char ut_line[]">
2880 <synopsis>
2881 The device name of the tty (without &lt;TT&gt;/dev/&lt;/TT&gt;).
2882 &lt;br&gt;&lt;br&gt;
2883 </synopsis>
2884 </element>
2885 <element content="char ut_id[]">
2886 <synopsis>
2887 The inittab ID of the process.
2888 &lt;br&gt;&lt;br&gt;
2889 </synopsis>
2890 </element>
2891 <element content="char ut_user[]">
2892 <synopsis>
2893 The user's login name.
2894 &lt;br&gt;&lt;br&gt;
2895 </synopsis>
2896 </element>
2897 <element content="char ut_host[]">
2898 <synopsis>
2899 The name of the host from which the user logged in.
2900 &lt;br&gt;&lt;br&gt;
2901 </synopsis>
2902 </element>
2903 <element content="struct exit_status ut_exit">
2904 <synopsis>
2905 The exit status of a process marked as &lt;CODE&gt;DEAD_PROCESS&lt;/CODE&gt;.
2906 &lt;br&gt;&lt;br&gt;
2907 </synopsis>
2908 </element>
2909 <element content="long ut_session">
2910 <synopsis>
2911 The Session ID, used for windowing.
2912 &lt;br&gt;&lt;br&gt;
2913 </synopsis>
2914 </element>
2915 <element content="struct timeval ut_tv">
2916 <synopsis>
2917 Time the entry was made. For entries of type &lt;CODE&gt;OLD_TIME&lt;/CODE&gt; this is
2918 the time when the system clock changed, and for entries of type
2919 &lt;CODE&gt;NEW_TIME&lt;/CODE&gt; this is the time the system clock was set to.
2920 &lt;br&gt;&lt;br&gt;
2921 </synopsis>
2922 </element>
2923 </elements>
2924 </structure>
2925 </construct>
2926 <construct id="function-setutent" type="function">
2927 <function returntype="void">
2928 <prototype>
2929 <parameter content="void"/>
2930 </prototype>
2931 <headers>
2932 <header filename = "stdio.h"/>
2933 <header filename = "utmp.h"/>
2934 </headers>
2935 <synopsis>
2936 This function opens the user accounting database to begin scanning it.
2937 You can then call &lt;CODE&gt;getutent&lt;/CODE&gt;, &lt;CODE&gt;getutid&lt;/CODE&gt; or &lt;CODE&gt;getutline&lt;/CODE&gt; to
2938 read entries and &lt;CODE&gt;pututline&lt;/CODE&gt; to write entries.
2939 &lt;br&gt;&lt;br&gt; If the database is already open, it resets the input to the beginning of
2940 the database.
2941 </synopsis>
2942 </function>
2943 </construct>
2944 <construct id="function-getutent" type="function">
2945 <function returntype="struct utmp *">
2946 <prototype>
2947 <parameter content="void"/>
2948 </prototype>
2949 <headers>
2950 <header filename = "utmp.h"/>
2951 </headers>
2952 <synopsis>
2953 The &lt;CODE&gt;getutent&lt;/CODE&gt; function reads the next entry from the user
2954 accounting database. It returns a pointer to the entry, which is
2955 statically allocated and may be overwritten by subsequent calls to
2956 &lt;CODE&gt;getutent&lt;/CODE&gt;. You must copy the contents of the structure if you
2957 wish to save the information or you can use the &lt;CODE&gt;getutent_r&lt;/CODE&gt;
2958 function which stores the data in a user-provided buffer.
2959 &lt;br&gt;&lt;br&gt; A null pointer is returned in case no further entry is available.
2960 </synopsis>
2961 </function>
2962 </construct>
2963 <construct id="function-endutent" type="function">
2964 <function returntype="void">
2965 <prototype>
2966 <parameter content="void"/>
2967 </prototype>
2968 <headers>
2969 <header filename = "utmp.h"/>
2970 </headers>
2971 <synopsis>
2972 This function closes the user accounting database.
2973 </synopsis>
2974 </function>
2975 </construct>
2976 <construct id="function-getutid" type="function">
2977 <function returntype="struct utmp *">
2978 <prototype>
2979 <parameter content="const struct utmp *id"/>
2980 </prototype>
2981 <headers>
2982 <header filename = "utmp.h"/>
2983 </headers>
2984 <synopsis>
2985 This function searches forward from the current point in the database
2986 for an entry that matches &lt;VAR&gt;id&lt;/VAR&gt;. If the &lt;CODE&gt;ut_type&lt;/CODE&gt; member of the
2987 &lt;VAR&gt;id&lt;/VAR&gt; structure is one of &lt;CODE&gt;RUN_LVL&lt;/CODE&gt;, &lt;CODE&gt;BOOT_TIME&lt;/CODE&gt;,
2988 &lt;CODE&gt;OLD_TIME&lt;/CODE&gt; or &lt;CODE&gt;NEW_TIME&lt;/CODE&gt; the entries match if the
2989 &lt;CODE&gt;ut_type&lt;/CODE&gt; members are identical. If the &lt;CODE&gt;ut_type&lt;/CODE&gt; member of
2990 the &lt;VAR&gt;id&lt;/VAR&gt; structure is &lt;CODE&gt;INIT_PROCESS&lt;/CODE&gt;, &lt;CODE&gt;LOGIN_PROCESS&lt;/CODE&gt;,
2991 &lt;CODE&gt;USER_PROCESS&lt;/CODE&gt; or &lt;CODE&gt;DEAD_PROCESS&lt;/CODE&gt;, the entries match if the
2992 &lt;CODE&gt;ut_type&lt;/CODE&gt; member of the entry read from the database is one of
2993 these four, and the &lt;CODE&gt;ut_id&lt;/CODE&gt; members match. However if the
2994 &lt;CODE&gt;ut_id&lt;/CODE&gt; member of either the &lt;VAR&gt;id&lt;/VAR&gt; structure or the entry read
2995 from the database is empty it checks if the &lt;CODE&gt;ut_line&lt;/CODE&gt; members match
2996 instead. If a matching entry is found, &lt;CODE&gt;getutid&lt;/CODE&gt; returns a pointer
2997 to the entry, which is statically allocated, and may be overwritten by a
2998 subsequent call to &lt;CODE&gt;getutent&lt;/CODE&gt;, &lt;CODE&gt;getutid&lt;/CODE&gt; or &lt;CODE&gt;getutline&lt;/CODE&gt;.
2999 You must copy the contents of the structure if you wish to save the
3000 information.
3001 &lt;br&gt;&lt;br&gt; A null pointer is returned in case the end of the database is reached
3002 without a match.
3003 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;getutid&lt;/CODE&gt; function may cache the last read entry. Therefore,
3004 if you are using &lt;CODE&gt;getutid&lt;/CODE&gt; to search for multiple occurrences, it
3005 is necessary to zero out the static data after each call. Otherwise
3006 &lt;CODE&gt;getutid&lt;/CODE&gt; could just return a pointer to the same entry over and
3007 over again.
3008 </synopsis>
3009 </function>
3010 </construct>
3011 <construct id="function-getutline" type="function">
3012 <function returntype="struct utmp *">
3013 <prototype>
3014 <parameter content="const struct utmp *line"/>
3015 </prototype>
3016 <headers>
3017 <header filename = "utmp.h"/>
3018 </headers>
3019 <synopsis>
3020 This function searches forward from the current point in the database
3021 until it finds an entry whose &lt;CODE&gt;ut_type&lt;/CODE&gt; value is
3022 &lt;CODE&gt;LOGIN_PROCESS&lt;/CODE&gt; or &lt;CODE&gt;USER_PROCESS&lt;/CODE&gt;, and whose &lt;CODE&gt;ut_line&lt;/CODE&gt;
3023 member matches the &lt;CODE&gt;ut_line&lt;/CODE&gt; member of the &lt;VAR&gt;line&lt;/VAR&gt; structure.
3024 If it finds such an entry, it returns a pointer to the entry which is
3025 statically allocated, and may be overwritten by a subsequent call to
3026 &lt;CODE&gt;getutent&lt;/CODE&gt;, &lt;CODE&gt;getutid&lt;/CODE&gt; or &lt;CODE&gt;getutline&lt;/CODE&gt;. You must copy the
3027 contents of the structure if you wish to save the information.
3028 &lt;br&gt;&lt;br&gt; A null pointer is returned in case the end of the database is reached
3029 without a match.
3030 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;getutline&lt;/CODE&gt; function may cache the last read entry. Therefore
3031 if you are using &lt;CODE&gt;getutline&lt;/CODE&gt; to search for multiple occurrences, it
3032 is necessary to zero out the static data after each call. Otherwise
3033 &lt;CODE&gt;getutline&lt;/CODE&gt; could just return a pointer to the same entry over and
3034 over again.
3035 </synopsis>
3036 </function>
3037 </construct>
3038 <construct id="function-pututline" type="function">
3039 <function returntype="struct utmp *">
3040 <prototype>
3041 <parameter content="const struct utmp *utmp"/>
3042 </prototype>
3043 <headers>
3044 <header filename = "utmp.h"/>
3045 </headers>
3046 <synopsis>
3047 The &lt;CODE&gt;pututline&lt;/CODE&gt; function inserts the entry &lt;CODE&gt;*&lt;VAR&gt;utmp&lt;/VAR&gt;&lt;/CODE&gt; at
3048 the appropriate place in the user accounting database. If it finds that
3049 it is not already at the correct place in the database, it uses
3050 &lt;CODE&gt;getutid&lt;/CODE&gt; to search for the position to insert the entry, however
3051 this will not modify the static structure returned by &lt;CODE&gt;getutent&lt;/CODE&gt;,
3052 &lt;CODE&gt;getutid&lt;/CODE&gt; and &lt;CODE&gt;getutline&lt;/CODE&gt;. If this search fails, the entry
3053 is appended to the database.
3054 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;pututline&lt;/CODE&gt; function returns a pointer to a copy of the entry
3055 inserted in the user accounting database, or a null pointer if the entry
3056 could not be added. The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are
3057 defined for this function:
3058 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
3059
3060 &lt;DT&gt;&lt;CODE&gt;EPERM&lt;/CODE&gt;
3061 &lt;DD&gt;
3062 The process does not have the appropriate privileges; you cannot modify
3063 the user accounting database.
3064
3065 </synopsis>
3066 </function>
3067 </construct>
3068 <construct id="function-getutent_r" type="function">
3069 <function returntype="int">
3070 <prototype>
3071 <parameter content="struct utmp *buffer"/>
3072 <parameter content="struct utmp **result"/>
3073 </prototype>
3074 <headers>
3075 <header filename = "utmp.h"/>
3076 </headers>
3077 <synopsis>
3078 The &lt;CODE&gt;getutent_r&lt;/CODE&gt; is equivalent to the &lt;CODE&gt;getutent&lt;/CODE&gt; function. It
3079 returns the next entry from the database. But instead of storing the
3080 information in a static buffer it stores it in the buffer pointed to by
3081 the parameter &lt;VAR&gt;buffer&lt;/VAR&gt;.
3082 &lt;br&gt;&lt;br&gt; If the call was successful, the function returns &lt;CODE&gt;0&lt;/CODE&gt; and the
3083 pointer variable pointed to by the parameter &lt;VAR&gt;result&lt;/VAR&gt; contains a
3084 pointer to the buffer which contains the result (this is most probably
3085 the same value as &lt;VAR&gt;buffer&lt;/VAR&gt;). If something went wrong during the
3086 execution of &lt;CODE&gt;getutent_r&lt;/CODE&gt; the function returns &lt;CODE&gt;-1&lt;/CODE&gt;.
3087 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
3088 </synopsis>
3089 </function>
3090 </construct>
3091 <construct id="function-getutid_r" type="function">
3092 <function returntype="int">
3093 <prototype>
3094 <parameter content="const struct utmp *id"/>
3095 <parameter content="struct utmp *buffer"/>
3096 <parameter content="struct utmp **result"/>
3097 </prototype>
3098 <headers>
3099 <header filename = "utmp.h"/>
3100 </headers>
3101 <synopsis>
3102 This function retrieves just like &lt;CODE&gt;getutid&lt;/CODE&gt; the next entry matching
3103 the information stored in &lt;VAR&gt;id&lt;/VAR&gt;. But the result is stored in the
3104 buffer pointed to by the parameter &lt;VAR&gt;buffer&lt;/VAR&gt;.
3105 &lt;br&gt;&lt;br&gt; If successful the function returns &lt;CODE&gt;0&lt;/CODE&gt; and the pointer variable
3106 pointed to by the parameter &lt;VAR&gt;result&lt;/VAR&gt; contains a pointer to the
3107 buffer with the result (probably the same as &lt;VAR&gt;result&lt;/VAR&gt;. If not
3108 successful the function return &lt;CODE&gt;-1&lt;/CODE&gt;.
3109 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
3110 </synopsis>
3111 </function>
3112 </construct>
3113 <construct id="function-getutline_r" type="function">
3114 <function returntype="int">
3115 <prototype>
3116 <parameter content="const struct utmp *line"/>
3117 <parameter content="struct utmp *buffer"/>
3118 <parameter content="struct utmp **result"/>
3119 </prototype>
3120 <headers>
3121 <header filename = "utmp.h"/>
3122 </headers>
3123 <synopsis>
3124 This function retrieves just like &lt;CODE&gt;getutline&lt;/CODE&gt; the next entry
3125 matching the information stored in &lt;VAR&gt;line&lt;/VAR&gt;. But the result is stored
3126 in the buffer pointed to by the parameter &lt;VAR&gt;buffer&lt;/VAR&gt;.
3127 &lt;br&gt;&lt;br&gt; If successful the function returns &lt;CODE&gt;0&lt;/CODE&gt; and the pointer variable
3128 pointed to by the parameter &lt;VAR&gt;result&lt;/VAR&gt; contains a pointer to the
3129 buffer with the result (probably the same as &lt;VAR&gt;result&lt;/VAR&gt;. If not
3130 successful the function return &lt;CODE&gt;-1&lt;/CODE&gt;.
3131 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
3132 </synopsis>
3133 </function>
3134 </construct>
3135 <construct id="function-utmpname" type="function">
3136 <function returntype="int">
3137 <prototype>
3138 <parameter content="const char *file"/>
3139 </prototype>
3140 <headers>
3141 <header filename = "utmp.h"/>
3142 </headers>
3143 <synopsis>
3144 The &lt;CODE&gt;utmpname&lt;/CODE&gt; function changes the name of the database to be
3145 examined to &lt;VAR&gt;file&lt;/VAR&gt;, and closes any previously opened database. By
3146 default &lt;CODE&gt;getutent&lt;/CODE&gt;, &lt;CODE&gt;getutid&lt;/CODE&gt;, &lt;CODE&gt;getutline&lt;/CODE&gt; and
3147 &lt;CODE&gt;pututline&lt;/CODE&gt; read from and write to the user accounting database.
3148 &lt;br&gt;&lt;br&gt; The following macros are defined for use as the &lt;VAR&gt;file&lt;/VAR&gt; argument:
3149 &lt;br&gt;&lt;br&gt; Macro {char *} _PATH_UTMP
3150 This macro is used to specify the user accounting database.
3151
3152 &lt;br&gt;&lt;br&gt; Macro {char *} _PATH_WTMP
3153 This macro is used to specify the user accounting log file.
3154
3155 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;utmpname&lt;/CODE&gt; function returns a value of &lt;CODE&gt;0&lt;/CODE&gt; if the new name
3156 was successfully stored, and a value of &lt;CODE&gt;-1&lt;/CODE&gt; to indicate an error.
3157 Note that &lt;CODE&gt;utmpname&lt;/CODE&gt; does not try to open the database, and that
3158 therefore the return value does not say anything about whether the
3159 database can be successfully opened.
3160 </synopsis>
3161 </function>
3162 </construct>
3163 <construct id="function-updwtmp" type="function">
3164 <function returntype="void">
3165 <prototype>
3166 <parameter content="const char *wtmp_file"/>
3167 <parameter content="const struct utmp *utmp"/>
3168 </prototype>
3169 <headers>
3170 <header filename = "utmp.h"/>
3171 </headers>
3172 <synopsis>
3173 The &lt;CODE&gt;updwtmp&lt;/CODE&gt; function appends the entry *&lt;VAR&gt;utmp&lt;/VAR&gt; to the
3174 database specified by &lt;VAR&gt;wtmp_file&lt;/VAR&gt;. For possible values for the
3175 &lt;VAR&gt;wtmp_file&lt;/VAR&gt; argument see the &lt;CODE&gt;utmpname&lt;/CODE&gt; function.
3176 </synopsis>
3177 </function>
3178 </construct>
3179 <construct id="struct-utmpx" type="struct">
3180 <structure>
3181 <synopsis>
3182 The &lt;CODE&gt;utmpx&lt;/CODE&gt; data structure contains at least the following members:
3183 &lt;br&gt;&lt;br&gt;
3184 </synopsis>
3185 <elements>
3186 <element content="short int ut_type">
3187 <synopsis>
3188 Specifies the type of login; one of &lt;CODE&gt;EMPTY&lt;/CODE&gt;, &lt;CODE&gt;RUN_LVL&lt;/CODE&gt;,
3189 &lt;CODE&gt;BOOT_TIME&lt;/CODE&gt;, &lt;CODE&gt;OLD_TIME&lt;/CODE&gt;, &lt;CODE&gt;NEW_TIME&lt;/CODE&gt;, &lt;CODE&gt;INIT_PROCESS&lt;/CODE&gt;,
3190 &lt;CODE&gt;LOGIN_PROCESS&lt;/CODE&gt;, &lt;CODE&gt;USER_PROCESS&lt;/CODE&gt; or &lt;CODE&gt;DEAD_PROCESS&lt;/CODE&gt;.
3191 &lt;br&gt;&lt;br&gt;
3192 </synopsis>
3193 </element>
3194 <element content="pid_t ut_pid">
3195 <synopsis>
3196 The process ID number of the login process.
3197 &lt;br&gt;&lt;br&gt;
3198 </synopsis>
3199 </element>
3200 <element content="char ut_line[]">
3201 <synopsis>
3202 The device name of the tty (without &lt;TT&gt;/dev/&lt;/TT&gt;).
3203 &lt;br&gt;&lt;br&gt;
3204 </synopsis>
3205 </element>
3206 <element content="char ut_id[]">
3207 <synopsis>
3208 The inittab ID of the process.
3209 &lt;br&gt;&lt;br&gt;
3210 </synopsis>
3211 </element>
3212 <element content="char ut_user[]">
3213 <synopsis>
3214 The user's login name.
3215 &lt;br&gt;&lt;br&gt;
3216 </synopsis>
3217 </element>
3218 </elements>
3219 </structure>
3220 </construct>
3221 <construct id="function-setutxent" type="function">
3222 <function returntype="void">
3223 <prototype>
3224 <parameter content="void"/>
3225 </prototype>
3226 <headers>
3227 <header filename = "utmpx.h"/>
3228 </headers>
3229 <synopsis>
3230 This function is similar to &lt;CODE&gt;setutent&lt;/CODE&gt;. On the GNU system it is
3231 simply an alias for &lt;CODE&gt;setutent&lt;/CODE&gt;.
3232 </synopsis>
3233 </function>
3234 </construct>
3235 <construct id="function-getutxent" type="function">
3236 <function returntype="struct utmpx *">
3237 <prototype>
3238 <parameter content="void"/>
3239 </prototype>
3240 <headers>
3241 <header filename = "utmpx.h"/>
3242 </headers>
3243 <synopsis>
3244 The &lt;CODE&gt;getutxent&lt;/CODE&gt; function is similar to &lt;CODE&gt;getutent&lt;/CODE&gt;, but returns
3245 a pointer to a &lt;CODE&gt;struct utmpx&lt;/CODE&gt; instead of &lt;CODE&gt;struct utmp&lt;/CODE&gt;. On
3246 the GNU system it simply is an alias for &lt;CODE&gt;getutent&lt;/CODE&gt;.
3247 </synopsis>
3248 </function>
3249 </construct>
3250 <construct id="function-endutxent" type="function">
3251 <function returntype="void">
3252 <prototype>
3253 <parameter content="void"/>
3254 </prototype>
3255 <headers>
3256 <header filename = "utmpx.h"/>
3257 </headers>
3258 <synopsis>
3259 This function is similar to &lt;CODE&gt;endutent&lt;/CODE&gt;. On the GNU system it is
3260 simply an alias for &lt;CODE&gt;endutent&lt;/CODE&gt;.
3261 </synopsis>
3262 </function>
3263 </construct>
3264 <construct id="function-getutxid" type="function">
3265 <function returntype="struct utmpx *">
3266 <prototype>
3267 <parameter content="const struct utmpx *id"/>
3268 </prototype>
3269 <headers>
3270 <header filename = "utmpx.h"/>
3271 </headers>
3272 <synopsis>
3273 This function is similar to &lt;CODE&gt;getutid&lt;/CODE&gt;, but uses &lt;CODE&gt;struct utmpx&lt;/CODE&gt;
3274 instead of &lt;CODE&gt;struct utmp&lt;/CODE&gt;. On the GNU system it is simply an alias
3275 for &lt;CODE&gt;getutid&lt;/CODE&gt;.
3276 </synopsis>
3277 </function>
3278 </construct>
3279 <construct id="function-getutxline" type="function">
3280 <function returntype="struct utmpx *">
3281 <prototype>
3282 <parameter content="const struct utmpx *line"/>
3283 </prototype>
3284 <headers>
3285 <header filename = "utmpx.h"/>
3286 </headers>
3287 <synopsis>
3288 This function is similar to &lt;CODE&gt;getutid&lt;/CODE&gt;, but uses &lt;CODE&gt;struct utmpx&lt;/CODE&gt;
3289 instead of &lt;CODE&gt;struct utmp&lt;/CODE&gt;. On the GNU system it is simply an alias
3290 for &lt;CODE&gt;getutline&lt;/CODE&gt;.
3291 </synopsis>
3292 </function>
3293 </construct>
3294 <construct id="function-pututxline" type="function">
3295 <function returntype="struct utmpx *">
3296 <prototype>
3297 <parameter content="const struct utmpx *utmp"/>
3298 </prototype>
3299 <headers>
3300 <header filename = "utmpx.h"/>
3301 </headers>
3302 <synopsis>
3303 The &lt;CODE&gt;pututxline&lt;/CODE&gt; function is functionally identical to
3304 &lt;CODE&gt;pututline&lt;/CODE&gt;, but uses &lt;CODE&gt;struct utmpx&lt;/CODE&gt; instead of &lt;CODE&gt;struct
3305 utmp&lt;/CODE&gt;. On the GNU system, &lt;CODE&gt;pututxline&lt;/CODE&gt; is simply an alias for
3306 &lt;CODE&gt;pututline&lt;/CODE&gt;.
3307 </synopsis>
3308 </function>
3309 </construct>
3310 <construct id="function-utmpxname" type="function">
3311 <function returntype="int">
3312 <prototype>
3313 <parameter content="const char *file"/>
3314 </prototype>
3315 <headers>
3316 <header filename = "utmpx.h"/>
3317 </headers>
3318 <synopsis>
3319 The &lt;CODE&gt;utmpxname&lt;/CODE&gt; function is functionally identical to
3320 &lt;CODE&gt;utmpname&lt;/CODE&gt;. On the GNU system, &lt;CODE&gt;utmpxname&lt;/CODE&gt; is simply an
3321 alias for &lt;CODE&gt;utmpname&lt;/CODE&gt;.
3322 </synopsis>
3323 </function>
3324 </construct>
3325 <construct id="function-getutmp" type="function">
3326 <function returntype="int">
3327 <prototype>
3328 <parameter content="const struct utmpx *utmpx"/>
3329 <parameter content="struct utmp *utmp"/>
3330 </prototype>
3331 <headers>
3332 <header filename = "utmpx.h"/>
3333 <header filename = "utmp.h"/>
3334 </headers>
3335 <synopsis>
3336 &lt;CODE&gt;getutmp&lt;/CODE&gt; copies the information, insofar as the structures are
3337 compatible, from &lt;VAR&gt;utmpx&lt;/VAR&gt; to &lt;VAR&gt;utmp&lt;/VAR&gt;.
3338 </synopsis>
3339 </function>
3340 </construct>
3341 <construct id="function-getutmpx" type="function">
3342 <function returntype="int">
3343 <prototype>
3344 <parameter content="const struct utmp *utmp"/>
3345 <parameter content="struct utmpx *utmpx"/>
3346 </prototype>
3347 <headers>
3348 <header filename = "utmpx.h"/>
3349 <header filename = "utmp.h"/>
3350 </headers>
3351 <synopsis>
3352 &lt;CODE&gt;getutmpx&lt;/CODE&gt; copies the information, insofar as the structures are
3353 compatible, from &lt;VAR&gt;utmp&lt;/VAR&gt; to &lt;VAR&gt;utmpx&lt;/VAR&gt;.
3354 </synopsis>
3355 </function>
3356 </construct>
3357 <construct id="function-login_tty" type="function">
3358 <function returntype="int">
3359 <prototype>
3360 <parameter content="int filedes"/>
3361 </prototype>
3362 <headers>
3363 <header filename = "utmp.h"/>
3364 </headers>
3365 <synopsis>
3366 This function makes &lt;VAR&gt;filedes&lt;/VAR&gt; the controlling terminal of the
3367 current process, redirects standard input, standard output and
3368 standard error output to this terminal, and closes &lt;VAR&gt;filedes&lt;/VAR&gt;.
3369 &lt;br&gt;&lt;br&gt; This function returns &lt;CODE&gt;0&lt;/CODE&gt; on successful completion, and &lt;CODE&gt;-1&lt;/CODE&gt;
3370 on error.
3371 </synopsis>
3372 </function>
3373 </construct>
3374 <construct id="function-login" type="function">
3375 <function returntype="void">
3376 <prototype>
3377 <parameter content="const struct utmp *entry"/>
3378 </prototype>
3379 <headers>
3380 <header filename = "utmp.h"/>
3381 </headers>
3382 <synopsis>
3383 The &lt;CODE&gt;login&lt;/CODE&gt; functions inserts an entry into the user accounting
3384 database. The &lt;CODE&gt;ut_line&lt;/CODE&gt; member is set to the name of the terminal
3385 on standard input. If standard input is not a terminal &lt;CODE&gt;login&lt;/CODE&gt;
3386 uses standard output or standard error output to determine the name of
3387 the terminal. If &lt;CODE&gt;struct utmp&lt;/CODE&gt; has a &lt;CODE&gt;ut_type&lt;/CODE&gt; member,
3388 &lt;CODE&gt;login&lt;/CODE&gt; sets it to &lt;CODE&gt;USER_PROCESS&lt;/CODE&gt;, and if there is an
3389 &lt;CODE&gt;ut_pid&lt;/CODE&gt; member, it will be set to the process ID of the current
3390 process. The remaining entries are copied from &lt;VAR&gt;entry&lt;/VAR&gt;.
3391 &lt;br&gt;&lt;br&gt; A copy of the entry is written to the user accounting log file.
3392 </synopsis>
3393 </function>
3394 </construct>
3395 <construct id="function-logout" type="function">
3396 <function returntype="int">
3397 <prototype>
3398 <parameter content="const char *ut_line"/>
3399 </prototype>
3400 <headers>
3401 <header filename = "utmp.h"/>
3402 </headers>
3403 <synopsis>
3404 This function modifies the user accounting database to indicate that the
3405 user on &lt;VAR&gt;ut_line&lt;/VAR&gt; has logged out.
3406 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;logout&lt;/CODE&gt; function returns &lt;CODE&gt;1&lt;/CODE&gt; if the entry was successfully
3407 written to the database, or &lt;CODE&gt;0&lt;/CODE&gt; on error.
3408 </synopsis>
3409 </function>
3410 </construct>
3411 <construct id="function-logwtmp" type="function">
3412 <function returntype="void">
3413 <prototype>
3414 <parameter content="const char *ut_line"/>
3415 <parameter content="const char *ut_name"/>
3416 <parameter content="const char *ut_host"/>
3417 </prototype>
3418 <headers>
3419 <header filename = "utmp.h"/>
3420 </headers>
3421 <synopsis>
3422 The &lt;CODE&gt;logwtmp&lt;/CODE&gt; function appends an entry to the user accounting log
3423 file, for the current time and the information provided in the
3424 &lt;VAR&gt;ut_line&lt;/VAR&gt;, &lt;VAR&gt;ut_name&lt;/VAR&gt; and &lt;VAR&gt;ut_host&lt;/VAR&gt; arguments.
3425 </synopsis>
3426 </function>
3427 </construct>
3428 <construct id="struct-passwd" type="struct">
3429 <structure>
3430 <synopsis>
3431 The &lt;CODE&gt;passwd&lt;/CODE&gt; data structure is used to hold information about
3432 entries in the system user data base. It has at least the following members:
3433 &lt;br&gt;&lt;br&gt;
3434 </synopsis>
3435 <elements>
3436 <element content="char *pw_name">
3437 <synopsis>
3438 The user's login name.
3439 &lt;br&gt;&lt;br&gt;
3440 </synopsis>
3441 </element>
3442 <element content="char *pw_passwd.">
3443 <synopsis>
3444 The encrypted password string.
3445 &lt;br&gt;&lt;br&gt;
3446 </synopsis>
3447 </element>
3448 <element content="uid_t pw_uid">
3449 <synopsis>
3450 The user ID number.
3451 &lt;br&gt;&lt;br&gt;
3452 </synopsis>
3453 </element>
3454 <element content="gid_t pw_gid">
3455 <synopsis>
3456 The user's default group ID number.
3457 &lt;br&gt;&lt;br&gt;
3458 </synopsis>
3459 </element>
3460 <element content="char *pw_gecos">
3461 <synopsis>
3462 A string typically containing the user's real name, and possibly other
3463 information such as a phone number.
3464 &lt;br&gt;&lt;br&gt;
3465 </synopsis>
3466 </element>
3467 <element content="char *pw_dir">
3468 <synopsis>
3469 The user's home directory, or initial working directory. This might be
3470 a null pointer, in which case the interpretation is system-dependent.
3471 &lt;br&gt;&lt;br&gt;
3472 </synopsis>
3473 </element>
3474 </elements>
3475 </structure>
3476 </construct>
3477 <construct id="function-getpwuid" type="function">
3478 <function returntype="struct passwd *">
3479 <prototype>
3480 <parameter content="uid_t uid"/>
3481 </prototype>
3482 <headers>
3483 <header filename = "pwd.h"/>
3484 </headers>
3485 <synopsis>
3486 This function returns a pointer to a statically-allocated structure
3487 containing information about the user whose user ID is &lt;VAR&gt;uid&lt;/VAR&gt;. This
3488 structure may be overwritten on subsequent calls to &lt;CODE&gt;getpwuid&lt;/CODE&gt;.
3489 &lt;br&gt;&lt;br&gt; A null pointer value indicates there is no user in the data base with
3490 user ID &lt;VAR&gt;uid&lt;/VAR&gt;.
3491 </synopsis>
3492 </function>
3493 </construct>
3494 <construct id="function-getpwuid_r" type="function">
3495 <function returntype="int">
3496 <prototype>
3497 <parameter content="uid_t uid"/>
3498 <parameter content="struct passwd *result_buf"/>
3499 <parameter content="char *buffer"/>
3500 <parameter content="size_t buflen"/>
3501 <parameter content="struct passwd **result"/>
3502 </prototype>
3503 <headers>
3504 <header filename = "pwd.h"/>
3505 </headers>
3506 <synopsis>
3507 This function is similar to &lt;CODE&gt;getpwuid&lt;/CODE&gt; in that it returns
3508 information about the user whose user ID is &lt;VAR&gt;uid&lt;/VAR&gt;. However, it
3509 fills the user supplied structure pointed to by &lt;VAR&gt;result_buf&lt;/VAR&gt; with
3510 the information instead of using a static buffer. The first
3511 &lt;VAR&gt;buflen&lt;/VAR&gt; bytes of the additional buffer pointed to by &lt;VAR&gt;buffer&lt;/VAR&gt;
3512 are used to contain additional information, normally strings which are
3513 pointed to by the elements of the result structure.
3514 &lt;br&gt;&lt;br&gt; If a user with ID &lt;VAR&gt;uid&lt;/VAR&gt; is found, the pointer returned in
3515 &lt;VAR&gt;result&lt;/VAR&gt; points to the record which contains the wanted data (i.e.,
3516 &lt;VAR&gt;result&lt;/VAR&gt; contains the value &lt;VAR&gt;result_buf&lt;/VAR&gt;). If no user is found
3517 or if an error occurred, the pointer returned in &lt;VAR&gt;result&lt;/VAR&gt; is a null
3518 pointer. The function returns zero or an error code. If the buffer
3519 &lt;VAR&gt;buffer&lt;/VAR&gt; is too small to contain all the needed information, the
3520 error code &lt;CODE&gt;ERANGE&lt;/CODE&gt; is returned and &lt;VAR&gt;errno&lt;/VAR&gt; is set to
3521 &lt;CODE&gt;ERANGE&lt;/CODE&gt;.
3522 </synopsis>
3523 </function>
3524 </construct>
3525 <construct id="function-getpwnam" type="function">
3526 <function returntype="struct passwd *">
3527 <prototype>
3528 <parameter content="const char *name"/>
3529 </prototype>
3530 <headers>
3531 <header filename = "pwd.h"/>
3532 </headers>
3533 <synopsis>
3534 This function returns a pointer to a statically-allocated structure
3535 containing information about the user whose user name is &lt;VAR&gt;name&lt;/VAR&gt;.
3536 This structure may be overwritten on subsequent calls to
3537 &lt;CODE&gt;getpwnam&lt;/CODE&gt;.
3538 &lt;br&gt;&lt;br&gt; A null pointer return indicates there is no user named &lt;VAR&gt;name&lt;/VAR&gt;.
3539 </synopsis>
3540 </function>
3541 </construct>
3542 <construct id="function-getpwnam_r" type="function">
3543 <function returntype="int">
3544 <prototype>
3545 <parameter content="const char *name"/>
3546 <parameter content="struct passwd *result_buf"/>
3547 <parameter content="char *buffer"/>
3548 <parameter content="size_t buflen"/>
3549 <parameter content="struct passwd **result"/>
3550 </prototype>
3551 <headers>
3552 <header filename = "pwd.h"/>
3553 </headers>
3554 <synopsis>
3555 This function is similar to &lt;CODE&gt;getpwnam&lt;/CODE&gt; in that is returns
3556 information about the user whose user name is &lt;VAR&gt;name&lt;/VAR&gt;. However, like
3557 &lt;CODE&gt;getpwuid_r&lt;/CODE&gt;, it fills the user supplied buffers in
3558 &lt;VAR&gt;result_buf&lt;/VAR&gt; and &lt;VAR&gt;buffer&lt;/VAR&gt; with the information instead of using
3559 a static buffer.
3560 &lt;br&gt;&lt;br&gt; The return values are the same as for &lt;CODE&gt;getpwuid_r&lt;/CODE&gt;.
3561 </synopsis>
3562 </function>
3563 </construct>
3564 <construct id="function-fgetpwent" type="function">
3565 <function returntype="struct passwd *">
3566 <prototype>
3567 <parameter content="FILE *stream"/>
3568 </prototype>
3569 <headers>
3570 <header filename = "pwd.h"/>
3571 </headers>
3572 <synopsis>
3573 This function reads the next user entry from &lt;VAR&gt;stream&lt;/VAR&gt; and returns a
3574 pointer to the entry. The structure is statically allocated and is
3575 rewritten on subsequent calls to &lt;CODE&gt;fgetpwent&lt;/CODE&gt;. You must copy the
3576 contents of the structure if you wish to save the information.
3577 &lt;br&gt;&lt;br&gt; The stream must correspond to a file in the same format as the standard
3578 password database file.
3579 </synopsis>
3580 </function>
3581 </construct>
3582 <construct id="function-fgetpwent_r" type="function">
3583 <function returntype="int">
3584 <prototype>
3585 <parameter content="FILE *stream"/>
3586 <parameter content="struct passwd *result_buf"/>
3587 <parameter content="char *buffer"/>
3588 <parameter content="size_t buflen"/>
3589 <parameter content="struct passwd **result"/>
3590 </prototype>
3591 <headers>
3592 <header filename = "pwd.h"/>
3593 </headers>
3594 <synopsis>
3595 This function is similar to &lt;CODE&gt;fgetpwent&lt;/CODE&gt; in that it reads the next
3596 user entry from &lt;VAR&gt;stream&lt;/VAR&gt;. But the result is returned in the
3597 structure pointed to by &lt;VAR&gt;result_buf&lt;/VAR&gt;. The
3598 first &lt;VAR&gt;buflen&lt;/VAR&gt; bytes of the additional buffer pointed to by
3599 &lt;VAR&gt;buffer&lt;/VAR&gt; are used to contain additional information, normally
3600 strings which are pointed to by the elements of the result structure.
3601 &lt;br&gt;&lt;br&gt; The stream must correspond to a file in the same format as the standard
3602 password database file.
3603 &lt;br&gt;&lt;br&gt; If the function returns zero &lt;VAR&gt;result&lt;/VAR&gt; points to the structure with
3604 the wanted data (normally this is in &lt;VAR&gt;result_buf&lt;/VAR&gt;). If errors
3605 occurred the return value is nonzero and &lt;VAR&gt;result&lt;/VAR&gt; contains a null
3606 pointer.
3607 </synopsis>
3608 </function>
3609 </construct>
3610 <construct id="function-setpwent" type="function">
3611 <function returntype="void">
3612 <prototype>
3613 <parameter content="void"/>
3614 </prototype>
3615 <headers>
3616 <header filename = "pwd.h"/>
3617 </headers>
3618 <synopsis>
3619 This function initializes a stream which &lt;CODE&gt;getpwent&lt;/CODE&gt; and
3620 &lt;CODE&gt;getpwent_r&lt;/CODE&gt; use to read the user database.
3621 </synopsis>
3622 </function>
3623 </construct>
3624 <construct id="function-getpwent" type="function">
3625 <function returntype="struct passwd *">
3626 <prototype>
3627 <parameter content="void"/>
3628 </prototype>
3629 <headers>
3630 <header filename = "pwd.h"/>
3631 </headers>
3632 <synopsis>
3633 The &lt;CODE&gt;getpwent&lt;/CODE&gt; function reads the next entry from the stream
3634 initialized by &lt;CODE&gt;setpwent&lt;/CODE&gt;. It returns a pointer to the entry. The
3635 structure is statically allocated and is rewritten on subsequent calls
3636 to &lt;CODE&gt;getpwent&lt;/CODE&gt;. You must copy the contents of the structure if you
3637 wish to save the information.
3638 &lt;br&gt;&lt;br&gt; A null pointer is returned when no more entries are available.
3639 </synopsis>
3640 </function>
3641 </construct>
3642 <construct id="function-getpwent_r" type="function">
3643 <function returntype="int">
3644 <prototype>
3645 <parameter content="struct passwd *result_buf"/>
3646 <parameter content="char *buffer"/>
3647 <parameter content="int buflen"/>
3648 <parameter content="struct passwd **result"/>
3649 </prototype>
3650 <headers>
3651 <header filename = "pwd.h"/>
3652 </headers>
3653 <synopsis>
3654 This function is similar to &lt;CODE&gt;getpwent&lt;/CODE&gt; in that it returns the next
3655 entry from the stream initialized by &lt;CODE&gt;setpwent&lt;/CODE&gt;. Like
3656 &lt;CODE&gt;fgetpwent_r&lt;/CODE&gt;, it uses the user-supplied buffers in
3657 &lt;VAR&gt;result_buf&lt;/VAR&gt; and &lt;VAR&gt;buffer&lt;/VAR&gt; to return the information requested.
3658 &lt;br&gt;&lt;br&gt; The return values are the same as for &lt;CODE&gt;fgetpwent_r&lt;/CODE&gt;.
3659 &lt;br&gt;&lt;br&gt;
3660 </synopsis>
3661 </function>
3662 </construct>
3663 <construct id="function-endpwent" type="function">
3664 <function returntype="void">
3665 <prototype>
3666 <parameter content="void"/>
3667 </prototype>
3668 <headers>
3669 <header filename = "pwd.h"/>
3670 </headers>
3671 <synopsis>
3672 This function closes the internal stream used by &lt;CODE&gt;getpwent&lt;/CODE&gt; or
3673 &lt;CODE&gt;getpwent_r&lt;/CODE&gt;.
3674 </synopsis>
3675 </function>
3676 </construct>
3677 <construct id="function-putpwent" type="function">
3678 <function returntype="int">
3679 <prototype>
3680 <parameter content="const struct passwd *p"/>
3681 <parameter content="FILE *stream"/>
3682 </prototype>
3683 <headers>
3684 <header filename = "pwd.h"/>
3685 </headers>
3686 <synopsis>
3687 This function writes the user entry &lt;CODE&gt;*&lt;VAR&gt;p&lt;/VAR&gt;&lt;/CODE&gt; to the stream
3688 &lt;VAR&gt;stream&lt;/VAR&gt;, in the format used for the standard user database
3689 file. The return value is zero on success and nonzero on failure.
3690 &lt;br&gt;&lt;br&gt; This function exists for compatibility with SVID. We recommend that you
3691 avoid using it, because it makes sense only on the assumption that the
3692 &lt;CODE&gt;struct passwd&lt;/CODE&gt; structure has no members except the standard ones;
3693 on a system which merges the traditional Unix data base with other
3694 extended information about users, adding an entry using this function
3695 would inevitably leave out much of the important information.
3696 &lt;br&gt;&lt;br&gt; The group and user ID fields are left empty if the group or user name
3697 starts with a - or +.
3698 &lt;br&gt;&lt;br&gt; The function &lt;CODE&gt;putpwent&lt;/CODE&gt; is declared in &lt;TT&gt;pwd.h&lt;/TT&gt;.
3699 </synopsis>
3700 </function>
3701 </construct>
3702 <construct id="struct-group" type="struct">
3703 <structure>
3704 <synopsis>
3705 The &lt;CODE&gt;group&lt;/CODE&gt; structure is used to hold information about an entry in
3706 the system group database. It has at least the following members:
3707 &lt;br&gt;&lt;br&gt;
3708 </synopsis>
3709 <elements>
3710 <element content="char *gr_name">
3711 <synopsis>
3712 The name of the group.
3713 &lt;br&gt;&lt;br&gt;
3714 </synopsis>
3715 </element>
3716 <element content="gid_t gr_gid">
3717 <synopsis>
3718 The group ID of the group.
3719 &lt;br&gt;&lt;br&gt;
3720 </synopsis>
3721 </element>
3722 </elements>
3723 </structure>
3724 </construct>
3725 <construct id="function-getgrgid" type="function">
3726 <function returntype="struct group *">
3727 <prototype>
3728 <parameter content="gid_t gid"/>
3729 </prototype>
3730 <headers>
3731 <header filename = "grp.h"/>
3732 </headers>
3733 <synopsis>
3734 This function returns a pointer to a statically-allocated structure
3735 containing information about the group whose group ID is &lt;VAR&gt;gid&lt;/VAR&gt;.
3736 This structure may be overwritten by subsequent calls to
3737 &lt;CODE&gt;getgrgid&lt;/CODE&gt;.
3738 &lt;br&gt;&lt;br&gt; A null pointer indicates there is no group with ID &lt;VAR&gt;gid&lt;/VAR&gt;.
3739 </synopsis>
3740 </function>
3741 </construct>
3742 <construct id="function-getgrgid_r" type="function">
3743 <function returntype="int">
3744 <prototype>
3745 <parameter content="gid_t gid"/>
3746 <parameter content="struct group *result_buf"/>
3747 <parameter content="char *buffer"/>
3748 <parameter content="size_t buflen"/>
3749 <parameter content="struct group **result"/>
3750 </prototype>
3751 <headers>
3752 <header filename = "grp.h"/>
3753 </headers>
3754 <synopsis>
3755 This function is similar to &lt;CODE&gt;getgrgid&lt;/CODE&gt; in that it returns
3756 information about the group whose group ID is &lt;VAR&gt;gid&lt;/VAR&gt;. However, it
3757 fills the user supplied structure pointed to by &lt;VAR&gt;result_buf&lt;/VAR&gt; with
3758 the information instead of using a static buffer. The first
3759 &lt;VAR&gt;buflen&lt;/VAR&gt; bytes of the additional buffer pointed to by &lt;VAR&gt;buffer&lt;/VAR&gt;
3760 are used to contain additional information, normally strings which are
3761 pointed to by the elements of the result structure.
3762 &lt;br&gt;&lt;br&gt; If a group with ID &lt;VAR&gt;gid&lt;/VAR&gt; is found, the pointer returned in
3763 &lt;VAR&gt;result&lt;/VAR&gt; points to the record which contains the wanted data (i.e.,
3764 &lt;VAR&gt;result&lt;/VAR&gt; contains the value &lt;VAR&gt;result_buf&lt;/VAR&gt;). If no group is found
3765 or if an error occurred, the pointer returned in &lt;VAR&gt;result&lt;/VAR&gt; is a null
3766 pointer. The function returns zero or an error code. If the buffer
3767 &lt;VAR&gt;buffer&lt;/VAR&gt; is too small to contain all the needed information, the
3768 error code &lt;CODE&gt;ERANGE&lt;/CODE&gt; is returned and &lt;VAR&gt;errno&lt;/VAR&gt; is set to
3769 &lt;CODE&gt;ERANGE&lt;/CODE&gt;.
3770 </synopsis>
3771 </function>
3772 </construct>
3773 <construct id="function-getgrnam" type="function">
3774 <function returntype="struct group *">
3775 <prototype>
3776 <parameter content="const char *name"/>
3777 </prototype>
3778 <headers>
3779 <header filename = "grp.h"/>
3780 </headers>
3781 <synopsis>
3782 This function returns a pointer to a statically-allocated structure
3783 containing information about the group whose group name is &lt;VAR&gt;name&lt;/VAR&gt;.
3784 This structure may be overwritten by subsequent calls to
3785 &lt;CODE&gt;getgrnam&lt;/CODE&gt;.
3786 &lt;br&gt;&lt;br&gt; A null pointer indicates there is no group named &lt;VAR&gt;name&lt;/VAR&gt;.
3787 </synopsis>
3788 </function>
3789 </construct>
3790 <construct id="function-getgrnam_r" type="function">
3791 <function returntype="int">
3792 <prototype>
3793 <parameter content="const char *name"/>
3794 <parameter content="struct group *result_buf"/>
3795 <parameter content="char *buffer"/>
3796 <parameter content="size_t buflen"/>
3797 <parameter content="struct group **result"/>
3798 </prototype>
3799 <headers>
3800 <header filename = "grp.h"/>
3801 </headers>
3802 <synopsis>
3803 This function is similar to &lt;CODE&gt;getgrnam&lt;/CODE&gt; in that is returns
3804 information about the group whose group name is &lt;VAR&gt;name&lt;/VAR&gt;. Like
3805 &lt;CODE&gt;getgrgid_r&lt;/CODE&gt;, it uses the user supplied buffers in
3806 &lt;VAR&gt;result_buf&lt;/VAR&gt; and &lt;VAR&gt;buffer&lt;/VAR&gt;, not a static buffer.
3807 &lt;br&gt;&lt;br&gt; The return values are the same as for &lt;CODE&gt;getgrgid_r&lt;/CODE&gt;
3808 &lt;CODE&gt;ERANGE&lt;/CODE&gt;.
3809 </synopsis>
3810 </function>
3811 </construct>
3812 <construct id="function-fgetgrent" type="function">
3813 <function returntype="struct group *">
3814 <prototype>
3815 <parameter content="FILE *stream"/>
3816 </prototype>
3817 <headers>
3818 <header filename = "grp.h"/>
3819 </headers>
3820 <synopsis>
3821 The &lt;CODE&gt;fgetgrent&lt;/CODE&gt; function reads the next entry from &lt;VAR&gt;stream&lt;/VAR&gt;.
3822 It returns a pointer to the entry. The structure is statically
3823 allocated and is overwritten on subsequent calls to &lt;CODE&gt;fgetgrent&lt;/CODE&gt;. You
3824 must copy the contents of the structure if you wish to save the
3825 information.
3826 &lt;br&gt;&lt;br&gt; The stream must correspond to a file in the same format as the standard
3827 group database file.
3828 </synopsis>
3829 </function>
3830 </construct>
3831 <construct id="function-fgetgrent_r" type="function">
3832 <function returntype="int">
3833 <prototype>
3834 <parameter content="FILE *stream"/>
3835 <parameter content="struct group *result_buf"/>
3836 <parameter content="char *buffer"/>
3837 <parameter content="size_t buflen"/>
3838 <parameter content="struct group **result"/>
3839 </prototype>
3840 <headers>
3841 <header filename = "grp.h"/>
3842 </headers>
3843 <synopsis>
3844 This function is similar to &lt;CODE&gt;fgetgrent&lt;/CODE&gt; in that it reads the next
3845 user entry from &lt;VAR&gt;stream&lt;/VAR&gt;. But the result is returned in the
3846 structure pointed to by &lt;VAR&gt;result_buf&lt;/VAR&gt;. The first &lt;VAR&gt;buflen&lt;/VAR&gt; bytes
3847 of the additional buffer pointed to by &lt;VAR&gt;buffer&lt;/VAR&gt; are used to contain
3848 additional information, normally strings which are pointed to by the
3849 elements of the result structure.
3850 &lt;br&gt;&lt;br&gt; This stream must correspond to a file in the same format as the standard
3851 group database file.
3852 &lt;br&gt;&lt;br&gt; If the function returns zero &lt;VAR&gt;result&lt;/VAR&gt; points to the structure with
3853 the wanted data (normally this is in &lt;VAR&gt;result_buf&lt;/VAR&gt;). If errors
3854 occurred the return value is non-zero and &lt;VAR&gt;result&lt;/VAR&gt; contains a null
3855 pointer.
3856 </synopsis>
3857 </function>
3858 </construct>
3859 <construct id="function-setgrent" type="function">
3860 <function returntype="void">
3861 <prototype>
3862 <parameter content="void"/>
3863 </prototype>
3864 <headers>
3865 <header filename = "grp.h"/>
3866 </headers>
3867 <synopsis>
3868 This function initializes a stream for reading from the group data base.
3869 You use this stream by calling &lt;CODE&gt;getgrent&lt;/CODE&gt; or &lt;CODE&gt;getgrent_r&lt;/CODE&gt;.
3870 </synopsis>
3871 </function>
3872 </construct>
3873 <construct id="function-getgrent" type="function">
3874 <function returntype="struct group *">
3875 <prototype>
3876 <parameter content="void"/>
3877 </prototype>
3878 <headers>
3879 <header filename = "grp.h"/>
3880 </headers>
3881 <synopsis>
3882 The &lt;CODE&gt;getgrent&lt;/CODE&gt; function reads the next entry from the stream
3883 initialized by &lt;CODE&gt;setgrent&lt;/CODE&gt;. It returns a pointer to the entry. The
3884 structure is statically allocated and is overwritten on subsequent calls
3885 to &lt;CODE&gt;getgrent&lt;/CODE&gt;. You must copy the contents of the structure if you
3886 wish to save the information.
3887 </synopsis>
3888 </function>
3889 </construct>
3890 <construct id="function-getgrent_r" type="function">
3891 <function returntype="int">
3892 <prototype>
3893 <parameter content="struct group *result_buf"/>
3894 <parameter content="char *buffer"/>
3895 <parameter content="size_t buflen"/>
3896 <parameter content="struct group **result"/>
3897 </prototype>
3898 <headers>
3899 <header filename = "grp.h"/>
3900 </headers>
3901 <synopsis>
3902 This function is similar to &lt;CODE&gt;getgrent&lt;/CODE&gt; in that it returns the next
3903 entry from the stream initialized by &lt;CODE&gt;setgrent&lt;/CODE&gt;. Like
3904 &lt;CODE&gt;fgetgrent_r&lt;/CODE&gt;, it places the result in user-supplied buffers
3905 pointed to &lt;VAR&gt;result_buf&lt;/VAR&gt; and &lt;VAR&gt;buffer&lt;/VAR&gt;.
3906 &lt;br&gt;&lt;br&gt; If the function returns zero &lt;VAR&gt;result&lt;/VAR&gt; contains a pointer to the data
3907 (normally equal to &lt;VAR&gt;result_buf&lt;/VAR&gt;). If errors occurred the return
3908 value is non-zero and &lt;VAR&gt;result&lt;/VAR&gt; contains a null pointer.
3909 </synopsis>
3910 </function>
3911 </construct>
3912 <construct id="function-endgrent" type="function">
3913 <function returntype="void">
3914 <prototype>
3915 <parameter content="void"/>
3916 </prototype>
3917 <headers>
3918 <header filename = "grp.h"/>
3919 </headers>
3920 <synopsis>
3921 This function closes the internal stream used by &lt;CODE&gt;getgrent&lt;/CODE&gt; or
3922 &lt;CODE&gt;getgrent_r&lt;/CODE&gt;.
3923 </synopsis>
3924 </function>
3925 </construct>
3926 <construct id="function-setnetgrent" type="function">
3927 <function returntype="int">
3928 <prototype>
3929 <parameter content="const char *netgroup"/>
3930 </prototype>
3931 <headers>
3932 <header filename = "netdb.h"/>
3933 </headers>
3934 <synopsis>
3935 A call to this function initializes the internal state of the library to
3936 allow following calls of the &lt;CODE&gt;getnetgrent&lt;/CODE&gt; to iterate over all entries
3937 in the netgroup with name &lt;VAR&gt;netgroup&lt;/VAR&gt;.
3938 &lt;br&gt;&lt;br&gt; When the call is successful (i.e., when a netgroup with this name exists)
3939 the return value is &lt;CODE&gt;1&lt;/CODE&gt;. When the return value is &lt;CODE&gt;0&lt;/CODE&gt; no
3940 netgroup of this name is known or some other error occurred.
3941 </synopsis>
3942 </function>
3943 </construct>
3944 <construct id="function-getnetgrent" type="function">
3945 <function returntype="int">
3946 <prototype>
3947 <parameter content="char **hostp"/>
3948 <parameter content="char **userp"/>
3949 <parameter content="char **domainp"/>
3950 </prototype>
3951 <headers>
3952 <header filename = "netdb.h"/>
3953 </headers>
3954 <synopsis>
3955 This function returns the next unprocessed entry of the currently
3956 selected netgroup. The string pointers, in which addresses are passed in
3957 the arguments &lt;VAR&gt;hostp&lt;/VAR&gt;, &lt;VAR&gt;userp&lt;/VAR&gt;, and &lt;VAR&gt;domainp&lt;/VAR&gt;, will contain
3958 after a successful call pointers to appropriate strings. If the string
3959 in the next entry is empty the pointer has the value &lt;CODE&gt;NULL&lt;/CODE&gt;.
3960 The returned string pointers are only valid if none of the netgroup
3961 related functions are called.
3962 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;1&lt;/CODE&gt; if the next entry was successfully read. A
3963 value of &lt;CODE&gt;0&lt;/CODE&gt; means no further entries exist or internal errors occurred.
3964 </synopsis>
3965 </function>
3966 </construct>
3967 <construct id="function-getnetgrent_r" type="function">
3968 <function returntype="int">
3969 <prototype>
3970 <parameter content="char **hostp"/>
3971 <parameter content="char **userp"/>
3972 <parameter content="char **domainp"/>
3973 <parameter content="char *buffer"/>
3974 <parameter content="int buflen"/>
3975 </prototype>
3976 <headers>
3977 <header filename = "netdb.h"/>
3978 </headers>
3979 <synopsis>
3980 This function is similar to &lt;CODE&gt;getnetgrent&lt;/CODE&gt; with only one exception:
3981 the strings the three string pointers &lt;VAR&gt;hostp&lt;/VAR&gt;, &lt;VAR&gt;userp&lt;/VAR&gt;, and
3982 &lt;VAR&gt;domainp&lt;/VAR&gt; point to, are placed in the buffer of &lt;VAR&gt;buflen&lt;/VAR&gt; bytes
3983 starting at &lt;VAR&gt;buffer&lt;/VAR&gt;. This means the returned values are valid
3984 even after other netgroup related functions are called.
3985 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;1&lt;/CODE&gt; if the next entry was successfully read and
3986 the buffer contains enough room to place the strings in it. &lt;CODE&gt;0&lt;/CODE&gt; is
3987 returned in case no more entries are found, the buffer is too small, or
3988 internal errors occurred.
3989 &lt;br&gt;&lt;br&gt; This function is a GNU extension. The original implementation in the
3990 SunOS libc does not provide this function.
3991 </synopsis>
3992 </function>
3993 </construct>
3994 <construct id="function-endnetgrent" type="function">
3995 <function returntype="void">
3996 <prototype>
3997 <parameter content="void"/>
3998 </prototype>
3999 <headers>
4000 <header filename = "netdb.h"/>
4001 </headers>
4002 <synopsis>
4003 This function frees all buffers which were allocated to process the last
4004 selected netgroup. As a result all string pointers returned by calls
4005 to &lt;CODE&gt;getnetgrent&lt;/CODE&gt; are invalid afterwards.
4006 </synopsis>
4007 </function>
4008 </construct>
4009 <construct id="function-innetgr" type="function">
4010 <function returntype="int">
4011 <prototype>
4012 <parameter content="const char *netgroup"/>
4013 <parameter content="const char *host"/>
4014 <parameter content="const char *user"/>
4015 <parameter content="const char *domain"/>
4016 </prototype>
4017 <headers>
4018 <header filename = "netdb.h"/>
4019 </headers>
4020 <synopsis>
4021 This function tests whether the triple specified by the parameters
4022 &lt;VAR&gt;hostp&lt;/VAR&gt;, &lt;VAR&gt;userp&lt;/VAR&gt;, and &lt;VAR&gt;domainp&lt;/VAR&gt; is part of the netgroup
4023 &lt;VAR&gt;netgroup&lt;/VAR&gt;. Using this function has the advantage that
4024 &lt;br&gt;&lt;br&gt; &lt;OL&gt;
4025 &lt;LI&gt;
4026 no other netgroup function can use the global netgroup state since
4027 internal locking is used and
4028 &lt;LI&gt;
4029 the function is implemented more efficiently than successive calls
4030 to the other &lt;CODE&gt;set&lt;/CODE&gt;/&lt;CODE&gt;get&lt;/CODE&gt;/&lt;CODE&gt;endnetgrent&lt;/CODE&gt; functions.
4031 &lt;/OL&gt;
4032 &lt;br&gt;&lt;br&gt; Any of the pointers &lt;VAR&gt;hostp&lt;/VAR&gt;, &lt;VAR&gt;userp&lt;/VAR&gt;, and &lt;VAR&gt;domainp&lt;/VAR&gt; can be
4033 &lt;CODE&gt;NULL&lt;/CODE&gt; which means any value is accepted in this position. This is
4034 also true for the name &lt;CODE&gt;-&lt;/CODE&gt; which should not match any other string
4035 otherwise.
4036 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;1&lt;/CODE&gt; if an entry matching the given triple is
4037 found in the netgroup. The return value is &lt;CODE&gt;0&lt;/CODE&gt; if the netgroup
4038 itself is not found, the netgroup does not contain the triple or
4039 internal errors occurred.
4040 </synopsis>
4041 </function>
4042 </construct>
4043 <construct id="struct-sockaddr" type="struct">
4044 <structure>
4045 <synopsis>
4046 The &lt;CODE&gt;struct sockaddr&lt;/CODE&gt; type itself has the following members:
4047 &lt;br&gt;&lt;br&gt;
4048 </synopsis>
4049 <elements>
4050 <element content="short int sa_family">
4051 <synopsis>
4052 This is the code for the address format of this address. It
4053 identifies the format of the data which follows.
4054 &lt;br&gt;&lt;br&gt;
4055 </synopsis>
4056 </element>
4057 </elements>
4058 </structure>
4059 </construct>
4060 <construct id="function-bind" type="function">
4061 <function returntype="int">
4062 <prototype>
4063 <parameter content="int socket"/>
4064 <parameter content="struct sockaddr *addr"/>
4065 <parameter content="socklen_t length"/>
4066 </prototype>
4067 <headers>
4068 <header filename = "sys/socket.h"/>
4069 </headers>
4070 <synopsis>
4071 The &lt;CODE&gt;bind&lt;/CODE&gt; function assigns an address to the socket
4072 &lt;VAR&gt;socket&lt;/VAR&gt;. The &lt;VAR&gt;addr&lt;/VAR&gt; and &lt;VAR&gt;length&lt;/VAR&gt; arguments specify the
4073 address; the detailed format of the address depends on the namespace.
4074 The first part of the address is always the format designator, which
4075 specifies a namespace, and says that the address is in the format of
4076 that namespace.
4077 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt; on failure. The
4078 following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
4079 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
4080
4081 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
4082 &lt;DD&gt;
4083 The &lt;VAR&gt;socket&lt;/VAR&gt; argument is not a valid file descriptor.
4084 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTSOCK
4085 The descriptor &lt;VAR&gt;socket&lt;/VAR&gt; is not a socket.
4086 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EADDRNOTAVAIL
4087 The specified address is not available on this machine.
4088 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EADDRINUSE
4089 Some other socket is already using the specified address.
4090 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
4091 The socket &lt;VAR&gt;socket&lt;/VAR&gt; already has an address.
4092 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EACCES
4093 You do not have permission to access the requested address. (In the
4094 Internet domain, only the super-user is allowed to specify a port number
4095 in the range 0 through &lt;CODE&gt;IPPORT_RESERVED&lt;/CODE&gt; minus one; see
4096 Ports.)
4097
4098 &lt;br&gt;&lt;br&gt; Additional conditions may be possible depending on the particular namespace
4099 of the socket.
4100 </synopsis>
4101 </function>
4102 </construct>
4103 <construct id="function-getsockname" type="function">
4104 <function returntype="int">
4105 <prototype>
4106 <parameter content="int socket"/>
4107 <parameter content="struct sockaddr *addr"/>
4108 <parameter content="socklen_t *length-ptr"/>
4109 </prototype>
4110 <headers>
4111 <header filename = "sys/socket.h"/>
4112 </headers>
4113 <synopsis>
4114 The &lt;CODE&gt;getsockname&lt;/CODE&gt; function returns information about the
4115 address of the socket &lt;VAR&gt;socket&lt;/VAR&gt; in the locations specified by the
4116 &lt;VAR&gt;addr&lt;/VAR&gt; and &lt;VAR&gt;length-ptr&lt;/VAR&gt; arguments. Note that the
4117 &lt;VAR&gt;length-ptr&lt;/VAR&gt; is a pointer; you should initialize it to be the
4118 allocation size of &lt;VAR&gt;addr&lt;/VAR&gt;, and on return it contains the actual
4119 size of the address data.
4120 &lt;br&gt;&lt;br&gt; The format of the address data depends on the socket namespace. The
4121 length of the information is usually fixed for a given namespace, so
4122 normally you can know exactly how much space is needed and can provide
4123 that much. The usual practice is to allocate a place for the value
4124 using the proper data type for the socket's namespace, then cast its
4125 address to &lt;CODE&gt;struct sockaddr *&lt;/CODE&gt; to pass it to &lt;CODE&gt;getsockname&lt;/CODE&gt;.
4126 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt; on error. The
4127 following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
4128 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
4129
4130 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
4131 &lt;DD&gt;
4132 The &lt;VAR&gt;socket&lt;/VAR&gt; argument is not a valid file descriptor.
4133 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTSOCK
4134 The descriptor &lt;VAR&gt;socket&lt;/VAR&gt; is not a socket.
4135 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOBUFS
4136 There are not enough internal buffers available for the operation.
4137
4138 </synopsis>
4139 </function>
4140 </construct>
4141 <construct id="function-if_nametoindex" type="function">
4142 <function returntype="unsigned int">
4143 <prototype>
4144 <parameter content="const char *ifname"/>
4145 </prototype>
4146 <headers>
4147 <header filename = "net/if.h"/>
4148 </headers>
4149 <synopsis>
4150 This function yields the interface index corresponding to a particular
4151 name. If no interface exists with the name given, it returns 0.
4152 </synopsis>
4153 </function>
4154 </construct>
4155 <construct id="function-if_indextoname" type="function">
4156 <function returntype="char *">
4157 <prototype>
4158 <parameter content="unsigned int ifindex"/>
4159 <parameter content="char *ifname"/>
4160 </prototype>
4161 <headers>
4162 <header filename = "net/if.h"/>
4163 </headers>
4164 <synopsis>
4165 This function maps an interface index to its corresponding name. The
4166 returned name is placed in the buffer pointed to by &lt;CODE&gt;ifname&lt;/CODE&gt;, which
4167 must be at least &lt;CODE&gt;IFNAMSIZ&lt;/CODE&gt; bytes in length. If the index was
4168 invalid, the function's return value is a null pointer, otherwise it is
4169 &lt;CODE&gt;ifname&lt;/CODE&gt;.
4170 </synopsis>
4171 </function>
4172 </construct>
4173 <construct id="struct-if_nameindex" type="struct">
4174 <structure>
4175 <synopsis>
4176 This data type is used to hold the information about a single
4177 interface. It has the following members:
4178 &lt;br&gt;&lt;br&gt;
4179 </synopsis>
4180 <elements>
4181 <element content="unsigned int if_index;">
4182 <synopsis>
4183 This is the interface index.
4184 &lt;br&gt;&lt;br&gt;
4185 </synopsis>
4186 </element>
4187 </elements>
4188 </structure>
4189 </construct>
4190 <construct id="function-if_nameindex" type="function">
4191 <function returntype="struct if_nameindex *">
4192 <prototype>
4193 <parameter content="void"/>
4194 </prototype>
4195 <headers>
4196 <header filename = "net/if.h"/>
4197 </headers>
4198 <synopsis>
4199 This function returns an array of &lt;CODE&gt;if_nameindex&lt;/CODE&gt; structures, one
4200 for every interface that is present. The end of the list is indicated
4201 by a structure with an interface of 0 and a null name pointer. If an
4202 error occurs, this function returns a null pointer.
4203 &lt;br&gt;&lt;br&gt; The returned structure must be freed with &lt;CODE&gt;if_freenameindex&lt;/CODE&gt; after
4204 use.
4205 </synopsis>
4206 </function>
4207 </construct>
4208 <construct id="function-if_freenameindex" type="function">
4209 <function returntype="void">
4210 <prototype>
4211 <parameter content="struct if_nameindex *ptr"/>
4212 </prototype>
4213 <headers>
4214 <header filename = "net/if.h"/>
4215 </headers>
4216 <synopsis>
4217 This function frees the structure returned by an earlier call to
4218 &lt;CODE&gt;if_nameindex&lt;/CODE&gt;.
4219 </synopsis>
4220 </function>
4221 </construct>
4222 <construct id="struct-sockaddr_un" type="struct">
4223 <structure>
4224 <synopsis>
4225 This structure is used to specify local namespace socket addresses. It has
4226 the following members:
4227 &lt;br&gt;&lt;br&gt;
4228 </synopsis>
4229 <elements>
4230 <element content="short int sun_family">
4231 <synopsis>
4232 This identifies the address family or format of the socket address.
4233 You should store the value &lt;CODE&gt;AF_LOCAL&lt;/CODE&gt; to designate the local
4234 namespace. .
4235 &lt;br&gt;&lt;br&gt;
4236 </synopsis>
4237 </element>
4238 </elements>
4239 </structure>
4240 </construct>
4241 <construct id="struct-sockaddr_in" type="struct">
4242 <structure>
4243 <synopsis>
4244 This is the data type used to represent socket addresses in the
4245 Internet namespace. It has the following members:
4246 &lt;br&gt;&lt;br&gt;
4247 </synopsis>
4248 <elements>
4249 <element content="sa_family_t sin_family">
4250 <synopsis>
4251 This identifies the address family or format of the socket address.
4252 You should store the value &lt;CODE&gt;AF_INET&lt;/CODE&gt; in this member.
4253 .
4254 &lt;br&gt;&lt;br&gt;
4255 </synopsis>
4256 </element>
4257 <element content="struct in_addr sin_addr">
4258 <synopsis>
4259 This is the Internet address of the host machine. , and Host Names, for how to get a value to store
4260 here.
4261 &lt;br&gt;&lt;br&gt;
4262 </synopsis>
4263 </element>
4264 </elements>
4265 </structure>
4266 </construct>
4267 <construct id="struct-sockaddr_in6" type="struct">
4268 <structure>
4269 <synopsis>
4270 This is the data type used to represent socket addresses in the IPv6
4271 namespace. It has the following members:
4272 &lt;br&gt;&lt;br&gt;
4273 </synopsis>
4274 <elements>
4275 <element content="sa_family_t sin6_family">
4276 <synopsis>
4277 This identifies the address family or format of the socket address.
4278 You should store the value of &lt;CODE&gt;AF_INET6&lt;/CODE&gt; in this member.
4279 .
4280 &lt;br&gt;&lt;br&gt;
4281 </synopsis>
4282 </element>
4283 <element content="struct in6_addr sin6_addr">
4284 <synopsis>
4285 This is the IPv6 address of the host machine. , and Host Names, for how to get a value to store
4286 here.
4287 &lt;br&gt;&lt;br&gt;
4288 </synopsis>
4289 </element>
4290 <element content="uint32_t sin6_flowinfo">
4291 <synopsis>
4292 This is a currently unimplemented field.
4293 &lt;br&gt;&lt;br&gt;
4294 </synopsis>
4295 </element>
4296 </elements>
4297 </structure>
4298 </construct>
4299 <construct id="struct-in_addr" type="struct">
4300 <structure>
4301 </structure>
4302 </construct>
4303 <construct id="struct-in6_addr" type="struct">
4304 <structure>
4305 </structure>
4306 </construct>
4307 <construct id="function-inet_aton" type="function">
4308 <function returntype="int">
4309 <prototype>
4310 <parameter content="const char *name"/>
4311 <parameter content="struct in_addr *addr"/>
4312 </prototype>
4313 <headers>
4314 <header filename = "sys/socket.h"/>
4315 <header filename = "netinet/in.h"/>
4316 <header filename = "arpa/inet.h"/>
4317 </headers>
4318 <synopsis>
4319 This function converts the IPv4 Internet host address &lt;VAR&gt;name&lt;/VAR&gt;
4320 from the standard numbers-and-dots notation into binary data and stores
4321 it in the &lt;CODE&gt;struct in_addr&lt;/CODE&gt; that &lt;VAR&gt;addr&lt;/VAR&gt; points to.
4322 &lt;CODE&gt;inet_aton&lt;/CODE&gt; returns nonzero if the address is valid, zero if not.
4323 </synopsis>
4324 </function>
4325 </construct>
4326 <construct id="function-inet_addr" type="function">
4327 <function returntype="uint32_t">
4328 <prototype>
4329 <parameter content="const char *name"/>
4330 </prototype>
4331 <headers>
4332 <header filename = "arpa/inet.h"/>
4333 </headers>
4334 <synopsis>
4335 This function converts the IPv4 Internet host address &lt;VAR&gt;name&lt;/VAR&gt; from the
4336 standard numbers-and-dots notation into binary data. If the input is
4337 not valid, &lt;CODE&gt;inet_addr&lt;/CODE&gt; returns &lt;CODE&gt;INADDR_NONE&lt;/CODE&gt;. This is an
4338 obsolete interface to &lt;CODE&gt;inet_aton&lt;/CODE&gt;, described immediately above. It
4339 is obsolete because &lt;CODE&gt;INADDR_NONE&lt;/CODE&gt; is a valid address
4340 (255.255.255.255), and &lt;CODE&gt;inet_aton&lt;/CODE&gt; provides a cleaner way to
4341 indicate error return.
4342 </synopsis>
4343 </function>
4344 </construct>
4345 <construct id="function-inet_network" type="function">
4346 <function returntype="uint32_t">
4347 <prototype>
4348 <parameter content="const char *name"/>
4349 </prototype>
4350 <headers>
4351 <header filename = "arpa/inet.h"/>
4352 </headers>
4353 <synopsis>
4354 This function extracts the network number from the address &lt;VAR&gt;name&lt;/VAR&gt;,
4355 given in the standard numbers-and-dots notation. The returned address is
4356 in host order. If the input is not valid, &lt;CODE&gt;inet_network&lt;/CODE&gt; returns
4357 &lt;CODE&gt;-1&lt;/CODE&gt;.
4358 &lt;br&gt;&lt;br&gt; The function works only with traditional IPv4 class A, B and C network
4359 types. It doesn't work with classless addresses and shouldn't be used
4360 anymore.
4361 </synopsis>
4362 </function>
4363 </construct>
4364 <construct id="function-inet_ntoa" type="function">
4365 <function returntype="char *">
4366 <prototype>
4367 <parameter content="struct in_addr addr"/>
4368 </prototype>
4369 <headers>
4370 <header filename = "arpa/inet.h"/>
4371 </headers>
4372 <synopsis>
4373 This function converts the IPv4 Internet host address &lt;VAR&gt;addr&lt;/VAR&gt; to a
4374 string in the standard numbers-and-dots notation. The return value is
4375 a pointer into a statically-allocated buffer. Subsequent calls will
4376 overwrite the same buffer, so you should copy the string if you need
4377 to save it.
4378 &lt;br&gt;&lt;br&gt; In multi-threaded programs each thread has an own statically-allocated
4379 buffer. But still subsequent calls of &lt;CODE&gt;inet_ntoa&lt;/CODE&gt; in the same
4380 thread will overwrite the result of the last call.
4381 &lt;br&gt;&lt;br&gt; Instead of &lt;CODE&gt;inet_ntoa&lt;/CODE&gt; the newer function &lt;CODE&gt;inet_ntop&lt;/CODE&gt; which is
4382 described below should be used since it handles both IPv4 and IPv6
4383 addresses.
4384 </synopsis>
4385 </function>
4386 </construct>
4387 <construct id="function-inet_makeaddr" type="function">
4388 <function returntype="struct in_addr">
4389 <prototype>
4390 <parameter content="uint32_t net"/>
4391 <parameter content="uint32_t local"/>
4392 </prototype>
4393 <headers>
4394 <header filename = "arpa/inet.h"/>
4395 </headers>
4396 <synopsis>
4397 This function makes an IPv4 Internet host address by combining the network
4398 number &lt;VAR&gt;net&lt;/VAR&gt; with the local-address-within-network number
4399 &lt;VAR&gt;local&lt;/VAR&gt;.
4400 </synopsis>
4401 </function>
4402 </construct>
4403 <construct id="function-inet_lnaof" type="function">
4404 <function returntype="uint32_t">
4405 <prototype>
4406 <parameter content="struct in_addr addr"/>
4407 </prototype>
4408 <headers>
4409 <header filename = "arpa/inet.h"/>
4410 </headers>
4411 <synopsis>
4412 This function returns the local-address-within-network part of the
4413 Internet host address &lt;VAR&gt;addr&lt;/VAR&gt;.
4414 &lt;br&gt;&lt;br&gt; The function works only with traditional IPv4 class A, B and C network
4415 types. It doesn't work with classless addresses and shouldn't be used
4416 anymore.
4417 </synopsis>
4418 </function>
4419 </construct>
4420 <construct id="function-inet_netof" type="function">
4421 <function returntype="uint32_t">
4422 <prototype>
4423 <parameter content="struct in_addr addr"/>
4424 </prototype>
4425 <headers>
4426 <header filename = "arpa/inet.h"/>
4427 </headers>
4428 <synopsis>
4429 This function returns the network number part of the Internet host
4430 address &lt;VAR&gt;addr&lt;/VAR&gt;.
4431 &lt;br&gt;&lt;br&gt; The function works only with traditional IPv4 class A, B and C network
4432 types. It doesn't work with classless addresses and shouldn't be used
4433 anymore.
4434 </synopsis>
4435 </function>
4436 </construct>
4437 <construct id="function-inet_pton" type="function">
4438 <function returntype="int">
4439 <prototype>
4440 <parameter content="int af"/>
4441 <parameter content="const char *cp"/>
4442 <parameter content="void *buf"/>
4443 </prototype>
4444 <headers>
4445 <header filename = "arpa/inet.h"/>
4446 </headers>
4447 <synopsis>
4448 This function converts an Internet address (either IPv4 or IPv6) from
4449 presentation (textual) to network (binary) format. &lt;VAR&gt;af&lt;/VAR&gt; should be
4450 either &lt;CODE&gt;AF_INET&lt;/CODE&gt; or &lt;CODE&gt;AF_INET6&lt;/CODE&gt;, as appropriate for the type of
4451 address being converted. &lt;VAR&gt;cp&lt;/VAR&gt; is a pointer to the input string, and
4452 &lt;VAR&gt;buf&lt;/VAR&gt; is a pointer to a buffer for the result. It is the caller's
4453 responsibility to make sure the buffer is large enough.
4454 </synopsis>
4455 </function>
4456 </construct>
4457 <construct id="function-inet_ntop" type="function">
4458 <function returntype="const char *">
4459 <prototype>
4460 <parameter content="int af"/>
4461 <parameter content="const void *cp"/>
4462 <parameter content="char *buf"/>
4463 <parameter content="size_t len"/>
4464 </prototype>
4465 <headers>
4466 <header filename = "arpa/inet.h"/>
4467 </headers>
4468 <synopsis>
4469 This function converts an Internet address (either IPv4 or IPv6) from
4470 network (binary) to presentation (textual) form. &lt;VAR&gt;af&lt;/VAR&gt; should be
4471 either &lt;CODE&gt;AF_INET&lt;/CODE&gt; or &lt;CODE&gt;AF_INET6&lt;/CODE&gt;, as appropriate. &lt;VAR&gt;cp&lt;/VAR&gt; is a
4472 pointer to the address to be converted. &lt;VAR&gt;buf&lt;/VAR&gt; should be a pointer
4473 to a buffer to hold the result, and &lt;VAR&gt;len&lt;/VAR&gt; is the length of this
4474 buffer. The return value from the function will be this buffer address.
4475 </synopsis>
4476 </function>
4477 </construct>
4478 <construct id="struct-hostent" type="struct">
4479 <structure>
4480 <synopsis>
4481 This data type is used to represent an entry in the hosts database. It
4482 has the following members:
4483 &lt;br&gt;&lt;br&gt;
4484 </synopsis>
4485 <elements>
4486 <element content="char *h_name">
4487 <synopsis>
4488 This is the ``official'' name of the host.
4489 &lt;br&gt;&lt;br&gt;
4490 </synopsis>
4491 </element>
4492 <element content="char **h_aliases">
4493 <synopsis>
4494 These are alternative names for the host, represented as a null-terminated
4495 vector of strings.
4496 &lt;br&gt;&lt;br&gt;
4497 </synopsis>
4498 </element>
4499 <element content="int h_addrtype">
4500 <synopsis>
4501 This is the host address type; in practice, its value is always either
4502 &lt;CODE&gt;AF_INET&lt;/CODE&gt; or &lt;CODE&gt;AF_INET6&lt;/CODE&gt;, with the latter being used for IPv6
4503 hosts. In principle other kinds of addresses could be represented in
4504 the database as well as Internet addresses; if this were done, you
4505 might find a value in this field other than &lt;CODE&gt;AF_INET&lt;/CODE&gt; or
4506 &lt;CODE&gt;AF_INET6&lt;/CODE&gt;. .
4507 &lt;br&gt;&lt;br&gt;
4508 </synopsis>
4509 </element>
4510 <element content="int h_length">
4511 <synopsis>
4512 This is the length, in bytes, of each address.
4513 &lt;br&gt;&lt;br&gt;
4514 </synopsis>
4515 </element>
4516 <element content="char **h_addr_list">
4517 <synopsis>
4518 This is the vector of addresses for the host. (Recall that the host
4519 might be connected to multiple networks and have different addresses on
4520 each one.) The vector is terminated by a null pointer.
4521 &lt;br&gt;&lt;br&gt;
4522 </synopsis>
4523 </element>
4524 </elements>
4525 </structure>
4526 </construct>
4527 <construct id="function-gethostbyname" type="function">
4528 <function returntype="struct hostent *">
4529 <prototype>
4530 <parameter content="const char *name"/>
4531 </prototype>
4532 <headers>
4533 <header filename = "netdb.h"/>
4534 </headers>
4535 <synopsis>
4536 The &lt;CODE&gt;gethostbyname&lt;/CODE&gt; function returns information about the host
4537 named &lt;VAR&gt;name&lt;/VAR&gt;. If the lookup fails, it returns a null pointer.
4538 </synopsis>
4539 </function>
4540 </construct>
4541 <construct id="function-gethostbyname2" type="function">
4542 <function returntype="struct hostent *">
4543 <prototype>
4544 <parameter content="const char *name"/>
4545 <parameter content="int af"/>
4546 </prototype>
4547 <headers>
4548 <header filename = "netdb.h"/>
4549 </headers>
4550 <synopsis>
4551 The &lt;CODE&gt;gethostbyname2&lt;/CODE&gt; function is like &lt;CODE&gt;gethostbyname&lt;/CODE&gt;, but
4552 allows the caller to specify the desired address family (e.g.:
4553 &lt;CODE&gt;AF_INET&lt;/CODE&gt; or &lt;CODE&gt;AF_INET6&lt;/CODE&gt;) of the result.
4554 </synopsis>
4555 </function>
4556 </construct>
4557 <construct id="function-gethostbyaddr" type="function">
4558 <function returntype="struct hostent *">
4559 <prototype>
4560 <parameter content="const char *addr"/>
4561 <parameter content="size_t length"/>
4562 <parameter content="int format"/>
4563 </prototype>
4564 <headers>
4565 <header filename = "netdb.h"/>
4566 </headers>
4567 <synopsis>
4568 The &lt;CODE&gt;gethostbyaddr&lt;/CODE&gt; function returns information about the host
4569 with Internet address &lt;VAR&gt;addr&lt;/VAR&gt;. The parameter &lt;VAR&gt;addr&lt;/VAR&gt; is not
4570 really a pointer to char - it can be a pointer to an IPv4 or an IPv6
4571 address. The &lt;VAR&gt;length&lt;/VAR&gt; argument is the size (in bytes) of the address
4572 at &lt;VAR&gt;addr&lt;/VAR&gt;. &lt;VAR&gt;format&lt;/VAR&gt; specifies the address format; for an IPv4
4573 Internet address, specify a value of &lt;CODE&gt;AF_INET&lt;/CODE&gt;; for an IPv6
4574 Internet address, use &lt;CODE&gt;AF_INET6&lt;/CODE&gt;.
4575 &lt;br&gt;&lt;br&gt; If the lookup fails, &lt;CODE&gt;gethostbyaddr&lt;/CODE&gt; returns a null pointer.
4576 </synopsis>
4577 </function>
4578 </construct>
4579 <construct id="function-gethostbyname_r" type="function">
4580 <function returntype="int">
4581 <prototype>
4582 <parameter content="const char *restrict name"/>
4583 <parameter content="struct hostent *restrict result_buf"/>
4584 <parameter content="char *restrict buf"/>
4585 <parameter content="size_t buflen"/>
4586 <parameter content="struct hostent **restrict result"/>
4587 <parameter content="int *restrict h_errnop"/>
4588 </prototype>
4589 <headers>
4590 <header filename = "netdb.h"/>
4591 </headers>
4592 <synopsis>
4593 The &lt;CODE&gt;gethostbyname_r&lt;/CODE&gt; function returns information about the host
4594 named &lt;VAR&gt;name&lt;/VAR&gt;. The caller must pass a pointer to an object of type
4595 &lt;CODE&gt;struct hostent&lt;/CODE&gt; in the &lt;VAR&gt;result_buf&lt;/VAR&gt; parameter. In addition
4596 the function may need extra buffer space and the caller must pass an
4597 pointer and the size of the buffer in the &lt;VAR&gt;buf&lt;/VAR&gt; and &lt;VAR&gt;buflen&lt;/VAR&gt;
4598 parameters.
4599 &lt;br&gt;&lt;br&gt; A pointer to the buffer, in which the result is stored, is available in
4600 &lt;CODE&gt;*&lt;VAR&gt;result&lt;/VAR&gt;&lt;/CODE&gt; after the function call successfully returned. If
4601 an error occurs or if no entry is found, the pointer &lt;CODE&gt;*&lt;VAR&gt;result&lt;/VAR&gt;&lt;/CODE&gt;
4602 is a null pointer. Success is signalled by a zero return value. If the
4603 function failed the return value is an error number. In addition to the
4604 errors defined for &lt;CODE&gt;gethostbyname&lt;/CODE&gt; it can also be &lt;CODE&gt;ERANGE&lt;/CODE&gt;.
4605 In this case the call should be repeated with a larger buffer.
4606 Additional error information is not stored in the global variable
4607 &lt;CODE&gt;h_errno&lt;/CODE&gt; but instead in the object pointed to by &lt;VAR&gt;h_errnop&lt;/VAR&gt;.
4608 &lt;br&gt;&lt;br&gt; Here's a small example:
4609 &lt;pre&gt;&lt;br&gt;
4610 struct hostent *&lt;br&gt;
4611 gethostname (char *host)&lt;br&gt;
4612 {&lt;br&gt;
4613 struct hostent hostbuf, *hp;&lt;br&gt;
4614 size_t hstbuflen;&lt;br&gt;
4615 char *tmphstbuf;&lt;br&gt;
4616 int res;&lt;br&gt;
4617 int herr;&lt;br&gt;
4618 &lt;br&gt;&lt;br&gt; hstbuflen = 1024;&lt;br&gt;
4619 /* Allocate buffer, remember to free it to avoid memory leakage. */&lt;br&gt;
4620 tmphstbuf = malloc (hstbuflen);&lt;br&gt;
4621 &lt;br&gt;&lt;br&gt; while ((res = gethostbyname_r (host, &amp;hostbuf, tmphstbuf, hstbuflen,&lt;br&gt;
4622 &amp;hp, &amp;herr)) == ERANGE)&lt;br&gt;
4623 {&lt;br&gt;
4624 /* Enlarge the buffer. */&lt;br&gt;
4625 hstbuflen *= 2;&lt;br&gt;
4626 tmphstbuf = realloc (tmphstbuf, hstbuflen);&lt;br&gt;
4627 }&lt;br&gt;
4628 /* Check for errors. */&lt;br&gt;
4629 if (res || hp == NULL)&lt;br&gt;
4630 return NULL;&lt;br&gt;
4631 return hp;&lt;br&gt;
4632 }&lt;br&gt;
4633 &lt;/pre&gt;
4634 </synopsis>
4635 </function>
4636 </construct>
4637 <construct id="function-gethostbyname2_r" type="function">
4638 <function returntype="int">
4639 <prototype>
4640 <parameter content="const char *name"/>
4641 <parameter content="int af"/>
4642 <parameter content="struct hostent *restrict result_buf"/>
4643 <parameter content="char *restrict buf"/>
4644 <parameter content="size_t buflen"/>
4645 <parameter content="struct hostent **restrict result"/>
4646 <parameter content="int *restrict h_errnop"/>
4647 </prototype>
4648 <headers>
4649 <header filename = "netdb.h"/>
4650 </headers>
4651 <synopsis>
4652 The &lt;CODE&gt;gethostbyname2_r&lt;/CODE&gt; function is like &lt;CODE&gt;gethostbyname_r&lt;/CODE&gt;, but
4653 allows the caller to specify the desired address family (e.g.:
4654 &lt;CODE&gt;AF_INET&lt;/CODE&gt; or &lt;CODE&gt;AF_INET6&lt;/CODE&gt;) for the result.
4655 </synopsis>
4656 </function>
4657 </construct>
4658 <construct id="function-gethostbyaddr_r" type="function">
4659 <function returntype="int">
4660 <prototype>
4661 <parameter content="const char *addr"/>
4662 <parameter content="size_t length"/>
4663 <parameter content="int format"/>
4664 <parameter content="struct hostent *restrict result_buf"/>
4665 <parameter content="char *restrict buf"/>
4666 <parameter content="size_t buflen"/>
4667 <parameter content="struct hostent **restrict result"/>
4668 <parameter content="int *restrict h_errnop"/>
4669 </prototype>
4670 <headers>
4671 <header filename = "netdb.h"/>
4672 </headers>
4673 <synopsis>
4674 The &lt;CODE&gt;gethostbyaddr_r&lt;/CODE&gt; function returns information about the host
4675 with Internet address &lt;VAR&gt;addr&lt;/VAR&gt;. The parameter &lt;VAR&gt;addr&lt;/VAR&gt; is not
4676 really a pointer to char - it can be a pointer to an IPv4 or an IPv6
4677 address. The &lt;VAR&gt;length&lt;/VAR&gt; argument is the size (in bytes) of the address
4678 at &lt;VAR&gt;addr&lt;/VAR&gt;. &lt;VAR&gt;format&lt;/VAR&gt; specifies the address format; for an IPv4
4679 Internet address, specify a value of &lt;CODE&gt;AF_INET&lt;/CODE&gt;; for an IPv6
4680 Internet address, use &lt;CODE&gt;AF_INET6&lt;/CODE&gt;.
4681 &lt;br&gt;&lt;br&gt; Similar to the &lt;CODE&gt;gethostbyname_r&lt;/CODE&gt; function, the caller must provide
4682 buffers for the result and memory used internally. In case of success
4683 the function returns zero. Otherwise the value is an error number where
4684 &lt;CODE&gt;ERANGE&lt;/CODE&gt; has the special meaning that the caller-provided buffer is
4685 too small.
4686 </synopsis>
4687 </function>
4688 </construct>
4689 <construct id="function-sethostent" type="function">
4690 <function returntype="void">
4691 <prototype>
4692 <parameter content="int stayopen"/>
4693 </prototype>
4694 <headers>
4695 <header filename = "netdb.h"/>
4696 </headers>
4697 <synopsis>
4698 This function opens the hosts database to begin scanning it. You can
4699 then call &lt;CODE&gt;gethostent&lt;/CODE&gt; to read the entries.
4700 &lt;br&gt;&lt;br&gt; If the &lt;VAR&gt;stayopen&lt;/VAR&gt; argument is nonzero, this sets a flag so that
4701 subsequent calls to &lt;CODE&gt;gethostbyname&lt;/CODE&gt; or &lt;CODE&gt;gethostbyaddr&lt;/CODE&gt; will
4702 not close the database (as they usually would). This makes for more
4703 efficiency if you call those functions several times, by avoiding
4704 reopening the database for each call.
4705 </synopsis>
4706 </function>
4707 </construct>
4708 <construct id="function-gethostent" type="function">
4709 <function returntype="struct hostent *">
4710 <prototype>
4711 <parameter content="void"/>
4712 </prototype>
4713 <headers>
4714 <header filename = "netdb.h"/>
4715 </headers>
4716 <synopsis>
4717 This function returns the next entry in the hosts database. It
4718 returns a null pointer if there are no more entries.
4719 </synopsis>
4720 </function>
4721 </construct>
4722 <construct id="function-endhostent" type="function">
4723 <function returntype="void">
4724 <prototype>
4725 <parameter content="void"/>
4726 </prototype>
4727 <headers>
4728 <header filename = "netdb.h"/>
4729 </headers>
4730 <synopsis>
4731 This function closes the hosts database.
4732 </synopsis>
4733 </function>
4734 </construct>
4735 <construct id="struct-servent" type="struct">
4736 <structure>
4737 <synopsis>
4738 This data type holds information about entries from the services database.
4739 It has the following members:
4740 &lt;br&gt;&lt;br&gt;
4741 </synopsis>
4742 <elements>
4743 <element content="char *s_name">
4744 <synopsis>
4745 This is the ``official'' name of the service.
4746 &lt;br&gt;&lt;br&gt;
4747 </synopsis>
4748 </element>
4749 <element content="char **s_aliases">
4750 <synopsis>
4751 These are alternate names for the service, represented as an array of
4752 strings. A null pointer terminates the array.
4753 &lt;br&gt;&lt;br&gt;
4754 </synopsis>
4755 </element>
4756 <element content="int s_port">
4757 <synopsis>
4758 This is the port number for the service. Port numbers are given in
4759 network byte order; see Byte Order.
4760 &lt;br&gt;&lt;br&gt;
4761 </synopsis>
4762 </element>
4763 </elements>
4764 </structure>
4765 </construct>
4766 <construct id="function-getservbyname" type="function">
4767 <function returntype="struct servent *">
4768 <prototype>
4769 <parameter content="const char *name"/>
4770 <parameter content="const char *proto"/>
4771 </prototype>
4772 <headers>
4773 <header filename = "netinet/in.h"/>
4774 <header filename = "netdb.h"/>
4775 </headers>
4776 <synopsis>
4777 The &lt;CODE&gt;getservbyname&lt;/CODE&gt; function returns information about the
4778 service named &lt;VAR&gt;name&lt;/VAR&gt; using protocol &lt;VAR&gt;proto&lt;/VAR&gt;. If it can't find
4779 such a service, it returns a null pointer.
4780 &lt;br&gt;&lt;br&gt; This function is useful for servers as well as for clients; servers
4781 use it to determine which port they should listen on .
4782 </synopsis>
4783 </function>
4784 </construct>
4785 <construct id="function-getservbyport" type="function">
4786 <function returntype="struct servent *">
4787 <prototype>
4788 <parameter content="int port"/>
4789 <parameter content="const char *proto"/>
4790 </prototype>
4791 <headers>
4792 <header filename = "netdb.h"/>
4793 </headers>
4794 <synopsis>
4795 The &lt;CODE&gt;getservbyport&lt;/CODE&gt; function returns information about the
4796 service at port &lt;VAR&gt;port&lt;/VAR&gt; using protocol &lt;VAR&gt;proto&lt;/VAR&gt;. If it can't
4797 find such a service, it returns a null pointer.
4798 </synopsis>
4799 </function>
4800 </construct>
4801 <construct id="function-setservent" type="function">
4802 <function returntype="void">
4803 <prototype>
4804 <parameter content="int stayopen"/>
4805 </prototype>
4806 <headers>
4807 <header filename = "netdb.h"/>
4808 </headers>
4809 <synopsis>
4810 This function opens the services database to begin scanning it.
4811 &lt;br&gt;&lt;br&gt; If the &lt;VAR&gt;stayopen&lt;/VAR&gt; argument is nonzero, this sets a flag so that
4812 subsequent calls to &lt;CODE&gt;getservbyname&lt;/CODE&gt; or &lt;CODE&gt;getservbyport&lt;/CODE&gt; will
4813 not close the database (as they usually would). This makes for more
4814 efficiency if you call those functions several times, by avoiding
4815 reopening the database for each call.
4816 </synopsis>
4817 </function>
4818 </construct>
4819 <construct id="function-getservent" type="function">
4820 <function returntype="struct servent *">
4821 <prototype>
4822 <parameter content="void"/>
4823 </prototype>
4824 <headers>
4825 <header filename = "netdb.h"/>
4826 </headers>
4827 <synopsis>
4828 This function returns the next entry in the services database. If
4829 there are no more entries, it returns a null pointer.
4830 </synopsis>
4831 </function>
4832 </construct>
4833 <construct id="function-endservent" type="function">
4834 <function returntype="void">
4835 <prototype>
4836 <parameter content="void"/>
4837 </prototype>
4838 <headers>
4839 <header filename = "netdb.h"/>
4840 </headers>
4841 <synopsis>
4842 This function closes the services database.
4843 </synopsis>
4844 </function>
4845 </construct>
4846 <construct id="function-htons" type="function">
4847 <function returntype="uint16_t">
4848 <prototype>
4849 <parameter content="uint16_t hostshort"/>
4850 </prototype>
4851 <headers>
4852 <header filename = "netinet/in.h"/>
4853 </headers>
4854 <synopsis>
4855 This function converts the &lt;CODE&gt;uint16_t&lt;/CODE&gt; integer &lt;VAR&gt;hostshort&lt;/VAR&gt; from
4856 host byte order to network byte order.
4857 </synopsis>
4858 </function>
4859 </construct>
4860 <construct id="function-ntohs" type="function">
4861 <function returntype="uint16_t">
4862 <prototype>
4863 <parameter content="uint16_t netshort"/>
4864 </prototype>
4865 <headers>
4866 <header filename = "netinet/in.h"/>
4867 </headers>
4868 <synopsis>
4869 This function converts the &lt;CODE&gt;uint16_t&lt;/CODE&gt; integer &lt;VAR&gt;netshort&lt;/VAR&gt; from
4870 network byte order to host byte order.
4871 </synopsis>
4872 </function>
4873 </construct>
4874 <construct id="function-htonl" type="function">
4875 <function returntype="uint32_t">
4876 <prototype>
4877 <parameter content="uint32_t hostlong"/>
4878 </prototype>
4879 <headers>
4880 <header filename = "netinet/in.h"/>
4881 </headers>
4882 <synopsis>
4883 This function converts the &lt;CODE&gt;uint32_t&lt;/CODE&gt; integer &lt;VAR&gt;hostlong&lt;/VAR&gt; from
4884 host byte order to network byte order.
4885 &lt;br&gt;&lt;br&gt; This is used for IPv4 Internet addresses.
4886 </synopsis>
4887 </function>
4888 </construct>
4889 <construct id="function-ntohl" type="function">
4890 <function returntype="uint32_t">
4891 <prototype>
4892 <parameter content="uint32_t netlong"/>
4893 </prototype>
4894 <headers>
4895 <header filename = "netinet/in.h"/>
4896 </headers>
4897 <synopsis>
4898 This function converts the &lt;CODE&gt;uint32_t&lt;/CODE&gt; integer &lt;VAR&gt;netlong&lt;/VAR&gt; from
4899 network byte order to host byte order.
4900 &lt;br&gt;&lt;br&gt; This is used for IPv4 Internet addresses.
4901 </synopsis>
4902 </function>
4903 </construct>
4904 <construct id="struct-protoent" type="struct">
4905 <structure>
4906 <synopsis>
4907 This data type is used to represent entries in the network protocols
4908 database. It has the following members:
4909 &lt;br&gt;&lt;br&gt;
4910 </synopsis>
4911 <elements>
4912 <element content="char *p_name">
4913 <synopsis>
4914 This is the official name of the protocol.
4915 &lt;br&gt;&lt;br&gt;
4916 </synopsis>
4917 </element>
4918 <element content="char **p_aliases">
4919 <synopsis>
4920 These are alternate names for the protocol, specified as an array of
4921 strings. The last element of the array is a null pointer.
4922 &lt;br&gt;&lt;br&gt;
4923 </synopsis>
4924 </element>
4925 </elements>
4926 </structure>
4927 </construct>
4928 <construct id="function-getprotobyname" type="function">
4929 <function returntype="struct protoent *">
4930 <prototype>
4931 <parameter content="const char *name"/>
4932 </prototype>
4933 <headers>
4934 <header filename = "netdb.h"/>
4935 </headers>
4936 <synopsis>
4937 The &lt;CODE&gt;getprotobyname&lt;/CODE&gt; function returns information about the
4938 network protocol named &lt;VAR&gt;name&lt;/VAR&gt;. If there is no such protocol, it
4939 returns a null pointer.
4940 </synopsis>
4941 </function>
4942 </construct>
4943 <construct id="function-getprotobynumber" type="function">
4944 <function returntype="struct protoent *">
4945 <prototype>
4946 <parameter content="int protocol"/>
4947 </prototype>
4948 <headers>
4949 <header filename = "netdb.h"/>
4950 </headers>
4951 <synopsis>
4952 The &lt;CODE&gt;getprotobynumber&lt;/CODE&gt; function returns information about the
4953 network protocol with number &lt;VAR&gt;protocol&lt;/VAR&gt;. If there is no such
4954 protocol, it returns a null pointer.
4955 </synopsis>
4956 </function>
4957 </construct>
4958 <construct id="function-setprotoent" type="function">
4959 <function returntype="void">
4960 <prototype>
4961 <parameter content="int stayopen"/>
4962 </prototype>
4963 <headers>
4964 <header filename = "netdb.h"/>
4965 </headers>
4966 <synopsis>
4967 This function opens the protocols database to begin scanning it.
4968 &lt;br&gt;&lt;br&gt; If the &lt;VAR&gt;stayopen&lt;/VAR&gt; argument is nonzero, this sets a flag so that
4969 subsequent calls to &lt;CODE&gt;getprotobyname&lt;/CODE&gt; or &lt;CODE&gt;getprotobynumber&lt;/CODE&gt; will
4970 not close the database (as they usually would). This makes for more
4971 efficiency if you call those functions several times, by avoiding
4972 reopening the database for each call.
4973 </synopsis>
4974 </function>
4975 </construct>
4976 <construct id="function-getprotoent" type="function">
4977 <function returntype="struct protoent *">
4978 <prototype>
4979 <parameter content="void"/>
4980 </prototype>
4981 <headers>
4982 <header filename = "netdb.h"/>
4983 </headers>
4984 <synopsis>
4985 This function returns the next entry in the protocols database. It
4986 returns a null pointer if there are no more entries.
4987 </synopsis>
4988 </function>
4989 </construct>
4990 <construct id="function-endprotoent" type="function">
4991 <function returntype="void">
4992 <prototype>
4993 <parameter content="void"/>
4994 </prototype>
4995 <headers>
4996 <header filename = "netdb.h"/>
4997 </headers>
4998 <synopsis>
4999 This function closes the protocols database.
5000 </synopsis>
5001 </function>
5002 </construct>
5003 <construct id="function-socket" type="function">
5004 <function returntype="int">
5005 <prototype>
5006 <parameter content="int namespace"/>
5007 <parameter content="int style"/>
5008 <parameter content="int protocol"/>
5009 </prototype>
5010 <headers>
5011 <header filename = "sys/socket.h"/>
5012 </headers>
5013 <synopsis>
5014 This function creates a socket and specifies communication style
5015 &lt;VAR&gt;style&lt;/VAR&gt;, which should be one of the socket styles listed in
5016 Communication Styles. The &lt;VAR&gt;namespace&lt;/VAR&gt; argument specifies
5017 the namespace; it must be &lt;CODE&gt;PF_LOCAL&lt;/CODE&gt; or
5018 &lt;CODE&gt;PF_INET&lt;/CODE&gt; . &lt;VAR&gt;protocol&lt;/VAR&gt;
5019 designates the specific protocol ; zero is
5020 usually right for &lt;VAR&gt;protocol&lt;/VAR&gt;.
5021 &lt;br&gt;&lt;br&gt; The return value from &lt;CODE&gt;socket&lt;/CODE&gt; is the file descriptor for the new
5022 socket, or &lt;CODE&gt;-1&lt;/CODE&gt; in case of error. The following &lt;CODE&gt;errno&lt;/CODE&gt; error
5023 conditions are defined for this function:
5024 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
5025
5026 &lt;DT&gt;&lt;CODE&gt;EPROTONOSUPPORT&lt;/CODE&gt;
5027 &lt;DD&gt;
5028 The &lt;VAR&gt;protocol&lt;/VAR&gt; or &lt;VAR&gt;style&lt;/VAR&gt; is not supported by the
5029 &lt;VAR&gt;namespace&lt;/VAR&gt; specified.
5030 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EMFILE
5031 The process already has too many file descriptors open.
5032 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENFILE
5033 The system already has too many file descriptors open.
5034 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EACCES
5035 The process does not have the privilege to create a socket of the specified
5036 &lt;VAR&gt;style&lt;/VAR&gt; or &lt;VAR&gt;protocol&lt;/VAR&gt;.
5037 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOBUFS
5038 The system ran out of internal buffer space.
5039
5040 &lt;br&gt;&lt;br&gt; The file descriptor returned by the &lt;CODE&gt;socket&lt;/CODE&gt; function supports both
5041 read and write operations. However, like pipes, sockets do not support file
5042 positioning operations.
5043 </synopsis>
5044 </function>
5045 </construct>
5046 <construct id="function-shutdown" type="function">
5047 <function returntype="int">
5048 <prototype>
5049 <parameter content="int socket"/>
5050 <parameter content="int how"/>
5051 </prototype>
5052 <headers>
5053 <header filename = "sys/socket.h"/>
5054 </headers>
5055 <synopsis>
5056 The &lt;CODE&gt;shutdown&lt;/CODE&gt; function shuts down the connection of socket
5057 &lt;VAR&gt;socket&lt;/VAR&gt;. The argument &lt;VAR&gt;how&lt;/VAR&gt; specifies what action to
5058 perform:
5059 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
5060
5061 &lt;DT&gt;&lt;CODE&gt;0&lt;/CODE&gt;
5062 &lt;DD&gt;
5063 Stop receiving data for this socket. If further data arrives,
5064 reject it.
5065 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;1&lt;/CODE&gt;
5066 &lt;DD&gt;
5067 Stop trying to transmit data from this socket. Discard any data
5068 waiting to be sent. Stop looking for acknowledgement of data already
5069 sent; don't retransmit it if it is lost.
5070 &lt;br&gt;&lt;br&gt; &lt;LI&gt; 2
5071 Stop both reception and transmission.
5072
5073 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt; on failure. The
5074 following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
5075 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
5076
5077 &lt;LI&gt; EBADF
5078 &lt;VAR&gt;socket&lt;/VAR&gt; is not a valid file descriptor.
5079 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTSOCK
5080 &lt;VAR&gt;socket&lt;/VAR&gt; is not a socket.
5081 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTCONN
5082 &lt;VAR&gt;socket&lt;/VAR&gt; is not connected.
5083
5084 </synopsis>
5085 </function>
5086 </construct>
5087 <construct id="function-socketpair" type="function">
5088 <function returntype="int">
5089 <prototype>
5090 <parameter content="int namespace"/>
5091 <parameter content="int style"/>
5092 <parameter content="int protocol"/>
5093 <parameter content="int filedes[2]"/>
5094 </prototype>
5095 <headers>
5096 <header filename = "sys/socket.h"/>
5097 </headers>
5098 <synopsis>
5099 This function creates a socket pair, returning the file descriptors in
5100 &lt;CODE&gt;&lt;VAR&gt;filedes&lt;/VAR&gt;[0]&lt;/CODE&gt; and &lt;CODE&gt;&lt;VAR&gt;filedes&lt;/VAR&gt;[1]&lt;/CODE&gt;. The socket pair
5101 is a full-duplex communications channel, so that both reading and writing
5102 may be performed at either end.
5103 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;namespace&lt;/VAR&gt;, &lt;VAR&gt;style&lt;/VAR&gt; and &lt;VAR&gt;protocol&lt;/VAR&gt; arguments are
5104 interpreted as for the &lt;CODE&gt;socket&lt;/CODE&gt; function. &lt;VAR&gt;style&lt;/VAR&gt; should be
5105 one of the communication styles listed in Communication Styles.
5106 The &lt;VAR&gt;namespace&lt;/VAR&gt; argument specifies the namespace, which must be
5107 &lt;CODE&gt;AF_LOCAL&lt;/CODE&gt; ; &lt;VAR&gt;protocol&lt;/VAR&gt; specifies the
5108 communications protocol, but zero is the only meaningful value.
5109 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;style&lt;/VAR&gt; specifies a connectionless communication style, then
5110 the two sockets you get are not &lt;EM&gt;connected&lt;/EM&gt;, strictly speaking,
5111 but each of them knows the other as the default destination address,
5112 so they can send packets to each other.
5113 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;socketpair&lt;/CODE&gt; function returns &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt;
5114 on failure. The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined
5115 for this function:
5116 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
5117
5118 &lt;DT&gt;&lt;CODE&gt;EMFILE&lt;/CODE&gt;
5119 &lt;DD&gt;
5120 The process has too many file descriptors open.
5121 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EAFNOSUPPORT
5122 The specified namespace is not supported.
5123 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EPROTONOSUPPORT
5124 The specified protocol is not supported.
5125 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EOPNOTSUPP
5126 The specified protocol does not support the creation of socket pairs.
5127
5128 </synopsis>
5129 </function>
5130 </construct>
5131 <construct id="function-connect" type="function">
5132 <function returntype="int">
5133 <prototype>
5134 <parameter content="int socket"/>
5135 <parameter content="struct sockaddr *addr"/>
5136 <parameter content="socklen_t length"/>
5137 </prototype>
5138 <headers>
5139 <header filename = "sys/socket.h"/>
5140 </headers>
5141 <synopsis>
5142 The &lt;CODE&gt;connect&lt;/CODE&gt; function initiates a connection from the socket
5143 with file descriptor &lt;VAR&gt;socket&lt;/VAR&gt; to the socket whose address is
5144 specified by the &lt;VAR&gt;addr&lt;/VAR&gt; and &lt;VAR&gt;length&lt;/VAR&gt; arguments. (This socket
5145 is typically on another machine, and it must be already set up as a
5146 server.) , for information about how these
5147 arguments are interpreted.
5148 &lt;br&gt;&lt;br&gt; Normally, &lt;CODE&gt;connect&lt;/CODE&gt; waits until the server responds to the request
5149 before it returns. You can set nonblocking mode on the socket
5150 &lt;VAR&gt;socket&lt;/VAR&gt; to make &lt;CODE&gt;connect&lt;/CODE&gt; return immediately without waiting
5151 for the response. , for information about
5152 nonblocking mode.
5153 &lt;br&gt;&lt;br&gt; The normal return value from &lt;CODE&gt;connect&lt;/CODE&gt; is &lt;CODE&gt;0&lt;/CODE&gt;. If an error
5154 occurs, &lt;CODE&gt;connect&lt;/CODE&gt; returns &lt;CODE&gt;-1&lt;/CODE&gt;. The following &lt;CODE&gt;errno&lt;/CODE&gt;
5155 error conditions are defined for this function:
5156 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
5157
5158 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
5159 &lt;DD&gt;
5160 The socket &lt;VAR&gt;socket&lt;/VAR&gt; is not a valid file descriptor.
5161 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTSOCK
5162 File descriptor &lt;VAR&gt;socket&lt;/VAR&gt; is not a socket.
5163 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EADDRNOTAVAIL
5164 The specified address is not available on the remote machine.
5165 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EAFNOSUPPORT
5166 The namespace of the &lt;VAR&gt;addr&lt;/VAR&gt; is not supported by this socket.
5167 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EISCONN
5168 The socket &lt;VAR&gt;socket&lt;/VAR&gt; is already connected.
5169 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ETIMEDOUT
5170 The attempt to establish the connection timed out.
5171 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ECONNREFUSED
5172 The server has actively refused to establish the connection.
5173 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENETUNREACH
5174 The network of the given &lt;VAR&gt;addr&lt;/VAR&gt; isn't reachable from this host.
5175 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EADDRINUSE
5176 The socket address of the given &lt;VAR&gt;addr&lt;/VAR&gt; is already in use.
5177 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINPROGRESS
5178 The socket &lt;VAR&gt;socket&lt;/VAR&gt; is non-blocking and the connection could not be
5179 established immediately. You can determine when the connection is
5180 completely established with &lt;CODE&gt;select&lt;/CODE&gt;; .
5181 Another &lt;CODE&gt;connect&lt;/CODE&gt; call on the same socket, before the connection is
5182 completely established, will fail with &lt;CODE&gt;EALREADY&lt;/CODE&gt;.
5183 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EALREADY
5184 The socket &lt;VAR&gt;socket&lt;/VAR&gt; is non-blocking and already has a pending
5185 connection in progress (see &lt;CODE&gt;EINPROGRESS&lt;/CODE&gt; above).
5186
5187 &lt;br&gt;&lt;br&gt; This function is defined as a cancellation point in multi-threaded
5188 programs, so one has to be prepared for this and make sure that
5189 allocated resources (like memory, files descriptors, semaphores or
5190 whatever) are freed even if the thread is canceled.
5191 </synopsis>
5192 </function>
5193 </construct>
5194 <construct id="function-listen" type="function">
5195 <function returntype="int">
5196 <prototype>
5197 <parameter content="int socket"/>
5198 <parameter content="int n"/>
5199 </prototype>
5200 <headers>
5201 <header filename = "sys/socket.h"/>
5202 </headers>
5203 <synopsis>
5204 The &lt;CODE&gt;listen&lt;/CODE&gt; function enables the socket &lt;VAR&gt;socket&lt;/VAR&gt; to accept
5205 connections, thus making it a server socket.
5206 &lt;br&gt;&lt;br&gt; The argument &lt;VAR&gt;n&lt;/VAR&gt; specifies the length of the queue for pending
5207 connections. When the queue fills, new clients attempting to connect
5208 fail with &lt;CODE&gt;ECONNREFUSED&lt;/CODE&gt; until the server calls &lt;CODE&gt;accept&lt;/CODE&gt; to
5209 accept a connection from the queue.
5210 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;listen&lt;/CODE&gt; function returns &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt;
5211 on failure. The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined
5212 for this function:
5213 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
5214
5215 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
5216 &lt;DD&gt;
5217 The argument &lt;VAR&gt;socket&lt;/VAR&gt; is not a valid file descriptor.
5218 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTSOCK
5219 The argument &lt;VAR&gt;socket&lt;/VAR&gt; is not a socket.
5220 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EOPNOTSUPP
5221 The socket &lt;VAR&gt;socket&lt;/VAR&gt; does not support this operation.
5222
5223 </synopsis>
5224 </function>
5225 </construct>
5226 <construct id="function-accept" type="function">
5227 <function returntype="int">
5228 <prototype>
5229 <parameter content="int socket"/>
5230 <parameter content="struct sockaddr *addr"/>
5231 <parameter content="socklen_t *length_ptr"/>
5232 </prototype>
5233 <headers>
5234 <header filename = "sys/socket.h"/>
5235 </headers>
5236 <synopsis>
5237 This function is used to accept a connection request on the server
5238 socket &lt;VAR&gt;socket&lt;/VAR&gt;.
5239 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;accept&lt;/CODE&gt; function waits if there are no connections pending,
5240 unless the socket &lt;VAR&gt;socket&lt;/VAR&gt; has nonblocking mode set. (You can use
5241 &lt;CODE&gt;select&lt;/CODE&gt; to wait for a pending connection, with a nonblocking
5242 socket.) , for information about nonblocking
5243 mode.
5244 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;addr&lt;/VAR&gt; and &lt;VAR&gt;length-ptr&lt;/VAR&gt; arguments are used to return
5245 information about the name of the client socket that initiated the
5246 connection. , for information about the format
5247 of the information.
5248 &lt;br&gt;&lt;br&gt; Accepting a connection does not make &lt;VAR&gt;socket&lt;/VAR&gt; part of the
5249 connection. Instead, it creates a new socket which becomes
5250 connected. The normal return value of &lt;CODE&gt;accept&lt;/CODE&gt; is the file
5251 descriptor for the new socket.
5252 &lt;br&gt;&lt;br&gt; After &lt;CODE&gt;accept&lt;/CODE&gt;, the original socket &lt;VAR&gt;socket&lt;/VAR&gt; remains open and
5253 unconnected, and continues listening until you close it. You can
5254 accept further connections with &lt;VAR&gt;socket&lt;/VAR&gt; by calling &lt;CODE&gt;accept&lt;/CODE&gt;
5255 again.
5256 &lt;br&gt;&lt;br&gt; If an error occurs, &lt;CODE&gt;accept&lt;/CODE&gt; returns &lt;CODE&gt;-1&lt;/CODE&gt;. The following
5257 &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
5258 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
5259
5260 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
5261 &lt;DD&gt;
5262 The &lt;VAR&gt;socket&lt;/VAR&gt; argument is not a valid file descriptor.
5263 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTSOCK
5264 The descriptor &lt;VAR&gt;socket&lt;/VAR&gt; argument is not a socket.
5265 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EOPNOTSUPP
5266 The descriptor &lt;VAR&gt;socket&lt;/VAR&gt; does not support this operation.
5267 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EWOULDBLOCK
5268 &lt;VAR&gt;socket&lt;/VAR&gt; has nonblocking mode set, and there are no pending
5269 connections immediately available.
5270
5271 &lt;br&gt;&lt;br&gt; This function is defined as a cancellation point in multi-threaded
5272 programs, so one has to be prepared for this and make sure that
5273 allocated resources (like memory, files descriptors, semaphores or
5274 whatever) are freed even if the thread is canceled.
5275 </synopsis>
5276 </function>
5277 </construct>
5278 <construct id="function-getpeername" type="function">
5279 <function returntype="int">
5280 <prototype>
5281 <parameter content="int socket"/>
5282 <parameter content="struct sockaddr *addr"/>
5283 <parameter content="socklen_t *length-ptr"/>
5284 </prototype>
5285 <headers>
5286 <header filename = "sys/socket.h"/>
5287 </headers>
5288 <synopsis>
5289 The &lt;CODE&gt;getpeername&lt;/CODE&gt; function returns the address of the socket that
5290 &lt;VAR&gt;socket&lt;/VAR&gt; is connected to; it stores the address in the memory space
5291 specified by &lt;VAR&gt;addr&lt;/VAR&gt; and &lt;VAR&gt;length-ptr&lt;/VAR&gt;. It stores the length of
5292 the address in &lt;CODE&gt;*&lt;VAR&gt;length-ptr&lt;/VAR&gt;&lt;/CODE&gt;.
5293 &lt;br&gt;&lt;br&gt; , for information about the format of the
5294 address. In some operating systems, &lt;CODE&gt;getpeername&lt;/CODE&gt; works only for
5295 sockets in the Internet domain.
5296 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt; on error. The
5297 following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
5298 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
5299
5300 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
5301 &lt;DD&gt;
5302 The argument &lt;VAR&gt;socket&lt;/VAR&gt; is not a valid file descriptor.
5303 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTSOCK
5304 The descriptor &lt;VAR&gt;socket&lt;/VAR&gt; is not a socket.
5305 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTCONN
5306 The socket &lt;VAR&gt;socket&lt;/VAR&gt; is not connected.
5307 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOBUFS
5308 There are not enough internal buffers available.
5309
5310 </synopsis>
5311 </function>
5312 </construct>
5313 <construct id="function-send" type="function">
5314 <function returntype="int">
5315 <prototype>
5316 <parameter content="int socket"/>
5317 <parameter content="void *buffer"/>
5318 <parameter content="size_t size"/>
5319 <parameter content="int flags"/>
5320 </prototype>
5321 <headers>
5322 <header filename = "sys/socket.h"/>
5323 </headers>
5324 <synopsis>
5325 The &lt;CODE&gt;send&lt;/CODE&gt; function is like &lt;CODE&gt;write&lt;/CODE&gt;, but with the additional
5326 flags &lt;VAR&gt;flags&lt;/VAR&gt;. The possible values of &lt;VAR&gt;flags&lt;/VAR&gt; are described
5327 in Socket Data Options.
5328 &lt;br&gt;&lt;br&gt; This function returns the number of bytes transmitted, or &lt;CODE&gt;-1&lt;/CODE&gt; on
5329 failure. If the socket is nonblocking, then &lt;CODE&gt;send&lt;/CODE&gt; (like
5330 &lt;CODE&gt;write&lt;/CODE&gt;) can return after sending just part of the data.
5331 , for information about nonblocking mode.
5332 &lt;br&gt;&lt;br&gt; Note, however, that a successful return value merely indicates that
5333 the message has been sent without error, not necessarily that it has
5334 been received without error.
5335 &lt;br&gt;&lt;br&gt; The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
5336 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
5337
5338 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
5339 &lt;DD&gt;
5340 The &lt;VAR&gt;socket&lt;/VAR&gt; argument is not a valid file descriptor.
5341 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINTR
5342 The operation was interrupted by a signal before any data was sent.
5343 .
5344 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTSOCK
5345 The descriptor &lt;VAR&gt;socket&lt;/VAR&gt; is not a socket.
5346 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EMSGSIZE
5347 The socket type requires that the message be sent atomically, but the
5348 message is too large for this to be possible.
5349 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EWOULDBLOCK
5350 Nonblocking mode has been set on the socket, and the write operation
5351 would block. (Normally &lt;CODE&gt;send&lt;/CODE&gt; blocks until the operation can be
5352 completed.)
5353 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOBUFS
5354 There is not enough internal buffer space available.
5355 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTCONN
5356 You never connected this socket.
5357 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EPIPE
5358 This socket was connected but the connection is now broken. In this
5359 case, &lt;CODE&gt;send&lt;/CODE&gt; generates a &lt;CODE&gt;SIGPIPE&lt;/CODE&gt; signal first; if that
5360 signal is ignored or blocked, or if its handler returns, then
5361 &lt;CODE&gt;send&lt;/CODE&gt; fails with &lt;CODE&gt;EPIPE&lt;/CODE&gt;.
5362
5363 &lt;br&gt;&lt;br&gt; This function is defined as a cancellation point in multi-threaded
5364 programs, so one has to be prepared for this and make sure that
5365 allocated resources (like memory, files descriptors, semaphores or
5366 whatever) are freed even if the thread is canceled.
5367 </synopsis>
5368 </function>
5369 </construct>
5370 <construct id="function-recv" type="function">
5371 <function returntype="int">
5372 <prototype>
5373 <parameter content="int socket"/>
5374 <parameter content="void *buffer"/>
5375 <parameter content="size_t size"/>
5376 <parameter content="int flags"/>
5377 </prototype>
5378 <headers>
5379 <header filename = "sys/socket.h"/>
5380 </headers>
5381 <synopsis>
5382 The &lt;CODE&gt;recv&lt;/CODE&gt; function is like &lt;CODE&gt;read&lt;/CODE&gt;, but with the additional
5383 flags &lt;VAR&gt;flags&lt;/VAR&gt;. The possible values of &lt;VAR&gt;flags&lt;/VAR&gt; are described
5384 in Socket Data Options.
5385 &lt;br&gt;&lt;br&gt; If nonblocking mode is set for &lt;VAR&gt;socket&lt;/VAR&gt;, and no data are available to
5386 be read, &lt;CODE&gt;recv&lt;/CODE&gt; fails immediately rather than waiting. , for information about nonblocking mode.
5387 &lt;br&gt;&lt;br&gt; This function returns the number of bytes received, or &lt;CODE&gt;-1&lt;/CODE&gt; on failure.
5388 The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
5389 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
5390
5391 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
5392 &lt;DD&gt;
5393 The &lt;VAR&gt;socket&lt;/VAR&gt; argument is not a valid file descriptor.
5394 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTSOCK
5395 The descriptor &lt;VAR&gt;socket&lt;/VAR&gt; is not a socket.
5396 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EWOULDBLOCK
5397 Nonblocking mode has been set on the socket, and the read operation
5398 would block. (Normally, &lt;CODE&gt;recv&lt;/CODE&gt; blocks until there is input
5399 available to be read.)
5400 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINTR
5401 The operation was interrupted by a signal before any data was read.
5402 .
5403 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTCONN
5404 You never connected this socket.
5405
5406 &lt;br&gt;&lt;br&gt; This function is defined as a cancellation point in multi-threaded
5407 programs, so one has to be prepared for this and make sure that
5408 allocated resources (like memory, files descriptors, semaphores or
5409 whatever) are freed even if the thread is canceled.
5410 </synopsis>
5411 </function>
5412 </construct>
5413 <construct id="function-sendto" type="function">
5414 <function returntype="int">
5415 <prototype>
5416 <parameter content="int socket"/>
5417 <parameter content="void *buffer. size_t size"/>
5418 <parameter content="int flags"/>
5419 <parameter content="struct sockaddr *addr"/>
5420 <parameter content="socklen_t length"/>
5421 </prototype>
5422 <headers>
5423 <header filename = "sys/socket.h"/>
5424 </headers>
5425 <synopsis>
5426 The &lt;CODE&gt;sendto&lt;/CODE&gt; function transmits the data in the &lt;VAR&gt;buffer&lt;/VAR&gt;
5427 through the socket &lt;VAR&gt;socket&lt;/VAR&gt; to the destination address specified
5428 by the &lt;VAR&gt;addr&lt;/VAR&gt; and &lt;VAR&gt;length&lt;/VAR&gt; arguments. The &lt;VAR&gt;size&lt;/VAR&gt; argument
5429 specifies the number of bytes to be transmitted.
5430 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;flags&lt;/VAR&gt; are interpreted the same way as for &lt;CODE&gt;send&lt;/CODE&gt;; see
5431 Socket Data Options.
5432 &lt;br&gt;&lt;br&gt; The return value and error conditions are also the same as for
5433 &lt;CODE&gt;send&lt;/CODE&gt;, but you cannot rely on the system to detect errors and
5434 report them; the most common error is that the packet is lost or there
5435 is no-one at the specified address to receive it, and the operating
5436 system on your machine usually does not know this.
5437 &lt;br&gt;&lt;br&gt; It is also possible for one call to &lt;CODE&gt;sendto&lt;/CODE&gt; to report an error
5438 owing to a problem related to a previous call.
5439 &lt;br&gt;&lt;br&gt; This function is defined as a cancellation point in multi-threaded
5440 programs, so one has to be prepared for this and make sure that
5441 allocated resources (like memory, files descriptors, semaphores or
5442 whatever) are freed even if the thread is canceled.
5443 </synopsis>
5444 </function>
5445 </construct>
5446 <construct id="function-recvfrom" type="function">
5447 <function returntype="int">
5448 <prototype>
5449 <parameter content="int socket"/>
5450 <parameter content="void *buffer"/>
5451 <parameter content="size_t size"/>
5452 <parameter content="int flags"/>
5453 <parameter content="struct sockaddr *addr"/>
5454 <parameter content="socklen_t *length-ptr"/>
5455 </prototype>
5456 <headers>
5457 <header filename = "sys/socket.h"/>
5458 </headers>
5459 <synopsis>
5460 The &lt;CODE&gt;recvfrom&lt;/CODE&gt; function reads one packet from the socket
5461 &lt;VAR&gt;socket&lt;/VAR&gt; into the buffer &lt;VAR&gt;buffer&lt;/VAR&gt;. The &lt;VAR&gt;size&lt;/VAR&gt; argument
5462 specifies the maximum number of bytes to be read.
5463 &lt;br&gt;&lt;br&gt; If the packet is longer than &lt;VAR&gt;size&lt;/VAR&gt; bytes, then you get the first
5464 &lt;VAR&gt;size&lt;/VAR&gt; bytes of the packet and the rest of the packet is lost.
5465 There's no way to read the rest of the packet. Thus, when you use a
5466 packet protocol, you must always know how long a packet to expect.
5467 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;addr&lt;/VAR&gt; and &lt;VAR&gt;length-ptr&lt;/VAR&gt; arguments are used to return the
5468 address where the packet came from. . For a
5469 socket in the local domain the address information won't be meaningful,
5470 since you can't read the address of such a socket. You can specify a null pointer as the &lt;VAR&gt;addr&lt;/VAR&gt; argument
5471 if you are not interested in this information.
5472 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;flags&lt;/VAR&gt; are interpreted the same way as for &lt;CODE&gt;recv&lt;/CODE&gt;
5473 . The return value and error conditions
5474 are also the same as for &lt;CODE&gt;recv&lt;/CODE&gt;.
5475 &lt;br&gt;&lt;br&gt; This function is defined as a cancellation point in multi-threaded
5476 programs, so one has to be prepared for this and make sure that
5477 allocated resources (like memory, files descriptors, semaphores or
5478 whatever) are freed even if the thread is canceled.
5479 </synopsis>
5480 </function>
5481 </construct>
5482 <construct id="struct-msghdr" type="struct">
5483 <structure>
5484 </structure>
5485 </construct>
5486 <construct id="function-sendmsg" type="function">
5487 <function returntype="int">
5488 <prototype>
5489 <parameter content="int socket"/>
5490 <parameter content="const struct msghdr *message"/>
5491 <parameter content="int flags"/>
5492 </prototype>
5493 <headers>
5494 <header filename = "sys/socket.h"/>
5495 </headers>
5496 <synopsis>
5497 &lt;br&gt;&lt;br&gt; This function is defined as a cancellation point in multi-threaded
5498 programs, so one has to be prepared for this and make sure that
5499 allocated resources (like memory, files descriptors, semaphores or
5500 whatever) are freed even if the thread is cancel.
5501 </synopsis>
5502 </function>
5503 </construct>
5504 <construct id="function-recvmsg" type="function">
5505 <function returntype="int">
5506 <prototype>
5507 <parameter content="int socket"/>
5508 <parameter content="struct msghdr *message"/>
5509 <parameter content="int flags"/>
5510 </prototype>
5511 <headers>
5512 <header filename = "sys/socket.h"/>
5513 </headers>
5514 <synopsis>
5515 &lt;br&gt;&lt;br&gt; This function is defined as a cancellation point in multi-threaded
5516 programs, so one has to be prepared for this and make sure that
5517 allocated resources (like memory, files descriptors, semaphores or
5518 whatever) are freed even if the thread is canceled.
5519 </synopsis>
5520 </function>
5521 </construct>
5522 <construct id="function-getsockopt" type="function">
5523 <function returntype="int">
5524 <prototype>
5525 <parameter content="int socket"/>
5526 <parameter content="int level"/>
5527 <parameter content="int optname"/>
5528 <parameter content="void *optval"/>
5529 <parameter content="socklen_t *optlen-ptr"/>
5530 </prototype>
5531 <headers>
5532 <header filename = "sys/socket.h"/>
5533 </headers>
5534 <synopsis>
5535 The &lt;CODE&gt;getsockopt&lt;/CODE&gt; function gets information about the value of
5536 option &lt;VAR&gt;optname&lt;/VAR&gt; at level &lt;VAR&gt;level&lt;/VAR&gt; for socket &lt;VAR&gt;socket&lt;/VAR&gt;.
5537 &lt;br&gt;&lt;br&gt; The option value is stored in a buffer that &lt;VAR&gt;optval&lt;/VAR&gt; points to.
5538 Before the call, you should supply in &lt;CODE&gt;*&lt;VAR&gt;optlen-ptr&lt;/VAR&gt;&lt;/CODE&gt; the
5539 size of this buffer; on return, it contains the number of bytes of
5540 information actually stored in the buffer.
5541 &lt;br&gt;&lt;br&gt; Most options interpret the &lt;VAR&gt;optval&lt;/VAR&gt; buffer as a single &lt;CODE&gt;int&lt;/CODE&gt;
5542 value.
5543 &lt;br&gt;&lt;br&gt; The actual return value of &lt;CODE&gt;getsockopt&lt;/CODE&gt; is &lt;CODE&gt;0&lt;/CODE&gt; on success
5544 and &lt;CODE&gt;-1&lt;/CODE&gt; on failure. The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions
5545 are defined:
5546 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
5547
5548 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
5549 &lt;DD&gt;
5550 The &lt;VAR&gt;socket&lt;/VAR&gt; argument is not a valid file descriptor.
5551 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTSOCK
5552 The descriptor &lt;VAR&gt;socket&lt;/VAR&gt; is not a socket.
5553 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOPROTOOPT
5554 The &lt;VAR&gt;optname&lt;/VAR&gt; doesn't make sense for the given &lt;VAR&gt;level&lt;/VAR&gt;.
5555
5556 </synopsis>
5557 </function>
5558 </construct>
5559 <construct id="function-setsockopt" type="function">
5560 <function returntype="int">
5561 <prototype>
5562 <parameter content="int socket"/>
5563 <parameter content="int level"/>
5564 <parameter content="int optname"/>
5565 <parameter content="void *optval"/>
5566 <parameter content="socklen_t optlen"/>
5567 </prototype>
5568 <headers>
5569 <header filename = "sys/socket.h"/>
5570 </headers>
5571 <synopsis>
5572 This function is used to set the socket option &lt;VAR&gt;optname&lt;/VAR&gt; at level
5573 &lt;VAR&gt;level&lt;/VAR&gt; for socket &lt;VAR&gt;socket&lt;/VAR&gt;. The value of the option is passed
5574 in the buffer &lt;VAR&gt;optval&lt;/VAR&gt; of size &lt;VAR&gt;optlen&lt;/VAR&gt;.
5575 &lt;br&gt;&lt;br&gt;
5576
5577 The return value and error codes for &lt;CODE&gt;setsockopt&lt;/CODE&gt; are the same as
5578 for &lt;CODE&gt;getsockopt&lt;/CODE&gt;.
5579
5580 &lt;br&gt;&lt;br&gt;
5581 </synopsis>
5582 </function>
5583 </construct>
5584 <construct id="struct-linger" type="struct">
5585 <structure>
5586 <synopsis>
5587 This structure type has the following members:
5588 &lt;br&gt;&lt;br&gt;
5589 </synopsis>
5590 <elements>
5591 <element content="int l_onoff">
5592 <synopsis>
5593 This field is interpreted as a boolean. If nonzero, &lt;CODE&gt;close&lt;/CODE&gt;
5594 blocks until the data are transmitted or the timeout period has expired.
5595 &lt;br&gt;&lt;br&gt;
5596 </synopsis>
5597 </element>
5598 </elements>
5599 </structure>
5600 </construct>
5601 <construct id="struct-netent" type="struct">
5602 <structure>
5603 <synopsis>
5604 This data type is used to represent information about entries in the
5605 networks database. It has the following members:
5606 &lt;br&gt;&lt;br&gt;
5607 </synopsis>
5608 <elements>
5609 <element content="char *n_name">
5610 <synopsis>
5611 This is the ``official'' name of the network.
5612 &lt;br&gt;&lt;br&gt;
5613 </synopsis>
5614 </element>
5615 <element content="char **n_aliases">
5616 <synopsis>
5617 These are alternative names for the network, represented as a vector
5618 of strings. A null pointer terminates the array.
5619 &lt;br&gt;&lt;br&gt;
5620 </synopsis>
5621 </element>
5622 <element content="int n_addrtype">
5623 <synopsis>
5624 This is the type of the network number; this is always equal to
5625 &lt;CODE&gt;AF_INET&lt;/CODE&gt; for Internet networks.
5626 &lt;br&gt;&lt;br&gt;
5627 </synopsis>
5628 </element>
5629 </elements>
5630 </structure>
5631 </construct>
5632 <construct id="function-getnetbyname" type="function">
5633 <function returntype="struct netent *">
5634 <prototype>
5635 <parameter content="const char *name"/>
5636 </prototype>
5637 <headers>
5638 <header filename = "sys/socket.h"/>
5639 <header filename = "netdb.h"/>
5640 </headers>
5641 <synopsis>
5642 The &lt;CODE&gt;getnetbyname&lt;/CODE&gt; function returns information about the network
5643 named &lt;VAR&gt;name&lt;/VAR&gt;. It returns a null pointer if there is no such
5644 network.
5645 </synopsis>
5646 </function>
5647 </construct>
5648 <construct id="function-getnetbyaddr" type="function">
5649 <function returntype="struct netent *">
5650 <prototype>
5651 <parameter content="unsigned long int net"/>
5652 <parameter content="int type"/>
5653 </prototype>
5654 <headers>
5655 <header filename = "netdb.h"/>
5656 </headers>
5657 <synopsis>
5658 The &lt;CODE&gt;getnetbyaddr&lt;/CODE&gt; function returns information about the network
5659 of type &lt;VAR&gt;type&lt;/VAR&gt; with number &lt;VAR&gt;net&lt;/VAR&gt;. You should specify a value of
5660 &lt;CODE&gt;AF_INET&lt;/CODE&gt; for the &lt;VAR&gt;type&lt;/VAR&gt; argument for Internet networks.
5661 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;getnetbyaddr&lt;/CODE&gt; returns a null pointer if there is no such
5662 network.
5663 </synopsis>
5664 </function>
5665 </construct>
5666 <construct id="function-setnetent" type="function">
5667 <function returntype="void">
5668 <prototype>
5669 <parameter content="int stayopen"/>
5670 </prototype>
5671 <headers>
5672 <header filename = "netdb.h"/>
5673 </headers>
5674 <synopsis>
5675 This function opens and rewinds the networks database.
5676 &lt;br&gt;&lt;br&gt; If the &lt;VAR&gt;stayopen&lt;/VAR&gt; argument is nonzero, this sets a flag so that
5677 subsequent calls to &lt;CODE&gt;getnetbyname&lt;/CODE&gt; or &lt;CODE&gt;getnetbyaddr&lt;/CODE&gt; will
5678 not close the database (as they usually would). This makes for more
5679 efficiency if you call those functions several times, by avoiding
5680 reopening the database for each call.
5681 </synopsis>
5682 </function>
5683 </construct>
5684 <construct id="function-getnetent" type="function">
5685 <function returntype="struct netent *">
5686 <prototype>
5687 <parameter content="void"/>
5688 </prototype>
5689 <headers>
5690 <header filename = "netdb.h"/>
5691 </headers>
5692 <synopsis>
5693 This function returns the next entry in the networks database. It
5694 returns a null pointer if there are no more entries.
5695 </synopsis>
5696 </function>
5697 </construct>
5698 <construct id="function-endnetent" type="function">
5699 <function returntype="void">
5700 <prototype>
5701 <parameter content="void"/>
5702 </prototype>
5703 <headers>
5704 <header filename = "netdb.h"/>
5705 </headers>
5706 <synopsis>
5707 This function closes the networks database.
5708 </synopsis>
5709 </function>
5710 </construct>
5711 <construct id="function-difftime" type="function">
5712 <function returntype="double">
5713 <prototype>
5714 <parameter content="time_t time1"/>
5715 <parameter content="time_t time0"/>
5716 </prototype>
5717 <headers>
5718 <header filename = "time.h"/>
5719 </headers>
5720 <synopsis>
5721 The &lt;CODE&gt;difftime&lt;/CODE&gt; function returns the number of seconds of elapsed
5722 time between calendar time &lt;VAR&gt;time1&lt;/VAR&gt; and calendar time &lt;VAR&gt;time0&lt;/VAR&gt;, as
5723 a value of type &lt;CODE&gt;double&lt;/CODE&gt;. The difference ignores leap seconds
5724 unless leap second support is enabled.
5725 &lt;br&gt;&lt;br&gt; In the GNU system, you can simply subtract &lt;CODE&gt;time_t&lt;/CODE&gt; values. But on
5726 other systems, the &lt;CODE&gt;time_t&lt;/CODE&gt; data type might use some other encoding
5727 where subtraction doesn't work directly.
5728 </synopsis>
5729 </function>
5730 </construct>
5731 <construct id="struct-timeval" type="struct">
5732 <structure>
5733 <synopsis>
5734
5735 The &lt;CODE&gt;struct timeval&lt;/CODE&gt; structure represents an elapsed time. It is
5736 declared in &lt;TT&gt;sys/time.h&lt;/TT&gt; and has the following members:
5737 &lt;br&gt;&lt;br&gt;
5738 </synopsis>
5739 <elements>
5740 <element content="long int tv_sec">
5741 <synopsis>
5742 This represents the number of whole seconds of elapsed time.
5743 &lt;br&gt;&lt;br&gt;
5744 </synopsis>
5745 </element>
5746 </elements>
5747 </structure>
5748 </construct>
5749 <construct id="struct-timespec" type="struct">
5750 <structure>
5751 <synopsis>
5752
5753 The &lt;CODE&gt;struct timespec&lt;/CODE&gt; structure represents an elapsed time. It is
5754 declared in &lt;TT&gt;time.h&lt;/TT&gt; and has the following members:
5755 &lt;br&gt;&lt;br&gt;
5756 </synopsis>
5757 <elements>
5758 <element content="long int tv_sec">
5759 <synopsis>
5760 This represents the number of whole seconds of elapsed time.
5761 &lt;br&gt;&lt;br&gt;
5762 </synopsis>
5763 </element>
5764 </elements>
5765 </structure>
5766 </construct>
5767 <construct id="dtype-clock_t" type="dtype">
5768 <structure>
5769 </structure>
5770 </construct>
5771 <construct id="function-clock" type="function">
5772 <function returntype="clock_t">
5773 <prototype>
5774 <parameter content="void"/>
5775 </prototype>
5776 <headers>
5777 <header filename = "sys/time.h"/>
5778 <header filename = "time.h"/>
5779 </headers>
5780 <synopsis>
5781 This function returns the calling process' current CPU time. If the CPU
5782 time is not available or cannot be represented, &lt;CODE&gt;clock&lt;/CODE&gt; returns the
5783 value &lt;CODE&gt;(clock_t)(-1)&lt;/CODE&gt;.
5784 </synopsis>
5785 </function>
5786 </construct>
5787 <construct id="struct-tms" type="struct">
5788 <structure>
5789 <synopsis>
5790 The &lt;CODE&gt;tms&lt;/CODE&gt; structure is used to return information about process
5791 times. It contains at least the following members:
5792 &lt;br&gt;&lt;br&gt;
5793 </synopsis>
5794 <elements>
5795 <element content="clock_t tms_utime">
5796 <synopsis>
5797 This is the total processor time the calling process has used in
5798 executing the instructions of its program.
5799 &lt;br&gt;&lt;br&gt;
5800 </synopsis>
5801 </element>
5802 <element content="clock_t tms_stime">
5803 <synopsis>
5804 This is the processor time the system has used on behalf of the calling
5805 process.
5806 &lt;br&gt;&lt;br&gt;
5807 </synopsis>
5808 </element>
5809 <element content="clock_t tms_cutime">
5810 <synopsis>
5811 This is the sum of the &lt;CODE&gt;tms_utime&lt;/CODE&gt; values and the &lt;CODE&gt;tms_cutime&lt;/CODE&gt;
5812 values of all terminated child processes of the calling process, whose
5813 status has been reported to the parent process by &lt;CODE&gt;wait&lt;/CODE&gt; or
5814 &lt;CODE&gt;waitpid&lt;/CODE&gt;; see Process Completion. In other words, it
5815 represents the total processor time used in executing the instructions
5816 of all the terminated child processes of the calling process, excluding
5817 child processes which have not yet been reported by &lt;CODE&gt;wait&lt;/CODE&gt; or
5818 &lt;CODE&gt;waitpid&lt;/CODE&gt;.
5819 process
5820 &lt;br&gt;&lt;br&gt;
5821 </synopsis>
5822 </element>
5823 </elements>
5824 </structure>
5825 </construct>
5826 <construct id="function-times" type="function">
5827 <function returntype="clock_t">
5828 <prototype>
5829 <parameter content="struct tms *buffer"/>
5830 </prototype>
5831 <headers>
5832 <header filename = "sys/times.h"/>
5833 </headers>
5834 <synopsis>
5835 The &lt;CODE&gt;times&lt;/CODE&gt; function stores the processor time information for
5836 the calling process in &lt;VAR&gt;buffer&lt;/VAR&gt;.
5837 &lt;br&gt;&lt;br&gt; The return value is the calling process' CPU time (the same value you
5838 get from &lt;CODE&gt;clock()&lt;/CODE&gt;. &lt;CODE&gt;times&lt;/CODE&gt; returns &lt;CODE&gt;(clock_t)(-1)&lt;/CODE&gt; to
5839 indicate failure.
5840 </synopsis>
5841 </function>
5842 </construct>
5843 <construct id="dtype-time_t" type="dtype">
5844 <structure>
5845 </structure>
5846 </construct>
5847 <construct id="function-time" type="function">
5848 <function returntype="time_t">
5849 <prototype>
5850 <parameter content="time_t *result"/>
5851 </prototype>
5852 <headers>
5853 <header filename = "time.h"/>
5854 </headers>
5855 <synopsis>
5856 The &lt;CODE&gt;time&lt;/CODE&gt; function returns the current calendar time as a value of
5857 type &lt;CODE&gt;time_t&lt;/CODE&gt;. If the argument &lt;VAR&gt;result&lt;/VAR&gt; is not a null pointer,
5858 the calendar time value is also stored in &lt;CODE&gt;*&lt;VAR&gt;result&lt;/VAR&gt;&lt;/CODE&gt;. If the
5859 current calendar time is not available, the value
5860 &lt;CODE&gt;(time_t)(-1)&lt;/CODE&gt; is returned.
5861 </synopsis>
5862 </function>
5863 </construct>
5864 <construct id="function-stime" type="function">
5865 <function returntype="int">
5866 <prototype>
5867 <parameter content="time_t *newtime"/>
5868 </prototype>
5869 <headers>
5870 <header filename = "time.h"/>
5871 </headers>
5872 <synopsis>
5873 &lt;CODE&gt;stime&lt;/CODE&gt; sets the system clock, i.e., it tells the system that the
5874 current calendar time is &lt;VAR&gt;newtime&lt;/VAR&gt;, where &lt;CODE&gt;newtime&lt;/CODE&gt; is
5875 interpreted as described in the above definition of &lt;CODE&gt;time_t&lt;/CODE&gt;.
5876 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;settimeofday&lt;/CODE&gt; is a newer function which sets the system clock to
5877 better than one second precision. &lt;CODE&gt;settimeofday&lt;/CODE&gt; is generally a
5878 better choice than &lt;CODE&gt;stime&lt;/CODE&gt;. .
5879 &lt;br&gt;&lt;br&gt; Only the superuser can set the system clock.
5880 &lt;br&gt;&lt;br&gt; If the function succeeds, the return value is zero. Otherwise, it is
5881 &lt;CODE&gt;-1&lt;/CODE&gt; and &lt;CODE&gt;errno&lt;/CODE&gt; is set accordingly:
5882 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
5883
5884 &lt;DT&gt;&lt;CODE&gt;EPERM&lt;/CODE&gt;
5885 &lt;DD&gt;
5886 The process is not superuser.
5887
5888 </synopsis>
5889 </function>
5890 </construct>
5891 <construct id="struct-timezone" type="struct">
5892 <structure>
5893 <synopsis>
5894 The &lt;CODE&gt;struct timezone&lt;/CODE&gt; structure is used to hold minimal information
5895 about the local time zone. It has the following members:
5896 &lt;br&gt;&lt;br&gt;
5897 </synopsis>
5898 <elements>
5899 <element content="int tz_minuteswest">
5900 <synopsis>
5901 This is the number of minutes west of UTC.
5902 &lt;br&gt;&lt;br&gt;
5903 </synopsis>
5904 </element>
5905 </elements>
5906 </structure>
5907 </construct>
5908 <construct id="function-gettimeofday" type="function">
5909 <function returntype="int">
5910 <prototype>
5911 <parameter content="struct timeval *tp"/>
5912 <parameter content="struct timezone *tzp"/>
5913 </prototype>
5914 <headers>
5915 <header filename = "sys/time.h"/>
5916 </headers>
5917 <synopsis>
5918 The &lt;CODE&gt;gettimeofday&lt;/CODE&gt; function returns the current calendar time as
5919 the elapsed time since the epoch in the &lt;CODE&gt;struct timeval&lt;/CODE&gt; structure
5920 indicated by &lt;VAR&gt;tp&lt;/VAR&gt;. ( for a description of
5921 &lt;CODE&gt;struct timeval&lt;/CODE&gt;). Information about the time zone is returned in
5922 the structure pointed at &lt;VAR&gt;tzp&lt;/VAR&gt;. If the &lt;VAR&gt;tzp&lt;/VAR&gt; argument is a null
5923 pointer, time zone information is ignored.
5924 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt; on failure. The
5925 following &lt;CODE&gt;errno&lt;/CODE&gt; error condition is defined for this function:
5926 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
5927
5928 &lt;DT&gt;&lt;CODE&gt;ENOSYS&lt;/CODE&gt;
5929 &lt;DD&gt;
5930 The operating system does not support getting time zone information, and
5931 &lt;VAR&gt;tzp&lt;/VAR&gt; is not a null pointer. The GNU operating system does not
5932 support using &lt;CODE&gt;struct timezone&lt;/CODE&gt; to represent time zone
5933 information; that is an obsolete feature of 4.3 BSD.
5934 Instead, use the facilities described in Time Zone Functions.
5935
5936 </synopsis>
5937 </function>
5938 </construct>
5939 <construct id="function-settimeofday" type="function">
5940 <function returntype="int">
5941 <prototype>
5942 <parameter content="const struct timeval *tp"/>
5943 <parameter content="const struct timezone *tzp"/>
5944 </prototype>
5945 <headers>
5946 <header filename = "sys/time.h"/>
5947 </headers>
5948 <synopsis>
5949 The &lt;CODE&gt;settimeofday&lt;/CODE&gt; function sets the current calendar time in the
5950 system clock according to the arguments. As for &lt;CODE&gt;gettimeofday&lt;/CODE&gt;,
5951 the calendar time is represented as the elapsed time since the epoch.
5952 As for &lt;CODE&gt;gettimeofday&lt;/CODE&gt;, time zone information is ignored if
5953 &lt;VAR&gt;tzp&lt;/VAR&gt; is a null pointer.
5954 &lt;br&gt;&lt;br&gt; You must be a privileged user in order to use &lt;CODE&gt;settimeofday&lt;/CODE&gt;.
5955 &lt;br&gt;&lt;br&gt; Some kernels automatically set the system clock from some source such as
5956 a hardware clock when they start up. Others, including Linux, place the
5957 system clock in an ``invalid'' state (in which attempts to read the clock
5958 fail). A call of &lt;CODE&gt;stime&lt;/CODE&gt; removes the system clock from an invalid
5959 state, and system startup scripts typically run a program that calls
5960 &lt;CODE&gt;stime&lt;/CODE&gt;.
5961 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;settimeofday&lt;/CODE&gt; causes a sudden jump forwards or backwards, which
5962 can cause a variety of problems in a system. Use &lt;CODE&gt;adjtime&lt;/CODE&gt; (below)
5963 to make a smooth transition from one time to another by temporarily
5964 speeding up or slowing down the clock.
5965 &lt;br&gt;&lt;br&gt; With a Linux kernel, &lt;CODE&gt;adjtimex&lt;/CODE&gt; does the same thing and can also
5966 make permanent changes to the speed of the system clock so it doesn't
5967 need to be corrected as often.
5968 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt; on failure. The
5969 following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
5970 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
5971
5972 &lt;DT&gt;&lt;CODE&gt;EPERM&lt;/CODE&gt;
5973 &lt;DD&gt;
5974 This process cannot set the clock because it is not privileged.
5975 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOSYS
5976 The operating system does not support setting time zone information, and
5977 &lt;VAR&gt;tzp&lt;/VAR&gt; is not a null pointer.
5978
5979 </synopsis>
5980 </function>
5981 </construct>
5982 <construct id="function-adjtime" type="function">
5983 <function returntype="int">
5984 <prototype>
5985 <parameter content="const struct timeval *delta"/>
5986 <parameter content="struct timeval *olddelta"/>
5987 </prototype>
5988 <headers>
5989 <header filename = "sys/time.h"/>
5990 </headers>
5991 <synopsis>
5992 This function speeds up or slows down the system clock in order to make
5993 a gradual adjustment. This ensures that the calendar time reported by
5994 the system clock is always monotonically increasing, which might not
5995 happen if you simply set the clock.
5996 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;delta&lt;/VAR&gt; argument specifies a relative adjustment to be made to
5997 the clock time. If negative, the system clock is slowed down for a
5998 while until it has lost this much elapsed time. If positive, the system
5999 clock is speeded up for a while.
6000 &lt;br&gt;&lt;br&gt; If the &lt;VAR&gt;olddelta&lt;/VAR&gt; argument is not a null pointer, the &lt;CODE&gt;adjtime&lt;/CODE&gt;
6001 function returns information about any previous time adjustment that
6002 has not yet completed.
6003 &lt;br&gt;&lt;br&gt; This function is typically used to synchronize the clocks of computers
6004 in a local network. You must be a privileged user to use it.
6005 &lt;br&gt;&lt;br&gt; With a Linux kernel, you can use the &lt;CODE&gt;adjtimex&lt;/CODE&gt; function to
6006 permanently change the clock speed.
6007 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt; on failure. The
6008 following &lt;CODE&gt;errno&lt;/CODE&gt; error condition is defined for this function:
6009 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
6010
6011 &lt;DT&gt;&lt;CODE&gt;EPERM&lt;/CODE&gt;
6012 &lt;DD&gt;
6013 You do not have privilege to set the time.
6014
6015 </synopsis>
6016 </function>
6017 </construct>
6018 <construct id="function-adjtimex" type="function">
6019 <function returntype="int">
6020 <prototype>
6021 <parameter content="struct timex *timex"/>
6022 </prototype>
6023 <headers>
6024 <header filename = "sys/timex.h"/>
6025 </headers>
6026 <synopsis>
6027 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;adjtimex&lt;/CODE&gt; is functionally identical to &lt;CODE&gt;ntp_adjtime&lt;/CODE&gt;.
6028 .
6029 &lt;br&gt;&lt;br&gt; This function is present only with a Linux kernel.
6030 &lt;br&gt;&lt;br&gt;
6031 </synopsis>
6032 </function>
6033 </construct>
6034 <construct id="struct-tm" type="struct">
6035 <structure>
6036 <synopsis>
6037 This is the data type used to represent a broken-down time. The structure
6038 contains at least the following members, which can appear in any order.
6039 &lt;br&gt;&lt;br&gt;
6040 </synopsis>
6041 <elements>
6042 <element content="int tm_sec">
6043 <synopsis>
6044 This is the number of full seconds since the top of the minute (normally
6045 in the range &lt;CODE&gt;0&lt;/CODE&gt; through &lt;CODE&gt;59&lt;/CODE&gt;, but the actual upper limit is
6046 &lt;CODE&gt;60&lt;/CODE&gt;, to allow for leap seconds if leap second support is
6047 available).
6048 second
6049 &lt;br&gt;&lt;br&gt;
6050 </synopsis>
6051 </element>
6052 <element content="int tm_min">
6053 <synopsis>
6054 This is the number of full minutes since the top of the hour (in the
6055 range &lt;CODE&gt;0&lt;/CODE&gt; through &lt;CODE&gt;59&lt;/CODE&gt;).
6056 &lt;br&gt;&lt;br&gt;
6057 </synopsis>
6058 </element>
6059 <element content="int tm_hour">
6060 <synopsis>
6061 This is the number of full hours past midnight (in the range &lt;CODE&gt;0&lt;/CODE&gt; through
6062 &lt;CODE&gt;23&lt;/CODE&gt;).
6063 &lt;br&gt;&lt;br&gt;
6064 </synopsis>
6065 </element>
6066 <element content="int tm_mday">
6067 <synopsis>
6068 This is the ordinal day of the month (in the range &lt;CODE&gt;1&lt;/CODE&gt; through &lt;CODE&gt;31&lt;/CODE&gt;).
6069 Watch out for this one! As the only ordinal number in the structure, it is
6070 inconsistent with the rest of the structure.
6071 &lt;br&gt;&lt;br&gt;
6072 </synopsis>
6073 </element>
6074 <element content="int tm_mon">
6075 <synopsis>
6076 This is the number of full calendar months since the beginning of the
6077 year (in the range &lt;CODE&gt;0&lt;/CODE&gt; through &lt;CODE&gt;11&lt;/CODE&gt;). Watch out for this one!
6078 People usually use ordinal numbers for month-of-year (where January = 1).
6079 &lt;br&gt;&lt;br&gt;
6080 </synopsis>
6081 </element>
6082 <element content="int tm_year">
6083 <synopsis>
6084 This is the number of full calendar years since 1900.
6085 &lt;br&gt;&lt;br&gt;
6086 </synopsis>
6087 </element>
6088 <element content="int tm_wday">
6089 <synopsis>
6090 This is the number of full days since Sunday (in the range &lt;CODE&gt;0&lt;/CODE&gt; through
6091 &lt;CODE&gt;6&lt;/CODE&gt;).
6092 &lt;br&gt;&lt;br&gt;
6093 </synopsis>
6094 </element>
6095 <element content="int tm_yday">
6096 <synopsis>
6097 This is the number of full days since the beginning of the year (in the
6098 range &lt;CODE&gt;0&lt;/CODE&gt; through &lt;CODE&gt;365&lt;/CODE&gt;).
6099 &lt;br&gt;&lt;br&gt;
6100 </synopsis>
6101 </element>
6102 <element content="int tm_isdst">
6103 <synopsis>
6104 Saving Time
6105 time
6106 This is a flag that indicates whether Daylight Saving Time is (or was, or
6107 will be) in effect at the time described. The value is positive if
6108 Daylight Saving Time is in effect, zero if it is not, and negative if the
6109 information is not available.
6110 &lt;br&gt;&lt;br&gt;
6111 </synopsis>
6112 </element>
6113 <element content="long int tm_gmtoff">
6114 <synopsis>
6115 This field describes the time zone that was used to compute this
6116 broken-down time value, including any adjustment for daylight saving; it
6117 is the number of seconds that you must add to UTC to get local time.
6118 You can also think of this as the number of seconds east of UTC. For
6119 example, for U.S. Eastern Standard Time, the value is &lt;CODE&gt;-5*60*60&lt;/CODE&gt;.
6120 The &lt;CODE&gt;tm_gmtoff&lt;/CODE&gt; field is derived from BSD and is a GNU library
6121 extension; it is not visible in a strict ISO C environment.
6122 &lt;br&gt;&lt;br&gt;
6123 </synopsis>
6124 </element>
6125 </elements>
6126 </structure>
6127 </construct>
6128 <construct id="function-localtime" type="function">
6129 <function returntype="struct tm *">
6130 <prototype>
6131 <parameter content="const time_t *time"/>
6132 </prototype>
6133 <headers>
6134 <header filename = "time.h"/>
6135 </headers>
6136 <synopsis>
6137 The &lt;CODE&gt;localtime&lt;/CODE&gt; function converts the simple time pointed to by
6138 &lt;VAR&gt;time&lt;/VAR&gt; to broken-down time representation, expressed relative to the
6139 user's specified time zone.
6140 &lt;br&gt;&lt;br&gt; The return value is a pointer to a static broken-down time structure, which
6141 might be overwritten by subsequent calls to &lt;CODE&gt;ctime&lt;/CODE&gt;, &lt;CODE&gt;gmtime&lt;/CODE&gt;,
6142 or &lt;CODE&gt;localtime&lt;/CODE&gt;. (But no other library function overwrites the contents
6143 of this object.)
6144 &lt;br&gt;&lt;br&gt; The return value is the null pointer if &lt;VAR&gt;time&lt;/VAR&gt; cannot be represented
6145 as a broken-down time; typically this is because the year cannot fit into
6146 an &lt;CODE&gt;int&lt;/CODE&gt;.
6147 &lt;br&gt;&lt;br&gt; Calling &lt;CODE&gt;localtime&lt;/CODE&gt; has one other effect: it sets the variable
6148 &lt;CODE&gt;tzname&lt;/CODE&gt; with information about the current time zone. .
6149 </synopsis>
6150 </function>
6151 </construct>
6152 <construct id="function-localtime_r" type="function">
6153 <function returntype="struct tm *">
6154 <prototype>
6155 <parameter content="const time_t *time"/>
6156 <parameter content="struct tm *resultp"/>
6157 </prototype>
6158 <headers>
6159 <header filename = "time.h"/>
6160 </headers>
6161 <synopsis>
6162 The &lt;CODE&gt;localtime_r&lt;/CODE&gt; function works just like the &lt;CODE&gt;localtime&lt;/CODE&gt;
6163 function. It takes a pointer to a variable containing a simple time
6164 and converts it to the broken-down time format.
6165 &lt;br&gt;&lt;br&gt; But the result is not placed in a static buffer. Instead it is placed
6166 in the object of type &lt;CODE&gt;struct tm&lt;/CODE&gt; to which the parameter
6167 &lt;VAR&gt;resultp&lt;/VAR&gt; points.
6168 &lt;br&gt;&lt;br&gt; If the conversion is successful the function returns a pointer to the
6169 object the result was written into, i.e., it returns &lt;VAR&gt;resultp&lt;/VAR&gt;.
6170 </synopsis>
6171 </function>
6172 </construct>
6173 <construct id="function-gmtime" type="function">
6174 <function returntype="struct tm *">
6175 <prototype>
6176 <parameter content="const time_t *time"/>
6177 </prototype>
6178 <headers>
6179 <header filename = "time.h"/>
6180 </headers>
6181 <synopsis>
6182 This function is similar to &lt;CODE&gt;localtime&lt;/CODE&gt;, except that the broken-down
6183 time is expressed as Coordinated Universal Time (UTC) (formerly called
6184 Greenwich Mean Time (GMT)) rather than relative to a local time zone.
6185 &lt;br&gt;&lt;br&gt;
6186 </synopsis>
6187 </function>
6188 </construct>
6189 <construct id="function-gmtime_r" type="function">
6190 <function returntype="struct tm *">
6191 <prototype>
6192 <parameter content="const time_t *time"/>
6193 <parameter content="struct tm *resultp"/>
6194 </prototype>
6195 <headers>
6196 <header filename = "time.h"/>
6197 </headers>
6198 <synopsis>
6199 This function is similar to &lt;CODE&gt;localtime_r&lt;/CODE&gt;, except that it converts
6200 just like &lt;CODE&gt;gmtime&lt;/CODE&gt; the given time as Coordinated Universal Time.
6201 &lt;br&gt;&lt;br&gt; If the conversion is successful the function returns a pointer to the
6202 object the result was written into, i.e., it returns &lt;VAR&gt;resultp&lt;/VAR&gt;.
6203 </synopsis>
6204 </function>
6205 </construct>
6206 <construct id="function-mktime" type="function">
6207 <function returntype="time_t">
6208 <prototype>
6209 <parameter content="struct tm *brokentime"/>
6210 </prototype>
6211 <headers>
6212 <header filename = "time.h"/>
6213 </headers>
6214 <synopsis>
6215 The &lt;CODE&gt;mktime&lt;/CODE&gt; function is used to convert a broken-down time structure
6216 to a simple time representation. It also ``normalizes'' the contents of
6217 the broken-down time structure, by filling in the day of week and day of
6218 year based on the other date and time components.
6219 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;mktime&lt;/CODE&gt; function ignores the specified contents of the
6220 &lt;CODE&gt;tm_wday&lt;/CODE&gt; and &lt;CODE&gt;tm_yday&lt;/CODE&gt; members of the broken-down time
6221 structure. It uses the values of the other components to determine the
6222 calendar time; it's permissible for these components to have
6223 unnormalized values outside their normal ranges. The last thing that
6224 &lt;CODE&gt;mktime&lt;/CODE&gt; does is adjust the components of the &lt;VAR&gt;brokentime&lt;/VAR&gt;
6225 structure (including the &lt;CODE&gt;tm_wday&lt;/CODE&gt; and &lt;CODE&gt;tm_yday&lt;/CODE&gt;).
6226 &lt;br&gt;&lt;br&gt; If the specified broken-down time cannot be represented as a simple time,
6227 &lt;CODE&gt;mktime&lt;/CODE&gt; returns a value of &lt;CODE&gt;(time_t)(-1)&lt;/CODE&gt; and does not modify
6228 the contents of &lt;VAR&gt;brokentime&lt;/VAR&gt;.
6229 &lt;br&gt;&lt;br&gt; Calling &lt;CODE&gt;mktime&lt;/CODE&gt; also sets the variable &lt;CODE&gt;tzname&lt;/CODE&gt; with
6230 information about the current time zone. .
6231 </synopsis>
6232 </function>
6233 </construct>
6234 <construct id="function-timelocal" type="function">
6235 <function returntype="time_t">
6236 <prototype>
6237 <parameter content="struct tm *brokentime"/>
6238 </prototype>
6239 <headers>
6240 <header filename = "time.h"/>
6241 </headers>
6242 <synopsis>
6243 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;timelocal&lt;/CODE&gt; is functionally identical to &lt;CODE&gt;mktime&lt;/CODE&gt;, but more
6244 mnemonically named. Note that it is the inverse of the &lt;CODE&gt;localtime&lt;/CODE&gt;
6245 function.
6246 &lt;br&gt;&lt;br&gt; Portability note: &lt;CODE&gt;mktime&lt;/CODE&gt; is essentially universally
6247 available. &lt;CODE&gt;timelocal&lt;/CODE&gt; is rather rare.
6248 &lt;br&gt;&lt;br&gt;
6249 </synopsis>
6250 </function>
6251 </construct>
6252 <construct id="function-timegm" type="function">
6253 <function returntype="time_t">
6254 <prototype>
6255 <parameter content="struct tm *brokentime"/>
6256 </prototype>
6257 <headers>
6258 <header filename = "time.h"/>
6259 </headers>
6260 <synopsis>
6261 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;timegm&lt;/CODE&gt; is functionally identical to &lt;CODE&gt;mktime&lt;/CODE&gt; except it
6262 always takes the input values to be Coordinated Universal Time (UTC)
6263 regardless of any local time zone setting.
6264 &lt;br&gt;&lt;br&gt; Note that &lt;CODE&gt;timegm&lt;/CODE&gt; is the inverse of &lt;CODE&gt;gmtime&lt;/CODE&gt;.
6265 &lt;br&gt;&lt;br&gt; Portability note: &lt;CODE&gt;mktime&lt;/CODE&gt; is essentially universally
6266 available. &lt;CODE&gt;timegm&lt;/CODE&gt; is rather rare. For the most portable
6267 conversion from a UTC broken-down time to a simple time, set
6268 the &lt;CODE&gt;TZ&lt;/CODE&gt; environment variable to UTC, call &lt;CODE&gt;mktime&lt;/CODE&gt;, then set
6269 &lt;CODE&gt;TZ&lt;/CODE&gt; back.
6270 &lt;br&gt;&lt;br&gt;
6271 </synopsis>
6272 </function>
6273 </construct>
6274 <construct id="struct-ntptimeval" type="struct">
6275 <structure>
6276 <synopsis>
6277 This structure is used for information about the system clock. It
6278 contains the following members:
6279 </synopsis>
6280 <elements>
6281 <element content="struct timeval time">
6282 <synopsis>
6283 This is the current calendar time, expressed as the elapsed time since
6284 the epoch. The &lt;CODE&gt;struct timeval&lt;/CODE&gt; data type is described in
6285 Elapsed Time.
6286 &lt;br&gt;&lt;br&gt;
6287 </synopsis>
6288 </element>
6289 <element content="long int maxerror">
6290 <synopsis>
6291 This is the maximum error, measured in microseconds. Unless updated
6292 via &lt;CODE&gt;ntp_adjtime&lt;/CODE&gt; periodically, this value will reach some
6293 platform-specific maximum value.
6294 &lt;br&gt;&lt;br&gt;
6295 </synopsis>
6296 </element>
6297 </elements>
6298 </structure>
6299 </construct>
6300 <construct id="function-ntp_gettime" type="function">
6301 <function returntype="int">
6302 <prototype>
6303 <parameter content="struct ntptimeval *tptr"/>
6304 </prototype>
6305 <headers>
6306 <header filename = "sys/timex.h"/>
6307 </headers>
6308 <synopsis>
6309 The &lt;CODE&gt;ntp_gettime&lt;/CODE&gt; function sets the structure pointed to by
6310 &lt;VAR&gt;tptr&lt;/VAR&gt; to current values. The elements of the structure afterwards
6311 contain the values the timer implementation in the kernel assumes. They
6312 might or might not be correct. If they are not a &lt;CODE&gt;ntp_adjtime&lt;/CODE&gt;
6313 call is necessary.
6314 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and other values on failure. The
6315 following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
6316 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
6317
6318 &lt;DT&gt;&lt;CODE&gt;TIME_ERROR&lt;/CODE&gt;
6319 &lt;DD&gt;
6320 The precision clock model is not properly set up at the moment, thus the
6321 clock must be considered unsynchronized, and the values should be
6322 treated with care.
6323
6324 </synopsis>
6325 </function>
6326 </construct>
6327 <construct id="struct-timex" type="struct">
6328 <structure>
6329 <synopsis>
6330 This structure is used to control and monitor the system clock. It
6331 contains the following members:
6332 </synopsis>
6333 <elements>
6334 <element content="unsigned int modes">
6335 <synopsis>
6336 This variable controls whether and which values are set. Several
6337 symbolic constants have to be combined with &lt;EM&gt;binary or&lt;/EM&gt; to specify
6338 the effective mode. These constants start with &lt;CODE&gt;MOD_&lt;/CODE&gt;.
6339 &lt;br&gt;&lt;br&gt;
6340 </synopsis>
6341 </element>
6342 <element content="long int offset">
6343 <synopsis>
6344 This value indicates the current offset of the system clock from the true
6345 calendar time. The value is given in microseconds. If bit
6346 &lt;CODE&gt;MOD_OFFSET&lt;/CODE&gt; is set in &lt;CODE&gt;modes&lt;/CODE&gt;, the offset (and possibly other
6347 dependent values) can be set. The offset's absolute value must not
6348 exceed &lt;CODE&gt;MAXPHASE&lt;/CODE&gt;.
6349 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt;
6350 </synopsis>
6351 </element>
6352 <element content="long int frequency">
6353 <synopsis>
6354 This value indicates the difference in frequency between the true
6355 calendar time and the system clock. The value is expressed as scaled
6356 PPM (parts per million, 0.0001%). The scaling is &lt;CODE&gt;1 &lt;&lt;
6357 SHIFT_USEC&lt;/CODE&gt;. The value can be set with bit &lt;CODE&gt;MOD_FREQUENCY&lt;/CODE&gt;, but
6358 the absolute value must not exceed &lt;CODE&gt;MAXFREQ&lt;/CODE&gt;.
6359 &lt;br&gt;&lt;br&gt;
6360 </synopsis>
6361 </element>
6362 <element content="long int maxerror">
6363 <synopsis>
6364 This is the maximum error, measured in microseconds. A new value can be
6365 set using bit &lt;CODE&gt;MOD_MAXERROR&lt;/CODE&gt;. Unless updated via
6366 &lt;CODE&gt;ntp_adjtime&lt;/CODE&gt; periodically, this value will increase steadily
6367 and reach some platform-specific maximum value.
6368 &lt;br&gt;&lt;br&gt;
6369 </synopsis>
6370 </element>
6371 <element content="long int esterror">
6372 <synopsis>
6373 This is the estimated error, measured in microseconds. This value can
6374 be set using bit &lt;CODE&gt;MOD_ESTERROR&lt;/CODE&gt;.
6375 &lt;br&gt;&lt;br&gt;
6376 </synopsis>
6377 </element>
6378 <element content="int status">
6379 <synopsis>
6380 This variable reflects the various states of the clock machinery. There
6381 are symbolic constants for the significant bits, starting with
6382 &lt;CODE&gt;STA_&lt;/CODE&gt;. Some of these flags can be updated using the
6383 &lt;CODE&gt;MOD_STATUS&lt;/CODE&gt; bit.
6384 &lt;br&gt;&lt;br&gt;
6385 </synopsis>
6386 </element>
6387 <element content="long int constant">
6388 <synopsis>
6389 This value represents the bandwidth or stiffness of the PLL (phase
6390 locked loop) implemented in the kernel. The value can be changed using
6391 bit &lt;CODE&gt;MOD_TIMECONST&lt;/CODE&gt;.
6392 &lt;br&gt;&lt;br&gt;
6393 </synopsis>
6394 </element>
6395 <element content="long int precision">
6396 <synopsis>
6397 This value represents the accuracy or the maximum error when reading the
6398 system clock. The value is expressed in microseconds.
6399 &lt;br&gt;&lt;br&gt;
6400 </synopsis>
6401 </element>
6402 <element content="long int tolerance">
6403 <synopsis>
6404 This value represents the maximum frequency error of the system clock in
6405 scaled PPM. This value is used to increase the &lt;CODE&gt;maxerror&lt;/CODE&gt; every
6406 second.
6407 &lt;br&gt;&lt;br&gt;
6408 </synopsis>
6409 </element>
6410 <element content="struct timeval time">
6411 <synopsis>
6412 The current calendar time.
6413 &lt;br&gt;&lt;br&gt;
6414 </synopsis>
6415 </element>
6416 <element content="long int tick">
6417 <synopsis>
6418 The elapsed time between clock ticks in microseconds. A clock tick is a
6419 periodic timer interrupt on which the system clock is based.
6420 &lt;br&gt;&lt;br&gt;
6421 </synopsis>
6422 </element>
6423 <element content="long int ppsfreq">
6424 <synopsis>
6425 This is the first of a few optional variables that are present only if
6426 the system clock can use a PPS (pulse per second) signal to discipline
6427 the system clock. The value is expressed in scaled PPM and it denotes
6428 the difference in frequency between the system clock and the PPS signal.
6429 &lt;br&gt;&lt;br&gt;
6430 </synopsis>
6431 </element>
6432 <element content="long int jitter">
6433 <synopsis>
6434 This value expresses a median filtered average of the PPS signal's
6435 dispersion in microseconds.
6436 &lt;br&gt;&lt;br&gt;
6437 </synopsis>
6438 </element>
6439 <element content="int shift">
6440 <synopsis>
6441 This value is a binary exponent for the duration of the PPS calibration
6442 interval, ranging from &lt;CODE&gt;PPS_SHIFT&lt;/CODE&gt; to &lt;CODE&gt;PPS_SHIFTMAX&lt;/CODE&gt;.
6443 &lt;br&gt;&lt;br&gt;
6444 </synopsis>
6445 </element>
6446 <element content="long int stabil">
6447 <synopsis>
6448 This value represents the median filtered dispersion of the PPS
6449 frequency in scaled PPM.
6450 &lt;br&gt;&lt;br&gt;
6451 </synopsis>
6452 </element>
6453 <element content="long int jitcnt">
6454 <synopsis>
6455 This counter represents the number of pulses where the jitter exceeded
6456 the allowed maximum &lt;CODE&gt;MAXTIME&lt;/CODE&gt;.
6457 &lt;br&gt;&lt;br&gt;
6458 </synopsis>
6459 </element>
6460 <element content="long int calcnt">
6461 <synopsis>
6462 This counter reflects the number of successful calibration intervals.
6463 &lt;br&gt;&lt;br&gt;
6464 </synopsis>
6465 </element>
6466 <element content="long int errcnt">
6467 <synopsis>
6468 This counter represents the number of calibration errors (caused by
6469 large offsets or jitter).
6470 &lt;br&gt;&lt;br&gt;
6471 </synopsis>
6472 </element>
6473 </elements>
6474 </structure>
6475 </construct>
6476 <construct id="function-ntp_adjtime" type="function">
6477 <function returntype="int">
6478 <prototype>
6479 <parameter content="struct timex *tptr"/>
6480 </prototype>
6481 <headers>
6482 <header filename = "sys/timex.h"/>
6483 </headers>
6484 <synopsis>
6485 The &lt;CODE&gt;ntp_adjtime&lt;/CODE&gt; function sets the structure specified by
6486 &lt;VAR&gt;tptr&lt;/VAR&gt; to current values.
6487 &lt;br&gt;&lt;br&gt; In addition, &lt;CODE&gt;ntp_adjtime&lt;/CODE&gt; updates some settings to match what you
6488 pass to it in *&lt;VAR&gt;tptr&lt;/VAR&gt;. Use the &lt;CODE&gt;modes&lt;/CODE&gt; element of *&lt;VAR&gt;tptr&lt;/VAR&gt;
6489 to select what settings to update. You can set &lt;CODE&gt;offset&lt;/CODE&gt;,
6490 &lt;CODE&gt;freq&lt;/CODE&gt;, &lt;CODE&gt;maxerror&lt;/CODE&gt;, &lt;CODE&gt;esterror&lt;/CODE&gt;, &lt;CODE&gt;status&lt;/CODE&gt;,
6491 &lt;CODE&gt;constant&lt;/CODE&gt;, and &lt;CODE&gt;tick&lt;/CODE&gt;.
6492 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;modes&lt;/CODE&gt; = zero means set nothing.
6493 &lt;br&gt;&lt;br&gt; Only the superuser can update settings.
6494 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and other values on failure. The
6495 following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
6496 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
6497
6498 &lt;DT&gt;&lt;CODE&gt;TIME_ERROR&lt;/CODE&gt;
6499 &lt;DD&gt;
6500 The high accuracy clock model is not properly set up at the moment, thus the
6501 clock must be considered unsynchronized, and the values should be
6502 treated with care. Another reason could be that the specified new values
6503 are not allowed.
6504 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EPERM
6505 The process specified a settings update, but is not superuser.
6506 &lt;br&gt;&lt;br&gt;
6507 &lt;br&gt;&lt;br&gt; For more details see RFC1305 (Network Time Protocol, Version 3) and
6508 related documents.
6509 &lt;br&gt;&lt;br&gt; Portability note: Early versions of the GNU C library did not
6510 have this function but did have the synonymous &lt;CODE&gt;adjtimex&lt;/CODE&gt;.
6511 &lt;br&gt;&lt;br&gt;
6512 </synopsis>
6513 </function>
6514 </construct>
6515 <construct id="function-asctime" type="function">
6516 <function returntype="char *">
6517 <prototype>
6518 <parameter content="const struct tm *brokentime"/>
6519 </prototype>
6520 <headers>
6521 <header filename = "time.h"/>
6522 </headers>
6523 <synopsis>
6524 The &lt;CODE&gt;asctime&lt;/CODE&gt; function converts the broken-down time value that
6525 &lt;VAR&gt;brokentime&lt;/VAR&gt; points to into a string in a standard format:
6526 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
6527 "Tue May 21 13:46:22 1991\n"&lt;br&gt;
6528 &lt;/pre&gt;
6529 &lt;br&gt;&lt;br&gt; The abbreviations for the days of week are: &lt;samp&gt;Sun&lt;/samp&gt;, &lt;samp&gt;Mon&lt;/samp&gt;,
6530 &lt;samp&gt;Tue&lt;/samp&gt;, &lt;samp&gt;Wed&lt;/samp&gt;, &lt;samp&gt;Thu&lt;/samp&gt;, &lt;samp&gt;Fri&lt;/samp&gt;, and &lt;samp&gt;Sat&lt;/samp&gt;.
6531 &lt;br&gt;&lt;br&gt; The abbreviations for the months are: &lt;samp&gt;Jan&lt;/samp&gt;, &lt;samp&gt;Feb&lt;/samp&gt;,
6532 &lt;samp&gt;Mar&lt;/samp&gt;, &lt;samp&gt;Apr&lt;/samp&gt;, &lt;samp&gt;May&lt;/samp&gt;, &lt;samp&gt;Jun&lt;/samp&gt;, &lt;samp&gt;Jul&lt;/samp&gt;, &lt;samp&gt;Aug&lt;/samp&gt;,
6533 &lt;samp&gt;Sep&lt;/samp&gt;, &lt;samp&gt;Oct&lt;/samp&gt;, &lt;samp&gt;Nov&lt;/samp&gt;, and &lt;samp&gt;Dec&lt;/samp&gt;.
6534 &lt;br&gt;&lt;br&gt; The return value points to a statically allocated string, which might be
6535 overwritten by subsequent calls to &lt;CODE&gt;asctime&lt;/CODE&gt; or &lt;CODE&gt;ctime&lt;/CODE&gt;.
6536 (But no other library function overwrites the contents of this
6537 string.)
6538 </synopsis>
6539 </function>
6540 </construct>
6541 <construct id="function-asctime_r" type="function">
6542 <function returntype="char *">
6543 <prototype>
6544 <parameter content="const struct tm *brokentime"/>
6545 <parameter content="char *buffer"/>
6546 </prototype>
6547 <headers>
6548 <header filename = "time.h"/>
6549 </headers>
6550 <synopsis>
6551 This function is similar to &lt;CODE&gt;asctime&lt;/CODE&gt; but instead of placing the
6552 result in a static buffer it writes the string in the buffer pointed to
6553 by the parameter &lt;VAR&gt;buffer&lt;/VAR&gt;. This buffer should have room
6554 for at least 26 bytes, including the terminating null.
6555 &lt;br&gt;&lt;br&gt; If no error occurred the function returns a pointer to the string the
6556 result was written into, i.e., it returns &lt;VAR&gt;buffer&lt;/VAR&gt;. Otherwise
6557 return &lt;CODE&gt;NULL&lt;/CODE&gt;.
6558 </synopsis>
6559 </function>
6560 </construct>
6561 <construct id="function-ctime" type="function">
6562 <function returntype="char *">
6563 <prototype>
6564 <parameter content="const time_t *time"/>
6565 </prototype>
6566 <headers>
6567 <header filename = "time.h"/>
6568 </headers>
6569 <synopsis>
6570 The &lt;CODE&gt;ctime&lt;/CODE&gt; function is similar to &lt;CODE&gt;asctime&lt;/CODE&gt;, except that you
6571 specify the calendar time argument as a &lt;CODE&gt;time_t&lt;/CODE&gt; simple time value
6572 rather than in broken-down local time format. It is equivalent to
6573 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
6574 asctime (localtime (&lt;VAR&gt;time&lt;/VAR&gt;))&lt;br&gt;
6575 &lt;/pre&gt;
6576 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;ctime&lt;/CODE&gt; sets the variable &lt;CODE&gt;tzname&lt;/CODE&gt;, because &lt;CODE&gt;localtime&lt;/CODE&gt;
6577 does so. .
6578 </synopsis>
6579 </function>
6580 </construct>
6581 <construct id="function-ctime_r" type="function">
6582 <function returntype="char *">
6583 <prototype>
6584 <parameter content="const time_t *time"/>
6585 <parameter content="char *buffer"/>
6586 </prototype>
6587 <headers>
6588 <header filename = "time.h"/>
6589 </headers>
6590 <synopsis>
6591 This function is similar to &lt;CODE&gt;ctime&lt;/CODE&gt;, but places the result in the
6592 string pointed to by &lt;VAR&gt;buffer&lt;/VAR&gt;. It is equivalent to (written using
6593 gcc extensions, ):
6594 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
6595 ({ struct tm tm; asctime_r (localtime_r (time, &amp;tm), buf); })&lt;br&gt;
6596 &lt;/pre&gt;
6597 &lt;br&gt;&lt;br&gt; If no error occurred the function returns a pointer to the string the
6598 result was written into, i.e., it returns &lt;VAR&gt;buffer&lt;/VAR&gt;. Otherwise
6599 return &lt;CODE&gt;NULL&lt;/CODE&gt;.
6600 </synopsis>
6601 </function>
6602 </construct>
6603 <construct id="function-strftime" type="function">
6604 <function returntype="size_t">
6605 <prototype>
6606 <parameter content="char *s"/>
6607 <parameter content="size_t size"/>
6608 <parameter content="const char *template"/>
6609 <parameter content="const struct tm *brokentime"/>
6610 </prototype>
6611 <headers>
6612 <header filename = "time.h"/>
6613 </headers>
6614 <synopsis>
6615 This function is similar to the &lt;CODE&gt;sprintf&lt;/CODE&gt; function , but the conversion specifications that can appear in the format
6616 template &lt;VAR&gt;template&lt;/VAR&gt; are specialized for printing components of the date
6617 and time &lt;VAR&gt;brokentime&lt;/VAR&gt; according to the locale currently specified for
6618 time conversion .
6619 &lt;br&gt;&lt;br&gt; Ordinary characters appearing in the &lt;VAR&gt;template&lt;/VAR&gt; are copied to the
6620 output string &lt;VAR&gt;s&lt;/VAR&gt;; this can include multibyte character sequences.
6621 Conversion specifiers are introduced by a &lt;samp&gt;%&lt;/samp&gt; character, followed
6622 by an optional flag which can be one of the following. These flags
6623 are all GNU extensions. The first three affect only the output of
6624 numbers:
6625 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
6626
6627 &lt;DT&gt;&lt;CODE&gt;_&lt;/CODE&gt;
6628 &lt;DD&gt;
6629 The number is padded with spaces.
6630 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;-&lt;/CODE&gt;
6631 &lt;DD&gt;
6632 The number is not padded at all.
6633 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;0&lt;/CODE&gt;
6634 &lt;DD&gt;
6635 The number is padded with zeros even if the format specifies padding
6636 with spaces.
6637 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ^
6638 The output uses uppercase characters, but only if this is possible
6639 .
6640
6641 &lt;br&gt;&lt;br&gt; The default action is to pad the number with zeros to keep it a constant
6642 width. Numbers that do not have a range indicated below are never
6643 padded, since there is no natural width for them.
6644 &lt;br&gt;&lt;br&gt; Following the flag an optional specification of the width is possible.
6645 This is specified in decimal notation. If the natural size of the
6646 output is of the field has less than the specified number of characters,
6647 the result is written right adjusted and space padded to the given
6648 size.
6649 &lt;br&gt;&lt;br&gt; An optional modifier can follow the optional flag and width
6650 specification. The modifiers, which were first standardized by
6651 POSIX.2-1992 and by ISO C99, are:
6652 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
6653
6654 &lt;LI&gt; E
6655 Use the locale's alternate representation for date and time. This
6656 modifier applies to the &lt;CODE&gt;%c&lt;/CODE&gt;, &lt;CODE&gt;%C&lt;/CODE&gt;, &lt;CODE&gt;%x&lt;/CODE&gt;, &lt;CODE&gt;%X&lt;/CODE&gt;,
6657 &lt;CODE&gt;%y&lt;/CODE&gt; and &lt;CODE&gt;%Y&lt;/CODE&gt; format specifiers. In a Japanese locale, for
6658 example, &lt;CODE&gt;%Ex&lt;/CODE&gt; might yield a date format based on the Japanese
6659 Emperors' reigns.
6660 &lt;br&gt;&lt;br&gt; &lt;LI&gt; O
6661 Use the locale's alternate numeric symbols for numbers. This modifier
6662 applies only to numeric format specifiers.
6663
6664 &lt;br&gt;&lt;br&gt; If the format supports the modifier but no alternate representation
6665 is available, it is ignored.
6666 &lt;br&gt;&lt;br&gt; The conversion specifier ends with a format specifier taken from the
6667 following list. The whole &lt;samp&gt;%&lt;/samp&gt; sequence is replaced in the output
6668 string as follows:
6669 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
6670
6671 &lt;LI&gt; %a
6672 The abbreviated weekday name according to the current locale.
6673 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %A
6674 The full weekday name according to the current locale.
6675 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %b
6676 The abbreviated month name according to the current locale.
6677 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %B
6678 The full month name according to the current locale.
6679 &lt;br&gt;&lt;br&gt; Using &lt;CODE&gt;%B&lt;/CODE&gt; together with &lt;CODE&gt;%d&lt;/CODE&gt; produces grammatically
6680 incorrect results for some locales.
6681 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %c
6682 The preferred calendar time representation for the current locale.
6683 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %C
6684 The century of the year. This is equivalent to the greatest integer not
6685 greater than the year divided by 100.
6686 &lt;br&gt;&lt;br&gt; This format was first standardized by POSIX.2-1992 and by ISO C99.
6687 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %d
6688 The day of the month as a decimal number (range &lt;CODE&gt;01&lt;/CODE&gt; through &lt;CODE&gt;31&lt;/CODE&gt;).
6689 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %D
6690 The date using the format &lt;CODE&gt;%m/%d/%y&lt;/CODE&gt;.
6691 &lt;br&gt;&lt;br&gt; This format was first standardized by POSIX.2-1992 and by ISO C99.
6692 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %e
6693 The day of the month like with &lt;CODE&gt;%d&lt;/CODE&gt;, but padded with blank (range
6694 &lt;CODE&gt; 1&lt;/CODE&gt; through &lt;CODE&gt;31&lt;/CODE&gt;).
6695 &lt;br&gt;&lt;br&gt; This format was first standardized by POSIX.2-1992 and by ISO C99.
6696 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %F
6697 The date using the format &lt;CODE&gt;%Y-%m-%d&lt;/CODE&gt;. This is the form specified
6698 in the ISO 8601 standard and is the preferred form for all uses.
6699 &lt;br&gt;&lt;br&gt; This format was first standardized by ISO C99 and by POSIX.1-2001.
6700 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %g
6701 The year corresponding to the ISO week number, but without the century
6702 (range &lt;CODE&gt;00&lt;/CODE&gt; through &lt;CODE&gt;99&lt;/CODE&gt;). This has the same format and value
6703 as &lt;CODE&gt;%y&lt;/CODE&gt;, except that if the ISO week number (see &lt;CODE&gt;%V&lt;/CODE&gt;) belongs
6704 to the previous or next year, that year is used instead.
6705 &lt;br&gt;&lt;br&gt; This format was first standardized by ISO C99 and by POSIX.1-2001.
6706 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %G
6707 The year corresponding to the ISO week number. This has the same format
6708 and value as &lt;CODE&gt;%Y&lt;/CODE&gt;, except that if the ISO week number (see
6709 &lt;CODE&gt;%V&lt;/CODE&gt;) belongs to the previous or next year, that year is used
6710 instead.
6711 &lt;br&gt;&lt;br&gt; This format was first standardized by ISO C99 and by POSIX.1-2001
6712 but was previously available as a GNU extension.
6713 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %h
6714 The abbreviated month name according to the current locale. The action
6715 is the same as for &lt;CODE&gt;%b&lt;/CODE&gt;.
6716 &lt;br&gt;&lt;br&gt; This format was first standardized by POSIX.2-1992 and by ISO C99.
6717 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %H
6718 The hour as a decimal number, using a 24-hour clock (range &lt;CODE&gt;00&lt;/CODE&gt; through
6719 &lt;CODE&gt;23&lt;/CODE&gt;).
6720 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %I
6721 The hour as a decimal number, using a 12-hour clock (range &lt;CODE&gt;01&lt;/CODE&gt; through
6722 &lt;CODE&gt;12&lt;/CODE&gt;).
6723 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %j
6724 The day of the year as a decimal number (range &lt;CODE&gt;001&lt;/CODE&gt; through &lt;CODE&gt;366&lt;/CODE&gt;).
6725 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %k
6726 The hour as a decimal number, using a 24-hour clock like &lt;CODE&gt;%H&lt;/CODE&gt;, but
6727 padded with blank (range &lt;CODE&gt; 0&lt;/CODE&gt; through &lt;CODE&gt;23&lt;/CODE&gt;).
6728 &lt;br&gt;&lt;br&gt; This format is a GNU extension.
6729 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %l
6730 The hour as a decimal number, using a 12-hour clock like &lt;CODE&gt;%I&lt;/CODE&gt;, but
6731 padded with blank (range &lt;CODE&gt; 1&lt;/CODE&gt; through &lt;CODE&gt;12&lt;/CODE&gt;).
6732 &lt;br&gt;&lt;br&gt; This format is a GNU extension.
6733 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %m
6734 The month as a decimal number (range &lt;CODE&gt;01&lt;/CODE&gt; through &lt;CODE&gt;12&lt;/CODE&gt;).
6735 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %M
6736 The minute as a decimal number (range &lt;CODE&gt;00&lt;/CODE&gt; through &lt;CODE&gt;59&lt;/CODE&gt;).
6737 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %n
6738 A single &lt;samp&gt;\n&lt;/samp&gt; (newline) character.
6739 &lt;br&gt;&lt;br&gt; This format was first standardized by POSIX.2-1992 and by ISO C99.
6740 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %p
6741 Either &lt;samp&gt;AM&lt;/samp&gt; or &lt;samp&gt;PM&lt;/samp&gt;, according to the given time value; or the
6742 corresponding strings for the current locale. Noon is treated as
6743 &lt;samp&gt;PM&lt;/samp&gt; and midnight as &lt;samp&gt;AM&lt;/samp&gt;. In most locales
6744 &lt;samp&gt;AM&lt;/samp&gt;/&lt;samp&gt;PM&lt;/samp&gt; format is not supported, in such cases &lt;CODE&gt;"%p"&lt;/CODE&gt;
6745 yields an empty string.
6746 &lt;br&gt;&lt;br&gt;
6747 &lt;LI&gt; %P
6748 Either &lt;samp&gt;am&lt;/samp&gt; or &lt;samp&gt;pm&lt;/samp&gt;, according to the given time value; or the
6749 corresponding strings for the current locale, printed in lowercase
6750 characters. Noon is treated as &lt;samp&gt;pm&lt;/samp&gt; and midnight as &lt;samp&gt;am&lt;/samp&gt;. In
6751 most locales &lt;samp&gt;AM&lt;/samp&gt;/&lt;samp&gt;PM&lt;/samp&gt; format is not supported, in such cases
6752 &lt;CODE&gt;"%P"&lt;/CODE&gt; yields an empty string.
6753 &lt;br&gt;&lt;br&gt; This format is a GNU extension.
6754 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %r
6755 The complete calendar time using the AM/PM format of the current locale.
6756 &lt;br&gt;&lt;br&gt; This format was first standardized by POSIX.2-1992 and by ISO C99.
6757 In the POSIX locale, this format is equivalent to &lt;CODE&gt;%I:%M:%S %p&lt;/CODE&gt;.
6758 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %R
6759 The hour and minute in decimal numbers using the format &lt;CODE&gt;%H:%M&lt;/CODE&gt;.
6760 &lt;br&gt;&lt;br&gt; This format was first standardized by ISO C99 and by POSIX.1-2001
6761 but was previously available as a GNU extension.
6762 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %s
6763 The number of seconds since the epoch, i.e., since 1970-01-01 00:00:00 UTC.
6764 Leap seconds are not counted unless leap second support is available.
6765 &lt;br&gt;&lt;br&gt; This format is a GNU extension.
6766 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %S
6767 The seconds as a decimal number (range &lt;CODE&gt;00&lt;/CODE&gt; through &lt;CODE&gt;60&lt;/CODE&gt;).
6768 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %t
6769 A single &lt;samp&gt;\t&lt;/samp&gt; (tabulator) character.
6770 &lt;br&gt;&lt;br&gt; This format was first standardized by POSIX.2-1992 and by ISO C99.
6771 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %T
6772 The time of day using decimal numbers using the format &lt;CODE&gt;%H:%M:%S&lt;/CODE&gt;.
6773 &lt;br&gt;&lt;br&gt; This format was first standardized by POSIX.2-1992 and by ISO C99.
6774 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %u
6775 The day of the week as a decimal number (range &lt;CODE&gt;1&lt;/CODE&gt; through
6776 &lt;CODE&gt;7&lt;/CODE&gt;), Monday being &lt;CODE&gt;1&lt;/CODE&gt;.
6777 &lt;br&gt;&lt;br&gt; This format was first standardized by POSIX.2-1992 and by ISO C99.
6778 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %U
6779 The week number of the current year as a decimal number (range &lt;CODE&gt;00&lt;/CODE&gt;
6780 through &lt;CODE&gt;53&lt;/CODE&gt;), starting with the first Sunday as the first day of
6781 the first week. Days preceding the first Sunday in the year are
6782 considered to be in week &lt;CODE&gt;00&lt;/CODE&gt;.
6783 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %V
6784 The ISO 8601:1988 week number as a decimal number (range &lt;CODE&gt;01&lt;/CODE&gt;
6785 through &lt;CODE&gt;53&lt;/CODE&gt;). ISO weeks start with Monday and end with Sunday.
6786 Week &lt;CODE&gt;01&lt;/CODE&gt; of a year is the first week which has the majority of its
6787 days in that year; this is equivalent to the week containing the year's
6788 first Thursday, and it is also equivalent to the week containing January
6789 4. Week &lt;CODE&gt;01&lt;/CODE&gt; of a year can contain days from the previous year.
6790 The week before week &lt;CODE&gt;01&lt;/CODE&gt; of a year is the last week (&lt;CODE&gt;52&lt;/CODE&gt; or
6791 &lt;CODE&gt;53&lt;/CODE&gt;) of the previous year even if it contains days from the new
6792 year.
6793 &lt;br&gt;&lt;br&gt; This format was first standardized by POSIX.2-1992 and by ISO C99.
6794 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %w
6795 The day of the week as a decimal number (range &lt;CODE&gt;0&lt;/CODE&gt; through
6796 &lt;CODE&gt;6&lt;/CODE&gt;), Sunday being &lt;CODE&gt;0&lt;/CODE&gt;.
6797 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %W
6798 The week number of the current year as a decimal number (range &lt;CODE&gt;00&lt;/CODE&gt;
6799 through &lt;CODE&gt;53&lt;/CODE&gt;), starting with the first Monday as the first day of
6800 the first week. All days preceding the first Monday in the year are
6801 considered to be in week &lt;CODE&gt;00&lt;/CODE&gt;.
6802 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %x
6803 The preferred date representation for the current locale.
6804 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %X
6805 The preferred time of day representation for the current locale.
6806 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %y
6807 The year without a century as a decimal number (range &lt;CODE&gt;00&lt;/CODE&gt; through
6808 &lt;CODE&gt;99&lt;/CODE&gt;). This is equivalent to the year modulo 100.
6809 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %Y
6810 The year as a decimal number, using the Gregorian calendar. Years
6811 before the year &lt;CODE&gt;1&lt;/CODE&gt; are numbered &lt;CODE&gt;0&lt;/CODE&gt;, &lt;CODE&gt;-1&lt;/CODE&gt;, and so on.
6812 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %z
6813 RFC 822/ISO 8601:1988 style numeric time zone (e.g.,
6814 &lt;CODE&gt;-0600&lt;/CODE&gt; or &lt;CODE&gt;+0100&lt;/CODE&gt;), or nothing if no time zone is
6815 determinable.
6816 &lt;br&gt;&lt;br&gt; This format was first standardized by ISO C99 and by POSIX.1-2001
6817 but was previously available as a GNU extension.
6818 &lt;br&gt;&lt;br&gt; In the POSIX locale, a full RFC 822 timestamp is generated by the format
6819 &lt;samp&gt;"%a, %d %b %Y %H:%M:%S %z"&lt;/samp&gt; (or the equivalent
6820 &lt;samp&gt;"%a, %d %b %Y %T %z"&lt;/samp&gt;).
6821 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %Z
6822 The time zone abbreviation (empty if the time zone can't be determined).
6823 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %%
6824 A literal &lt;samp&gt;%&lt;/samp&gt; character.
6825
6826 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;size&lt;/VAR&gt; parameter can be used to specify the maximum number of
6827 characters to be stored in the array &lt;VAR&gt;s&lt;/VAR&gt;, including the terminating
6828 null character. If the formatted time requires more than &lt;VAR&gt;size&lt;/VAR&gt;
6829 characters, &lt;CODE&gt;strftime&lt;/CODE&gt; returns zero and the contents of the array
6830 &lt;VAR&gt;s&lt;/VAR&gt; are undefined. Otherwise the return value indicates the
6831 number of characters placed in the array &lt;VAR&gt;s&lt;/VAR&gt;, not including the
6832 terminating null character.
6833 &lt;br&gt;&lt;br&gt; &lt;EM&gt;Warning:&lt;/EM&gt; This convention for the return value which is prescribed
6834 in ISO C can lead to problems in some situations. For certain
6835 format strings and certain locales the output really can be the empty
6836 string and this cannot be discovered by testing the return value only.
6837 E.g., in most locales the AM/PM time format is not supported (most of
6838 the world uses the 24 hour time representation). In such locales
6839 &lt;CODE&gt;"%p"&lt;/CODE&gt; will return the empty string, i.e., the return value is
6840 zero. To detect situations like this something similar to the following
6841 code should be used:
6842 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
6843 buf[0] = '\1';&lt;br&gt;
6844 len = strftime (buf, bufsize, format, tp);&lt;br&gt;
6845 if (len == 0 &amp;&amp; buf[0] != '\0')&lt;br&gt;
6846 {&lt;br&gt;
6847 /* Something went wrong in the strftime call. */&lt;br&gt;
6848 &lt;small&gt;...&lt;/small&gt;&lt;br&gt;
6849 }&lt;br&gt;
6850 &lt;/pre&gt;
6851 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;s&lt;/VAR&gt; is a null pointer, &lt;CODE&gt;strftime&lt;/CODE&gt; does not actually write
6852 anything, but instead returns the number of characters it would have written.
6853 &lt;br&gt;&lt;br&gt; According to POSIX.1 every call to &lt;CODE&gt;strftime&lt;/CODE&gt; implies a call to
6854 &lt;CODE&gt;tzset&lt;/CODE&gt;. So the contents of the environment variable &lt;CODE&gt;TZ&lt;/CODE&gt;
6855 is examined before any output is produced.
6856 &lt;br&gt;&lt;br&gt; For an example of &lt;CODE&gt;strftime&lt;/CODE&gt;, see Time Functions Example.
6857 </synopsis>
6858 </function>
6859 </construct>
6860 <construct id="function-wcsftime" type="function">
6861 <function returntype="size_t">
6862 <prototype>
6863 <parameter content="wchar_t *s"/>
6864 <parameter content="size_t size"/>
6865 <parameter content="const wchar_t *template"/>
6866 <parameter content="const struct tm *brokentime"/>
6867 </prototype>
6868 <headers>
6869 <header filename = "time.h"/>
6870 </headers>
6871 <synopsis>
6872 The &lt;CODE&gt;wcsftime&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;strftime&lt;/CODE&gt;
6873 function with the difference that it operates on wide character
6874 strings. The buffer where the result is stored, pointed to by &lt;VAR&gt;s&lt;/VAR&gt;,
6875 must be an array of wide characters. The parameter &lt;VAR&gt;size&lt;/VAR&gt; which
6876 specifies the size of the output buffer gives the number of wide
6877 character, not the number of bytes.
6878 &lt;br&gt;&lt;br&gt; Also the format string &lt;VAR&gt;template&lt;/VAR&gt; is a wide character string. Since
6879 all characters needed to specify the format string are in the basic
6880 character set it is portably possible to write format strings in the C
6881 source code using the &lt;CODE&gt;L"&lt;small&gt;...&lt;/small&gt;"&lt;/CODE&gt; notation. The parameter
6882 &lt;VAR&gt;brokentime&lt;/VAR&gt; has the same meaning as in the &lt;CODE&gt;strftime&lt;/CODE&gt; call.
6883 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;wcsftime&lt;/CODE&gt; function supports the same flags, modifiers, and
6884 format specifiers as the &lt;CODE&gt;strftime&lt;/CODE&gt; function.
6885 &lt;br&gt;&lt;br&gt; The return value of &lt;CODE&gt;wcsftime&lt;/CODE&gt; is the number of wide characters
6886 stored in &lt;CODE&gt;s&lt;/CODE&gt;. When more characters would have to be written than
6887 can be placed in the buffer &lt;VAR&gt;s&lt;/VAR&gt; the return value is zero, with the
6888 same problems indicated in the &lt;CODE&gt;strftime&lt;/CODE&gt; documentation.
6889 </synopsis>
6890 </function>
6891 </construct>
6892 <construct id="function-strptime" type="function">
6893 <function returntype="char *">
6894 <prototype>
6895 <parameter content="const char *s"/>
6896 <parameter content="const char *fmt"/>
6897 <parameter content="struct tm *tp"/>
6898 </prototype>
6899 <headers>
6900 <header filename = "time.h"/>
6901 </headers>
6902 <synopsis>
6903 The &lt;CODE&gt;strptime&lt;/CODE&gt; function parses the input string &lt;VAR&gt;s&lt;/VAR&gt; according
6904 to the format string &lt;VAR&gt;fmt&lt;/VAR&gt; and stores its results in the
6905 structure &lt;VAR&gt;tp&lt;/VAR&gt;.
6906 &lt;br&gt;&lt;br&gt; The input string could be generated by a &lt;CODE&gt;strftime&lt;/CODE&gt; call or
6907 obtained any other way. It does not need to be in a human-recognizable
6908 format; e.g. a date passed as &lt;CODE&gt;"02:1999:9"&lt;/CODE&gt; is acceptable, even
6909 though it is ambiguous without context. As long as the format string
6910 &lt;VAR&gt;fmt&lt;/VAR&gt; matches the input string the function will succeed.
6911 &lt;br&gt;&lt;br&gt; The user has to make sure, though, that the input can be parsed in a
6912 unambiguous way. The string &lt;CODE&gt;"1999112"&lt;/CODE&gt; can be parsed using the
6913 format &lt;CODE&gt;"%Y%m%d"&lt;/CODE&gt; as 1999-1-12, 1999-11-2, or even 19991-1-2. It
6914 is necessary to add appropriate separators to reliably get results.
6915 &lt;br&gt;&lt;br&gt; The format string consists of the same components as the format string
6916 of the &lt;CODE&gt;strftime&lt;/CODE&gt; function. The only difference is that the flags
6917 &lt;CODE&gt;_&lt;/CODE&gt;, &lt;CODE&gt;-&lt;/CODE&gt;, &lt;CODE&gt;0&lt;/CODE&gt;, and &lt;CODE&gt;^&lt;/CODE&gt; are not allowed.
6918 Several of the distinct formats of &lt;CODE&gt;strftime&lt;/CODE&gt; do the same work in
6919 &lt;CODE&gt;strptime&lt;/CODE&gt; since differences like case of the input do not matter.
6920 For reasons of symmetry all formats are supported, though.
6921 &lt;br&gt;&lt;br&gt; The modifiers &lt;CODE&gt;E&lt;/CODE&gt; and &lt;CODE&gt;O&lt;/CODE&gt; are also allowed everywhere the
6922 &lt;CODE&gt;strftime&lt;/CODE&gt; function allows them.
6923 &lt;br&gt;&lt;br&gt; The formats are:
6924 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
6925
6926 &lt;DT&gt;&lt;CODE&gt;%a&lt;/CODE&gt;
6927 &lt;DD&gt;
6928 &lt;LI&gt;x %A
6929 The weekday name according to the current locale, in abbreviated form or
6930 the full name.
6931 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %b
6932 &lt;LI&gt;x %B
6933 &lt;LI&gt;x %h
6934 The month name according to the current locale, in abbreviated form or
6935 the full name.
6936 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %c
6937 The date and time representation for the current locale.
6938 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %Ec
6939 Like &lt;CODE&gt;%c&lt;/CODE&gt; but the locale's alternative date and time format is used.
6940 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %C
6941 The century of the year.
6942 &lt;br&gt;&lt;br&gt; It makes sense to use this format only if the format string also
6943 contains the &lt;CODE&gt;%y&lt;/CODE&gt; format.
6944 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %EC
6945 The locale's representation of the period.
6946 &lt;br&gt;&lt;br&gt; Unlike &lt;CODE&gt;%C&lt;/CODE&gt; it sometimes makes sense to use this format since some
6947 cultures represent years relative to the beginning of eras instead of
6948 using the Gregorian years.
6949 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %d
6950 &lt;LI&gt; %e
6951 The day of the month as a decimal number (range &lt;CODE&gt;1&lt;/CODE&gt; through &lt;CODE&gt;31&lt;/CODE&gt;).
6952 Leading zeroes are permitted but not required.
6953 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %Od
6954 &lt;LI&gt;x %Oe
6955 Same as &lt;CODE&gt;%d&lt;/CODE&gt; but using the locale's alternative numeric symbols.
6956 &lt;br&gt;&lt;br&gt; Leading zeroes are permitted but not required.
6957 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %D
6958 Equivalent to &lt;CODE&gt;%m/%d/%y&lt;/CODE&gt;.
6959 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %F
6960 Equivalent to &lt;CODE&gt;%Y-%m-%d&lt;/CODE&gt;, which is the ISO 8601 date
6961 format.
6962 &lt;br&gt;&lt;br&gt; This is a GNU extension following an ISO C99 extension to
6963 &lt;CODE&gt;strftime&lt;/CODE&gt;.
6964 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %g
6965 The year corresponding to the ISO week number, but without the century
6966 (range &lt;CODE&gt;00&lt;/CODE&gt; through &lt;CODE&gt;99&lt;/CODE&gt;).
6967 &lt;br&gt;&lt;br&gt; &lt;EM&gt;Note:&lt;/EM&gt; Currently, this is not fully implemented. The format is
6968 recognized, input is consumed but no field in &lt;VAR&gt;tm&lt;/VAR&gt; is set.
6969 &lt;br&gt;&lt;br&gt; This format is a GNU extension following a GNU extension of &lt;CODE&gt;strftime&lt;/CODE&gt;.
6970 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %G
6971 The year corresponding to the ISO week number.
6972 &lt;br&gt;&lt;br&gt; &lt;EM&gt;Note:&lt;/EM&gt; Currently, this is not fully implemented. The format is
6973 recognized, input is consumed but no field in &lt;VAR&gt;tm&lt;/VAR&gt; is set.
6974 &lt;br&gt;&lt;br&gt; This format is a GNU extension following a GNU extension of &lt;CODE&gt;strftime&lt;/CODE&gt;.
6975 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %H
6976 &lt;LI&gt;x %k
6977 The hour as a decimal number, using a 24-hour clock (range &lt;CODE&gt;00&lt;/CODE&gt; through
6978 &lt;CODE&gt;23&lt;/CODE&gt;).
6979 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;%k&lt;/CODE&gt; is a GNU extension following a GNU extension of &lt;CODE&gt;strftime&lt;/CODE&gt;.
6980 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %OH
6981 Same as &lt;CODE&gt;%H&lt;/CODE&gt; but using the locale's alternative numeric symbols.
6982 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %I
6983 &lt;LI&gt;x %l
6984 The hour as a decimal number, using a 12-hour clock (range &lt;CODE&gt;01&lt;/CODE&gt; through
6985 &lt;CODE&gt;12&lt;/CODE&gt;).
6986 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;%l&lt;/CODE&gt; is a GNU extension following a GNU extension of &lt;CODE&gt;strftime&lt;/CODE&gt;.
6987 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %OI
6988 Same as &lt;CODE&gt;%I&lt;/CODE&gt; but using the locale's alternative numeric symbols.
6989 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %j
6990 The day of the year as a decimal number (range &lt;CODE&gt;1&lt;/CODE&gt; through &lt;CODE&gt;366&lt;/CODE&gt;).
6991 &lt;br&gt;&lt;br&gt; Leading zeroes are permitted but not required.
6992 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %m
6993 The month as a decimal number (range &lt;CODE&gt;1&lt;/CODE&gt; through &lt;CODE&gt;12&lt;/CODE&gt;).
6994 &lt;br&gt;&lt;br&gt; Leading zeroes are permitted but not required.
6995 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %Om
6996 Same as &lt;CODE&gt;%m&lt;/CODE&gt; but using the locale's alternative numeric symbols.
6997 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %M
6998 The minute as a decimal number (range &lt;CODE&gt;0&lt;/CODE&gt; through &lt;CODE&gt;59&lt;/CODE&gt;).
6999 &lt;br&gt;&lt;br&gt; Leading zeroes are permitted but not required.
7000 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %OM
7001 Same as &lt;CODE&gt;%M&lt;/CODE&gt; but using the locale's alternative numeric symbols.
7002 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %n
7003 &lt;LI&gt;x %t
7004 Matches any white space.
7005 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %p
7006 &lt;LI&gt; %P
7007 The locale-dependent equivalent to &lt;samp&gt;AM&lt;/samp&gt; or &lt;samp&gt;PM&lt;/samp&gt;.
7008 &lt;br&gt;&lt;br&gt; This format is not useful unless &lt;CODE&gt;%I&lt;/CODE&gt; or &lt;CODE&gt;%l&lt;/CODE&gt; is also used.
7009 Another complication is that the locale might not define these values at
7010 all and therefore the conversion fails.
7011 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;%P&lt;/CODE&gt; is a GNU extension following a GNU extension to &lt;CODE&gt;strftime&lt;/CODE&gt;.
7012 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %r
7013 The complete time using the AM/PM format of the current locale.
7014 &lt;br&gt;&lt;br&gt; A complication is that the locale might not define this format at all
7015 and therefore the conversion fails.
7016 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %R
7017 The hour and minute in decimal numbers using the format &lt;CODE&gt;%H:%M&lt;/CODE&gt;.
7018 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;%R&lt;/CODE&gt; is a GNU extension following a GNU extension to &lt;CODE&gt;strftime&lt;/CODE&gt;.
7019 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %s
7020 The number of seconds since the epoch, i.e., since 1970-01-01 00:00:00 UTC.
7021 Leap seconds are not counted unless leap second support is available.
7022 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;%s&lt;/CODE&gt; is a GNU extension following a GNU extension to &lt;CODE&gt;strftime&lt;/CODE&gt;.
7023 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %S
7024 The seconds as a decimal number (range &lt;CODE&gt;0&lt;/CODE&gt; through &lt;CODE&gt;60&lt;/CODE&gt;).
7025 &lt;br&gt;&lt;br&gt; Leading zeroes are permitted but not required.
7026 &lt;br&gt;&lt;br&gt; NB: The Unix specification says the upper bound on this value
7027 is &lt;CODE&gt;61&lt;/CODE&gt;, a result of a decision to allow double leap seconds. You
7028 will not see the value &lt;CODE&gt;61&lt;/CODE&gt; because no minute has more than one
7029 leap second, but the myth persists.
7030 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %OS
7031 Same as &lt;CODE&gt;%S&lt;/CODE&gt; but using the locale's alternative numeric symbols.
7032 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %T
7033 Equivalent to the use of &lt;CODE&gt;%H:%M:%S&lt;/CODE&gt; in this place.
7034 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %u
7035 The day of the week as a decimal number (range &lt;CODE&gt;1&lt;/CODE&gt; through
7036 &lt;CODE&gt;7&lt;/CODE&gt;), Monday being &lt;CODE&gt;1&lt;/CODE&gt;.
7037 &lt;br&gt;&lt;br&gt; Leading zeroes are permitted but not required.
7038 &lt;br&gt;&lt;br&gt; &lt;EM&gt;Note:&lt;/EM&gt; Currently, this is not fully implemented. The format is
7039 recognized, input is consumed but no field in &lt;VAR&gt;tm&lt;/VAR&gt; is set.
7040 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %U
7041 The week number of the current year as a decimal number (range &lt;CODE&gt;0&lt;/CODE&gt;
7042 through &lt;CODE&gt;53&lt;/CODE&gt;).
7043 &lt;br&gt;&lt;br&gt; Leading zeroes are permitted but not required.
7044 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %OU
7045 Same as &lt;CODE&gt;%U&lt;/CODE&gt; but using the locale's alternative numeric symbols.
7046 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %V
7047 The ISO 8601:1988 week number as a decimal number (range &lt;CODE&gt;1&lt;/CODE&gt;
7048 through &lt;CODE&gt;53&lt;/CODE&gt;).
7049 &lt;br&gt;&lt;br&gt; Leading zeroes are permitted but not required.
7050 &lt;br&gt;&lt;br&gt; &lt;EM&gt;Note:&lt;/EM&gt; Currently, this is not fully implemented. The format is
7051 recognized, input is consumed but no field in &lt;VAR&gt;tm&lt;/VAR&gt; is set.
7052 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %w
7053 The day of the week as a decimal number (range &lt;CODE&gt;0&lt;/CODE&gt; through
7054 &lt;CODE&gt;6&lt;/CODE&gt;), Sunday being &lt;CODE&gt;0&lt;/CODE&gt;.
7055 &lt;br&gt;&lt;br&gt; Leading zeroes are permitted but not required.
7056 &lt;br&gt;&lt;br&gt; &lt;EM&gt;Note:&lt;/EM&gt; Currently, this is not fully implemented. The format is
7057 recognized, input is consumed but no field in &lt;VAR&gt;tm&lt;/VAR&gt; is set.
7058 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %Ow
7059 Same as &lt;CODE&gt;%w&lt;/CODE&gt; but using the locale's alternative numeric symbols.
7060 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %W
7061 The week number of the current year as a decimal number (range &lt;CODE&gt;0&lt;/CODE&gt;
7062 through &lt;CODE&gt;53&lt;/CODE&gt;).
7063 &lt;br&gt;&lt;br&gt; Leading zeroes are permitted but not required.
7064 &lt;br&gt;&lt;br&gt; &lt;EM&gt;Note:&lt;/EM&gt; Currently, this is not fully implemented. The format is
7065 recognized, input is consumed but no field in &lt;VAR&gt;tm&lt;/VAR&gt; is set.
7066 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %OW
7067 Same as &lt;CODE&gt;%W&lt;/CODE&gt; but using the locale's alternative numeric symbols.
7068 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %x
7069 The date using the locale's date format.
7070 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %Ex
7071 Like &lt;CODE&gt;%x&lt;/CODE&gt; but the locale's alternative data representation is used.
7072 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %X
7073 The time using the locale's time format.
7074 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %EX
7075 Like &lt;CODE&gt;%X&lt;/CODE&gt; but the locale's alternative time representation is used.
7076 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %y
7077 The year without a century as a decimal number (range &lt;CODE&gt;0&lt;/CODE&gt; through
7078 &lt;CODE&gt;99&lt;/CODE&gt;).
7079 &lt;br&gt;&lt;br&gt; Leading zeroes are permitted but not required.
7080 &lt;br&gt;&lt;br&gt; Note that it is questionable to use this format without
7081 the &lt;CODE&gt;%C&lt;/CODE&gt; format. The &lt;CODE&gt;strptime&lt;/CODE&gt; function does regard input
7082 values in the range 68 to 99 as the years 1969 to
7083 1999 and the values 0 to 68 as the years
7084 2000 to 2068. But maybe this heuristic fails for some
7085 input data.
7086 &lt;br&gt;&lt;br&gt; Therefore it is best to avoid &lt;CODE&gt;%y&lt;/CODE&gt; completely and use &lt;CODE&gt;%Y&lt;/CODE&gt;
7087 instead.
7088 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %Ey
7089 The offset from &lt;CODE&gt;%EC&lt;/CODE&gt; in the locale's alternative representation.
7090 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %Oy
7091 The offset of the year (from &lt;CODE&gt;%C&lt;/CODE&gt;) using the locale's alternative
7092 numeric symbols.
7093 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %Y
7094 The year as a decimal number, using the Gregorian calendar.
7095 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %EY
7096 The full alternative year representation.
7097 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %z
7098 The offset from GMT in ISO 8601/RFC822 format.
7099 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %Z
7100 The timezone name.
7101 &lt;br&gt;&lt;br&gt; &lt;EM&gt;Note:&lt;/EM&gt; Currently, this is not fully implemented. The format is
7102 recognized, input is consumed but no field in &lt;VAR&gt;tm&lt;/VAR&gt; is set.
7103 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %%
7104 A literal &lt;samp&gt;%&lt;/samp&gt; character.
7105
7106 &lt;br&gt;&lt;br&gt; All other characters in the format string must have a matching character
7107 in the input string. Exceptions are white spaces in the input string
7108 which can match zero or more whitespace characters in the format string.
7109 &lt;br&gt;&lt;br&gt; Portability Note: The XPG standard advises applications to use
7110 at least one whitespace character (as specified by &lt;CODE&gt;isspace&lt;/CODE&gt;) or
7111 other non-alphanumeric characters between any two conversion
7112 specifications. The GNU C Library does not have this limitation but
7113 other libraries might have trouble parsing formats like
7114 &lt;CODE&gt;"%d%m%Y%H%M%S"&lt;/CODE&gt;.
7115 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;strptime&lt;/CODE&gt; function processes the input string from right to
7116 left. Each of the three possible input elements (white space, literal,
7117 or format) are handled one after the other. If the input cannot be
7118 matched to the format string the function stops. The remainder of the
7119 format and input strings are not processed.
7120 &lt;br&gt;&lt;br&gt; The function returns a pointer to the first character it was unable to
7121 process. If the input string contains more characters than required by
7122 the format string the return value points right after the last consumed
7123 input character. If the whole input string is consumed the return value
7124 points to the &lt;CODE&gt;NULL&lt;/CODE&gt; byte at the end of the string. If an error
7125 occurs, i.e., &lt;CODE&gt;strptime&lt;/CODE&gt; fails to match all of the format string,
7126 the function returns &lt;CODE&gt;NULL&lt;/CODE&gt;.
7127 </synopsis>
7128 </function>
7129 </construct>
7130 <construct id="function-getdate" type="function">
7131 <function returntype="struct tm *">
7132 <prototype>
7133 <parameter content="const char *string"/>
7134 </prototype>
7135 <headers>
7136 <header filename = "time.h"/>
7137 </headers>
7138 <synopsis>
7139 The interface to &lt;CODE&gt;getdate&lt;/CODE&gt; is the simplest possible for a function
7140 to parse a string and return the value. &lt;VAR&gt;string&lt;/VAR&gt; is the input
7141 string and the result is returned in a statically-allocated variable.
7142 &lt;br&gt;&lt;br&gt; The details about how the string is processed are hidden from the user.
7143 In fact, they can be outside the control of the program. Which formats
7144 are recognized is controlled by the file named by the environment
7145 variable &lt;CODE&gt;DATEMSK&lt;/CODE&gt;. This file should contain
7146 lines of valid format strings which could be passed to &lt;CODE&gt;strptime&lt;/CODE&gt;.
7147 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;getdate&lt;/CODE&gt; function reads these format strings one after the
7148 other and tries to match the input string. The first line which
7149 completely matches the input string is used.
7150 &lt;br&gt;&lt;br&gt; Elements not initialized through the format string retain the values
7151 present at the time of the &lt;CODE&gt;getdate&lt;/CODE&gt; function call.
7152 &lt;br&gt;&lt;br&gt; The formats recognized by &lt;CODE&gt;getdate&lt;/CODE&gt; are the same as for
7153 &lt;CODE&gt;strptime&lt;/CODE&gt;. See above for an explanation. There are only a few
7154 extensions to the &lt;CODE&gt;strptime&lt;/CODE&gt; behavior:
7155 &lt;br&gt;&lt;br&gt; &lt;OL&gt;
7156 &lt;LI&gt;
7157 If the &lt;CODE&gt;%Z&lt;/CODE&gt; format is given the broken-down time is based on the
7158 current time of the timezone matched, not of the current timezone of the
7159 runtime environment.
7160 &lt;br&gt;&lt;br&gt; &lt;EM&gt;Note&lt;/EM&gt;: This is not implemented (currently). The problem is that
7161 timezone names are not unique. If a fixed timezone is assumed for a
7162 given string (say &lt;CODE&gt;EST&lt;/CODE&gt; meaning US East Coast time), then uses for
7163 countries other than the USA will fail. So far we have found no good
7164 solution to this.
7165 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
7166 If only the weekday is specified the selected day depends on the current
7167 date. If the current weekday is greater or equal to the &lt;CODE&gt;tm_wday&lt;/CODE&gt;
7168 value the current week's day is chosen, otherwise the day next week is chosen.
7169 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
7170 A similar heuristic is used when only the month is given and not the
7171 year. If the month is greater than or equal to the current month, then
7172 the current year is used. Otherwise it wraps to next year. The first
7173 day of the month is assumed if one is not explicitly specified.
7174 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
7175 The current hour, minute, and second are used if the appropriate value is
7176 not set through the format.
7177 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
7178 If no date is given tomorrow's date is used if the time is
7179 smaller than the current time. Otherwise today's date is taken.
7180 &lt;/OL&gt;
7181 &lt;br&gt;&lt;br&gt; It should be noted that the format in the template file need not only
7182 contain format elements. The following is a list of possible format
7183 strings (taken from the Unix standard):
7184 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
7185 %m&lt;br&gt;
7186 %A %B %d, %Y %H:%M:%S&lt;br&gt;
7187 %A&lt;br&gt;
7188 %B&lt;br&gt;
7189 %m/%d/%y %I %p&lt;br&gt;
7190 %d,%m,%Y %H:%M&lt;br&gt;
7191 at %A the %dst of %B in %Y&lt;br&gt;
7192 run job at %I %p,%B %dnd&lt;br&gt;
7193 %A den %d. %B %Y %H.%M Uhr&lt;br&gt;
7194 &lt;/pre&gt;
7195 &lt;br&gt;&lt;br&gt; As you can see, the template list can contain very specific strings like
7196 &lt;CODE&gt;run job at %I %p,%B %dnd&lt;/CODE&gt;. Using the above list of templates and
7197 assuming the current time is Mon Sep 22 12:19:47 EDT 1986 we can obtain the
7198 following results for the given input.
7199 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
7200 &lt;DT&gt;&lt;pre&gt;Input Match Result&lt;/pre&gt;
7201 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;Mon %a Mon Sep 22 12:19:47 EDT 1986&lt;/pre&gt;
7202 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;Sun %a Sun Sep 28 12:19:47 EDT 1986&lt;/pre&gt;
7203 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;Fri %a Fri Sep 26 12:19:47 EDT 1986&lt;/pre&gt;
7204 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;September %B Mon Sep 1 12:19:47 EDT 1986&lt;/pre&gt;
7205 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;January %B Thu Jan 1 12:19:47 EST 1987&lt;/pre&gt;
7206 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;December %B Mon Dec 1 12:19:47 EST 1986&lt;/pre&gt;
7207 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;Sep Mon %b %a Mon Sep 1 12:19:47 EDT 1986&lt;/pre&gt;
7208 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;Jan Fri %b %a Fri Jan 2 12:19:47 EST 1987&lt;/pre&gt;
7209 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;Dec Mon %b %a Mon Dec 1 12:19:47 EST 1986&lt;/pre&gt;
7210 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;Jan Wed 1989 %b %a %Y Wed Jan 4 12:19:47 EST 1989&lt;/pre&gt;
7211 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;Fri 9 %a %H Fri Sep 26 09:00:00 EDT 1986&lt;/pre&gt;
7212 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;Feb 10:30 %b %H:%S Sun Feb 1 10:00:30 EST 1987&lt;/pre&gt;
7213 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;10:30 %H:%M Tue Sep 23 10:30:00 EDT 1986&lt;/pre&gt;
7214 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;13:30 %H:%M Mon Sep 22 13:30:00 EDT 1986&lt;/pre&gt;
7215 &lt;DD&gt;&lt;br&gt; &lt;/DL&gt;
7216 &lt;br&gt;&lt;br&gt; The return value of the function is a pointer to a static variable of
7217 type &lt;CODE&gt;struct tm&lt;/CODE&gt;, or a null pointer if an error occurred. The
7218 result is only valid until the next &lt;CODE&gt;getdate&lt;/CODE&gt; call, making this
7219 function unusable in multi-threaded applications.
7220 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;errno&lt;/CODE&gt; variable is &lt;EM&gt;not&lt;/EM&gt; changed. Error conditions are
7221 stored in the global variable &lt;CODE&gt;getdate_err&lt;/CODE&gt;. See the
7222 description above for a list of the possible error values.
7223 &lt;br&gt;&lt;br&gt; &lt;EM&gt;Warning:&lt;/EM&gt; The &lt;CODE&gt;getdate&lt;/CODE&gt; function should &lt;EM&gt;never&lt;/EM&gt; be
7224 used in SUID-programs. The reason is obvious: using the
7225 &lt;CODE&gt;DATEMSK&lt;/CODE&gt; environment variable you can get the function to open
7226 any arbitrary file and chances are high that with some bogus input
7227 (such as a binary file) the program will crash.
7228 </synopsis>
7229 </function>
7230 </construct>
7231 <construct id="function-getdate_r" type="function">
7232 <function returntype="int">
7233 <prototype>
7234 <parameter content="const char *string"/>
7235 <parameter content="struct tm *tp"/>
7236 </prototype>
7237 <headers>
7238 <header filename = "time.h"/>
7239 </headers>
7240 <synopsis>
7241 The &lt;CODE&gt;getdate_r&lt;/CODE&gt; function is the reentrant counterpart of
7242 &lt;CODE&gt;getdate&lt;/CODE&gt;. It does not use the global variable &lt;CODE&gt;getdate_err&lt;/CODE&gt;
7243 to signal an error, but instead returns an error code. The same error
7244 codes as described in the &lt;CODE&gt;getdate_err&lt;/CODE&gt; documentation above are
7245 used, with 0 meaning success.
7246 &lt;br&gt;&lt;br&gt; Moreover, &lt;CODE&gt;getdate_r&lt;/CODE&gt; stores the broken-down time in the variable
7247 of type &lt;CODE&gt;struct tm&lt;/CODE&gt; pointed to by the second argument, rather than
7248 in a static variable.
7249 &lt;br&gt;&lt;br&gt; This function is not defined in the Unix standard. Nevertheless it is
7250 available on some other Unix systems as well.
7251 &lt;br&gt;&lt;br&gt; The warning against using &lt;CODE&gt;getdate&lt;/CODE&gt; in SUID-programs applies to
7252 &lt;CODE&gt;getdate_r&lt;/CODE&gt; as well.
7253 </synopsis>
7254 </function>
7255 </construct>
7256 <construct id="function-tzset" type="function">
7257 <function returntype="void">
7258 <prototype>
7259 <parameter content="void"/>
7260 </prototype>
7261 <headers>
7262 <header filename = "time.h"/>
7263 </headers>
7264 <synopsis>
7265 The &lt;CODE&gt;tzset&lt;/CODE&gt; function initializes the &lt;CODE&gt;tzname&lt;/CODE&gt; variable from
7266 the value of the &lt;CODE&gt;TZ&lt;/CODE&gt; environment variable. It is not usually
7267 necessary for your program to call this function, because it is called
7268 automatically when you use the other time conversion functions that
7269 depend on the time zone.
7270 </synopsis>
7271 </function>
7272 </construct>
7273 <construct id="struct-itimerval" type="struct">
7274 <structure>
7275 <synopsis>
7276 This structure is used to specify when a timer should expire. It contains
7277 the following members:
7278 </synopsis>
7279 <elements>
7280 <element content="struct timeval it_interval">
7281 <synopsis>
7282 This is the period between successive timer interrupts. If zero, the
7283 alarm will only be sent once.
7284 &lt;br&gt;&lt;br&gt;
7285 </synopsis>
7286 </element>
7287 </elements>
7288 </structure>
7289 </construct>
7290 <construct id="function-setitimer" type="function">
7291 <function returntype="int">
7292 <prototype>
7293 <parameter content="int which"/>
7294 <parameter content="struct itimerval *new"/>
7295 <parameter content="struct itimerval *old"/>
7296 </prototype>
7297 <headers>
7298 <header filename = "time.h"/>
7299 <header filename = "sys/time.h"/>
7300 </headers>
7301 <synopsis>
7302 The &lt;CODE&gt;setitimer&lt;/CODE&gt; function sets the timer specified by &lt;VAR&gt;which&lt;/VAR&gt;
7303 according to &lt;VAR&gt;new&lt;/VAR&gt;. The &lt;VAR&gt;which&lt;/VAR&gt; argument can have a value of
7304 &lt;CODE&gt;ITIMER_REAL&lt;/CODE&gt;, &lt;CODE&gt;ITIMER_VIRTUAL&lt;/CODE&gt;, or &lt;CODE&gt;ITIMER_PROF&lt;/CODE&gt;.
7305 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;old&lt;/VAR&gt; is not a null pointer, &lt;CODE&gt;setitimer&lt;/CODE&gt; returns information
7306 about any previous unexpired timer of the same kind in the structure it
7307 points to.
7308 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt; on failure. The
7309 following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
7310 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
7311
7312 &lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
7313 &lt;DD&gt;
7314 The timer period is too large.
7315
7316 </synopsis>
7317 </function>
7318 </construct>
7319 <construct id="function-getitimer" type="function">
7320 <function returntype="int">
7321 <prototype>
7322 <parameter content="int which"/>
7323 <parameter content="struct itimerval *old"/>
7324 </prototype>
7325 <headers>
7326 <header filename = "sys/time.h"/>
7327 </headers>
7328 <synopsis>
7329 The &lt;CODE&gt;getitimer&lt;/CODE&gt; function stores information about the timer specified
7330 by &lt;VAR&gt;which&lt;/VAR&gt; in the structure pointed at by &lt;VAR&gt;old&lt;/VAR&gt;.
7331 &lt;br&gt;&lt;br&gt; The return value and error conditions are the same as for &lt;CODE&gt;setitimer&lt;/CODE&gt;.
7332 </synopsis>
7333 </function>
7334 </construct>
7335 <construct id="function-alarm" type="function">
7336 <function returntype="unsigned int">
7337 <prototype>
7338 <parameter content="unsigned int seconds"/>
7339 </prototype>
7340 <headers>
7341 <header filename = "sys/time.h"/>
7342 <header filename = "unistd.h"/>
7343 </headers>
7344 <synopsis>
7345 The &lt;CODE&gt;alarm&lt;/CODE&gt; function sets the real-time timer to expire in
7346 &lt;VAR&gt;seconds&lt;/VAR&gt; seconds. If you want to cancel any existing alarm, you
7347 can do this by calling &lt;CODE&gt;alarm&lt;/CODE&gt; with a &lt;VAR&gt;seconds&lt;/VAR&gt; argument of
7348 zero.
7349 &lt;br&gt;&lt;br&gt; The return value indicates how many seconds remain before the previous
7350 alarm would have been sent. If there is no previous alarm, &lt;CODE&gt;alarm&lt;/CODE&gt;
7351 returns zero.
7352 </synopsis>
7353 </function>
7354 </construct>
7355 <construct id="function-sleep" type="function">
7356 <function returntype="unsigned int">
7357 <prototype>
7358 <parameter content="unsigned int seconds"/>
7359 </prototype>
7360 <headers>
7361 <header filename = "unistd.h"/>
7362 </headers>
7363 <synopsis>
7364 The &lt;CODE&gt;sleep&lt;/CODE&gt; function waits for &lt;VAR&gt;seconds&lt;/VAR&gt; or until a signal
7365 is delivered, whichever happens first.
7366 &lt;br&gt;&lt;br&gt; If &lt;CODE&gt;sleep&lt;/CODE&gt; function returns because the requested interval is over,
7367 it returns a value of zero. If it returns because of delivery of a
7368 signal, its return value is the remaining time in the sleep interval.
7369 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;sleep&lt;/CODE&gt; function is declared in &lt;TT&gt;unistd.h&lt;/TT&gt;.
7370 </synopsis>
7371 </function>
7372 </construct>
7373 <construct id="function-nanosleep" type="function">
7374 <function returntype="int">
7375 <prototype>
7376 <parameter content="const struct timespec *requested_time"/>
7377 <parameter content="struct timespec *remaining"/>
7378 </prototype>
7379 <headers>
7380 <header filename = "time.h"/>
7381 </headers>
7382 <synopsis>
7383 If resolution to seconds is not enough the &lt;CODE&gt;nanosleep&lt;/CODE&gt; function can
7384 be used. As the name suggests the sleep interval can be specified in
7385 nanoseconds. The actual elapsed time of the sleep interval might be
7386 longer since the system rounds the elapsed time you request up to the
7387 next integer multiple of the actual resolution the system can deliver.
7388 &lt;br&gt;&lt;br&gt; *&lt;CODE&gt;requested_time&lt;/CODE&gt; is the elapsed time of the interval you want to
7389 sleep.
7390 &lt;br&gt;&lt;br&gt; The function returns as *&lt;CODE&gt;remaining&lt;/CODE&gt; the elapsed time left in the
7391 interval for which you requested to sleep. If the interval completed
7392 without getting interrupted by a signal, this is zero.
7393 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;struct timespec&lt;/CODE&gt; is described in .
7394 &lt;br&gt;&lt;br&gt; If the function returns because the interval is over the return value is
7395 zero. If the function returns -1 the global variable &lt;VAR&gt;errno&lt;/VAR&gt;
7396 is set to the following values:
7397 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
7398
7399 &lt;DT&gt;&lt;CODE&gt;EINTR&lt;/CODE&gt;
7400 &lt;DD&gt;
7401 The call was interrupted because a signal was delivered to the thread.
7402 If the &lt;VAR&gt;remaining&lt;/VAR&gt; parameter is not the null pointer the structure
7403 pointed to by &lt;VAR&gt;remaining&lt;/VAR&gt; is updated to contain the remaining
7404 elapsed time.
7405 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
7406 The nanosecond value in the &lt;VAR&gt;requested_time&lt;/VAR&gt; parameter contains an
7407 illegal value. Either the value is negative or greater than or equal to
7408 1000 million.
7409
7410 &lt;br&gt;&lt;br&gt; This function is a cancellation point in multi-threaded programs. This
7411 is a problem if the thread allocates some resources (like memory, file
7412 descriptors, semaphores or whatever) at the time &lt;CODE&gt;nanosleep&lt;/CODE&gt; is
7413 called. If the thread gets canceled these resources stay allocated
7414 until the program ends. To avoid this calls to &lt;CODE&gt;nanosleep&lt;/CODE&gt; should
7415 be protected using cancellation handlers.
7416 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;nanosleep&lt;/CODE&gt; function is declared in &lt;TT&gt;time.h&lt;/TT&gt;.
7417 </synopsis>
7418 </function>
7419 </construct>
7420 <construct id="dtype-va_list" type="dtype">
7421 <structure>
7422 </structure>
7423 </construct>
7424 <construct id="dtype-ptrdiff_t" type="dtype">
7425 <structure>
7426 </structure>
7427 </construct>
7428 <construct id="dtype-size_t" type="dtype">
7429 <structure>
7430 </structure>
7431 </construct>
7432 <construct id="function-system" type="function">
7433 <function returntype="int">
7434 <prototype>
7435 <parameter content="const char *command"/>
7436 </prototype>
7437 <headers>
7438 <header filename = "stdlib.h"/>
7439 </headers>
7440 <synopsis>
7441 This function executes &lt;VAR&gt;command&lt;/VAR&gt; as a shell command. In the GNU C
7442 library, it always uses the default shell &lt;CODE&gt;sh&lt;/CODE&gt; to run the command.
7443 In particular, it searches the directories in &lt;CODE&gt;PATH&lt;/CODE&gt; to find
7444 programs to execute. The return value is &lt;CODE&gt;-1&lt;/CODE&gt; if it wasn't
7445 possible to create the shell process, and otherwise is the status of the
7446 shell process. , for details on how this
7447 status code can be interpreted.
7448 &lt;br&gt;&lt;br&gt; If the &lt;VAR&gt;command&lt;/VAR&gt; argument is a null pointer, a return value of zero
7449 indicates that no command processor is available.
7450 &lt;br&gt;&lt;br&gt; This function is a cancellation point in multi-threaded programs. This
7451 is a problem if the thread allocates some resources (like memory, file
7452 descriptors, semaphores or whatever) at the time &lt;CODE&gt;system&lt;/CODE&gt; is
7453 called. If the thread gets canceled these resources stay allocated
7454 until the program ends. To avoid this calls to &lt;CODE&gt;system&lt;/CODE&gt; should be
7455 protected using cancellation handlers.
7456 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;system&lt;/CODE&gt; function is declared in the header file
7457 &lt;TT&gt;stdlib.h&lt;/TT&gt;.
7458 </synopsis>
7459 </function>
7460 </construct>
7461 <construct id="dtype-pid_t" type="dtype">
7462 <structure>
7463 </structure>
7464 </construct>
7465 <construct id="function-getpid" type="function">
7466 <function returntype="pid_t">
7467 <prototype>
7468 <parameter content="void"/>
7469 </prototype>
7470 <headers>
7471 <header filename = "sys/types.h"/>
7472 <header filename = "unistd.h"/>
7473 </headers>
7474 <synopsis>
7475 The &lt;CODE&gt;getpid&lt;/CODE&gt; function returns the process ID of the current process.
7476 </synopsis>
7477 </function>
7478 </construct>
7479 <construct id="function-getppid" type="function">
7480 <function returntype="pid_t">
7481 <prototype>
7482 <parameter content="void"/>
7483 </prototype>
7484 <headers>
7485 <header filename = "unistd.h"/>
7486 </headers>
7487 <synopsis>
7488 The &lt;CODE&gt;getppid&lt;/CODE&gt; function returns the process ID of the parent of the
7489 current process.
7490 </synopsis>
7491 </function>
7492 </construct>
7493 <construct id="function-fork" type="function">
7494 <function returntype="pid_t">
7495 <prototype>
7496 <parameter content="void"/>
7497 </prototype>
7498 <headers>
7499 <header filename = "unistd.h"/>
7500 </headers>
7501 <synopsis>
7502 The &lt;CODE&gt;fork&lt;/CODE&gt; function creates a new process.
7503 &lt;br&gt;&lt;br&gt; If the operation is successful, there are then both parent and child
7504 processes and both see &lt;CODE&gt;fork&lt;/CODE&gt; return, but with different values: it
7505 returns a value of &lt;CODE&gt;0&lt;/CODE&gt; in the child process and returns the child's
7506 process ID in the parent process.
7507 &lt;br&gt;&lt;br&gt; If process creation failed, &lt;CODE&gt;fork&lt;/CODE&gt; returns a value of &lt;CODE&gt;-1&lt;/CODE&gt; in
7508 the parent process. The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are
7509 defined for &lt;CODE&gt;fork&lt;/CODE&gt;:
7510 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
7511
7512 &lt;DT&gt;&lt;CODE&gt;EAGAIN&lt;/CODE&gt;
7513 &lt;DD&gt;
7514 There aren't enough system resources to create another process, or the
7515 user already has too many processes running. This means exceeding the
7516 &lt;CODE&gt;RLIMIT_NPROC&lt;/CODE&gt; resource limit, which can usually be increased;
7517 .
7518 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOMEM
7519 The process requires more space than the system can supply.
7520
7521 </synopsis>
7522 </function>
7523 </construct>
7524 <construct id="function-vfork" type="function">
7525 <function returntype="pid_t">
7526 <prototype>
7527 <parameter content="void"/>
7528 </prototype>
7529 <headers>
7530 <header filename = "unistd.h"/>
7531 </headers>
7532 <synopsis>
7533 The &lt;CODE&gt;vfork&lt;/CODE&gt; function is similar to &lt;CODE&gt;fork&lt;/CODE&gt; but on some systems
7534 it is more efficient; however, there are restrictions you must follow to
7535 use it safely.
7536 &lt;br&gt;&lt;br&gt; While &lt;CODE&gt;fork&lt;/CODE&gt; makes a complete copy of the calling process's address
7537 space and allows both the parent and child to execute independently,
7538 &lt;CODE&gt;vfork&lt;/CODE&gt; does not make this copy. Instead, the child process
7539 created with &lt;CODE&gt;vfork&lt;/CODE&gt; shares its parent's address space until it
7540 calls &lt;CODE&gt;_exit&lt;/CODE&gt; or one of the &lt;CODE&gt;exec&lt;/CODE&gt; functions. In the
7541 meantime, the parent process suspends execution.
7542 &lt;br&gt;&lt;br&gt; You must be very careful not to allow the child process created with
7543 &lt;CODE&gt;vfork&lt;/CODE&gt; to modify any global data or even local variables shared
7544 with the parent. Furthermore, the child process cannot return from (or
7545 do a long jump out of) the function that called &lt;CODE&gt;vfork&lt;/CODE&gt;! This
7546 would leave the parent process's control information very confused. If
7547 in doubt, use &lt;CODE&gt;fork&lt;/CODE&gt; instead.
7548 &lt;br&gt;&lt;br&gt; Some operating systems don't really implement &lt;CODE&gt;vfork&lt;/CODE&gt;. The GNU C
7549 library permits you to use &lt;CODE&gt;vfork&lt;/CODE&gt; on all systems, but actually
7550 executes &lt;CODE&gt;fork&lt;/CODE&gt; if &lt;CODE&gt;vfork&lt;/CODE&gt; isn't available. If you follow
7551 the proper precautions for using &lt;CODE&gt;vfork&lt;/CODE&gt;, your program will still
7552 work even if the system uses &lt;CODE&gt;fork&lt;/CODE&gt; instead.
7553 </synopsis>
7554 </function>
7555 </construct>
7556 <construct id="function-execv" type="function">
7557 <function returntype="int">
7558 <prototype>
7559 <parameter content="const char *filename"/>
7560 <parameter content="char *const argv[]"/>
7561 </prototype>
7562 <headers>
7563 <header filename = "unistd.h"/>
7564 </headers>
7565 <synopsis>
7566 The &lt;CODE&gt;execv&lt;/CODE&gt; function executes the file named by &lt;VAR&gt;filename&lt;/VAR&gt; as a
7567 new process image.
7568 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;argv&lt;/VAR&gt; argument is an array of null-terminated strings that is
7569 used to provide a value for the &lt;CODE&gt;argv&lt;/CODE&gt; argument to the &lt;CODE&gt;main&lt;/CODE&gt;
7570 function of the program to be executed. The last element of this array
7571 must be a null pointer. By convention, the first element of this array
7572 is the file name of the program sans directory names. , for full details on how programs can access these arguments.
7573 &lt;br&gt;&lt;br&gt; The environment for the new process image is taken from the
7574 &lt;CODE&gt;environ&lt;/CODE&gt; variable of the current process image; see
7575 Environment Variables, for information about environments.
7576 </synopsis>
7577 </function>
7578 </construct>
7579 <construct id="function-execl" type="function">
7580 <function returntype="int">
7581 <prototype>
7582 <parameter content="const char *filename"/>
7583 <parameter content="const char *arg0"/>
7584 <parameter content="..."/>
7585 </prototype>
7586 <headers>
7587 <header filename = "unistd.h"/>
7588 </headers>
7589 <synopsis>
7590 This is similar to &lt;CODE&gt;execv&lt;/CODE&gt;, but the &lt;VAR&gt;argv&lt;/VAR&gt; strings are
7591 specified individually instead of as an array. A null pointer must be
7592 passed as the last such argument.
7593 </synopsis>
7594 </function>
7595 </construct>
7596 <construct id="function-execve" type="function">
7597 <function returntype="int">
7598 <prototype>
7599 <parameter content="const char *filename"/>
7600 <parameter content="char *const argv[]"/>
7601 <parameter content="char *const env[]"/>
7602 </prototype>
7603 <headers>
7604 <header filename = "unistd.h"/>
7605 </headers>
7606 <synopsis>
7607 This is similar to &lt;CODE&gt;execv&lt;/CODE&gt;, but permits you to specify the environment
7608 for the new program explicitly as the &lt;VAR&gt;env&lt;/VAR&gt; argument. This should
7609 be an array of strings in the same format as for the &lt;CODE&gt;environ&lt;/CODE&gt;
7610 variable; see Environment Access.
7611 </synopsis>
7612 </function>
7613 </construct>
7614 <construct id="function-execle" type="function">
7615 <function returntype="int">
7616 <prototype>
7617 <parameter content="const char *filename"/>
7618 <parameter content="const char *arg0"/>
7619 <parameter content="char *const env[]"/>
7620 <parameter content="..."/>
7621 </prototype>
7622 <headers>
7623 <header filename = "unistd.h"/>
7624 </headers>
7625 <synopsis>
7626 This is similar to &lt;CODE&gt;execl&lt;/CODE&gt;, but permits you to specify the
7627 environment for the new program explicitly. The environment argument is
7628 passed following the null pointer that marks the last &lt;VAR&gt;argv&lt;/VAR&gt;
7629 argument, and should be an array of strings in the same format as for
7630 the &lt;CODE&gt;environ&lt;/CODE&gt; variable.
7631 </synopsis>
7632 </function>
7633 </construct>
7634 <construct id="function-execvp" type="function">
7635 <function returntype="int">
7636 <prototype>
7637 <parameter content="const char *filename"/>
7638 <parameter content="char *const argv[]"/>
7639 </prototype>
7640 <headers>
7641 <header filename = "unistd.h"/>
7642 </headers>
7643 <synopsis>
7644 The &lt;CODE&gt;execvp&lt;/CODE&gt; function is similar to &lt;CODE&gt;execv&lt;/CODE&gt;, except that it
7645 searches the directories listed in the &lt;CODE&gt;PATH&lt;/CODE&gt; environment variable
7646 to find the full file name of a
7647 file from &lt;VAR&gt;filename&lt;/VAR&gt; if &lt;VAR&gt;filename&lt;/VAR&gt; does not contain a slash.
7648 &lt;br&gt;&lt;br&gt; This function is useful for executing system utility programs, because
7649 it looks for them in the places that the user has chosen. Shells use it
7650 to run the commands that users type.
7651 </synopsis>
7652 </function>
7653 </construct>
7654 <construct id="function-execlp" type="function">
7655 <function returntype="int">
7656 <prototype>
7657 <parameter content="const char *filename"/>
7658 <parameter content="const char *arg0"/>
7659 <parameter content="..."/>
7660 </prototype>
7661 <headers>
7662 <header filename = "unistd.h"/>
7663 </headers>
7664 <synopsis>
7665 This function is like &lt;CODE&gt;execl&lt;/CODE&gt;, except that it performs the same
7666 file name searching as the &lt;CODE&gt;execvp&lt;/CODE&gt; function.
7667 </synopsis>
7668 </function>
7669 </construct>
7670 <construct id="function-waitpid" type="function">
7671 <function returntype="pid_t">
7672 <prototype>
7673 <parameter content="pid_t pid"/>
7674 <parameter content="int *status-ptr"/>
7675 <parameter content="int options"/>
7676 </prototype>
7677 <headers>
7678 <header filename = "sys/wait.h"/>
7679 </headers>
7680 <synopsis>
7681 The &lt;CODE&gt;waitpid&lt;/CODE&gt; function is used to request status information from a
7682 child process whose process ID is &lt;VAR&gt;pid&lt;/VAR&gt;. Normally, the calling
7683 process is suspended until the child process makes status information
7684 available by terminating.
7685 &lt;br&gt;&lt;br&gt; Other values for the &lt;VAR&gt;pid&lt;/VAR&gt; argument have special interpretations. A
7686 value of &lt;CODE&gt;-1&lt;/CODE&gt; or &lt;CODE&gt;WAIT_ANY&lt;/CODE&gt; requests status information for
7687 any child process; a value of &lt;CODE&gt;0&lt;/CODE&gt; or &lt;CODE&gt;WAIT_MYPGRP&lt;/CODE&gt; requests
7688 information for any child process in the same process group as the
7689 calling process; and any other negative value &lt;VAR&gt;pgid&lt;/VAR&gt;
7690 requests information for any child process whose process group ID is
7691 &lt;VAR&gt;pgid&lt;/VAR&gt;.
7692 &lt;br&gt;&lt;br&gt; If status information for a child process is available immediately, this
7693 function returns immediately without waiting. If more than one eligible
7694 child process has status information available, one of them is chosen
7695 randomly, and its status is returned immediately. To get the status
7696 from the other eligible child processes, you need to call &lt;CODE&gt;waitpid&lt;/CODE&gt;
7697 again.
7698 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;options&lt;/VAR&gt; argument is a bit mask. Its value should be the
7699 bitwise OR (that is, the &lt;samp&gt;|&lt;/samp&gt; operator) of zero or more of the
7700 &lt;CODE&gt;WNOHANG&lt;/CODE&gt; and &lt;CODE&gt;WUNTRACED&lt;/CODE&gt; flags. You can use the
7701 &lt;CODE&gt;WNOHANG&lt;/CODE&gt; flag to indicate that the parent process shouldn't wait;
7702 and the &lt;CODE&gt;WUNTRACED&lt;/CODE&gt; flag to request status information from stopped
7703 processes as well as processes that have terminated.
7704 &lt;br&gt;&lt;br&gt; The status information from the child process is stored in the object
7705 that &lt;VAR&gt;status-ptr&lt;/VAR&gt; points to, unless &lt;VAR&gt;status-ptr&lt;/VAR&gt; is a null pointer.
7706 &lt;br&gt;&lt;br&gt; This function is a cancellation point in multi-threaded programs. This
7707 is a problem if the thread allocates some resources (like memory, file
7708 descriptors, semaphores or whatever) at the time &lt;CODE&gt;waitpid&lt;/CODE&gt; is
7709 called. If the thread gets canceled these resources stay allocated
7710 until the program ends. To avoid this calls to &lt;CODE&gt;waitpid&lt;/CODE&gt; should be
7711 protected using cancellation handlers.
7712 &lt;br&gt;&lt;br&gt; The return value is normally the process ID of the child process whose
7713 status is reported. If there are child processes but none of them is
7714 waiting to be noticed, &lt;CODE&gt;waitpid&lt;/CODE&gt; will block until one is. However,
7715 if the &lt;CODE&gt;WNOHANG&lt;/CODE&gt; option was specified, &lt;CODE&gt;waitpid&lt;/CODE&gt; will return
7716 zero instead of blocking.
7717 &lt;br&gt;&lt;br&gt; If a specific PID to wait for was given to &lt;CODE&gt;waitpid&lt;/CODE&gt;, it will
7718 ignore all other children (if any). Therefore if there are children
7719 waiting to be noticed but the child whose PID was specified is not one
7720 of them, &lt;CODE&gt;waitpid&lt;/CODE&gt; will block or return zero as described above.
7721 &lt;br&gt;&lt;br&gt; A value of &lt;CODE&gt;-1&lt;/CODE&gt; is returned in case of error. The following
7722 &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
7723 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
7724
7725 &lt;DT&gt;&lt;CODE&gt;EINTR&lt;/CODE&gt;
7726 &lt;DD&gt;
7727 The function was interrupted by delivery of a signal to the calling
7728 process. .
7729 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ECHILD
7730 There are no child processes to wait for, or the specified &lt;VAR&gt;pid&lt;/VAR&gt;
7731 is not a child of the calling process.
7732 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
7733 An invalid value was provided for the &lt;VAR&gt;options&lt;/VAR&gt; argument.
7734
7735 </synopsis>
7736 </function>
7737 </construct>
7738 <construct id="function-wait" type="function">
7739 <function returntype="pid_t">
7740 <prototype>
7741 <parameter content="int *status-ptr"/>
7742 </prototype>
7743 <headers>
7744 <header filename = "sys/wait.h"/>
7745 </headers>
7746 <synopsis>
7747 This is a simplified version of &lt;CODE&gt;waitpid&lt;/CODE&gt;, and is used to wait
7748 until any one child process terminates. The call:
7749 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
7750 wait (&amp;status)&lt;br&gt;
7751 &lt;/pre&gt;&lt;br&gt;
7752 &lt;br&gt;&lt;br&gt; &lt;br&gt;
7753 is exactly equivalent to:&lt;br&gt;
7754 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
7755 waitpid (-1, &amp;status, 0)&lt;br&gt;
7756 &lt;/pre&gt;
7757 &lt;br&gt;&lt;br&gt; This function is a cancellation point in multi-threaded programs. This
7758 is a problem if the thread allocates some resources (like memory, file
7759 descriptors, semaphores or whatever) at the time &lt;CODE&gt;wait&lt;/CODE&gt; is
7760 called. If the thread gets canceled these resources stay allocated
7761 until the program ends. To avoid this calls to &lt;CODE&gt;wait&lt;/CODE&gt; should be
7762 protected using cancellation handlers.
7763 </synopsis>
7764 </function>
7765 </construct>
7766 <construct id="function-wait4" type="function">
7767 <function returntype="pid_t">
7768 <prototype>
7769 <parameter content="pid_t pid"/>
7770 <parameter content="int *status-ptr"/>
7771 <parameter content="int options"/>
7772 <parameter content="struct rusage *usage"/>
7773 </prototype>
7774 <headers>
7775 <header filename = "sys/wait.h"/>
7776 </headers>
7777 <synopsis>
7778 If &lt;VAR&gt;usage&lt;/VAR&gt; is a null pointer, &lt;CODE&gt;wait4&lt;/CODE&gt; is equivalent to
7779 &lt;CODE&gt;waitpid (&lt;VAR&gt;pid&lt;/VAR&gt;, &lt;VAR&gt;status-ptr&lt;/VAR&gt;, &lt;VAR&gt;options&lt;/VAR&gt;)&lt;/CODE&gt;.
7780 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;usage&lt;/VAR&gt; is not null, &lt;CODE&gt;wait4&lt;/CODE&gt; stores usage figures for the
7781 child process in &lt;CODE&gt;*&lt;VAR&gt;rusage&lt;/VAR&gt;&lt;/CODE&gt; (but only if the child has
7782 terminated, not if it has stopped). .
7783 &lt;br&gt;&lt;br&gt; This function is a BSD extension.
7784 </synopsis>
7785 </function>
7786 </construct>
7787 <construct id="union-wait" type="union">
7788 <structure>
7789 <synopsis>
7790 This data type represents program termination status values. It has
7791 the following members:
7792 &lt;br&gt;&lt;br&gt;
7793 </synopsis>
7794 <elements>
7795 <element content="int w_termsig">
7796 <synopsis>
7797 The value of this member is the same as that of the
7798 &lt;CODE&gt;WTERMSIG&lt;/CODE&gt; macro.
7799 &lt;br&gt;&lt;br&gt;
7800 </synopsis>
7801 </element>
7802 <element content="int w_coredump">
7803 <synopsis>
7804 The value of this member is the same as that of the
7805 &lt;CODE&gt;WCOREDUMP&lt;/CODE&gt; macro.
7806 &lt;br&gt;&lt;br&gt;
7807 </synopsis>
7808 </element>
7809 <element content="int w_retcode">
7810 <synopsis>
7811 The value of this member is the same as that of the
7812 &lt;CODE&gt;WEXITSTATUS&lt;/CODE&gt; macro.
7813 &lt;br&gt;&lt;br&gt;
7814 </synopsis>
7815 </element>
7816 </elements>
7817 </structure>
7818 </construct>
7819 <construct id="function-wait3" type="function">
7820 <function returntype="pid_t">
7821 <prototype>
7822 <parameter content="union wait *status-ptr"/>
7823 <parameter content="int options"/>
7824 <parameter content="struct rusage *usage"/>
7825 </prototype>
7826 <headers>
7827 <header filename = "sys/wait.h"/>
7828 </headers>
7829 <synopsis>
7830 If &lt;VAR&gt;usage&lt;/VAR&gt; is a null pointer, &lt;CODE&gt;wait3&lt;/CODE&gt; is equivalent to
7831 &lt;CODE&gt;waitpid (-1, &lt;VAR&gt;status-ptr&lt;/VAR&gt;, &lt;VAR&gt;options&lt;/VAR&gt;)&lt;/CODE&gt;.
7832 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;usage&lt;/VAR&gt; is not null, &lt;CODE&gt;wait3&lt;/CODE&gt; stores usage figures for the
7833 child process in &lt;CODE&gt;*&lt;VAR&gt;rusage&lt;/VAR&gt;&lt;/CODE&gt; (but only if the child has
7834 terminated, not if it has stopped). .
7835 </synopsis>
7836 </function>
7837 </construct>
7838 <construct id="function-getcwd" type="function">
7839 <function returntype="char *">
7840 <prototype>
7841 <parameter content="char *buffer"/>
7842 <parameter content="size_t size"/>
7843 </prototype>
7844 <headers>
7845 <header filename = "unistd.h"/>
7846 </headers>
7847 <synopsis>
7848 The &lt;CODE&gt;getcwd&lt;/CODE&gt; function returns an absolute file name representing
7849 the current working directory, storing it in the character array
7850 &lt;VAR&gt;buffer&lt;/VAR&gt; that you provide. The &lt;VAR&gt;size&lt;/VAR&gt; argument is how you tell
7851 the system the allocation size of &lt;VAR&gt;buffer&lt;/VAR&gt;.
7852 &lt;br&gt;&lt;br&gt; The GNU library version of this function also permits you to specify a
7853 null pointer for the &lt;VAR&gt;buffer&lt;/VAR&gt; argument. Then &lt;CODE&gt;getcwd&lt;/CODE&gt;
7854 allocates a buffer automatically, as with &lt;CODE&gt;malloc&lt;/CODE&gt;
7855 . If the &lt;VAR&gt;size&lt;/VAR&gt; is greater than
7856 zero, then the buffer is that large; otherwise, the buffer is as large
7857 as necessary to hold the result.
7858 &lt;br&gt;&lt;br&gt; The return value is &lt;VAR&gt;buffer&lt;/VAR&gt; on success and a null pointer on failure.
7859 The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
7860 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
7861
7862 &lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
7863 &lt;DD&gt;
7864 The &lt;VAR&gt;size&lt;/VAR&gt; argument is zero and &lt;VAR&gt;buffer&lt;/VAR&gt; is not a null pointer.
7865 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ERANGE
7866 The &lt;VAR&gt;size&lt;/VAR&gt; argument is less than the length of the working directory
7867 name. You need to allocate a bigger array and try again.
7868 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EACCES
7869 Permission to read or search a component of the file name was denied.
7870
7871 </synopsis>
7872 </function>
7873 </construct>
7874 <construct id="function-get_current_dir_name" type="function">
7875 <function returntype="char *">
7876 <prototype>
7877 <parameter content="void"/>
7878 </prototype>
7879 <headers>
7880 <header filename = "unistd.h"/>
7881 </headers>
7882 <synopsis>
7883
7884 This &lt;CODE&gt;get_current_dir_name&lt;/CODE&gt; function is basically equivalent to
7885 &lt;CODE&gt;getcwd (NULL, 0)&lt;/CODE&gt;. The only difference is that the value of
7886 the &lt;CODE&gt;PWD&lt;/CODE&gt; variable is returned if this value is correct. This is a
7887 subtle difference which is visible if the path described by the
7888 &lt;CODE&gt;PWD&lt;/CODE&gt; value is using one or more symbol links in which case the
7889 value returned by &lt;CODE&gt;getcwd&lt;/CODE&gt; can resolve the symbol links and
7890 therefore yield a different result.
7891 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
7892 </synopsis>
7893 </function>
7894 </construct>
7895 <construct id="function-chdir" type="function">
7896 <function returntype="int">
7897 <prototype>
7898 <parameter content="const char *filename"/>
7899 </prototype>
7900 <headers>
7901 <header filename = "unistd.h"/>
7902 </headers>
7903 <synopsis>
7904 This function is used to set the process's working directory to
7905 &lt;VAR&gt;filename&lt;/VAR&gt;.
7906 &lt;br&gt;&lt;br&gt; The normal, successful return value from &lt;CODE&gt;chdir&lt;/CODE&gt; is &lt;CODE&gt;0&lt;/CODE&gt;. A
7907 value of &lt;CODE&gt;-1&lt;/CODE&gt; is returned to indicate an error. The &lt;CODE&gt;errno&lt;/CODE&gt;
7908 error conditions defined for this function are the usual file name
7909 syntax errors , plus &lt;CODE&gt;ENOTDIR&lt;/CODE&gt; if the
7910 file &lt;VAR&gt;filename&lt;/VAR&gt; is not a directory.
7911 </synopsis>
7912 </function>
7913 </construct>
7914 <construct id="function-fchdir" type="function">
7915 <function returntype="int">
7916 <prototype>
7917 <parameter content="int filedes"/>
7918 </prototype>
7919 <headers>
7920 <header filename = "unistd.h"/>
7921 </headers>
7922 <synopsis>
7923 This function is used to set the process's working directory to
7924 directory associated with the file descriptor &lt;VAR&gt;filedes&lt;/VAR&gt;.
7925 &lt;br&gt;&lt;br&gt; The normal, successful return value from &lt;CODE&gt;fchdir&lt;/CODE&gt; is &lt;CODE&gt;0&lt;/CODE&gt;. A
7926 value of &lt;CODE&gt;-1&lt;/CODE&gt; is returned to indicate an error. The following
7927 &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
7928 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
7929
7930 &lt;DT&gt;&lt;CODE&gt;EACCES&lt;/CODE&gt;
7931 &lt;DD&gt;
7932 Read permission is denied for the directory named by &lt;CODE&gt;dirname&lt;/CODE&gt;.
7933 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EBADF
7934 The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not a valid file descriptor.
7935 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTDIR
7936 The file descriptor &lt;VAR&gt;filedes&lt;/VAR&gt; is not associated with a directory.
7937 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINTR
7938 The function call was interrupt by a signal.
7939 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EIO
7940 An I/O error occurred.
7941
7942 </synopsis>
7943 </function>
7944 </construct>
7945 <construct id="struct-dirent" type="struct">
7946 <structure>
7947 <synopsis>
7948 This is a structure type used to return information about directory
7949 entries. It contains the following fields:
7950 &lt;br&gt;&lt;br&gt;
7951 </synopsis>
7952 <elements>
7953 <element content="char d_name[]">
7954 <synopsis>
7955 This is the null-terminated file name component. This is the only
7956 field you can count on in all POSIX systems.
7957 &lt;br&gt;&lt;br&gt;
7958 </synopsis>
7959 </element>
7960 <element content="ino_t d_fileno">
7961 <synopsis>
7962 This is the file serial number. For BSD compatibility, you can also
7963 refer to this member as &lt;CODE&gt;d_ino&lt;/CODE&gt;. In the GNU system and most POSIX
7964 systems, for most files this the same as the &lt;CODE&gt;st_ino&lt;/CODE&gt; member that
7965 &lt;CODE&gt;stat&lt;/CODE&gt; will return for the file. .
7966 &lt;br&gt;&lt;br&gt;
7967 </synopsis>
7968 </element>
7969 <element content="unsigned char d_namlen">
7970 <synopsis>
7971 This is the length of the file name, not including the terminating null
7972 character. Its type is &lt;CODE&gt;unsigned char&lt;/CODE&gt; because that is the integer
7973 type of the appropriate size
7974 &lt;br&gt;&lt;br&gt;
7975 </synopsis>
7976 </element>
7977 <element content="unsigned char d_type">
7978 <synopsis>
7979 This is the type of the file, possibly unknown. The following constants
7980 are defined for its value:
7981 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
7982
7983 </synopsis>
7984 </element>
7985 <element content="DT_UNKNOWN">
7986 <synopsis>
7987 The type is unknown. On some systems this is the only value returned.
7988 &lt;br&gt;&lt;br&gt;
7989 </synopsis>
7990 </element>
7991 <element content="DT_REG">
7992 <synopsis>
7993 A regular file.
7994 &lt;br&gt;&lt;br&gt;
7995 </synopsis>
7996 </element>
7997 <element content="DT_DIR">
7998 <synopsis>
7999 A directory.
8000 &lt;br&gt;&lt;br&gt;
8001 </synopsis>
8002 </element>
8003 <element content="DT_FIFO">
8004 <synopsis>
8005 A named pipe, or FIFO. .
8006 &lt;br&gt;&lt;br&gt;
8007 </synopsis>
8008 </element>
8009 <element content="DT_SOCK">
8010 <synopsis>
8011 A local-domain socket.
8012 &lt;br&gt;&lt;br&gt;
8013 </synopsis>
8014 </element>
8015 <element content="DT_CHR">
8016 <synopsis>
8017 A character device.
8018 &lt;br&gt;&lt;br&gt;
8019 </synopsis>
8020 </element>
8021 </elements>
8022 </structure>
8023 </construct>
8024 <construct id="dtype-DIR" type="dtype">
8025 <structure>
8026 </structure>
8027 </construct>
8028 <construct id="function-opendir" type="function">
8029 <function returntype="DIR *">
8030 <prototype>
8031 <parameter content="const char *dirname"/>
8032 </prototype>
8033 <headers>
8034 <header filename = "dirent.h"/>
8035 </headers>
8036 <synopsis>
8037 The &lt;CODE&gt;opendir&lt;/CODE&gt; function opens and returns a directory stream for
8038 reading the directory whose file name is &lt;VAR&gt;dirname&lt;/VAR&gt;. The stream has
8039 type &lt;CODE&gt;DIR *&lt;/CODE&gt;.
8040 &lt;br&gt;&lt;br&gt; If unsuccessful, &lt;CODE&gt;opendir&lt;/CODE&gt; returns a null pointer. In addition to
8041 the usual file name errors , the
8042 following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
8043 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
8044
8045 &lt;DT&gt;&lt;CODE&gt;EACCES&lt;/CODE&gt;
8046 &lt;DD&gt;
8047 Read permission is denied for the directory named by &lt;CODE&gt;dirname&lt;/CODE&gt;.
8048 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EMFILE
8049 The process has too many files open.
8050 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENFILE
8051 The entire system, or perhaps the file system which contains the
8052 directory, cannot support any additional open files at the moment.
8053 (This problem cannot happen on the GNU system.)
8054 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOMEM
8055 Not enough memory available.
8056
8057 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;DIR&lt;/CODE&gt; type is typically implemented using a file descriptor,
8058 and the &lt;CODE&gt;opendir&lt;/CODE&gt; function in terms of the &lt;CODE&gt;open&lt;/CODE&gt; function.
8059 . Directory streams and the underlying
8060 file descriptors are closed on &lt;CODE&gt;exec&lt;/CODE&gt; .
8061 </synopsis>
8062 </function>
8063 </construct>
8064 <construct id="function-fdopendir" type="function">
8065 <function returntype="DIR *">
8066 <prototype>
8067 <parameter content="int fd"/>
8068 </prototype>
8069 <headers>
8070 <header filename = "dirent.h"/>
8071 </headers>
8072 <synopsis>
8073 The &lt;CODE&gt;fdopendir&lt;/CODE&gt; function works just like &lt;CODE&gt;opendir&lt;/CODE&gt; but
8074 instead of taking a file name and opening a file descriptor for the
8075 directory the caller is required to provide a file descriptor. This
8076 file descriptor is then used in subsequent uses of the returned
8077 directory stream object.
8078 &lt;br&gt;&lt;br&gt; The caller must make sure the file descriptor is associated with a
8079 directory and it allows reading.
8080 &lt;br&gt;&lt;br&gt; If the &lt;CODE&gt;fdopendir&lt;/CODE&gt; call returns successfully the file descriptor
8081 is now under the control of the system. It can be used in the same
8082 way the descriptor implicitly created by &lt;CODE&gt;opendir&lt;/CODE&gt; can be used
8083 but the program must not close the descriptor.
8084 &lt;br&gt;&lt;br&gt; In case the function is unsuccessful it returns a null pointer and the
8085 file descriptor remains to be usable by the program. The following
8086 &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
8087 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
8088
8089 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
8090 &lt;DD&gt;
8091 The file descriptor is not valid.
8092 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTDIR
8093 The file descriptor is not associated with a directory.
8094 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
8095 The descriptor does not allow reading the directory content.
8096 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOMEM
8097 Not enough memory available.
8098
8099 </synopsis>
8100 </function>
8101 </construct>
8102 <construct id="function-dirfd" type="function">
8103 <function returntype="int">
8104 <prototype>
8105 <parameter content="DIR *dirstream"/>
8106 </prototype>
8107 <headers>
8108 <header filename = "dirent.h"/>
8109 </headers>
8110 <synopsis>
8111 The function &lt;CODE&gt;dirfd&lt;/CODE&gt; returns the file descriptor associated with
8112 the directory stream &lt;VAR&gt;dirstream&lt;/VAR&gt;. This descriptor can be used until
8113 the directory is closed with &lt;CODE&gt;closedir&lt;/CODE&gt;. If the directory stream
8114 implementation is not using file descriptors the return value is
8115 &lt;CODE&gt;-1&lt;/CODE&gt;.
8116 </synopsis>
8117 </function>
8118 </construct>
8119 <construct id="function-readdir" type="function">
8120 <function returntype="struct dirent *">
8121 <prototype>
8122 <parameter content="DIR *dirstream"/>
8123 </prototype>
8124 <headers>
8125 <header filename = "dirent.h"/>
8126 </headers>
8127 <synopsis>
8128 This function reads the next entry from the directory. It normally
8129 returns a pointer to a structure containing information about the file.
8130 This structure is statically allocated and can be rewritten by a
8131 subsequent call.
8132 &lt;br&gt;&lt;br&gt; Portability Note: On some systems &lt;CODE&gt;readdir&lt;/CODE&gt; may not
8133 return entries for &lt;TT&gt;.&lt;/TT&gt; and &lt;TT&gt;..&lt;/TT&gt;, even though these are always
8134 valid file names in any directory. .
8135 &lt;br&gt;&lt;br&gt; If there are no more entries in the directory or an error is detected,
8136 &lt;CODE&gt;readdir&lt;/CODE&gt; returns a null pointer. The following &lt;CODE&gt;errno&lt;/CODE&gt; error
8137 conditions are defined for this function:
8138 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
8139
8140 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
8141 &lt;DD&gt;
8142 The &lt;VAR&gt;dirstream&lt;/VAR&gt; argument is not valid.
8143
8144 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;readdir&lt;/CODE&gt; is not thread safe. Multiple threads using
8145 &lt;CODE&gt;readdir&lt;/CODE&gt; on the same &lt;VAR&gt;dirstream&lt;/VAR&gt; may overwrite the return
8146 value. Use &lt;CODE&gt;readdir_r&lt;/CODE&gt; when this is critical.
8147 </synopsis>
8148 </function>
8149 </construct>
8150 <construct id="function-readdir_r" type="function">
8151 <function returntype="int">
8152 <prototype>
8153 <parameter content="DIR *dirstream"/>
8154 <parameter content="struct dirent *entry"/>
8155 <parameter content="struct dirent **result"/>
8156 </prototype>
8157 <headers>
8158 <header filename = "dirent.h"/>
8159 </headers>
8160 <synopsis>
8161 This function is the reentrant version of &lt;CODE&gt;readdir&lt;/CODE&gt;. Like
8162 &lt;CODE&gt;readdir&lt;/CODE&gt; it returns the next entry from the directory. But to
8163 prevent conflicts between simultaneously running threads the result is
8164 not stored in statically allocated memory. Instead the argument
8165 &lt;VAR&gt;entry&lt;/VAR&gt; points to a place to store the result.
8166 &lt;br&gt;&lt;br&gt; Normally &lt;CODE&gt;readdir_r&lt;/CODE&gt; returns zero and sets &lt;CODE&gt;*&lt;VAR&gt;result&lt;/VAR&gt;&lt;/CODE&gt;
8167 to &lt;VAR&gt;entry&lt;/VAR&gt;. If there are no more entries in the directory or an
8168 error is detected, &lt;CODE&gt;readdir_r&lt;/CODE&gt; sets &lt;CODE&gt;*&lt;VAR&gt;result&lt;/VAR&gt;&lt;/CODE&gt; to a
8169 null pointer and returns a nonzero error code, also stored in
8170 &lt;CODE&gt;errno&lt;/CODE&gt;, as described for &lt;CODE&gt;readdir&lt;/CODE&gt;.
8171 &lt;br&gt;&lt;br&gt; Portability Note: On some systems &lt;CODE&gt;readdir_r&lt;/CODE&gt; may not
8172 return a NUL terminated string for the file name, even when there is no
8173 &lt;CODE&gt;d_reclen&lt;/CODE&gt; field in &lt;CODE&gt;struct dirent&lt;/CODE&gt; and the file
8174 name is the maximum allowed size. Modern systems all have the
8175 &lt;CODE&gt;d_reclen&lt;/CODE&gt; field, and on old systems multi-threading is not
8176 critical. In any case there is no such problem with the &lt;CODE&gt;readdir&lt;/CODE&gt;
8177 function, so that even on systems without the &lt;CODE&gt;d_reclen&lt;/CODE&gt; member one
8178 could use multiple threads by using external locking.
8179 &lt;br&gt;&lt;br&gt; It is also important to look at the definition of the &lt;CODE&gt;struct
8180 dirent&lt;/CODE&gt; type. Simply passing a pointer to an object of this type for
8181 the second parameter of &lt;CODE&gt;readdir_r&lt;/CODE&gt; might not be enough. Some
8182 systems don't define the &lt;CODE&gt;d_name&lt;/CODE&gt; element sufficiently long. In
8183 this case the user has to provide additional space. There must be room
8184 for at least &lt;CODE&gt;NAME_MAX + 1&lt;/CODE&gt; characters in the &lt;CODE&gt;d_name&lt;/CODE&gt; array.
8185 Code to call &lt;CODE&gt;readdir_r&lt;/CODE&gt; could look like this:
8186 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
8187 union&lt;br&gt;
8188 {&lt;br&gt;
8189 struct dirent d;&lt;br&gt;
8190 char b[offsetof (struct dirent, d_name) + NAME_MAX + 1];&lt;br&gt;
8191 } u;&lt;br&gt;
8192 &lt;br&gt;&lt;br&gt; if (readdir_r (dir, &amp;u.d, &amp;res) == 0)&lt;br&gt;
8193 &lt;small&gt;...&lt;/small&gt;&lt;br&gt;
8194 &lt;/pre&gt;
8195 </synopsis>
8196 </function>
8197 </construct>
8198 <construct id="function-readdir64" type="function">
8199 <function returntype="struct dirent64 *">
8200 <prototype>
8201 <parameter content="DIR *dirstream"/>
8202 </prototype>
8203 <headers>
8204 <header filename = "dirent.h"/>
8205 </headers>
8206 <synopsis>
8207 The &lt;CODE&gt;readdir64&lt;/CODE&gt; function is just like the &lt;CODE&gt;readdir&lt;/CODE&gt; function
8208 except that it returns a pointer to a record of type &lt;CODE&gt;struct
8209 dirent64&lt;/CODE&gt;. Some of the members of this data type (notably &lt;CODE&gt;d_ino&lt;/CODE&gt;)
8210 might have a different size to allow large filesystems.
8211 &lt;br&gt;&lt;br&gt; In all other aspects this function is equivalent to &lt;CODE&gt;readdir&lt;/CODE&gt;.
8212 </synopsis>
8213 </function>
8214 </construct>
8215 <construct id="function-readdir64_r" type="function">
8216 <function returntype="int">
8217 <prototype>
8218 <parameter content="DIR *dirstream"/>
8219 <parameter content="struct dirent64 *entry"/>
8220 <parameter content="struct dirent64 **result"/>
8221 </prototype>
8222 <headers>
8223 <header filename = "dirent.h"/>
8224 </headers>
8225 <synopsis>
8226 The &lt;CODE&gt;readdir64_r&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;readdir_r&lt;/CODE&gt;
8227 function except that it takes parameters of base type &lt;CODE&gt;struct
8228 dirent64&lt;/CODE&gt; instead of &lt;CODE&gt;struct dirent&lt;/CODE&gt; in the second and third
8229 position. The same precautions mentioned in the documentation of
8230 &lt;CODE&gt;readdir_r&lt;/CODE&gt; also apply here.
8231 </synopsis>
8232 </function>
8233 </construct>
8234 <construct id="function-closedir" type="function">
8235 <function returntype="int">
8236 <prototype>
8237 <parameter content="DIR *dirstream"/>
8238 </prototype>
8239 <headers>
8240 <header filename = "dirent.h"/>
8241 </headers>
8242 <synopsis>
8243 This function closes the directory stream &lt;VAR&gt;dirstream&lt;/VAR&gt;. It returns
8244 &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt; on failure.
8245 &lt;br&gt;&lt;br&gt; The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this
8246 function:
8247 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
8248
8249 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
8250 &lt;DD&gt;
8251 The &lt;VAR&gt;dirstream&lt;/VAR&gt; argument is not valid.
8252
8253 </synopsis>
8254 </function>
8255 </construct>
8256 <construct id="function-rewinddir" type="function">
8257 <function returntype="void">
8258 <prototype>
8259 <parameter content="DIR *dirstream"/>
8260 </prototype>
8261 <headers>
8262 <header filename = "dirent.h"/>
8263 </headers>
8264 <synopsis>
8265 The &lt;CODE&gt;rewinddir&lt;/CODE&gt; function is used to reinitialize the directory
8266 stream &lt;VAR&gt;dirstream&lt;/VAR&gt;, so that if you call &lt;CODE&gt;readdir&lt;/CODE&gt; it
8267 returns information about the first entry in the directory again. This
8268 function also notices if files have been added or removed to the
8269 directory since it was opened with &lt;CODE&gt;opendir&lt;/CODE&gt;. (Entries for these
8270 files might or might not be returned by &lt;CODE&gt;readdir&lt;/CODE&gt; if they were
8271 added or removed since you last called &lt;CODE&gt;opendir&lt;/CODE&gt; or
8272 &lt;CODE&gt;rewinddir&lt;/CODE&gt;.)
8273 </synopsis>
8274 </function>
8275 </construct>
8276 <construct id="function-seekdir" type="function">
8277 <function returntype="void">
8278 <prototype>
8279 <parameter content="DIR *dirstream"/>
8280 <parameter content="long int pos"/>
8281 </prototype>
8282 <headers>
8283 <header filename = "dirent.h"/>
8284 </headers>
8285 <synopsis>
8286 The &lt;CODE&gt;seekdir&lt;/CODE&gt; function sets the file position of the directory
8287 stream &lt;VAR&gt;dirstream&lt;/VAR&gt; to &lt;VAR&gt;pos&lt;/VAR&gt;. The value &lt;VAR&gt;pos&lt;/VAR&gt; must be the
8288 result of a previous call to &lt;CODE&gt;telldir&lt;/CODE&gt; on this particular stream;
8289 closing and reopening the directory can invalidate values returned by
8290 &lt;CODE&gt;telldir&lt;/CODE&gt;.
8291 </synopsis>
8292 </function>
8293 </construct>
8294 <construct id="function-scandir" type="function">
8295 <function returntype="int">
8296 <prototype>
8297 <parameter content="const char *dir"/>
8298 <parameter content="struct dirent ***namelist"/>
8299 <parameter content="int (*selector) (const struct dirent *)"/>
8300 <parameter content="int (*cmp) (const void *"/>
8301 <parameter content="const void *)"/>
8302 </prototype>
8303 <headers>
8304 <header filename = "dirent.h"/>
8305 </headers>
8306 <synopsis>
8307 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;scandir&lt;/CODE&gt; function scans the contents of the directory selected
8308 by &lt;VAR&gt;dir&lt;/VAR&gt;. The result in *&lt;VAR&gt;namelist&lt;/VAR&gt; is an array of pointers to
8309 structure of type &lt;CODE&gt;struct dirent&lt;/CODE&gt; which describe all selected
8310 directory entries and which is allocated using &lt;CODE&gt;malloc&lt;/CODE&gt;. Instead
8311 of always getting all directory entries returned, the user supplied
8312 function &lt;VAR&gt;selector&lt;/VAR&gt; can be used to decide which entries are in the
8313 result. Only the entries for which &lt;VAR&gt;selector&lt;/VAR&gt; returns a non-zero
8314 value are selected.
8315 &lt;br&gt;&lt;br&gt; Finally the entries in *&lt;VAR&gt;namelist&lt;/VAR&gt; are sorted using the
8316 user-supplied function &lt;VAR&gt;cmp&lt;/VAR&gt;. The arguments passed to the &lt;VAR&gt;cmp&lt;/VAR&gt;
8317 function are of type &lt;CODE&gt;struct dirent **&lt;/CODE&gt;, therefore one cannot
8318 directly use the &lt;CODE&gt;strcmp&lt;/CODE&gt; or &lt;CODE&gt;strcoll&lt;/CODE&gt; functions; instead see
8319 the functions &lt;CODE&gt;alphasort&lt;/CODE&gt; and &lt;CODE&gt;versionsort&lt;/CODE&gt; below.
8320 &lt;br&gt;&lt;br&gt; The return value of the function is the number of entries placed in
8321 *&lt;VAR&gt;namelist&lt;/VAR&gt;. If it is &lt;CODE&gt;-1&lt;/CODE&gt; an error occurred (either the
8322 directory could not be opened for reading or the malloc call failed) and
8323 the global variable &lt;CODE&gt;errno&lt;/CODE&gt; contains more information on the error.
8324 </synopsis>
8325 </function>
8326 </construct>
8327 <construct id="function-alphasort" type="function">
8328 <function returntype="int">
8329 <prototype>
8330 <parameter content="const void *a"/>
8331 <parameter content="const void *b"/>
8332 </prototype>
8333 <headers>
8334 <header filename = "dirent.h"/>
8335 </headers>
8336 <synopsis>
8337 The &lt;CODE&gt;alphasort&lt;/CODE&gt; function behaves like the &lt;CODE&gt;strcoll&lt;/CODE&gt; function
8338 . The difference is that the arguments
8339 are not string pointers but instead they are of type
8340 &lt;CODE&gt;struct dirent **&lt;/CODE&gt;.
8341 &lt;br&gt;&lt;br&gt; The return value of &lt;CODE&gt;alphasort&lt;/CODE&gt; is less than, equal to, or greater
8342 than zero depending on the order of the two entries &lt;VAR&gt;a&lt;/VAR&gt; and &lt;VAR&gt;b&lt;/VAR&gt;.
8343 </synopsis>
8344 </function>
8345 </construct>
8346 <construct id="function-versionsort" type="function">
8347 <function returntype="int">
8348 <prototype>
8349 <parameter content="const void *a"/>
8350 <parameter content="const void *b"/>
8351 </prototype>
8352 <headers>
8353 <header filename = "dirent.h"/>
8354 </headers>
8355 <synopsis>
8356 The &lt;CODE&gt;versionsort&lt;/CODE&gt; function is like &lt;CODE&gt;alphasort&lt;/CODE&gt; except that it
8357 uses the &lt;CODE&gt;strverscmp&lt;/CODE&gt; function internally.
8358 </synopsis>
8359 </function>
8360 </construct>
8361 <construct id="function-scandir64" type="function">
8362 <function returntype="int">
8363 <prototype>
8364 <parameter content="const char *dir"/>
8365 <parameter content="struct dirent64 ***namelist"/>
8366 <parameter content="int (*selector) (const struct dirent64 *)"/>
8367 <parameter content="int (*cmp) (const void *"/>
8368 <parameter content="const void *)"/>
8369 </prototype>
8370 <headers>
8371 <header filename = "dirent.h"/>
8372 </headers>
8373 <synopsis>
8374 The &lt;CODE&gt;scandir64&lt;/CODE&gt; function works like the &lt;CODE&gt;scandir&lt;/CODE&gt; function
8375 except that the directory entries it returns are described by elements
8376 of type &lt;CODE&gt;struct dirent64&lt;/CODE&gt;. The function pointed to by
8377 &lt;VAR&gt;selector&lt;/VAR&gt; is again used to select the desired entries, except that
8378 &lt;VAR&gt;selector&lt;/VAR&gt; now must point to a function which takes a
8379 &lt;CODE&gt;struct dirent64 *&lt;/CODE&gt; parameter.
8380 &lt;br&gt;&lt;br&gt; Similarly the &lt;VAR&gt;cmp&lt;/VAR&gt; function should expect its two arguments to be
8381 of type &lt;CODE&gt;struct dirent64 **&lt;/CODE&gt;.
8382 </synopsis>
8383 </function>
8384 </construct>
8385 <construct id="function-alphasort64" type="function">
8386 <function returntype="int">
8387 <prototype>
8388 <parameter content="const void *a"/>
8389 <parameter content="const void *b"/>
8390 </prototype>
8391 <headers>
8392 <header filename = "dirent.h"/>
8393 </headers>
8394 <synopsis>
8395 The &lt;CODE&gt;alphasort64&lt;/CODE&gt; function behaves like the &lt;CODE&gt;strcoll&lt;/CODE&gt; function
8396 . The difference is that the arguments
8397 are not string pointers but instead they are of type
8398 &lt;CODE&gt;struct dirent64 **&lt;/CODE&gt;.
8399 &lt;br&gt;&lt;br&gt; Return value of &lt;CODE&gt;alphasort64&lt;/CODE&gt; is less than, equal to, or greater
8400 than zero depending on the order of the two entries &lt;VAR&gt;a&lt;/VAR&gt; and &lt;VAR&gt;b&lt;/VAR&gt;.
8401 </synopsis>
8402 </function>
8403 </construct>
8404 <construct id="function-versionsort64" type="function">
8405 <function returntype="int">
8406 <prototype>
8407 <parameter content="const void *a"/>
8408 <parameter content="const void *b"/>
8409 </prototype>
8410 <headers>
8411 <header filename = "dirent.h"/>
8412 </headers>
8413 <synopsis>
8414 The &lt;CODE&gt;versionsort64&lt;/CODE&gt; function is like &lt;CODE&gt;alphasort64&lt;/CODE&gt;, excepted that it
8415 uses the &lt;CODE&gt;strverscmp&lt;/CODE&gt; function internally.
8416 </synopsis>
8417 </function>
8418 </construct>
8419 <construct id="dtype-__ftw_func_t" type="dtype">
8420 <structure>
8421 <synopsis>
8422 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
8423 int (*) (const char *, const struct stat *, int)&lt;br&gt;
8424 &lt;/pre&gt;
8425 &lt;br&gt;&lt;br&gt; The type of callback functions given to the &lt;CODE&gt;ftw&lt;/CODE&gt; function. The
8426 first parameter points to the file name, the second parameter to an
8427 object of type &lt;CODE&gt;struct stat&lt;/CODE&gt; which is filled in for the file named
8428 in the first parameter.
8429 &lt;br&gt;&lt;br&gt;
8430 The last parameter is a flag giving more information about the current
8431 file. It can have the following values:
8432 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
8433
8434 </synopsis>
8435 <elements>
8436 <element content="FTW_F">
8437 <synopsis>
8438 The item is either a normal file or a file which does not fit into one
8439 of the following categories. This could be special files, sockets etc.
8440 </synopsis>
8441 </element>
8442 <element content="FTW_D">
8443 <synopsis>
8444 The item is a directory.
8445 </synopsis>
8446 </element>
8447 <element content="FTW_NS">
8448 <synopsis>
8449 The &lt;CODE&gt;stat&lt;/CODE&gt; call failed and so the information pointed to by the
8450 second paramater is invalid.
8451 </synopsis>
8452 </element>
8453 <element content="FTW_DNR">
8454 <synopsis>
8455 The item is a directory which cannot be read.
8456 </synopsis>
8457 </element>
8458 </elements>
8459 </structure>
8460 </construct>
8461 <construct id="dtype-__ftw64_func_t" type="dtype">
8462 <structure>
8463 </structure>
8464 </construct>
8465 <construct id="dtype-__nftw_func_t" type="dtype">
8466 <structure>
8467 <synopsis>
8468 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
8469 int (*) (const char *, const struct stat *, int, struct FTW *)&lt;br&gt;
8470 &lt;/pre&gt;
8471 &lt;br&gt;&lt;br&gt;
8472
8473 The first three arguments are the same as for the &lt;CODE&gt;__ftw_func_t&lt;/CODE&gt;
8474 type. However for the third argument some additional values are defined
8475 to allow finer differentiation:
8476 </synopsis>
8477 <elements>
8478 <element content="FTW_DP">
8479 <synopsis>
8480 The current item is a directory and all subdirectories have already been
8481 visited and reported. This flag is returned instead of &lt;CODE&gt;FTW_D&lt;/CODE&gt; if
8482 the &lt;CODE&gt;FTW_DEPTH&lt;/CODE&gt; flag is passed to &lt;CODE&gt;nftw&lt;/CODE&gt; (see below).
8483 </synopsis>
8484 </element>
8485 </elements>
8486 </structure>
8487 </construct>
8488 <construct id="dtype-__nftw64_func_t" type="dtype">
8489 <structure>
8490 </structure>
8491 </construct>
8492 <construct id="struct-FTW" type="struct">
8493 <structure>
8494 <synopsis>
8495 The information contained in this structure helps in interpreting the
8496 name parameter and gives some information about the current state of the
8497 traversal of the directory hierarchy.
8498 &lt;br&gt;&lt;br&gt;
8499 </synopsis>
8500 <elements>
8501 <element content="int base">
8502 <synopsis>
8503 The value is the offset into the string passed in the first parameter to
8504 the callback function of the beginning of the file name. The rest of
8505 the string is the path of the file. This information is especially
8506 important if the &lt;CODE&gt;FTW_CHDIR&lt;/CODE&gt; flag was set in calling &lt;CODE&gt;nftw&lt;/CODE&gt;
8507 since then the current directory is the one the current item is found
8508 in.
8509 </synopsis>
8510 </element>
8511 </elements>
8512 </structure>
8513 </construct>
8514 <construct id="function-ftw" type="function">
8515 <function returntype="int">
8516 <prototype>
8517 <parameter content="const char *filename"/>
8518 <parameter content="__ftw_func_t func"/>
8519 <parameter content="int descriptors"/>
8520 </prototype>
8521 <headers>
8522 <header filename = "ftw.h"/>
8523 </headers>
8524 <synopsis>
8525 The &lt;CODE&gt;ftw&lt;/CODE&gt; function calls the callback function given in the
8526 parameter &lt;VAR&gt;func&lt;/VAR&gt; for every item which is found in the directory
8527 specified by &lt;VAR&gt;filename&lt;/VAR&gt; and all directories below. The function
8528 follows symbolic links if necessary but does not process an item twice.
8529 If &lt;VAR&gt;filename&lt;/VAR&gt; is not a directory then it itself is the only object
8530 returned to the callback function.
8531 &lt;br&gt;&lt;br&gt; The file name passed to the callback function is constructed by taking
8532 the &lt;VAR&gt;filename&lt;/VAR&gt; parameter and appending the names of all passed
8533 directories and then the local file name. So the callback function can
8534 use this parameter to access the file. &lt;CODE&gt;ftw&lt;/CODE&gt; also calls
8535 &lt;CODE&gt;stat&lt;/CODE&gt; for the file and passes that information on to the callback
8536 function. If this &lt;CODE&gt;stat&lt;/CODE&gt; call was not successful the failure is
8537 indicated by setting the third argument of the callback function to
8538 &lt;CODE&gt;FTW_NS&lt;/CODE&gt;. Otherwise it is set according to the description given
8539 in the account of &lt;CODE&gt;__ftw_func_t&lt;/CODE&gt; above.
8540 &lt;br&gt;&lt;br&gt; The callback function is expected to return 0 to indicate that no
8541 error occurred and that processing should continue. If an error
8542 occurred in the callback function or it wants &lt;CODE&gt;ftw&lt;/CODE&gt; to return
8543 immediately, the callback function can return a value other than
8544 0. This is the only correct way to stop the function. The
8545 program must not use &lt;CODE&gt;setjmp&lt;/CODE&gt; or similar techniques to continue
8546 from another place. This would leave resources allocated by the
8547 &lt;CODE&gt;ftw&lt;/CODE&gt; function unfreed.
8548 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;descriptors&lt;/VAR&gt; parameter to &lt;CODE&gt;ftw&lt;/CODE&gt; specifies how many file
8549 descriptors it is allowed to consume. The function runs faster the more
8550 descriptors it can use. For each level in the directory hierarchy at
8551 most one descriptor is used, but for very deep ones any limit on open
8552 file descriptors for the process or the system may be exceeded.
8553 Moreover, file descriptor limits in a multi-threaded program apply to
8554 all the threads as a group, and therefore it is a good idea to supply a
8555 reasonable limit to the number of open descriptors.
8556 &lt;br&gt;&lt;br&gt; The return value of the &lt;CODE&gt;ftw&lt;/CODE&gt; function is 0 if all callback
8557 function calls returned 0 and all actions performed by the
8558 &lt;CODE&gt;ftw&lt;/CODE&gt; succeeded. If a function call failed (other than calling
8559 &lt;CODE&gt;stat&lt;/CODE&gt; on an item) the function returns -1. If a callback
8560 function returns a value other than 0 this value is returned as
8561 the return value of &lt;CODE&gt;ftw&lt;/CODE&gt;.
8562 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a
8563 32-bit system this function is in fact &lt;CODE&gt;ftw64&lt;/CODE&gt;, i.e., the LFS
8564 interface transparently replaces the old interface.
8565 </synopsis>
8566 </function>
8567 </construct>
8568 <construct id="function-ftw64" type="function">
8569 <function returntype="int">
8570 <prototype>
8571 <parameter content="const char *filename"/>
8572 <parameter content="__ftw64_func_t func"/>
8573 <parameter content="int descriptors"/>
8574 </prototype>
8575 <headers>
8576 <header filename = "ftw.h"/>
8577 </headers>
8578 <synopsis>
8579 This function is similar to &lt;CODE&gt;ftw&lt;/CODE&gt; but it can work on filesystems
8580 with large files. File information is reported using a variable of type
8581 &lt;CODE&gt;struct stat64&lt;/CODE&gt; which is passed by reference to the callback
8582 function.
8583 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a
8584 32-bit system this function is available under the name &lt;CODE&gt;ftw&lt;/CODE&gt; and
8585 transparently replaces the old implementation.
8586 </synopsis>
8587 </function>
8588 </construct>
8589 <construct id="function-nftw" type="function">
8590 <function returntype="int">
8591 <prototype>
8592 <parameter content="const char *filename"/>
8593 <parameter content="__nftw_func_t func"/>
8594 <parameter content="int descriptors"/>
8595 <parameter content="int flag"/>
8596 </prototype>
8597 <headers>
8598 <header filename = "ftw.h"/>
8599 </headers>
8600 <synopsis>
8601 The &lt;CODE&gt;nftw&lt;/CODE&gt; function works like the &lt;CODE&gt;ftw&lt;/CODE&gt; functions. They call
8602 the callback function &lt;VAR&gt;func&lt;/VAR&gt; for all items found in the directory
8603 &lt;VAR&gt;filename&lt;/VAR&gt; and below. At most &lt;VAR&gt;descriptors&lt;/VAR&gt; file descriptors
8604 are consumed during the &lt;CODE&gt;nftw&lt;/CODE&gt; call.
8605 &lt;br&gt;&lt;br&gt; One difference is that the callback function is of a different type. It
8606 is of type &lt;CODE&gt;struct FTW *&lt;/CODE&gt; and provides the callback function
8607 with the extra information described above.
8608 &lt;br&gt;&lt;br&gt; A second difference is that &lt;CODE&gt;nftw&lt;/CODE&gt; takes a fourth argument, which
8609 is 0 or a bitwise-OR combination of any of the following values.
8610 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
8611
8612 &lt;DT&gt;&lt;CODE&gt;FTW_PHYS&lt;/CODE&gt;
8613 &lt;DD&gt;
8614 While traversing the directory symbolic links are not followed. Instead
8615 symbolic links are reported using the &lt;CODE&gt;FTW_SL&lt;/CODE&gt; value for the type
8616 parameter to the callback function. If the file referenced by a
8617 symbolic link does not exist &lt;CODE&gt;FTW_SLN&lt;/CODE&gt; is returned instead.
8618 &lt;DT&gt;&lt;CODE&gt;FTW_MOUNT&lt;/CODE&gt;
8619 &lt;DD&gt;
8620 The callback function is only called for items which are on the same
8621 mounted filesystem as the directory given by the &lt;VAR&gt;filename&lt;/VAR&gt;
8622 parameter to &lt;CODE&gt;nftw&lt;/CODE&gt;.
8623 &lt;DT&gt;&lt;CODE&gt;FTW_CHDIR&lt;/CODE&gt;
8624 &lt;DD&gt;
8625 If this flag is given the current working directory is changed to the
8626 directory of the reported object before the callback function is called.
8627 When &lt;CODE&gt;ntfw&lt;/CODE&gt; finally returns the current directory is restored to
8628 its original value.
8629 &lt;DT&gt;&lt;CODE&gt;FTW_DEPTH&lt;/CODE&gt;
8630 &lt;DD&gt;
8631 If this option is specified then all subdirectories and files within
8632 them are processed before processing the top directory itself
8633 (depth-first processing). This also means the type flag given to the
8634 callback function is &lt;CODE&gt;FTW_DP&lt;/CODE&gt; and not &lt;CODE&gt;FTW_D&lt;/CODE&gt;.
8635 &lt;DT&gt;&lt;CODE&gt;FTW_ACTIONRETVAL&lt;/CODE&gt;
8636 &lt;DD&gt;
8637 If this option is specified then return values from callbacks
8638 are handled differently. If the callback returns &lt;CODE&gt;FTW_CONTINUE&lt;/CODE&gt;,
8639 walking continues normally. &lt;CODE&gt;FTW_STOP&lt;/CODE&gt; means walking stops
8640 and &lt;CODE&gt;FTW_STOP&lt;/CODE&gt; is returned to the caller. If &lt;CODE&gt;FTW_SKIP_SUBTREE&lt;/CODE&gt;
8641 is returned by the callback with &lt;CODE&gt;FTW_D&lt;/CODE&gt; argument, the subtree
8642 is skipped and walking continues with next sibling of the directory.
8643 If &lt;CODE&gt;FTW_SKIP_SIBLINGS&lt;/CODE&gt; is returned by the callback, all siblings
8644 of the current entry are skipped and walking continues in its parent.
8645 No other return values should be returned from the callbacks if
8646 this option is set. This option is a GNU extension.
8647 &lt;/DL&gt;
8648 &lt;br&gt;&lt;br&gt; The return value is computed in the same way as for &lt;CODE&gt;ftw&lt;/CODE&gt;.
8649 &lt;CODE&gt;nftw&lt;/CODE&gt; returns 0 if no failures occurred and all callback
8650 functions returned 0. In case of internal errors, such as memory
8651 problems, the return value is -1 and &lt;VAR&gt;errno&lt;/VAR&gt; is set
8652 accordingly. If the return value of a callback invocation was non-zero
8653 then that value is returned.
8654 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a
8655 32-bit system this function is in fact &lt;CODE&gt;nftw64&lt;/CODE&gt;, i.e., the LFS
8656 interface transparently replaces the old interface.
8657 </synopsis>
8658 </function>
8659 </construct>
8660 <construct id="function-nftw64" type="function">
8661 <function returntype="int">
8662 <prototype>
8663 <parameter content="const char *filename"/>
8664 <parameter content="__nftw64_func_t func"/>
8665 <parameter content="int descriptors"/>
8666 <parameter content="int flag"/>
8667 </prototype>
8668 <headers>
8669 <header filename = "ftw.h"/>
8670 </headers>
8671 <synopsis>
8672 This function is similar to &lt;CODE&gt;nftw&lt;/CODE&gt; but it can work on filesystems
8673 with large files. File information is reported using a variable of type
8674 &lt;CODE&gt;struct stat64&lt;/CODE&gt; which is passed by reference to the callback
8675 function.
8676 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a
8677 32-bit system this function is available under the name &lt;CODE&gt;nftw&lt;/CODE&gt; and
8678 transparently replaces the old implementation.
8679 </synopsis>
8680 </function>
8681 </construct>
8682 <construct id="function-link" type="function">
8683 <function returntype="int">
8684 <prototype>
8685 <parameter content="const char *oldname"/>
8686 <parameter content="const char *newname"/>
8687 </prototype>
8688 <headers>
8689 <header filename = "unistd.h"/>
8690 </headers>
8691 <synopsis>
8692 The &lt;CODE&gt;link&lt;/CODE&gt; function makes a new link to the existing file named by
8693 &lt;VAR&gt;oldname&lt;/VAR&gt;, under the new name &lt;VAR&gt;newname&lt;/VAR&gt;.
8694 &lt;br&gt;&lt;br&gt; This function returns a value of &lt;CODE&gt;0&lt;/CODE&gt; if it is successful and
8695 &lt;CODE&gt;-1&lt;/CODE&gt; on failure. In addition to the usual file name errors
8696 for both &lt;VAR&gt;oldname&lt;/VAR&gt; and &lt;VAR&gt;newname&lt;/VAR&gt;, the
8697 following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
8698 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
8699
8700 &lt;DT&gt;&lt;CODE&gt;EACCES&lt;/CODE&gt;
8701 &lt;DD&gt;
8702 You are not allowed to write to the directory in which the new link is
8703 to be written.
8704
8705 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EEXIST
8706 There is already a file named &lt;VAR&gt;newname&lt;/VAR&gt;. If you want to replace
8707 this link with a new link, you must remove the old link explicitly first.
8708 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EMLINK
8709 There are already too many links to the file named by &lt;VAR&gt;oldname&lt;/VAR&gt;.
8710 (The maximum number of links to a file is &lt;CODE&gt;LINK_MAX&lt;/CODE&gt;; see
8711 Limits for Files.)
8712 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOENT
8713 The file named by &lt;VAR&gt;oldname&lt;/VAR&gt; doesn't exist. You can't make a link to
8714 a file that doesn't exist.
8715 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOSPC
8716 The directory or file system that would contain the new link is full
8717 and cannot be extended.
8718 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EPERM
8719 In the GNU system and some others, you cannot make links to directories.
8720 Many systems allow only privileged users to do so. This error
8721 is used to report the problem.
8722 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
8723 The directory containing the new link can't be modified because it's on
8724 a read-only file system.
8725 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EXDEV
8726 The directory specified in &lt;VAR&gt;newname&lt;/VAR&gt; is on a different file system
8727 than the existing file.
8728 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EIO
8729 A hardware error occurred while trying to read or write the to filesystem.
8730
8731 </synopsis>
8732 </function>
8733 </construct>
8734 <construct id="function-symlink" type="function">
8735 <function returntype="int">
8736 <prototype>
8737 <parameter content="const char *oldname"/>
8738 <parameter content="const char *newname"/>
8739 </prototype>
8740 <headers>
8741 <header filename = "sys/param.h"/>
8742 <header filename = "unistd.h"/>
8743 </headers>
8744 <synopsis>
8745 The &lt;CODE&gt;symlink&lt;/CODE&gt; function makes a symbolic link to &lt;VAR&gt;oldname&lt;/VAR&gt; named
8746 &lt;VAR&gt;newname&lt;/VAR&gt;.
8747 &lt;br&gt;&lt;br&gt; The normal return value from &lt;CODE&gt;symlink&lt;/CODE&gt; is &lt;CODE&gt;0&lt;/CODE&gt;. A return value
8748 of &lt;CODE&gt;-1&lt;/CODE&gt; indicates an error. In addition to the usual file name
8749 syntax errors , the following &lt;CODE&gt;errno&lt;/CODE&gt;
8750 error conditions are defined for this function:
8751 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
8752
8753 &lt;DT&gt;&lt;CODE&gt;EEXIST&lt;/CODE&gt;
8754 &lt;DD&gt;
8755 There is already an existing file named &lt;VAR&gt;newname&lt;/VAR&gt;.
8756 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
8757 The file &lt;VAR&gt;newname&lt;/VAR&gt; would exist on a read-only file system.
8758 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOSPC
8759 The directory or file system cannot be extended to make the new link.
8760 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EIO
8761 A hardware error occurred while reading or writing data on the disk.
8762 &lt;br&gt;&lt;br&gt;
8763
8764 </synopsis>
8765 </function>
8766 </construct>
8767 <construct id="function-readlink" type="function">
8768 <function returntype="int">
8769 <prototype>
8770 <parameter content="const char *filename"/>
8771 <parameter content="char *buffer"/>
8772 <parameter content="size_t size"/>
8773 </prototype>
8774 <headers>
8775 <header filename = "unistd.h"/>
8776 </headers>
8777 <synopsis>
8778 The &lt;CODE&gt;readlink&lt;/CODE&gt; function gets the value of the symbolic link
8779 &lt;VAR&gt;filename&lt;/VAR&gt;. The file name that the link points to is copied into
8780 &lt;VAR&gt;buffer&lt;/VAR&gt;. This file name string is &lt;EM&gt;not&lt;/EM&gt; null-terminated;
8781 &lt;CODE&gt;readlink&lt;/CODE&gt; normally returns the number of characters copied. The
8782 &lt;VAR&gt;size&lt;/VAR&gt; argument specifies the maximum number of characters to copy,
8783 usually the allocation size of &lt;VAR&gt;buffer&lt;/VAR&gt;.
8784 &lt;br&gt;&lt;br&gt; If the return value equals &lt;VAR&gt;size&lt;/VAR&gt;, you cannot tell whether or not
8785 there was room to return the entire name. So make a bigger buffer and
8786 call &lt;CODE&gt;readlink&lt;/CODE&gt; again. Here is an example:
8787 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
8788 char *&lt;br&gt;
8789 readlink_malloc (const char *filename)&lt;br&gt;
8790 {&lt;br&gt;
8791 int size = 100;&lt;br&gt;
8792 char *buffer = NULL;&lt;br&gt;
8793 &lt;br&gt;&lt;br&gt; while (1)&lt;br&gt;
8794 {&lt;br&gt;
8795 buffer = (char *) xrealloc (buffer, size);&lt;br&gt;
8796 int nchars = readlink (filename, buffer, size);&lt;br&gt;
8797 if (nchars &lt; 0)&lt;br&gt;
8798 {&lt;br&gt;
8799 free (buffer);&lt;br&gt;
8800 return NULL;&lt;br&gt;
8801 }&lt;br&gt;
8802 if (nchars &lt; size)&lt;br&gt;
8803 return buffer;&lt;br&gt;
8804 size *= 2;&lt;br&gt;
8805 }&lt;br&gt;
8806 }&lt;br&gt;
8807 &lt;/pre&gt;
8808 &lt;br&gt;&lt;br&gt; A value of &lt;CODE&gt;-1&lt;/CODE&gt; is returned in case of error. In addition to the
8809 usual file name errors , the following
8810 &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
8811 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
8812
8813 &lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
8814 &lt;DD&gt;
8815 The named file is not a symbolic link.
8816 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EIO
8817 A hardware error occurred while reading or writing data on the disk.
8818
8819 </synopsis>
8820 </function>
8821 </construct>
8822 <construct id="function-canonicalize_file_name" type="function">
8823 <function returntype="char *">
8824 <prototype>
8825 <parameter content="const char *name"/>
8826 </prototype>
8827 <headers>
8828 <header filename = "stdlib.h"/>
8829 </headers>
8830 <synopsis>
8831 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;canonicalize_file_name&lt;/CODE&gt; function returns the absolute name of
8832 the file named by &lt;VAR&gt;name&lt;/VAR&gt; which contains no &lt;CODE&gt;.&lt;/CODE&gt;, &lt;CODE&gt;..&lt;/CODE&gt;
8833 components nor any repeated path separators (&lt;CODE&gt;/&lt;/CODE&gt;) or symlinks. The
8834 result is passed back as the return value of the function in a block of
8835 memory allocated with &lt;CODE&gt;malloc&lt;/CODE&gt;. If the result is not used anymore
8836 the memory should be freed with a call to &lt;CODE&gt;free&lt;/CODE&gt;.
8837 &lt;br&gt;&lt;br&gt; If any of the path components is missing the function returns a NULL
8838 pointer. This is also what is returned if the length of the path
8839 reaches or exceeds &lt;CODE&gt;PATH_MAX&lt;/CODE&gt; characters. In any case
8840 &lt;CODE&gt;errno&lt;/CODE&gt; is set accordingly.
8841 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
8842
8843 &lt;DT&gt;&lt;CODE&gt;ENAMETOOLONG&lt;/CODE&gt;
8844 &lt;DD&gt;
8845 The resulting path is too long. This error only occurs on systems which
8846 have a limit on the file name length.
8847 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EACCES
8848 At least one of the path components is not readable.
8849 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOENT
8850 The input file name is empty.
8851 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOENT
8852 At least one of the path components does not exist.
8853 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ELOOP
8854 More than &lt;CODE&gt;MAXSYMLINKS&lt;/CODE&gt; many symlinks have been followed.
8855
8856 &lt;br&gt;&lt;br&gt; This function is a GNU extension and is declared in &lt;TT&gt;stdlib.h&lt;/TT&gt;.
8857 </synopsis>
8858 </function>
8859 </construct>
8860 <construct id="function-realpath" type="function">
8861 <function returntype="char *">
8862 <prototype>
8863 <parameter content="const char *restrict name"/>
8864 <parameter content="char *restrict resolved"/>
8865 </prototype>
8866 <headers>
8867 <header filename = "stdlib.h"/>
8868 </headers>
8869 <synopsis>
8870 &lt;br&gt;&lt;br&gt; A call to &lt;CODE&gt;realpath&lt;/CODE&gt; where the &lt;VAR&gt;resolved&lt;/VAR&gt; parameter is
8871 &lt;CODE&gt;NULL&lt;/CODE&gt; behaves exactly like &lt;CODE&gt;canonicalize_file_name&lt;/CODE&gt;. The
8872 function allocates a buffer for the file name and returns a pointer to
8873 it. If &lt;VAR&gt;resolved&lt;/VAR&gt; is not &lt;CODE&gt;NULL&lt;/CODE&gt; it points to a buffer into
8874 which the result is copied. It is the callers responsibility to
8875 allocate a buffer which is large enough. On systems which define
8876 &lt;CODE&gt;PATH_MAX&lt;/CODE&gt; this means the buffer must be large enough for a
8877 pathname of this size. For systems without limitations on the pathname
8878 length the requirement cannot be met and programs should not call
8879 &lt;CODE&gt;realpath&lt;/CODE&gt; with anything but &lt;CODE&gt;NULL&lt;/CODE&gt; for the second parameter.
8880 &lt;br&gt;&lt;br&gt; One other difference is that the buffer &lt;VAR&gt;resolved&lt;/VAR&gt; (if nonzero) will
8881 contain the part of the path component which does not exist or is not
8882 readable if the function returns &lt;CODE&gt;NULL&lt;/CODE&gt; and &lt;CODE&gt;errno&lt;/CODE&gt; is set to
8883 &lt;CODE&gt;EACCES&lt;/CODE&gt; or &lt;CODE&gt;ENOENT&lt;/CODE&gt;.
8884 &lt;br&gt;&lt;br&gt; This function is declared in &lt;TT&gt;stdlib.h&lt;/TT&gt;.
8885 </synopsis>
8886 </function>
8887 </construct>
8888 <construct id="function-unlink" type="function">
8889 <function returntype="int">
8890 <prototype>
8891 <parameter content="const char *filename"/>
8892 </prototype>
8893 <headers>
8894 <header filename = "unistd.h"/>
8895 </headers>
8896 <synopsis>
8897 The &lt;CODE&gt;unlink&lt;/CODE&gt; function deletes the file name &lt;VAR&gt;filename&lt;/VAR&gt;. If
8898 this is a file's sole name, the file itself is also deleted. (Actually,
8899 if any process has the file open when this happens, deletion is
8900 postponed until all processes have closed the file.)
8901 &lt;br&gt;&lt;br&gt; The function &lt;CODE&gt;unlink&lt;/CODE&gt; is declared in the header file &lt;TT&gt;unistd.h&lt;/TT&gt;.
8902 &lt;br&gt;&lt;br&gt; This function returns &lt;CODE&gt;0&lt;/CODE&gt; on successful completion, and &lt;CODE&gt;-1&lt;/CODE&gt;
8903 on error. In addition to the usual file name errors
8904 , the following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are
8905 defined for this function:
8906 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
8907
8908 &lt;DT&gt;&lt;CODE&gt;EACCES&lt;/CODE&gt;
8909 &lt;DD&gt;
8910 Write permission is denied for the directory from which the file is to be
8911 removed, or the directory has the sticky bit set and you do not own the file.
8912 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EBUSY
8913 This error indicates that the file is being used by the system in such a
8914 way that it can't be unlinked. For example, you might see this error if
8915 the file name specifies the root directory or a mount point for a file
8916 system.
8917 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOENT
8918 The file name to be deleted doesn't exist.
8919 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EPERM
8920 On some systems &lt;CODE&gt;unlink&lt;/CODE&gt; cannot be used to delete the name of a
8921 directory, or at least can only be used this way by a privileged user.
8922 To avoid such problems, use &lt;CODE&gt;rmdir&lt;/CODE&gt; to delete directories. (In the
8923 GNU system &lt;CODE&gt;unlink&lt;/CODE&gt; can never delete the name of a directory.)
8924 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
8925 The directory containing the file name to be deleted is on a read-only
8926 file system and can't be modified.
8927
8928 </synopsis>
8929 </function>
8930 </construct>
8931 <construct id="function-rmdir" type="function">
8932 <function returntype="int">
8933 <prototype>
8934 <parameter content="const char *filename"/>
8935 </prototype>
8936 <headers>
8937 <header filename = "unistd.h"/>
8938 </headers>
8939 <synopsis>
8940 , deleting
8941 a directory
8942 The &lt;CODE&gt;rmdir&lt;/CODE&gt; function deletes a directory. The directory must be
8943 empty before it can be removed; in other words, it can only contain
8944 entries for &lt;TT&gt;.&lt;/TT&gt; and &lt;TT&gt;..&lt;/TT&gt;.
8945 &lt;br&gt;&lt;br&gt; In most other respects, &lt;CODE&gt;rmdir&lt;/CODE&gt; behaves like &lt;CODE&gt;unlink&lt;/CODE&gt;. There
8946 are two additional &lt;CODE&gt;errno&lt;/CODE&gt; error conditions defined for
8947 &lt;CODE&gt;rmdir&lt;/CODE&gt;:
8948 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
8949
8950 &lt;DT&gt;&lt;CODE&gt;ENOTEMPTY&lt;/CODE&gt;
8951 &lt;DD&gt;
8952 &lt;LI&gt;x EEXIST
8953 The directory to be deleted is not empty.
8954
8955 &lt;br&gt;&lt;br&gt; These two error codes are synonymous; some systems use one, and some use
8956 the other. The GNU system always uses &lt;CODE&gt;ENOTEMPTY&lt;/CODE&gt;.
8957 &lt;br&gt;&lt;br&gt; The prototype for this function is declared in the header file
8958 &lt;TT&gt;unistd.h&lt;/TT&gt;.
8959 </synopsis>
8960 </function>
8961 </construct>
8962 <construct id="function-remove" type="function">
8963 <function returntype="int">
8964 <prototype>
8965 <parameter content="const char *filename"/>
8966 </prototype>
8967 <headers>
8968 <header filename = "stdio.h"/>
8969 </headers>
8970 <synopsis>
8971 This is the ISO C function to remove a file. It works like
8972 &lt;CODE&gt;unlink&lt;/CODE&gt; for files and like &lt;CODE&gt;rmdir&lt;/CODE&gt; for directories.
8973 &lt;CODE&gt;remove&lt;/CODE&gt; is declared in &lt;TT&gt;stdio.h&lt;/TT&gt;.
8974 </synopsis>
8975 </function>
8976 </construct>
8977 <construct id="function-rename" type="function">
8978 <function returntype="int">
8979 <prototype>
8980 <parameter content="const char *oldname"/>
8981 <parameter content="const char *newname"/>
8982 </prototype>
8983 <headers>
8984 <header filename = "stdio.h"/>
8985 </headers>
8986 <synopsis>
8987 The &lt;CODE&gt;rename&lt;/CODE&gt; function renames the file &lt;VAR&gt;oldname&lt;/VAR&gt; to
8988 &lt;VAR&gt;newname&lt;/VAR&gt;. The file formerly accessible under the name
8989 &lt;VAR&gt;oldname&lt;/VAR&gt; is afterwards accessible as &lt;VAR&gt;newname&lt;/VAR&gt; instead. (If
8990 the file had any other names aside from &lt;VAR&gt;oldname&lt;/VAR&gt;, it continues to
8991 have those names.)
8992 &lt;br&gt;&lt;br&gt; The directory containing the name &lt;VAR&gt;newname&lt;/VAR&gt; must be on the same file
8993 system as the directory containing the name &lt;VAR&gt;oldname&lt;/VAR&gt;.
8994 &lt;br&gt;&lt;br&gt; One special case for &lt;CODE&gt;rename&lt;/CODE&gt; is when &lt;VAR&gt;oldname&lt;/VAR&gt; and
8995 &lt;VAR&gt;newname&lt;/VAR&gt; are two names for the same file. The consistent way to
8996 handle this case is to delete &lt;VAR&gt;oldname&lt;/VAR&gt;. However, in this case
8997 POSIX requires that &lt;CODE&gt;rename&lt;/CODE&gt; do nothing and report success---which
8998 is inconsistent. We don't know what your operating system will do.
8999 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;oldname&lt;/VAR&gt; is not a directory, then any existing file named
9000 &lt;VAR&gt;newname&lt;/VAR&gt; is removed during the renaming operation. However, if
9001 &lt;VAR&gt;newname&lt;/VAR&gt; is the name of a directory, &lt;CODE&gt;rename&lt;/CODE&gt; fails in this
9002 case.
9003 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;oldname&lt;/VAR&gt; is a directory, then either &lt;VAR&gt;newname&lt;/VAR&gt; must not
9004 exist or it must name a directory that is empty. In the latter case,
9005 the existing directory named &lt;VAR&gt;newname&lt;/VAR&gt; is deleted first. The name
9006 &lt;VAR&gt;newname&lt;/VAR&gt; must not specify a subdirectory of the directory
9007 &lt;CODE&gt;oldname&lt;/CODE&gt; which is being renamed.
9008 &lt;br&gt;&lt;br&gt; One useful feature of &lt;CODE&gt;rename&lt;/CODE&gt; is that the meaning of &lt;VAR&gt;newname&lt;/VAR&gt;
9009 changes ``atomically'' from any previously existing file by that name to
9010 its new meaning (i.e., the file that was called &lt;VAR&gt;oldname&lt;/VAR&gt;). There is
9011 no instant at which &lt;VAR&gt;newname&lt;/VAR&gt; is non-existent ``in between'' the old
9012 meaning and the new meaning. If there is a system crash during the
9013 operation, it is possible for both names to still exist; but
9014 &lt;VAR&gt;newname&lt;/VAR&gt; will always be intact if it exists at all.
9015 &lt;br&gt;&lt;br&gt; If &lt;CODE&gt;rename&lt;/CODE&gt; fails, it returns &lt;CODE&gt;-1&lt;/CODE&gt;. In addition to the usual
9016 file name errors , the following
9017 &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
9018 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
9019
9020 &lt;DT&gt;&lt;CODE&gt;EACCES&lt;/CODE&gt;
9021 &lt;DD&gt;
9022 One of the directories containing &lt;VAR&gt;newname&lt;/VAR&gt; or &lt;VAR&gt;oldname&lt;/VAR&gt;
9023 refuses write permission; or &lt;VAR&gt;newname&lt;/VAR&gt; and &lt;VAR&gt;oldname&lt;/VAR&gt; are
9024 directories and write permission is refused for one of them.
9025 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EBUSY
9026 A directory named by &lt;VAR&gt;oldname&lt;/VAR&gt; or &lt;VAR&gt;newname&lt;/VAR&gt; is being used by
9027 the system in a way that prevents the renaming from working. This includes
9028 directories that are mount points for filesystems, and directories
9029 that are the current working directories of processes.
9030 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTEMPTY
9031 &lt;LI&gt;x EEXIST
9032 The directory &lt;VAR&gt;newname&lt;/VAR&gt; isn't empty. The GNU system always returns
9033 &lt;CODE&gt;ENOTEMPTY&lt;/CODE&gt; for this, but some other systems return &lt;CODE&gt;EEXIST&lt;/CODE&gt;.
9034 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
9035 &lt;VAR&gt;oldname&lt;/VAR&gt; is a directory that contains &lt;VAR&gt;newname&lt;/VAR&gt;.
9036 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EISDIR
9037 &lt;VAR&gt;newname&lt;/VAR&gt; is a directory but the &lt;VAR&gt;oldname&lt;/VAR&gt; isn't.
9038 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EMLINK
9039 The parent directory of &lt;VAR&gt;newname&lt;/VAR&gt; would have too many links
9040 (entries).
9041 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOENT
9042 The file &lt;VAR&gt;oldname&lt;/VAR&gt; doesn't exist.
9043 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOSPC
9044 The directory that would contain &lt;VAR&gt;newname&lt;/VAR&gt; has no room for another
9045 entry, and there is no space left in the file system to expand it.
9046 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
9047 The operation would involve writing to a directory on a read-only file
9048 system.
9049 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EXDEV
9050 The two file names &lt;VAR&gt;newname&lt;/VAR&gt; and &lt;VAR&gt;oldname&lt;/VAR&gt; are on different
9051 file systems.
9052
9053 </synopsis>
9054 </function>
9055 </construct>
9056 <construct id="function-mkdir" type="function">
9057 <function returntype="int">
9058 <prototype>
9059 <parameter content="const char *filename"/>
9060 <parameter content="mode_t mode"/>
9061 </prototype>
9062 <headers>
9063 <header filename = "sys/stat.h"/>
9064 </headers>
9065 <synopsis>
9066 The &lt;CODE&gt;mkdir&lt;/CODE&gt; function creates a new, empty directory with name
9067 &lt;VAR&gt;filename&lt;/VAR&gt;.
9068 &lt;br&gt;&lt;br&gt; The argument &lt;VAR&gt;mode&lt;/VAR&gt; specifies the file permissions for the new
9069 directory file. , for more information about
9070 this.
9071 &lt;br&gt;&lt;br&gt; A return value of &lt;CODE&gt;0&lt;/CODE&gt; indicates successful completion, and
9072 &lt;CODE&gt;-1&lt;/CODE&gt; indicates failure. In addition to the usual file name syntax
9073 errors , the following &lt;CODE&gt;errno&lt;/CODE&gt; error
9074 conditions are defined for this function:
9075 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
9076
9077 &lt;DT&gt;&lt;CODE&gt;EACCES&lt;/CODE&gt;
9078 &lt;DD&gt;
9079 Write permission is denied for the parent directory in which the new
9080 directory is to be added.
9081 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EEXIST
9082 A file named &lt;VAR&gt;filename&lt;/VAR&gt; already exists.
9083 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EMLINK
9084 The parent directory has too many links (entries).
9085 &lt;br&gt;&lt;br&gt; Well-designed file systems never report this error, because they permit
9086 more links than your disk could possibly hold. However, you must still
9087 take account of the possibility of this error, as it could result from
9088 network access to a file system on another machine.
9089 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOSPC
9090 The file system doesn't have enough room to create the new directory.
9091 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
9092 The parent directory of the directory being created is on a read-only
9093 file system and cannot be modified.
9094
9095 &lt;br&gt;&lt;br&gt; To use this function, your program should include the header file
9096 &lt;TT&gt;sys/stat.h&lt;/TT&gt;.
9097 </synopsis>
9098 </function>
9099 </construct>
9100 <construct id="struct-stat" type="struct">
9101 <structure>
9102 <synopsis>
9103 The &lt;CODE&gt;stat&lt;/CODE&gt; structure type is used to return information about the
9104 attributes of a file. It contains at least the following members:
9105 &lt;br&gt;&lt;br&gt;
9106 </synopsis>
9107 <elements>
9108 <element content="mode_t st_mode">
9109 <synopsis>
9110 Specifies the mode of the file. This includes file type information
9111 and the file permission bits
9112 .
9113 &lt;br&gt;&lt;br&gt;
9114 </synopsis>
9115 </element>
9116 <element content="ino_t st_ino">
9117 <synopsis>
9118 The file serial number, which distinguishes this file from all other
9119 files on the same device.
9120 &lt;br&gt;&lt;br&gt;
9121 </synopsis>
9122 </element>
9123 <element content="dev_t st_dev">
9124 <synopsis>
9125 Identifies the device containing the file. The &lt;CODE&gt;st_ino&lt;/CODE&gt; and
9126 &lt;CODE&gt;st_dev&lt;/CODE&gt;, taken together, uniquely identify the file. The
9127 &lt;CODE&gt;st_dev&lt;/CODE&gt; value is not necessarily consistent across reboots or
9128 system crashes, however.
9129 &lt;br&gt;&lt;br&gt;
9130 </synopsis>
9131 </element>
9132 <element content="nlink_t st_nlink">
9133 <synopsis>
9134 The number of hard links to the file. This count keeps track of how
9135 many directories have entries for this file. If the count is ever
9136 decremented to zero, then the file itself is discarded as soon as no
9137 process still holds it open. Symbolic links are not counted in the
9138 total.
9139 &lt;br&gt;&lt;br&gt;
9140 </synopsis>
9141 </element>
9142 <element content="uid_t st_uid">
9143 <synopsis>
9144 The user ID of the file's owner. .
9145 &lt;br&gt;&lt;br&gt;
9146 </synopsis>
9147 </element>
9148 <element content="gid_t st_gid">
9149 <synopsis>
9150 The group ID of the file. .
9151 &lt;br&gt;&lt;br&gt;
9152 </synopsis>
9153 </element>
9154 <element content="off_t st_size">
9155 <synopsis>
9156 This specifies the size of a regular file in bytes. For files that are
9157 really devices this field isn't usually meaningful. For symbolic links
9158 this specifies the length of the file name the link refers to.
9159 &lt;br&gt;&lt;br&gt;
9160 </synopsis>
9161 </element>
9162 <element content="time_t st_atime">
9163 <synopsis>
9164 This is the last access time for the file. .
9165 &lt;br&gt;&lt;br&gt;
9166 </synopsis>
9167 </element>
9168 <element content="unsigned long int st_atime_usec">
9169 <synopsis>
9170 This is the fractional part of the last access time for the file.
9171 .
9172 &lt;br&gt;&lt;br&gt;
9173 </synopsis>
9174 </element>
9175 <element content="time_t st_mtime">
9176 <synopsis>
9177 This is the time of the last modification to the contents of the file.
9178 .
9179 &lt;br&gt;&lt;br&gt;
9180 </synopsis>
9181 </element>
9182 <element content="unsigned long int st_mtime_usec">
9183 <synopsis>
9184 This is the fractional part of the time of the last modification to the
9185 contents of the file. .
9186 &lt;br&gt;&lt;br&gt;
9187 </synopsis>
9188 </element>
9189 <element content="time_t st_ctime">
9190 <synopsis>
9191 This is the time of the last modification to the attributes of the file.
9192 .
9193 &lt;br&gt;&lt;br&gt;
9194 </synopsis>
9195 </element>
9196 <element content="unsigned long int st_ctime_usec">
9197 <synopsis>
9198 This is the fractional part of the time of the last modification to the
9199 attributes of the file. .
9200 &lt;br&gt;&lt;br&gt;
9201 </synopsis>
9202 </element>
9203 <element content="blkcnt_t st_blocks">
9204 <synopsis>
9205 This is the amount of disk space that the file occupies, measured in
9206 units of 512-byte blocks.
9207 &lt;br&gt;&lt;br&gt; The number of disk blocks is not strictly proportional to the size of
9208 the file, for two reasons: the file system may use some blocks for
9209 internal record keeping; and the file may be sparse---it may have
9210 ``holes'' which contain zeros but do not actually take up space on the
9211 disk.
9212 &lt;br&gt;&lt;br&gt; You can tell (approximately) whether a file is sparse by comparing this
9213 value with &lt;CODE&gt;st_size&lt;/CODE&gt;, like this:
9214 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
9215 (st.st_blocks * 512 &lt; st.st_size)&lt;br&gt;
9216 &lt;/pre&gt;
9217 &lt;br&gt;&lt;br&gt; This test is not perfect because a file that is just slightly sparse
9218 might not be detected as sparse at all. For practical applications,
9219 this is not a problem.
9220 &lt;br&gt;&lt;br&gt;
9221 </synopsis>
9222 </element>
9223 </elements>
9224 </structure>
9225 </construct>
9226 <construct id="struct-stat64" type="struct">
9227 <structure>
9228 <synopsis>
9229 The members of this type are the same and have the same names as those
9230 in &lt;CODE&gt;struct stat&lt;/CODE&gt;. The only difference is that the members
9231 &lt;CODE&gt;st_ino&lt;/CODE&gt;, &lt;CODE&gt;st_size&lt;/CODE&gt;, and &lt;CODE&gt;st_blocks&lt;/CODE&gt; have a different
9232 type to support larger values.
9233 &lt;br&gt;&lt;br&gt;
9234 </synopsis>
9235 <elements>
9236 <element content="mode_t st_mode">
9237 <synopsis>
9238 Specifies the mode of the file. This includes file type information
9239 and the file permission bits
9240 .
9241 &lt;br&gt;&lt;br&gt;
9242 </synopsis>
9243 </element>
9244 <element content="ino64_t st_ino">
9245 <synopsis>
9246 The file serial number, which distinguishes this file from all other
9247 files on the same device.
9248 &lt;br&gt;&lt;br&gt;
9249 </synopsis>
9250 </element>
9251 <element content="dev_t st_dev">
9252 <synopsis>
9253 Identifies the device containing the file. The &lt;CODE&gt;st_ino&lt;/CODE&gt; and
9254 &lt;CODE&gt;st_dev&lt;/CODE&gt;, taken together, uniquely identify the file. The
9255 &lt;CODE&gt;st_dev&lt;/CODE&gt; value is not necessarily consistent across reboots or
9256 system crashes, however.
9257 &lt;br&gt;&lt;br&gt;
9258 </synopsis>
9259 </element>
9260 <element content="nlink_t st_nlink">
9261 <synopsis>
9262 The number of hard links to the file. This count keeps track of how
9263 many directories have entries for this file. If the count is ever
9264 decremented to zero, then the file itself is discarded as soon as no
9265 process still holds it open. Symbolic links are not counted in the
9266 total.
9267 &lt;br&gt;&lt;br&gt;
9268 </synopsis>
9269 </element>
9270 <element content="uid_t st_uid">
9271 <synopsis>
9272 The user ID of the file's owner. .
9273 &lt;br&gt;&lt;br&gt;
9274 </synopsis>
9275 </element>
9276 <element content="gid_t st_gid">
9277 <synopsis>
9278 The group ID of the file. .
9279 &lt;br&gt;&lt;br&gt;
9280 </synopsis>
9281 </element>
9282 <element content="off64_t st_size">
9283 <synopsis>
9284 This specifies the size of a regular file in bytes. For files that are
9285 really devices this field isn't usually meaningful. For symbolic links
9286 this specifies the length of the file name the link refers to.
9287 &lt;br&gt;&lt;br&gt;
9288 </synopsis>
9289 </element>
9290 <element content="time_t st_atime">
9291 <synopsis>
9292 This is the last access time for the file. .
9293 &lt;br&gt;&lt;br&gt;
9294 </synopsis>
9295 </element>
9296 <element content="unsigned long int st_atime_usec">
9297 <synopsis>
9298 This is the fractional part of the last access time for the file.
9299 .
9300 &lt;br&gt;&lt;br&gt;
9301 </synopsis>
9302 </element>
9303 <element content="time_t st_mtime">
9304 <synopsis>
9305 This is the time of the last modification to the contents of the file.
9306 .
9307 &lt;br&gt;&lt;br&gt;
9308 </synopsis>
9309 </element>
9310 <element content="unsigned long int st_mtime_usec">
9311 <synopsis>
9312 This is the fractional part of the time of the last modification to the
9313 contents of the file. .
9314 &lt;br&gt;&lt;br&gt;
9315 </synopsis>
9316 </element>
9317 <element content="time_t st_ctime">
9318 <synopsis>
9319 This is the time of the last modification to the attributes of the file.
9320 .
9321 &lt;br&gt;&lt;br&gt;
9322 </synopsis>
9323 </element>
9324 <element content="unsigned long int st_ctime_usec">
9325 <synopsis>
9326 This is the fractional part of the time of the last modification to the
9327 attributes of the file. .
9328 &lt;br&gt;&lt;br&gt;
9329 </synopsis>
9330 </element>
9331 <element content="blkcnt64_t st_blocks">
9332 <synopsis>
9333 This is the amount of disk space that the file occupies, measured in
9334 units of 512-byte blocks.
9335 &lt;br&gt;&lt;br&gt;
9336 </synopsis>
9337 </element>
9338 </elements>
9339 </structure>
9340 </construct>
9341 <construct id="dtype-mode_t" type="dtype">
9342 <structure>
9343 </structure>
9344 </construct>
9345 <construct id="dtype-ino_t" type="dtype">
9346 <structure>
9347 </structure>
9348 </construct>
9349 <construct id="dtype-ino64_t" type="dtype">
9350 <structure>
9351 </structure>
9352 </construct>
9353 <construct id="dtype-dev_t" type="dtype">
9354 <structure>
9355 </structure>
9356 </construct>
9357 <construct id="dtype-nlink_t" type="dtype">
9358 <structure>
9359 </structure>
9360 </construct>
9361 <construct id="dtype-blkcnt_t" type="dtype">
9362 <structure>
9363 </structure>
9364 </construct>
9365 <construct id="dtype-blkcnt64_t" type="dtype">
9366 <structure>
9367 </structure>
9368 </construct>
9369 <construct id="function-stat" type="function">
9370 <function returntype="int">
9371 <prototype>
9372 <parameter content="const char *filename"/>
9373 <parameter content="struct stat *buf"/>
9374 </prototype>
9375 <headers>
9376 <header filename = "sys/stat.h"/>
9377 <header filename = "sys/types.h"/>
9378 </headers>
9379 <synopsis>
9380 The &lt;CODE&gt;stat&lt;/CODE&gt; function returns information about the attributes of the
9381 file named by &lt;VAR&gt;filename&lt;/VAR&gt; in the structure pointed to by &lt;VAR&gt;buf&lt;/VAR&gt;.
9382 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;filename&lt;/VAR&gt; is the name of a symbolic link, the attributes you get
9383 describe the file that the link points to. If the link points to a
9384 nonexistent file name, then &lt;CODE&gt;stat&lt;/CODE&gt; fails reporting a nonexistent
9385 file.
9386 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; if the operation is successful, or
9387 &lt;CODE&gt;-1&lt;/CODE&gt; on failure. In addition to the usual file name errors
9388 (, the following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions
9389 are defined for this function:
9390 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
9391
9392 &lt;DT&gt;&lt;CODE&gt;ENOENT&lt;/CODE&gt;
9393 &lt;DD&gt;
9394 The file named by &lt;VAR&gt;filename&lt;/VAR&gt; doesn't exist.
9395
9396 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
9397 function is in fact &lt;CODE&gt;stat64&lt;/CODE&gt; since the LFS interface transparently
9398 replaces the normal implementation.
9399 </synopsis>
9400 </function>
9401 </construct>
9402 <construct id="function-stat64" type="function">
9403 <function returntype="int">
9404 <prototype>
9405 <parameter content="const char *filename"/>
9406 <parameter content="struct stat64 *buf"/>
9407 </prototype>
9408 <headers>
9409 <header filename = "sys/stat.h"/>
9410 </headers>
9411 <synopsis>
9412 This function is similar to &lt;CODE&gt;stat&lt;/CODE&gt; but it is also able to work on
9413 files larger then 2^31 bytes on 32-bit systems. To be able to do
9414 this the result is stored in a variable of type &lt;CODE&gt;struct stat64&lt;/CODE&gt; to
9415 which &lt;VAR&gt;buf&lt;/VAR&gt; must point.
9416 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
9417 function is available under the name &lt;CODE&gt;stat&lt;/CODE&gt; and so transparently
9418 replaces the interface for small files on 32-bit machines.
9419 </synopsis>
9420 </function>
9421 </construct>
9422 <construct id="function-fstat" type="function">
9423 <function returntype="int">
9424 <prototype>
9425 <parameter content="int filedes"/>
9426 <parameter content="struct stat *buf"/>
9427 </prototype>
9428 <headers>
9429 <header filename = "sys/stat.h"/>
9430 </headers>
9431 <synopsis>
9432 The &lt;CODE&gt;fstat&lt;/CODE&gt; function is like &lt;CODE&gt;stat&lt;/CODE&gt;, except that it takes an
9433 open file descriptor as an argument instead of a file name.
9434 .
9435 &lt;br&gt;&lt;br&gt; Like &lt;CODE&gt;stat&lt;/CODE&gt;, &lt;CODE&gt;fstat&lt;/CODE&gt; returns &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt;
9436 on failure. The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for
9437 &lt;CODE&gt;fstat&lt;/CODE&gt;:
9438 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
9439
9440 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
9441 &lt;DD&gt;
9442 The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not a valid file descriptor.
9443
9444 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
9445 function is in fact &lt;CODE&gt;fstat64&lt;/CODE&gt; since the LFS interface transparently
9446 replaces the normal implementation.
9447 </synopsis>
9448 </function>
9449 </construct>
9450 <construct id="function-fstat64" type="function">
9451 <function returntype="int">
9452 <prototype>
9453 <parameter content="int filedes"/>
9454 <parameter content="struct stat64 *buf"/>
9455 </prototype>
9456 <headers>
9457 <header filename = "sys/stat.h"/>
9458 </headers>
9459 <synopsis>
9460 This function is similar to &lt;CODE&gt;fstat&lt;/CODE&gt; but is able to work on large
9461 files on 32-bit platforms. For large files the file descriptor
9462 &lt;VAR&gt;filedes&lt;/VAR&gt; should be obtained by &lt;CODE&gt;open64&lt;/CODE&gt; or &lt;CODE&gt;creat64&lt;/CODE&gt;.
9463 The &lt;VAR&gt;buf&lt;/VAR&gt; pointer points to a variable of type &lt;CODE&gt;struct stat64&lt;/CODE&gt;
9464 which is able to represent the larger values.
9465 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
9466 function is available under the name &lt;CODE&gt;fstat&lt;/CODE&gt; and so transparently
9467 replaces the interface for small files on 32-bit machines.
9468 </synopsis>
9469 </function>
9470 </construct>
9471 <construct id="function-lstat" type="function">
9472 <function returntype="int">
9473 <prototype>
9474 <parameter content="const char *filename"/>
9475 <parameter content="struct stat *buf"/>
9476 </prototype>
9477 <headers>
9478 <header filename = "sys/stat.h"/>
9479 </headers>
9480 <synopsis>
9481 The &lt;CODE&gt;lstat&lt;/CODE&gt; function is like &lt;CODE&gt;stat&lt;/CODE&gt;, except that it does not
9482 follow symbolic links. If &lt;VAR&gt;filename&lt;/VAR&gt; is the name of a symbolic
9483 link, &lt;CODE&gt;lstat&lt;/CODE&gt; returns information about the link itself; otherwise
9484 &lt;CODE&gt;lstat&lt;/CODE&gt; works like &lt;CODE&gt;stat&lt;/CODE&gt;. .
9485 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
9486 function is in fact &lt;CODE&gt;lstat64&lt;/CODE&gt; since the LFS interface transparently
9487 replaces the normal implementation.
9488 </synopsis>
9489 </function>
9490 </construct>
9491 <construct id="function-lstat64" type="function">
9492 <function returntype="int">
9493 <prototype>
9494 <parameter content="const char *filename"/>
9495 <parameter content="struct stat64 *buf"/>
9496 </prototype>
9497 <headers>
9498 <header filename = "sys/stat.h"/>
9499 </headers>
9500 <synopsis>
9501 This function is similar to &lt;CODE&gt;lstat&lt;/CODE&gt; but it is also able to work on
9502 files larger then 2^31 bytes on 32-bit systems. To be able to do
9503 this the result is stored in a variable of type &lt;CODE&gt;struct stat64&lt;/CODE&gt; to
9504 which &lt;VAR&gt;buf&lt;/VAR&gt; must point.
9505 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
9506 function is available under the name &lt;CODE&gt;lstat&lt;/CODE&gt; and so transparently
9507 replaces the interface for small files on 32-bit machines.
9508 </synopsis>
9509 </function>
9510 </construct>
9511 <construct id="function-chown" type="function">
9512 <function returntype="int">
9513 <prototype>
9514 <parameter content="const char *filename"/>
9515 <parameter content="uid_t owner"/>
9516 <parameter content="gid_t group"/>
9517 </prototype>
9518 <headers>
9519 <header filename = "unistd.h"/>
9520 </headers>
9521 <synopsis>
9522 The &lt;CODE&gt;chown&lt;/CODE&gt; function changes the owner of the file &lt;VAR&gt;filename&lt;/VAR&gt; to
9523 &lt;VAR&gt;owner&lt;/VAR&gt;, and its group owner to &lt;VAR&gt;group&lt;/VAR&gt;.
9524 &lt;br&gt;&lt;br&gt; Changing the owner of the file on certain systems clears the set-user-ID
9525 and set-group-ID permission bits. (This is because those bits may not
9526 be appropriate for the new owner.) Other file permission bits are not
9527 changed.
9528 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt; on failure.
9529 In addition to the usual file name errors ,
9530 the following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
9531 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
9532
9533 &lt;DT&gt;&lt;CODE&gt;EPERM&lt;/CODE&gt;
9534 &lt;DD&gt;
9535 This process lacks permission to make the requested change.
9536 &lt;br&gt;&lt;br&gt; Only privileged users or the file's owner can change the file's group.
9537 On most file systems, only privileged users can change the file owner;
9538 some file systems allow you to change the owner if you are currently the
9539 owner. When you access a remote file system, the behavior you encounter
9540 is determined by the system that actually holds the file, not by the
9541 system your program is running on.
9542 &lt;br&gt;&lt;br&gt; , for information about the
9543 &lt;CODE&gt;_POSIX_CHOWN_RESTRICTED&lt;/CODE&gt; macro.
9544 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
9545 The file is on a read-only file system.
9546
9547 </synopsis>
9548 </function>
9549 </construct>
9550 <construct id="function-fchown" type="function">
9551 <function returntype="int">
9552 <prototype>
9553 <parameter content="int filedes"/>
9554 <parameter content="int owner"/>
9555 <parameter content="int group"/>
9556 </prototype>
9557 <headers>
9558 <header filename = "unistd.h"/>
9559 </headers>
9560 <synopsis>
9561 This is like &lt;CODE&gt;chown&lt;/CODE&gt;, except that it changes the owner of the open
9562 file with descriptor &lt;VAR&gt;filedes&lt;/VAR&gt;.
9563 &lt;br&gt;&lt;br&gt; The return value from &lt;CODE&gt;fchown&lt;/CODE&gt; is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt;
9564 on failure. The following &lt;CODE&gt;errno&lt;/CODE&gt; error codes are defined for this
9565 function:
9566 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
9567
9568 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
9569 &lt;DD&gt;
9570 The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not a valid file descriptor.
9571 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
9572 The &lt;VAR&gt;filedes&lt;/VAR&gt; argument corresponds to a pipe or socket, not an ordinary
9573 file.
9574 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EPERM
9575 This process lacks permission to make the requested change. For details
9576 see &lt;CODE&gt;chmod&lt;/CODE&gt; above.
9577 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
9578 The file resides on a read-only file system.
9579
9580 </synopsis>
9581 </function>
9582 </construct>
9583 <construct id="function-umask" type="function">
9584 <function returntype="mode_t">
9585 <prototype>
9586 <parameter content="mode_t mask"/>
9587 </prototype>
9588 <headers>
9589 <header filename = "sys/stat.h"/>
9590 </headers>
9591 <synopsis>
9592 The &lt;CODE&gt;umask&lt;/CODE&gt; function sets the file creation mask of the current
9593 process to &lt;VAR&gt;mask&lt;/VAR&gt;, and returns the previous value of the file
9594 creation mask.
9595 &lt;br&gt;&lt;br&gt; Here is an example showing how to read the mask with &lt;CODE&gt;umask&lt;/CODE&gt;
9596 without changing it permanently:
9597 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
9598 mode_t&lt;br&gt;
9599 read_umask (void)&lt;br&gt;
9600 {&lt;br&gt;
9601 mode_t mask = umask (0);&lt;br&gt;
9602 umask (mask);&lt;br&gt;
9603 return mask;&lt;br&gt;
9604 }&lt;br&gt;
9605 &lt;/pre&gt;
9606 &lt;br&gt;&lt;br&gt;
9607 However, it is better to use &lt;CODE&gt;getumask&lt;/CODE&gt; if you just want to read
9608 the mask value, because it is reentrant (at least if you use the GNU
9609 operating system).
9610 </synopsis>
9611 </function>
9612 </construct>
9613 <construct id="function-getumask" type="function">
9614 <function returntype="mode_t">
9615 <prototype>
9616 <parameter content="void"/>
9617 </prototype>
9618 <headers>
9619 <header filename = "sys/stat.h"/>
9620 </headers>
9621 <synopsis>
9622 Return the current value of the file creation mask for the current
9623 process. This function is a GNU extension.
9624 </synopsis>
9625 </function>
9626 </construct>
9627 <construct id="function-chmod" type="function">
9628 <function returntype="int">
9629 <prototype>
9630 <parameter content="const char *filename"/>
9631 <parameter content="mode_t mode"/>
9632 </prototype>
9633 <headers>
9634 <header filename = "sys/stat.h"/>
9635 </headers>
9636 <synopsis>
9637 The &lt;CODE&gt;chmod&lt;/CODE&gt; function sets the access permission bits for the file
9638 named by &lt;VAR&gt;filename&lt;/VAR&gt; to &lt;VAR&gt;mode&lt;/VAR&gt;.
9639 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;filename&lt;/VAR&gt; is a symbolic link, &lt;CODE&gt;chmod&lt;/CODE&gt; changes the
9640 permissions of the file pointed to by the link, not those of the link
9641 itself.
9642 &lt;br&gt;&lt;br&gt; This function returns &lt;CODE&gt;0&lt;/CODE&gt; if successful and &lt;CODE&gt;-1&lt;/CODE&gt; if not. In
9643 addition to the usual file name errors , the following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for
9644 this function:
9645 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
9646
9647 &lt;DT&gt;&lt;CODE&gt;ENOENT&lt;/CODE&gt;
9648 &lt;DD&gt;
9649 The named file doesn't exist.
9650 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EPERM
9651 This process does not have permission to change the access permissions
9652 of this file. Only the file's owner (as judged by the effective user ID
9653 of the process) or a privileged user can change them.
9654 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
9655 The file resides on a read-only file system.
9656 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EFTYPE
9657 &lt;VAR&gt;mode&lt;/VAR&gt; has the &lt;CODE&gt;S_ISVTX&lt;/CODE&gt; bit (the ``sticky bit'') set,
9658 and the named file is not a directory. Some systems do not allow setting the
9659 sticky bit on non-directory files, and some do (and only some of those
9660 assign a useful meaning to the bit for non-directory files).
9661 &lt;br&gt;&lt;br&gt; You only get &lt;CODE&gt;EFTYPE&lt;/CODE&gt; on systems where the sticky bit has no useful
9662 meaning for non-directory files, so it is always safe to just clear the
9663 bit in &lt;VAR&gt;mode&lt;/VAR&gt; and call &lt;CODE&gt;chmod&lt;/CODE&gt; again. ,
9664 for full details on the sticky bit.
9665
9666 </synopsis>
9667 </function>
9668 </construct>
9669 <construct id="function-fchmod" type="function">
9670 <function returntype="int">
9671 <prototype>
9672 <parameter content="int filedes"/>
9673 <parameter content="int mode"/>
9674 </prototype>
9675 <headers>
9676 <header filename = "sys/stat.h"/>
9677 </headers>
9678 <synopsis>
9679 This is like &lt;CODE&gt;chmod&lt;/CODE&gt;, except that it changes the permissions of the
9680 currently open file given by &lt;VAR&gt;filedes&lt;/VAR&gt;.
9681 &lt;br&gt;&lt;br&gt; The return value from &lt;CODE&gt;fchmod&lt;/CODE&gt; is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt;
9682 on failure. The following &lt;CODE&gt;errno&lt;/CODE&gt; error codes are defined for this
9683 function:
9684 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
9685
9686 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
9687 &lt;DD&gt;
9688 The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not a valid file descriptor.
9689 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
9690 The &lt;VAR&gt;filedes&lt;/VAR&gt; argument corresponds to a pipe or socket, or something
9691 else that doesn't really have access permissions.
9692 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EPERM
9693 This process does not have permission to change the access permissions
9694 of this file. Only the file's owner (as judged by the effective user ID
9695 of the process) or a privileged user can change them.
9696 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
9697 The file resides on a read-only file system.
9698
9699 </synopsis>
9700 </function>
9701 </construct>
9702 <construct id="function-access" type="function">
9703 <function returntype="int">
9704 <prototype>
9705 <parameter content="const char *filename"/>
9706 <parameter content="int how"/>
9707 </prototype>
9708 <headers>
9709 <header filename = "unistd.h"/>
9710 </headers>
9711 <synopsis>
9712 The &lt;CODE&gt;access&lt;/CODE&gt; function checks to see whether the file named by
9713 &lt;VAR&gt;filename&lt;/VAR&gt; can be accessed in the way specified by the &lt;VAR&gt;how&lt;/VAR&gt;
9714 argument. The &lt;VAR&gt;how&lt;/VAR&gt; argument either can be the bitwise OR of the
9715 flags &lt;CODE&gt;R_OK&lt;/CODE&gt;, &lt;CODE&gt;W_OK&lt;/CODE&gt;, &lt;CODE&gt;X_OK&lt;/CODE&gt;, or the existence test
9716 &lt;CODE&gt;F_OK&lt;/CODE&gt;.
9717 &lt;br&gt;&lt;br&gt; This function uses the &lt;EM&gt;real&lt;/EM&gt; user and group IDs of the calling
9718 process, rather than the &lt;EM&gt;effective&lt;/EM&gt; IDs, to check for access
9719 permission. As a result, if you use the function from a &lt;CODE&gt;setuid&lt;/CODE&gt;
9720 or &lt;CODE&gt;setgid&lt;/CODE&gt; program , it gives
9721 information relative to the user who actually ran the program.
9722 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; if the access is permitted, and &lt;CODE&gt;-1&lt;/CODE&gt;
9723 otherwise. (In other words, treated as a predicate function,
9724 &lt;CODE&gt;access&lt;/CODE&gt; returns true if the requested access is &lt;EM&gt;denied&lt;/EM&gt;.)
9725 &lt;br&gt;&lt;br&gt; In addition to the usual file name errors , the following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for
9726 this function:
9727 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
9728
9729 &lt;DT&gt;&lt;CODE&gt;EACCES&lt;/CODE&gt;
9730 &lt;DD&gt;
9731 The access specified by &lt;VAR&gt;how&lt;/VAR&gt; is denied.
9732 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOENT
9733 The file doesn't exist.
9734 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
9735 Write permission was requested for a file on a read-only file system.
9736
9737 </synopsis>
9738 </function>
9739 </construct>
9740 <construct id="struct-utimbuf" type="struct">
9741 <structure>
9742 <synopsis>
9743 The &lt;CODE&gt;utimbuf&lt;/CODE&gt; structure is used with the &lt;CODE&gt;utime&lt;/CODE&gt; function to
9744 specify new access and modification times for a file. It contains the
9745 following members:
9746 &lt;br&gt;&lt;br&gt;
9747 </synopsis>
9748 <elements>
9749 <element content="time_t actime">
9750 <synopsis>
9751 This is the access time for the file.
9752 &lt;br&gt;&lt;br&gt;
9753 </synopsis>
9754 </element>
9755 </elements>
9756 </structure>
9757 </construct>
9758 <construct id="function-utime" type="function">
9759 <function returntype="int">
9760 <prototype>
9761 <parameter content="const char *filename"/>
9762 <parameter content="const struct utimbuf *times"/>
9763 </prototype>
9764 <headers>
9765 <header filename = "unistd.h"/>
9766 <header filename = "time.h"/>
9767 </headers>
9768 <synopsis>
9769 This function is used to modify the file times associated with the file
9770 named &lt;VAR&gt;filename&lt;/VAR&gt;.
9771 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;times&lt;/VAR&gt; is a null pointer, then the access and modification times
9772 of the file are set to the current time. Otherwise, they are set to the
9773 values from the &lt;CODE&gt;actime&lt;/CODE&gt; and &lt;CODE&gt;modtime&lt;/CODE&gt; members (respectively)
9774 of the &lt;CODE&gt;utimbuf&lt;/CODE&gt; structure pointed to by &lt;VAR&gt;times&lt;/VAR&gt;.
9775 &lt;br&gt;&lt;br&gt; The attribute modification time for the file is set to the current time
9776 in either case (since changing the time stamps is itself a modification
9777 of the file attributes).
9778 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;utime&lt;/CODE&gt; function returns &lt;CODE&gt;0&lt;/CODE&gt; if successful and &lt;CODE&gt;-1&lt;/CODE&gt;
9779 on failure. In addition to the usual file name errors
9780 , the following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions
9781 are defined for this function:
9782 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
9783
9784 &lt;DT&gt;&lt;CODE&gt;EACCES&lt;/CODE&gt;
9785 &lt;DD&gt;
9786 There is a permission problem in the case where a null pointer was
9787 passed as the &lt;VAR&gt;times&lt;/VAR&gt; argument. In order to update the time stamp on
9788 the file, you must either be the owner of the file, have write
9789 permission for the file, or be a privileged user.
9790 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOENT
9791 The file doesn't exist.
9792 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EPERM
9793 If the &lt;VAR&gt;times&lt;/VAR&gt; argument is not a null pointer, you must either be
9794 the owner of the file or be a privileged user.
9795 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
9796 The file lives on a read-only file system.
9797
9798 </synopsis>
9799 </function>
9800 </construct>
9801 <construct id="function-utimes" type="function">
9802 <function returntype="int">
9803 <prototype>
9804 <parameter content="const char *filename"/>
9805 <parameter content="struct timeval tvp[2]"/>
9806 </prototype>
9807 <headers>
9808 <header filename = "sys/time.h"/>
9809 </headers>
9810 <synopsis>
9811 This function sets the file access and modification times of the file
9812 &lt;VAR&gt;filename&lt;/VAR&gt;. The new file access time is specified by
9813 &lt;CODE&gt;&lt;VAR&gt;tvp&lt;/VAR&gt;[0]&lt;/CODE&gt;, and the new modification time by
9814 &lt;CODE&gt;&lt;VAR&gt;tvp&lt;/VAR&gt;[1]&lt;/CODE&gt;. Similar to &lt;CODE&gt;utime&lt;/CODE&gt;, if &lt;VAR&gt;tvp&lt;/VAR&gt; is a null
9815 pointer then the access and modification times of the file are set to
9816 the current time. This function comes from BSD.
9817 &lt;br&gt;&lt;br&gt; The return values and error conditions are the same as for the &lt;CODE&gt;utime&lt;/CODE&gt;
9818 function.
9819 </synopsis>
9820 </function>
9821 </construct>
9822 <construct id="function-lutimes" type="function">
9823 <function returntype="int">
9824 <prototype>
9825 <parameter content="const char *filename"/>
9826 <parameter content="struct timeval tvp[2]"/>
9827 </prototype>
9828 <headers>
9829 <header filename = "sys/time.h"/>
9830 </headers>
9831 <synopsis>
9832 This function is like &lt;CODE&gt;utimes&lt;/CODE&gt;, except that it does not follow
9833 symbolic links. If &lt;VAR&gt;filename&lt;/VAR&gt; is the name of a symbolic link,
9834 &lt;CODE&gt;lutimes&lt;/CODE&gt; sets the file access and modification times of the
9835 symbolic link special file itself (as seen by &lt;CODE&gt;lstat&lt;/CODE&gt;;
9836 ) while &lt;CODE&gt;utimes&lt;/CODE&gt; sets the file access and
9837 modification times of the file the symbolic link refers to. This
9838 function comes from FreeBSD, and is not available on all platforms (if
9839 not available, it will fail with &lt;CODE&gt;ENOSYS&lt;/CODE&gt;).
9840 &lt;br&gt;&lt;br&gt; The return values and error conditions are the same as for the &lt;CODE&gt;utime&lt;/CODE&gt;
9841 function.
9842 </synopsis>
9843 </function>
9844 </construct>
9845 <construct id="function-futimes" type="function">
9846 <function returntype="int">
9847 <prototype>
9848 <parameter content="int fd"/>
9849 <parameter content="struct timeval tvp[2]"/>
9850 </prototype>
9851 <headers>
9852 <header filename = "sys/time.h"/>
9853 </headers>
9854 <synopsis>
9855 This function is like &lt;CODE&gt;utimes&lt;/CODE&gt;, except that it takes an open file
9856 descriptor as an argument instead of a file name. . This function comes from FreeBSD, and is not available on all
9857 platforms (if not available, it will fail with &lt;CODE&gt;ENOSYS&lt;/CODE&gt;).
9858 &lt;br&gt;&lt;br&gt; Like &lt;CODE&gt;utimes&lt;/CODE&gt;, &lt;CODE&gt;futimes&lt;/CODE&gt; returns &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt;
9859 on failure. The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for
9860 &lt;CODE&gt;futimes&lt;/CODE&gt;:
9861 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
9862
9863 &lt;DT&gt;&lt;CODE&gt;EACCES&lt;/CODE&gt;
9864 &lt;DD&gt;
9865 There is a permission problem in the case where a null pointer was
9866 passed as the &lt;VAR&gt;times&lt;/VAR&gt; argument. In order to update the time stamp on
9867 the file, you must either be the owner of the file, have write
9868 permission for the file, or be a privileged user.
9869 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EBADF
9870 The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not a valid file descriptor.
9871 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EPERM
9872 If the &lt;VAR&gt;times&lt;/VAR&gt; argument is not a null pointer, you must either be
9873 the owner of the file or be a privileged user.
9874 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
9875 The file lives on a read-only file system.
9876
9877 </synopsis>
9878 </function>
9879 </construct>
9880 <construct id="function-truncate" type="function">
9881 <function returntype="int">
9882 <prototype>
9883 <parameter content="const char *filename"/>
9884 <parameter content="off_t length"/>
9885 </prototype>
9886 <headers>
9887 <header filename = "unistd.h"/>
9888 </headers>
9889 <synopsis>
9890 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;truncate&lt;/CODE&gt; function changes the size of &lt;VAR&gt;filename&lt;/VAR&gt; to
9891 &lt;VAR&gt;length&lt;/VAR&gt;. If &lt;VAR&gt;length&lt;/VAR&gt; is shorter than the previous length, data
9892 at the end will be lost. The file must be writable by the user to
9893 perform this operation.
9894 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;length&lt;/VAR&gt; is longer, holes will be added to the end. However, some
9895 systems do not support this feature and will leave the file unchanged.
9896 &lt;br&gt;&lt;br&gt; When the source file is compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; the
9897 &lt;CODE&gt;truncate&lt;/CODE&gt; function is in fact &lt;CODE&gt;truncate64&lt;/CODE&gt; and the type
9898 &lt;CODE&gt;off_t&lt;/CODE&gt; has 64 bits which makes it possible to handle files up to
9899 2^63 bytes in length.
9900 &lt;br&gt;&lt;br&gt; The return value is 0 for success, or -1 for an error. In
9901 addition to the usual file name errors, the following errors may occur:
9902 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
9903
9904 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;EACCES&lt;/CODE&gt;
9905 &lt;DD&gt;
9906 The file is a directory or not writable.
9907 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
9908 &lt;VAR&gt;length&lt;/VAR&gt; is negative.
9909 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EFBIG
9910 The operation would extend the file beyond the limits of the operating system.
9911 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EIO
9912 A hardware I/O error occurred.
9913 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EPERM
9914 The file is "append-only" or "immutable".
9915 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINTR
9916 The operation was interrupted by a signal.
9917 &lt;br&gt;&lt;br&gt;
9918 &lt;br&gt;&lt;br&gt;
9919 </synopsis>
9920 </function>
9921 </construct>
9922 <construct id="function-truncate64" type="function">
9923 <function returntype="int">
9924 <prototype>
9925 <parameter content="const char *name"/>
9926 <parameter content="off64_t length"/>
9927 </prototype>
9928 <headers>
9929 <header filename = "unistd.h"/>
9930 </headers>
9931 <synopsis>
9932 This function is similar to the &lt;CODE&gt;truncate&lt;/CODE&gt; function. The
9933 difference is that the &lt;VAR&gt;length&lt;/VAR&gt; argument is 64 bits wide even on 32
9934 bits machines, which allows the handling of files with sizes up to
9935 2^63 bytes.
9936 &lt;br&gt;&lt;br&gt; When the source file is compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a
9937 32 bits machine this function is actually available under the name
9938 &lt;CODE&gt;truncate&lt;/CODE&gt; and so transparently replaces the 32 bits interface.
9939 </synopsis>
9940 </function>
9941 </construct>
9942 <construct id="function-ftruncate" type="function">
9943 <function returntype="int">
9944 <prototype>
9945 <parameter content="int fd"/>
9946 <parameter content="off_t length"/>
9947 </prototype>
9948 <headers>
9949 <header filename = "unistd.h"/>
9950 </headers>
9951 <synopsis>
9952 &lt;br&gt;&lt;br&gt; This is like &lt;CODE&gt;truncate&lt;/CODE&gt;, but it works on a file descriptor &lt;VAR&gt;fd&lt;/VAR&gt;
9953 for an opened file instead of a file name to identify the object. The
9954 file must be opened for writing to successfully carry out the operation.
9955 &lt;br&gt;&lt;br&gt; The POSIX standard leaves it implementation defined what happens if the
9956 specified new &lt;VAR&gt;length&lt;/VAR&gt; of the file is bigger than the original size.
9957 The &lt;CODE&gt;ftruncate&lt;/CODE&gt; function might simply leave the file alone and do
9958 nothing or it can increase the size to the desired size. In this later
9959 case the extended area should be zero-filled. So using &lt;CODE&gt;ftruncate&lt;/CODE&gt;
9960 is no reliable way to increase the file size but if it is possible it is
9961 probably the fastest way. The function also operates on POSIX shared
9962 memory segments if these are implemented by the system.
9963 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;ftruncate&lt;/CODE&gt; is especially useful in combination with &lt;CODE&gt;mmap&lt;/CODE&gt;.
9964 Since the mapped region must have a fixed size one cannot enlarge the
9965 file by writing something beyond the last mapped page. Instead one has
9966 to enlarge the file itself and then remap the file with the new size.
9967 The example below shows how this works.
9968 &lt;br&gt;&lt;br&gt; When the source file is compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; the
9969 &lt;CODE&gt;ftruncate&lt;/CODE&gt; function is in fact &lt;CODE&gt;ftruncate64&lt;/CODE&gt; and the type
9970 &lt;CODE&gt;off_t&lt;/CODE&gt; has 64 bits which makes it possible to handle files up to
9971 2^63 bytes in length.
9972 &lt;br&gt;&lt;br&gt; The return value is 0 for success, or -1 for an error. The
9973 following errors may occur:
9974 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
9975
9976 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
9977 &lt;DD&gt;
9978 &lt;VAR&gt;fd&lt;/VAR&gt; does not correspond to an open file.
9979 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EACCES
9980 &lt;VAR&gt;fd&lt;/VAR&gt; is a directory or not open for writing.
9981 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
9982 &lt;VAR&gt;length&lt;/VAR&gt; is negative.
9983 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EFBIG
9984 The operation would extend the file beyond the limits of the operating system.
9985 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EIO
9986 A hardware I/O error occurred.
9987 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EPERM
9988 The file is "append-only" or "immutable".
9989 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINTR
9990 The operation was interrupted by a signal.
9991 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt;
9992 &lt;br&gt;&lt;br&gt;
9993 </synopsis>
9994 </function>
9995 </construct>
9996 <construct id="function-ftruncate64" type="function">
9997 <function returntype="int">
9998 <prototype>
9999 <parameter content="int id"/>
10000 <parameter content="off64_t length"/>
10001 </prototype>
10002 <headers>
10003 <header filename = "unistd.h"/>
10004 </headers>
10005 <synopsis>
10006 This function is similar to the &lt;CODE&gt;ftruncate&lt;/CODE&gt; function. The
10007 difference is that the &lt;VAR&gt;length&lt;/VAR&gt; argument is 64 bits wide even on 32
10008 bits machines which allows the handling of files with sizes up to
10009 2^63 bytes.
10010 &lt;br&gt;&lt;br&gt; When the source file is compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a
10011 32 bits machine this function is actually available under the name
10012 &lt;CODE&gt;ftruncate&lt;/CODE&gt; and so transparently replaces the 32 bits interface.
10013 </synopsis>
10014 </function>
10015 </construct>
10016 <construct id="function-mknod" type="function">
10017 <function returntype="int">
10018 <prototype>
10019 <parameter content="const char *filename"/>
10020 <parameter content="int mode"/>
10021 <parameter content="int dev"/>
10022 </prototype>
10023 <headers>
10024 <header filename = "sys/stat.h"/>
10025 </headers>
10026 <synopsis>
10027 The &lt;CODE&gt;mknod&lt;/CODE&gt; function makes a special file with name &lt;VAR&gt;filename&lt;/VAR&gt;.
10028 The &lt;VAR&gt;mode&lt;/VAR&gt; specifies the mode of the file, and may include the various
10029 special file bits, such as &lt;CODE&gt;S_IFCHR&lt;/CODE&gt; (for a character special file)
10030 or &lt;CODE&gt;S_IFBLK&lt;/CODE&gt; (for a block special file). .
10031 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;dev&lt;/VAR&gt; argument specifies which device the special file refers to.
10032 Its exact interpretation depends on the kind of special file being created.
10033 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt; on error. In addition
10034 to the usual file name errors , the
10035 following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
10036 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
10037
10038 &lt;DT&gt;&lt;CODE&gt;EPERM&lt;/CODE&gt;
10039 &lt;DD&gt;
10040 The calling process is not privileged. Only the superuser can create
10041 special files.
10042 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOSPC
10043 The directory or file system that would contain the new file is full
10044 and cannot be extended.
10045 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
10046 The directory containing the new file can't be modified because it's on
10047 a read-only file system.
10048 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EEXIST
10049 There is already a file named &lt;VAR&gt;filename&lt;/VAR&gt;. If you want to replace
10050 this file, you must remove the old file explicitly first.
10051
10052 </synopsis>
10053 </function>
10054 </construct>
10055 <construct id="function-tmpfile" type="function">
10056 <function returntype="FILE *">
10057 <prototype>
10058 <parameter content="void"/>
10059 </prototype>
10060 <headers>
10061 <header filename = "stdio.h"/>
10062 </headers>
10063 <synopsis>
10064 This function creates a temporary binary file for update mode, as if by
10065 calling &lt;CODE&gt;fopen&lt;/CODE&gt; with mode &lt;CODE&gt;"wb+"&lt;/CODE&gt;. The file is deleted
10066 automatically when it is closed or when the program terminates. (On
10067 some other ISO C systems the file may fail to be deleted if the program
10068 terminates abnormally).
10069 &lt;br&gt;&lt;br&gt; This function is reentrant.
10070 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a
10071 32-bit system this function is in fact &lt;CODE&gt;tmpfile64&lt;/CODE&gt;, i.e., the LFS
10072 interface transparently replaces the old interface.
10073 </synopsis>
10074 </function>
10075 </construct>
10076 <construct id="function-tmpfile64" type="function">
10077 <function returntype="FILE *">
10078 <prototype>
10079 <parameter content="void"/>
10080 </prototype>
10081 <headers>
10082 <header filename = "stdio.h"/>
10083 </headers>
10084 <synopsis>
10085 This function is similar to &lt;CODE&gt;tmpfile&lt;/CODE&gt;, but the stream it returns a
10086 pointer to was opened using &lt;CODE&gt;tmpfile64&lt;/CODE&gt;. Therefore this stream can
10087 be used for files larger then 2^31 bytes on 32-bit machines.
10088 &lt;br&gt;&lt;br&gt; Please note that the return type is still &lt;CODE&gt;FILE *&lt;/CODE&gt;. There is no
10089 special &lt;CODE&gt;FILE&lt;/CODE&gt; type for the LFS interface.
10090 &lt;br&gt;&lt;br&gt; If the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a 32
10091 bits machine this function is available under the name &lt;CODE&gt;tmpfile&lt;/CODE&gt;
10092 and so transparently replaces the old interface.
10093 </synopsis>
10094 </function>
10095 </construct>
10096 <construct id="function-tmpnam" type="function">
10097 <function returntype="char *">
10098 <prototype>
10099 <parameter content="char *result"/>
10100 </prototype>
10101 <headers>
10102 <header filename = "stdio.h"/>
10103 </headers>
10104 <synopsis>
10105 This function constructs and returns a valid file name that does not
10106 refer to any existing file. If the &lt;VAR&gt;result&lt;/VAR&gt; argument is a null
10107 pointer, the return value is a pointer to an internal static string,
10108 which might be modified by subsequent calls and therefore makes this
10109 function non-reentrant. Otherwise, the &lt;VAR&gt;result&lt;/VAR&gt; argument should be
10110 a pointer to an array of at least &lt;CODE&gt;L_tmpnam&lt;/CODE&gt; characters, and the
10111 result is written into that array.
10112 &lt;br&gt;&lt;br&gt; It is possible for &lt;CODE&gt;tmpnam&lt;/CODE&gt; to fail if you call it too many times
10113 without removing previously-created files. This is because the limited
10114 length of the temporary file names gives room for only a finite number
10115 of different names. If &lt;CODE&gt;tmpnam&lt;/CODE&gt; fails it returns a null pointer.
10116 &lt;br&gt;&lt;br&gt; Warning: Between the time the pathname is constructed and the
10117 file is created another process might have created a file with the same
10118 name using &lt;CODE&gt;tmpnam&lt;/CODE&gt;, leading to a possible security hole. The
10119 implementation generates names which can hardly be predicted, but when
10120 opening the file you should use the &lt;CODE&gt;O_EXCL&lt;/CODE&gt; flag. Using
10121 &lt;CODE&gt;tmpfile&lt;/CODE&gt; or &lt;CODE&gt;mkstemp&lt;/CODE&gt; is a safe way to avoid this problem.
10122 </synopsis>
10123 </function>
10124 </construct>
10125 <construct id="function-tmpnam_r" type="function">
10126 <function returntype="char *">
10127 <prototype>
10128 <parameter content="char *result"/>
10129 </prototype>
10130 <headers>
10131 <header filename = "stdio.h"/>
10132 </headers>
10133 <synopsis>
10134 This function is nearly identical to the &lt;CODE&gt;tmpnam&lt;/CODE&gt; function, except
10135 that if &lt;VAR&gt;result&lt;/VAR&gt; is a null pointer it returns a null pointer.
10136 &lt;br&gt;&lt;br&gt; This guarantees reentrancy because the non-reentrant situation of
10137 &lt;CODE&gt;tmpnam&lt;/CODE&gt; cannot happen here.
10138 &lt;br&gt;&lt;br&gt; &lt;h3&gt;Warning&lt;/h3&gt;: This function has the same security problems as
10139 &lt;CODE&gt;tmpnam&lt;/CODE&gt;.
10140 </synopsis>
10141 </function>
10142 </construct>
10143 <construct id="function-tempnam" type="function">
10144 <function returntype="char *">
10145 <prototype>
10146 <parameter content="const char *dir"/>
10147 <parameter content="const char *prefix"/>
10148 </prototype>
10149 <headers>
10150 <header filename = "stdio.h"/>
10151 </headers>
10152 <synopsis>
10153 This function generates a unique temporary file name. If &lt;VAR&gt;prefix&lt;/VAR&gt;
10154 is not a null pointer, up to five characters of this string are used as
10155 a prefix for the file name. The return value is a string newly
10156 allocated with &lt;CODE&gt;malloc&lt;/CODE&gt;, so you should release its storage with
10157 &lt;CODE&gt;free&lt;/CODE&gt; when it is no longer needed.
10158 &lt;br&gt;&lt;br&gt; Because the string is dynamically allocated this function is reentrant.
10159 &lt;br&gt;&lt;br&gt; The directory prefix for the temporary file name is determined by
10160 testing each of the following in sequence. The directory must exist and
10161 be writable.
10162 &lt;br&gt;&lt;br&gt; &lt;OL&gt;
10163 &lt;LI&gt;
10164 The environment variable &lt;CODE&gt;TMPDIR&lt;/CODE&gt;, if it is defined. For security
10165 reasons this only happens if the program is not SUID or SGID enabled.
10166 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
10167 The &lt;VAR&gt;dir&lt;/VAR&gt; argument, if it is not a null pointer.
10168 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
10169 The value of the &lt;CODE&gt;P_tmpdir&lt;/CODE&gt; macro.
10170 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
10171 The directory &lt;TT&gt;/tmp&lt;/TT&gt;.
10172 &lt;/OL&gt;
10173 &lt;br&gt;&lt;br&gt; This function is defined for SVID compatibility.
10174 &lt;br&gt;&lt;br&gt; Warning: Between the time the pathname is constructed and the
10175 file is created another process might have created a file with the same
10176 name using &lt;CODE&gt;tempnam&lt;/CODE&gt;, leading to a possible security hole. The
10177 implementation generates names which can hardly be predicted, but when
10178 opening the file you should use the &lt;CODE&gt;O_EXCL&lt;/CODE&gt; flag. Using
10179 &lt;CODE&gt;tmpfile&lt;/CODE&gt; or &lt;CODE&gt;mkstemp&lt;/CODE&gt; is a safe way to avoid this problem.
10180 </synopsis>
10181 </function>
10182 </construct>
10183 <construct id="function-mktemp" type="function">
10184 <function returntype="char *">
10185 <prototype>
10186 <parameter content="char *template"/>
10187 </prototype>
10188 <headers>
10189 <header filename = "stdio.h"/>
10190 <header filename = "stdlib.h"/>
10191 </headers>
10192 <synopsis>
10193 The &lt;CODE&gt;mktemp&lt;/CODE&gt; function generates a unique file name by modifying
10194 &lt;VAR&gt;template&lt;/VAR&gt; as described above. If successful, it returns
10195 &lt;VAR&gt;template&lt;/VAR&gt; as modified. If &lt;CODE&gt;mktemp&lt;/CODE&gt; cannot find a unique file
10196 name, it makes &lt;VAR&gt;template&lt;/VAR&gt; an empty string and returns that. If
10197 &lt;VAR&gt;template&lt;/VAR&gt; does not end with &lt;samp&gt;XXXXXX&lt;/samp&gt;, &lt;CODE&gt;mktemp&lt;/CODE&gt; returns a
10198 null pointer.
10199 &lt;br&gt;&lt;br&gt; Warning: Between the time the pathname is constructed and the
10200 file is created another process might have created a file with the same
10201 name using &lt;CODE&gt;mktemp&lt;/CODE&gt;, leading to a possible security hole. The
10202 implementation generates names which can hardly be predicted, but when
10203 opening the file you should use the &lt;CODE&gt;O_EXCL&lt;/CODE&gt; flag. Using
10204 &lt;CODE&gt;mkstemp&lt;/CODE&gt; is a safe way to avoid this problem.
10205 </synopsis>
10206 </function>
10207 </construct>
10208 <construct id="function-mkstemp" type="function">
10209 <function returntype="int">
10210 <prototype>
10211 <parameter content="char *template"/>
10212 </prototype>
10213 <headers>
10214 <header filename = "stdlib.h"/>
10215 </headers>
10216 <synopsis>
10217 The &lt;CODE&gt;mkstemp&lt;/CODE&gt; function generates a unique file name just as
10218 &lt;CODE&gt;mktemp&lt;/CODE&gt; does, but it also opens the file for you with &lt;CODE&gt;open&lt;/CODE&gt;
10219 . If successful, it modifies
10220 &lt;VAR&gt;template&lt;/VAR&gt; in place and returns a file descriptor for that file open
10221 for reading and writing. If &lt;CODE&gt;mkstemp&lt;/CODE&gt; cannot create a
10222 uniquely-named file, it returns &lt;CODE&gt;-1&lt;/CODE&gt;. If &lt;VAR&gt;template&lt;/VAR&gt; does not
10223 end with &lt;samp&gt;XXXXXX&lt;/samp&gt;, &lt;CODE&gt;mkstemp&lt;/CODE&gt; returns &lt;CODE&gt;-1&lt;/CODE&gt; and does not
10224 modify &lt;VAR&gt;template&lt;/VAR&gt;.
10225 &lt;br&gt;&lt;br&gt; The file is opened using mode &lt;CODE&gt;0600&lt;/CODE&gt;. If the file is meant to be
10226 used by other users this mode must be changed explicitly.
10227 </synopsis>
10228 </function>
10229 </construct>
10230 <construct id="function-mkdtemp" type="function">
10231 <function returntype="char *">
10232 <prototype>
10233 <parameter content="char *template"/>
10234 </prototype>
10235 <headers>
10236 <header filename = "stdlib.h"/>
10237 </headers>
10238 <synopsis>
10239 The &lt;CODE&gt;mkdtemp&lt;/CODE&gt; function creates a directory with a unique name. If
10240 it succeeds, it overwrites &lt;VAR&gt;template&lt;/VAR&gt; with the name of the
10241 directory, and returns &lt;VAR&gt;template&lt;/VAR&gt;. As with &lt;CODE&gt;mktemp&lt;/CODE&gt; and
10242 &lt;CODE&gt;mkstemp&lt;/CODE&gt;, &lt;VAR&gt;template&lt;/VAR&gt; should be a string ending with
10243 &lt;samp&gt;XXXXXX&lt;/samp&gt;.
10244 &lt;br&gt;&lt;br&gt; If &lt;CODE&gt;mkdtemp&lt;/CODE&gt; cannot create an uniquely named directory, it returns
10245 &lt;CODE&gt;NULL&lt;/CODE&gt; and sets &lt;VAR&gt;errno&lt;/VAR&gt; appropriately. If &lt;VAR&gt;template&lt;/VAR&gt; does
10246 not end with &lt;samp&gt;XXXXXX&lt;/samp&gt;, &lt;CODE&gt;mkdtemp&lt;/CODE&gt; returns &lt;CODE&gt;NULL&lt;/CODE&gt; and does
10247 not modify &lt;VAR&gt;template&lt;/VAR&gt;. &lt;VAR&gt;errno&lt;/VAR&gt; will be set to &lt;CODE&gt;EINVAL&lt;/CODE&gt; in
10248 this case.
10249 &lt;br&gt;&lt;br&gt; The directory is created using mode &lt;CODE&gt;0700&lt;/CODE&gt;.
10250 </synopsis>
10251 </function>
10252 </construct>
10253 <construct id="function-strsignal" type="function">
10254 <function returntype="char *">
10255 <prototype>
10256 <parameter content="int signum"/>
10257 </prototype>
10258 <headers>
10259 <header filename = "signal.h"/>
10260 <header filename = "string.h"/>
10261 </headers>
10262 <synopsis>
10263 This function returns a pointer to a statically-allocated string
10264 containing a message describing the signal &lt;VAR&gt;signum&lt;/VAR&gt;. You
10265 should not modify the contents of this string; and, since it can be
10266 rewritten on subsequent calls, you should save a copy of it if you need
10267 to reference it later.
10268 &lt;br&gt;&lt;br&gt; This function is a GNU extension, declared in the header file
10269 &lt;TT&gt;string.h&lt;/TT&gt;.
10270 </synopsis>
10271 </function>
10272 </construct>
10273 <construct id="function-psignal" type="function">
10274 <function returntype="void">
10275 <prototype>
10276 <parameter content="int signum"/>
10277 <parameter content="const char *message"/>
10278 </prototype>
10279 <headers>
10280 <header filename = "signal.h"/>
10281 </headers>
10282 <synopsis>
10283 This function prints a message describing the signal &lt;VAR&gt;signum&lt;/VAR&gt; to the
10284 standard error output stream &lt;CODE&gt;stderr&lt;/CODE&gt;; see Standard Streams.
10285 &lt;br&gt;&lt;br&gt; If you call &lt;CODE&gt;psignal&lt;/CODE&gt; with a &lt;VAR&gt;message&lt;/VAR&gt; that is either a null
10286 pointer or an empty string, &lt;CODE&gt;psignal&lt;/CODE&gt; just prints the message
10287 corresponding to &lt;VAR&gt;signum&lt;/VAR&gt;, adding a trailing newline.
10288 &lt;br&gt;&lt;br&gt; If you supply a non-null &lt;VAR&gt;message&lt;/VAR&gt; argument, then &lt;CODE&gt;psignal&lt;/CODE&gt;
10289 prefixes its output with this string. It adds a colon and a space
10290 character to separate the &lt;VAR&gt;message&lt;/VAR&gt; from the string corresponding
10291 to &lt;VAR&gt;signum&lt;/VAR&gt;.
10292 &lt;br&gt;&lt;br&gt; This function is a BSD feature, declared in the header file &lt;TT&gt;signal.h&lt;/TT&gt;.
10293 </synopsis>
10294 </function>
10295 </construct>
10296 <construct id="dtype-sighandler_t" type="dtype">
10297 <structure>
10298 </structure>
10299 </construct>
10300 <construct id="function-signal" type="function">
10301 <function returntype="sighandler_t">
10302 <prototype>
10303 <parameter content="int signum"/>
10304 <parameter content="sighandler_t action"/>
10305 </prototype>
10306 <headers>
10307 <header filename = "signal.h"/>
10308 </headers>
10309 <synopsis>
10310 The &lt;CODE&gt;signal&lt;/CODE&gt; function establishes &lt;VAR&gt;action&lt;/VAR&gt; as the action for
10311 the signal &lt;VAR&gt;signum&lt;/VAR&gt;.
10312 &lt;br&gt;&lt;br&gt; The first argument, &lt;VAR&gt;signum&lt;/VAR&gt;, identifies the signal whose behavior
10313 you want to control, and should be a signal number. The proper way to
10314 specify a signal number is with one of the symbolic signal names
10315 ---don't use an explicit number, because
10316 the numerical code for a given kind of signal may vary from operating
10317 system to operating system.
10318 &lt;br&gt;&lt;br&gt; The second argument, &lt;VAR&gt;action&lt;/VAR&gt;, specifies the action to use for the
10319 signal &lt;VAR&gt;signum&lt;/VAR&gt;. This can be one of the following:
10320 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
10321
10322 &lt;DT&gt;&lt;CODE&gt;SIG_DFL&lt;/CODE&gt;
10323 &lt;DD&gt;
10324
10325 action for a signal
10326 &lt;CODE&gt;SIG_DFL&lt;/CODE&gt; specifies the default action for the particular signal.
10327 The default actions for various kinds of signals are stated in
10328 Standard Signals.
10329 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;SIG_IGN&lt;/CODE&gt;
10330 &lt;DD&gt;
10331
10332 action for a signal
10333 &lt;CODE&gt;SIG_IGN&lt;/CODE&gt; specifies that the signal should be ignored.
10334 &lt;br&gt;&lt;br&gt; Your program generally should not ignore signals that represent serious
10335 events or that are normally used to request termination. You cannot
10336 ignore the &lt;CODE&gt;SIGKILL&lt;/CODE&gt; or &lt;CODE&gt;SIGSTOP&lt;/CODE&gt; signals at all. You can
10337 ignore program error signals like &lt;CODE&gt;SIGSEGV&lt;/CODE&gt;, but ignoring the error
10338 won't enable the program to continue executing meaningfully. Ignoring
10339 user requests such as &lt;CODE&gt;SIGINT&lt;/CODE&gt;, &lt;CODE&gt;SIGQUIT&lt;/CODE&gt;, and &lt;CODE&gt;SIGTSTP&lt;/CODE&gt;
10340 is unfriendly.
10341 &lt;br&gt;&lt;br&gt; When you do not wish signals to be delivered during a certain part of
10342 the program, the thing to do is to block them, not ignore them.
10343 .
10344 &lt;br&gt;&lt;br&gt; &lt;LI&gt; &lt;VAR&gt;handler&lt;/VAR&gt;
10345 Supply the address of a handler function in your program, to specify
10346 running this handler as the way to deliver the signal.
10347 &lt;br&gt;&lt;br&gt; For more information about defining signal handler functions,
10348 see Defining Handlers.
10349
10350 &lt;br&gt;&lt;br&gt; If you set the action for a signal to &lt;CODE&gt;SIG_IGN&lt;/CODE&gt;, or if you set it
10351 to &lt;CODE&gt;SIG_DFL&lt;/CODE&gt; and the default action is to ignore that signal, then
10352 any pending signals of that type are discarded (even if they are
10353 blocked). Discarding the pending signals means that they will never be
10354 delivered, not even if you subsequently specify another action and
10355 unblock this kind of signal.
10356 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;signal&lt;/CODE&gt; function returns the action that was previously in
10357 effect for the specified &lt;VAR&gt;signum&lt;/VAR&gt;. You can save this value and
10358 restore it later by calling &lt;CODE&gt;signal&lt;/CODE&gt; again.
10359 &lt;br&gt;&lt;br&gt; If &lt;CODE&gt;signal&lt;/CODE&gt; can't honor the request, it returns &lt;CODE&gt;SIG_ERR&lt;/CODE&gt;
10360 instead. The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for
10361 this function:
10362 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
10363
10364 &lt;LI&gt; EINVAL
10365 You specified an invalid &lt;VAR&gt;signum&lt;/VAR&gt;; or you tried to ignore or provide
10366 a handler for &lt;CODE&gt;SIGKILL&lt;/CODE&gt; or &lt;CODE&gt;SIGSTOP&lt;/CODE&gt;.
10367
10368 </synopsis>
10369 </function>
10370 </construct>
10371 <construct id="function-sysv_signal" type="function">
10372 <function returntype="sighandler_t">
10373 <prototype>
10374 <parameter content="int signum"/>
10375 <parameter content="sighandler_t action"/>
10376 </prototype>
10377 <headers>
10378 <header filename = "signal.h"/>
10379 </headers>
10380 <synopsis>
10381 The &lt;CODE&gt;sysv_signal&lt;/CODE&gt; implements the behavior of the standard
10382 &lt;CODE&gt;signal&lt;/CODE&gt; function as found on SVID systems. The difference to BSD
10383 systems is that the handler is deinstalled after a delivery of a signal.
10384 &lt;br&gt;&lt;br&gt; Compatibility Note: As said above for &lt;CODE&gt;signal&lt;/CODE&gt;, this
10385 function should be avoided when possible. &lt;CODE&gt;sigaction&lt;/CODE&gt; is the
10386 preferred method.
10387 </synopsis>
10388 </function>
10389 </construct>
10390 <construct id="function-ssignal" type="function">
10391 <function returntype="sighandler_t">
10392 <prototype>
10393 <parameter content="int signum"/>
10394 <parameter content="sighandler_t action"/>
10395 </prototype>
10396 <headers>
10397 <header filename = "signal.h"/>
10398 </headers>
10399 <synopsis>
10400 The &lt;CODE&gt;ssignal&lt;/CODE&gt; function does the same thing as &lt;CODE&gt;signal&lt;/CODE&gt;; it is
10401 provided only for compatibility with SVID.
10402 </synopsis>
10403 </function>
10404 </construct>
10405 <construct id="struct-sigaction" type="struct">
10406 <structure>
10407 <synopsis>
10408 Structures of type &lt;CODE&gt;struct sigaction&lt;/CODE&gt; are used in the
10409 &lt;CODE&gt;sigaction&lt;/CODE&gt; function to specify all the information about how to
10410 handle a particular signal. This structure contains at least the
10411 following members:
10412 &lt;br&gt;&lt;br&gt;
10413 </synopsis>
10414 <elements>
10415 <element content="sighandler_t sa_handler">
10416 <synopsis>
10417 This is used in the same way as the &lt;VAR&gt;action&lt;/VAR&gt; argument to the
10418 &lt;CODE&gt;signal&lt;/CODE&gt; function. The value can be &lt;CODE&gt;SIG_DFL&lt;/CODE&gt;,
10419 &lt;CODE&gt;SIG_IGN&lt;/CODE&gt;, or a function pointer. .
10420 &lt;br&gt;&lt;br&gt;
10421 </synopsis>
10422 </element>
10423 <element content="sigset_t sa_mask">
10424 <synopsis>
10425 This specifies a set of signals to be blocked while the handler runs.
10426 Blocking is explained in Blocking for Handler. Note that the
10427 signal that was delivered is automatically blocked by default before its
10428 handler is started; this is true regardless of the value in
10429 &lt;CODE&gt;sa_mask&lt;/CODE&gt;. If you want that signal not to be blocked within its
10430 handler, you must write code in the handler to unblock it.
10431 &lt;br&gt;&lt;br&gt;
10432 </synopsis>
10433 </element>
10434 </elements>
10435 </structure>
10436 </construct>
10437 <construct id="function-sigaction" type="function">
10438 <function returntype="int">
10439 <prototype>
10440 <parameter content="int signum"/>
10441 <parameter content="const struct sigaction *restrict action"/>
10442 <parameter content="struct sigaction *restrict old-action"/>
10443 </prototype>
10444 <headers>
10445 <header filename = "signal.h"/>
10446 </headers>
10447 <synopsis>
10448 The &lt;VAR&gt;action&lt;/VAR&gt; argument is used to set up a new action for the signal
10449 &lt;VAR&gt;signum&lt;/VAR&gt;, while the &lt;VAR&gt;old-action&lt;/VAR&gt; argument is used to return
10450 information about the action previously associated with this symbol.
10451 (In other words, &lt;VAR&gt;old-action&lt;/VAR&gt; has the same purpose as the
10452 &lt;CODE&gt;signal&lt;/CODE&gt; function's return value---you can check to see what the
10453 old action in effect for the signal was, and restore it later if you
10454 want.)
10455 &lt;br&gt;&lt;br&gt; Either &lt;VAR&gt;action&lt;/VAR&gt; or &lt;VAR&gt;old-action&lt;/VAR&gt; can be a null pointer. If
10456 &lt;VAR&gt;old-action&lt;/VAR&gt; is a null pointer, this simply suppresses the return
10457 of information about the old action. If &lt;VAR&gt;action&lt;/VAR&gt; is a null pointer,
10458 the action associated with the signal &lt;VAR&gt;signum&lt;/VAR&gt; is unchanged; this
10459 allows you to inquire about how a signal is being handled without changing
10460 that handling.
10461 &lt;br&gt;&lt;br&gt; The return value from &lt;CODE&gt;sigaction&lt;/CODE&gt; is zero if it succeeds, and
10462 &lt;CODE&gt;-1&lt;/CODE&gt; on failure. The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are
10463 defined for this function:
10464 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
10465
10466 &lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
10467 &lt;DD&gt;
10468 The &lt;VAR&gt;signum&lt;/VAR&gt; argument is not valid, or you are trying to
10469 trap or ignore &lt;CODE&gt;SIGKILL&lt;/CODE&gt; or &lt;CODE&gt;SIGSTOP&lt;/CODE&gt;.
10470
10471 </synopsis>
10472 </function>
10473 </construct>
10474 <construct id="dtype-sig_atomic_t" type="dtype">
10475 <structure>
10476 </structure>
10477 </construct>
10478 <construct id="function-raise" type="function">
10479 <function returntype="int">
10480 <prototype>
10481 <parameter content="int signum"/>
10482 </prototype>
10483 <headers>
10484 <header filename = "signal.h"/>
10485 <header filename = "unistd.h"/>
10486 </headers>
10487 <synopsis>
10488 The &lt;CODE&gt;raise&lt;/CODE&gt; function sends the signal &lt;VAR&gt;signum&lt;/VAR&gt; to the calling
10489 process. It returns zero if successful and a nonzero value if it fails.
10490 About the only reason for failure would be if the value of &lt;VAR&gt;signum&lt;/VAR&gt;
10491 is invalid.
10492 </synopsis>
10493 </function>
10494 </construct>
10495 <construct id="function-gsignal" type="function">
10496 <function returntype="int">
10497 <prototype>
10498 <parameter content="int signum"/>
10499 </prototype>
10500 <headers>
10501 <header filename = "signal.h"/>
10502 </headers>
10503 <synopsis>
10504 The &lt;CODE&gt;gsignal&lt;/CODE&gt; function does the same thing as &lt;CODE&gt;raise&lt;/CODE&gt;; it is
10505 provided only for compatibility with SVID.
10506 </synopsis>
10507 </function>
10508 </construct>
10509 <construct id="function-kill" type="function">
10510 <function returntype="int">
10511 <prototype>
10512 <parameter content="pid_t pid"/>
10513 <parameter content="int signum"/>
10514 </prototype>
10515 <headers>
10516 <header filename = "signal.h"/>
10517 </headers>
10518 <synopsis>
10519 The &lt;CODE&gt;kill&lt;/CODE&gt; function sends the signal &lt;VAR&gt;signum&lt;/VAR&gt; to the process
10520 or process group specified by &lt;VAR&gt;pid&lt;/VAR&gt;. Besides the signals listed in
10521 Standard Signals, &lt;VAR&gt;signum&lt;/VAR&gt; can also have a value of zero to
10522 check the validity of the &lt;VAR&gt;pid&lt;/VAR&gt;.
10523 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;pid&lt;/VAR&gt; specifies the process or process group to receive the
10524 signal:
10525 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
10526
10527 &lt;DT&gt;&lt;CODE&gt;&lt;VAR&gt;pid&lt;/VAR&gt; &gt; 0&lt;/CODE&gt;
10528 &lt;DD&gt;
10529 The process whose identifier is &lt;VAR&gt;pid&lt;/VAR&gt;.
10530 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;&lt;VAR&gt;pid&lt;/VAR&gt; == 0&lt;/CODE&gt;
10531 &lt;DD&gt;
10532 All processes in the same process group as the sender.
10533 &lt;br&gt;&lt;br&gt; &lt;LI&gt; &lt;VAR&gt;pid&lt;/VAR&gt; &lt; -1
10534 The process group whose identifier is &lt;VAR&gt;pid&lt;/VAR&gt;.
10535 &lt;br&gt;&lt;br&gt; &lt;LI&gt; &lt;VAR&gt;pid&lt;/VAR&gt; == -1
10536 If the process is privileged, send the signal to all processes except
10537 for some special system processes. Otherwise, send the signal to all
10538 processes with the same effective user ID.
10539
10540 &lt;br&gt;&lt;br&gt; A process can send a signal to itself with a call like &lt;CODE&gt;kill
10541 (getpid(), &lt;VAR&gt;signum&lt;/VAR&gt;)&lt;/CODE&gt;. If &lt;CODE&gt;kill&lt;/CODE&gt; is used by a process to send
10542 a signal to itself, and the signal is not blocked, then &lt;CODE&gt;kill&lt;/CODE&gt;
10543 delivers at least one signal (which might be some other pending
10544 unblocked signal instead of the signal &lt;VAR&gt;signum&lt;/VAR&gt;) to that process
10545 before it returns.
10546 &lt;br&gt;&lt;br&gt; The return value from &lt;CODE&gt;kill&lt;/CODE&gt; is zero if the signal can be sent
10547 successfully. Otherwise, no signal is sent, and a value of &lt;CODE&gt;-1&lt;/CODE&gt; is
10548 returned. If &lt;VAR&gt;pid&lt;/VAR&gt; specifies sending a signal to several processes,
10549 &lt;CODE&gt;kill&lt;/CODE&gt; succeeds if it can send the signal to at least one of them.
10550 There's no way you can tell which of the processes got the signal
10551 or whether all of them did.
10552 &lt;br&gt;&lt;br&gt; The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
10553 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
10554
10555 &lt;LI&gt; EINVAL
10556 The &lt;VAR&gt;signum&lt;/VAR&gt; argument is an invalid or unsupported number.
10557 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EPERM
10558 You do not have the privilege to send a signal to the process or any of
10559 the processes in the process group named by &lt;VAR&gt;pid&lt;/VAR&gt;.
10560 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ESRCH
10561 The &lt;VAR&gt;pid&lt;/VAR&gt; argument does not refer to an existing process or group.
10562
10563 </synopsis>
10564 </function>
10565 </construct>
10566 <construct id="function-killpg" type="function">
10567 <function returntype="int">
10568 <prototype>
10569 <parameter content="int pgid"/>
10570 <parameter content="int signum"/>
10571 </prototype>
10572 <headers>
10573 <header filename = "signal.h"/>
10574 </headers>
10575 <synopsis>
10576 This is similar to &lt;CODE&gt;kill&lt;/CODE&gt;, but sends signal &lt;VAR&gt;signum&lt;/VAR&gt; to the
10577 process group &lt;VAR&gt;pgid&lt;/VAR&gt;. This function is provided for compatibility
10578 with BSD; using &lt;CODE&gt;kill&lt;/CODE&gt; to do this is more portable.
10579 </synopsis>
10580 </function>
10581 </construct>
10582 <construct id="dtype-sigset_t" type="dtype">
10583 <structure>
10584 </structure>
10585 </construct>
10586 <construct id="function-sigemptyset" type="function">
10587 <function returntype="int">
10588 <prototype>
10589 <parameter content="sigset_t *set"/>
10590 </prototype>
10591 <headers>
10592 <header filename = "signal.h"/>
10593 </headers>
10594 <synopsis>
10595 This function initializes the signal set &lt;VAR&gt;set&lt;/VAR&gt; to exclude all of the
10596 defined signals. It always returns &lt;CODE&gt;0&lt;/CODE&gt;.
10597 </synopsis>
10598 </function>
10599 </construct>
10600 <construct id="function-sigfillset" type="function">
10601 <function returntype="int">
10602 <prototype>
10603 <parameter content="sigset_t *set"/>
10604 </prototype>
10605 <headers>
10606 <header filename = "signal.h"/>
10607 </headers>
10608 <synopsis>
10609 This function initializes the signal set &lt;VAR&gt;set&lt;/VAR&gt; to include
10610 all of the defined signals. Again, the return value is &lt;CODE&gt;0&lt;/CODE&gt;.
10611 </synopsis>
10612 </function>
10613 </construct>
10614 <construct id="function-sigaddset" type="function">
10615 <function returntype="int">
10616 <prototype>
10617 <parameter content="sigset_t *set"/>
10618 <parameter content="int signum"/>
10619 </prototype>
10620 <headers>
10621 <header filename = "signal.h"/>
10622 </headers>
10623 <synopsis>
10624 This function adds the signal &lt;VAR&gt;signum&lt;/VAR&gt; to the signal set &lt;VAR&gt;set&lt;/VAR&gt;.
10625 All &lt;CODE&gt;sigaddset&lt;/CODE&gt; does is modify &lt;VAR&gt;set&lt;/VAR&gt;; it does not block or
10626 unblock any signals.
10627 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt; on failure.
10628 The following &lt;CODE&gt;errno&lt;/CODE&gt; error condition is defined for this function:
10629 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
10630
10631 &lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
10632 &lt;DD&gt;
10633 The &lt;VAR&gt;signum&lt;/VAR&gt; argument doesn't specify a valid signal.
10634
10635 </synopsis>
10636 </function>
10637 </construct>
10638 <construct id="function-sigdelset" type="function">
10639 <function returntype="int">
10640 <prototype>
10641 <parameter content="sigset_t *set"/>
10642 <parameter content="int signum"/>
10643 </prototype>
10644 <headers>
10645 <header filename = "signal.h"/>
10646 </headers>
10647 <synopsis>
10648 This function removes the signal &lt;VAR&gt;signum&lt;/VAR&gt; from the signal set
10649 &lt;VAR&gt;set&lt;/VAR&gt;. All &lt;CODE&gt;sigdelset&lt;/CODE&gt; does is modify &lt;VAR&gt;set&lt;/VAR&gt;; it does not
10650 block or unblock any signals. The return value and error conditions are
10651 the same as for &lt;CODE&gt;sigaddset&lt;/CODE&gt;.
10652 </synopsis>
10653 </function>
10654 </construct>
10655 <construct id="function-sigismember" type="function">
10656 <function returntype="int">
10657 <prototype>
10658 <parameter content="const sigset_t *set"/>
10659 <parameter content="int signum"/>
10660 </prototype>
10661 <headers>
10662 <header filename = "signal.h"/>
10663 </headers>
10664 <synopsis>
10665 The &lt;CODE&gt;sigismember&lt;/CODE&gt; function tests whether the signal &lt;VAR&gt;signum&lt;/VAR&gt; is
10666 a member of the signal set &lt;VAR&gt;set&lt;/VAR&gt;. It returns &lt;CODE&gt;1&lt;/CODE&gt; if the signal
10667 is in the set, &lt;CODE&gt;0&lt;/CODE&gt; if not, and &lt;CODE&gt;-1&lt;/CODE&gt; if there is an error.
10668 &lt;br&gt;&lt;br&gt; The following &lt;CODE&gt;errno&lt;/CODE&gt; error condition is defined for this function:
10669 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
10670
10671 &lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
10672 &lt;DD&gt;
10673 The &lt;VAR&gt;signum&lt;/VAR&gt; argument doesn't specify a valid signal.
10674
10675 </synopsis>
10676 </function>
10677 </construct>
10678 <construct id="function-sigprocmask" type="function">
10679 <function returntype="int">
10680 <prototype>
10681 <parameter content="int how"/>
10682 <parameter content="const sigset_t *restrict set"/>
10683 <parameter content="sigset_t *restrict oldset"/>
10684 </prototype>
10685 <headers>
10686 <header filename = "signal.h"/>
10687 </headers>
10688 <synopsis>
10689 The &lt;CODE&gt;sigprocmask&lt;/CODE&gt; function is used to examine or change the calling
10690 process's signal mask. The &lt;VAR&gt;how&lt;/VAR&gt; argument determines how the signal
10691 mask is changed, and must be one of the following values:
10692 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
10693
10694
10695 &lt;DT&gt;&lt;CODE&gt;SIG_BLOCK&lt;/CODE&gt;
10696 &lt;DD&gt;
10697 Block the signals in &lt;CODE&gt;set&lt;/CODE&gt;---add them to the existing mask. In
10698 other words, the new mask is the union of the existing mask and
10699 &lt;VAR&gt;set&lt;/VAR&gt;.
10700 &lt;br&gt;&lt;br&gt;
10701 &lt;DT&gt;&lt;CODE&gt;SIG_UNBLOCK&lt;/CODE&gt;
10702 &lt;DD&gt;
10703 Unblock the signals in &lt;VAR&gt;set&lt;/VAR&gt;---remove them from the existing mask.
10704 &lt;br&gt;&lt;br&gt;
10705 &lt;LI&gt; SIG_SETMASK
10706 Use &lt;VAR&gt;set&lt;/VAR&gt; for the mask; ignore the previous value of the mask.
10707
10708 &lt;br&gt;&lt;br&gt; The last argument, &lt;VAR&gt;oldset&lt;/VAR&gt;, is used to return information about the
10709 old process signal mask. If you just want to change the mask without
10710 looking at it, pass a null pointer as the &lt;VAR&gt;oldset&lt;/VAR&gt; argument.
10711 Similarly, if you want to know what's in the mask without changing it,
10712 pass a null pointer for &lt;VAR&gt;set&lt;/VAR&gt; (in this case the &lt;VAR&gt;how&lt;/VAR&gt; argument
10713 is not significant). The &lt;VAR&gt;oldset&lt;/VAR&gt; argument is often used to
10714 remember the previous signal mask in order to restore it later. (Since
10715 the signal mask is inherited over &lt;CODE&gt;fork&lt;/CODE&gt; and &lt;CODE&gt;exec&lt;/CODE&gt; calls, you
10716 can't predict what its contents are when your program starts running.)
10717 &lt;br&gt;&lt;br&gt; If invoking &lt;CODE&gt;sigprocmask&lt;/CODE&gt; causes any pending signals to be
10718 unblocked, at least one of those signals is delivered to the process
10719 before &lt;CODE&gt;sigprocmask&lt;/CODE&gt; returns. The order in which pending signals
10720 are delivered is not specified, but you can control the order explicitly
10721 by making multiple &lt;CODE&gt;sigprocmask&lt;/CODE&gt; calls to unblock various signals
10722 one at a time.
10723 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;sigprocmask&lt;/CODE&gt; function returns &lt;CODE&gt;0&lt;/CODE&gt; if successful, and &lt;CODE&gt;-1&lt;/CODE&gt;
10724 to indicate an error. The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are
10725 defined for this function:
10726 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
10727
10728 &lt;LI&gt; EINVAL
10729 The &lt;VAR&gt;how&lt;/VAR&gt; argument is invalid.
10730
10731 &lt;br&gt;&lt;br&gt; You can't block the &lt;CODE&gt;SIGKILL&lt;/CODE&gt; and &lt;CODE&gt;SIGSTOP&lt;/CODE&gt; signals, but
10732 if the signal set includes these, &lt;CODE&gt;sigprocmask&lt;/CODE&gt; just ignores
10733 them instead of returning an error status.
10734 &lt;br&gt;&lt;br&gt; Remember, too, that blocking program error signals such as &lt;CODE&gt;SIGFPE&lt;/CODE&gt;
10735 leads to undesirable results for signals generated by an actual program
10736 error (as opposed to signals sent with &lt;CODE&gt;raise&lt;/CODE&gt; or &lt;CODE&gt;kill&lt;/CODE&gt;).
10737 This is because your program may be too broken to be able to continue
10738 executing to a point where the signal is unblocked again.
10739 .
10740 </synopsis>
10741 </function>
10742 </construct>
10743 <construct id="function-sigpending" type="function">
10744 <function returntype="int">
10745 <prototype>
10746 <parameter content="sigset_t *set"/>
10747 </prototype>
10748 <headers>
10749 <header filename = "signal.h"/>
10750 </headers>
10751 <synopsis>
10752 The &lt;CODE&gt;sigpending&lt;/CODE&gt; function stores information about pending signals
10753 in &lt;VAR&gt;set&lt;/VAR&gt;. If there is a pending signal that is blocked from
10754 delivery, then that signal is a member of the returned set. (You can
10755 test whether a particular signal is a member of this set using
10756 &lt;CODE&gt;sigismember&lt;/CODE&gt;; see Signal Sets.)
10757 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; if successful, and &lt;CODE&gt;-1&lt;/CODE&gt; on failure.
10758 </synopsis>
10759 </function>
10760 </construct>
10761 <construct id="function-pause" type="function">
10762 <function returntype="int">
10763 <prototype>
10764 <parameter content=""/>
10765 </prototype>
10766 <headers>
10767 <header filename = "unistd.h"/>
10768 </headers>
10769 <synopsis>
10770 The &lt;CODE&gt;pause&lt;/CODE&gt; function suspends program execution until a signal
10771 arrives whose action is either to execute a handler function, or to
10772 terminate the process.
10773 &lt;br&gt;&lt;br&gt; If the signal causes a handler function to be executed, then
10774 &lt;CODE&gt;pause&lt;/CODE&gt; returns. This is considered an unsuccessful return (since
10775 ``successful'' behavior would be to suspend the program forever), so the
10776 return value is &lt;CODE&gt;-1&lt;/CODE&gt;. Even if you specify that other primitives
10777 should resume when a system handler returns , this has no effect on &lt;CODE&gt;pause&lt;/CODE&gt;; it always fails when a
10778 signal is handled.
10779 &lt;br&gt;&lt;br&gt; The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
10780 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
10781
10782 &lt;DT&gt;&lt;CODE&gt;EINTR&lt;/CODE&gt;
10783 &lt;DD&gt;
10784 The function was interrupted by delivery of a signal.
10785
10786 &lt;br&gt;&lt;br&gt; If the signal causes program termination, &lt;CODE&gt;pause&lt;/CODE&gt; doesn't return
10787 (obviously).
10788 &lt;br&gt;&lt;br&gt; This function is a cancellation point in multithreaded programs. This
10789 is a problem if the thread allocates some resources (like memory, file
10790 descriptors, semaphores or whatever) at the time &lt;CODE&gt;pause&lt;/CODE&gt; is
10791 called. If the thread gets cancelled these resources stay allocated
10792 until the program ends. To avoid this calls to &lt;CODE&gt;pause&lt;/CODE&gt; should be
10793 protected using cancellation handlers.
10794 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;pause&lt;/CODE&gt; function is declared in &lt;TT&gt;unistd.h&lt;/TT&gt;.
10795 </synopsis>
10796 </function>
10797 </construct>
10798 <construct id="function-sigsuspend" type="function">
10799 <function returntype="int">
10800 <prototype>
10801 <parameter content="const sigset_t *set"/>
10802 </prototype>
10803 <headers>
10804 <header filename = "signal.h"/>
10805 </headers>
10806 <synopsis>
10807 This function replaces the process's signal mask with &lt;VAR&gt;set&lt;/VAR&gt; and then
10808 suspends the process until a signal is delivered whose action is either
10809 to terminate the process or invoke a signal handling function. In other
10810 words, the program is effectively suspended until one of the signals that
10811 is not a member of &lt;VAR&gt;set&lt;/VAR&gt; arrives.
10812 &lt;br&gt;&lt;br&gt; If the process is woken up by delivery of a signal that invokes a handler
10813 function, and the handler function returns, then &lt;CODE&gt;sigsuspend&lt;/CODE&gt; also
10814 returns.
10815 &lt;br&gt;&lt;br&gt; The mask remains &lt;VAR&gt;set&lt;/VAR&gt; only as long as &lt;CODE&gt;sigsuspend&lt;/CODE&gt; is waiting.
10816 The function &lt;CODE&gt;sigsuspend&lt;/CODE&gt; always restores the previous signal mask
10817 when it returns.
10818 &lt;br&gt;&lt;br&gt; The return value and error conditions are the same as for &lt;CODE&gt;pause&lt;/CODE&gt;.
10819 </synopsis>
10820 </function>
10821 </construct>
10822 <construct id="dtype-stack_t" type="dtype">
10823 <structure>
10824 <synopsis>
10825 This structure describes a signal stack. It contains the following members:
10826 &lt;br&gt;&lt;br&gt;
10827 </synopsis>
10828 <elements>
10829 <element content="void *ss_sp">
10830 <synopsis>
10831 This points to the base of the signal stack.
10832 &lt;br&gt;&lt;br&gt;
10833 </synopsis>
10834 </element>
10835 <element content="size_t ss_size">
10836 <synopsis>
10837 This is the size (in bytes) of the signal stack which &lt;samp&gt;ss_sp&lt;/samp&gt; points to.
10838 You should set this to however much space you allocated for the stack.
10839 &lt;br&gt;&lt;br&gt; There are two macros defined in &lt;TT&gt;signal.h&lt;/TT&gt; that you should use in
10840 calculating this size:
10841 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
10842
10843 </synopsis>
10844 </element>
10845 <element content="SIGSTKSZ">
10846 <synopsis>
10847 This is the canonical size for a signal stack. It is judged to be
10848 sufficient for normal uses.
10849 &lt;br&gt;&lt;br&gt;
10850 </synopsis>
10851 </element>
10852 <element content="MINSIGSTKSZ">
10853 <synopsis>
10854 This is the amount of signal stack space the operating system needs just
10855 to implement signal delivery. The size of a signal stack &lt;h3&gt;must&lt;/h3&gt;
10856 be greater than this.
10857 &lt;br&gt;&lt;br&gt; For most cases, just using &lt;CODE&gt;SIGSTKSZ&lt;/CODE&gt; for &lt;CODE&gt;ss_size&lt;/CODE&gt; is
10858 sufficient. But if you know how much stack space your program's signal
10859 handlers will need, you may want to use a different size. In this case,
10860 you should allocate &lt;CODE&gt;MINSIGSTKSZ&lt;/CODE&gt; additional bytes for the signal
10861 stack and increase &lt;CODE&gt;ss_size&lt;/CODE&gt; accordingly.
10862 &lt;/DL&gt;
10863 &lt;br&gt;&lt;br&gt;
10864 </synopsis>
10865 </element>
10866 <element content="int ss_flags">
10867 <synopsis>
10868 This field contains the bitwise or of these flags:
10869 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
10870
10871 </synopsis>
10872 </element>
10873 <element content="SS_DISABLE">
10874 <synopsis>
10875 This tells the system that it should not use the signal stack.
10876 &lt;br&gt;&lt;br&gt;
10877 </synopsis>
10878 </element>
10879 </elements>
10880 </structure>
10881 </construct>
10882 <construct id="function-sigaltstack" type="function">
10883 <function returntype="int">
10884 <prototype>
10885 <parameter content="const stack_t *restrict stack"/>
10886 <parameter content="stack_t *restrict oldstack"/>
10887 </prototype>
10888 <headers>
10889 <header filename = "signal.h"/>
10890 </headers>
10891 <synopsis>
10892 The &lt;CODE&gt;sigaltstack&lt;/CODE&gt; function specifies an alternate stack for use
10893 during signal handling. When a signal is received by the process and
10894 its action indicates that the signal stack is used, the system arranges
10895 a switch to the currently installed signal stack while the handler for
10896 that signal is executed.
10897 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;oldstack&lt;/VAR&gt; is not a null pointer, information about the currently
10898 installed signal stack is returned in the location it points to. If
10899 &lt;VAR&gt;stack&lt;/VAR&gt; is not a null pointer, then this is installed as the new
10900 stack for use by signal handlers.
10901 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt; on failure. If
10902 &lt;CODE&gt;sigaltstack&lt;/CODE&gt; fails, it sets &lt;CODE&gt;errno&lt;/CODE&gt; to one of these values:
10903 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
10904
10905 &lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
10906 &lt;DD&gt;
10907 You tried to disable a stack that was in fact currently in use.
10908 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOMEM
10909 The size of the alternate stack was too small.
10910 It must be greater than &lt;CODE&gt;MINSIGSTKSZ&lt;/CODE&gt;.
10911
10912 </synopsis>
10913 </function>
10914 </construct>
10915 <construct id="struct-sigstack" type="struct">
10916 <structure>
10917 <synopsis>
10918 This structure describes a signal stack. It contains the following members:
10919 &lt;br&gt;&lt;br&gt;
10920 </synopsis>
10921 <elements>
10922 <element content="void *ss_sp">
10923 <synopsis>
10924 This is the stack pointer. If the stack grows downwards on your
10925 machine, this should point to the top of the area you allocated. If the
10926 stack grows upwards, it should point to the bottom.
10927 &lt;br&gt;&lt;br&gt;
10928 </synopsis>
10929 </element>
10930 </elements>
10931 </structure>
10932 </construct>
10933 <construct id="function-sigstack" type="function">
10934 <function returntype="int">
10935 <prototype>
10936 <parameter content="const struct sigstack *stack"/>
10937 <parameter content="struct sigstack *oldstack"/>
10938 </prototype>
10939 <headers>
10940 <header filename = "signal.h"/>
10941 </headers>
10942 <synopsis>
10943 The &lt;CODE&gt;sigstack&lt;/CODE&gt; function specifies an alternate stack for use during
10944 signal handling. When a signal is received by the process and its
10945 action indicates that the signal stack is used, the system arranges a
10946 switch to the currently installed signal stack while the handler for
10947 that signal is executed.
10948 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;oldstack&lt;/VAR&gt; is not a null pointer, information about the currently
10949 installed signal stack is returned in the location it points to. If
10950 &lt;VAR&gt;stack&lt;/VAR&gt; is not a null pointer, then this is installed as the new
10951 stack for use by signal handlers.
10952 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt; on failure.
10953 </synopsis>
10954 </function>
10955 </construct>
10956 <construct id="struct-sigvec" type="struct">
10957 <structure>
10958 <synopsis>
10959 This data type is the BSD equivalent of &lt;CODE&gt;struct sigaction&lt;/CODE&gt;
10960 ; it is used to specify signal actions
10961 to the &lt;CODE&gt;sigvec&lt;/CODE&gt; function. It contains the following members:
10962 &lt;br&gt;&lt;br&gt;
10963 </synopsis>
10964 <elements>
10965 <element content="sighandler_t sv_handler">
10966 <synopsis>
10967 This is the handler function.
10968 &lt;br&gt;&lt;br&gt;
10969 </synopsis>
10970 </element>
10971 <element content="int sv_mask">
10972 <synopsis>
10973 This is the mask of additional signals to be blocked while the handler
10974 function is being called.
10975 &lt;br&gt;&lt;br&gt;
10976 </synopsis>
10977 </element>
10978 </elements>
10979 </structure>
10980 </construct>
10981 <construct id="function-sigvec" type="function">
10982 <function returntype="int">
10983 <prototype>
10984 <parameter content="int signum"/>
10985 <parameter content="const struct sigvec *action,struct sigvec *old-action"/>
10986 </prototype>
10987 <headers>
10988 <header filename = "signal.h"/>
10989 </headers>
10990 <synopsis>
10991 This function is the equivalent of &lt;CODE&gt;sigaction&lt;/CODE&gt; ; it installs the action &lt;VAR&gt;action&lt;/VAR&gt; for the signal &lt;VAR&gt;signum&lt;/VAR&gt;,
10992 returning information about the previous action in effect for that signal
10993 in &lt;VAR&gt;old-action&lt;/VAR&gt;.
10994 </synopsis>
10995 </function>
10996 </construct>
10997 <construct id="function-siginterrupt" type="function">
10998 <function returntype="int">
10999 <prototype>
11000 <parameter content="int signum"/>
11001 <parameter content="int failflag"/>
11002 </prototype>
11003 <headers>
11004 <header filename = "signal.h"/>
11005 </headers>
11006 <synopsis>
11007 This function specifies which approach to use when certain primitives
11008 are interrupted by handling signal &lt;VAR&gt;signum&lt;/VAR&gt;. If &lt;VAR&gt;failflag&lt;/VAR&gt; is
11009 false, signal &lt;VAR&gt;signum&lt;/VAR&gt; restarts primitives. If &lt;VAR&gt;failflag&lt;/VAR&gt; is
11010 true, handling &lt;VAR&gt;signum&lt;/VAR&gt; causes these primitives to fail with error
11011 code &lt;CODE&gt;EINTR&lt;/CODE&gt;. .
11012 </synopsis>
11013 </function>
11014 </construct>
11015 <construct id="function-sigblock" type="function">
11016 <function returntype="int">
11017 <prototype>
11018 <parameter content="int mask"/>
11019 </prototype>
11020 <headers>
11021 <header filename = "signal.h"/>
11022 </headers>
11023 <synopsis>
11024 This function is equivalent to &lt;CODE&gt;sigprocmask&lt;/CODE&gt; with a &lt;VAR&gt;how&lt;/VAR&gt; argument of &lt;CODE&gt;SIG_BLOCK&lt;/CODE&gt;: it adds the
11025 signals specified by &lt;VAR&gt;mask&lt;/VAR&gt; to the calling process's set of blocked
11026 signals. The return value is the previous set of blocked signals.
11027 </synopsis>
11028 </function>
11029 </construct>
11030 <construct id="function-sigsetmask" type="function">
11031 <function returntype="int">
11032 <prototype>
11033 <parameter content="int mask"/>
11034 </prototype>
11035 <headers>
11036 <header filename = "signal.h"/>
11037 </headers>
11038 <synopsis>
11039 This function equivalent to &lt;CODE&gt;sigprocmask&lt;/CODE&gt; with a &lt;VAR&gt;how&lt;/VAR&gt; argument of &lt;CODE&gt;SIG_SETMASK&lt;/CODE&gt;: it sets
11040 the calling process's signal mask to &lt;VAR&gt;mask&lt;/VAR&gt;. The return value is
11041 the previous set of blocked signals.
11042 </synopsis>
11043 </function>
11044 </construct>
11045 <construct id="function-sigpause" type="function">
11046 <function returntype="int">
11047 <prototype>
11048 <parameter content="int mask"/>
11049 </prototype>
11050 <headers>
11051 <header filename = "signal.h"/>
11052 </headers>
11053 <synopsis>
11054 This function is the equivalent of &lt;CODE&gt;sigsuspend&lt;/CODE&gt; : it sets the calling process's signal mask to &lt;VAR&gt;mask&lt;/VAR&gt;,
11055 and waits for a signal to arrive. On return the previous set of blocked
11056 signals is restored.
11057 </synopsis>
11058 </function>
11059 </construct>
11060 <construct id="function-pipe" type="function">
11061 <function returntype="int">
11062 <prototype>
11063 <parameter content="int filedes[2]"/>
11064 </prototype>
11065 <headers>
11066 <header filename = "unistd.h"/>
11067 </headers>
11068 <synopsis>
11069 The &lt;CODE&gt;pipe&lt;/CODE&gt; function creates a pipe and puts the file descriptors
11070 for the reading and writing ends of the pipe (respectively) into
11071 &lt;CODE&gt;&lt;VAR&gt;filedes&lt;/VAR&gt;[0]&lt;/CODE&gt; and &lt;CODE&gt;&lt;VAR&gt;filedes&lt;/VAR&gt;[1]&lt;/CODE&gt;.
11072 &lt;br&gt;&lt;br&gt; An easy way to remember that the input end comes first is that file
11073 descriptor &lt;CODE&gt;0&lt;/CODE&gt; is standard input, and file descriptor &lt;CODE&gt;1&lt;/CODE&gt; is
11074 standard output.
11075 &lt;br&gt;&lt;br&gt; If successful, &lt;CODE&gt;pipe&lt;/CODE&gt; returns a value of &lt;CODE&gt;0&lt;/CODE&gt;. On failure,
11076 &lt;CODE&gt;-1&lt;/CODE&gt; is returned. The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are
11077 defined for this function:
11078 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
11079
11080 &lt;DT&gt;&lt;CODE&gt;EMFILE&lt;/CODE&gt;
11081 &lt;DD&gt;
11082 The process has too many files open.
11083 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENFILE
11084 There are too many open files in the entire system. ,
11085 for more information about &lt;CODE&gt;ENFILE&lt;/CODE&gt;. This error never occurs in
11086 the GNU system.
11087
11088 </synopsis>
11089 </function>
11090 </construct>
11091 <construct id="function-popen" type="function">
11092 <function returntype="FILE *">
11093 <prototype>
11094 <parameter content="const char *command"/>
11095 <parameter content="const char *mode"/>
11096 </prototype>
11097 <headers>
11098 <header filename = "stdio.h"/>
11099 </headers>
11100 <synopsis>
11101 The &lt;CODE&gt;popen&lt;/CODE&gt; function is closely related to the &lt;CODE&gt;system&lt;/CODE&gt;
11102 function; see Running a Command. It executes the shell command
11103 &lt;VAR&gt;command&lt;/VAR&gt; as a subprocess. However, instead of waiting for the
11104 command to complete, it creates a pipe to the subprocess and returns a
11105 stream that corresponds to that pipe.
11106 &lt;br&gt;&lt;br&gt; If you specify a &lt;VAR&gt;mode&lt;/VAR&gt; argument of &lt;CODE&gt;"r"&lt;/CODE&gt;, you can read from the
11107 stream to retrieve data from the standard output channel of the subprocess.
11108 The subprocess inherits its standard input channel from the parent process.
11109 &lt;br&gt;&lt;br&gt; Similarly, if you specify a &lt;VAR&gt;mode&lt;/VAR&gt; argument of &lt;CODE&gt;"w"&lt;/CODE&gt;, you can
11110 write to the stream to send data to the standard input channel of the
11111 subprocess. The subprocess inherits its standard output channel from
11112 the parent process.
11113 &lt;br&gt;&lt;br&gt; In the event of an error &lt;CODE&gt;popen&lt;/CODE&gt; returns a null pointer. This
11114 might happen if the pipe or stream cannot be created, if the subprocess
11115 cannot be forked, or if the program cannot be executed.
11116 </synopsis>
11117 </function>
11118 </construct>
11119 <construct id="function-pclose" type="function">
11120 <function returntype="int">
11121 <prototype>
11122 <parameter content="FILE *stream"/>
11123 </prototype>
11124 <headers>
11125 <header filename = "stdio.h"/>
11126 </headers>
11127 <synopsis>
11128 The &lt;CODE&gt;pclose&lt;/CODE&gt; function is used to close a stream created by &lt;CODE&gt;popen&lt;/CODE&gt;.
11129 It waits for the child process to terminate and returns its status value,
11130 as for the &lt;CODE&gt;system&lt;/CODE&gt; function.
11131 </synopsis>
11132 </function>
11133 </construct>
11134 <construct id="function-mkfifo" type="function">
11135 <function returntype="int">
11136 <prototype>
11137 <parameter content="const char *filename"/>
11138 <parameter content="mode_t mode"/>
11139 </prototype>
11140 <headers>
11141 <header filename = "sys/stat.h"/>
11142 </headers>
11143 <synopsis>
11144 The &lt;CODE&gt;mkfifo&lt;/CODE&gt; function makes a FIFO special file with name
11145 &lt;VAR&gt;filename&lt;/VAR&gt;. The &lt;VAR&gt;mode&lt;/VAR&gt; argument is used to set the file's
11146 permissions; see Setting Permissions.
11147 &lt;br&gt;&lt;br&gt; The normal, successful return value from &lt;CODE&gt;mkfifo&lt;/CODE&gt; is &lt;CODE&gt;0&lt;/CODE&gt;. In
11148 the case of an error, &lt;CODE&gt;-1&lt;/CODE&gt; is returned. In addition to the usual
11149 file name errors , the following
11150 &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
11151 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
11152
11153 &lt;DT&gt;&lt;CODE&gt;EEXIST&lt;/CODE&gt;
11154 &lt;DD&gt;
11155 The named file already exists.
11156 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOSPC
11157 The directory or file system cannot be extended.
11158 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
11159 The directory that would contain the file resides on a read-only file
11160 system.
11161
11162 </synopsis>
11163 </function>
11164 </construct>
11165 <construct id="function-strerror" type="function">
11166 <function returntype="char *">
11167 <prototype>
11168 <parameter content="int errnum"/>
11169 </prototype>
11170 <headers>
11171 <header filename = "errno.h"/>
11172 <header filename = "string.h"/>
11173 </headers>
11174 <synopsis>
11175 The &lt;CODE&gt;strerror&lt;/CODE&gt; function maps the error code specified by the &lt;VAR&gt;errnum&lt;/VAR&gt; argument to a descriptive error
11176 message string. The return value is a pointer to this string.
11177 &lt;br&gt;&lt;br&gt; The value &lt;VAR&gt;errnum&lt;/VAR&gt; normally comes from the variable &lt;CODE&gt;errno&lt;/CODE&gt;.
11178 &lt;br&gt;&lt;br&gt; You should not modify the string returned by &lt;CODE&gt;strerror&lt;/CODE&gt;. Also, if
11179 you make subsequent calls to &lt;CODE&gt;strerror&lt;/CODE&gt;, the string might be
11180 overwritten. (But it's guaranteed that no library function ever calls
11181 &lt;CODE&gt;strerror&lt;/CODE&gt; behind your back.)
11182 &lt;br&gt;&lt;br&gt; The function &lt;CODE&gt;strerror&lt;/CODE&gt; is declared in &lt;TT&gt;string.h&lt;/TT&gt;.
11183 </synopsis>
11184 </function>
11185 </construct>
11186 <construct id="function-strerror_r" type="function">
11187 <function returntype="char *">
11188 <prototype>
11189 <parameter content="int errnum"/>
11190 <parameter content="char *buf"/>
11191 <parameter content="size_t n"/>
11192 </prototype>
11193 <headers>
11194 <header filename = "string.h"/>
11195 </headers>
11196 <synopsis>
11197 The &lt;CODE&gt;strerror_r&lt;/CODE&gt; function works like &lt;CODE&gt;strerror&lt;/CODE&gt; but instead of
11198 returning the error message in a statically allocated buffer shared by
11199 all threads in the process, it returns a private copy for the
11200 thread. This might be either some permanent global data or a message
11201 string in the user supplied buffer starting at &lt;VAR&gt;buf&lt;/VAR&gt; with the
11202 length of &lt;VAR&gt;n&lt;/VAR&gt; bytes.
11203 &lt;br&gt;&lt;br&gt; At most &lt;VAR&gt;n&lt;/VAR&gt; characters are written (including the NUL byte) so it is
11204 up to the user to select the buffer large enough.
11205 &lt;br&gt;&lt;br&gt; This function should always be used in multi-threaded programs since
11206 there is no way to guarantee the string returned by &lt;CODE&gt;strerror&lt;/CODE&gt;
11207 really belongs to the last call of the current thread.
11208 &lt;br&gt;&lt;br&gt; This function &lt;CODE&gt;strerror_r&lt;/CODE&gt; is a GNU extension and it is declared in
11209 &lt;TT&gt;string.h&lt;/TT&gt;.
11210 </synopsis>
11211 </function>
11212 </construct>
11213 <construct id="function-perror" type="function">
11214 <function returntype="void">
11215 <prototype>
11216 <parameter content="const char *message"/>
11217 </prototype>
11218 <headers>
11219 <header filename = "stdio.h"/>
11220 </headers>
11221 <synopsis>
11222 This function prints an error message to the stream &lt;CODE&gt;stderr&lt;/CODE&gt;;
11223 see Standard Streams. The orientation of &lt;CODE&gt;stderr&lt;/CODE&gt; is not
11224 changed.
11225 &lt;br&gt;&lt;br&gt; If you call &lt;CODE&gt;perror&lt;/CODE&gt; with a &lt;VAR&gt;message&lt;/VAR&gt; that is either a null
11226 pointer or an empty string, &lt;CODE&gt;perror&lt;/CODE&gt; just prints the error message
11227 corresponding to &lt;CODE&gt;errno&lt;/CODE&gt;, adding a trailing newline.
11228 &lt;br&gt;&lt;br&gt; If you supply a non-null &lt;VAR&gt;message&lt;/VAR&gt; argument, then &lt;CODE&gt;perror&lt;/CODE&gt;
11229 prefixes its output with this string. It adds a colon and a space
11230 character to separate the &lt;VAR&gt;message&lt;/VAR&gt; from the error string corresponding
11231 to &lt;CODE&gt;errno&lt;/CODE&gt;.
11232 &lt;br&gt;&lt;br&gt; The function &lt;CODE&gt;perror&lt;/CODE&gt; is declared in &lt;TT&gt;stdio.h&lt;/TT&gt;.
11233 </synopsis>
11234 </function>
11235 </construct>
11236 <construct id="function-error" type="function">
11237 <function returntype="void">
11238 <prototype>
11239 <parameter content="int status"/>
11240 <parameter content="int errnum"/>
11241 <parameter content="const char *format"/>
11242 <parameter content="..."/>
11243 </prototype>
11244 <headers>
11245 <header filename = "errno.h"/>
11246 <header filename = "error.h"/>
11247 </headers>
11248 <synopsis>
11249 The &lt;CODE&gt;error&lt;/CODE&gt; function can be used to report general problems during
11250 program execution. The &lt;VAR&gt;format&lt;/VAR&gt; argument is a format string just
11251 like those given to the &lt;CODE&gt;printf&lt;/CODE&gt; family of functions. The
11252 arguments required for the format can follow the &lt;VAR&gt;format&lt;/VAR&gt; parameter.
11253 Just like &lt;CODE&gt;perror&lt;/CODE&gt;, &lt;CODE&gt;error&lt;/CODE&gt; also can report an error code in
11254 textual form. But unlike &lt;CODE&gt;perror&lt;/CODE&gt; the error value is explicitly
11255 passed to the function in the &lt;VAR&gt;errnum&lt;/VAR&gt; parameter. This eliminates
11256 the problem mentioned above that the error reporting function must be
11257 called immediately after the function causing the error since otherwise
11258 &lt;CODE&gt;errno&lt;/CODE&gt; might have a different value.
11259 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;error&lt;/CODE&gt; prints first the program name. If the application
11260 defined a global variable &lt;CODE&gt;error_print_progname&lt;/CODE&gt; and points it to a
11261 function this function will be called to print the program name.
11262 Otherwise the string from the global variable &lt;CODE&gt;program_name&lt;/CODE&gt; is
11263 used. The program name is followed by a colon and a space which in turn
11264 is followed by the output produced by the format string. If the
11265 &lt;VAR&gt;errnum&lt;/VAR&gt; parameter is non-zero the format string output is followed
11266 by a colon and a space, followed by the error message for the error code
11267 &lt;VAR&gt;errnum&lt;/VAR&gt;. In any case is the output terminated with a newline.
11268 &lt;br&gt;&lt;br&gt; The output is directed to the &lt;CODE&gt;stderr&lt;/CODE&gt; stream. If the
11269 &lt;CODE&gt;stderr&lt;/CODE&gt; wasn't oriented before the call it will be narrow-oriented
11270 afterwards.
11271 &lt;br&gt;&lt;br&gt; The function will return unless the &lt;VAR&gt;status&lt;/VAR&gt; parameter has a
11272 non-zero value. In this case the function will call &lt;CODE&gt;exit&lt;/CODE&gt; with
11273 the &lt;VAR&gt;status&lt;/VAR&gt; value for its parameter and therefore never return. If
11274 &lt;CODE&gt;error&lt;/CODE&gt; returns the global variable &lt;CODE&gt;error_message_count&lt;/CODE&gt; is
11275 incremented by one to keep track of the number of errors reported.
11276 </synopsis>
11277 </function>
11278 </construct>
11279 <construct id="function-error_at_line" type="function">
11280 <function returntype="void">
11281 <prototype>
11282 <parameter content="int status"/>
11283 <parameter content="int errnum"/>
11284 <parameter content="const char *fname"/>
11285 <parameter content="unsigned int lineno"/>
11286 <parameter content="const char *format"/>
11287 <parameter content="..."/>
11288 </prototype>
11289 <headers>
11290 <header filename = "error.h"/>
11291 </headers>
11292 <synopsis>
11293 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;error_at_line&lt;/CODE&gt; function is very similar to the &lt;CODE&gt;error&lt;/CODE&gt;
11294 function. The only difference are the additional parameters &lt;VAR&gt;fname&lt;/VAR&gt;
11295 and &lt;VAR&gt;lineno&lt;/VAR&gt;. The handling of the other parameters is identical to
11296 that of &lt;CODE&gt;error&lt;/CODE&gt; except that between the program name and the string
11297 generated by the format string additional text is inserted.
11298 &lt;br&gt;&lt;br&gt; Directly following the program name a colon, followed by the file name
11299 pointer to by &lt;VAR&gt;fname&lt;/VAR&gt;, another colon, and a value of &lt;VAR&gt;lineno&lt;/VAR&gt; is
11300 printed.
11301 &lt;br&gt;&lt;br&gt; This additional output of course is meant to be used to locate an error
11302 in an input file (like a programming language source code file etc).
11303 &lt;br&gt;&lt;br&gt; If the global variable &lt;CODE&gt;error_one_per_line&lt;/CODE&gt; is set to a non-zero
11304 value &lt;CODE&gt;error_at_line&lt;/CODE&gt; will avoid printing consecutive messages for
11305 the same file and line. Repetition which are not directly following
11306 each other are not caught.
11307 &lt;br&gt;&lt;br&gt; Just like &lt;CODE&gt;error&lt;/CODE&gt; this function only returned if &lt;VAR&gt;status&lt;/VAR&gt; is
11308 zero. Otherwise &lt;CODE&gt;exit&lt;/CODE&gt; is called with the non-zero value. If
11309 &lt;CODE&gt;error&lt;/CODE&gt; returns the global variable &lt;CODE&gt;error_message_count&lt;/CODE&gt; is
11310 incremented by one to keep track of the number of errors reported.
11311 </synopsis>
11312 </function>
11313 </construct>
11314 <construct id="function-warn" type="function">
11315 <function returntype="void">
11316 <prototype>
11317 <parameter content="const char *format"/>
11318 <parameter content="..."/>
11319 </prototype>
11320 <headers>
11321 <header filename = "error.h"/>
11322 <header filename = "err.h"/>
11323 </headers>
11324 <synopsis>
11325 The &lt;CODE&gt;warn&lt;/CODE&gt; function is roughly equivalent to a call like
11326 &lt;pre&gt;&lt;br&gt;
11327 error (0, errno, format, the parameters)&lt;br&gt;
11328 &lt;/pre&gt;
11329
11330 except that the global variables &lt;CODE&gt;error&lt;/CODE&gt; respects and modifies
11331 are not used.
11332 </synopsis>
11333 </function>
11334 </construct>
11335 <construct id="function-vwarn" type="function">
11336 <function returntype="void">
11337 <prototype>
11338 <parameter content="const char *format"/>
11339 <parameter content="va_list"/>
11340 </prototype>
11341 <headers>
11342 <header filename = "err.h"/>
11343 </headers>
11344 <synopsis>
11345 The &lt;CODE&gt;vwarn&lt;/CODE&gt; function is just like &lt;CODE&gt;warn&lt;/CODE&gt; except that the
11346 parameters for the handling of the format string &lt;VAR&gt;format&lt;/VAR&gt; are passed
11347 in as an value of type &lt;CODE&gt;va_list&lt;/CODE&gt;.
11348 </synopsis>
11349 </function>
11350 </construct>
11351 <construct id="function-warnx" type="function">
11352 <function returntype="void">
11353 <prototype>
11354 <parameter content="const char *format"/>
11355 <parameter content="..."/>
11356 </prototype>
11357 <headers>
11358 <header filename = "err.h"/>
11359 </headers>
11360 <synopsis>
11361 The &lt;CODE&gt;warnx&lt;/CODE&gt; function is roughly equivalent to a call like
11362 &lt;pre&gt;&lt;br&gt;
11363 error (0, 0, format, the parameters)&lt;br&gt;
11364 &lt;/pre&gt;
11365
11366 except that the global variables &lt;CODE&gt;error&lt;/CODE&gt; respects and modifies
11367 are not used. The difference to &lt;CODE&gt;warn&lt;/CODE&gt; is that no error number
11368 string is printed.
11369 </synopsis>
11370 </function>
11371 </construct>
11372 <construct id="function-vwarnx" type="function">
11373 <function returntype="void">
11374 <prototype>
11375 <parameter content="const char *format"/>
11376 <parameter content="va_list"/>
11377 </prototype>
11378 <headers>
11379 <header filename = "err.h"/>
11380 </headers>
11381 <synopsis>
11382 The &lt;CODE&gt;vwarnx&lt;/CODE&gt; function is just like &lt;CODE&gt;warnx&lt;/CODE&gt; except that the
11383 parameters for the handling of the format string &lt;VAR&gt;format&lt;/VAR&gt; are passed
11384 in as an value of type &lt;CODE&gt;va_list&lt;/CODE&gt;.
11385 </synopsis>
11386 </function>
11387 </construct>
11388 <construct id="function-err" type="function">
11389 <function returntype="void">
11390 <prototype>
11391 <parameter content="int status"/>
11392 <parameter content="const char *format"/>
11393 <parameter content="..."/>
11394 </prototype>
11395 <headers>
11396 <header filename = "err.h"/>
11397 </headers>
11398 <synopsis>
11399 The &lt;CODE&gt;err&lt;/CODE&gt; function is roughly equivalent to a call like
11400 &lt;pre&gt;&lt;br&gt;
11401 error (status, errno, format, the parameters)&lt;br&gt;
11402 &lt;/pre&gt;
11403
11404 except that the global variables &lt;CODE&gt;error&lt;/CODE&gt; respects and modifies
11405 are not used and that the program is exited even if &lt;VAR&gt;status&lt;/VAR&gt; is zero.
11406 </synopsis>
11407 </function>
11408 </construct>
11409 <construct id="function-verr" type="function">
11410 <function returntype="void">
11411 <prototype>
11412 <parameter content="int status"/>
11413 <parameter content="const char *format"/>
11414 <parameter content="va_list"/>
11415 </prototype>
11416 <headers>
11417 <header filename = "err.h"/>
11418 </headers>
11419 <synopsis>
11420 The &lt;CODE&gt;verr&lt;/CODE&gt; function is just like &lt;CODE&gt;err&lt;/CODE&gt; except that the
11421 parameters for the handling of the format string &lt;VAR&gt;format&lt;/VAR&gt; are passed
11422 in as an value of type &lt;CODE&gt;va_list&lt;/CODE&gt;.
11423 </synopsis>
11424 </function>
11425 </construct>
11426 <construct id="function-errx" type="function">
11427 <function returntype="void">
11428 <prototype>
11429 <parameter content="int status"/>
11430 <parameter content="const char *format"/>
11431 <parameter content="..."/>
11432 </prototype>
11433 <headers>
11434 <header filename = "err.h"/>
11435 </headers>
11436 <synopsis>
11437 The &lt;CODE&gt;errx&lt;/CODE&gt; function is roughly equivalent to a call like
11438 &lt;pre&gt;&lt;br&gt;
11439 error (status, 0, format, the parameters)&lt;br&gt;
11440 &lt;/pre&gt;
11441
11442 except that the global variables &lt;CODE&gt;error&lt;/CODE&gt; respects and modifies
11443 are not used and that the program is exited even if &lt;VAR&gt;status&lt;/VAR&gt;
11444 is zero. The difference to &lt;CODE&gt;err&lt;/CODE&gt; is that no error number
11445 string is printed.
11446 </synopsis>
11447 </function>
11448 </construct>
11449 <construct id="function-verrx" type="function">
11450 <function returntype="void">
11451 <prototype>
11452 <parameter content="int status"/>
11453 <parameter content="const char *format"/>
11454 <parameter content="va_list"/>
11455 </prototype>
11456 <headers>
11457 <header filename = "err.h"/>
11458 </headers>
11459 <synopsis>
11460 The &lt;CODE&gt;verrx&lt;/CODE&gt; function is just like &lt;CODE&gt;errx&lt;/CODE&gt; except that the
11461 parameters for the handling of the format string &lt;VAR&gt;format&lt;/VAR&gt; are passed
11462 in as an value of type &lt;CODE&gt;va_list&lt;/CODE&gt;.
11463 </synopsis>
11464 </function>
11465 </construct>
11466 <construct id="function-fnmatch" type="function">
11467 <function returntype="int">
11468 <prototype>
11469 <parameter content="const char *pattern"/>
11470 <parameter content="const char *string"/>
11471 <parameter content="int flags"/>
11472 </prototype>
11473 <headers>
11474 <header filename = "fnmatch.h"/>
11475 </headers>
11476 <synopsis>
11477 This function tests whether the string &lt;VAR&gt;string&lt;/VAR&gt; matches the pattern
11478 &lt;VAR&gt;pattern&lt;/VAR&gt;. It returns &lt;CODE&gt;0&lt;/CODE&gt; if they do match; otherwise, it
11479 returns the nonzero value &lt;CODE&gt;FNM_NOMATCH&lt;/CODE&gt;. The arguments
11480 &lt;VAR&gt;pattern&lt;/VAR&gt; and &lt;VAR&gt;string&lt;/VAR&gt; are both strings.
11481 &lt;br&gt;&lt;br&gt; The argument &lt;VAR&gt;flags&lt;/VAR&gt; is a combination of flag bits that alter the
11482 details of matching. See below for a list of the defined flags.
11483 &lt;br&gt;&lt;br&gt; In the GNU C Library, &lt;CODE&gt;fnmatch&lt;/CODE&gt; cannot experience an ``error''---it
11484 always returns an answer for whether the match succeeds. However, other
11485 implementations of &lt;CODE&gt;fnmatch&lt;/CODE&gt; might sometimes report ``errors''.
11486 They would do so by returning nonzero values that are not equal to
11487 &lt;CODE&gt;FNM_NOMATCH&lt;/CODE&gt;.
11488 </synopsis>
11489 </function>
11490 </construct>
11491 <construct id="dtype-glob_t" type="dtype">
11492 <structure>
11493 <synopsis>
11494 This data type holds a pointer to a word vector. More precisely, it
11495 records both the address of the word vector and its size. The GNU
11496 implementation contains some more fields which are non-standard
11497 extensions.
11498 &lt;br&gt;&lt;br&gt;
11499 </synopsis>
11500 <elements>
11501 <element content="gl_pathc">
11502 <synopsis>
11503 The number of elements in the vector, excluding the initial null entries
11504 if the GLOB_DOOFFS flag is used (see gl_offs below).
11505 &lt;br&gt;&lt;br&gt;
11506 </synopsis>
11507 </element>
11508 <element content="gl_pathv">
11509 <synopsis>
11510 The address of the vector. This field has type &lt;CODE&gt;char **&lt;/CODE&gt;.
11511 &lt;br&gt;&lt;br&gt;
11512 </synopsis>
11513 </element>
11514 <element content="gl_offs">
11515 <synopsis>
11516 The offset of the first real element of the vector, from its nominal
11517 address in the &lt;CODE&gt;gl_pathv&lt;/CODE&gt; field. Unlike the other fields, this
11518 is always an input to &lt;CODE&gt;glob&lt;/CODE&gt;, rather than an output from it.
11519 &lt;br&gt;&lt;br&gt; If you use a nonzero offset, then that many elements at the beginning of
11520 the vector are left empty. (The &lt;CODE&gt;glob&lt;/CODE&gt; function fills them with
11521 null pointers.)
11522 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;gl_offs&lt;/CODE&gt; field is meaningful only if you use the
11523 &lt;CODE&gt;GLOB_DOOFFS&lt;/CODE&gt; flag. Otherwise, the offset is always zero
11524 regardless of what is in this field, and the first real element comes at
11525 the beginning of the vector.
11526 &lt;br&gt;&lt;br&gt;
11527 </synopsis>
11528 </element>
11529 <element content="gl_closedir">
11530 <synopsis>
11531 The address of an alternative implementation of the &lt;CODE&gt;closedir&lt;/CODE&gt;
11532 function. It is used if the &lt;CODE&gt;GLOB_ALTDIRFUNC&lt;/CODE&gt; bit is set in
11533 the flag parameter. The type of this field is
11534 &lt;CODE&gt;void (*) (void *)&lt;/CODE&gt;.
11535 &lt;br&gt;&lt;br&gt; This is a GNU extension.
11536 &lt;br&gt;&lt;br&gt;
11537 </synopsis>
11538 </element>
11539 <element content="gl_readdir">
11540 <synopsis>
11541 The address of an alternative implementation of the &lt;CODE&gt;readdir&lt;/CODE&gt;
11542 function used to read the contents of a directory. It is used if the
11543 &lt;CODE&gt;GLOB_ALTDIRFUNC&lt;/CODE&gt; bit is set in the flag parameter. The type of
11544 this field is &lt;CODE&gt;struct dirent *(*) (void *)&lt;/CODE&gt;.
11545 &lt;br&gt;&lt;br&gt; This is a GNU extension.
11546 &lt;br&gt;&lt;br&gt;
11547 </synopsis>
11548 </element>
11549 <element content="gl_opendir">
11550 <synopsis>
11551 The address of an alternative implementation of the &lt;CODE&gt;opendir&lt;/CODE&gt;
11552 function. It is used if the &lt;CODE&gt;GLOB_ALTDIRFUNC&lt;/CODE&gt; bit is set in
11553 the flag parameter. The type of this field is
11554 &lt;CODE&gt;void *(*) (const char *)&lt;/CODE&gt;.
11555 &lt;br&gt;&lt;br&gt; This is a GNU extension.
11556 &lt;br&gt;&lt;br&gt;
11557 </synopsis>
11558 </element>
11559 <element content="gl_stat">
11560 <synopsis>
11561 The address of an alternative implementation of the &lt;CODE&gt;stat&lt;/CODE&gt; function
11562 to get information about an object in the filesystem. It is used if the
11563 &lt;CODE&gt;GLOB_ALTDIRFUNC&lt;/CODE&gt; bit is set in the flag parameter. The type of
11564 this field is &lt;CODE&gt;int (*) (const char *, struct stat *)&lt;/CODE&gt;.
11565 &lt;br&gt;&lt;br&gt; This is a GNU extension.
11566 &lt;br&gt;&lt;br&gt;
11567 </synopsis>
11568 </element>
11569 </elements>
11570 </structure>
11571 </construct>
11572 <construct id="dtype-glob64_t" type="dtype">
11573 <structure>
11574 <synopsis>
11575 This data type holds a pointer to a word vector. More precisely, it
11576 records both the address of the word vector and its size. The GNU
11577 implementation contains some more fields which are non-standard
11578 extensions.
11579 &lt;br&gt;&lt;br&gt;
11580 </synopsis>
11581 <elements>
11582 <element content="gl_pathc">
11583 <synopsis>
11584 The number of elements in the vector, excluding the initial null entries
11585 if the GLOB_DOOFFS flag is used (see gl_offs below).
11586 &lt;br&gt;&lt;br&gt;
11587 </synopsis>
11588 </element>
11589 <element content="gl_pathv">
11590 <synopsis>
11591 The address of the vector. This field has type &lt;CODE&gt;char **&lt;/CODE&gt;.
11592 &lt;br&gt;&lt;br&gt;
11593 </synopsis>
11594 </element>
11595 <element content="gl_offs">
11596 <synopsis>
11597 The offset of the first real element of the vector, from its nominal
11598 address in the &lt;CODE&gt;gl_pathv&lt;/CODE&gt; field. Unlike the other fields, this
11599 is always an input to &lt;CODE&gt;glob&lt;/CODE&gt;, rather than an output from it.
11600 &lt;br&gt;&lt;br&gt; If you use a nonzero offset, then that many elements at the beginning of
11601 the vector are left empty. (The &lt;CODE&gt;glob&lt;/CODE&gt; function fills them with
11602 null pointers.)
11603 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;gl_offs&lt;/CODE&gt; field is meaningful only if you use the
11604 &lt;CODE&gt;GLOB_DOOFFS&lt;/CODE&gt; flag. Otherwise, the offset is always zero
11605 regardless of what is in this field, and the first real element comes at
11606 the beginning of the vector.
11607 &lt;br&gt;&lt;br&gt;
11608 </synopsis>
11609 </element>
11610 <element content="gl_closedir">
11611 <synopsis>
11612 The address of an alternative implementation of the &lt;CODE&gt;closedir&lt;/CODE&gt;
11613 function. It is used if the &lt;CODE&gt;GLOB_ALTDIRFUNC&lt;/CODE&gt; bit is set in
11614 the flag parameter. The type of this field is
11615 &lt;CODE&gt;void (*) (void *)&lt;/CODE&gt;.
11616 &lt;br&gt;&lt;br&gt; This is a GNU extension.
11617 &lt;br&gt;&lt;br&gt;
11618 </synopsis>
11619 </element>
11620 <element content="gl_readdir">
11621 <synopsis>
11622 The address of an alternative implementation of the &lt;CODE&gt;readdir64&lt;/CODE&gt;
11623 function used to read the contents of a directory. It is used if the
11624 &lt;CODE&gt;GLOB_ALTDIRFUNC&lt;/CODE&gt; bit is set in the flag parameter. The type of
11625 this field is &lt;CODE&gt;struct dirent64 *(*) (void *)&lt;/CODE&gt;.
11626 &lt;br&gt;&lt;br&gt; This is a GNU extension.
11627 &lt;br&gt;&lt;br&gt;
11628 </synopsis>
11629 </element>
11630 <element content="gl_opendir">
11631 <synopsis>
11632 The address of an alternative implementation of the &lt;CODE&gt;opendir&lt;/CODE&gt;
11633 function. It is used if the &lt;CODE&gt;GLOB_ALTDIRFUNC&lt;/CODE&gt; bit is set in
11634 the flag parameter. The type of this field is
11635 &lt;CODE&gt;void *(*) (const char *)&lt;/CODE&gt;.
11636 &lt;br&gt;&lt;br&gt; This is a GNU extension.
11637 &lt;br&gt;&lt;br&gt;
11638 </synopsis>
11639 </element>
11640 <element content="gl_stat">
11641 <synopsis>
11642 The address of an alternative implementation of the &lt;CODE&gt;stat64&lt;/CODE&gt; function
11643 to get information about an object in the filesystem. It is used if the
11644 &lt;CODE&gt;GLOB_ALTDIRFUNC&lt;/CODE&gt; bit is set in the flag parameter. The type of
11645 this field is &lt;CODE&gt;int (*) (const char *, struct stat64 *)&lt;/CODE&gt;.
11646 &lt;br&gt;&lt;br&gt; This is a GNU extension.
11647 &lt;br&gt;&lt;br&gt;
11648 </synopsis>
11649 </element>
11650 </elements>
11651 </structure>
11652 </construct>
11653 <construct id="function-glob" type="function">
11654 <function returntype="int">
11655 <prototype>
11656 <parameter content="const char *pattern"/>
11657 <parameter content="int flags"/>
11658 <parameter content="int (*errfunc) (const char *filename"/>
11659 <parameter content="int error-code)"/>
11660 <parameter content="glob_t *vector-ptr"/>
11661 </prototype>
11662 <headers>
11663 <header filename = "fnmatch.h"/>
11664 <header filename = "glob.h"/>
11665 </headers>
11666 <synopsis>
11667 The function &lt;CODE&gt;glob&lt;/CODE&gt; does globbing using the pattern &lt;VAR&gt;pattern&lt;/VAR&gt;
11668 in the current directory. It puts the result in a newly allocated
11669 vector, and stores the size and address of this vector into
11670 &lt;CODE&gt;*&lt;VAR&gt;vector-ptr&lt;/VAR&gt;&lt;/CODE&gt;. The argument &lt;VAR&gt;flags&lt;/VAR&gt; is a combination of
11671 bit flags; see Flags for Globbing, for details of the flags.
11672 &lt;br&gt;&lt;br&gt; The result of globbing is a sequence of file names. The function
11673 &lt;CODE&gt;glob&lt;/CODE&gt; allocates a string for each resulting word, then
11674 allocates a vector of type &lt;CODE&gt;char **&lt;/CODE&gt; to store the addresses of
11675 these strings. The last element of the vector is a null pointer.
11676 This vector is called the word vector.
11677 &lt;br&gt;&lt;br&gt; To return this vector, &lt;CODE&gt;glob&lt;/CODE&gt; stores both its address and its
11678 length (number of elements, not counting the terminating null pointer)
11679 into &lt;CODE&gt;*&lt;VAR&gt;vector-ptr&lt;/VAR&gt;&lt;/CODE&gt;.
11680 &lt;br&gt;&lt;br&gt; Normally, &lt;CODE&gt;glob&lt;/CODE&gt; sorts the file names alphabetically before
11681 returning them. You can turn this off with the flag &lt;CODE&gt;GLOB_NOSORT&lt;/CODE&gt;
11682 if you want to get the information as fast as possible. Usually it's
11683 a good idea to let &lt;CODE&gt;glob&lt;/CODE&gt; sort them---if you process the files in
11684 alphabetical order, the users will have a feel for the rate of progress
11685 that your application is making.
11686 &lt;br&gt;&lt;br&gt; If &lt;CODE&gt;glob&lt;/CODE&gt; succeeds, it returns 0. Otherwise, it returns one
11687 of these error codes:
11688 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
11689
11690 &lt;DT&gt;&lt;CODE&gt;GLOB_ABORTED&lt;/CODE&gt;
11691 &lt;DD&gt;
11692 There was an error opening a directory, and you used the flag
11693 &lt;CODE&gt;GLOB_ERR&lt;/CODE&gt; or your specified &lt;VAR&gt;errfunc&lt;/VAR&gt; returned a nonzero
11694 value.
11695
11696
11697 ,
11698
11699 for an explanation of the &lt;CODE&gt;GLOB_ERR&lt;/CODE&gt; flag and &lt;VAR&gt;errfunc&lt;/VAR&gt;.
11700 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;GLOB_NOMATCH&lt;/CODE&gt;
11701 &lt;DD&gt;
11702 The pattern didn't match any existing files. If you use the
11703 &lt;CODE&gt;GLOB_NOCHECK&lt;/CODE&gt; flag, then you never get this error code, because
11704 that flag tells &lt;CODE&gt;glob&lt;/CODE&gt; to &lt;EM&gt;pretend&lt;/EM&gt; that the pattern matched
11705 at least one file.
11706 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;GLOB_NOSPACE&lt;/CODE&gt;
11707 &lt;DD&gt;
11708 It was impossible to allocate memory to hold the result.
11709 &lt;/DL&gt;
11710 &lt;br&gt;&lt;br&gt; In the event of an error, &lt;CODE&gt;glob&lt;/CODE&gt; stores information in
11711 &lt;CODE&gt;*&lt;VAR&gt;vector-ptr&lt;/VAR&gt;&lt;/CODE&gt; about all the matches it has found so far.
11712 &lt;br&gt;&lt;br&gt; It is important to notice that the &lt;CODE&gt;glob&lt;/CODE&gt; function will not fail if
11713 it encounters directories or files which cannot be handled without the
11714 LFS interfaces. The implementation of &lt;CODE&gt;glob&lt;/CODE&gt; is supposed to use
11715 these functions internally. This at least is the assumptions made by
11716 the Unix standard. The GNU extension of allowing the user to provide
11717 own directory handling and &lt;CODE&gt;stat&lt;/CODE&gt; functions complicates things a
11718 bit. If these callback functions are used and a large file or directory
11719 is encountered &lt;CODE&gt;glob&lt;/CODE&gt; &lt;EM&gt;can&lt;/EM&gt; fail.
11720 </synopsis>
11721 </function>
11722 </construct>
11723 <construct id="function-glob64" type="function">
11724 <function returntype="int">
11725 <prototype>
11726 <parameter content="const char *pattern"/>
11727 <parameter content="int flags"/>
11728 <parameter content="int (*errfunc) (const char *filename"/>
11729 <parameter content="int error-code)"/>
11730 <parameter content="glob64_t *vector-ptr"/>
11731 </prototype>
11732 <headers>
11733 <header filename = "glob.h"/>
11734 </headers>
11735 <synopsis>
11736 The &lt;CODE&gt;glob64&lt;/CODE&gt; function was added as part of the Large File Summit
11737 extensions but is not part of the original LFS proposal. The reason for
11738 this is simple: it is not necessary. The necessity for a &lt;CODE&gt;glob64&lt;/CODE&gt;
11739 function is added by the extensions of the GNU &lt;CODE&gt;glob&lt;/CODE&gt;
11740 implementation which allows the user to provide own directory handling
11741 and &lt;CODE&gt;stat&lt;/CODE&gt; functions. The &lt;CODE&gt;readdir&lt;/CODE&gt; and &lt;CODE&gt;stat&lt;/CODE&gt; functions
11742 do depend on the choice of &lt;CODE&gt;_FILE_OFFSET_BITS&lt;/CODE&gt; since the definition
11743 of the types &lt;CODE&gt;struct dirent&lt;/CODE&gt; and &lt;CODE&gt;struct stat&lt;/CODE&gt; will change
11744 depending on the choice.
11745 &lt;br&gt;&lt;br&gt; Beside this difference the &lt;CODE&gt;glob64&lt;/CODE&gt; works just like &lt;CODE&gt;glob&lt;/CODE&gt; in
11746 all aspects.
11747 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
11748 </synopsis>
11749 </function>
11750 </construct>
11751 <construct id="function-globfree" type="function">
11752 <function returntype="void">
11753 <prototype>
11754 <parameter content="glob_t *pglob"/>
11755 </prototype>
11756 <headers>
11757 <header filename = "glob.h"/>
11758 </headers>
11759 <synopsis>
11760 The &lt;CODE&gt;globfree&lt;/CODE&gt; function frees all resources allocated by previous
11761 calls to &lt;CODE&gt;glob&lt;/CODE&gt; associated with the object pointed to by
11762 &lt;VAR&gt;pglob&lt;/VAR&gt;. This function should be called whenever the currently used
11763 &lt;CODE&gt;glob_t&lt;/CODE&gt; typed object isn't used anymore.
11764 </synopsis>
11765 </function>
11766 </construct>
11767 <construct id="function-globfree64" type="function">
11768 <function returntype="void">
11769 <prototype>
11770 <parameter content="glob64_t *pglob"/>
11771 </prototype>
11772 <headers>
11773 <header filename = "glob.h"/>
11774 </headers>
11775 <synopsis>
11776 This function is equivalent to &lt;CODE&gt;globfree&lt;/CODE&gt; but it frees records of
11777 type &lt;CODE&gt;glob64_t&lt;/CODE&gt; which were allocated by &lt;CODE&gt;glob64&lt;/CODE&gt;.
11778 </synopsis>
11779 </function>
11780 </construct>
11781 <construct id="dtype-regex_t" type="dtype">
11782 <structure>
11783 <synopsis>
11784 This type of object holds a compiled regular expression.
11785 It is actually a structure. It has just one field that your programs
11786 should look at:
11787 &lt;br&gt;&lt;br&gt;
11788 </synopsis>
11789 </structure>
11790 </construct>
11791 <construct id="function-regcomp" type="function">
11792 <function returntype="int">
11793 <prototype>
11794 <parameter content="regex_t *restrict compiled"/>
11795 <parameter content="const char *restrict pattern"/>
11796 <parameter content="int cflags"/>
11797 </prototype>
11798 <headers>
11799 <header filename = "regex.h"/>
11800 </headers>
11801 <synopsis>
11802 The function &lt;CODE&gt;regcomp&lt;/CODE&gt; ``compiles'' a regular expression into a
11803 data structure that you can use with &lt;CODE&gt;regexec&lt;/CODE&gt; to match against a
11804 string. The compiled regular expression format is designed for
11805 efficient matching. &lt;CODE&gt;regcomp&lt;/CODE&gt; stores it into &lt;CODE&gt;*&lt;VAR&gt;compiled&lt;/VAR&gt;&lt;/CODE&gt;.
11806 &lt;br&gt;&lt;br&gt; It's up to you to allocate an object of type &lt;CODE&gt;regex_t&lt;/CODE&gt; and pass its
11807 address to &lt;CODE&gt;regcomp&lt;/CODE&gt;.
11808 &lt;br&gt;&lt;br&gt; The argument &lt;VAR&gt;cflags&lt;/VAR&gt; lets you specify various options that control
11809 the syntax and semantics of regular expressions. .
11810 &lt;br&gt;&lt;br&gt; If you use the flag &lt;CODE&gt;REG_NOSUB&lt;/CODE&gt;, then &lt;CODE&gt;regcomp&lt;/CODE&gt; omits from
11811 the compiled regular expression the information necessary to record
11812 how subexpressions actually match. In this case, you might as well
11813 pass &lt;CODE&gt;0&lt;/CODE&gt; for the &lt;VAR&gt;matchptr&lt;/VAR&gt; and &lt;VAR&gt;nmatch&lt;/VAR&gt; arguments when
11814 you call &lt;CODE&gt;regexec&lt;/CODE&gt;.
11815 &lt;br&gt;&lt;br&gt; If you don't use &lt;CODE&gt;REG_NOSUB&lt;/CODE&gt;, then the compiled regular expression
11816 does have the capacity to record how subexpressions match. Also,
11817 &lt;CODE&gt;regcomp&lt;/CODE&gt; tells you how many subexpressions &lt;VAR&gt;pattern&lt;/VAR&gt; has, by
11818 storing the number in &lt;CODE&gt;&lt;VAR&gt;compiled&lt;/VAR&gt;-&gt;re_nsub&lt;/CODE&gt;. You can use that
11819 value to decide how long an array to allocate to hold information about
11820 subexpression matches.
11821 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;regcomp&lt;/CODE&gt; returns &lt;CODE&gt;0&lt;/CODE&gt; if it succeeds in compiling the regular
11822 expression; otherwise, it returns a nonzero error code (see the table
11823 below). You can use &lt;CODE&gt;regerror&lt;/CODE&gt; to produce an error message string
11824 describing the reason for a nonzero value; see Regexp Cleanup.
11825 &lt;br&gt;&lt;br&gt;
11826 </synopsis>
11827 </function>
11828 </construct>
11829 <construct id="function-regexec" type="function">
11830 <function returntype="int">
11831 <prototype>
11832 <parameter content="const regex_t *restrict compiled"/>
11833 <parameter content="const char *restrict string"/>
11834 <parameter content="size_t nmatch"/>
11835 <parameter content="regmatch_t matchptr[restrict]"/>
11836 <parameter content="int eflags"/>
11837 </prototype>
11838 <headers>
11839 <header filename = "regex.h"/>
11840 </headers>
11841 <synopsis>
11842 This function tries to match the compiled regular expression
11843 &lt;CODE&gt;*&lt;VAR&gt;compiled&lt;/VAR&gt;&lt;/CODE&gt; against &lt;VAR&gt;string&lt;/VAR&gt;.
11844 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;regexec&lt;/CODE&gt; returns &lt;CODE&gt;0&lt;/CODE&gt; if the regular expression matches;
11845 otherwise, it returns a nonzero value. See the table below for
11846 what nonzero values mean. You can use &lt;CODE&gt;regerror&lt;/CODE&gt; to produce an
11847 error message string describing the reason for a nonzero value;
11848 see Regexp Cleanup.
11849 &lt;br&gt;&lt;br&gt; The argument &lt;VAR&gt;eflags&lt;/VAR&gt; is a word of bit flags that enable various
11850 options.
11851 &lt;br&gt;&lt;br&gt; If you want to get information about what part of &lt;VAR&gt;string&lt;/VAR&gt; actually
11852 matched the regular expression or its subexpressions, use the arguments
11853 &lt;VAR&gt;matchptr&lt;/VAR&gt; and &lt;VAR&gt;nmatch&lt;/VAR&gt;. Otherwise, pass &lt;CODE&gt;0&lt;/CODE&gt; for
11854 &lt;VAR&gt;nmatch&lt;/VAR&gt;, and &lt;CODE&gt;NULL&lt;/CODE&gt; for &lt;VAR&gt;matchptr&lt;/VAR&gt;. .
11855 </synopsis>
11856 </function>
11857 </construct>
11858 <construct id="dtype-regmatch_t" type="dtype">
11859 <structure>
11860 <synopsis>
11861 This is the data type of the &lt;VAR&gt;matcharray&lt;/VAR&gt; array that you pass to
11862 &lt;CODE&gt;regexec&lt;/CODE&gt;. It contains two structure fields, as follows:
11863 &lt;br&gt;&lt;br&gt;
11864 </synopsis>
11865 <elements>
11866 <element content="rm_so">
11867 <synopsis>
11868 The offset in &lt;VAR&gt;string&lt;/VAR&gt; of the beginning of a substring. Add this
11869 value to &lt;VAR&gt;string&lt;/VAR&gt; to get the address of that part.
11870 &lt;br&gt;&lt;br&gt;
11871 </synopsis>
11872 </element>
11873 </elements>
11874 </structure>
11875 </construct>
11876 <construct id="dtype-regoff_t" type="dtype">
11877 <structure>
11878 </structure>
11879 </construct>
11880 <construct id="function-regfree" type="function">
11881 <function returntype="void">
11882 <prototype>
11883 <parameter content="regex_t *compiled"/>
11884 </prototype>
11885 <headers>
11886 <header filename = "regex.h"/>
11887 </headers>
11888 <synopsis>
11889 Calling &lt;CODE&gt;regfree&lt;/CODE&gt; frees all the storage that &lt;CODE&gt;*&lt;VAR&gt;compiled&lt;/VAR&gt;&lt;/CODE&gt;
11890 points to. This includes various internal fields of the &lt;CODE&gt;regex_t&lt;/CODE&gt;
11891 structure that aren't documented in this manual.
11892 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;regfree&lt;/CODE&gt; does not free the object &lt;CODE&gt;*&lt;VAR&gt;compiled&lt;/VAR&gt;&lt;/CODE&gt; itself.
11893 </synopsis>
11894 </function>
11895 </construct>
11896 <construct id="function-regerror" type="function">
11897 <function returntype="size_t">
11898 <prototype>
11899 <parameter content="int errcode"/>
11900 <parameter content="const regex_t *restrict compiled"/>
11901 <parameter content="char *restrict buffer"/>
11902 <parameter content="size_t length"/>
11903 </prototype>
11904 <headers>
11905 <header filename = "regex.h"/>
11906 </headers>
11907 <synopsis>
11908 This function produces an error message string for the error code
11909 &lt;VAR&gt;errcode&lt;/VAR&gt;, and stores the string in &lt;VAR&gt;length&lt;/VAR&gt; bytes of memory
11910 starting at &lt;VAR&gt;buffer&lt;/VAR&gt;. For the &lt;VAR&gt;compiled&lt;/VAR&gt; argument, supply the
11911 same compiled regular expression structure that &lt;CODE&gt;regcomp&lt;/CODE&gt; or
11912 &lt;CODE&gt;regexec&lt;/CODE&gt; was working with when it got the error. Alternatively,
11913 you can supply &lt;CODE&gt;NULL&lt;/CODE&gt; for &lt;VAR&gt;compiled&lt;/VAR&gt;; you will still get a
11914 meaningful error message, but it might not be as detailed.
11915 &lt;br&gt;&lt;br&gt; If the error message can't fit in &lt;VAR&gt;length&lt;/VAR&gt; bytes (including a
11916 terminating null character), then &lt;CODE&gt;regerror&lt;/CODE&gt; truncates it.
11917 The string that &lt;CODE&gt;regerror&lt;/CODE&gt; stores is always null-terminated
11918 even if it has been truncated.
11919 &lt;br&gt;&lt;br&gt; The return value of &lt;CODE&gt;regerror&lt;/CODE&gt; is the minimum length needed to
11920 store the entire error message. If this is less than &lt;VAR&gt;length&lt;/VAR&gt;, then
11921 the error message was not truncated, and you can use it. Otherwise, you
11922 should call &lt;CODE&gt;regerror&lt;/CODE&gt; again with a larger buffer.
11923 &lt;br&gt;&lt;br&gt; Here is a function which uses &lt;CODE&gt;regerror&lt;/CODE&gt;, but always dynamically
11924 allocates a buffer for the error message:
11925 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
11926 char *get_regerror (int errcode, regex_t *compiled)&lt;br&gt;
11927 {&lt;br&gt;
11928 size_t length = regerror (errcode, compiled, NULL, 0);&lt;br&gt;
11929 char *buffer = xmalloc (length);&lt;br&gt;
11930 (void) regerror (errcode, compiled, buffer, length);&lt;br&gt;
11931 return buffer;&lt;br&gt;
11932 }&lt;br&gt;
11933 &lt;/pre&gt;
11934 </synopsis>
11935 </function>
11936 </construct>
11937 <construct id="type-wordexp_t" type="type">
11938 <structure>
11939 <synopsis>
11940 This data type holds a pointer to a word vector. More precisely, it
11941 records both the address of the word vector and its size.
11942 &lt;br&gt;&lt;br&gt;
11943 </synopsis>
11944 <elements>
11945 <element content="we_wordc">
11946 <synopsis>
11947 The number of elements in the vector.
11948 &lt;br&gt;&lt;br&gt;
11949 </synopsis>
11950 </element>
11951 <element content="we_wordv">
11952 <synopsis>
11953 The address of the vector. This field has type &lt;CODE&gt;char **&lt;/CODE&gt;.
11954 &lt;br&gt;&lt;br&gt;
11955 </synopsis>
11956 </element>
11957 </elements>
11958 </structure>
11959 </construct>
11960 <construct id="function-wordexp" type="function">
11961 <function returntype="int">
11962 <prototype>
11963 <parameter content="const char *words"/>
11964 <parameter content="wordexp_t *word-vector-ptr"/>
11965 <parameter content="int flags"/>
11966 </prototype>
11967 <headers>
11968 <header filename = "wordexp.h"/>
11969 </headers>
11970 <synopsis>
11971 Perform word expansion on the string &lt;VAR&gt;words&lt;/VAR&gt;, putting the result in
11972 a newly allocated vector, and store the size and address of this vector
11973 into &lt;CODE&gt;*&lt;VAR&gt;word-vector-ptr&lt;/VAR&gt;&lt;/CODE&gt;. The argument &lt;VAR&gt;flags&lt;/VAR&gt; is a
11974 combination of bit flags; see Flags for Wordexp, for details of
11975 the flags.
11976 &lt;br&gt;&lt;br&gt; You shouldn't use any of the characters &lt;samp&gt;|&amp;;&lt;&gt;&lt;/samp&gt; in the string
11977 &lt;VAR&gt;words&lt;/VAR&gt; unless they are quoted; likewise for newline. If you use
11978 these characters unquoted, you will get the &lt;CODE&gt;WRDE_BADCHAR&lt;/CODE&gt; error
11979 code. Don't use parentheses or braces unless they are quoted or part of
11980 a word expansion construct. If you use quotation characters &lt;samp&gt;'"`&lt;/samp&gt;,
11981 they should come in pairs that balance.
11982 &lt;br&gt;&lt;br&gt; The results of word expansion are a sequence of words. The function
11983 &lt;CODE&gt;wordexp&lt;/CODE&gt; allocates a string for each resulting word, then
11984 allocates a vector of type &lt;CODE&gt;char **&lt;/CODE&gt; to store the addresses of
11985 these strings. The last element of the vector is a null pointer.
11986 This vector is called the word vector.
11987 &lt;br&gt;&lt;br&gt; To return this vector, &lt;CODE&gt;wordexp&lt;/CODE&gt; stores both its address and its
11988 length (number of elements, not counting the terminating null pointer)
11989 into &lt;CODE&gt;*&lt;VAR&gt;word-vector-ptr&lt;/VAR&gt;&lt;/CODE&gt;.
11990 &lt;br&gt;&lt;br&gt; If &lt;CODE&gt;wordexp&lt;/CODE&gt; succeeds, it returns 0. Otherwise, it returns one
11991 of these error codes:
11992 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
11993
11994 &lt;DT&gt;&lt;CODE&gt;WRDE_BADCHAR&lt;/CODE&gt;
11995 &lt;DD&gt;
11996 The input string &lt;VAR&gt;words&lt;/VAR&gt; contains an unquoted invalid character such
11997 as &lt;samp&gt;|&lt;/samp&gt;.
11998 &lt;br&gt;&lt;br&gt; &lt;LI&gt; WRDE_BADVAL
11999 The input string refers to an undefined shell variable, and you used the flag
12000 &lt;CODE&gt;WRDE_UNDEF&lt;/CODE&gt; to forbid such references.
12001 &lt;br&gt;&lt;br&gt; &lt;LI&gt; WRDE_CMDSUB
12002 The input string uses command substitution, and you used the flag
12003 &lt;CODE&gt;WRDE_NOCMD&lt;/CODE&gt; to forbid command substitution.
12004 &lt;br&gt;&lt;br&gt; &lt;LI&gt; WRDE_NOSPACE
12005 It was impossible to allocate memory to hold the result. In this case,
12006 &lt;CODE&gt;wordexp&lt;/CODE&gt; can store part of the results---as much as it could
12007 allocate room for.
12008 &lt;br&gt;&lt;br&gt; &lt;LI&gt; WRDE_SYNTAX
12009 There was a syntax error in the input string. For example, an unmatched
12010 quoting character is a syntax error.
12011
12012 </synopsis>
12013 </function>
12014 </construct>
12015 <construct id="function-wordfree" type="function">
12016 <function returntype="void">
12017 <prototype>
12018 <parameter content="wordexp_t *word-vector-ptr"/>
12019 </prototype>
12020 <headers>
12021 <header filename = "wordexp.h"/>
12022 </headers>
12023 <synopsis>
12024 Free the storage used for the word-strings and vector that
12025 &lt;CODE&gt;*&lt;VAR&gt;word-vector-ptr&lt;/VAR&gt;&lt;/CODE&gt; points to. This does not free the
12026 structure &lt;CODE&gt;*&lt;VAR&gt;word-vector-ptr&lt;/VAR&gt;&lt;/CODE&gt; itself---only the other
12027 data it points to.
12028 </synopsis>
12029 </function>
12030 </construct>
12031 <construct id="function-backtrace" type="function">
12032 <function returntype="int">
12033 <prototype>
12034 <parameter content="void **buffer"/>
12035 <parameter content="int size"/>
12036 </prototype>
12037 <headers>
12038 <header filename = "wordexp.h"/>
12039 <header filename = "execinfo.h"/>
12040 </headers>
12041 <synopsis>
12042 The &lt;CODE&gt;backtrace&lt;/CODE&gt; function obtains a backtrace for the current
12043 thread, as a list of pointers, and places the information into
12044 &lt;VAR&gt;buffer&lt;/VAR&gt;. The argument &lt;VAR&gt;size&lt;/VAR&gt; should be the number of
12045 &lt;CODE&gt;void *&lt;/CODE&gt; elements that will fit into &lt;VAR&gt;buffer&lt;/VAR&gt;. The return
12046 value is the actual number of entries of &lt;VAR&gt;buffer&lt;/VAR&gt; that are obtained,
12047 and is at most &lt;VAR&gt;size&lt;/VAR&gt;.
12048 &lt;br&gt;&lt;br&gt; The pointers placed in &lt;VAR&gt;buffer&lt;/VAR&gt; are actually return addresses
12049 obtained by inspecting the stack, one return address per stack frame.
12050 &lt;br&gt;&lt;br&gt; Note that certain compiler optimizations may interfere with obtaining a
12051 valid backtrace. Function inlining causes the inlined function to not
12052 have a stack frame; tail call optimization replaces one stack frame with
12053 another; frame pointer elimination will stop &lt;CODE&gt;backtrace&lt;/CODE&gt; from
12054 interpreting the stack contents correctly.
12055 </synopsis>
12056 </function>
12057 </construct>
12058 <construct id="function-backtrace_symbols" type="function">
12059 <function returntype="char **">
12060 <prototype>
12061 <parameter content="void *const *buffer"/>
12062 <parameter content="int size"/>
12063 </prototype>
12064 <headers>
12065 <header filename = "execinfo.h"/>
12066 </headers>
12067 <synopsis>
12068 The &lt;CODE&gt;backtrace_symbols&lt;/CODE&gt; function translates the information
12069 obtained from the &lt;CODE&gt;backtrace&lt;/CODE&gt; function into an array of strings.
12070 The argument &lt;VAR&gt;buffer&lt;/VAR&gt; should be a pointer to an array of addresses
12071 obtained via the &lt;CODE&gt;backtrace&lt;/CODE&gt; function, and &lt;VAR&gt;size&lt;/VAR&gt; is the number
12072 of entries in that array (the return value of &lt;CODE&gt;backtrace&lt;/CODE&gt;).
12073 &lt;br&gt;&lt;br&gt; The return value is a pointer to an array of strings, which has
12074 &lt;VAR&gt;size&lt;/VAR&gt; entries just like the array &lt;VAR&gt;buffer&lt;/VAR&gt;. Each string
12075 contains a printable representation of the corresponding element of
12076 &lt;VAR&gt;buffer&lt;/VAR&gt;. It includes the function name (if this can be
12077 determined), an offset into the function, and the actual return address
12078 (in hexadecimal).
12079 &lt;br&gt;&lt;br&gt; Currently, the function name and offset only be obtained on systems that
12080 use the ELF binary format for programs and libraries. On other systems,
12081 only the hexadecimal return address will be present. Also, you may need
12082 to pass additional flags to the linker to make the function names
12083 available to the program. (For example, on systems using GNU ld, you
12084 must pass (&lt;CODE&gt;-rdynamic&lt;/CODE&gt;.)
12085 &lt;br&gt;&lt;br&gt; The return value of &lt;CODE&gt;backtrace_symbols&lt;/CODE&gt; is a pointer obtained via
12086 the &lt;CODE&gt;malloc&lt;/CODE&gt; function, and it is the responsibility of the caller
12087 to &lt;CODE&gt;free&lt;/CODE&gt; that pointer. Note that only the return value need be
12088 freed, not the individual strings.
12089 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;NULL&lt;/CODE&gt; if sufficient memory for the strings
12090 cannot be obtained.
12091 </synopsis>
12092 </function>
12093 </construct>
12094 <construct id="function-backtrace_symbols_fd" type="function">
12095 <function returntype="void">
12096 <prototype>
12097 <parameter content="void *const *buffer"/>
12098 <parameter content="int size"/>
12099 <parameter content="int fd"/>
12100 </prototype>
12101 <headers>
12102 <header filename = "execinfo.h"/>
12103 </headers>
12104 <synopsis>
12105 The &lt;CODE&gt;backtrace_symbols_fd&lt;/CODE&gt; function performs the same translation
12106 as the function &lt;CODE&gt;backtrace_symbols&lt;/CODE&gt; function. Instead of returning
12107 the strings to the caller, it writes the strings to the file descriptor
12108 &lt;VAR&gt;fd&lt;/VAR&gt;, one per line. It does not use the &lt;CODE&gt;malloc&lt;/CODE&gt; function, and
12109 can therefore be used in situations where that function might fail.
12110 </synopsis>
12111 </function>
12112 </construct>
12113 <construct id="function-ctermid" type="function">
12114 <function returntype="char *">
12115 <prototype>
12116 <parameter content="char *string"/>
12117 </prototype>
12118 <headers>
12119 <header filename = "stdio.h"/>
12120 </headers>
12121 <synopsis>
12122 The &lt;CODE&gt;ctermid&lt;/CODE&gt; function returns a string containing the file name of
12123 the controlling terminal for the current process. If &lt;VAR&gt;string&lt;/VAR&gt; is
12124 not a null pointer, it should be an array that can hold at least
12125 &lt;CODE&gt;L_ctermid&lt;/CODE&gt; characters; the string is returned in this array.
12126 Otherwise, a pointer to a string in a static area is returned, which
12127 might get overwritten on subsequent calls to this function.
12128 &lt;br&gt;&lt;br&gt; An empty string is returned if the file name cannot be determined for
12129 any reason. Even if a file name is returned, access to the file it
12130 represents is not guaranteed.
12131 </synopsis>
12132 </function>
12133 </construct>
12134 <construct id="function-setsid" type="function">
12135 <function returntype="pid_t">
12136 <prototype>
12137 <parameter content="void"/>
12138 </prototype>
12139 <headers>
12140 <header filename = "stdio.h"/>
12141 <header filename = "unistd.h"/>
12142 </headers>
12143 <synopsis>
12144 The &lt;CODE&gt;setsid&lt;/CODE&gt; function creates a new session. The calling process
12145 becomes the session leader, and is put in a new process group whose
12146 process group ID is the same as the process ID of that process. There
12147 are initially no other processes in the new process group, and no other
12148 process groups in the new session.
12149 &lt;br&gt;&lt;br&gt; This function also makes the calling process have no controlling terminal.
12150 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;setsid&lt;/CODE&gt; function returns the new process group ID of the
12151 calling process if successful. A return value of &lt;CODE&gt;-1&lt;/CODE&gt; indicates an
12152 error. The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this
12153 function:
12154 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
12155
12156 &lt;DT&gt;&lt;CODE&gt;EPERM&lt;/CODE&gt;
12157 &lt;DD&gt;
12158 The calling process is already a process group leader, or there is
12159 already another process group around that has the same process group ID.
12160
12161 </synopsis>
12162 </function>
12163 </construct>
12164 <construct id="function-getsid" type="function">
12165 <function returntype="pid_t">
12166 <prototype>
12167 <parameter content="pid_t pid"/>
12168 </prototype>
12169 <headers>
12170 <header filename = "unistd.h"/>
12171 </headers>
12172 <synopsis>
12173 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;getsid&lt;/CODE&gt; function returns the process group ID of the session
12174 leader of the specified process. If a &lt;VAR&gt;pid&lt;/VAR&gt; is &lt;CODE&gt;0&lt;/CODE&gt;, the
12175 process group ID of the session leader of the current process is
12176 returned.
12177 &lt;br&gt;&lt;br&gt; In case of error &lt;CODE&gt;-1&lt;/CODE&gt; is returned and &lt;CODE&gt;errno&lt;/CODE&gt; is set. The
12178 following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
12179 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
12180
12181 &lt;DT&gt;&lt;CODE&gt;ESRCH&lt;/CODE&gt;
12182 &lt;DD&gt;
12183 There is no process with the given process ID &lt;VAR&gt;pid&lt;/VAR&gt;.
12184 &lt;LI&gt; EPERM
12185 The calling process and the process specified by &lt;VAR&gt;pid&lt;/VAR&gt; are in
12186 different sessions, and the implementation doesn't allow to access the
12187 process group ID of the session leader of the process with ID &lt;VAR&gt;pid&lt;/VAR&gt;
12188 from the calling process.
12189
12190 </synopsis>
12191 </function>
12192 </construct>
12193 <construct id="function-setpgid" type="function">
12194 <function returntype="int">
12195 <prototype>
12196 <parameter content="pid_t pid"/>
12197 <parameter content="pid_t pgid"/>
12198 </prototype>
12199 <headers>
12200 <header filename = "unistd.h"/>
12201 </headers>
12202 <synopsis>
12203 The &lt;CODE&gt;setpgid&lt;/CODE&gt; function puts the process &lt;VAR&gt;pid&lt;/VAR&gt; into the process
12204 group &lt;VAR&gt;pgid&lt;/VAR&gt;. As a special case, either &lt;VAR&gt;pid&lt;/VAR&gt; or &lt;VAR&gt;pgid&lt;/VAR&gt; can
12205 be zero to indicate the process ID of the calling process.
12206 &lt;br&gt;&lt;br&gt; This function fails on a system that does not support job control.
12207 , for more information.
12208 &lt;br&gt;&lt;br&gt; If the operation is successful, &lt;CODE&gt;setpgid&lt;/CODE&gt; returns zero. Otherwise
12209 it returns &lt;CODE&gt;-1&lt;/CODE&gt;. The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are
12210 defined for this function:
12211 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
12212
12213 &lt;DT&gt;&lt;CODE&gt;EACCES&lt;/CODE&gt;
12214 &lt;DD&gt;
12215 The child process named by &lt;VAR&gt;pid&lt;/VAR&gt; has executed an &lt;CODE&gt;exec&lt;/CODE&gt;
12216 function since it was forked.
12217 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
12218 The value of the &lt;VAR&gt;pgid&lt;/VAR&gt; is not valid.
12219 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOSYS
12220 The system doesn't support job control.
12221 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EPERM
12222 The process indicated by the &lt;VAR&gt;pid&lt;/VAR&gt; argument is a session leader,
12223 or is not in the same session as the calling process, or the value of
12224 the &lt;VAR&gt;pgid&lt;/VAR&gt; argument doesn't match a process group ID in the same
12225 session as the calling process.
12226 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ESRCH
12227 The process indicated by the &lt;VAR&gt;pid&lt;/VAR&gt; argument is not the calling
12228 process or a child of the calling process.
12229
12230 </synopsis>
12231 </function>
12232 </construct>
12233 <construct id="function-setpgrp" type="function">
12234 <function returntype="int">
12235 <prototype>
12236 <parameter content="pid_t pid"/>
12237 <parameter content="pid_t pgid"/>
12238 </prototype>
12239 <headers>
12240 <header filename = "unistd.h"/>
12241 </headers>
12242 <synopsis>
12243 This is the BSD Unix name for &lt;CODE&gt;setpgid&lt;/CODE&gt;. Both functions do exactly
12244 the same thing.
12245 </synopsis>
12246 </function>
12247 </construct>
12248 <construct id="function-tcgetpgrp" type="function">
12249 <function returntype="pid_t">
12250 <prototype>
12251 <parameter content="int filedes"/>
12252 </prototype>
12253 <headers>
12254 <header filename = "unistd.h"/>
12255 </headers>
12256 <synopsis>
12257 This function returns the process group ID of the foreground process
12258 group associated with the terminal open on descriptor &lt;VAR&gt;filedes&lt;/VAR&gt;.
12259 &lt;br&gt;&lt;br&gt; If there is no foreground process group, the return value is a number
12260 greater than &lt;CODE&gt;1&lt;/CODE&gt; that does not match the process group ID of any
12261 existing process group. This can happen if all of the processes in the
12262 job that was formerly the foreground job have terminated, and no other
12263 job has yet been moved into the foreground.
12264 &lt;br&gt;&lt;br&gt; In case of an error, a value of &lt;CODE&gt;-1&lt;/CODE&gt; is returned. The
12265 following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
12266 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
12267
12268 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
12269 &lt;DD&gt;
12270 The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not a valid file descriptor.
12271 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOSYS
12272 The system doesn't support job control.
12273 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTTY
12274 The terminal file associated with the &lt;VAR&gt;filedes&lt;/VAR&gt; argument isn't the
12275 controlling terminal of the calling process.
12276
12277 </synopsis>
12278 </function>
12279 </construct>
12280 <construct id="function-tcsetpgrp" type="function">
12281 <function returntype="int">
12282 <prototype>
12283 <parameter content="int filedes"/>
12284 <parameter content="pid_t pgid"/>
12285 </prototype>
12286 <headers>
12287 <header filename = "unistd.h"/>
12288 </headers>
12289 <synopsis>
12290 This function is used to set a terminal's foreground process group ID.
12291 The argument &lt;VAR&gt;filedes&lt;/VAR&gt; is a descriptor which specifies the terminal;
12292 &lt;VAR&gt;pgid&lt;/VAR&gt; specifies the process group. The calling process must be a
12293 member of the same session as &lt;VAR&gt;pgid&lt;/VAR&gt; and must have the same
12294 controlling terminal.
12295 &lt;br&gt;&lt;br&gt; For terminal access purposes, this function is treated as output. If it
12296 is called from a background process on its controlling terminal,
12297 normally all processes in the process group are sent a &lt;CODE&gt;SIGTTOU&lt;/CODE&gt;
12298 signal. The exception is if the calling process itself is ignoring or
12299 blocking &lt;CODE&gt;SIGTTOU&lt;/CODE&gt; signals, in which case the operation is
12300 performed and no signal is sent.
12301 &lt;br&gt;&lt;br&gt; If successful, &lt;CODE&gt;tcsetpgrp&lt;/CODE&gt; returns &lt;CODE&gt;0&lt;/CODE&gt;. A return value of
12302 &lt;CODE&gt;-1&lt;/CODE&gt; indicates an error. The following &lt;CODE&gt;errno&lt;/CODE&gt; error
12303 conditions are defined for this function:
12304 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
12305
12306 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
12307 &lt;DD&gt;
12308 The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not a valid file descriptor.
12309 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
12310 The &lt;VAR&gt;pgid&lt;/VAR&gt; argument is not valid.
12311 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOSYS
12312 The system doesn't support job control.
12313 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTTY
12314 The &lt;VAR&gt;filedes&lt;/VAR&gt; isn't the controlling terminal of the calling process.
12315 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EPERM
12316 The &lt;VAR&gt;pgid&lt;/VAR&gt; isn't a process group in the same session as the calling
12317 process.
12318
12319 </synopsis>
12320 </function>
12321 </construct>
12322 <construct id="function-tcgetsid" type="function">
12323 <function returntype="pid_t">
12324 <prototype>
12325 <parameter content="int fildes"/>
12326 </prototype>
12327 <headers>
12328 <header filename = "termios.h"/>
12329 </headers>
12330 <synopsis>
12331 This function is used to obtain the process group ID of the session
12332 for which the terminal specified by &lt;VAR&gt;fildes&lt;/VAR&gt; is the controlling terminal.
12333 If the call is successful the group ID is returned. Otherwise the
12334 return value is &lt;CODE&gt;(pid_t) -1&lt;/CODE&gt; and the global variable &lt;VAR&gt;errno&lt;/VAR&gt;
12335 is set to the following value:
12336 &lt;DL&gt;
12337
12338 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
12339 &lt;DD&gt;
12340 The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not a valid file descriptor.
12341 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTTY
12342 The calling process does not have a controlling terminal, or the file
12343 is not the controlling terminal.
12344
12345 </synopsis>
12346 </function>
12347 </construct>
12348 <construct id="function-islower" type="function">
12349 <function returntype="int">
12350 <prototype>
12351 <parameter content="int c"/>
12352 </prototype>
12353 <headers>
12354 <header filename = "ctype.h"/>
12355 </headers>
12356 <synopsis>
12357 Returns true if &lt;VAR&gt;c&lt;/VAR&gt; is a lower-case letter. The letter need not be
12358 from the Latin alphabet, any alphabet representable is valid.
12359 </synopsis>
12360 </function>
12361 </construct>
12362 <construct id="function-isupper" type="function">
12363 <function returntype="int">
12364 <prototype>
12365 <parameter content="int c"/>
12366 </prototype>
12367 <headers>
12368 <header filename = "ctype.h"/>
12369 </headers>
12370 <synopsis>
12371 Returns true if &lt;VAR&gt;c&lt;/VAR&gt; is an upper-case letter. The letter need not be
12372 from the Latin alphabet, any alphabet representable is valid.
12373 </synopsis>
12374 </function>
12375 </construct>
12376 <construct id="function-isalpha" type="function">
12377 <function returntype="int">
12378 <prototype>
12379 <parameter content="int c"/>
12380 </prototype>
12381 <headers>
12382 <header filename = "ctype.h"/>
12383 </headers>
12384 <synopsis>
12385 Returns true if &lt;VAR&gt;c&lt;/VAR&gt; is an alphabetic character (a letter). If
12386 &lt;CODE&gt;islower&lt;/CODE&gt; or &lt;CODE&gt;isupper&lt;/CODE&gt; is true of a character, then
12387 &lt;CODE&gt;isalpha&lt;/CODE&gt; is also true.
12388 &lt;br&gt;&lt;br&gt; In some locales, there may be additional characters for which
12389 &lt;CODE&gt;isalpha&lt;/CODE&gt; is true---letters which are neither upper case nor lower
12390 case. But in the standard &lt;CODE&gt;"C"&lt;/CODE&gt; locale, there are no such
12391 additional characters.
12392 </synopsis>
12393 </function>
12394 </construct>
12395 <construct id="function-isdigit" type="function">
12396 <function returntype="int">
12397 <prototype>
12398 <parameter content="int c"/>
12399 </prototype>
12400 <headers>
12401 <header filename = "ctype.h"/>
12402 </headers>
12403 <synopsis>
12404 Returns true if &lt;VAR&gt;c&lt;/VAR&gt; is a decimal digit (&lt;samp&gt;0&lt;/samp&gt; through &lt;samp&gt;9&lt;/samp&gt;).
12405 </synopsis>
12406 </function>
12407 </construct>
12408 <construct id="function-isalnum" type="function">
12409 <function returntype="int">
12410 <prototype>
12411 <parameter content="int c"/>
12412 </prototype>
12413 <headers>
12414 <header filename = "ctype.h"/>
12415 </headers>
12416 <synopsis>
12417 Returns true if &lt;VAR&gt;c&lt;/VAR&gt; is an alphanumeric character (a letter or
12418 number); in other words, if either &lt;CODE&gt;isalpha&lt;/CODE&gt; or &lt;CODE&gt;isdigit&lt;/CODE&gt; is
12419 true of a character, then &lt;CODE&gt;isalnum&lt;/CODE&gt; is also true.
12420 </synopsis>
12421 </function>
12422 </construct>
12423 <construct id="function-isxdigit" type="function">
12424 <function returntype="int">
12425 <prototype>
12426 <parameter content="int c"/>
12427 </prototype>
12428 <headers>
12429 <header filename = "ctype.h"/>
12430 </headers>
12431 <synopsis>
12432 Returns true if &lt;VAR&gt;c&lt;/VAR&gt; is a hexadecimal digit.
12433 Hexadecimal digits include the normal decimal digits &lt;samp&gt;0&lt;/samp&gt; through
12434 &lt;samp&gt;9&lt;/samp&gt; and the letters &lt;samp&gt;A&lt;/samp&gt; through &lt;samp&gt;F&lt;/samp&gt; and
12435 &lt;samp&gt;a&lt;/samp&gt; through &lt;samp&gt;f&lt;/samp&gt;.
12436 </synopsis>
12437 </function>
12438 </construct>
12439 <construct id="function-ispunct" type="function">
12440 <function returntype="int">
12441 <prototype>
12442 <parameter content="int c"/>
12443 </prototype>
12444 <headers>
12445 <header filename = "ctype.h"/>
12446 </headers>
12447 <synopsis>
12448 Returns true if &lt;VAR&gt;c&lt;/VAR&gt; is a punctuation character.
12449 This means any printing character that is not alphanumeric or a space
12450 character.
12451 </synopsis>
12452 </function>
12453 </construct>
12454 <construct id="function-isspace" type="function">
12455 <function returntype="int">
12456 <prototype>
12457 <parameter content="int c"/>
12458 </prototype>
12459 <headers>
12460 <header filename = "ctype.h"/>
12461 </headers>
12462 <synopsis>
12463 Returns true if &lt;VAR&gt;c&lt;/VAR&gt; is a whitespace character. In the standard
12464 &lt;CODE&gt;"C"&lt;/CODE&gt; locale, &lt;CODE&gt;isspace&lt;/CODE&gt; returns true for only the standard
12465 whitespace characters:
12466 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
12467
12468 &lt;DT&gt;&lt;CODE&gt;' '&lt;/CODE&gt;
12469 &lt;DD&gt;
12470 space
12471 &lt;br&gt;&lt;br&gt; &lt;LI&gt; '\f'
12472 formfeed
12473 &lt;br&gt;&lt;br&gt; &lt;LI&gt; '\n'
12474 newline
12475 &lt;br&gt;&lt;br&gt; &lt;LI&gt; '\r'
12476 carriage return
12477 &lt;br&gt;&lt;br&gt; &lt;LI&gt; '\t'
12478 horizontal tab
12479 &lt;br&gt;&lt;br&gt; &lt;LI&gt; '\v'
12480 vertical tab
12481
12482 </synopsis>
12483 </function>
12484 </construct>
12485 <construct id="function-isblank" type="function">
12486 <function returntype="int">
12487 <prototype>
12488 <parameter content="int c"/>
12489 </prototype>
12490 <headers>
12491 <header filename = "ctype.h"/>
12492 </headers>
12493 <synopsis>
12494 Returns true if &lt;VAR&gt;c&lt;/VAR&gt; is a blank character; that is, a space or a tab.
12495 This function was originally a GNU extension, but was added in ISO C99.
12496 </synopsis>
12497 </function>
12498 </construct>
12499 <construct id="function-isgraph" type="function">
12500 <function returntype="int">
12501 <prototype>
12502 <parameter content="int c"/>
12503 </prototype>
12504 <headers>
12505 <header filename = "ctype.h"/>
12506 </headers>
12507 <synopsis>
12508 Returns true if &lt;VAR&gt;c&lt;/VAR&gt; is a graphic character; that is, a character
12509 that has a glyph associated with it. The whitespace characters are not
12510 considered graphic.
12511 </synopsis>
12512 </function>
12513 </construct>
12514 <construct id="function-isprint" type="function">
12515 <function returntype="int">
12516 <prototype>
12517 <parameter content="int c"/>
12518 </prototype>
12519 <headers>
12520 <header filename = "ctype.h"/>
12521 </headers>
12522 <synopsis>
12523 Returns true if &lt;VAR&gt;c&lt;/VAR&gt; is a printing character. Printing characters
12524 include all the graphic characters, plus the space (&lt;samp&gt; &lt;/samp&gt;) character.
12525 </synopsis>
12526 </function>
12527 </construct>
12528 <construct id="function-iscntrl" type="function">
12529 <function returntype="int">
12530 <prototype>
12531 <parameter content="int c"/>
12532 </prototype>
12533 <headers>
12534 <header filename = "ctype.h"/>
12535 </headers>
12536 <synopsis>
12537 Returns true if &lt;VAR&gt;c&lt;/VAR&gt; is a control character (that is, a character that
12538 is not a printing character).
12539 </synopsis>
12540 </function>
12541 </construct>
12542 <construct id="function-isascii" type="function">
12543 <function returntype="int">
12544 <prototype>
12545 <parameter content="int c"/>
12546 </prototype>
12547 <headers>
12548 <header filename = "ctype.h"/>
12549 </headers>
12550 <synopsis>
12551 Returns true if &lt;VAR&gt;c&lt;/VAR&gt; is a 7-bit &lt;CODE&gt;unsigned char&lt;/CODE&gt; value that fits
12552 into the US/UK ASCII character set. This function is a BSD extension
12553 and is also an SVID extension.
12554 </synopsis>
12555 </function>
12556 </construct>
12557 <construct id="function-tolower" type="function">
12558 <function returntype="int">
12559 <prototype>
12560 <parameter content="int c"/>
12561 </prototype>
12562 <headers>
12563 <header filename = "ctype.h"/>
12564 </headers>
12565 <synopsis>
12566 If &lt;VAR&gt;c&lt;/VAR&gt; is an upper-case letter, &lt;CODE&gt;tolower&lt;/CODE&gt; returns the corresponding
12567 lower-case letter. If &lt;VAR&gt;c&lt;/VAR&gt; is not an upper-case letter,
12568 &lt;VAR&gt;c&lt;/VAR&gt; is returned unchanged.
12569 </synopsis>
12570 </function>
12571 </construct>
12572 <construct id="function-toupper" type="function">
12573 <function returntype="int">
12574 <prototype>
12575 <parameter content="int c"/>
12576 </prototype>
12577 <headers>
12578 <header filename = "ctype.h"/>
12579 </headers>
12580 <synopsis>
12581 If &lt;VAR&gt;c&lt;/VAR&gt; is a lower-case letter, &lt;CODE&gt;toupper&lt;/CODE&gt; returns the corresponding
12582 upper-case letter. Otherwise &lt;VAR&gt;c&lt;/VAR&gt; is returned unchanged.
12583 </synopsis>
12584 </function>
12585 </construct>
12586 <construct id="function-toascii" type="function">
12587 <function returntype="int">
12588 <prototype>
12589 <parameter content="int c"/>
12590 </prototype>
12591 <headers>
12592 <header filename = "ctype.h"/>
12593 </headers>
12594 <synopsis>
12595 This function converts &lt;VAR&gt;c&lt;/VAR&gt; to a 7-bit &lt;CODE&gt;unsigned char&lt;/CODE&gt; value
12596 that fits into the US/UK ASCII character set, by clearing the high-order
12597 bits. This function is a BSD extension and is also an SVID extension.
12598 </synopsis>
12599 </function>
12600 </construct>
12601 <construct id="function-_tolower" type="function">
12602 <function returntype="int">
12603 <prototype>
12604 <parameter content="int c"/>
12605 </prototype>
12606 <headers>
12607 <header filename = "ctype.h"/>
12608 </headers>
12609 <synopsis>
12610 This is identical to &lt;CODE&gt;tolower&lt;/CODE&gt;, and is provided for compatibility
12611 with the SVID. .
12612 </synopsis>
12613 </function>
12614 </construct>
12615 <construct id="function-_toupper" type="function">
12616 <function returntype="int">
12617 <prototype>
12618 <parameter content="int c"/>
12619 </prototype>
12620 <headers>
12621 <header filename = "ctype.h"/>
12622 </headers>
12623 <synopsis>
12624 This is identical to &lt;CODE&gt;toupper&lt;/CODE&gt;, and is provided for compatibility
12625 with the SVID.
12626 </synopsis>
12627 </function>
12628 </construct>
12629 <construct id="dtype-wctype_t" type="dtype">
12630 <structure>
12631 </structure>
12632 </construct>
12633 <construct id="function-wctype" type="function">
12634 <function returntype="wctype_t">
12635 <prototype>
12636 <parameter content="const char *property"/>
12637 </prototype>
12638 <headers>
12639 <header filename = "wctype.h"/>
12640 </headers>
12641 <synopsis>
12642 The &lt;CODE&gt;wctype&lt;/CODE&gt; returns a value representing a class of wide
12643 characters which is identified by the string &lt;VAR&gt;property&lt;/VAR&gt;. Beside
12644 some standard properties each locale can define its own ones. In case
12645 no property with the given name is known for the current locale
12646 selected for the &lt;CODE&gt;LC_CTYPE&lt;/CODE&gt; category, the function returns zero.
12647 &lt;br&gt;&lt;br&gt;
12648 The properties known in every locale are:
12649 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;&lt;/pre&gt;
12650 &lt;DD&gt;&lt;br&gt;
12651 &lt;br&gt;&lt;br&gt; This function is declared in &lt;TT&gt;wctype.h&lt;/TT&gt;.
12652 </synopsis>
12653 </function>
12654 </construct>
12655 <construct id="function-iswctype" type="function">
12656 <function returntype="int">
12657 <prototype>
12658 <parameter content="wint_t wc"/>
12659 <parameter content="wctype_t desc"/>
12660 </prototype>
12661 <headers>
12662 <header filename = "wctype.h"/>
12663 </headers>
12664 <synopsis>
12665 This function returns a nonzero value if &lt;VAR&gt;wc&lt;/VAR&gt; is in the character
12666 class specified by &lt;VAR&gt;desc&lt;/VAR&gt;. &lt;VAR&gt;desc&lt;/VAR&gt; must previously be returned
12667 by a successful call to &lt;CODE&gt;wctype&lt;/CODE&gt;.
12668 &lt;br&gt;&lt;br&gt; This function is declared in &lt;TT&gt;wctype.h&lt;/TT&gt;.
12669 </synopsis>
12670 </function>
12671 </construct>
12672 <construct id="function-iswalnum" type="function">
12673 <function returntype="int">
12674 <prototype>
12675 <parameter content="wint_t wc"/>
12676 </prototype>
12677 <headers>
12678 <header filename = "wctype.h"/>
12679 </headers>
12680 <synopsis>
12681 This function returns a nonzero value if &lt;VAR&gt;wc&lt;/VAR&gt; is an alphanumeric
12682 character (a letter or number); in other words, if either &lt;CODE&gt;iswalpha&lt;/CODE&gt;
12683 or &lt;CODE&gt;iswdigit&lt;/CODE&gt; is true of a character, then &lt;CODE&gt;iswalnum&lt;/CODE&gt; is also
12684 true.
12685 &lt;br&gt;&lt;br&gt;
12686 This function can be implemented using
12687 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
12688 iswctype (wc, wctype ("alnum"))&lt;br&gt;
12689 &lt;/pre&gt;
12690 &lt;br&gt;&lt;br&gt; It is declared in &lt;TT&gt;wctype.h&lt;/TT&gt;.
12691 </synopsis>
12692 </function>
12693 </construct>
12694 <construct id="function-iswalpha" type="function">
12695 <function returntype="int">
12696 <prototype>
12697 <parameter content="wint_t wc"/>
12698 </prototype>
12699 <headers>
12700 <header filename = "wctype.h"/>
12701 </headers>
12702 <synopsis>
12703 Returns true if &lt;VAR&gt;wc&lt;/VAR&gt; is an alphabetic character (a letter). If
12704 &lt;CODE&gt;iswlower&lt;/CODE&gt; or &lt;CODE&gt;iswupper&lt;/CODE&gt; is true of a character, then
12705 &lt;CODE&gt;iswalpha&lt;/CODE&gt; is also true.
12706 &lt;br&gt;&lt;br&gt; In some locales, there may be additional characters for which
12707 &lt;CODE&gt;iswalpha&lt;/CODE&gt; is true---letters which are neither upper case nor lower
12708 case. But in the standard &lt;CODE&gt;"C"&lt;/CODE&gt; locale, there are no such
12709 additional characters.
12710 &lt;br&gt;&lt;br&gt;
12711 This function can be implemented using
12712 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
12713 iswctype (wc, wctype ("alpha"))&lt;br&gt;
12714 &lt;/pre&gt;
12715 &lt;br&gt;&lt;br&gt; It is declared in &lt;TT&gt;wctype.h&lt;/TT&gt;.
12716 </synopsis>
12717 </function>
12718 </construct>
12719 <construct id="function-iswcntrl" type="function">
12720 <function returntype="int">
12721 <prototype>
12722 <parameter content="wint_t wc"/>
12723 </prototype>
12724 <headers>
12725 <header filename = "wctype.h"/>
12726 </headers>
12727 <synopsis>
12728 Returns true if &lt;VAR&gt;wc&lt;/VAR&gt; is a control character (that is, a character that
12729 is not a printing character).
12730 &lt;br&gt;&lt;br&gt;
12731 This function can be implemented using
12732 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
12733 iswctype (wc, wctype ("cntrl"))&lt;br&gt;
12734 &lt;/pre&gt;
12735 &lt;br&gt;&lt;br&gt; It is declared in &lt;TT&gt;wctype.h&lt;/TT&gt;.
12736 </synopsis>
12737 </function>
12738 </construct>
12739 <construct id="function-iswdigit" type="function">
12740 <function returntype="int">
12741 <prototype>
12742 <parameter content="wint_t wc"/>
12743 </prototype>
12744 <headers>
12745 <header filename = "wctype.h"/>
12746 </headers>
12747 <synopsis>
12748 Returns true if &lt;VAR&gt;wc&lt;/VAR&gt; is a digit (e.g., &lt;samp&gt;0&lt;/samp&gt; through &lt;samp&gt;9&lt;/samp&gt;).
12749 Please note that this function does not only return a nonzero value for
12750 &lt;EM&gt;decimal&lt;/EM&gt; digits, but for all kinds of digits. A consequence is
12751 that code like the following will &lt;h3&gt;not&lt;/h3&gt; work unconditionally for
12752 wide characters:
12753 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
12754 n = 0;&lt;br&gt;
12755 while (iswdigit (*wc))&lt;br&gt;
12756 {&lt;br&gt;
12757 n *= 10;&lt;br&gt;
12758 n += *wc++ - L'0';&lt;br&gt;
12759 }&lt;br&gt;
12760 &lt;/pre&gt;&lt;br&gt;
12761 &lt;br&gt;&lt;br&gt; &lt;br&gt;
12762 This function can be implemented using&lt;br&gt;
12763 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
12764 iswctype (wc, wctype ("digit"))&lt;br&gt;
12765 &lt;/pre&gt;
12766 &lt;br&gt;&lt;br&gt; It is declared in &lt;TT&gt;wctype.h&lt;/TT&gt;.
12767 </synopsis>
12768 </function>
12769 </construct>
12770 <construct id="function-iswgraph" type="function">
12771 <function returntype="int">
12772 <prototype>
12773 <parameter content="wint_t wc"/>
12774 </prototype>
12775 <headers>
12776 <header filename = "wctype.h"/>
12777 </headers>
12778 <synopsis>
12779 Returns true if &lt;VAR&gt;wc&lt;/VAR&gt; is a graphic character; that is, a character
12780 that has a glyph associated with it. The whitespace characters are not
12781 considered graphic.
12782 &lt;br&gt;&lt;br&gt;
12783 This function can be implemented using
12784 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
12785 iswctype (wc, wctype ("graph"))&lt;br&gt;
12786 &lt;/pre&gt;
12787 &lt;br&gt;&lt;br&gt; It is declared in &lt;TT&gt;wctype.h&lt;/TT&gt;.
12788 </synopsis>
12789 </function>
12790 </construct>
12791 <construct id="function-iswlower" type="function">
12792 <function returntype="int">
12793 <prototype>
12794 <parameter content="wint_t wc"/>
12795 </prototype>
12796 <headers>
12797 <header filename = "ctype.h"/>
12798 </headers>
12799 <synopsis>
12800 Returns true if &lt;VAR&gt;wc&lt;/VAR&gt; is a lower-case letter. The letter need not be
12801 from the Latin alphabet, any alphabet representable is valid.
12802 &lt;br&gt;&lt;br&gt;
12803 This function can be implemented using
12804 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
12805 iswctype (wc, wctype ("lower"))&lt;br&gt;
12806 &lt;/pre&gt;
12807 &lt;br&gt;&lt;br&gt; It is declared in &lt;TT&gt;wctype.h&lt;/TT&gt;.
12808 </synopsis>
12809 </function>
12810 </construct>
12811 <construct id="function-iswprint" type="function">
12812 <function returntype="int">
12813 <prototype>
12814 <parameter content="wint_t wc"/>
12815 </prototype>
12816 <headers>
12817 <header filename = "wctype.h"/>
12818 </headers>
12819 <synopsis>
12820 Returns true if &lt;VAR&gt;wc&lt;/VAR&gt; is a printing character. Printing characters
12821 include all the graphic characters, plus the space (&lt;samp&gt; &lt;/samp&gt;) character.
12822 &lt;br&gt;&lt;br&gt;
12823 This function can be implemented using
12824 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
12825 iswctype (wc, wctype ("print"))&lt;br&gt;
12826 &lt;/pre&gt;
12827 &lt;br&gt;&lt;br&gt; It is declared in &lt;TT&gt;wctype.h&lt;/TT&gt;.
12828 </synopsis>
12829 </function>
12830 </construct>
12831 <construct id="function-iswpunct" type="function">
12832 <function returntype="int">
12833 <prototype>
12834 <parameter content="wint_t wc"/>
12835 </prototype>
12836 <headers>
12837 <header filename = "wctype.h"/>
12838 </headers>
12839 <synopsis>
12840 Returns true if &lt;VAR&gt;wc&lt;/VAR&gt; is a punctuation character.
12841 This means any printing character that is not alphanumeric or a space
12842 character.
12843 &lt;br&gt;&lt;br&gt;
12844 This function can be implemented using
12845 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
12846 iswctype (wc, wctype ("punct"))&lt;br&gt;
12847 &lt;/pre&gt;
12848 &lt;br&gt;&lt;br&gt; It is declared in &lt;TT&gt;wctype.h&lt;/TT&gt;.
12849 </synopsis>
12850 </function>
12851 </construct>
12852 <construct id="function-iswspace" type="function">
12853 <function returntype="int">
12854 <prototype>
12855 <parameter content="wint_t wc"/>
12856 </prototype>
12857 <headers>
12858 <header filename = "wctype.h"/>
12859 </headers>
12860 <synopsis>
12861 Returns true if &lt;VAR&gt;wc&lt;/VAR&gt; is a whitespace character. In the standard
12862 &lt;CODE&gt;"C"&lt;/CODE&gt; locale, &lt;CODE&gt;iswspace&lt;/CODE&gt; returns true for only the standard
12863 whitespace characters:
12864 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
12865
12866 &lt;DT&gt;&lt;CODE&gt;L' '&lt;/CODE&gt;
12867 &lt;DD&gt;
12868 space
12869 &lt;br&gt;&lt;br&gt; &lt;LI&gt; L'\f'
12870 formfeed
12871 &lt;br&gt;&lt;br&gt; &lt;LI&gt; L'\n'
12872 newline
12873 &lt;br&gt;&lt;br&gt; &lt;LI&gt; L'\r'
12874 carriage return
12875 &lt;br&gt;&lt;br&gt; &lt;LI&gt; L'\t'
12876 horizontal tab
12877 &lt;br&gt;&lt;br&gt; &lt;LI&gt; L'\v'
12878 vertical tab
12879
12880 &lt;br&gt;&lt;br&gt;
12881 This function can be implemented using
12882 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
12883 iswctype (wc, wctype ("space"))&lt;br&gt;
12884 &lt;/pre&gt;
12885 &lt;br&gt;&lt;br&gt; It is declared in &lt;TT&gt;wctype.h&lt;/TT&gt;.
12886 </synopsis>
12887 </function>
12888 </construct>
12889 <construct id="function-iswupper" type="function">
12890 <function returntype="int">
12891 <prototype>
12892 <parameter content="wint_t wc"/>
12893 </prototype>
12894 <headers>
12895 <header filename = "wctype.h"/>
12896 </headers>
12897 <synopsis>
12898 Returns true if &lt;VAR&gt;wc&lt;/VAR&gt; is an upper-case letter. The letter need not be
12899 from the Latin alphabet, any alphabet representable is valid.
12900 &lt;br&gt;&lt;br&gt;
12901 This function can be implemented using
12902 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
12903 iswctype (wc, wctype ("upper"))&lt;br&gt;
12904 &lt;/pre&gt;
12905 &lt;br&gt;&lt;br&gt; It is declared in &lt;TT&gt;wctype.h&lt;/TT&gt;.
12906 </synopsis>
12907 </function>
12908 </construct>
12909 <construct id="function-iswxdigit" type="function">
12910 <function returntype="int">
12911 <prototype>
12912 <parameter content="wint_t wc"/>
12913 </prototype>
12914 <headers>
12915 <header filename = "wctype.h"/>
12916 </headers>
12917 <synopsis>
12918 Returns true if &lt;VAR&gt;wc&lt;/VAR&gt; is a hexadecimal digit.
12919 Hexadecimal digits include the normal decimal digits &lt;samp&gt;0&lt;/samp&gt; through
12920 &lt;samp&gt;9&lt;/samp&gt; and the letters &lt;samp&gt;A&lt;/samp&gt; through &lt;samp&gt;F&lt;/samp&gt; and
12921 &lt;samp&gt;a&lt;/samp&gt; through &lt;samp&gt;f&lt;/samp&gt;.
12922 &lt;br&gt;&lt;br&gt;
12923 This function can be implemented using
12924 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
12925 iswctype (wc, wctype ("xdigit"))&lt;br&gt;
12926 &lt;/pre&gt;
12927 &lt;br&gt;&lt;br&gt; It is declared in &lt;TT&gt;wctype.h&lt;/TT&gt;.
12928 </synopsis>
12929 </function>
12930 </construct>
12931 <construct id="function-iswblank" type="function">
12932 <function returntype="int">
12933 <prototype>
12934 <parameter content="wint_t wc"/>
12935 </prototype>
12936 <headers>
12937 <header filename = "wctype.h"/>
12938 </headers>
12939 <synopsis>
12940 Returns true if &lt;VAR&gt;wc&lt;/VAR&gt; is a blank character; that is, a space or a tab.
12941 This function was originally a GNU extension, but was added in ISO C99.
12942 It is declared in &lt;TT&gt;wchar.h&lt;/TT&gt;.
12943 </synopsis>
12944 </function>
12945 </construct>
12946 <construct id="dtype-wctrans_t" type="dtype">
12947 <structure>
12948 </structure>
12949 </construct>
12950 <construct id="function-wctrans" type="function">
12951 <function returntype="wctrans_t">
12952 <prototype>
12953 <parameter content="const char *property"/>
12954 </prototype>
12955 <headers>
12956 <header filename = "wctype.h"/>
12957 </headers>
12958 <synopsis>
12959 The &lt;CODE&gt;wctrans&lt;/CODE&gt; function has to be used to find out whether a named
12960 mapping is defined in the current locale selected for the
12961 &lt;CODE&gt;LC_CTYPE&lt;/CODE&gt; category. If the returned value is non-zero, you can use
12962 it afterwards in calls to &lt;CODE&gt;towctrans&lt;/CODE&gt;. If the return value is
12963 zero no such mapping is known in the current locale.
12964 &lt;br&gt;&lt;br&gt; Beside locale-specific mappings there are two mappings which are
12965 guaranteed to be available in every locale:
12966 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;&lt;/pre&gt;
12967 &lt;DD&gt;&lt;br&gt;
12968 &lt;br&gt;&lt;br&gt;
12969 These functions are declared in &lt;TT&gt;wctype.h&lt;/TT&gt;.
12970 </synopsis>
12971 </function>
12972 </construct>
12973 <construct id="function-towctrans" type="function">
12974 <function returntype="wint_t">
12975 <prototype>
12976 <parameter content="wint_t wc"/>
12977 <parameter content="wctrans_t desc"/>
12978 </prototype>
12979 <headers>
12980 <header filename = "wctype.h"/>
12981 </headers>
12982 <synopsis>
12983 &lt;CODE&gt;towctrans&lt;/CODE&gt; maps the input character &lt;VAR&gt;wc&lt;/VAR&gt;
12984 according to the rules of the mapping for which &lt;VAR&gt;desc&lt;/VAR&gt; is a
12985 descriptor, and returns the value it finds. &lt;VAR&gt;desc&lt;/VAR&gt; must be
12986 obtained by a successful call to &lt;CODE&gt;wctrans&lt;/CODE&gt;.
12987 &lt;br&gt;&lt;br&gt;
12988 This function is declared in &lt;TT&gt;wctype.h&lt;/TT&gt;.
12989 </synopsis>
12990 </function>
12991 </construct>
12992 <construct id="function-towlower" type="function">
12993 <function returntype="wint_t">
12994 <prototype>
12995 <parameter content="wint_t wc"/>
12996 </prototype>
12997 <headers>
12998 <header filename = "wctype.h"/>
12999 </headers>
13000 <synopsis>
13001 If &lt;VAR&gt;wc&lt;/VAR&gt; is an upper-case letter, &lt;CODE&gt;towlower&lt;/CODE&gt; returns the corresponding
13002 lower-case letter. If &lt;VAR&gt;wc&lt;/VAR&gt; is not an upper-case letter,
13003 &lt;VAR&gt;wc&lt;/VAR&gt; is returned unchanged.
13004 &lt;br&gt;&lt;br&gt;
13005 &lt;CODE&gt;towlower&lt;/CODE&gt; can be implemented using
13006 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
13007 towctrans (wc, wctrans ("tolower"))&lt;br&gt;
13008 &lt;/pre&gt;
13009 &lt;br&gt;&lt;br&gt;
13010 This function is declared in &lt;TT&gt;wctype.h&lt;/TT&gt;.
13011 </synopsis>
13012 </function>
13013 </construct>
13014 <construct id="function-towupper" type="function">
13015 <function returntype="wint_t">
13016 <prototype>
13017 <parameter content="wint_t wc"/>
13018 </prototype>
13019 <headers>
13020 <header filename = "wctype.h"/>
13021 </headers>
13022 <synopsis>
13023 If &lt;VAR&gt;wc&lt;/VAR&gt; is a lower-case letter, &lt;CODE&gt;towupper&lt;/CODE&gt; returns the corresponding
13024 upper-case letter. Otherwise &lt;VAR&gt;wc&lt;/VAR&gt; is returned unchanged.
13025 &lt;br&gt;&lt;br&gt;
13026 &lt;CODE&gt;towupper&lt;/CODE&gt; can be implemented using
13027 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
13028 towctrans (wc, wctrans ("toupper"))&lt;br&gt;
13029 &lt;/pre&gt;
13030 &lt;br&gt;&lt;br&gt;
13031 This function is declared in &lt;TT&gt;wctype.h&lt;/TT&gt;.
13032 </synopsis>
13033 </function>
13034 </construct>
13035 <construct id="function-catopen" type="function">
13036 <function returntype="nl_catd">
13037 <prototype>
13038 <parameter content="const char *cat_name"/>
13039 <parameter content="int flag"/>
13040 </prototype>
13041 <headers>
13042 <header filename = "nl_types.h"/>
13043 </headers>
13044 <synopsis>
13045 The &lt;CODE&gt;catgets&lt;/CODE&gt; function tries to locate the message data file names
13046 &lt;VAR&gt;cat_name&lt;/VAR&gt; and loads it when found. The return value is of an
13047 opaque type and can be used in calls to the other functions to refer to
13048 this loaded catalog.
13049 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;(nl_catd) -1&lt;/CODE&gt; in case the function failed and
13050 no catalog was loaded. The global variable &lt;VAR&gt;errno&lt;/VAR&gt; contains a code
13051 for the error causing the failure. But even if the function call
13052 succeeded this does not mean that all messages can be translated.
13053 &lt;br&gt;&lt;br&gt; Locating the catalog file must happen in a way which lets the user of
13054 the program influence the decision. It is up to the user to decide
13055 about the language to use and sometimes it is useful to use alternate
13056 catalog files. All this can be specified by the user by setting some
13057 environment variables.
13058 &lt;br&gt;&lt;br&gt; The first problem is to find out where all the message catalogs are
13059 stored. Every program could have its own place to keep all the
13060 different files but usually the catalog files are grouped by languages
13061 and the catalogs for all programs are kept in the same place.
13062 &lt;br&gt;&lt;br&gt; environment variable
13063 To tell the &lt;CODE&gt;catopen&lt;/CODE&gt; function where the catalog for the program
13064 can be found the user can set the environment variable &lt;CODE&gt;NLSPATH&lt;/CODE&gt; to
13065 a value which describes her/his choice. Since this value must be usable
13066 for different languages and locales it cannot be a simple string.
13067 Instead it is a format string (similar to &lt;CODE&gt;printf&lt;/CODE&gt;'s). An example
13068 is
13069 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
13070 /usr/share/locale/%L/%N:/usr/share/locale/%L/LC_MESSAGES/%N&lt;br&gt;
13071 &lt;/pre&gt;&lt;br&gt;
13072 &lt;br&gt;&lt;br&gt; First one can see that more than one directory can be specified (with&lt;br&gt;
13073 the usual syntax of separating them by colons). The next things to&lt;br&gt;
13074 observe are the format string, &lt;CODE&gt;%L&lt;/CODE&gt; and &lt;CODE&gt;%N&lt;/CODE&gt; in this case.&lt;br&gt;
13075 The &lt;CODE&gt;catopen&lt;/CODE&gt; function knows about several of them and the&lt;br&gt;
13076 replacement for all of them is of course different.&lt;br&gt;
13077 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
13078 &lt;br&gt;
13079 &lt;DT&gt;&lt;CODE&gt;%N&lt;br&gt;&lt;/CODE&gt;
13080 &lt;DD&gt;
13081 This format element is substituted with the name of the catalog file.&lt;br&gt;
13082 This is the value of the &lt;VAR&gt;cat_name&lt;/VAR&gt; argument given to&lt;br&gt;
13083 &lt;CODE&gt;catgets&lt;/CODE&gt;.&lt;br&gt;
13084 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;%L&lt;br&gt;&lt;/CODE&gt;
13085 &lt;DD&gt;
13086 This format element is substituted with the name of the currently&lt;br&gt;
13087 selected locale for translating messages. How this is determined is&lt;br&gt;
13088 explained below.&lt;br&gt;
13089 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %l&lt;br&gt;
13090 (This is the lowercase ell.) This format element is substituted with the&lt;br&gt;
13091 language element of the locale name. The string describing the selected&lt;br&gt;
13092 locale is expected to have the form&lt;br&gt;
13093 &lt;CODE&gt;&lt;VAR&gt;lang&lt;/VAR&gt;[_&lt;VAR&gt;terr&lt;/VAR&gt;[.&lt;VAR&gt;codeset&lt;/VAR&gt;]]&lt;/CODE&gt; and this format uses the&lt;br&gt;
13094 first part &lt;VAR&gt;lang&lt;/VAR&gt;.&lt;br&gt;
13095 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %t&lt;br&gt;
13096 This format element is substituted by the territory part &lt;VAR&gt;terr&lt;/VAR&gt; of&lt;br&gt;
13097 the name of the currently selected locale. See the explanation of the&lt;br&gt;
13098 format above.&lt;br&gt;
13099 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %c&lt;br&gt;
13100 This format element is substituted by the codeset part &lt;VAR&gt;codeset&lt;/VAR&gt; of&lt;br&gt;
13101 the name of the currently selected locale. See the explanation of the&lt;br&gt;
13102 format above.&lt;br&gt;
13103 &lt;br&gt;&lt;br&gt; &lt;LI&gt; %%&lt;br&gt;
13104 Since &lt;CODE&gt;%&lt;/CODE&gt; is used in a meta character there must be a way to&lt;br&gt;
13105 express the &lt;CODE&gt;%&lt;/CODE&gt; character in the result itself. Using &lt;CODE&gt;%%&lt;/CODE&gt;&lt;br&gt;
13106 does this just like it works for &lt;CODE&gt;printf&lt;/CODE&gt;.&lt;br&gt;
13107 &lt;br&gt;
13108 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt; Using &lt;CODE&gt;NLSPATH&lt;/CODE&gt; allows arbitrary directories to be searched for&lt;br&gt;
13109 message catalogs while still allowing different languages to be used.&lt;br&gt;
13110 If the &lt;CODE&gt;NLSPATH&lt;/CODE&gt; environment variable is not set, the default value&lt;br&gt;
13111 is&lt;br&gt;
13112 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
13113 &lt;VAR&gt;prefix&lt;/VAR&gt;/share/locale/%L/%N:&lt;VAR&gt;prefix&lt;/VAR&gt;/share/locale/%L/LC_MESSAGES/%N&lt;br&gt;
13114 &lt;/pre&gt;&lt;br&gt;
13115 &lt;br&gt;&lt;br&gt; &lt;br&gt;
13116 where &lt;VAR&gt;prefix&lt;/VAR&gt; is given to &lt;CODE&gt;configure&lt;/CODE&gt; while installing the GNU&lt;br&gt;
13117 C Library (this value is in many cases &lt;CODE&gt;/usr&lt;/CODE&gt; or the empty string).&lt;br&gt;
13118 &lt;br&gt;&lt;br&gt; The remaining problem is to decide which must be used. The value&lt;br&gt;
13119 decides about the substitution of the format elements mentioned above.&lt;br&gt;
13120 First of all the user can specify a path in the message catalog name&lt;br&gt;
13121 (i.e., the name contains a slash character). In this situation the&lt;br&gt;
13122 &lt;CODE&gt;NLSPATH&lt;/CODE&gt; environment variable is not used. The catalog must exist&lt;br&gt;
13123 as specified in the program, perhaps relative to the current working&lt;br&gt;
13124 directory. This situation in not desirable and catalogs names never&lt;br&gt;
13125 should be written this way. Beside this, this behavior is not portable&lt;br&gt;
13126 to all other platforms providing the &lt;CODE&gt;catgets&lt;/CODE&gt; interface.&lt;br&gt;
13127 &lt;br&gt;&lt;br&gt; environment variable&lt;br&gt;
13128 environment variable&lt;br&gt;
13129 environment variable&lt;br&gt;
13130 Otherwise the values of environment variables from the standard&lt;br&gt;
13131 environment are examined. Which&lt;br&gt;
13132 variables are examined is decided by the &lt;VAR&gt;flag&lt;/VAR&gt; parameter of&lt;br&gt;
13133 &lt;CODE&gt;catopen&lt;/CODE&gt;. If the value is &lt;CODE&gt;NL_CAT_LOCALE&lt;/CODE&gt; (which is defined&lt;br&gt;
13134 in &lt;TT&gt;nl_types.h&lt;/TT&gt;) then the &lt;CODE&gt;catopen&lt;/CODE&gt; function use the name of&lt;br&gt;
13135 the locale currently selected for the &lt;CODE&gt;LC_MESSAGES&lt;/CODE&gt; category.&lt;br&gt;
13136 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;flag&lt;/VAR&gt; is zero the &lt;CODE&gt;LANG&lt;/CODE&gt; environment variable is examined.&lt;br&gt;
13137 This is a left-over from the early days where the concept of the locales&lt;br&gt;
13138 had not even reached the level of POSIX locales.&lt;br&gt;
13139 &lt;br&gt;&lt;br&gt; The environment variable and the locale name should have a value of the&lt;br&gt;
13140 form &lt;CODE&gt;&lt;VAR&gt;lang&lt;/VAR&gt;[_&lt;VAR&gt;terr&lt;/VAR&gt;[.&lt;VAR&gt;codeset&lt;/VAR&gt;]]&lt;/CODE&gt; as explained above.&lt;br&gt;
13141 If no environment variable is set the &lt;CODE&gt;"C"&lt;/CODE&gt; locale is used which&lt;br&gt;
13142 prevents any translation.&lt;br&gt;
13143 &lt;br&gt;&lt;br&gt; The return value of the function is in any case a valid string. Either&lt;br&gt;
13144 it is a translation from a message catalog or it is the same as the&lt;br&gt;
13145 &lt;VAR&gt;string&lt;/VAR&gt; parameter. So a piece of code to decide whether a&lt;br&gt;
13146 translation actually happened must look like this:&lt;br&gt;
13147 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
13148 {&lt;br&gt;
13149 char *trans = catgets (desc, set, msg, input_string);&lt;br&gt;
13150 if (trans == input_string)&lt;br&gt;
13151 {&lt;br&gt;
13152 /* Something went wrong. */&lt;br&gt;
13153 }&lt;br&gt;
13154 }&lt;br&gt;
13155 &lt;/pre&gt;
13156 &lt;br&gt;&lt;br&gt;
13157 When an error occurred the global variable &lt;VAR&gt;errno&lt;/VAR&gt; is set to
13158 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
13159
13160 &lt;LI&gt; EBADF
13161 The catalog does not exist.
13162 &lt;LI&gt; ENOMSG
13163 The set/message tuple does not name an existing element in the
13164 message catalog.
13165
13166 &lt;br&gt;&lt;br&gt; While it sometimes can be useful to test for errors programs normally
13167 will avoid any test. If the translation is not available it is no big
13168 problem if the original, untranslated message is printed. Either the
13169 user understands this as well or s/he will look for the reason why the
13170 messages are not translated.
13171 </synopsis>
13172 </function>
13173 </construct>
13174 <construct id="function-catgets" type="function">
13175 <function returntype="char *">
13176 <prototype>
13177 <parameter content="nl_catd catalog_desc"/>
13178 <parameter content="int set"/>
13179 <parameter content="int message"/>
13180 <parameter content="const char *string"/>
13181 </prototype>
13182 <synopsis>
13183 The function &lt;CODE&gt;catgets&lt;/CODE&gt; has to be used to access the massage catalog
13184 previously opened using the &lt;CODE&gt;catopen&lt;/CODE&gt; function. The
13185 &lt;VAR&gt;catalog_desc&lt;/VAR&gt; parameter must be a value previously returned by
13186 &lt;CODE&gt;catopen&lt;/CODE&gt;.
13187 &lt;br&gt;&lt;br&gt; The next two parameters, &lt;VAR&gt;set&lt;/VAR&gt; and &lt;VAR&gt;message&lt;/VAR&gt;, reflect the
13188 internal organization of the message catalog files. This will be
13189 explained in detail below. For now it is interesting to know that a
13190 catalog can consists of several set and the messages in each thread are
13191 individually numbered using numbers. Neither the set number nor the
13192 message number must be consecutive. They can be arbitrarily chosen.
13193 But each message (unless equal to another one) must have its own unique
13194 pair of set and message number.
13195 &lt;br&gt;&lt;br&gt; Since it is not guaranteed that the message catalog for the language
13196 selected by the user exists the last parameter &lt;VAR&gt;string&lt;/VAR&gt; helps to
13197 handle this case gracefully. If no matching string can be found
13198 &lt;VAR&gt;string&lt;/VAR&gt; is returned. This means for the programmer that
13199 &lt;br&gt;&lt;br&gt; &lt;OL&gt;
13200 &lt;LI&gt;
13201 the &lt;VAR&gt;string&lt;/VAR&gt; parameters should contain reasonable text (this also
13202 helps to understand the program seems otherwise there would be no hint
13203 on the string which is expected to be returned.
13204 &lt;LI&gt;
13205 all &lt;VAR&gt;string&lt;/VAR&gt; arguments should be written in the same language.
13206 &lt;/OL&gt;
13207 </synopsis>
13208 </function>
13209 </construct>
13210 <construct id="function-catclose" type="function">
13211 <function returntype="int">
13212 <prototype>
13213 <parameter content="nl_catd catalog_desc"/>
13214 </prototype>
13215 <synopsis>
13216 The &lt;CODE&gt;catclose&lt;/CODE&gt; function can be used to free the resources
13217 associated with a message catalog which previously was opened by a call
13218 to &lt;CODE&gt;catopen&lt;/CODE&gt;. If the resources can be successfully freed the
13219 function returns &lt;CODE&gt;0&lt;/CODE&gt;. Otherwise it return &lt;CODE&gt;&lt;/CODE&gt;1 and the
13220 global variable &lt;VAR&gt;errno&lt;/VAR&gt; is set. Errors can occur if the catalog
13221 descriptor &lt;VAR&gt;catalog_desc&lt;/VAR&gt; is not valid in which case &lt;VAR&gt;errno&lt;/VAR&gt; is
13222 set to &lt;CODE&gt;EBADF&lt;/CODE&gt;.
13223 </synopsis>
13224 </function>
13225 </construct>
13226 <construct id="function-gettext" type="function">
13227 <function returntype="char *">
13228 <prototype>
13229 <parameter content="const char *msgid"/>
13230 </prototype>
13231 <headers>
13232 <header filename = "libintl.h"/>
13233 </headers>
13234 <synopsis>
13235 The &lt;CODE&gt;gettext&lt;/CODE&gt; function searches the currently selected message
13236 catalogs for a string which is equal to &lt;VAR&gt;msgid&lt;/VAR&gt;. If there is such a
13237 string available it is returned. Otherwise the argument string
13238 &lt;VAR&gt;msgid&lt;/VAR&gt; is returned.
13239 &lt;br&gt;&lt;br&gt; Please note that all though the return value is &lt;CODE&gt;char *&lt;/CODE&gt; the
13240 returned string must not be changed. This broken type results from the
13241 history of the function and does not reflect the way the function should
13242 be used.
13243 &lt;br&gt;&lt;br&gt; Please note that above we wrote ``message catalogs'' (plural). This is
13244 a specialty of the GNU implementation of these functions and we will
13245 say more about this when we talk about the ways message catalogs are
13246 selected .
13247 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;gettext&lt;/CODE&gt; function does not modify the value of the global
13248 &lt;VAR&gt;errno&lt;/VAR&gt; variable. This is necessary to make it possible to write
13249 something like
13250 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
13251 printf (gettext ("Operation failed: %m\n"));&lt;br&gt;
13252 &lt;/pre&gt;
13253 &lt;br&gt;&lt;br&gt; Here the &lt;VAR&gt;errno&lt;/VAR&gt; value is used in the &lt;CODE&gt;printf&lt;/CODE&gt; function while
13254 processing the &lt;CODE&gt;%m&lt;/CODE&gt; format element and if the &lt;CODE&gt;gettext&lt;/CODE&gt;
13255 function would change this value (it is called before &lt;CODE&gt;printf&lt;/CODE&gt; is
13256 called) we would get a wrong message.
13257 &lt;br&gt;&lt;br&gt; So there is no easy way to detect a missing message catalog beside
13258 comparing the argument string with the result. But it is normally the
13259 task of the user to react on missing catalogs. The program cannot guess
13260 when a message catalog is really necessary since for a user who speaks
13261 the language the program was developed in does not need any translation.
13262 </synopsis>
13263 </function>
13264 </construct>
13265 <construct id="function-dgettext" type="function">
13266 <function returntype="char *">
13267 <prototype>
13268 <parameter content="const char *domainname"/>
13269 <parameter content="const char *msgid"/>
13270 </prototype>
13271 <headers>
13272 <header filename = "libintl.h"/>
13273 </headers>
13274 <synopsis>
13275 The &lt;CODE&gt;dgettext&lt;/CODE&gt; functions acts just like the &lt;CODE&gt;gettext&lt;/CODE&gt;
13276 function. It only takes an additional first argument &lt;VAR&gt;domainname&lt;/VAR&gt;
13277 which guides the selection of the message catalogs which are searched
13278 for the translation. If the &lt;VAR&gt;domainname&lt;/VAR&gt; parameter is the null
13279 pointer the &lt;CODE&gt;dgettext&lt;/CODE&gt; function is exactly equivalent to
13280 &lt;CODE&gt;gettext&lt;/CODE&gt; since the default value for the domain name is used.
13281 &lt;br&gt;&lt;br&gt; As for &lt;CODE&gt;gettext&lt;/CODE&gt; the return value type is &lt;CODE&gt;char *&lt;/CODE&gt; which is an
13282 anachronism. The returned string must never be modified.
13283 </synopsis>
13284 </function>
13285 </construct>
13286 <construct id="function-dcgettext" type="function">
13287 <function returntype="char *">
13288 <prototype>
13289 <parameter content="const char *domainname"/>
13290 <parameter content="const char *msgid"/>
13291 <parameter content="int category"/>
13292 </prototype>
13293 <headers>
13294 <header filename = "libintl.h"/>
13295 </headers>
13296 <synopsis>
13297 The &lt;CODE&gt;dcgettext&lt;/CODE&gt; adds another argument to those which
13298 &lt;CODE&gt;dgettext&lt;/CODE&gt; takes. This argument &lt;VAR&gt;category&lt;/VAR&gt; specifies the last
13299 piece of information needed to localize the message catalog. I.e., the
13300 domain name and the locale category exactly specify which message
13301 catalog has to be used (relative to a given directory, see below).
13302 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;dgettext&lt;/CODE&gt; function can be expressed in terms of
13303 &lt;CODE&gt;dcgettext&lt;/CODE&gt; by using
13304 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
13305 dcgettext (domain, string, LC_MESSAGES)&lt;br&gt;
13306 &lt;/pre&gt;&lt;br&gt;
13307 &lt;br&gt;&lt;br&gt; &lt;br&gt;
13308 instead of&lt;br&gt;
13309 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
13310 dgettext (domain, string)&lt;br&gt;
13311 &lt;/pre&gt;
13312 &lt;br&gt;&lt;br&gt; This also shows which values are expected for the third parameter. One
13313 has to use the available selectors for the categories available in
13314 &lt;TT&gt;locale.h&lt;/TT&gt;. Normally the available values are &lt;CODE&gt;LC_CTYPE&lt;/CODE&gt;,
13315 &lt;CODE&gt;LC_COLLATE&lt;/CODE&gt;, &lt;CODE&gt;LC_MESSAGES&lt;/CODE&gt;, &lt;CODE&gt;LC_MONETARY&lt;/CODE&gt;,
13316 &lt;CODE&gt;LC_NUMERIC&lt;/CODE&gt;, and &lt;CODE&gt;LC_TIME&lt;/CODE&gt;. Please note that &lt;CODE&gt;LC_ALL&lt;/CODE&gt;
13317 must not be used and even though the names might suggest this, there is
13318 no relation to the environments variables of this name.
13319 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;dcgettext&lt;/CODE&gt; function is only implemented for compatibility with
13320 other systems which have &lt;CODE&gt;gettext&lt;/CODE&gt; functions. There is not really
13321 any situation where it is necessary (or useful) to use a different value
13322 but &lt;CODE&gt;LC_MESSAGES&lt;/CODE&gt; in for the &lt;VAR&gt;category&lt;/VAR&gt; parameter. We are
13323 dealing with messages here and any other choice can only be irritating.
13324 &lt;br&gt;&lt;br&gt; As for &lt;CODE&gt;gettext&lt;/CODE&gt; the return value type is &lt;CODE&gt;char *&lt;/CODE&gt; which is an
13325 anachronism. The returned string must never be modified.
13326 </synopsis>
13327 </function>
13328 </construct>
13329 <construct id="function-textdomain" type="function">
13330 <function returntype="char *">
13331 <prototype>
13332 <parameter content="const char *domainname"/>
13333 </prototype>
13334 <headers>
13335 <header filename = "libintl.h"/>
13336 </headers>
13337 <synopsis>
13338 The &lt;CODE&gt;textdomain&lt;/CODE&gt; function sets the default domain, which is used in
13339 all future &lt;CODE&gt;gettext&lt;/CODE&gt; calls, to &lt;VAR&gt;domainname&lt;/VAR&gt;. Please note that
13340 &lt;CODE&gt;dgettext&lt;/CODE&gt; and &lt;CODE&gt;dcgettext&lt;/CODE&gt; calls are not influenced if the
13341 &lt;VAR&gt;domainname&lt;/VAR&gt; parameter of these functions is not the null pointer.
13342 &lt;br&gt;&lt;br&gt; Before the first call to &lt;CODE&gt;textdomain&lt;/CODE&gt; the default domain is
13343 &lt;CODE&gt;messages&lt;/CODE&gt;. This is the name specified in the specification of
13344 the &lt;CODE&gt;gettext&lt;/CODE&gt; API. This name is as good as any other name. No
13345 program should ever really use a domain with this name since this can
13346 only lead to problems.
13347 &lt;br&gt;&lt;br&gt; The function returns the value which is from now on taken as the default
13348 domain. If the system went out of memory the returned value is
13349 &lt;CODE&gt;NULL&lt;/CODE&gt; and the global variable &lt;VAR&gt;errno&lt;/VAR&gt; is set to &lt;CODE&gt;ENOMEM&lt;/CODE&gt;.
13350 Despite the return value type being &lt;CODE&gt;char *&lt;/CODE&gt; the return string must
13351 not be changed. It is allocated internally by the &lt;CODE&gt;textdomain&lt;/CODE&gt;
13352 function.
13353 &lt;br&gt;&lt;br&gt; If the &lt;VAR&gt;domainname&lt;/VAR&gt; parameter is the null pointer no new default
13354 domain is set. Instead the currently selected default domain is
13355 returned.
13356 &lt;br&gt;&lt;br&gt; If the &lt;VAR&gt;domainname&lt;/VAR&gt; parameter is the empty string the default domain
13357 is reset to its initial value, the domain with the name &lt;CODE&gt;messages&lt;/CODE&gt;.
13358 This possibility is questionable to use since the domain &lt;CODE&gt;messages&lt;/CODE&gt;
13359 really never should be used.
13360 </synopsis>
13361 </function>
13362 </construct>
13363 <construct id="function-bindtextdomain" type="function">
13364 <function returntype="char *">
13365 <prototype>
13366 <parameter content="const char *domainname"/>
13367 <parameter content="const char *dirname"/>
13368 </prototype>
13369 <headers>
13370 <header filename = "libintl.h"/>
13371 </headers>
13372 <synopsis>
13373 The &lt;CODE&gt;bindtextdomain&lt;/CODE&gt; function can be used to specify the directory
13374 which contains the message catalogs for domain &lt;VAR&gt;domainname&lt;/VAR&gt; for the
13375 different languages. To be correct, this is the directory where the
13376 hierarchy of directories is expected. Details are explained below.
13377 &lt;br&gt;&lt;br&gt; For the programmer it is important to note that the translations which
13378 come with the program have be placed in a directory hierarchy starting
13379 at, say, &lt;TT&gt;/foo/bar&lt;/TT&gt;. Then the program should make a
13380 &lt;CODE&gt;bindtextdomain&lt;/CODE&gt; call to bind the domain for the current program to
13381 this directory. So it is made sure the catalogs are found. A correctly
13382 running program does not depend on the user setting an environment
13383 variable.
13384 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;bindtextdomain&lt;/CODE&gt; function can be used several times and if the
13385 &lt;VAR&gt;domainname&lt;/VAR&gt; argument is different the previously bound domains
13386 will not be overwritten.
13387 &lt;br&gt;&lt;br&gt; If the program which wish to use &lt;CODE&gt;bindtextdomain&lt;/CODE&gt; at some point of
13388 time use the &lt;CODE&gt;chdir&lt;/CODE&gt; function to change the current working
13389 directory it is important that the &lt;VAR&gt;dirname&lt;/VAR&gt; strings ought to be an
13390 absolute pathname. Otherwise the addressed directory might vary with
13391 the time.
13392 &lt;br&gt;&lt;br&gt; If the &lt;VAR&gt;dirname&lt;/VAR&gt; parameter is the null pointer &lt;CODE&gt;bindtextdomain&lt;/CODE&gt;
13393 returns the currently selected directory for the domain with the name
13394 &lt;VAR&gt;domainname&lt;/VAR&gt;.
13395 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;bindtextdomain&lt;/CODE&gt; function returns a pointer to a string
13396 containing the name of the selected directory name. The string is
13397 allocated internally in the function and must not be changed by the
13398 user. If the system went out of core during the execution of
13399 &lt;CODE&gt;bindtextdomain&lt;/CODE&gt; the return value is &lt;CODE&gt;NULL&lt;/CODE&gt; and the global
13400 variable &lt;VAR&gt;errno&lt;/VAR&gt; is set accordingly.
13401 </synopsis>
13402 </function>
13403 </construct>
13404 <construct id="function-ngettext" type="function">
13405 <function returntype="char *">
13406 <prototype>
13407 <parameter content="const char *msgid1"/>
13408 <parameter content="const char *msgid2"/>
13409 <parameter content="unsigned long int n"/>
13410 </prototype>
13411 <headers>
13412 <header filename = "libintl.h"/>
13413 </headers>
13414 <synopsis>
13415 The &lt;CODE&gt;ngettext&lt;/CODE&gt; function is similar to the &lt;CODE&gt;gettext&lt;/CODE&gt; function
13416 as it finds the message catalogs in the same way. But it takes two
13417 extra arguments. The &lt;VAR&gt;msgid1&lt;/VAR&gt; parameter must contain the singular
13418 form of the string to be converted. It is also used as the key for the
13419 search in the catalog. The &lt;VAR&gt;msgid2&lt;/VAR&gt; parameter is the plural form.
13420 The parameter &lt;VAR&gt;n&lt;/VAR&gt; is used to determine the plural form. If no
13421 message catalog is found &lt;VAR&gt;msgid1&lt;/VAR&gt; is returned if &lt;CODE&gt;n == 1&lt;/CODE&gt;,
13422 otherwise &lt;CODE&gt;msgid2&lt;/CODE&gt;.
13423 &lt;br&gt;&lt;br&gt; An example for the us of this function is:
13424 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
13425 printf (ngettext ("%d file removed", "%d files removed", n), n);&lt;br&gt;
13426 &lt;/pre&gt;
13427 &lt;br&gt;&lt;br&gt; Please note that the numeric value &lt;VAR&gt;n&lt;/VAR&gt; has to be passed to the
13428 &lt;CODE&gt;printf&lt;/CODE&gt; function as well. It is not sufficient to pass it only to
13429 &lt;CODE&gt;ngettext&lt;/CODE&gt;.
13430 </synopsis>
13431 </function>
13432 </construct>
13433 <construct id="function-dngettext" type="function">
13434 <function returntype="char *">
13435 <prototype>
13436 <parameter content="const char *domain"/>
13437 <parameter content="const char *msgid1"/>
13438 <parameter content="const char *msgid2"/>
13439 <parameter content="unsigned long int n"/>
13440 </prototype>
13441 <headers>
13442 <header filename = "libintl.h"/>
13443 </headers>
13444 <synopsis>
13445 The &lt;CODE&gt;dngettext&lt;/CODE&gt; is similar to the &lt;CODE&gt;dgettext&lt;/CODE&gt; function in the
13446 way the message catalog is selected. The difference is that it takes
13447 two extra parameter to provide the correct plural form. These two
13448 parameters are handled in the same way &lt;CODE&gt;ngettext&lt;/CODE&gt; handles them.
13449 </synopsis>
13450 </function>
13451 </construct>
13452 <construct id="function-dcngettext" type="function">
13453 <function returntype="char *">
13454 <prototype>
13455 <parameter content="const char *domain"/>
13456 <parameter content="const char *msgid1"/>
13457 <parameter content="const char *msgid2"/>
13458 <parameter content="unsigned long int n"/>
13459 <parameter content="int category"/>
13460 </prototype>
13461 <headers>
13462 <header filename = "libintl.h"/>
13463 </headers>
13464 <synopsis>
13465 The &lt;CODE&gt;dcngettext&lt;/CODE&gt; is similar to the &lt;CODE&gt;dcgettext&lt;/CODE&gt; function in the
13466 way the message catalog is selected. The difference is that it takes
13467 two extra parameter to provide the correct plural form. These two
13468 parameters are handled in the same way &lt;CODE&gt;ngettext&lt;/CODE&gt; handles them.
13469 </synopsis>
13470 </function>
13471 </construct>
13472 <construct id="dtype-jmp_buf" type="dtype">
13473 <structure>
13474 </structure>
13475 </construct>
13476 <construct id="function-longjmp" type="function">
13477 <function returntype="void">
13478 <prototype>
13479 <parameter content="jmp_buf state"/>
13480 <parameter content="int value"/>
13481 </prototype>
13482 <headers>
13483 <header filename = "setjmp.h"/>
13484 </headers>
13485 <synopsis>
13486 This function restores current execution to the state saved in
13487 &lt;VAR&gt;state&lt;/VAR&gt;, and continues execution from the call to &lt;CODE&gt;setjmp&lt;/CODE&gt; that
13488 established that return point. Returning from &lt;CODE&gt;setjmp&lt;/CODE&gt; by means of
13489 &lt;CODE&gt;longjmp&lt;/CODE&gt; returns the &lt;VAR&gt;value&lt;/VAR&gt; argument that was passed to
13490 &lt;CODE&gt;longjmp&lt;/CODE&gt;, rather than &lt;CODE&gt;0&lt;/CODE&gt;. (But if &lt;VAR&gt;value&lt;/VAR&gt; is given as
13491 &lt;CODE&gt;0&lt;/CODE&gt;, &lt;CODE&gt;setjmp&lt;/CODE&gt; returns &lt;CODE&gt;1&lt;/CODE&gt;).
13492 </synopsis>
13493 </function>
13494 </construct>
13495 <construct id="dtype-sigjmp_buf" type="dtype">
13496 <structure>
13497 </structure>
13498 </construct>
13499 <construct id="function-sigsetjmp" type="function">
13500 <function returntype="int">
13501 <prototype>
13502 <parameter content="sigjmp_buf state"/>
13503 <parameter content="int savesigs"/>
13504 </prototype>
13505 <headers>
13506 <header filename = "setjmp.h"/>
13507 </headers>
13508 <synopsis>
13509 This is similar to &lt;CODE&gt;setjmp&lt;/CODE&gt;. If &lt;VAR&gt;savesigs&lt;/VAR&gt; is nonzero, the set
13510 of blocked signals is saved in &lt;VAR&gt;state&lt;/VAR&gt; and will be restored if a
13511 &lt;CODE&gt;siglongjmp&lt;/CODE&gt; is later performed with this &lt;VAR&gt;state&lt;/VAR&gt;.
13512 </synopsis>
13513 </function>
13514 </construct>
13515 <construct id="function-siglongjmp" type="function">
13516 <function returntype="void">
13517 <prototype>
13518 <parameter content="sigjmp_buf state"/>
13519 <parameter content="int value"/>
13520 </prototype>
13521 <headers>
13522 <header filename = "setjmp.h"/>
13523 </headers>
13524 <synopsis>
13525 This is similar to &lt;CODE&gt;longjmp&lt;/CODE&gt; except for the type of its &lt;VAR&gt;state&lt;/VAR&gt;
13526 argument. If the &lt;CODE&gt;sigsetjmp&lt;/CODE&gt; call that set this &lt;VAR&gt;state&lt;/VAR&gt; used a
13527 nonzero &lt;VAR&gt;savesigs&lt;/VAR&gt; flag, &lt;CODE&gt;siglongjmp&lt;/CODE&gt; also restores the set of
13528 blocked signals.
13529 </synopsis>
13530 </function>
13531 </construct>
13532 <construct id="dtype-ucontext_t" type="dtype">
13533 <structure>
13534 <synopsis>
13535 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;ucontext_t&lt;/CODE&gt; type is defined as a structure with as least the
13536 following elements:
13537 &lt;br&gt;&lt;br&gt;
13538 </synopsis>
13539 <elements>
13540 <element content="ucontext_t *uc_link">
13541 <synopsis>
13542 This is a pointer to the next context structure which is used if the
13543 context described in the current structure returns.
13544 &lt;br&gt;&lt;br&gt;
13545 </synopsis>
13546 </element>
13547 <element content="sigset_t uc_sigmask">
13548 <synopsis>
13549 Set of signals which are blocked when this context is used.
13550 &lt;br&gt;&lt;br&gt;
13551 </synopsis>
13552 </element>
13553 <element content="stack_t uc_stack">
13554 <synopsis>
13555 Stack used for this context. The value need not be (and normally is
13556 not) the stack pointer. .
13557 &lt;br&gt;&lt;br&gt;
13558 </synopsis>
13559 </element>
13560 </elements>
13561 </structure>
13562 </construct>
13563 <construct id="function-getcontext" type="function">
13564 <function returntype="int">
13565 <prototype>
13566 <parameter content="ucontext_t *ucp"/>
13567 </prototype>
13568 <headers>
13569 <header filename = "ucontext.h"/>
13570 </headers>
13571 <synopsis>
13572 The &lt;CODE&gt;getcontext&lt;/CODE&gt; function initializes the variable pointed to by
13573 &lt;VAR&gt;ucp&lt;/VAR&gt; with the context of the calling thread. The context contains
13574 the content of the registers, the signal mask, and the current stack.
13575 Executing the contents would start at the point where the
13576 &lt;CODE&gt;getcontext&lt;/CODE&gt; call just returned.
13577 &lt;br&gt;&lt;br&gt; The function returns &lt;CODE&gt;0&lt;/CODE&gt; if successful. Otherwise it returns
13578 &lt;CODE&gt;-1&lt;/CODE&gt; and sets &lt;VAR&gt;errno&lt;/VAR&gt; accordingly.
13579 </synopsis>
13580 </function>
13581 </construct>
13582 <construct id="function-makecontext" type="function">
13583 <function returntype="void">
13584 <prototype>
13585 <parameter content="ucontext_t *ucp"/>
13586 <parameter content="void (*func) (void)"/>
13587 <parameter content="int argc"/>
13588 <parameter content="..."/>
13589 </prototype>
13590 <headers>
13591 <header filename = "ucontext.h"/>
13592 </headers>
13593 <synopsis>
13594 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;ucp&lt;/VAR&gt; parameter passed to the &lt;CODE&gt;makecontext&lt;/CODE&gt; shall be
13595 initialized by a call to &lt;CODE&gt;getcontext&lt;/CODE&gt;. The context will be
13596 modified to in a way so that if the context is resumed it will start by
13597 calling the function &lt;CODE&gt;func&lt;/CODE&gt; which gets &lt;VAR&gt;argc&lt;/VAR&gt; integer arguments
13598 passed. The integer arguments which are to be passed should follow the
13599 &lt;VAR&gt;argc&lt;/VAR&gt; parameter in the call to &lt;CODE&gt;makecontext&lt;/CODE&gt;.
13600 &lt;br&gt;&lt;br&gt; Before the call to this function the &lt;CODE&gt;uc_stack&lt;/CODE&gt; and &lt;CODE&gt;uc_link&lt;/CODE&gt;
13601 element of the &lt;VAR&gt;ucp&lt;/VAR&gt; structure should be initialized. The
13602 &lt;CODE&gt;uc_stack&lt;/CODE&gt; element describes the stack which is used for this
13603 context. No two contexts which are used at the same time should use the
13604 same memory region for a stack.
13605 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;uc_link&lt;/CODE&gt; element of the object pointed to by &lt;VAR&gt;ucp&lt;/VAR&gt; should
13606 be a pointer to the context to be executed when the function &lt;VAR&gt;func&lt;/VAR&gt;
13607 returns or it should be a null pointer. See &lt;CODE&gt;setcontext&lt;/CODE&gt; for more
13608 information about the exact use.
13609 </synopsis>
13610 </function>
13611 </construct>
13612 <construct id="function-setcontext" type="function">
13613 <function returntype="int">
13614 <prototype>
13615 <parameter content="const ucontext_t *ucp"/>
13616 </prototype>
13617 <headers>
13618 <header filename = "ucontext.h"/>
13619 </headers>
13620 <synopsis>
13621 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;setcontext&lt;/CODE&gt; function restores the context described by
13622 &lt;VAR&gt;ucp&lt;/VAR&gt;. The context is not modified and can be reused as often as
13623 wanted.
13624 &lt;br&gt;&lt;br&gt; If the context was created by &lt;CODE&gt;getcontext&lt;/CODE&gt; execution resumes with
13625 the registers filled with the same values and the same stack as if the
13626 &lt;CODE&gt;getcontext&lt;/CODE&gt; call just returned.
13627 &lt;br&gt;&lt;br&gt; If the context was modified with a call to &lt;CODE&gt;makecontext&lt;/CODE&gt; execution
13628 continues with the function passed to &lt;CODE&gt;makecontext&lt;/CODE&gt; which gets the
13629 specified parameters passed. If this function returns execution is
13630 resumed in the context which was referenced by the &lt;CODE&gt;uc_link&lt;/CODE&gt;
13631 element of the context structure passed to &lt;CODE&gt;makecontext&lt;/CODE&gt; at the
13632 time of the call. If &lt;CODE&gt;uc_link&lt;/CODE&gt; was a null pointer the application
13633 terminates in this case.
13634 &lt;br&gt;&lt;br&gt; Since the context contains information about the stack no two threads
13635 should use the same context at the same time. The result in most cases
13636 would be disastrous.
13637 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;setcontext&lt;/CODE&gt; function does not return unless an error occurred
13638 in which case it returns &lt;CODE&gt;-1&lt;/CODE&gt;.
13639 </synopsis>
13640 </function>
13641 </construct>
13642 <construct id="function-swapcontext" type="function">
13643 <function returntype="int">
13644 <prototype>
13645 <parameter content="ucontext_t *restrict oucp"/>
13646 <parameter content="const ucontext_t *restrict ucp"/>
13647 </prototype>
13648 <headers>
13649 <header filename = "ucontext.h"/>
13650 </headers>
13651 <synopsis>
13652 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;swapcontext&lt;/CODE&gt; function is similar to &lt;CODE&gt;setcontext&lt;/CODE&gt; but
13653 instead of just replacing the current context the latter is first saved
13654 in the object pointed to by &lt;VAR&gt;oucp&lt;/VAR&gt; as if this was a call to
13655 &lt;CODE&gt;getcontext&lt;/CODE&gt;. The saved context would resume after the call to
13656 &lt;CODE&gt;swapcontext&lt;/CODE&gt;.
13657 &lt;br&gt;&lt;br&gt; Once the current context is saved the context described in &lt;VAR&gt;ucp&lt;/VAR&gt; is
13658 installed and execution continues as described in this context.
13659 &lt;br&gt;&lt;br&gt; If &lt;CODE&gt;swapcontext&lt;/CODE&gt; succeeds the function does not return unless the
13660 context &lt;VAR&gt;oucp&lt;/VAR&gt; is used without prior modification by
13661 &lt;CODE&gt;makecontext&lt;/CODE&gt;. The return value in this case is &lt;CODE&gt;0&lt;/CODE&gt;. If the
13662 function fails it returns &lt;CODE&gt;-1&lt;/CODE&gt; and set &lt;VAR&gt;errno&lt;/VAR&gt; accordingly.
13663 </synopsis>
13664 </function>
13665 </construct>
13666 <construct id="function-open" type="function">
13667 <function returntype="int">
13668 <prototype>
13669 <parameter content="const char *filename"/>
13670 <parameter content="int flags["/>
13671 <parameter content="mode_t mode]"/>
13672 </prototype>
13673 <headers>
13674 <header filename = "fcntl.h"/>
13675 </headers>
13676 <synopsis>
13677 The &lt;CODE&gt;open&lt;/CODE&gt; function creates and returns a new file descriptor
13678 for the file named by &lt;VAR&gt;filename&lt;/VAR&gt;. Initially, the file position
13679 indicator for the file is at the beginning of the file. The argument
13680 &lt;VAR&gt;mode&lt;/VAR&gt; is used only when a file is created, but it doesn't hurt
13681 to supply the argument in any case.
13682 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;flags&lt;/VAR&gt; argument controls how the file is to be opened. This is
13683 a bit mask; you create the value by the bitwise OR of the appropriate
13684 parameters (using the &lt;samp&gt;|&lt;/samp&gt; operator in C).
13685 , for the parameters available.
13686 &lt;br&gt;&lt;br&gt; The normal return value from &lt;CODE&gt;open&lt;/CODE&gt; is a non-negative integer file
13687 descriptor. In the case of an error, a value of -1 is returned
13688 instead. In addition to the usual file name errors , the following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined
13689 for this function:
13690 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
13691
13692 &lt;DT&gt;&lt;CODE&gt;EACCES&lt;/CODE&gt;
13693 &lt;DD&gt;
13694 The file exists but is not readable/writable as requested by the &lt;VAR&gt;flags&lt;/VAR&gt;
13695 argument, the file does not exist and the directory is unwritable so
13696 it cannot be created.
13697 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EEXIST
13698 Both &lt;CODE&gt;O_CREAT&lt;/CODE&gt; and &lt;CODE&gt;O_EXCL&lt;/CODE&gt; are set, and the named file already
13699 exists.
13700 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINTR
13701 The &lt;CODE&gt;open&lt;/CODE&gt; operation was interrupted by a signal.
13702 .
13703 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EISDIR
13704 The &lt;VAR&gt;flags&lt;/VAR&gt; argument specified write access, and the file is a directory.
13705 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EMFILE
13706 The process has too many files open.
13707 The maximum number of file descriptors is controlled by the
13708 &lt;CODE&gt;RLIMIT_NOFILE&lt;/CODE&gt; resource limit; .
13709 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENFILE
13710 The entire system, or perhaps the file system which contains the
13711 directory, cannot support any additional open files at the moment.
13712 (This problem cannot happen on the GNU system.)
13713 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOENT
13714 The named file does not exist, and &lt;CODE&gt;O_CREAT&lt;/CODE&gt; is not specified.
13715 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOSPC
13716 The directory or file system that would contain the new file cannot be
13717 extended, because there is no disk space left.
13718 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENXIO
13719 &lt;CODE&gt;O_NONBLOCK&lt;/CODE&gt; and &lt;CODE&gt;O_WRONLY&lt;/CODE&gt; are both set in the &lt;VAR&gt;flags&lt;/VAR&gt;
13720 argument, the file named by &lt;VAR&gt;filename&lt;/VAR&gt; is a FIFO , and no process has the file open for reading.
13721 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
13722 The file resides on a read-only file system and any of &lt;CODE&gt;O_WRONLY&lt;/CODE&gt;,
13723 &lt;CODE&gt;O_RDWR&lt;/CODE&gt;, and &lt;CODE&gt;O_TRUNC&lt;/CODE&gt; are set in the &lt;VAR&gt;flags&lt;/VAR&gt; argument,
13724 or &lt;CODE&gt;O_CREAT&lt;/CODE&gt; is set and the file does not already exist.
13725
13726 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt; If on a 32 bit machine the sources are translated with
13727 &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; the function &lt;CODE&gt;open&lt;/CODE&gt; returns a file
13728 descriptor opened in the large file mode which enables the file handling
13729 functions to use files up to 2^63 bytes in size and offset from
13730 -2^63 to 2^63. This happens transparently for the user
13731 since all of the lowlevel file handling functions are equally replaced.
13732 &lt;br&gt;&lt;br&gt; This function is a cancellation point in multi-threaded programs. This
13733 is a problem if the thread allocates some resources (like memory, file
13734 descriptors, semaphores or whatever) at the time &lt;CODE&gt;open&lt;/CODE&gt; is
13735 called. If the thread gets canceled these resources stay allocated
13736 until the program ends. To avoid this calls to &lt;CODE&gt;open&lt;/CODE&gt; should be
13737 protected using cancellation handlers.
13738 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;open&lt;/CODE&gt; function is the underlying primitive for the &lt;CODE&gt;fopen&lt;/CODE&gt;
13739 and &lt;CODE&gt;freopen&lt;/CODE&gt; functions, that create streams.
13740 </synopsis>
13741 </function>
13742 </construct>
13743 <construct id="function-open64" type="function">
13744 <function returntype="int">
13745 <prototype>
13746 <parameter content="const char *filename"/>
13747 <parameter content="int flags["/>
13748 <parameter content="mode_t mode]"/>
13749 </prototype>
13750 <headers>
13751 <header filename = "fcntl.h"/>
13752 </headers>
13753 <synopsis>
13754 This function is similar to &lt;CODE&gt;open&lt;/CODE&gt;. It returns a file descriptor
13755 which can be used to access the file named by &lt;VAR&gt;filename&lt;/VAR&gt;. The only
13756 difference is that on 32 bit systems the file is opened in the
13757 large file mode. I.e., file length and file offsets can exceed 31 bits.
13758 &lt;br&gt;&lt;br&gt; When the sources are translated with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
13759 function is actually available under the name &lt;CODE&gt;open&lt;/CODE&gt;. I.e., the
13760 new, extended API using 64 bit file sizes and offsets transparently
13761 replaces the old API.
13762 </synopsis>
13763 </function>
13764 </construct>
13765 <construct id="function-close" type="function">
13766 <function returntype="int">
13767 <prototype>
13768 <parameter content="int filedes"/>
13769 </prototype>
13770 <headers>
13771 <header filename = "unistd.h"/>
13772 </headers>
13773 <synopsis>
13774 The function &lt;CODE&gt;close&lt;/CODE&gt; closes the file descriptor &lt;VAR&gt;filedes&lt;/VAR&gt;.
13775 Closing a file has the following consequences:
13776 &lt;br&gt;&lt;br&gt; &lt;OL&gt;
13777 &lt;LI&gt;
13778 The file descriptor is deallocated.
13779 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
13780 Any record locks owned by the process on the file are unlocked.
13781 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
13782 When all file descriptors associated with a pipe or FIFO have been closed,
13783 any unread data is discarded.
13784 &lt;/OL&gt;
13785 &lt;br&gt;&lt;br&gt; This function is a cancellation point in multi-threaded programs. This
13786 is a problem if the thread allocates some resources (like memory, file
13787 descriptors, semaphores or whatever) at the time &lt;CODE&gt;close&lt;/CODE&gt; is
13788 called. If the thread gets canceled these resources stay allocated
13789 until the program ends. To avoid this, calls to &lt;CODE&gt;close&lt;/CODE&gt; should be
13790 protected using cancellation handlers.
13791 &lt;br&gt;&lt;br&gt; The normal return value from &lt;CODE&gt;close&lt;/CODE&gt; is 0; a value of -1
13792 is returned in case of failure. The following &lt;CODE&gt;errno&lt;/CODE&gt; error
13793 conditions are defined for this function:
13794 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
13795
13796 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
13797 &lt;DD&gt;
13798 The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not a valid file descriptor.
13799 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINTR
13800 The &lt;CODE&gt;close&lt;/CODE&gt; call was interrupted by a signal.
13801 .
13802 Here is an example of how to handle &lt;CODE&gt;EINTR&lt;/CODE&gt; properly:
13803 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
13804 TEMP_FAILURE_RETRY (close (desc));&lt;br&gt;
13805 &lt;/pre&gt;
13806 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOSPC
13807 &lt;LI&gt;x EIO
13808 &lt;LI&gt;x EDQUOT
13809 When the file is accessed by NFS, these errors from &lt;CODE&gt;write&lt;/CODE&gt; can sometimes
13810 not be detected until &lt;CODE&gt;close&lt;/CODE&gt;. , for details
13811 on their meaning.
13812
13813 &lt;br&gt;&lt;br&gt; Please note that there is &lt;EM&gt;no&lt;/EM&gt; separate &lt;CODE&gt;close64&lt;/CODE&gt; function.
13814 This is not necessary since this function does not determine nor depend
13815 on the mode of the file. The kernel which performs the &lt;CODE&gt;close&lt;/CODE&gt;
13816 operation knows which mode the descriptor is used for and can handle
13817 this situation.
13818 </synopsis>
13819 </function>
13820 </construct>
13821 <construct id="dtype-ssize_t" type="dtype">
13822 <structure>
13823 </structure>
13824 </construct>
13825 <construct id="function-read" type="function">
13826 <function returntype="ssize_t">
13827 <prototype>
13828 <parameter content="int filedes"/>
13829 <parameter content="void *buffer"/>
13830 <parameter content="size_t size"/>
13831 </prototype>
13832 <headers>
13833 <header filename = "unistd.h"/>
13834 </headers>
13835 <synopsis>
13836 The &lt;CODE&gt;read&lt;/CODE&gt; function reads up to &lt;VAR&gt;size&lt;/VAR&gt; bytes from the file
13837 with descriptor &lt;VAR&gt;filedes&lt;/VAR&gt;, storing the results in the &lt;VAR&gt;buffer&lt;/VAR&gt;.
13838 (This is not necessarily a character string, and no terminating null
13839 character is added.)
13840 &lt;br&gt;&lt;br&gt; -of-file, on a file descriptor
13841 The return value is the number of bytes actually read. This might be
13842 less than &lt;VAR&gt;size&lt;/VAR&gt;; for example, if there aren't that many bytes left
13843 in the file or if there aren't that many bytes immediately available.
13844 The exact behavior depends on what kind of file it is. Note that
13845 reading less than &lt;VAR&gt;size&lt;/VAR&gt; bytes is not an error.
13846 &lt;br&gt;&lt;br&gt; A value of zero indicates end-of-file (except if the value of the
13847 &lt;VAR&gt;size&lt;/VAR&gt; argument is also zero). This is not considered an error.
13848 If you keep calling &lt;CODE&gt;read&lt;/CODE&gt; while at end-of-file, it will keep
13849 returning zero and doing nothing else.
13850 &lt;br&gt;&lt;br&gt; If &lt;CODE&gt;read&lt;/CODE&gt; returns at least one character, there is no way you can
13851 tell whether end-of-file was reached. But if you did reach the end, the
13852 next read will return zero.
13853 &lt;br&gt;&lt;br&gt; In case of an error, &lt;CODE&gt;read&lt;/CODE&gt; returns -1. The following
13854 &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
13855 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
13856
13857 &lt;DT&gt;&lt;CODE&gt;EAGAIN&lt;/CODE&gt;
13858 &lt;DD&gt;
13859 Normally, when no input is immediately available, &lt;CODE&gt;read&lt;/CODE&gt; waits for
13860 some input. But if the &lt;CODE&gt;O_NONBLOCK&lt;/CODE&gt; flag is set for the file
13861 , &lt;CODE&gt;read&lt;/CODE&gt; returns immediately without
13862 reading any data, and reports this error.
13863 &lt;br&gt;&lt;br&gt; Compatibility Note: Most versions of BSD Unix use a different
13864 error code for this: &lt;CODE&gt;EWOULDBLOCK&lt;/CODE&gt;. In the GNU library,
13865 &lt;CODE&gt;EWOULDBLOCK&lt;/CODE&gt; is an alias for &lt;CODE&gt;EAGAIN&lt;/CODE&gt;, so it doesn't matter
13866 which name you use.
13867 &lt;br&gt;&lt;br&gt; On some systems, reading a large amount of data from a character special
13868 file can also fail with &lt;CODE&gt;EAGAIN&lt;/CODE&gt; if the kernel cannot find enough
13869 physical memory to lock down the user's pages. This is limited to
13870 devices that transfer with direct memory access into the user's memory,
13871 which means it does not include terminals, since they always use
13872 separate buffers inside the kernel. This problem never happens in the
13873 GNU system.
13874 &lt;br&gt;&lt;br&gt; Any condition that could result in &lt;CODE&gt;EAGAIN&lt;/CODE&gt; can instead result in a
13875 successful &lt;CODE&gt;read&lt;/CODE&gt; which returns fewer bytes than requested.
13876 Calling &lt;CODE&gt;read&lt;/CODE&gt; again immediately would result in &lt;CODE&gt;EAGAIN&lt;/CODE&gt;.
13877 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EBADF
13878 The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not a valid file descriptor,
13879 or is not open for reading.
13880 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINTR
13881 &lt;CODE&gt;read&lt;/CODE&gt; was interrupted by a signal while it was waiting for input.
13882 . A signal will not necessary cause
13883 &lt;CODE&gt;read&lt;/CODE&gt; to return &lt;CODE&gt;EINTR&lt;/CODE&gt;; it may instead result in a
13884 successful &lt;CODE&gt;read&lt;/CODE&gt; which returns fewer bytes than requested.
13885 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EIO
13886 For many devices, and for disk files, this error code indicates
13887 a hardware error.
13888 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;EIO&lt;/CODE&gt; also occurs when a background process tries to read from the
13889 controlling terminal, and the normal action of stopping the process by
13890 sending it a &lt;CODE&gt;SIGTTIN&lt;/CODE&gt; signal isn't working. This might happen if
13891 the signal is being blocked or ignored, or because the process group is
13892 orphaned. , for more information about job control,
13893 and Signal Handling, for information about signals.
13894 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
13895 In some systems, when reading from a character or block device, position
13896 and size offsets must be aligned to a particular block size. This error
13897 indicates that the offsets were not properly aligned.
13898
13899 &lt;br&gt;&lt;br&gt; Please note that there is no function named &lt;CODE&gt;read64&lt;/CODE&gt;. This is not
13900 necessary since this function does not directly modify or handle the
13901 possibly wide file offset. Since the kernel handles this state
13902 internally, the &lt;CODE&gt;read&lt;/CODE&gt; function can be used for all cases.
13903 &lt;br&gt;&lt;br&gt; This function is a cancellation point in multi-threaded programs. This
13904 is a problem if the thread allocates some resources (like memory, file
13905 descriptors, semaphores or whatever) at the time &lt;CODE&gt;read&lt;/CODE&gt; is
13906 called. If the thread gets canceled these resources stay allocated
13907 until the program ends. To avoid this, calls to &lt;CODE&gt;read&lt;/CODE&gt; should be
13908 protected using cancellation handlers.
13909 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;read&lt;/CODE&gt; function is the underlying primitive for all of the
13910 functions that read from streams, such as &lt;CODE&gt;fgetc&lt;/CODE&gt;.
13911 </synopsis>
13912 </function>
13913 </construct>
13914 <construct id="function-pread" type="function">
13915 <function returntype="ssize_t">
13916 <prototype>
13917 <parameter content="int filedes"/>
13918 <parameter content="void *buffer"/>
13919 <parameter content="size_t size"/>
13920 <parameter content="off_t offset"/>
13921 </prototype>
13922 <headers>
13923 <header filename = "unistd.h"/>
13924 </headers>
13925 <synopsis>
13926 The &lt;CODE&gt;pread&lt;/CODE&gt; function is similar to the &lt;CODE&gt;read&lt;/CODE&gt; function. The
13927 first three arguments are identical, and the return values and error
13928 codes also correspond.
13929 &lt;br&gt;&lt;br&gt; The difference is the fourth argument and its handling. The data block
13930 is not read from the current position of the file descriptor
13931 &lt;CODE&gt;filedes&lt;/CODE&gt;. Instead the data is read from the file starting at
13932 position &lt;VAR&gt;offset&lt;/VAR&gt;. The position of the file descriptor itself is
13933 not affected by the operation. The value is the same as before the call.
13934 &lt;br&gt;&lt;br&gt; When the source file is compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; the
13935 &lt;CODE&gt;pread&lt;/CODE&gt; function is in fact &lt;CODE&gt;pread64&lt;/CODE&gt; and the type
13936 &lt;CODE&gt;off_t&lt;/CODE&gt; has 64 bits, which makes it possible to handle files up to
13937 2^63 bytes in length.
13938 &lt;br&gt;&lt;br&gt; The return value of &lt;CODE&gt;pread&lt;/CODE&gt; describes the number of bytes read.
13939 In the error case it returns -1 like &lt;CODE&gt;read&lt;/CODE&gt; does and the
13940 error codes are also the same, with these additions:
13941 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
13942
13943 &lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
13944 &lt;DD&gt;
13945 The value given for &lt;VAR&gt;offset&lt;/VAR&gt; is negative and therefore illegal.
13946 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ESPIPE
13947 The file descriptor &lt;VAR&gt;filedes&lt;/VAR&gt; is associate with a pipe or a FIFO and
13948 this device does not allow positioning of the file pointer.
13949
13950 &lt;br&gt;&lt;br&gt; The function is an extension defined in the Unix Single Specification
13951 version 2.
13952 </synopsis>
13953 </function>
13954 </construct>
13955 <construct id="function-pread64" type="function">
13956 <function returntype="ssize_t">
13957 <prototype>
13958 <parameter content="int filedes"/>
13959 <parameter content="void *buffer"/>
13960 <parameter content="size_t size"/>
13961 <parameter content="off64_t offset"/>
13962 </prototype>
13963 <headers>
13964 <header filename = "unistd.h"/>
13965 </headers>
13966 <synopsis>
13967 This function is similar to the &lt;CODE&gt;pread&lt;/CODE&gt; function. The difference
13968 is that the &lt;VAR&gt;offset&lt;/VAR&gt; parameter is of type &lt;CODE&gt;off64_t&lt;/CODE&gt; instead of
13969 &lt;CODE&gt;off_t&lt;/CODE&gt; which makes it possible on 32 bit machines to address
13970 files larger than 2^31 bytes and up to 2^63 bytes. The
13971 file descriptor &lt;CODE&gt;filedes&lt;/CODE&gt; must be opened using &lt;CODE&gt;open64&lt;/CODE&gt; since
13972 otherwise the large offsets possible with &lt;CODE&gt;off64_t&lt;/CODE&gt; will lead to
13973 errors with a descriptor in small file mode.
13974 &lt;br&gt;&lt;br&gt; When the source file is compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a
13975 32 bit machine this function is actually available under the name
13976 &lt;CODE&gt;pread&lt;/CODE&gt; and so transparently replaces the 32 bit interface.
13977 </synopsis>
13978 </function>
13979 </construct>
13980 <construct id="function-write" type="function">
13981 <function returntype="ssize_t">
13982 <prototype>
13983 <parameter content="int filedes"/>
13984 <parameter content="const void *buffer"/>
13985 <parameter content="size_t size"/>
13986 </prototype>
13987 <headers>
13988 <header filename = "unistd.h"/>
13989 </headers>
13990 <synopsis>
13991 The &lt;CODE&gt;write&lt;/CODE&gt; function writes up to &lt;VAR&gt;size&lt;/VAR&gt; bytes from
13992 &lt;VAR&gt;buffer&lt;/VAR&gt; to the file with descriptor &lt;VAR&gt;filedes&lt;/VAR&gt;. The data in
13993 &lt;VAR&gt;buffer&lt;/VAR&gt; is not necessarily a character string and a null character is
13994 output like any other character.
13995 &lt;br&gt;&lt;br&gt; The return value is the number of bytes actually written. This may be
13996 &lt;VAR&gt;size&lt;/VAR&gt;, but can always be smaller. Your program should always call
13997 &lt;CODE&gt;write&lt;/CODE&gt; in a loop, iterating until all the data is written.
13998 &lt;br&gt;&lt;br&gt; Once &lt;CODE&gt;write&lt;/CODE&gt; returns, the data is enqueued to be written and can be
13999 read back right away, but it is not necessarily written out to permanent
14000 storage immediately. You can use &lt;CODE&gt;fsync&lt;/CODE&gt; when you need to be sure
14001 your data has been permanently stored before continuing. (It is more
14002 efficient for the system to batch up consecutive writes and do them all
14003 at once when convenient. Normally they will always be written to disk
14004 within a minute or less.) Modern systems provide another function
14005 &lt;CODE&gt;fdatasync&lt;/CODE&gt; which guarantees integrity only for the file data and
14006 is therefore faster.
14007 You can use the &lt;CODE&gt;O_FSYNC&lt;/CODE&gt; open mode to make &lt;CODE&gt;write&lt;/CODE&gt; always
14008 store the data to disk before returning; .
14009 &lt;br&gt;&lt;br&gt; In the case of an error, &lt;CODE&gt;write&lt;/CODE&gt; returns -1. The following
14010 &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
14011 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
14012
14013 &lt;DT&gt;&lt;CODE&gt;EAGAIN&lt;/CODE&gt;
14014 &lt;DD&gt;
14015 Normally, &lt;CODE&gt;write&lt;/CODE&gt; blocks until the write operation is complete.
14016 But if the &lt;CODE&gt;O_NONBLOCK&lt;/CODE&gt; flag is set for the file , it returns immediately without writing any data and
14017 reports this error. An example of a situation that might cause the
14018 process to block on output is writing to a terminal device that supports
14019 flow control, where output has been suspended by receipt of a STOP
14020 character.
14021 &lt;br&gt;&lt;br&gt; Compatibility Note: Most versions of BSD Unix use a different
14022 error code for this: &lt;CODE&gt;EWOULDBLOCK&lt;/CODE&gt;. In the GNU library,
14023 &lt;CODE&gt;EWOULDBLOCK&lt;/CODE&gt; is an alias for &lt;CODE&gt;EAGAIN&lt;/CODE&gt;, so it doesn't matter
14024 which name you use.
14025 &lt;br&gt;&lt;br&gt; On some systems, writing a large amount of data from a character special
14026 file can also fail with &lt;CODE&gt;EAGAIN&lt;/CODE&gt; if the kernel cannot find enough
14027 physical memory to lock down the user's pages. This is limited to
14028 devices that transfer with direct memory access into the user's memory,
14029 which means it does not include terminals, since they always use
14030 separate buffers inside the kernel. This problem does not arise in the
14031 GNU system.
14032 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EBADF
14033 The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not a valid file descriptor,
14034 or is not open for writing.
14035 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EFBIG
14036 The size of the file would become larger than the implementation can support.
14037 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINTR
14038 The &lt;CODE&gt;write&lt;/CODE&gt; operation was interrupted by a signal while it was
14039 blocked waiting for completion. A signal will not necessarily cause
14040 &lt;CODE&gt;write&lt;/CODE&gt; to return &lt;CODE&gt;EINTR&lt;/CODE&gt;; it may instead result in a
14041 successful &lt;CODE&gt;write&lt;/CODE&gt; which writes fewer bytes than requested.
14042 .
14043 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EIO
14044 For many devices, and for disk files, this error code indicates
14045 a hardware error.
14046 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOSPC
14047 The device containing the file is full.
14048 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EPIPE
14049 This error is returned when you try to write to a pipe or FIFO that
14050 isn't open for reading by any process. When this happens, a &lt;CODE&gt;SIGPIPE&lt;/CODE&gt;
14051 signal is also sent to the process; see Signal Handling.
14052 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
14053 In some systems, when writing to a character or block device, position
14054 and size offsets must be aligned to a particular block size. This error
14055 indicates that the offsets were not properly aligned.
14056
14057 &lt;br&gt;&lt;br&gt; Unless you have arranged to prevent &lt;CODE&gt;EINTR&lt;/CODE&gt; failures, you should
14058 check &lt;CODE&gt;errno&lt;/CODE&gt; after each failing call to &lt;CODE&gt;write&lt;/CODE&gt;, and if the
14059 error was &lt;CODE&gt;EINTR&lt;/CODE&gt;, you should simply repeat the call.
14060 . The easy way to do this is with the
14061 macro &lt;CODE&gt;TEMP_FAILURE_RETRY&lt;/CODE&gt;, as follows:
14062 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
14063 nbytes = TEMP_FAILURE_RETRY (write (desc, buffer, count));&lt;br&gt;
14064 &lt;/pre&gt;
14065 &lt;br&gt;&lt;br&gt; Please note that there is no function named &lt;CODE&gt;write64&lt;/CODE&gt;. This is not
14066 necessary since this function does not directly modify or handle the
14067 possibly wide file offset. Since the kernel handles this state
14068 internally the &lt;CODE&gt;write&lt;/CODE&gt; function can be used for all cases.
14069 &lt;br&gt;&lt;br&gt; This function is a cancellation point in multi-threaded programs. This
14070 is a problem if the thread allocates some resources (like memory, file
14071 descriptors, semaphores or whatever) at the time &lt;CODE&gt;write&lt;/CODE&gt; is
14072 called. If the thread gets canceled these resources stay allocated
14073 until the program ends. To avoid this, calls to &lt;CODE&gt;write&lt;/CODE&gt; should be
14074 protected using cancellation handlers.
14075 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;write&lt;/CODE&gt; function is the underlying primitive for all of the
14076 functions that write to streams, such as &lt;CODE&gt;fputc&lt;/CODE&gt;.
14077 </synopsis>
14078 </function>
14079 </construct>
14080 <construct id="function-pwrite" type="function">
14081 <function returntype="ssize_t">
14082 <prototype>
14083 <parameter content="int filedes"/>
14084 <parameter content="const void *buffer"/>
14085 <parameter content="size_t size"/>
14086 <parameter content="off_t offset"/>
14087 </prototype>
14088 <headers>
14089 <header filename = "unistd.h"/>
14090 </headers>
14091 <synopsis>
14092 The &lt;CODE&gt;pwrite&lt;/CODE&gt; function is similar to the &lt;CODE&gt;write&lt;/CODE&gt; function. The
14093 first three arguments are identical, and the return values and error codes
14094 also correspond.
14095 &lt;br&gt;&lt;br&gt; The difference is the fourth argument and its handling. The data block
14096 is not written to the current position of the file descriptor
14097 &lt;CODE&gt;filedes&lt;/CODE&gt;. Instead the data is written to the file starting at
14098 position &lt;VAR&gt;offset&lt;/VAR&gt;. The position of the file descriptor itself is
14099 not affected by the operation. The value is the same as before the call.
14100 &lt;br&gt;&lt;br&gt; When the source file is compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; the
14101 &lt;CODE&gt;pwrite&lt;/CODE&gt; function is in fact &lt;CODE&gt;pwrite64&lt;/CODE&gt; and the type
14102 &lt;CODE&gt;off_t&lt;/CODE&gt; has 64 bits, which makes it possible to handle files up to
14103 2^63 bytes in length.
14104 &lt;br&gt;&lt;br&gt; The return value of &lt;CODE&gt;pwrite&lt;/CODE&gt; describes the number of written bytes.
14105 In the error case it returns -1 like &lt;CODE&gt;write&lt;/CODE&gt; does and the
14106 error codes are also the same, with these additions:
14107 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
14108
14109 &lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
14110 &lt;DD&gt;
14111 The value given for &lt;VAR&gt;offset&lt;/VAR&gt; is negative and therefore illegal.
14112 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ESPIPE
14113 The file descriptor &lt;VAR&gt;filedes&lt;/VAR&gt; is associated with a pipe or a FIFO and
14114 this device does not allow positioning of the file pointer.
14115
14116 &lt;br&gt;&lt;br&gt; The function is an extension defined in the Unix Single Specification
14117 version 2.
14118 </synopsis>
14119 </function>
14120 </construct>
14121 <construct id="function-pwrite64" type="function">
14122 <function returntype="ssize_t">
14123 <prototype>
14124 <parameter content="int filedes"/>
14125 <parameter content="const void *buffer"/>
14126 <parameter content="size_t size"/>
14127 <parameter content="off64_t offset"/>
14128 </prototype>
14129 <headers>
14130 <header filename = "unistd.h"/>
14131 </headers>
14132 <synopsis>
14133 This function is similar to the &lt;CODE&gt;pwrite&lt;/CODE&gt; function. The difference
14134 is that the &lt;VAR&gt;offset&lt;/VAR&gt; parameter is of type &lt;CODE&gt;off64_t&lt;/CODE&gt; instead of
14135 &lt;CODE&gt;off_t&lt;/CODE&gt; which makes it possible on 32 bit machines to address
14136 files larger than 2^31 bytes and up to 2^63 bytes. The
14137 file descriptor &lt;CODE&gt;filedes&lt;/CODE&gt; must be opened using &lt;CODE&gt;open64&lt;/CODE&gt; since
14138 otherwise the large offsets possible with &lt;CODE&gt;off64_t&lt;/CODE&gt; will lead to
14139 errors with a descriptor in small file mode.
14140 &lt;br&gt;&lt;br&gt; When the source file is compiled using &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a
14141 32 bit machine this function is actually available under the name
14142 &lt;CODE&gt;pwrite&lt;/CODE&gt; and so transparently replaces the 32 bit interface.
14143 </synopsis>
14144 </function>
14145 </construct>
14146 <construct id="function-lseek" type="function">
14147 <function returntype="off_t">
14148 <prototype>
14149 <parameter content="int filedes"/>
14150 <parameter content="off_t offset"/>
14151 <parameter content="int whence"/>
14152 </prototype>
14153 <headers>
14154 <header filename = "unistd.h"/>
14155 </headers>
14156 <synopsis>
14157 The &lt;CODE&gt;lseek&lt;/CODE&gt; function is used to change the file position of the
14158 file with descriptor &lt;VAR&gt;filedes&lt;/VAR&gt;.
14159 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;whence&lt;/VAR&gt; argument specifies how the &lt;VAR&gt;offset&lt;/VAR&gt; should be
14160 interpreted, in the same way as for the &lt;CODE&gt;fseek&lt;/CODE&gt; function, and it must
14161 be one of the symbolic constants &lt;CODE&gt;SEEK_SET&lt;/CODE&gt;, &lt;CODE&gt;SEEK_CUR&lt;/CODE&gt;, or
14162 &lt;CODE&gt;SEEK_END&lt;/CODE&gt;.
14163 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
14164
14165 &lt;DT&gt;&lt;CODE&gt;SEEK_SET&lt;/CODE&gt;
14166 &lt;DD&gt;
14167 Specifies that &lt;VAR&gt;whence&lt;/VAR&gt; is a count of characters from the beginning
14168 of the file.
14169 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;SEEK_CUR&lt;/CODE&gt;
14170 &lt;DD&gt;
14171 Specifies that &lt;VAR&gt;whence&lt;/VAR&gt; is a count of characters from the current
14172 file position. This count may be positive or negative.
14173 &lt;br&gt;&lt;br&gt; &lt;LI&gt; SEEK_END
14174 Specifies that &lt;VAR&gt;whence&lt;/VAR&gt; is a count of characters from the end of
14175 the file. A negative count specifies a position within the current
14176 extent of the file; a positive count specifies a position past the
14177 current end. If you set the position past the current end, and
14178 actually write data, you will extend the file with zeros up to that
14179 position.
14180
14181 &lt;br&gt;&lt;br&gt; The return value from &lt;CODE&gt;lseek&lt;/CODE&gt; is normally the resulting file
14182 position, measured in bytes from the beginning of the file.
14183 You can use this feature together with &lt;CODE&gt;SEEK_CUR&lt;/CODE&gt; to read the
14184 current file position.
14185 &lt;br&gt;&lt;br&gt; If you want to append to the file, setting the file position to the
14186 current end of file with &lt;CODE&gt;SEEK_END&lt;/CODE&gt; is not sufficient. Another
14187 process may write more data after you seek but before you write,
14188 extending the file so the position you write onto clobbers their data.
14189 Instead, use the &lt;CODE&gt;O_APPEND&lt;/CODE&gt; operating mode; .
14190 &lt;br&gt;&lt;br&gt; You can set the file position past the current end of the file. This
14191 does not by itself make the file longer; &lt;CODE&gt;lseek&lt;/CODE&gt; never changes the
14192 file. But subsequent output at that position will extend the file.
14193 Characters between the previous end of file and the new position are
14194 filled with zeros. Extending the file in this way can create a
14195 ``hole'': the blocks of zeros are not actually allocated on disk, so the
14196 file takes up less space than it appears to; it is then called a
14197 ``sparse file''.
14198 files
14199 in files
14200 &lt;br&gt;&lt;br&gt; If the file position cannot be changed, or the operation is in some way
14201 invalid, &lt;CODE&gt;lseek&lt;/CODE&gt; returns a value of -1. The following
14202 &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
14203 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
14204
14205 &lt;LI&gt; EBADF
14206 The &lt;VAR&gt;filedes&lt;/VAR&gt; is not a valid file descriptor.
14207 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
14208 The &lt;VAR&gt;whence&lt;/VAR&gt; argument value is not valid, or the resulting
14209 file offset is not valid. A file offset is invalid.
14210 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ESPIPE
14211 The &lt;VAR&gt;filedes&lt;/VAR&gt; corresponds to an object that cannot be positioned,
14212 such as a pipe, FIFO or terminal device. (POSIX.1 specifies this error
14213 only for pipes and FIFOs, but in the GNU system, you always get
14214 &lt;CODE&gt;ESPIPE&lt;/CODE&gt; if the object is not seekable.)
14215
14216 &lt;br&gt;&lt;br&gt; When the source file is compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; the
14217 &lt;CODE&gt;lseek&lt;/CODE&gt; function is in fact &lt;CODE&gt;lseek64&lt;/CODE&gt; and the type
14218 &lt;CODE&gt;off_t&lt;/CODE&gt; has 64 bits which makes it possible to handle files up to
14219 2^63 bytes in length.
14220 &lt;br&gt;&lt;br&gt; This function is a cancellation point in multi-threaded programs. This
14221 is a problem if the thread allocates some resources (like memory, file
14222 descriptors, semaphores or whatever) at the time &lt;CODE&gt;lseek&lt;/CODE&gt; is
14223 called. If the thread gets canceled these resources stay allocated
14224 until the program ends. To avoid this calls to &lt;CODE&gt;lseek&lt;/CODE&gt; should be
14225 protected using cancellation handlers.
14226 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;lseek&lt;/CODE&gt; function is the underlying primitive for the
14227 &lt;CODE&gt;fseek&lt;/CODE&gt;, &lt;CODE&gt;fseeko&lt;/CODE&gt;, &lt;CODE&gt;ftell&lt;/CODE&gt;, &lt;CODE&gt;ftello&lt;/CODE&gt; and
14228 &lt;CODE&gt;rewind&lt;/CODE&gt; functions, which operate on streams instead of file
14229 descriptors.
14230 </synopsis>
14231 </function>
14232 </construct>
14233 <construct id="function-lseek64" type="function">
14234 <function returntype="off64_t">
14235 <prototype>
14236 <parameter content="int filedes"/>
14237 <parameter content="off64_t offset"/>
14238 <parameter content="int whence"/>
14239 </prototype>
14240 <headers>
14241 <header filename = "unistd.h"/>
14242 </headers>
14243 <synopsis>
14244 This function is similar to the &lt;CODE&gt;lseek&lt;/CODE&gt; function. The difference
14245 is that the &lt;VAR&gt;offset&lt;/VAR&gt; parameter is of type &lt;CODE&gt;off64_t&lt;/CODE&gt; instead of
14246 &lt;CODE&gt;off_t&lt;/CODE&gt; which makes it possible on 32 bit machines to address
14247 files larger than 2^31 bytes and up to 2^63 bytes. The
14248 file descriptor &lt;CODE&gt;filedes&lt;/CODE&gt; must be opened using &lt;CODE&gt;open64&lt;/CODE&gt; since
14249 otherwise the large offsets possible with &lt;CODE&gt;off64_t&lt;/CODE&gt; will lead to
14250 errors with a descriptor in small file mode.
14251 &lt;br&gt;&lt;br&gt; When the source file is compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a
14252 32 bits machine this function is actually available under the name
14253 &lt;CODE&gt;lseek&lt;/CODE&gt; and so transparently replaces the 32 bit interface.
14254 </synopsis>
14255 </function>
14256 </construct>
14257 <construct id="dtype-off_t" type="dtype">
14258 <structure>
14259 </structure>
14260 </construct>
14261 <construct id="dtype-off64_t" type="dtype">
14262 <structure>
14263 </structure>
14264 </construct>
14265 <construct id="function-fdopen" type="function">
14266 <function returntype="FILE *">
14267 <prototype>
14268 <parameter content="int filedes"/>
14269 <parameter content="const char *opentype"/>
14270 </prototype>
14271 <headers>
14272 <header filename = "sys/types.h"/>
14273 <header filename = "stdio.h"/>
14274 </headers>
14275 <synopsis>
14276 The &lt;CODE&gt;fdopen&lt;/CODE&gt; function returns a new stream for the file descriptor
14277 &lt;VAR&gt;filedes&lt;/VAR&gt;.
14278 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;opentype&lt;/VAR&gt; argument is interpreted in the same way as for the
14279 &lt;CODE&gt;fopen&lt;/CODE&gt; function , except that
14280 the &lt;samp&gt;b&lt;/samp&gt; option is not permitted; this is because GNU makes no
14281 distinction between text and binary files. Also, &lt;CODE&gt;"w"&lt;/CODE&gt; and
14282 &lt;CODE&gt;"w+"&lt;/CODE&gt; do not cause truncation of the file; these have an effect only
14283 when opening a file, and in this case the file has already been opened.
14284 You must make sure that the &lt;VAR&gt;opentype&lt;/VAR&gt; argument matches the actual
14285 mode of the open file descriptor.
14286 &lt;br&gt;&lt;br&gt; The return value is the new stream. If the stream cannot be created
14287 (for example, if the modes for the file indicated by the file descriptor
14288 do not permit the access specified by the &lt;VAR&gt;opentype&lt;/VAR&gt; argument), a
14289 null pointer is returned instead.
14290 &lt;br&gt;&lt;br&gt; In some other systems, &lt;CODE&gt;fdopen&lt;/CODE&gt; may fail to detect that the modes
14291 for file descriptor do not permit the access specified by
14292 &lt;CODE&gt;opentype&lt;/CODE&gt;. The GNU C library always checks for this.
14293 </synopsis>
14294 </function>
14295 </construct>
14296 <construct id="function-fileno" type="function">
14297 <function returntype="int">
14298 <prototype>
14299 <parameter content="FILE *stream"/>
14300 </prototype>
14301 <headers>
14302 <header filename = "stdio.h"/>
14303 </headers>
14304 <synopsis>
14305 This function returns the file descriptor associated with the stream
14306 &lt;VAR&gt;stream&lt;/VAR&gt;. If an error is detected (for example, if the &lt;VAR&gt;stream&lt;/VAR&gt;
14307 is not valid) or if &lt;VAR&gt;stream&lt;/VAR&gt; does not do I/O to a file,
14308 &lt;CODE&gt;fileno&lt;/CODE&gt; returns -1.
14309 </synopsis>
14310 </function>
14311 </construct>
14312 <construct id="function-fileno_unlocked" type="function">
14313 <function returntype="int">
14314 <prototype>
14315 <parameter content="FILE *stream"/>
14316 </prototype>
14317 <headers>
14318 <header filename = "stdio.h"/>
14319 </headers>
14320 <synopsis>
14321 The &lt;CODE&gt;fileno_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;fileno&lt;/CODE&gt;
14322 function except that it does not implicitly lock the stream if the state
14323 is &lt;CODE&gt;FSETLOCKING_INTERNAL&lt;/CODE&gt;.
14324 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
14325 </synopsis>
14326 </function>
14327 </construct>
14328 <construct id="function-fclean" type="function">
14329 <function returntype="int">
14330 <prototype>
14331 <parameter content="FILE *stream"/>
14332 </prototype>
14333 <headers>
14334 <header filename = "unistd.h"/>
14335 <header filename = "stdio.h"/>
14336 </headers>
14337 <synopsis>
14338 Clean up the stream &lt;VAR&gt;stream&lt;/VAR&gt; so that its buffer is empty. If
14339 &lt;VAR&gt;stream&lt;/VAR&gt; is doing output, force it out. If &lt;VAR&gt;stream&lt;/VAR&gt; is doing
14340 input, give the data in the buffer back to the system, arranging to
14341 reread it.
14342 </synopsis>
14343 </function>
14344 </construct>
14345 <construct id="struct-iovec" type="struct">
14346 <structure>
14347 <synopsis>
14348 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;iovec&lt;/CODE&gt; structure describes a buffer. It contains two fields:
14349 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt;
14350 </synopsis>
14351 <elements>
14352 <element content="void *iov_base">
14353 <synopsis>
14354 Contains the address of a buffer.
14355 &lt;br&gt;&lt;br&gt;
14356 </synopsis>
14357 </element>
14358 </elements>
14359 </structure>
14360 </construct>
14361 <construct id="function-readv" type="function">
14362 <function returntype="ssize_t">
14363 <prototype>
14364 <parameter content="int filedes"/>
14365 <parameter content="const struct iovec *vector"/>
14366 <parameter content="int count"/>
14367 </prototype>
14368 <headers>
14369 <header filename = "sys/uio.h"/>
14370 </headers>
14371 <synopsis>
14372 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;readv&lt;/CODE&gt; function reads data from &lt;VAR&gt;filedes&lt;/VAR&gt; and scatters it
14373 into the buffers described in &lt;VAR&gt;vector&lt;/VAR&gt;, which is taken to be
14374 &lt;VAR&gt;count&lt;/VAR&gt; structures long. As each buffer is filled, data is sent to the
14375 next.
14376 &lt;br&gt;&lt;br&gt; Note that &lt;CODE&gt;readv&lt;/CODE&gt; is not guaranteed to fill all the buffers.
14377 It may stop at any point, for the same reasons &lt;CODE&gt;read&lt;/CODE&gt; would.
14378 &lt;br&gt;&lt;br&gt; The return value is a count of bytes (&lt;EM&gt;not&lt;/EM&gt; buffers) read, 0
14379 indicating end-of-file, or -1 indicating an error. The possible
14380 errors are the same as in &lt;CODE&gt;read&lt;/CODE&gt;.
14381 &lt;br&gt;&lt;br&gt;
14382 </synopsis>
14383 </function>
14384 </construct>
14385 <construct id="function-writev" type="function">
14386 <function returntype="ssize_t">
14387 <prototype>
14388 <parameter content="int filedes"/>
14389 <parameter content="const struct iovec *vector"/>
14390 <parameter content="int count"/>
14391 </prototype>
14392 <headers>
14393 <header filename = "sys/uio.h"/>
14394 </headers>
14395 <synopsis>
14396 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;writev&lt;/CODE&gt; function gathers data from the buffers described in
14397 &lt;VAR&gt;vector&lt;/VAR&gt;, which is taken to be &lt;VAR&gt;count&lt;/VAR&gt; structures long, and writes
14398 them to &lt;CODE&gt;filedes&lt;/CODE&gt;. As each buffer is written, it moves on to the
14399 next.
14400 &lt;br&gt;&lt;br&gt; Like &lt;CODE&gt;readv&lt;/CODE&gt;, &lt;CODE&gt;writev&lt;/CODE&gt; may stop midstream under the same
14401 conditions &lt;CODE&gt;write&lt;/CODE&gt; would.
14402 &lt;br&gt;&lt;br&gt; The return value is a count of bytes written, or -1 indicating an
14403 error. The possible errors are the same as in &lt;CODE&gt;write&lt;/CODE&gt;.
14404 &lt;br&gt;&lt;br&gt;
14405 </synopsis>
14406 </function>
14407 </construct>
14408 <construct id="function-mmap" type="function">
14409 <function returntype="void *">
14410 <prototype>
14411 <parameter content="void *address"/>
14412 <parameter content="size_t length,int protect"/>
14413 <parameter content="int flags"/>
14414 <parameter content="int filedes"/>
14415 <parameter content="off_t offset"/>
14416 </prototype>
14417 <headers>
14418 <header filename = "sys/mman.h"/>
14419 </headers>
14420 <synopsis>
14421 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;mmap&lt;/CODE&gt; function creates a new mapping, connected to bytes
14422 (&lt;VAR&gt;offset&lt;/VAR&gt;) to (&lt;VAR&gt;offset&lt;/VAR&gt; + &lt;VAR&gt;length&lt;/VAR&gt; - 1) in the file open on
14423 &lt;VAR&gt;filedes&lt;/VAR&gt;. A new reference for the file specified by &lt;VAR&gt;filedes&lt;/VAR&gt;
14424 is created, which is not removed by closing the file.
14425 &lt;br&gt;&lt;br&gt; &lt;VAR&gt;address&lt;/VAR&gt; gives a preferred starting address for the mapping.
14426 &lt;CODE&gt;NULL&lt;/CODE&gt; expresses no preference. Any previous mapping at that
14427 address is automatically removed. The address you give may still be
14428 changed, unless you use the &lt;CODE&gt;MAP_FIXED&lt;/CODE&gt; flag.
14429 &lt;br&gt;&lt;br&gt;
14430
14431
14432 &lt;VAR&gt;protect&lt;/VAR&gt; contains flags that control what kind of access is
14433 permitted. They include &lt;CODE&gt;PROT_READ&lt;/CODE&gt;, &lt;CODE&gt;PROT_WRITE&lt;/CODE&gt;, and
14434 &lt;CODE&gt;PROT_EXEC&lt;/CODE&gt;, which permit reading, writing, and execution,
14435 respectively. Inappropriate access will cause a segfault .
14436 &lt;br&gt;&lt;br&gt; Note that most hardware designs cannot support write permission without
14437 read permission, and many do not distinguish read and execute permission.
14438 Thus, you may receive wider permissions than you ask for, and mappings of
14439 write-only files may be denied even if you do not use &lt;CODE&gt;PROT_READ&lt;/CODE&gt;.
14440 &lt;br&gt;&lt;br&gt; &lt;VAR&gt;flags&lt;/VAR&gt; contains flags that control the nature of the map.
14441 One of &lt;CODE&gt;MAP_SHARED&lt;/CODE&gt; or &lt;CODE&gt;MAP_PRIVATE&lt;/CODE&gt; must be specified.
14442 &lt;br&gt;&lt;br&gt; They include:
14443 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
14444
14445 &lt;DT&gt;&lt;CODE&gt;MAP_PRIVATE&lt;/CODE&gt;
14446 &lt;DD&gt;
14447 This specifies that writes to the region should never be written back
14448 to the attached file. Instead, a copy is made for the process, and the
14449 region will be swapped normally if memory runs low. No other process will
14450 see the changes.
14451 &lt;br&gt;&lt;br&gt; Since private mappings effectively revert to ordinary memory
14452 when written to, you must have enough virtual memory for a copy of
14453 the entire mmapped region if you use this mode with &lt;CODE&gt;PROT_WRITE&lt;/CODE&gt;.
14454 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;MAP_SHARED&lt;/CODE&gt;
14455 &lt;DD&gt;
14456 This specifies that writes to the region will be written back to the
14457 file. Changes made will be shared immediately with other processes
14458 mmaping the same file.
14459 &lt;br&gt;&lt;br&gt; Note that actual writing may take place at any time. You need to use
14460 &lt;CODE&gt;msync&lt;/CODE&gt;, described below, if it is important that other processes
14461 using conventional I/O get a consistent view of the file.
14462 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;MAP_FIXED&lt;/CODE&gt;
14463 &lt;DD&gt;
14464 This forces the system to use the exact mapping address specified in
14465 &lt;VAR&gt;address&lt;/VAR&gt; and fail if it can't.
14466 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;MAP_ANONYMOUS&lt;/CODE&gt;
14467 &lt;DD&gt;
14468 &lt;LI&gt;x MAP_ANON
14469 This flag tells the system to create an anonymous mapping, not connected
14470 to a file. &lt;VAR&gt;filedes&lt;/VAR&gt; and &lt;VAR&gt;off&lt;/VAR&gt; are ignored, and the region is
14471 initialized with zeros.
14472 &lt;br&gt;&lt;br&gt; Anonymous maps are used as the basic primitive to extend the heap on some
14473 systems. They are also useful to share data between multiple tasks
14474 without creating a file.
14475 &lt;br&gt;&lt;br&gt; On some systems using private anonymous mmaps is more efficient than using
14476 &lt;CODE&gt;malloc&lt;/CODE&gt; for large blocks. This is not an issue with the GNU C library,
14477 as the included &lt;CODE&gt;malloc&lt;/CODE&gt; automatically uses &lt;CODE&gt;mmap&lt;/CODE&gt; where appropriate.
14478 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt; &lt;/DL&gt;
14479 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;mmap&lt;/CODE&gt; returns the address of the new mapping, or -1 for an
14480 error.
14481 &lt;br&gt;&lt;br&gt; Possible errors include:
14482 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
14483
14484 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
14485 &lt;DD&gt;
14486 &lt;br&gt;&lt;br&gt; Either &lt;VAR&gt;address&lt;/VAR&gt; was unusable, or inconsistent &lt;VAR&gt;flags&lt;/VAR&gt; were
14487 given.
14488 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EACCES
14489 &lt;br&gt;&lt;br&gt; &lt;VAR&gt;filedes&lt;/VAR&gt; was not open for the type of access specified in &lt;VAR&gt;protect&lt;/VAR&gt;.
14490 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOMEM
14491 &lt;br&gt;&lt;br&gt; Either there is not enough memory for the operation, or the process is
14492 out of address space.
14493 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENODEV
14494 &lt;br&gt;&lt;br&gt; This file is of a type that doesn't support mapping.
14495 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOEXEC
14496 &lt;br&gt;&lt;br&gt; The file is on a filesystem that doesn't support mapping.
14497 &lt;br&gt;&lt;br&gt;
14498 &lt;br&gt;&lt;br&gt;
14499 &lt;br&gt;&lt;br&gt;
14500 </synopsis>
14501 </function>
14502 </construct>
14503 <construct id="function-mmap64" type="function">
14504 <function returntype="void *">
14505 <prototype>
14506 <parameter content="void *address"/>
14507 <parameter content="size_t length,int protect"/>
14508 <parameter content="int flags"/>
14509 <parameter content="int filedes"/>
14510 <parameter content="off64_t offset"/>
14511 </prototype>
14512 <headers>
14513 <header filename = "sys/mman.h"/>
14514 </headers>
14515 <synopsis>
14516 The &lt;CODE&gt;mmap64&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;mmap&lt;/CODE&gt; function but
14517 the &lt;VAR&gt;offset&lt;/VAR&gt; parameter is of type &lt;CODE&gt;off64_t&lt;/CODE&gt;. On 32-bit systems
14518 this allows the file associated with the &lt;VAR&gt;filedes&lt;/VAR&gt; descriptor to be
14519 larger than 2GB. &lt;VAR&gt;filedes&lt;/VAR&gt; must be a descriptor returned from a
14520 call to &lt;CODE&gt;open64&lt;/CODE&gt; or &lt;CODE&gt;fopen64&lt;/CODE&gt; and &lt;CODE&gt;freopen64&lt;/CODE&gt; where the
14521 descriptor is retrieved with &lt;CODE&gt;fileno&lt;/CODE&gt;.
14522 &lt;br&gt;&lt;br&gt; When the sources are translated with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
14523 function is actually available under the name &lt;CODE&gt;mmap&lt;/CODE&gt;. I.e., the
14524 new, extended API using 64 bit file sizes and offsets transparently
14525 replaces the old API.
14526 </synopsis>
14527 </function>
14528 </construct>
14529 <construct id="function-munmap" type="function">
14530 <function returntype="int">
14531 <prototype>
14532 <parameter content="void *addr"/>
14533 <parameter content="size_t length"/>
14534 </prototype>
14535 <headers>
14536 <header filename = "sys/mman.h"/>
14537 </headers>
14538 <synopsis>
14539 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;munmap&lt;/CODE&gt; removes any memory maps from (&lt;VAR&gt;addr&lt;/VAR&gt;) to (&lt;VAR&gt;addr&lt;/VAR&gt; +
14540 &lt;VAR&gt;length&lt;/VAR&gt;). &lt;VAR&gt;length&lt;/VAR&gt; should be the length of the mapping.
14541 &lt;br&gt;&lt;br&gt; It is safe to unmap multiple mappings in one command, or include unmapped
14542 space in the range. It is also possible to unmap only part of an existing
14543 mapping. However, only entire pages can be removed. If &lt;VAR&gt;length&lt;/VAR&gt; is not
14544 an even number of pages, it will be rounded up.
14545 &lt;br&gt;&lt;br&gt; It returns 0 for success and -1 for an error.
14546 &lt;br&gt;&lt;br&gt; One error is possible:
14547 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
14548
14549 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
14550 &lt;DD&gt;
14551 The memory range given was outside the user mmap range or wasn't page
14552 aligned.
14553 &lt;br&gt;&lt;br&gt;
14554 &lt;br&gt;&lt;br&gt;
14555 </synopsis>
14556 </function>
14557 </construct>
14558 <construct id="function-msync" type="function">
14559 <function returntype="int">
14560 <prototype>
14561 <parameter content="void *address"/>
14562 <parameter content="size_t length"/>
14563 <parameter content="int flags"/>
14564 </prototype>
14565 <headers>
14566 <header filename = "sys/mman.h"/>
14567 </headers>
14568 <synopsis>
14569 &lt;br&gt;&lt;br&gt; When using shared mappings, the kernel can write the file at any time
14570 before the mapping is removed. To be certain data has actually been
14571 written to the file and will be accessible to non-memory-mapped I/O, it
14572 is necessary to use this function.
14573 &lt;br&gt;&lt;br&gt; It operates on the region &lt;VAR&gt;address&lt;/VAR&gt; to (&lt;VAR&gt;address&lt;/VAR&gt; + &lt;VAR&gt;length&lt;/VAR&gt;).
14574 It may be used on part of a mapping or multiple mappings, however the
14575 region given should not contain any unmapped space.
14576 &lt;br&gt;&lt;br&gt; &lt;VAR&gt;flags&lt;/VAR&gt; can contain some options:
14577 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
14578
14579 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;MS_SYNC&lt;/CODE&gt;
14580 &lt;DD&gt;
14581 &lt;br&gt;&lt;br&gt; This flag makes sure the data is actually written &lt;EM&gt;to disk&lt;/EM&gt;.
14582 Normally &lt;CODE&gt;msync&lt;/CODE&gt; only makes sure that accesses to a file with
14583 conventional I/O reflect the recent changes.
14584 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;MS_ASYNC&lt;/CODE&gt;
14585 &lt;DD&gt;
14586 &lt;br&gt;&lt;br&gt; This tells &lt;CODE&gt;msync&lt;/CODE&gt; to begin the synchronization, but not to wait for
14587 it to complete.
14588 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt; &lt;/DL&gt;
14589 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;msync&lt;/CODE&gt; returns 0 for success and -1 for
14590 error. Errors include:
14591 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
14592
14593 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
14594 &lt;DD&gt;
14595 An invalid region was given, or the &lt;VAR&gt;flags&lt;/VAR&gt; were invalid.
14596 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EFAULT
14597 There is no existing mapping in at least part of the given region.
14598 &lt;br&gt;&lt;br&gt;
14599 &lt;br&gt;&lt;br&gt;
14600 </synopsis>
14601 </function>
14602 </construct>
14603 <construct id="function-mremap" type="function">
14604 <function returntype="void *">
14605 <prototype>
14606 <parameter content="void *address"/>
14607 <parameter content="size_t length"/>
14608 <parameter content="size_t new_length"/>
14609 <parameter content="int flag"/>
14610 </prototype>
14611 <headers>
14612 <header filename = "sys/mman.h"/>
14613 </headers>
14614 <synopsis>
14615 &lt;br&gt;&lt;br&gt; This function can be used to change the size of an existing memory
14616 area. &lt;VAR&gt;address&lt;/VAR&gt; and &lt;VAR&gt;length&lt;/VAR&gt; must cover a region entirely mapped
14617 in the same &lt;CODE&gt;mmap&lt;/CODE&gt; statement. A new mapping with the same
14618 characteristics will be returned with the length &lt;VAR&gt;new_length&lt;/VAR&gt;.
14619 &lt;br&gt;&lt;br&gt; One option is possible, &lt;CODE&gt;MREMAP_MAYMOVE&lt;/CODE&gt;. If it is given in
14620 &lt;VAR&gt;flags&lt;/VAR&gt;, the system may remove the existing mapping and create a new
14621 one of the desired length in another location.
14622 &lt;br&gt;&lt;br&gt; The address of the resulting mapping is returned, or -1. Possible
14623 error codes include:
14624 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
14625
14626 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;EFAULT&lt;/CODE&gt;
14627 &lt;DD&gt;
14628 There is no existing mapping in at least part of the original region, or
14629 the region covers two or more distinct mappings.
14630 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
14631 The address given is misaligned or inappropriate.
14632 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EAGAIN
14633 The region has pages locked, and if extended it would exceed the
14634 process's resource limit for locked pages. .
14635 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOMEM
14636 The region is private writable, and insufficient virtual memory is
14637 available to extend it. Also, this error will occur if
14638 &lt;CODE&gt;MREMAP_MAYMOVE&lt;/CODE&gt; is not given and the extension would collide with
14639 another mapped region.
14640 &lt;br&gt;&lt;br&gt;
14641 </synopsis>
14642 </function>
14643 </construct>
14644 <construct id="function-madvise" type="function">
14645 <function returntype="int">
14646 <prototype>
14647 <parameter content="void *addr"/>
14648 <parameter content="size_t length"/>
14649 <parameter content="int advice"/>
14650 </prototype>
14651 <headers>
14652 <header filename = "sys/mman.h"/>
14653 </headers>
14654 <synopsis>
14655 &lt;br&gt;&lt;br&gt; This function can be used to provide the system with &lt;VAR&gt;advice&lt;/VAR&gt; about
14656 the intended usage patterns of the memory region starting at &lt;VAR&gt;addr&lt;/VAR&gt;
14657 and extending &lt;VAR&gt;length&lt;/VAR&gt; bytes.
14658 &lt;br&gt;&lt;br&gt; The valid BSD values for &lt;VAR&gt;advice&lt;/VAR&gt; are:
14659 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
14660
14661 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;MADV_NORMAL&lt;/CODE&gt;
14662 &lt;DD&gt;
14663 The region should receive no further special treatment.
14664 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;MADV_RANDOM&lt;/CODE&gt;
14665 &lt;DD&gt;
14666 The region will be accessed via random page references. The kernel
14667 should page-in the minimal number of pages for each page fault.
14668 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;MADV_SEQUENTIAL&lt;/CODE&gt;
14669 &lt;DD&gt;
14670 The region will be accessed via sequential page references. This
14671 may cause the kernel to aggressively read-ahead, expecting further
14672 sequential references after any page fault within this region.
14673 &lt;br&gt;&lt;br&gt; &lt;LI&gt; MADV_WILLNEED
14674 The region will be needed. The pages within this region may
14675 be pre-faulted in by the kernel.
14676 &lt;br&gt;&lt;br&gt; &lt;LI&gt; MADV_DONTNEED
14677 The region is no longer needed. The kernel may free these pages,
14678 causing any changes to the pages to be lost, as well as swapped
14679 out pages to be discarded.
14680 &lt;br&gt;&lt;br&gt;
14681 &lt;br&gt;&lt;br&gt; The POSIX names are slightly different, but with the same meanings:
14682 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
14683
14684 &lt;br&gt;&lt;br&gt; &lt;LI&gt; POSIX_MADV_NORMAL
14685 This corresponds with BSD's &lt;CODE&gt;MADV_NORMAL&lt;/CODE&gt;.
14686 &lt;br&gt;&lt;br&gt; &lt;LI&gt; POSIX_MADV_RANDOM
14687 This corresponds with BSD's &lt;CODE&gt;MADV_RANDOM&lt;/CODE&gt;.
14688 &lt;br&gt;&lt;br&gt; &lt;LI&gt; POSIX_MADV_SEQUENTIAL
14689 This corresponds with BSD's &lt;CODE&gt;MADV_SEQUENTIAL&lt;/CODE&gt;.
14690 &lt;br&gt;&lt;br&gt; &lt;LI&gt; POSIX_MADV_WILLNEED
14691 This corresponds with BSD's &lt;CODE&gt;MADV_WILLNEED&lt;/CODE&gt;.
14692 &lt;br&gt;&lt;br&gt; &lt;LI&gt; POSIX_MADV_DONTNEED
14693 This corresponds with BSD's &lt;CODE&gt;MADV_DONTNEED&lt;/CODE&gt;.
14694 &lt;br&gt;&lt;br&gt;
14695 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;msync&lt;/CODE&gt; returns 0 for success and -1 for
14696 error. Errors include:
14697 &lt;DL&gt;
14698
14699 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
14700 An invalid region was given, or the &lt;VAR&gt;advice&lt;/VAR&gt; was invalid.
14701 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EFAULT
14702 There is no existing mapping in at least part of the given region.
14703 &lt;br&gt;&lt;br&gt;
14704 </synopsis>
14705 </function>
14706 </construct>
14707 <construct id="dtype-fd_set" type="dtype">
14708 <structure>
14709 </structure>
14710 </construct>
14711 <construct id="function-select" type="function">
14712 <function returntype="int">
14713 <prototype>
14714 <parameter content="int nfds"/>
14715 <parameter content="fd_set *read-fds"/>
14716 <parameter content="fd_set *write-fds"/>
14717 <parameter content="fd_set *except-fds"/>
14718 <parameter content="struct timeval *timeout"/>
14719 </prototype>
14720 <headers>
14721 <header filename = "sys/types.h"/>
14722 </headers>
14723 <synopsis>
14724 The &lt;CODE&gt;select&lt;/CODE&gt; function blocks the calling process until there is
14725 activity on any of the specified sets of file descriptors, or until the
14726 timeout period has expired.
14727 &lt;br&gt;&lt;br&gt; The file descriptors specified by the &lt;VAR&gt;read-fds&lt;/VAR&gt; argument are
14728 checked to see if they are ready for reading; the &lt;VAR&gt;write-fds&lt;/VAR&gt; file
14729 descriptors are checked to see if they are ready for writing; and the
14730 &lt;VAR&gt;except-fds&lt;/VAR&gt; file descriptors are checked for exceptional
14731 conditions. You can pass a null pointer for any of these arguments if
14732 you are not interested in checking for that kind of condition.
14733 &lt;br&gt;&lt;br&gt; A file descriptor is considered ready for reading if a &lt;CODE&gt;read&lt;/CODE&gt;
14734 call will not block. This usually includes the read offset being at
14735 the end of the file or there is an error to report. A server socket
14736 is considered ready for reading if there is a pending connection which
14737 can be accepted with &lt;CODE&gt;accept&lt;/CODE&gt;; . A
14738 client socket is ready for writing when its connection is fully
14739 established; .
14740 &lt;br&gt;&lt;br&gt; ``Exceptional conditions'' does not mean errors---errors are reported
14741 immediately when an erroneous system call is executed, and do not
14742 constitute a state of the descriptor. Rather, they include conditions
14743 such as the presence of an urgent message on a socket. (,
14744 for information on urgent messages.)
14745 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;select&lt;/CODE&gt; function checks only the first &lt;VAR&gt;nfds&lt;/VAR&gt; file
14746 descriptors. The usual thing is to pass &lt;CODE&gt;FD_SETSIZE&lt;/CODE&gt; as the value
14747 of this argument.
14748 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;timeout&lt;/VAR&gt; specifies the maximum time to wait. If you pass a
14749 null pointer for this argument, it means to block indefinitely until one
14750 of the file descriptors is ready. Otherwise, you should provide the
14751 time in &lt;CODE&gt;struct timeval&lt;/CODE&gt; format; see High-Resolution
14752 Calendar. Specify zero as the time (a &lt;CODE&gt;struct timeval&lt;/CODE&gt; containing
14753 all zeros) if you want to find out which descriptors are ready without
14754 waiting if none are ready.
14755 &lt;br&gt;&lt;br&gt; The normal return value from &lt;CODE&gt;select&lt;/CODE&gt; is the total number of ready file
14756 descriptors in all of the sets. Each of the argument sets is overwritten
14757 with information about the descriptors that are ready for the corresponding
14758 operation. Thus, to see if a particular descriptor &lt;VAR&gt;desc&lt;/VAR&gt; has input,
14759 use &lt;CODE&gt;FD_ISSET (&lt;VAR&gt;desc&lt;/VAR&gt;, &lt;VAR&gt;read-fds&lt;/VAR&gt;)&lt;/CODE&gt; after &lt;CODE&gt;select&lt;/CODE&gt; returns.
14760 &lt;br&gt;&lt;br&gt; If &lt;CODE&gt;select&lt;/CODE&gt; returns because the timeout period expires, it returns
14761 a value of zero.
14762 &lt;br&gt;&lt;br&gt; Any signal will cause &lt;CODE&gt;select&lt;/CODE&gt; to return immediately. So if your
14763 program uses signals, you can't rely on &lt;CODE&gt;select&lt;/CODE&gt; to keep waiting
14764 for the full time specified. If you want to be sure of waiting for a
14765 particular amount of time, you must check for &lt;CODE&gt;EINTR&lt;/CODE&gt; and repeat
14766 the &lt;CODE&gt;select&lt;/CODE&gt; with a newly calculated timeout based on the current
14767 time. See the example below. See also Interrupted Primitives.
14768 &lt;br&gt;&lt;br&gt; If an error occurs, &lt;CODE&gt;select&lt;/CODE&gt; returns &lt;CODE&gt;-1&lt;/CODE&gt; and does not modify
14769 the argument file descriptor sets. The following &lt;CODE&gt;errno&lt;/CODE&gt; error
14770 conditions are defined for this function:
14771 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
14772
14773 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
14774 &lt;DD&gt;
14775 One of the file descriptor sets specified an invalid file descriptor.
14776 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINTR
14777 The operation was interrupted by a signal. .
14778 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
14779 The &lt;VAR&gt;timeout&lt;/VAR&gt; argument is invalid; one of the components is negative
14780 or too large.
14781
14782 </synopsis>
14783 </function>
14784 </construct>
14785 <construct id="function-sync" type="function">
14786 <function returntype="int">
14787 <prototype>
14788 <parameter content="void"/>
14789 </prototype>
14790 <headers>
14791 <header filename = "unistd.h"/>
14792 </headers>
14793 <synopsis>
14794 A call to this function will not return as long as there is data which
14795 has not been written to the device. All dirty buffers in the kernel will
14796 be written and so an overall consistent system can be achieved (if no
14797 other process in parallel writes data).
14798 &lt;br&gt;&lt;br&gt; A prototype for &lt;CODE&gt;sync&lt;/CODE&gt; can be found in &lt;TT&gt;unistd.h&lt;/TT&gt;.
14799 &lt;br&gt;&lt;br&gt; The return value is zero to indicate no error.
14800 </synopsis>
14801 </function>
14802 </construct>
14803 <construct id="function-fsync" type="function">
14804 <function returntype="int">
14805 <prototype>
14806 <parameter content="int fildes"/>
14807 </prototype>
14808 <headers>
14809 <header filename = "unistd.h"/>
14810 </headers>
14811 <synopsis>
14812 The &lt;CODE&gt;fsync&lt;/CODE&gt; function can be used to make sure all data associated with
14813 the open file &lt;VAR&gt;fildes&lt;/VAR&gt; is written to the device associated with the
14814 descriptor. The function call does not return unless all actions have
14815 finished.
14816 &lt;br&gt;&lt;br&gt; A prototype for &lt;CODE&gt;fsync&lt;/CODE&gt; can be found in &lt;TT&gt;unistd.h&lt;/TT&gt;.
14817 &lt;br&gt;&lt;br&gt; This function is a cancellation point in multi-threaded programs. This
14818 is a problem if the thread allocates some resources (like memory, file
14819 descriptors, semaphores or whatever) at the time &lt;CODE&gt;fsync&lt;/CODE&gt; is
14820 called. If the thread gets canceled these resources stay allocated
14821 until the program ends. To avoid this, calls to &lt;CODE&gt;fsync&lt;/CODE&gt; should be
14822 protected using cancellation handlers.
14823 &lt;br&gt;&lt;br&gt; The return value of the function is zero if no error occurred. Otherwise
14824 it is -1 and the global variable &lt;VAR&gt;errno&lt;/VAR&gt; is set to the
14825 following values:
14826 &lt;DL&gt;
14827
14828 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
14829 &lt;DD&gt;
14830 The descriptor &lt;VAR&gt;fildes&lt;/VAR&gt; is not valid.
14831 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
14832 No synchronization is possible since the system does not implement this.
14833
14834 </synopsis>
14835 </function>
14836 </construct>
14837 <construct id="function-fdatasync" type="function">
14838 <function returntype="int">
14839 <prototype>
14840 <parameter content="int fildes"/>
14841 </prototype>
14842 <headers>
14843 <header filename = "unistd.h"/>
14844 </headers>
14845 <synopsis>
14846 When a call to the &lt;CODE&gt;fdatasync&lt;/CODE&gt; function returns, it is ensured
14847 that all of the file data is written to the device. For all pending I/O
14848 operations, the parts guaranteeing data integrity finished.
14849 &lt;br&gt;&lt;br&gt; Not all systems implement the &lt;CODE&gt;fdatasync&lt;/CODE&gt; operation. On systems
14850 missing this functionality &lt;CODE&gt;fdatasync&lt;/CODE&gt; is emulated by a call to
14851 &lt;CODE&gt;fsync&lt;/CODE&gt; since the performed actions are a superset of those
14852 required by &lt;CODE&gt;fdatasync&lt;/CODE&gt;.
14853 &lt;br&gt;&lt;br&gt; The prototype for &lt;CODE&gt;fdatasync&lt;/CODE&gt; is in &lt;TT&gt;unistd.h&lt;/TT&gt;.
14854 &lt;br&gt;&lt;br&gt; The return value of the function is zero if no error occurred. Otherwise
14855 it is -1 and the global variable &lt;VAR&gt;errno&lt;/VAR&gt; is set to the
14856 following values:
14857 &lt;DL&gt;
14858
14859 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
14860 &lt;DD&gt;
14861 The descriptor &lt;VAR&gt;fildes&lt;/VAR&gt; is not valid.
14862 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
14863 No synchronization is possible since the system does not implement this.
14864
14865 </synopsis>
14866 </function>
14867 </construct>
14868 <construct id="struct-aiocb" type="struct">
14869 <structure>
14870 <synopsis>
14871 The POSIX.1b standard mandates that the &lt;CODE&gt;struct aiocb&lt;/CODE&gt; structure
14872 contains at least the members described in the following table. There
14873 might be more elements which are used by the implementation, but
14874 depending upon these elements is not portable and is highly deprecated.
14875 &lt;br&gt;&lt;br&gt;
14876 </synopsis>
14877 <elements>
14878 <element content="int aio_fildes">
14879 <synopsis>
14880 This element specifies the file descriptor to be used for the
14881 operation. It must be a legal descriptor, otherwise the operation will
14882 fail.
14883 &lt;br&gt;&lt;br&gt; The device on which the file is opened must allow the seek operation.
14884 I.e., it is not possible to use any of the AIO operations on devices
14885 like terminals where an &lt;CODE&gt;lseek&lt;/CODE&gt; call would lead to an error.
14886 &lt;br&gt;&lt;br&gt;
14887 </synopsis>
14888 </element>
14889 <element content="off_t aio_offset">
14890 <synopsis>
14891 This element specifies the offset in the file at which the operation (input
14892 or output) is performed. Since the operations are carried out in arbitrary
14893 order and more than one operation for one file descriptor can be
14894 started, one cannot expect a current read/write position of the file
14895 descriptor.
14896 &lt;br&gt;&lt;br&gt;
14897 </synopsis>
14898 </element>
14899 <element content="volatile void *aio_buf">
14900 <synopsis>
14901 This is a pointer to the buffer with the data to be written or the place
14902 where the read data is stored.
14903 &lt;br&gt;&lt;br&gt;
14904 </synopsis>
14905 </element>
14906 <element content="size_t aio_nbytes">
14907 <synopsis>
14908 This element specifies the length of the buffer pointed to by &lt;CODE&gt;aio_buf&lt;/CODE&gt;.
14909 &lt;br&gt;&lt;br&gt;
14910 </synopsis>
14911 </element>
14912 <element content="int aio_reqprio">
14913 <synopsis>
14914 If the platform has defined &lt;CODE&gt;_POSIX_PRIORITIZED_IO&lt;/CODE&gt; and
14915 &lt;CODE&gt;_POSIX_PRIORITY_SCHEDULING&lt;/CODE&gt;, the AIO requests are
14916 processed based on the current scheduling priority. The
14917 &lt;CODE&gt;aio_reqprio&lt;/CODE&gt; element can then be used to lower the priority of the
14918 AIO operation.
14919 &lt;br&gt;&lt;br&gt;
14920 </synopsis>
14921 </element>
14922 <element content="struct sigevent aio_sigevent">
14923 <synopsis>
14924 This element specifies how the calling process is notified once the
14925 operation terminates. If the &lt;CODE&gt;sigev_notify&lt;/CODE&gt; element is
14926 &lt;CODE&gt;SIGEV_NONE&lt;/CODE&gt;, no notification is sent. If it is &lt;CODE&gt;SIGEV_SIGNAL&lt;/CODE&gt;,
14927 the signal determined by &lt;CODE&gt;sigev_signo&lt;/CODE&gt; is sent. Otherwise,
14928 &lt;CODE&gt;sigev_notify&lt;/CODE&gt; must be &lt;CODE&gt;SIGEV_THREAD&lt;/CODE&gt;. In this case, a thread
14929 is created which starts executing the function pointed to by
14930 &lt;CODE&gt;sigev_notify_function&lt;/CODE&gt;.
14931 &lt;br&gt;&lt;br&gt;
14932 </synopsis>
14933 </element>
14934 <element content="int aio_lio_opcode">
14935 <synopsis>
14936 This element is only used by the &lt;CODE&gt;lio_listio&lt;/CODE&gt; and
14937 &lt;CODE&gt;lio_listio64&lt;/CODE&gt; functions. Since these functions allow an
14938 arbitrary number of operations to start at once, and each operation can be
14939 input or output (or nothing), the information must be stored in the
14940 control block. The possible values are:
14941 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
14942
14943 </synopsis>
14944 </element>
14945 <element content="LIO_READ">
14946 <synopsis>
14947 Start a read operation. Read from the file at position
14948 &lt;CODE&gt;aio_offset&lt;/CODE&gt; and store the next &lt;CODE&gt;aio_nbytes&lt;/CODE&gt; bytes in the
14949 buffer pointed to by &lt;CODE&gt;aio_buf&lt;/CODE&gt;.
14950 &lt;br&gt;&lt;br&gt;
14951 </synopsis>
14952 </element>
14953 <element content="LIO_WRITE">
14954 <synopsis>
14955 Start a write operation. Write &lt;CODE&gt;aio_nbytes&lt;/CODE&gt; bytes starting at
14956 &lt;CODE&gt;aio_buf&lt;/CODE&gt; into the file starting at position &lt;CODE&gt;aio_offset&lt;/CODE&gt;.
14957 &lt;br&gt;&lt;br&gt;
14958 </synopsis>
14959 </element>
14960 </elements>
14961 </structure>
14962 </construct>
14963 <construct id="struct-aiocb64" type="struct">
14964 <structure>
14965 <elements>
14966 <element content="int aio_fildes">
14967 <synopsis>
14968 This element specifies the file descriptor which is used for the
14969 operation. It must be a legal descriptor since otherwise the operation
14970 fails for obvious reasons.
14971 &lt;br&gt;&lt;br&gt; The device on which the file is opened must allow the seek operation.
14972 I.e., it is not possible to use any of the AIO operations on devices
14973 like terminals where an &lt;CODE&gt;lseek&lt;/CODE&gt; call would lead to an error.
14974 &lt;br&gt;&lt;br&gt;
14975 </synopsis>
14976 </element>
14977 <element content="off64_t aio_offset">
14978 <synopsis>
14979 This element specifies at which offset in the file the operation (input
14980 or output) is performed. Since the operation are carried in arbitrary
14981 order and more than one operation for one file descriptor can be
14982 started, one cannot expect a current read/write position of the file
14983 descriptor.
14984 &lt;br&gt;&lt;br&gt;
14985 </synopsis>
14986 </element>
14987 <element content="volatile void *aio_buf">
14988 <synopsis>
14989 This is a pointer to the buffer with the data to be written or the place
14990 where the read data is stored.
14991 &lt;br&gt;&lt;br&gt;
14992 </synopsis>
14993 </element>
14994 <element content="size_t aio_nbytes">
14995 <synopsis>
14996 This element specifies the length of the buffer pointed to by &lt;CODE&gt;aio_buf&lt;/CODE&gt;.
14997 &lt;br&gt;&lt;br&gt;
14998 </synopsis>
14999 </element>
15000 <element content="int aio_reqprio">
15001 <synopsis>
15002 If for the platform &lt;CODE&gt;_POSIX_PRIORITIZED_IO&lt;/CODE&gt; and
15003 &lt;CODE&gt;_POSIX_PRIORITY_SCHEDULING&lt;/CODE&gt; are defined the AIO requests are
15004 processed based on the current scheduling priority. The
15005 &lt;CODE&gt;aio_reqprio&lt;/CODE&gt; element can then be used to lower the priority of the
15006 AIO operation.
15007 &lt;br&gt;&lt;br&gt;
15008 </synopsis>
15009 </element>
15010 <element content="struct sigevent aio_sigevent">
15011 <synopsis>
15012 This element specifies how the calling process is notified once the
15013 operation terminates. If the &lt;CODE&gt;sigev_notify&lt;/CODE&gt;, element is
15014 &lt;CODE&gt;SIGEV_NONE&lt;/CODE&gt; no notification is sent. If it is &lt;CODE&gt;SIGEV_SIGNAL&lt;/CODE&gt;,
15015 the signal determined by &lt;CODE&gt;sigev_signo&lt;/CODE&gt; is sent. Otherwise,
15016 &lt;CODE&gt;sigev_notify&lt;/CODE&gt; must be &lt;CODE&gt;SIGEV_THREAD&lt;/CODE&gt; in which case a thread
15017 which starts executing the function pointed to by
15018 &lt;CODE&gt;sigev_notify_function&lt;/CODE&gt;.
15019 &lt;br&gt;&lt;br&gt;
15020 </synopsis>
15021 </element>
15022 </elements>
15023 </structure>
15024 </construct>
15025 <construct id="function-aio_read" type="function">
15026 <function returntype="int">
15027 <prototype>
15028 <parameter content="struct aiocb *aiocbp"/>
15029 </prototype>
15030 <headers>
15031 <header filename = "aio.h"/>
15032 </headers>
15033 <synopsis>
15034 This function initiates an asynchronous read operation. It
15035 immediately returns after the operation was enqueued or when an
15036 error was encountered.
15037 &lt;br&gt;&lt;br&gt; The first &lt;CODE&gt;aiocbp-&gt;aio_nbytes&lt;/CODE&gt; bytes of the file for which
15038 &lt;CODE&gt;aiocbp-&gt;aio_fildes&lt;/CODE&gt; is a descriptor are written to the buffer
15039 starting at &lt;CODE&gt;aiocbp-&gt;aio_buf&lt;/CODE&gt;. Reading starts at the absolute
15040 position &lt;CODE&gt;aiocbp-&gt;aio_offset&lt;/CODE&gt; in the file.
15041 &lt;br&gt;&lt;br&gt; If prioritized I/O is supported by the platform the
15042 &lt;CODE&gt;aiocbp-&gt;aio_reqprio&lt;/CODE&gt; value is used to adjust the priority before
15043 the request is actually enqueued.
15044 &lt;br&gt;&lt;br&gt; The calling process is notified about the termination of the read
15045 request according to the &lt;CODE&gt;aiocbp-&gt;aio_sigevent&lt;/CODE&gt; value.
15046 &lt;br&gt;&lt;br&gt; When &lt;CODE&gt;aio_read&lt;/CODE&gt; returns, the return value is zero if no error
15047 occurred that can be found before the process is enqueued. If such an
15048 early error is found, the function returns -1 and sets
15049 &lt;CODE&gt;errno&lt;/CODE&gt; to one of the following values:
15050 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
15051
15052 &lt;DT&gt;&lt;CODE&gt;EAGAIN&lt;/CODE&gt;
15053 &lt;DD&gt;
15054 The request was not enqueued due to (temporarily) exceeded resource
15055 limitations.
15056 &lt;DT&gt;&lt;CODE&gt;ENOSYS&lt;/CODE&gt;
15057 &lt;DD&gt;
15058 The &lt;CODE&gt;aio_read&lt;/CODE&gt; function is not implemented.
15059 &lt;LI&gt; EBADF
15060 The &lt;CODE&gt;aiocbp-&gt;aio_fildes&lt;/CODE&gt; descriptor is not valid. This condition
15061 need not be recognized before enqueueing the request and so this error
15062 might also be signaled asynchronously.
15063 &lt;LI&gt; EINVAL
15064 The &lt;CODE&gt;aiocbp-&gt;aio_offset&lt;/CODE&gt; or &lt;CODE&gt;aiocbp-&gt;aio_reqpiro&lt;/CODE&gt; value is
15065 invalid. This condition need not be recognized before enqueueing the
15066 request and so this error might also be signaled asynchronously.
15067
15068 &lt;br&gt;&lt;br&gt; If &lt;CODE&gt;aio_read&lt;/CODE&gt; returns zero, the current status of the request
15069 can be queried using &lt;CODE&gt;aio_error&lt;/CODE&gt; and &lt;CODE&gt;aio_return&lt;/CODE&gt; functions.
15070 As long as the value returned by &lt;CODE&gt;aio_error&lt;/CODE&gt; is &lt;CODE&gt;EINPROGRESS&lt;/CODE&gt;
15071 the operation has not yet completed. If &lt;CODE&gt;aio_error&lt;/CODE&gt; returns zero,
15072 the operation successfully terminated, otherwise the value is to be
15073 interpreted as an error code. If the function terminated, the result of
15074 the operation can be obtained using a call to &lt;CODE&gt;aio_return&lt;/CODE&gt;. The
15075 returned value is the same as an equivalent call to &lt;CODE&gt;read&lt;/CODE&gt; would
15076 have returned. Possible error codes returned by &lt;CODE&gt;aio_error&lt;/CODE&gt; are:
15077 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
15078
15079 &lt;LI&gt; EBADF
15080 The &lt;CODE&gt;aiocbp-&gt;aio_fildes&lt;/CODE&gt; descriptor is not valid.
15081 &lt;LI&gt; ECANCELED
15082 The operation was canceled before the operation was finished
15083
15084 &lt;LI&gt; EINVAL
15085 The &lt;CODE&gt;aiocbp-&gt;aio_offset&lt;/CODE&gt; value is invalid.
15086
15087 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
15088 function is in fact &lt;CODE&gt;aio_read64&lt;/CODE&gt; since the LFS interface transparently
15089 replaces the normal implementation.
15090 </synopsis>
15091 </function>
15092 </construct>
15093 <construct id="function-aio_read64" type="function">
15094 <function returntype="int">
15095 <prototype>
15096 <parameter content="struct aiocb *aiocbp"/>
15097 </prototype>
15098 <headers>
15099 <header filename = "aio.h"/>
15100 </headers>
15101 <synopsis>
15102 This function is similar to the &lt;CODE&gt;aio_read&lt;/CODE&gt; function. The only
15103 difference is that on 32 bit machines, the file descriptor should
15104 be opened in the large file mode. Internally, &lt;CODE&gt;aio_read64&lt;/CODE&gt; uses
15105 functionality equivalent to &lt;CODE&gt;lseek64&lt;/CODE&gt; to position the file descriptor correctly for the reading,
15106 as opposed to &lt;CODE&gt;lseek&lt;/CODE&gt; functionality used in &lt;CODE&gt;aio_read&lt;/CODE&gt;.
15107 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt;, this
15108 function is available under the name &lt;CODE&gt;aio_read&lt;/CODE&gt; and so transparently
15109 replaces the interface for small files on 32 bit machines.
15110 </synopsis>
15111 </function>
15112 </construct>
15113 <construct id="function-aio_write" type="function">
15114 <function returntype="int">
15115 <prototype>
15116 <parameter content="struct aiocb *aiocbp"/>
15117 </prototype>
15118 <headers>
15119 <header filename = "aio.h"/>
15120 </headers>
15121 <synopsis>
15122 This function initiates an asynchronous write operation. The function
15123 call immediately returns after the operation was enqueued or if before
15124 this happens an error was encountered.
15125 &lt;br&gt;&lt;br&gt; The first &lt;CODE&gt;aiocbp-&gt;aio_nbytes&lt;/CODE&gt; bytes from the buffer starting at
15126 &lt;CODE&gt;aiocbp-&gt;aio_buf&lt;/CODE&gt; are written to the file for which
15127 &lt;CODE&gt;aiocbp-&gt;aio_fildes&lt;/CODE&gt; is an descriptor, starting at the absolute
15128 position &lt;CODE&gt;aiocbp-&gt;aio_offset&lt;/CODE&gt; in the file.
15129 &lt;br&gt;&lt;br&gt; If prioritized I/O is supported by the platform, the
15130 &lt;CODE&gt;aiocbp-&gt;aio_reqprio&lt;/CODE&gt; value is used to adjust the priority before
15131 the request is actually enqueued.
15132 &lt;br&gt;&lt;br&gt; The calling process is notified about the termination of the read
15133 request according to the &lt;CODE&gt;aiocbp-&gt;aio_sigevent&lt;/CODE&gt; value.
15134 &lt;br&gt;&lt;br&gt; When &lt;CODE&gt;aio_write&lt;/CODE&gt; returns, the return value is zero if no error
15135 occurred that can be found before the process is enqueued. If such an
15136 early error is found the function returns -1 and sets
15137 &lt;CODE&gt;errno&lt;/CODE&gt; to one of the following values.
15138 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
15139
15140 &lt;DT&gt;&lt;CODE&gt;EAGAIN&lt;/CODE&gt;
15141 &lt;DD&gt;
15142 The request was not enqueued due to (temporarily) exceeded resource
15143 limitations.
15144 &lt;DT&gt;&lt;CODE&gt;ENOSYS&lt;/CODE&gt;
15145 &lt;DD&gt;
15146 The &lt;CODE&gt;aio_write&lt;/CODE&gt; function is not implemented.
15147 &lt;LI&gt; EBADF
15148 The &lt;CODE&gt;aiocbp-&gt;aio_fildes&lt;/CODE&gt; descriptor is not valid. This condition
15149 may not be recognized before enqueueing the request, and so this error
15150 might also be signaled asynchronously.
15151 &lt;LI&gt; EINVAL
15152 The &lt;CODE&gt;aiocbp-&gt;aio_offset&lt;/CODE&gt; or &lt;CODE&gt;aiocbp-&gt;aio_reqprio&lt;/CODE&gt; value is
15153 invalid. This condition may not be recognized before enqueueing the
15154 request and so this error might also be signaled asynchronously.
15155
15156 &lt;br&gt;&lt;br&gt; In the case &lt;CODE&gt;aio_write&lt;/CODE&gt; returns zero, the current status of the
15157 request can be queried using &lt;CODE&gt;aio_error&lt;/CODE&gt; and &lt;CODE&gt;aio_return&lt;/CODE&gt;
15158 functions. As long as the value returned by &lt;CODE&gt;aio_error&lt;/CODE&gt; is
15159 &lt;CODE&gt;EINPROGRESS&lt;/CODE&gt; the operation has not yet completed. If
15160 &lt;CODE&gt;aio_error&lt;/CODE&gt; returns zero, the operation successfully terminated,
15161 otherwise the value is to be interpreted as an error code. If the
15162 function terminated, the result of the operation can be get using a call
15163 to &lt;CODE&gt;aio_return&lt;/CODE&gt;. The returned value is the same as an equivalent
15164 call to &lt;CODE&gt;read&lt;/CODE&gt; would have returned. Possible error codes returned
15165 by &lt;CODE&gt;aio_error&lt;/CODE&gt; are:
15166 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
15167
15168 &lt;LI&gt; EBADF
15169 The &lt;CODE&gt;aiocbp-&gt;aio_fildes&lt;/CODE&gt; descriptor is not valid.
15170 &lt;LI&gt; ECANCELED
15171 The operation was canceled before the operation was finished.
15172
15173 &lt;LI&gt; EINVAL
15174 The &lt;CODE&gt;aiocbp-&gt;aio_offset&lt;/CODE&gt; value is invalid.
15175
15176 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt;, this
15177 function is in fact &lt;CODE&gt;aio_write64&lt;/CODE&gt; since the LFS interface transparently
15178 replaces the normal implementation.
15179 </synopsis>
15180 </function>
15181 </construct>
15182 <construct id="function-aio_write64" type="function">
15183 <function returntype="int">
15184 <prototype>
15185 <parameter content="struct aiocb *aiocbp"/>
15186 </prototype>
15187 <headers>
15188 <header filename = "aio.h"/>
15189 </headers>
15190 <synopsis>
15191 This function is similar to the &lt;CODE&gt;aio_write&lt;/CODE&gt; function. The only
15192 difference is that on 32 bit machines the file descriptor should
15193 be opened in the large file mode. Internally &lt;CODE&gt;aio_write64&lt;/CODE&gt; uses
15194 functionality equivalent to &lt;CODE&gt;lseek64&lt;/CODE&gt; to position the file descriptor correctly for the writing,
15195 as opposed to &lt;CODE&gt;lseek&lt;/CODE&gt; functionality used in &lt;CODE&gt;aio_write&lt;/CODE&gt;.
15196 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt;, this
15197 function is available under the name &lt;CODE&gt;aio_write&lt;/CODE&gt; and so transparently
15198 replaces the interface for small files on 32 bit machines.
15199 </synopsis>
15200 </function>
15201 </construct>
15202 <construct id="function-lio_listio" type="function">
15203 <function returntype="int">
15204 <prototype>
15205 <parameter content="int mode"/>
15206 <parameter content="struct aiocb *const list[]"/>
15207 <parameter content="int nent"/>
15208 <parameter content="struct sigevent *sig"/>
15209 </prototype>
15210 <headers>
15211 <header filename = "aio.h"/>
15212 </headers>
15213 <synopsis>
15214 The &lt;CODE&gt;lio_listio&lt;/CODE&gt; function can be used to enqueue an arbitrary
15215 number of read and write requests at one time. The requests can all be
15216 meant for the same file, all for different files or every solution in
15217 between.
15218 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;lio_listio&lt;/CODE&gt; gets the &lt;VAR&gt;nent&lt;/VAR&gt; requests from the array pointed to
15219 by &lt;VAR&gt;list&lt;/VAR&gt;. The operation to be performed is determined by the
15220 &lt;CODE&gt;aio_lio_opcode&lt;/CODE&gt; member in each element of &lt;VAR&gt;list&lt;/VAR&gt;. If this
15221 field is &lt;CODE&gt;LIO_READ&lt;/CODE&gt; a read operation is enqueued, similar to a call
15222 of &lt;CODE&gt;aio_read&lt;/CODE&gt; for this element of the array (except that the way
15223 the termination is signalled is different, as we will see below). If
15224 the &lt;CODE&gt;aio_lio_opcode&lt;/CODE&gt; member is &lt;CODE&gt;LIO_WRITE&lt;/CODE&gt; a write operation
15225 is enqueued. Otherwise the &lt;CODE&gt;aio_lio_opcode&lt;/CODE&gt; must be &lt;CODE&gt;LIO_NOP&lt;/CODE&gt;
15226 in which case this element of &lt;VAR&gt;list&lt;/VAR&gt; is simply ignored. This
15227 ``operation'' is useful in situations where one has a fixed array of
15228 &lt;CODE&gt;struct aiocb&lt;/CODE&gt; elements from which only a few need to be handled at
15229 a time. Another situation is where the &lt;CODE&gt;lio_listio&lt;/CODE&gt; call was
15230 canceled before all requests are processed and the remaining requests have to be reissued.
15231 &lt;br&gt;&lt;br&gt; The other members of each element of the array pointed to by
15232 &lt;CODE&gt;list&lt;/CODE&gt; must have values suitable for the operation as described in
15233 the documentation for &lt;CODE&gt;aio_read&lt;/CODE&gt; and &lt;CODE&gt;aio_write&lt;/CODE&gt; above.
15234 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;mode&lt;/VAR&gt; argument determines how &lt;CODE&gt;lio_listio&lt;/CODE&gt; behaves after
15235 having enqueued all the requests. If &lt;VAR&gt;mode&lt;/VAR&gt; is &lt;CODE&gt;LIO_WAIT&lt;/CODE&gt; it
15236 waits until all requests terminated. Otherwise &lt;VAR&gt;mode&lt;/VAR&gt; must be
15237 &lt;CODE&gt;LIO_NOWAIT&lt;/CODE&gt; and in this case the function returns immediately after
15238 having enqueued all the requests. In this case the caller gets a
15239 notification of the termination of all requests according to the
15240 &lt;VAR&gt;sig&lt;/VAR&gt; parameter. If &lt;VAR&gt;sig&lt;/VAR&gt; is &lt;CODE&gt;NULL&lt;/CODE&gt; no notification is
15241 send. Otherwise a signal is sent or a thread is started, just as
15242 described in the description for &lt;CODE&gt;aio_read&lt;/CODE&gt; or &lt;CODE&gt;aio_write&lt;/CODE&gt;.
15243 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;mode&lt;/VAR&gt; is &lt;CODE&gt;LIO_WAIT&lt;/CODE&gt;, the return value of &lt;CODE&gt;lio_listio&lt;/CODE&gt;
15244 is 0 when all requests completed successfully. Otherwise the
15245 function return -1 and &lt;CODE&gt;errno&lt;/CODE&gt; is set accordingly. To find
15246 out which request or requests failed one has to use the &lt;CODE&gt;aio_error&lt;/CODE&gt;
15247 function on all the elements of the array &lt;VAR&gt;list&lt;/VAR&gt;.
15248 &lt;br&gt;&lt;br&gt; In case &lt;VAR&gt;mode&lt;/VAR&gt; is &lt;CODE&gt;LIO_NOWAIT&lt;/CODE&gt;, the function returns 0 if
15249 all requests were enqueued correctly. The current state of the requests
15250 can be found using &lt;CODE&gt;aio_error&lt;/CODE&gt; and &lt;CODE&gt;aio_return&lt;/CODE&gt; as described
15251 above. If &lt;CODE&gt;lio_listio&lt;/CODE&gt; returns -1 in this mode, the
15252 global variable &lt;CODE&gt;errno&lt;/CODE&gt; is set accordingly. If a request did not
15253 yet terminate, a call to &lt;CODE&gt;aio_error&lt;/CODE&gt; returns &lt;CODE&gt;EINPROGRESS&lt;/CODE&gt;. If
15254 the value is different, the request is finished and the error value (or
15255 0) is returned and the result of the operation can be retrieved
15256 using &lt;CODE&gt;aio_return&lt;/CODE&gt;.
15257 &lt;br&gt;&lt;br&gt; Possible values for &lt;CODE&gt;errno&lt;/CODE&gt; are:
15258 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
15259
15260 &lt;DT&gt;&lt;CODE&gt;EAGAIN&lt;/CODE&gt;
15261 &lt;DD&gt;
15262 The resources necessary to queue all the requests are not available at
15263 the moment. The error status for each element of &lt;VAR&gt;list&lt;/VAR&gt; must be
15264 checked to determine which request failed.
15265 &lt;br&gt;&lt;br&gt; Another reason could be that the system wide limit of AIO requests is
15266 exceeded. This cannot be the case for the implementation on GNU systems
15267 since no arbitrary limits exist.
15268 &lt;LI&gt; EINVAL
15269 The &lt;VAR&gt;mode&lt;/VAR&gt; parameter is invalid or &lt;VAR&gt;nent&lt;/VAR&gt; is larger than
15270 &lt;CODE&gt;AIO_LISTIO_MAX&lt;/CODE&gt;.
15271 &lt;LI&gt; EIO
15272 One or more of the request's I/O operations failed. The error status of
15273 each request should be checked to determine which one failed.
15274 &lt;LI&gt; ENOSYS
15275 The &lt;CODE&gt;lio_listio&lt;/CODE&gt; function is not supported.
15276
15277 &lt;br&gt;&lt;br&gt; If the &lt;VAR&gt;mode&lt;/VAR&gt; parameter is &lt;CODE&gt;LIO_NOWAIT&lt;/CODE&gt; and the caller cancels
15278 a request, the error status for this request returned by
15279 &lt;CODE&gt;aio_error&lt;/CODE&gt; is &lt;CODE&gt;ECANCELED&lt;/CODE&gt;.
15280 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt;, this
15281 function is in fact &lt;CODE&gt;lio_listio64&lt;/CODE&gt; since the LFS interface
15282 transparently replaces the normal implementation.
15283 </synopsis>
15284 </function>
15285 </construct>
15286 <construct id="function-lio_listio64" type="function">
15287 <function returntype="int">
15288 <prototype>
15289 <parameter content="int mode"/>
15290 <parameter content="struct aiocb *const list"/>
15291 <parameter content="int nent"/>
15292 <parameter content="struct sigevent *sig"/>
15293 </prototype>
15294 <headers>
15295 <header filename = "aio.h"/>
15296 </headers>
15297 <synopsis>
15298 This function is similar to the &lt;CODE&gt;lio_listio&lt;/CODE&gt; function. The only
15299 difference is that on 32 bit machines, the file descriptor should
15300 be opened in the large file mode. Internally, &lt;CODE&gt;lio_listio64&lt;/CODE&gt; uses
15301 functionality equivalent to &lt;CODE&gt;lseek64&lt;/CODE&gt; to position the file descriptor correctly for the reading or
15302 writing, as opposed to &lt;CODE&gt;lseek&lt;/CODE&gt; functionality used in
15303 &lt;CODE&gt;lio_listio&lt;/CODE&gt;.
15304 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt;, this
15305 function is available under the name &lt;CODE&gt;lio_listio&lt;/CODE&gt; and so
15306 transparently replaces the interface for small files on 32 bit
15307 machines.
15308 </synopsis>
15309 </function>
15310 </construct>
15311 <construct id="function-aio_error" type="function">
15312 <function returntype="int">
15313 <prototype>
15314 <parameter content="const struct aiocb *aiocbp"/>
15315 </prototype>
15316 <headers>
15317 <header filename = "aio.h"/>
15318 </headers>
15319 <synopsis>
15320 This function determines the error state of the request described by the
15321 &lt;CODE&gt;struct aiocb&lt;/CODE&gt; variable pointed to by &lt;VAR&gt;aiocbp&lt;/VAR&gt;. If the
15322 request has not yet terminated the value returned is always
15323 &lt;CODE&gt;EINPROGRESS&lt;/CODE&gt;. Once the request has terminated the value
15324 &lt;CODE&gt;aio_error&lt;/CODE&gt; returns is either 0 if the request completed
15325 successfully or it returns the value which would be stored in the
15326 &lt;CODE&gt;errno&lt;/CODE&gt; variable if the request would have been done using
15327 &lt;CODE&gt;read&lt;/CODE&gt;, &lt;CODE&gt;write&lt;/CODE&gt;, or &lt;CODE&gt;fsync&lt;/CODE&gt;.
15328 &lt;br&gt;&lt;br&gt; The function can return &lt;CODE&gt;ENOSYS&lt;/CODE&gt; if it is not implemented. It
15329 could also return &lt;CODE&gt;EINVAL&lt;/CODE&gt; if the &lt;VAR&gt;aiocbp&lt;/VAR&gt; parameter does not
15330 refer to an asynchronous operation whose return status is not yet known.
15331 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
15332 function is in fact &lt;CODE&gt;aio_error64&lt;/CODE&gt; since the LFS interface
15333 transparently replaces the normal implementation.
15334 </synopsis>
15335 </function>
15336 </construct>
15337 <construct id="function-aio_error64" type="function">
15338 <function returntype="int">
15339 <prototype>
15340 <parameter content="const struct aiocb64 *aiocbp"/>
15341 </prototype>
15342 <headers>
15343 <header filename = "aio.h"/>
15344 </headers>
15345 <synopsis>
15346 This function is similar to &lt;CODE&gt;aio_error&lt;/CODE&gt; with the only difference
15347 that the argument is a reference to a variable of type &lt;CODE&gt;struct
15348 aiocb64&lt;/CODE&gt;.
15349 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
15350 function is available under the name &lt;CODE&gt;aio_error&lt;/CODE&gt; and so
15351 transparently replaces the interface for small files on 32 bit
15352 machines.
15353 </synopsis>
15354 </function>
15355 </construct>
15356 <construct id="function-aio_return" type="function">
15357 <function returntype="ssize_t">
15358 <prototype>
15359 <parameter content="const struct aiocb *aiocbp"/>
15360 </prototype>
15361 <headers>
15362 <header filename = "aio.h"/>
15363 </headers>
15364 <synopsis>
15365 This function can be used to retrieve the return status of the operation
15366 carried out by the request described in the variable pointed to by
15367 &lt;VAR&gt;aiocbp&lt;/VAR&gt;. As long as the error status of this request as returned
15368 by &lt;CODE&gt;aio_error&lt;/CODE&gt; is &lt;CODE&gt;EINPROGRESS&lt;/CODE&gt; the return of this function is
15369 undefined.
15370 &lt;br&gt;&lt;br&gt; Once the request is finished this function can be used exactly once to
15371 retrieve the return value. Following calls might lead to undefined
15372 behavior. The return value itself is the value which would have been
15373 returned by the &lt;CODE&gt;read&lt;/CODE&gt;, &lt;CODE&gt;write&lt;/CODE&gt;, or &lt;CODE&gt;fsync&lt;/CODE&gt; call.
15374 &lt;br&gt;&lt;br&gt; The function can return &lt;CODE&gt;ENOSYS&lt;/CODE&gt; if it is not implemented. It
15375 could also return &lt;CODE&gt;EINVAL&lt;/CODE&gt; if the &lt;VAR&gt;aiocbp&lt;/VAR&gt; parameter does not
15376 refer to an asynchronous operation whose return status is not yet known.
15377 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
15378 function is in fact &lt;CODE&gt;aio_return64&lt;/CODE&gt; since the LFS interface
15379 transparently replaces the normal implementation.
15380 </synopsis>
15381 </function>
15382 </construct>
15383 <construct id="function-aio_return64" type="function">
15384 <function returntype="int">
15385 <prototype>
15386 <parameter content="const struct aiocb64 *aiocbp"/>
15387 </prototype>
15388 <headers>
15389 <header filename = "aio.h"/>
15390 </headers>
15391 <synopsis>
15392 This function is similar to &lt;CODE&gt;aio_return&lt;/CODE&gt; with the only difference
15393 that the argument is a reference to a variable of type &lt;CODE&gt;struct
15394 aiocb64&lt;/CODE&gt;.
15395 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
15396 function is available under the name &lt;CODE&gt;aio_return&lt;/CODE&gt; and so
15397 transparently replaces the interface for small files on 32 bit
15398 machines.
15399 </synopsis>
15400 </function>
15401 </construct>
15402 <construct id="function-aio_fsync" type="function">
15403 <function returntype="int">
15404 <prototype>
15405 <parameter content="int op"/>
15406 <parameter content="struct aiocb *aiocbp"/>
15407 </prototype>
15408 <headers>
15409 <header filename = "aio.h"/>
15410 </headers>
15411 <synopsis>
15412 Calling this function forces all I/O operations operating queued at the
15413 time of the function call operating on the file descriptor
15414 &lt;CODE&gt;aiocbp-&gt;aio_fildes&lt;/CODE&gt; into the synchronized I/O completion state
15415 . The &lt;CODE&gt;aio_fsync&lt;/CODE&gt; function returns
15416 immediately but the notification through the method described in
15417 &lt;CODE&gt;aiocbp-&gt;aio_sigevent&lt;/CODE&gt; will happen only after all requests for this
15418 file descriptor have terminated and the file is synchronized. This also
15419 means that requests for this very same file descriptor which are queued
15420 after the synchronization request are not affected.
15421 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;op&lt;/VAR&gt; is &lt;CODE&gt;O_DSYNC&lt;/CODE&gt; the synchronization happens as with a call
15422 to &lt;CODE&gt;fdatasync&lt;/CODE&gt;. Otherwise &lt;VAR&gt;op&lt;/VAR&gt; should be &lt;CODE&gt;O_SYNC&lt;/CODE&gt; and
15423 the synchronization happens as with &lt;CODE&gt;fsync&lt;/CODE&gt;.
15424 &lt;br&gt;&lt;br&gt; As long as the synchronization has not happened, a call to
15425 &lt;CODE&gt;aio_error&lt;/CODE&gt; with the reference to the object pointed to by
15426 &lt;VAR&gt;aiocbp&lt;/VAR&gt; returns &lt;CODE&gt;EINPROGRESS&lt;/CODE&gt;. Once the synchronization is
15427 done &lt;CODE&gt;aio_error&lt;/CODE&gt; return 0 if the synchronization was not
15428 successful. Otherwise the value returned is the value to which the
15429 &lt;CODE&gt;fsync&lt;/CODE&gt; or &lt;CODE&gt;fdatasync&lt;/CODE&gt; function would have set the
15430 &lt;CODE&gt;errno&lt;/CODE&gt; variable. In this case nothing can be assumed about the
15431 consistency for the data written to this file descriptor.
15432 &lt;br&gt;&lt;br&gt; The return value of this function is 0 if the request was
15433 successfully enqueued. Otherwise the return value is -1 and
15434 &lt;CODE&gt;errno&lt;/CODE&gt; is set to one of the following values:
15435 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
15436
15437 &lt;DT&gt;&lt;CODE&gt;EAGAIN&lt;/CODE&gt;
15438 &lt;DD&gt;
15439 The request could not be enqueued due to temporary lack of resources.
15440 &lt;LI&gt; EBADF
15441 The file descriptor &lt;CODE&gt;aiocbp-&gt;aio_fildes&lt;/CODE&gt; is not valid or not open
15442 for writing.
15443 &lt;LI&gt; EINVAL
15444 The implementation does not support I/O synchronization or the &lt;VAR&gt;op&lt;/VAR&gt;
15445 parameter is other than &lt;CODE&gt;O_DSYNC&lt;/CODE&gt; and &lt;CODE&gt;O_SYNC&lt;/CODE&gt;.
15446 &lt;LI&gt; ENOSYS
15447 This function is not implemented.
15448
15449 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
15450 function is in fact &lt;CODE&gt;aio_fsync64&lt;/CODE&gt; since the LFS interface
15451 transparently replaces the normal implementation.
15452 </synopsis>
15453 </function>
15454 </construct>
15455 <construct id="function-aio_fsync64" type="function">
15456 <function returntype="int">
15457 <prototype>
15458 <parameter content="int op"/>
15459 <parameter content="struct aiocb64 *aiocbp"/>
15460 </prototype>
15461 <headers>
15462 <header filename = "aio.h"/>
15463 </headers>
15464 <synopsis>
15465 This function is similar to &lt;CODE&gt;aio_fsync&lt;/CODE&gt; with the only difference
15466 that the argument is a reference to a variable of type &lt;CODE&gt;struct
15467 aiocb64&lt;/CODE&gt;.
15468 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
15469 function is available under the name &lt;CODE&gt;aio_fsync&lt;/CODE&gt; and so
15470 transparently replaces the interface for small files on 32 bit
15471 machines.
15472 </synopsis>
15473 </function>
15474 </construct>
15475 <construct id="function-aio_suspend" type="function">
15476 <function returntype="int">
15477 <prototype>
15478 <parameter content="const struct aiocb *const list[]"/>
15479 <parameter content="int nent"/>
15480 <parameter content="const struct timespec *timeout"/>
15481 </prototype>
15482 <headers>
15483 <header filename = "aio.h"/>
15484 </headers>
15485 <synopsis>
15486 When calling this function, the calling thread is suspended until at
15487 least one of the requests pointed to by the &lt;VAR&gt;nent&lt;/VAR&gt; elements of the
15488 array &lt;VAR&gt;list&lt;/VAR&gt; has completed. If any of the requests has already
15489 completed at the time &lt;CODE&gt;aio_suspend&lt;/CODE&gt; is called, the function returns
15490 immediately. Whether a request has terminated or not is determined by
15491 comparing the error status of the request with &lt;CODE&gt;EINPROGRESS&lt;/CODE&gt;. If
15492 an element of &lt;VAR&gt;list&lt;/VAR&gt; is &lt;CODE&gt;NULL&lt;/CODE&gt;, the entry is simply ignored.
15493 &lt;br&gt;&lt;br&gt; If no request has finished, the calling process is suspended. If
15494 &lt;VAR&gt;timeout&lt;/VAR&gt; is &lt;CODE&gt;NULL&lt;/CODE&gt;, the process is not woken until a request
15495 has finished. If &lt;VAR&gt;timeout&lt;/VAR&gt; is not &lt;CODE&gt;NULL&lt;/CODE&gt;, the process remains
15496 suspended at least as long as specified in &lt;VAR&gt;timeout&lt;/VAR&gt;. In this case,
15497 &lt;CODE&gt;aio_suspend&lt;/CODE&gt; returns with an error.
15498 &lt;br&gt;&lt;br&gt; The return value of the function is 0 if one or more requests
15499 from the &lt;VAR&gt;list&lt;/VAR&gt; have terminated. Otherwise the function returns
15500 -1 and &lt;CODE&gt;errno&lt;/CODE&gt; is set to one of the following values:
15501 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
15502
15503 &lt;DT&gt;&lt;CODE&gt;EAGAIN&lt;/CODE&gt;
15504 &lt;DD&gt;
15505 None of the requests from the &lt;VAR&gt;list&lt;/VAR&gt; completed in the time specified
15506 by &lt;VAR&gt;timeout&lt;/VAR&gt;.
15507 &lt;LI&gt; EINTR
15508 A signal interrupted the &lt;CODE&gt;aio_suspend&lt;/CODE&gt; function. This signal might
15509 also be sent by the AIO implementation while signalling the termination
15510 of one of the requests.
15511 &lt;LI&gt; ENOSYS
15512 The &lt;CODE&gt;aio_suspend&lt;/CODE&gt; function is not implemented.
15513
15514 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
15515 function is in fact &lt;CODE&gt;aio_suspend64&lt;/CODE&gt; since the LFS interface
15516 transparently replaces the normal implementation.
15517 </synopsis>
15518 </function>
15519 </construct>
15520 <construct id="function-aio_suspend64" type="function">
15521 <function returntype="int">
15522 <prototype>
15523 <parameter content="const struct aiocb64 *const list[]"/>
15524 <parameter content="int nent"/>
15525 <parameter content="const struct timespec *timeout"/>
15526 </prototype>
15527 <headers>
15528 <header filename = "aio.h"/>
15529 </headers>
15530 <synopsis>
15531 This function is similar to &lt;CODE&gt;aio_suspend&lt;/CODE&gt; with the only difference
15532 that the argument is a reference to a variable of type &lt;CODE&gt;struct
15533 aiocb64&lt;/CODE&gt;.
15534 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
15535 function is available under the name &lt;CODE&gt;aio_suspend&lt;/CODE&gt; and so
15536 transparently replaces the interface for small files on 32 bit
15537 machines.
15538 </synopsis>
15539 </function>
15540 </construct>
15541 <construct id="function-aio_cancel" type="function">
15542 <function returntype="int">
15543 <prototype>
15544 <parameter content="int fildes"/>
15545 <parameter content="struct aiocb *aiocbp"/>
15546 </prototype>
15547 <headers>
15548 <header filename = "aio.h"/>
15549 </headers>
15550 <synopsis>
15551 The &lt;CODE&gt;aio_cancel&lt;/CODE&gt; function can be used to cancel one or more
15552 outstanding requests. If the &lt;VAR&gt;aiocbp&lt;/VAR&gt; parameter is &lt;CODE&gt;NULL&lt;/CODE&gt;, the
15553 function tries to cancel all of the outstanding requests which would process
15554 the file descriptor &lt;VAR&gt;fildes&lt;/VAR&gt; (i.e., whose &lt;CODE&gt;aio_fildes&lt;/CODE&gt; member
15555 is &lt;VAR&gt;fildes&lt;/VAR&gt;). If &lt;VAR&gt;aiocbp&lt;/VAR&gt; is not &lt;CODE&gt;NULL&lt;/CODE&gt;, &lt;CODE&gt;aio_cancel&lt;/CODE&gt;
15556 attempts to cancel the specific request pointed to by &lt;VAR&gt;aiocbp&lt;/VAR&gt;.
15557 &lt;br&gt;&lt;br&gt; For requests which were successfully canceled, the normal notification
15558 about the termination of the request should take place. I.e., depending
15559 on the &lt;CODE&gt;struct sigevent&lt;/CODE&gt; object which controls this, nothing
15560 happens, a signal is sent or a thread is started. If the request cannot
15561 be canceled, it terminates the usual way after performing the operation.
15562 &lt;br&gt;&lt;br&gt; After a request is successfully canceled, a call to &lt;CODE&gt;aio_error&lt;/CODE&gt; with
15563 a reference to this request as the parameter will return
15564 &lt;CODE&gt;ECANCELED&lt;/CODE&gt; and a call to &lt;CODE&gt;aio_return&lt;/CODE&gt; will return -1.
15565 If the request wasn't canceled and is still running the error status is
15566 still &lt;CODE&gt;EINPROGRESS&lt;/CODE&gt;.
15567 &lt;br&gt;&lt;br&gt; The return value of the function is &lt;CODE&gt;AIO_CANCELED&lt;/CODE&gt; if there were
15568 requests which haven't terminated and which were successfully canceled.
15569 If there is one or more requests left which couldn't be canceled, the
15570 return value is &lt;CODE&gt;AIO_NOTCANCELED&lt;/CODE&gt;. In this case &lt;CODE&gt;aio_error&lt;/CODE&gt;
15571 must be used to find out which of the, perhaps multiple, requests (in
15572 &lt;VAR&gt;aiocbp&lt;/VAR&gt; is &lt;CODE&gt;NULL&lt;/CODE&gt;) weren't successfully canceled. If all
15573 requests already terminated at the time &lt;CODE&gt;aio_cancel&lt;/CODE&gt; is called the
15574 return value is &lt;CODE&gt;AIO_ALLDONE&lt;/CODE&gt;.
15575 &lt;br&gt;&lt;br&gt; If an error occurred during the execution of &lt;CODE&gt;aio_cancel&lt;/CODE&gt; the
15576 function returns -1 and sets &lt;CODE&gt;errno&lt;/CODE&gt; to one of the following
15577 values.
15578 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
15579
15580 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
15581 &lt;DD&gt;
15582 The file descriptor &lt;VAR&gt;fildes&lt;/VAR&gt; is not valid.
15583 &lt;LI&gt; ENOSYS
15584 &lt;CODE&gt;aio_cancel&lt;/CODE&gt; is not implemented.
15585
15586 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt;, this
15587 function is in fact &lt;CODE&gt;aio_cancel64&lt;/CODE&gt; since the LFS interface
15588 transparently replaces the normal implementation.
15589 </synopsis>
15590 </function>
15591 </construct>
15592 <construct id="function-aio_cancel64" type="function">
15593 <function returntype="int">
15594 <prototype>
15595 <parameter content="int fildes"/>
15596 <parameter content="struct aiocb64 *aiocbp"/>
15597 </prototype>
15598 <headers>
15599 <header filename = "aio.h"/>
15600 </headers>
15601 <synopsis>
15602 This function is similar to &lt;CODE&gt;aio_cancel&lt;/CODE&gt; with the only difference
15603 that the argument is a reference to a variable of type &lt;CODE&gt;struct
15604 aiocb64&lt;/CODE&gt;.
15605 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt;, this
15606 function is available under the name &lt;CODE&gt;aio_cancel&lt;/CODE&gt; and so
15607 transparently replaces the interface for small files on 32 bit
15608 machines.
15609 </synopsis>
15610 </function>
15611 </construct>
15612 <construct id="struct-aioinit" type="struct">
15613 <structure>
15614 <synopsis>
15615 This data type is used to pass the configuration or tunable parameters
15616 to the implementation. The program has to initialize the members of
15617 this struct and pass it to the implementation using the &lt;CODE&gt;aio_init&lt;/CODE&gt;
15618 function.
15619 &lt;br&gt;&lt;br&gt;
15620 </synopsis>
15621 <elements>
15622 <element content="int aio_threads">
15623 <synopsis>
15624 This member specifies the maximal number of threads which may be used
15625 at any one time.
15626 </synopsis>
15627 </element>
15628 <element content="int aio_num">
15629 <synopsis>
15630 This number provides an estimate on the maximal number of simultaneously
15631 enqueued requests.
15632 </synopsis>
15633 </element>
15634 <element content="int aio_locks">
15635 <synopsis>
15636 Unused.
15637 </synopsis>
15638 </element>
15639 <element content="int aio_usedba">
15640 <synopsis>
15641 Unused.
15642 </synopsis>
15643 </element>
15644 <element content="int aio_debug">
15645 <synopsis>
15646 Unused.
15647 </synopsis>
15648 </element>
15649 <element content="int aio_numusers">
15650 <synopsis>
15651 Unused.
15652 </synopsis>
15653 </element>
15654 </elements>
15655 </structure>
15656 </construct>
15657 <construct id="function-aio_init" type="function">
15658 <function returntype="void">
15659 <prototype>
15660 <parameter content="const struct aioinit *init"/>
15661 </prototype>
15662 <headers>
15663 <header filename = "aio.h"/>
15664 </headers>
15665 <synopsis>
15666 This function must be called before any other AIO function. Calling it
15667 is completely voluntary, as it is only meant to help the AIO
15668 implementation perform better.
15669 &lt;br&gt;&lt;br&gt; Before calling the &lt;CODE&gt;aio_init&lt;/CODE&gt;, function the members of a variable of
15670 type &lt;CODE&gt;struct aioinit&lt;/CODE&gt; must be initialized. Then a reference to
15671 this variable is passed as the parameter to &lt;CODE&gt;aio_init&lt;/CODE&gt; which itself
15672 may or may not pay attention to the hints.
15673 &lt;br&gt;&lt;br&gt; The function has no return value and no error cases are defined. It is
15674 a extension which follows a proposal from the SGI implementation in
15675 Irix 6. It is not covered by POSIX.1b or Unix98.
15676 </synopsis>
15677 </function>
15678 </construct>
15679 <construct id="function-fcntl" type="function">
15680 <function returntype="int">
15681 <prototype>
15682 <parameter content="int filedes"/>
15683 <parameter content="int command"/>
15684 <parameter content="..."/>
15685 </prototype>
15686 <headers>
15687 <header filename = "fcntl.h"/>
15688 </headers>
15689 <synopsis>
15690 The &lt;CODE&gt;fcntl&lt;/CODE&gt; function performs the operation specified by
15691 &lt;VAR&gt;command&lt;/VAR&gt; on the file descriptor &lt;VAR&gt;filedes&lt;/VAR&gt;. Some commands
15692 require additional arguments to be supplied. These additional arguments
15693 and the return value and error conditions are given in the detailed
15694 descriptions of the individual commands.
15695 &lt;br&gt;&lt;br&gt; Briefly, here is a list of what the various commands are.
15696 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
15697
15698 &lt;DT&gt;&lt;CODE&gt;F_DUPFD&lt;/CODE&gt;
15699 &lt;DD&gt;
15700 Duplicate the file descriptor (return another file descriptor pointing
15701 to the same open file). .
15702 &lt;br&gt;&lt;br&gt; &lt;LI&gt; F_GETFD
15703 Get flags associated with the file descriptor. .
15704 &lt;br&gt;&lt;br&gt; &lt;LI&gt; F_SETFD
15705 Set flags associated with the file descriptor. .
15706 &lt;br&gt;&lt;br&gt; &lt;LI&gt; F_GETFL
15707 Get flags associated with the open file. .
15708 &lt;br&gt;&lt;br&gt; &lt;LI&gt; F_SETFL
15709 Set flags associated with the open file. .
15710 &lt;br&gt;&lt;br&gt; &lt;LI&gt; F_GETLK
15711 Get a file lock. .
15712 &lt;br&gt;&lt;br&gt; &lt;LI&gt; F_SETLK
15713 Set or clear a file lock. .
15714 &lt;br&gt;&lt;br&gt; &lt;LI&gt; F_SETLKW
15715 Like &lt;CODE&gt;F_SETLK&lt;/CODE&gt;, but wait for completion. .
15716 &lt;br&gt;&lt;br&gt; &lt;LI&gt; F_GETOWN
15717 Get process or process group ID to receive &lt;CODE&gt;SIGIO&lt;/CODE&gt; signals.
15718 .
15719 &lt;br&gt;&lt;br&gt; &lt;LI&gt; F_SETOWN
15720 Set process or process group ID to receive &lt;CODE&gt;SIGIO&lt;/CODE&gt; signals.
15721 .
15722
15723 &lt;br&gt;&lt;br&gt; This function is a cancellation point in multi-threaded programs. This
15724 is a problem if the thread allocates some resources (like memory, file
15725 descriptors, semaphores or whatever) at the time &lt;CODE&gt;fcntl&lt;/CODE&gt; is
15726 called. If the thread gets canceled these resources stay allocated
15727 until the program ends. To avoid this calls to &lt;CODE&gt;fcntl&lt;/CODE&gt; should be
15728 protected using cancellation handlers.
15729 </synopsis>
15730 </function>
15731 </construct>
15732 <construct id="function-dup" type="function">
15733 <function returntype="int">
15734 <prototype>
15735 <parameter content="int old"/>
15736 </prototype>
15737 <headers>
15738 <header filename = "unistd.h"/>
15739 </headers>
15740 <synopsis>
15741 This function copies descriptor &lt;VAR&gt;old&lt;/VAR&gt; to the first available
15742 descriptor number (the first number not currently open). It is
15743 equivalent to &lt;CODE&gt;fcntl (&lt;VAR&gt;old&lt;/VAR&gt;, F_DUPFD, 0)&lt;/CODE&gt;.
15744 </synopsis>
15745 </function>
15746 </construct>
15747 <construct id="function-dup2" type="function">
15748 <function returntype="int">
15749 <prototype>
15750 <parameter content="int old"/>
15751 <parameter content="int new"/>
15752 </prototype>
15753 <headers>
15754 <header filename = "unistd.h"/>
15755 </headers>
15756 <synopsis>
15757 This function copies the descriptor &lt;VAR&gt;old&lt;/VAR&gt; to descriptor number
15758 &lt;VAR&gt;new&lt;/VAR&gt;.
15759 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;old&lt;/VAR&gt; is an invalid descriptor, then &lt;CODE&gt;dup2&lt;/CODE&gt; does nothing; it
15760 does not close &lt;VAR&gt;new&lt;/VAR&gt;. Otherwise, the new duplicate of &lt;VAR&gt;old&lt;/VAR&gt;
15761 replaces any previous meaning of descriptor &lt;VAR&gt;new&lt;/VAR&gt;, as if &lt;VAR&gt;new&lt;/VAR&gt;
15762 were closed first.
15763 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;old&lt;/VAR&gt; and &lt;VAR&gt;new&lt;/VAR&gt; are different numbers, and &lt;VAR&gt;old&lt;/VAR&gt; is a
15764 valid descriptor number, then &lt;CODE&gt;dup2&lt;/CODE&gt; is equivalent to:
15765 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
15766 close (&lt;VAR&gt;new&lt;/VAR&gt;);&lt;br&gt;
15767 fcntl (&lt;VAR&gt;old&lt;/VAR&gt;, F_DUPFD, &lt;VAR&gt;new&lt;/VAR&gt;)&lt;br&gt;
15768 &lt;/pre&gt;
15769 &lt;br&gt;&lt;br&gt; However, &lt;CODE&gt;dup2&lt;/CODE&gt; does this atomically; there is no instant in the
15770 middle of calling &lt;CODE&gt;dup2&lt;/CODE&gt; at which &lt;VAR&gt;new&lt;/VAR&gt; is closed and not yet a
15771 duplicate of &lt;VAR&gt;old&lt;/VAR&gt;.
15772 </synopsis>
15773 </function>
15774 </construct>
15775 <construct id="struct-flock" type="struct">
15776 <structure>
15777 <synopsis>
15778 This structure is used with the &lt;CODE&gt;fcntl&lt;/CODE&gt; function to describe a file
15779 lock. It has these members:
15780 &lt;br&gt;&lt;br&gt;
15781 </synopsis>
15782 <elements>
15783 <element content="short int l_type">
15784 <synopsis>
15785 Specifies the type of the lock; one of &lt;CODE&gt;F_RDLCK&lt;/CODE&gt;, &lt;CODE&gt;F_WRLCK&lt;/CODE&gt;, or
15786 &lt;CODE&gt;F_UNLCK&lt;/CODE&gt;.
15787 &lt;br&gt;&lt;br&gt;
15788 </synopsis>
15789 </element>
15790 <element content="short int l_whence">
15791 <synopsis>
15792 This corresponds to the &lt;VAR&gt;whence&lt;/VAR&gt; argument to &lt;CODE&gt;fseek&lt;/CODE&gt; or
15793 &lt;CODE&gt;lseek&lt;/CODE&gt;, and specifies what the offset is relative to. Its value
15794 can be one of &lt;CODE&gt;SEEK_SET&lt;/CODE&gt;, &lt;CODE&gt;SEEK_CUR&lt;/CODE&gt;, or &lt;CODE&gt;SEEK_END&lt;/CODE&gt;.
15795 &lt;br&gt;&lt;br&gt;
15796 </synopsis>
15797 </element>
15798 <element content="off_t l_start">
15799 <synopsis>
15800 This specifies the offset of the start of the region to which the lock
15801 applies, and is given in bytes relative to the point specified by
15802 &lt;CODE&gt;l_whence&lt;/CODE&gt; member.
15803 &lt;br&gt;&lt;br&gt;
15804 </synopsis>
15805 </element>
15806 <element content="off_t l_len">
15807 <synopsis>
15808 This specifies the length of the region to be locked. A value of
15809 &lt;CODE&gt;0&lt;/CODE&gt; is treated specially; it means the region extends to the end of
15810 the file.
15811 &lt;br&gt;&lt;br&gt;
15812 </synopsis>
15813 </element>
15814 </elements>
15815 </structure>
15816 </construct>
15817 <construct id="function-ioctl" type="function">
15818 <function returntype="int">
15819 <prototype>
15820 <parameter content="int filedes"/>
15821 <parameter content="int command"/>
15822 <parameter content="..."/>
15823 </prototype>
15824 <headers>
15825 <header filename = "fcntl.h"/>
15826 <header filename = "sys/ioctl.h"/>
15827 </headers>
15828 <synopsis>
15829 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;ioctl&lt;/CODE&gt; function performs the generic I/O operation
15830 &lt;VAR&gt;command&lt;/VAR&gt; on &lt;VAR&gt;filedes&lt;/VAR&gt;.
15831 &lt;br&gt;&lt;br&gt; A third argument is usually present, either a single number or a pointer
15832 to a structure. The meaning of this argument, the returned value, and
15833 any error codes depends upon the command used. Often -1 is
15834 returned for a failure.
15835 &lt;br&gt;&lt;br&gt;
15836 </synopsis>
15837 </function>
15838 </construct>
15839 <construct id="function-strlen" type="function">
15840 <function returntype="size_t">
15841 <prototype>
15842 <parameter content="const char *s"/>
15843 </prototype>
15844 <headers>
15845 <header filename = "string.h"/>
15846 </headers>
15847 <synopsis>
15848 The &lt;CODE&gt;strlen&lt;/CODE&gt; function returns the length of the null-terminated
15849 string &lt;VAR&gt;s&lt;/VAR&gt; in bytes. (In other words, it returns the offset of the
15850 terminating null character within the array.)
15851 &lt;br&gt;&lt;br&gt; For example,
15852 &lt;pre&gt;&lt;br&gt;
15853 strlen ("hello, world")&lt;br&gt;
15854 12&lt;br&gt;
15855 &lt;/pre&gt;&lt;br&gt;
15856 &lt;br&gt;&lt;br&gt; When applied to a character array, the &lt;CODE&gt;strlen&lt;/CODE&gt; function returns&lt;br&gt;
15857 the length of the string stored there, not its allocated size. You can&lt;br&gt;
15858 get the allocated size of the character array that holds a string using&lt;br&gt;
15859 the &lt;CODE&gt;sizeof&lt;/CODE&gt; operator:&lt;br&gt;
15860 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
15861 char string[32] = "hello, world";&lt;br&gt;
15862 sizeof (string)&lt;br&gt;
15863 32&lt;br&gt;
15864 strlen (string)&lt;br&gt;
15865 12&lt;br&gt;
15866 &lt;/pre&gt;&lt;br&gt;
15867 &lt;br&gt;&lt;br&gt; But beware, this will not work unless &lt;VAR&gt;string&lt;/VAR&gt; is the character&lt;br&gt;
15868 array itself, not a pointer to it. For example:&lt;br&gt;
15869 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
15870 char string[32] = "hello, world";&lt;br&gt;
15871 char *ptr = string;&lt;br&gt;
15872 sizeof (string)&lt;br&gt;
15873 32&lt;br&gt;
15874 sizeof (ptr)&lt;br&gt;
15875 4 /* (on a machine with 4 byte pointers) */&lt;br&gt;
15876 &lt;/pre&gt;&lt;br&gt;
15877 &lt;br&gt;&lt;br&gt; This is an easy mistake to make when you are working with functions that&lt;br&gt;
15878 take string arguments; those arguments are always pointers, not arrays.&lt;br&gt;
15879 &lt;br&gt;&lt;br&gt; It must also be noted that for multibyte encoded strings the return&lt;br&gt;
15880 value does not have to correspond to the number of characters in the&lt;br&gt;
15881 string. To get this value the string can be converted to wide&lt;br&gt;
15882 characters and &lt;CODE&gt;wcslen&lt;/CODE&gt; can be used or something like the following&lt;br&gt;
15883 code can be used:&lt;br&gt;
15884 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
15885 /* The input is in &lt;CODE&gt;string&lt;/CODE&gt;.&lt;br&gt;
15886 The length is expected in &lt;CODE&gt;n&lt;/CODE&gt;. */&lt;br&gt;
15887 {&lt;br&gt;
15888 mbstate_t t;&lt;br&gt;
15889 char *scopy = string;&lt;br&gt;
15890 /* In initial state. */&lt;br&gt;
15891 memset (&amp;t, '\0', sizeof (t));&lt;br&gt;
15892 /* Determine number of characters. */&lt;br&gt;
15893 n = mbsrtowcs (NULL, &amp;scopy, strlen (scopy), &amp;t);&lt;br&gt;
15894 }&lt;br&gt;
15895 &lt;/pre&gt;
15896 &lt;br&gt;&lt;br&gt; This is cumbersome to do so if the number of characters (as opposed to
15897 bytes) is needed often it is better to work with wide characters.
15898 </synopsis>
15899 </function>
15900 </construct>
15901 <construct id="function-wcslen" type="function">
15902 <function returntype="size_t">
15903 <prototype>
15904 <parameter content="const wchar_t *ws"/>
15905 </prototype>
15906 <headers>
15907 <header filename = "wchar.h"/>
15908 </headers>
15909 <synopsis>
15910 The &lt;CODE&gt;wcslen&lt;/CODE&gt; function is the wide character equivalent to
15911 &lt;CODE&gt;strlen&lt;/CODE&gt;. The return value is the number of wide characters in the
15912 wide character string pointed to by &lt;VAR&gt;ws&lt;/VAR&gt; (this is also the offset of
15913 the terminating null wide character of &lt;VAR&gt;ws&lt;/VAR&gt;).
15914 &lt;br&gt;&lt;br&gt; Since there are no multi wide character sequences making up one
15915 character the return value is not only the offset in the array, it is
15916 also the number of wide characters.
15917 &lt;br&gt;&lt;br&gt; This function was introduced in Amendment 1 to ISO C90.
15918 </synopsis>
15919 </function>
15920 </construct>
15921 <construct id="function-strnlen" type="function">
15922 <function returntype="size_t">
15923 <prototype>
15924 <parameter content="const char *s"/>
15925 <parameter content="size_t maxlen"/>
15926 </prototype>
15927 <headers>
15928 <header filename = "string.h"/>
15929 </headers>
15930 <synopsis>
15931 The &lt;CODE&gt;strnlen&lt;/CODE&gt; function returns the length of the string &lt;VAR&gt;s&lt;/VAR&gt; in
15932 bytes if this length is smaller than &lt;VAR&gt;maxlen&lt;/VAR&gt; bytes. Otherwise it
15933 returns &lt;VAR&gt;maxlen&lt;/VAR&gt;. Therefore this function is equivalent to
15934 &lt;CODE&gt;(strlen (&lt;VAR&gt;s&lt;/VAR&gt;) &lt; n ? strlen (&lt;VAR&gt;s&lt;/VAR&gt;) : &lt;VAR&gt;maxlen&lt;/VAR&gt;)&lt;/CODE&gt; but it
15935 is more efficient and works even if the string &lt;VAR&gt;s&lt;/VAR&gt; is not
15936 null-terminated.
15937 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
15938 char string[32] = "hello, world";&lt;br&gt;
15939 strnlen (string, 32)&lt;br&gt;
15940 12&lt;br&gt;
15941 strnlen (string, 5)&lt;br&gt;
15942 5&lt;br&gt;
15943 &lt;/pre&gt;
15944 &lt;br&gt;&lt;br&gt; This function is a GNU extension and is declared in &lt;TT&gt;string.h&lt;/TT&gt;.
15945 </synopsis>
15946 </function>
15947 </construct>
15948 <construct id="function-wcsnlen" type="function">
15949 <function returntype="size_t">
15950 <prototype>
15951 <parameter content="const wchar_t *ws"/>
15952 <parameter content="size_t maxlen"/>
15953 </prototype>
15954 <headers>
15955 <header filename = "wchar.h"/>
15956 </headers>
15957 <synopsis>
15958 &lt;CODE&gt;wcsnlen&lt;/CODE&gt; is the wide character equivalent to &lt;CODE&gt;strnlen&lt;/CODE&gt;. The
15959 &lt;VAR&gt;maxlen&lt;/VAR&gt; parameter specifies the maximum number of wide characters.
15960 &lt;br&gt;&lt;br&gt; This function is a GNU extension and is declared in &lt;TT&gt;wchar.h&lt;/TT&gt;.
15961 </synopsis>
15962 </function>
15963 </construct>
15964 <construct id="function-memcpy" type="function">
15965 <function returntype="void *">
15966 <prototype>
15967 <parameter content="void *restrict to"/>
15968 <parameter content="const void *restrict from"/>
15969 <parameter content="size_t size"/>
15970 </prototype>
15971 <headers>
15972 <header filename = "string.h"/>
15973 </headers>
15974 <synopsis>
15975 The &lt;CODE&gt;memcpy&lt;/CODE&gt; function copies &lt;VAR&gt;size&lt;/VAR&gt; bytes from the object
15976 beginning at &lt;VAR&gt;from&lt;/VAR&gt; into the object beginning at &lt;VAR&gt;to&lt;/VAR&gt;. The
15977 behavior of this function is undefined if the two arrays &lt;VAR&gt;to&lt;/VAR&gt; and
15978 &lt;VAR&gt;from&lt;/VAR&gt; overlap; use &lt;CODE&gt;memmove&lt;/CODE&gt; instead if overlapping is possible.
15979 &lt;br&gt;&lt;br&gt; The value returned by &lt;CODE&gt;memcpy&lt;/CODE&gt; is the value of &lt;VAR&gt;to&lt;/VAR&gt;.
15980 &lt;br&gt;&lt;br&gt; Here is an example of how you might use &lt;CODE&gt;memcpy&lt;/CODE&gt; to copy the
15981 contents of an array:
15982 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
15983 struct foo *oldarray, *newarray;&lt;br&gt;
15984 int arraysize;&lt;br&gt;
15985 &lt;small&gt;...&lt;/small&gt;&lt;br&gt;
15986 memcpy (new, old, arraysize * sizeof (struct foo));&lt;br&gt;
15987 &lt;/pre&gt;
15988 </synopsis>
15989 </function>
15990 </construct>
15991 <construct id="function-wmemcpy" type="function">
15992 <function returntype="wchar_t *">
15993 <prototype>
15994 <parameter content="wchar_t *restrict wto"/>
15995 <parameter content="const wchar_t *restrict wfrom"/>
15996 <parameter content="size_t size"/>
15997 </prototype>
15998 <headers>
15999 <header filename = "wchar.h"/>
16000 </headers>
16001 <synopsis>
16002 The &lt;CODE&gt;wmemcpy&lt;/CODE&gt; function copies &lt;VAR&gt;size&lt;/VAR&gt; wide characters from the object
16003 beginning at &lt;VAR&gt;wfrom&lt;/VAR&gt; into the object beginning at &lt;VAR&gt;wto&lt;/VAR&gt;. The
16004 behavior of this function is undefined if the two arrays &lt;VAR&gt;wto&lt;/VAR&gt; and
16005 &lt;VAR&gt;wfrom&lt;/VAR&gt; overlap; use &lt;CODE&gt;wmemmove&lt;/CODE&gt; instead if overlapping is possible.
16006 &lt;br&gt;&lt;br&gt; The following is a possible implementation of &lt;CODE&gt;wmemcpy&lt;/CODE&gt; but there
16007 are more optimizations possible.
16008 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
16009 wchar_t *&lt;br&gt;
16010 wmemcpy (wchar_t *restrict wto, const wchar_t *restrict wfrom,&lt;br&gt;
16011 size_t size)&lt;br&gt;
16012 {&lt;br&gt;
16013 return (wchar_t *) memcpy (wto, wfrom, size * sizeof (wchar_t));&lt;br&gt;
16014 }&lt;br&gt;
16015 &lt;/pre&gt;
16016 &lt;br&gt;&lt;br&gt; The value returned by &lt;CODE&gt;wmemcpy&lt;/CODE&gt; is the value of &lt;VAR&gt;wto&lt;/VAR&gt;.
16017 &lt;br&gt;&lt;br&gt; This function was introduced in Amendment 1 to ISO C90.
16018 </synopsis>
16019 </function>
16020 </construct>
16021 <construct id="function-mempcpy" type="function">
16022 <function returntype="void *">
16023 <prototype>
16024 <parameter content="void *restrict to"/>
16025 <parameter content="const void *restrict from"/>
16026 <parameter content="size_t size"/>
16027 </prototype>
16028 <headers>
16029 <header filename = "string.h"/>
16030 </headers>
16031 <synopsis>
16032 The &lt;CODE&gt;mempcpy&lt;/CODE&gt; function is nearly identical to the &lt;CODE&gt;memcpy&lt;/CODE&gt;
16033 function. It copies &lt;VAR&gt;size&lt;/VAR&gt; bytes from the object beginning at
16034 &lt;CODE&gt;from&lt;/CODE&gt; into the object pointed to by &lt;VAR&gt;to&lt;/VAR&gt;. But instead of
16035 returning the value of &lt;VAR&gt;to&lt;/VAR&gt; it returns a pointer to the byte
16036 following the last written byte in the object beginning at &lt;VAR&gt;to&lt;/VAR&gt;.
16037 I.e., the value is &lt;CODE&gt;((void *) ((char *) &lt;VAR&gt;to&lt;/VAR&gt; + &lt;VAR&gt;size&lt;/VAR&gt;))&lt;/CODE&gt;.
16038 &lt;br&gt;&lt;br&gt; This function is useful in situations where a number of objects shall be
16039 copied to consecutive memory positions.
16040 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
16041 void *&lt;br&gt;
16042 combine (void *o1, size_t s1, void *o2, size_t s2)&lt;br&gt;
16043 {&lt;br&gt;
16044 void *result = malloc (s1 + s2);&lt;br&gt;
16045 if (result != NULL)&lt;br&gt;
16046 mempcpy (mempcpy (result, o1, s1), o2, s2);&lt;br&gt;
16047 return result;&lt;br&gt;
16048 }&lt;br&gt;
16049 &lt;/pre&gt;
16050 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
16051 </synopsis>
16052 </function>
16053 </construct>
16054 <construct id="function-wmempcpy" type="function">
16055 <function returntype="wchar_t *">
16056 <prototype>
16057 <parameter content="wchar_t *restrict wto"/>
16058 <parameter content="const wchar_t *restrict wfrom"/>
16059 <parameter content="size_t size"/>
16060 </prototype>
16061 <headers>
16062 <header filename = "wchar.h"/>
16063 </headers>
16064 <synopsis>
16065 The &lt;CODE&gt;wmempcpy&lt;/CODE&gt; function is nearly identical to the &lt;CODE&gt;wmemcpy&lt;/CODE&gt;
16066 function. It copies &lt;VAR&gt;size&lt;/VAR&gt; wide characters from the object
16067 beginning at &lt;CODE&gt;wfrom&lt;/CODE&gt; into the object pointed to by &lt;VAR&gt;wto&lt;/VAR&gt;. But
16068 instead of returning the value of &lt;VAR&gt;wto&lt;/VAR&gt; it returns a pointer to the
16069 wide character following the last written wide character in the object
16070 beginning at &lt;VAR&gt;wto&lt;/VAR&gt;. I.e., the value is &lt;CODE&gt;&lt;VAR&gt;wto&lt;/VAR&gt; + &lt;VAR&gt;size&lt;/VAR&gt;&lt;/CODE&gt;.
16071 &lt;br&gt;&lt;br&gt; This function is useful in situations where a number of objects shall be
16072 copied to consecutive memory positions.
16073 &lt;br&gt;&lt;br&gt; The following is a possible implementation of &lt;CODE&gt;wmemcpy&lt;/CODE&gt; but there
16074 are more optimizations possible.
16075 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
16076 wchar_t *&lt;br&gt;
16077 wmempcpy (wchar_t *restrict wto, const wchar_t *restrict wfrom,&lt;br&gt;
16078 size_t size)&lt;br&gt;
16079 {&lt;br&gt;
16080 return (wchar_t *) mempcpy (wto, wfrom, size * sizeof (wchar_t));&lt;br&gt;
16081 }&lt;br&gt;
16082 &lt;/pre&gt;
16083 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
16084 </synopsis>
16085 </function>
16086 </construct>
16087 <construct id="function-memmove" type="function">
16088 <function returntype="void *">
16089 <prototype>
16090 <parameter content="void *to"/>
16091 <parameter content="const void *from"/>
16092 <parameter content="size_t size"/>
16093 </prototype>
16094 <headers>
16095 <header filename = "string.h"/>
16096 </headers>
16097 <synopsis>
16098 &lt;CODE&gt;memmove&lt;/CODE&gt; copies the &lt;VAR&gt;size&lt;/VAR&gt; bytes at &lt;VAR&gt;from&lt;/VAR&gt; into the
16099 &lt;VAR&gt;size&lt;/VAR&gt; bytes at &lt;VAR&gt;to&lt;/VAR&gt;, even if those two blocks of space
16100 overlap. In the case of overlap, &lt;CODE&gt;memmove&lt;/CODE&gt; is careful to copy the
16101 original values of the bytes in the block at &lt;VAR&gt;from&lt;/VAR&gt;, including those
16102 bytes which also belong to the block at &lt;VAR&gt;to&lt;/VAR&gt;.
16103 &lt;br&gt;&lt;br&gt; The value returned by &lt;CODE&gt;memmove&lt;/CODE&gt; is the value of &lt;VAR&gt;to&lt;/VAR&gt;.
16104 </synopsis>
16105 </function>
16106 </construct>
16107 <construct id="function-wmemmove" type="function">
16108 <function returntype="wchar_t *">
16109 <prototype>
16110 <parameter content="wchar *wto"/>
16111 <parameter content="const wchar_t *wfrom"/>
16112 <parameter content="size_t size"/>
16113 </prototype>
16114 <headers>
16115 <header filename = "wchar.h"/>
16116 </headers>
16117 <synopsis>
16118 &lt;CODE&gt;wmemmove&lt;/CODE&gt; copies the &lt;VAR&gt;size&lt;/VAR&gt; wide characters at &lt;VAR&gt;wfrom&lt;/VAR&gt;
16119 into the &lt;VAR&gt;size&lt;/VAR&gt; wide characters at &lt;VAR&gt;wto&lt;/VAR&gt;, even if those two
16120 blocks of space overlap. In the case of overlap, &lt;CODE&gt;memmove&lt;/CODE&gt; is
16121 careful to copy the original values of the wide characters in the block
16122 at &lt;VAR&gt;wfrom&lt;/VAR&gt;, including those wide characters which also belong to the
16123 block at &lt;VAR&gt;wto&lt;/VAR&gt;.
16124 &lt;br&gt;&lt;br&gt; The following is a possible implementation of &lt;CODE&gt;wmemcpy&lt;/CODE&gt; but there
16125 are more optimizations possible.
16126 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
16127 wchar_t *&lt;br&gt;
16128 wmempcpy (wchar_t *restrict wto, const wchar_t *restrict wfrom,&lt;br&gt;
16129 size_t size)&lt;br&gt;
16130 {&lt;br&gt;
16131 return (wchar_t *) mempcpy (wto, wfrom, size * sizeof (wchar_t));&lt;br&gt;
16132 }&lt;br&gt;
16133 &lt;/pre&gt;
16134 &lt;br&gt;&lt;br&gt; The value returned by &lt;CODE&gt;wmemmove&lt;/CODE&gt; is the value of &lt;VAR&gt;wto&lt;/VAR&gt;.
16135 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
16136 </synopsis>
16137 </function>
16138 </construct>
16139 <construct id="function-memccpy" type="function">
16140 <function returntype="void *">
16141 <prototype>
16142 <parameter content="void *restrict to"/>
16143 <parameter content="const void *restrict from"/>
16144 <parameter content="int c"/>
16145 <parameter content="size_t size"/>
16146 </prototype>
16147 <headers>
16148 <header filename = "string.h"/>
16149 </headers>
16150 <synopsis>
16151 This function copies no more than &lt;VAR&gt;size&lt;/VAR&gt; bytes from &lt;VAR&gt;from&lt;/VAR&gt; to
16152 &lt;VAR&gt;to&lt;/VAR&gt;, stopping if a byte matching &lt;VAR&gt;c&lt;/VAR&gt; is found. The return
16153 value is a pointer into &lt;VAR&gt;to&lt;/VAR&gt; one byte past where &lt;VAR&gt;c&lt;/VAR&gt; was copied,
16154 or a null pointer if no byte matching &lt;VAR&gt;c&lt;/VAR&gt; appeared in the first
16155 &lt;VAR&gt;size&lt;/VAR&gt; bytes of &lt;VAR&gt;from&lt;/VAR&gt;.
16156 </synopsis>
16157 </function>
16158 </construct>
16159 <construct id="function-memset" type="function">
16160 <function returntype="void *">
16161 <prototype>
16162 <parameter content="void *block"/>
16163 <parameter content="int c"/>
16164 <parameter content="size_t size"/>
16165 </prototype>
16166 <headers>
16167 <header filename = "string.h"/>
16168 </headers>
16169 <synopsis>
16170 This function copies the value of &lt;VAR&gt;c&lt;/VAR&gt; (converted to an
16171 &lt;CODE&gt;unsigned char&lt;/CODE&gt;) into each of the first &lt;VAR&gt;size&lt;/VAR&gt; bytes of the
16172 object beginning at &lt;VAR&gt;block&lt;/VAR&gt;. It returns the value of &lt;VAR&gt;block&lt;/VAR&gt;.
16173 </synopsis>
16174 </function>
16175 </construct>
16176 <construct id="function-wmemset" type="function">
16177 <function returntype="wchar_t *">
16178 <prototype>
16179 <parameter content="wchar_t *block"/>
16180 <parameter content="wchar_t wc"/>
16181 <parameter content="size_t size"/>
16182 </prototype>
16183 <headers>
16184 <header filename = "wchar.h"/>
16185 </headers>
16186 <synopsis>
16187 This function copies the value of &lt;VAR&gt;wc&lt;/VAR&gt; into each of the first
16188 &lt;VAR&gt;size&lt;/VAR&gt; wide characters of the object beginning at &lt;VAR&gt;block&lt;/VAR&gt;. It
16189 returns the value of &lt;VAR&gt;block&lt;/VAR&gt;.
16190 </synopsis>
16191 </function>
16192 </construct>
16193 <construct id="function-strcpy" type="function">
16194 <function returntype="char *">
16195 <prototype>
16196 <parameter content="char *restrict to"/>
16197 <parameter content="const char *restrict from"/>
16198 </prototype>
16199 <headers>
16200 <header filename = "string.h"/>
16201 </headers>
16202 <synopsis>
16203 This copies characters from the string &lt;VAR&gt;from&lt;/VAR&gt; (up to and including
16204 the terminating null character) into the string &lt;VAR&gt;to&lt;/VAR&gt;. Like
16205 &lt;CODE&gt;memcpy&lt;/CODE&gt;, this function has undefined results if the strings
16206 overlap. The return value is the value of &lt;VAR&gt;to&lt;/VAR&gt;.
16207 </synopsis>
16208 </function>
16209 </construct>
16210 <construct id="function-wcscpy" type="function">
16211 <function returntype="wchar_t *">
16212 <prototype>
16213 <parameter content="wchar_t *restrict wto"/>
16214 <parameter content="const wchar_t *restrict wfrom"/>
16215 </prototype>
16216 <headers>
16217 <header filename = "wchar.h"/>
16218 </headers>
16219 <synopsis>
16220 This copies wide characters from the string &lt;VAR&gt;wfrom&lt;/VAR&gt; (up to and
16221 including the terminating null wide character) into the string
16222 &lt;VAR&gt;wto&lt;/VAR&gt;. Like &lt;CODE&gt;wmemcpy&lt;/CODE&gt;, this function has undefined results if
16223 the strings overlap. The return value is the value of &lt;VAR&gt;wto&lt;/VAR&gt;.
16224 </synopsis>
16225 </function>
16226 </construct>
16227 <construct id="function-strncpy" type="function">
16228 <function returntype="char *">
16229 <prototype>
16230 <parameter content="char *restrict to"/>
16231 <parameter content="const char *restrict from"/>
16232 <parameter content="size_t size"/>
16233 </prototype>
16234 <headers>
16235 <header filename = "string.h"/>
16236 </headers>
16237 <synopsis>
16238 This function is similar to &lt;CODE&gt;strcpy&lt;/CODE&gt; but always copies exactly
16239 &lt;VAR&gt;size&lt;/VAR&gt; characters into &lt;VAR&gt;to&lt;/VAR&gt;.
16240 &lt;br&gt;&lt;br&gt; If the length of &lt;VAR&gt;from&lt;/VAR&gt; is more than &lt;VAR&gt;size&lt;/VAR&gt;, then &lt;CODE&gt;strncpy&lt;/CODE&gt;
16241 copies just the first &lt;VAR&gt;size&lt;/VAR&gt; characters. Note that in this case
16242 there is no null terminator written into &lt;VAR&gt;to&lt;/VAR&gt;.
16243 &lt;br&gt;&lt;br&gt; If the length of &lt;VAR&gt;from&lt;/VAR&gt; is less than &lt;VAR&gt;size&lt;/VAR&gt;, then &lt;CODE&gt;strncpy&lt;/CODE&gt;
16244 copies all of &lt;VAR&gt;from&lt;/VAR&gt;, followed by enough null characters to add up
16245 to &lt;VAR&gt;size&lt;/VAR&gt; characters in all. This behavior is rarely useful, but it
16246 is specified by the ISO C standard.
16247 &lt;br&gt;&lt;br&gt; The behavior of &lt;CODE&gt;strncpy&lt;/CODE&gt; is undefined if the strings overlap.
16248 &lt;br&gt;&lt;br&gt; Using &lt;CODE&gt;strncpy&lt;/CODE&gt; as opposed to &lt;CODE&gt;strcpy&lt;/CODE&gt; is a way to avoid bugs
16249 relating to writing past the end of the allocated space for &lt;VAR&gt;to&lt;/VAR&gt;.
16250 However, it can also make your program much slower in one common case:
16251 copying a string which is probably small into a potentially large buffer.
16252 In this case, &lt;VAR&gt;size&lt;/VAR&gt; may be large, and when it is, &lt;CODE&gt;strncpy&lt;/CODE&gt; will
16253 waste a considerable amount of time copying null characters.
16254 </synopsis>
16255 </function>
16256 </construct>
16257 <construct id="function-wcsncpy" type="function">
16258 <function returntype="wchar_t *">
16259 <prototype>
16260 <parameter content="wchar_t *restrict wto"/>
16261 <parameter content="const wchar_t *restrict wfrom"/>
16262 <parameter content="size_t size"/>
16263 </prototype>
16264 <headers>
16265 <header filename = "wchar.h"/>
16266 </headers>
16267 <synopsis>
16268 This function is similar to &lt;CODE&gt;wcscpy&lt;/CODE&gt; but always copies exactly
16269 &lt;VAR&gt;size&lt;/VAR&gt; wide characters into &lt;VAR&gt;wto&lt;/VAR&gt;.
16270 &lt;br&gt;&lt;br&gt; If the length of &lt;VAR&gt;wfrom&lt;/VAR&gt; is more than &lt;VAR&gt;size&lt;/VAR&gt;, then
16271 &lt;CODE&gt;wcsncpy&lt;/CODE&gt; copies just the first &lt;VAR&gt;size&lt;/VAR&gt; wide characters. Note
16272 that in this case there is no null terminator written into &lt;VAR&gt;wto&lt;/VAR&gt;.
16273 &lt;br&gt;&lt;br&gt; If the length of &lt;VAR&gt;wfrom&lt;/VAR&gt; is less than &lt;VAR&gt;size&lt;/VAR&gt;, then
16274 &lt;CODE&gt;wcsncpy&lt;/CODE&gt; copies all of &lt;VAR&gt;wfrom&lt;/VAR&gt;, followed by enough null wide
16275 characters to add up to &lt;VAR&gt;size&lt;/VAR&gt; wide characters in all. This
16276 behavior is rarely useful, but it is specified by the ISO C
16277 standard.
16278 &lt;br&gt;&lt;br&gt; The behavior of &lt;CODE&gt;wcsncpy&lt;/CODE&gt; is undefined if the strings overlap.
16279 &lt;br&gt;&lt;br&gt; Using &lt;CODE&gt;wcsncpy&lt;/CODE&gt; as opposed to &lt;CODE&gt;wcscpy&lt;/CODE&gt; is a way to avoid bugs
16280 relating to writing past the end of the allocated space for &lt;VAR&gt;wto&lt;/VAR&gt;.
16281 However, it can also make your program much slower in one common case:
16282 copying a string which is probably small into a potentially large buffer.
16283 In this case, &lt;VAR&gt;size&lt;/VAR&gt; may be large, and when it is, &lt;CODE&gt;wcsncpy&lt;/CODE&gt; will
16284 waste a considerable amount of time copying null wide characters.
16285 </synopsis>
16286 </function>
16287 </construct>
16288 <construct id="function-strdup" type="function">
16289 <function returntype="char *">
16290 <prototype>
16291 <parameter content="const char *s"/>
16292 </prototype>
16293 <headers>
16294 <header filename = "string.h"/>
16295 </headers>
16296 <synopsis>
16297 This function copies the null-terminated string &lt;VAR&gt;s&lt;/VAR&gt; into a newly
16298 allocated string. The string is allocated using &lt;CODE&gt;malloc&lt;/CODE&gt;; see
16299 Unconstrained Allocation. If &lt;CODE&gt;malloc&lt;/CODE&gt; cannot allocate space
16300 for the new string, &lt;CODE&gt;strdup&lt;/CODE&gt; returns a null pointer. Otherwise it
16301 returns a pointer to the new string.
16302 </synopsis>
16303 </function>
16304 </construct>
16305 <construct id="function-wcsdup" type="function">
16306 <function returntype="wchar_t *">
16307 <prototype>
16308 <parameter content="const wchar_t *ws"/>
16309 </prototype>
16310 <headers>
16311 <header filename = "wchar.h"/>
16312 </headers>
16313 <synopsis>
16314 This function copies the null-terminated wide character string &lt;VAR&gt;ws&lt;/VAR&gt;
16315 into a newly allocated string. The string is allocated using
16316 &lt;CODE&gt;malloc&lt;/CODE&gt;; see Unconstrained Allocation. If &lt;CODE&gt;malloc&lt;/CODE&gt;
16317 cannot allocate space for the new string, &lt;CODE&gt;wcsdup&lt;/CODE&gt; returns a null
16318 pointer. Otherwise it returns a pointer to the new wide character
16319 string.
16320 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
16321 </synopsis>
16322 </function>
16323 </construct>
16324 <construct id="function-strndup" type="function">
16325 <function returntype="char *">
16326 <prototype>
16327 <parameter content="const char *s"/>
16328 <parameter content="size_t size"/>
16329 </prototype>
16330 <headers>
16331 <header filename = "string.h"/>
16332 </headers>
16333 <synopsis>
16334 This function is similar to &lt;CODE&gt;strdup&lt;/CODE&gt; but always copies at most
16335 &lt;VAR&gt;size&lt;/VAR&gt; characters into the newly allocated string.
16336 &lt;br&gt;&lt;br&gt; If the length of &lt;VAR&gt;s&lt;/VAR&gt; is more than &lt;VAR&gt;size&lt;/VAR&gt;, then &lt;CODE&gt;strndup&lt;/CODE&gt;
16337 copies just the first &lt;VAR&gt;size&lt;/VAR&gt; characters and adds a closing null
16338 terminator. Otherwise all characters are copied and the string is
16339 terminated.
16340 &lt;br&gt;&lt;br&gt; This function is different to &lt;CODE&gt;strncpy&lt;/CODE&gt; in that it always
16341 terminates the destination string.
16342 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;strndup&lt;/CODE&gt; is a GNU extension.
16343 </synopsis>
16344 </function>
16345 </construct>
16346 <construct id="function-stpcpy" type="function">
16347 <function returntype="char *">
16348 <prototype>
16349 <parameter content="char *restrict to"/>
16350 <parameter content="const char *restrict from"/>
16351 </prototype>
16352 <headers>
16353 <header filename = "string.h"/>
16354 </headers>
16355 <synopsis>
16356 This function is like &lt;CODE&gt;strcpy&lt;/CODE&gt;, except that it returns a pointer to
16357 the end of the string &lt;VAR&gt;to&lt;/VAR&gt; (that is, the address of the terminating
16358 null character &lt;CODE&gt;to + strlen (from)&lt;/CODE&gt;) rather than the beginning.
16359 &lt;br&gt;&lt;br&gt; For example, this program uses &lt;CODE&gt;stpcpy&lt;/CODE&gt; to concatenate &lt;samp&gt;foo&lt;/samp&gt;
16360 and &lt;samp&gt;bar&lt;/samp&gt; to produce &lt;samp&gt;foobar&lt;/samp&gt;, which it then prints.
16361 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
16362 #include &amp;lt;string.h&amp;gt;&lt;br&gt;
16363 #include &amp;lt;stdio.h&amp;gt;&lt;br&gt;
16364 &lt;br&gt;&lt;br&gt; int&lt;br&gt;
16365 main (void)&lt;br&gt;
16366 {&lt;br&gt;
16367 char buffer[10];&lt;br&gt;
16368 char *to = buffer;&lt;br&gt;
16369 to = stpcpy (to, "foo");&lt;br&gt;
16370 to = stpcpy (to, "bar");&lt;br&gt;
16371 puts (buffer);&lt;br&gt;
16372 return 0;&lt;br&gt;
16373 }&lt;br&gt;
16374 &lt;/pre&gt;
16375 &lt;br&gt;&lt;br&gt; This function is not part of the ISO or POSIX standards, and is not
16376 customary on Unix systems, but we did not invent it either. Perhaps it
16377 comes from MS-DOG.
16378 &lt;br&gt;&lt;br&gt; Its behavior is undefined if the strings overlap. The function is
16379 declared in &lt;TT&gt;string.h&lt;/TT&gt;.
16380 </synopsis>
16381 </function>
16382 </construct>
16383 <construct id="function-wcpcpy" type="function">
16384 <function returntype="wchar_t *">
16385 <prototype>
16386 <parameter content="wchar_t *restrict wto"/>
16387 <parameter content="const wchar_t *restrict wfrom"/>
16388 </prototype>
16389 <headers>
16390 <header filename = "wchar.h"/>
16391 </headers>
16392 <synopsis>
16393 This function is like &lt;CODE&gt;wcscpy&lt;/CODE&gt;, except that it returns a pointer to
16394 the end of the string &lt;VAR&gt;wto&lt;/VAR&gt; (that is, the address of the terminating
16395 null character &lt;CODE&gt;wto + strlen (wfrom)&lt;/CODE&gt;) rather than the beginning.
16396 &lt;br&gt;&lt;br&gt; This function is not part of ISO or POSIX but was found useful while
16397 developing the GNU C Library itself.
16398 &lt;br&gt;&lt;br&gt; The behavior of &lt;CODE&gt;wcpcpy&lt;/CODE&gt; is undefined if the strings overlap.
16399 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;wcpcpy&lt;/CODE&gt; is a GNU extension and is declared in &lt;TT&gt;wchar.h&lt;/TT&gt;.
16400 </synopsis>
16401 </function>
16402 </construct>
16403 <construct id="function-stpncpy" type="function">
16404 <function returntype="char *">
16405 <prototype>
16406 <parameter content="char *restrict to"/>
16407 <parameter content="const char *restrict from"/>
16408 <parameter content="size_t size"/>
16409 </prototype>
16410 <headers>
16411 <header filename = "string.h"/>
16412 </headers>
16413 <synopsis>
16414 This function is similar to &lt;CODE&gt;stpcpy&lt;/CODE&gt; but copies always exactly
16415 &lt;VAR&gt;size&lt;/VAR&gt; characters into &lt;VAR&gt;to&lt;/VAR&gt;.
16416 &lt;br&gt;&lt;br&gt; If the length of &lt;VAR&gt;from&lt;/VAR&gt; is more then &lt;VAR&gt;size&lt;/VAR&gt;, then &lt;CODE&gt;stpncpy&lt;/CODE&gt;
16417 copies just the first &lt;VAR&gt;size&lt;/VAR&gt; characters and returns a pointer to the
16418 character directly following the one which was copied last. Note that in
16419 this case there is no null terminator written into &lt;VAR&gt;to&lt;/VAR&gt;.
16420 &lt;br&gt;&lt;br&gt; If the length of &lt;VAR&gt;from&lt;/VAR&gt; is less than &lt;VAR&gt;size&lt;/VAR&gt;, then &lt;CODE&gt;stpncpy&lt;/CODE&gt;
16421 copies all of &lt;VAR&gt;from&lt;/VAR&gt;, followed by enough null characters to add up
16422 to &lt;VAR&gt;size&lt;/VAR&gt; characters in all. This behavior is rarely useful, but it
16423 is implemented to be useful in contexts where this behavior of the
16424 &lt;CODE&gt;strncpy&lt;/CODE&gt; is used. &lt;CODE&gt;stpncpy&lt;/CODE&gt; returns a pointer to the
16425 &lt;EM&gt;first&lt;/EM&gt; written null character.
16426 &lt;br&gt;&lt;br&gt; This function is not part of ISO or POSIX but was found useful while
16427 developing the GNU C Library itself.
16428 &lt;br&gt;&lt;br&gt; Its behavior is undefined if the strings overlap. The function is
16429 declared in &lt;TT&gt;string.h&lt;/TT&gt;.
16430 </synopsis>
16431 </function>
16432 </construct>
16433 <construct id="function-wcpncpy" type="function">
16434 <function returntype="wchar_t *">
16435 <prototype>
16436 <parameter content="wchar_t *restrict wto"/>
16437 <parameter content="const wchar_t *restrict wfrom"/>
16438 <parameter content="size_t size"/>
16439 </prototype>
16440 <headers>
16441 <header filename = "wchar.h"/>
16442 </headers>
16443 <synopsis>
16444 This function is similar to &lt;CODE&gt;wcpcpy&lt;/CODE&gt; but copies always exactly
16445 &lt;VAR&gt;wsize&lt;/VAR&gt; characters into &lt;VAR&gt;wto&lt;/VAR&gt;.
16446 &lt;br&gt;&lt;br&gt; If the length of &lt;VAR&gt;wfrom&lt;/VAR&gt; is more then &lt;VAR&gt;size&lt;/VAR&gt;, then
16447 &lt;CODE&gt;wcpncpy&lt;/CODE&gt; copies just the first &lt;VAR&gt;size&lt;/VAR&gt; wide characters and
16448 returns a pointer to the wide character directly following the last
16449 non-null wide character which was copied last. Note that in this case
16450 there is no null terminator written into &lt;VAR&gt;wto&lt;/VAR&gt;.
16451 &lt;br&gt;&lt;br&gt; If the length of &lt;VAR&gt;wfrom&lt;/VAR&gt; is less than &lt;VAR&gt;size&lt;/VAR&gt;, then &lt;CODE&gt;wcpncpy&lt;/CODE&gt;
16452 copies all of &lt;VAR&gt;wfrom&lt;/VAR&gt;, followed by enough null characters to add up
16453 to &lt;VAR&gt;size&lt;/VAR&gt; characters in all. This behavior is rarely useful, but it
16454 is implemented to be useful in contexts where this behavior of the
16455 &lt;CODE&gt;wcsncpy&lt;/CODE&gt; is used. &lt;CODE&gt;wcpncpy&lt;/CODE&gt; returns a pointer to the
16456 &lt;EM&gt;first&lt;/EM&gt; written null character.
16457 &lt;br&gt;&lt;br&gt; This function is not part of ISO or POSIX but was found useful while
16458 developing the GNU C Library itself.
16459 &lt;br&gt;&lt;br&gt; Its behavior is undefined if the strings overlap.
16460 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;wcpncpy&lt;/CODE&gt; is a GNU extension and is declared in &lt;TT&gt;wchar.h&lt;/TT&gt;.
16461 </synopsis>
16462 </function>
16463 </construct>
16464 <construct id="function-strcat" type="function">
16465 <function returntype="char *">
16466 <prototype>
16467 <parameter content="char *restrict to"/>
16468 <parameter content="const char *restrict from"/>
16469 </prototype>
16470 <headers>
16471 <header filename = "string.h"/>
16472 </headers>
16473 <synopsis>
16474 The &lt;CODE&gt;strcat&lt;/CODE&gt; function is similar to &lt;CODE&gt;strcpy&lt;/CODE&gt;, except that the
16475 characters from &lt;VAR&gt;from&lt;/VAR&gt; are concatenated or appended to the end of
16476 &lt;VAR&gt;to&lt;/VAR&gt;, instead of overwriting it. That is, the first character from
16477 &lt;VAR&gt;from&lt;/VAR&gt; overwrites the null character marking the end of &lt;VAR&gt;to&lt;/VAR&gt;.
16478 &lt;br&gt;&lt;br&gt; An equivalent definition for &lt;CODE&gt;strcat&lt;/CODE&gt; would be:
16479 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
16480 char *&lt;br&gt;
16481 strcat (char *restrict to, const char *restrict from)&lt;br&gt;
16482 {&lt;br&gt;
16483 strcpy (to + strlen (to), from);&lt;br&gt;
16484 return to;&lt;br&gt;
16485 }&lt;br&gt;
16486 &lt;/pre&gt;
16487 &lt;br&gt;&lt;br&gt; This function has undefined results if the strings overlap.
16488 </synopsis>
16489 </function>
16490 </construct>
16491 <construct id="function-wcscat" type="function">
16492 <function returntype="wchar_t *">
16493 <prototype>
16494 <parameter content="wchar_t *restrict wto"/>
16495 <parameter content="const wchar_t *restrict wfrom"/>
16496 </prototype>
16497 <headers>
16498 <header filename = "wchar.h"/>
16499 </headers>
16500 <synopsis>
16501 The &lt;CODE&gt;wcscat&lt;/CODE&gt; function is similar to &lt;CODE&gt;wcscpy&lt;/CODE&gt;, except that the
16502 characters from &lt;VAR&gt;wfrom&lt;/VAR&gt; are concatenated or appended to the end of
16503 &lt;VAR&gt;wto&lt;/VAR&gt;, instead of overwriting it. That is, the first character from
16504 &lt;VAR&gt;wfrom&lt;/VAR&gt; overwrites the null character marking the end of &lt;VAR&gt;wto&lt;/VAR&gt;.
16505 &lt;br&gt;&lt;br&gt; An equivalent definition for &lt;CODE&gt;wcscat&lt;/CODE&gt; would be:
16506 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
16507 wchar_t *&lt;br&gt;
16508 wcscat (wchar_t *wto, const wchar_t *wfrom)&lt;br&gt;
16509 {&lt;br&gt;
16510 wcscpy (wto + wcslen (wto), wfrom);&lt;br&gt;
16511 return wto;&lt;br&gt;
16512 }&lt;br&gt;
16513 &lt;/pre&gt;
16514 &lt;br&gt;&lt;br&gt; This function has undefined results if the strings overlap.
16515 </synopsis>
16516 </function>
16517 </construct>
16518 <construct id="function-strncat" type="function">
16519 <function returntype="char *">
16520 <prototype>
16521 <parameter content="char *restrict to"/>
16522 <parameter content="const char *restrict from"/>
16523 <parameter content="size_t size"/>
16524 </prototype>
16525 <headers>
16526 <header filename = "string.h"/>
16527 </headers>
16528 <synopsis>
16529 This function is like &lt;CODE&gt;strcat&lt;/CODE&gt; except that not more than &lt;VAR&gt;size&lt;/VAR&gt;
16530 characters from &lt;VAR&gt;from&lt;/VAR&gt; are appended to the end of &lt;VAR&gt;to&lt;/VAR&gt;. A
16531 single null character is also always appended to &lt;VAR&gt;to&lt;/VAR&gt;, so the total
16532 allocated size of &lt;VAR&gt;to&lt;/VAR&gt; must be at least &lt;CODE&gt;&lt;VAR&gt;size&lt;/VAR&gt; + 1&lt;/CODE&gt; bytes
16533 longer than its initial length.
16534 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;strncat&lt;/CODE&gt; function could be implemented like this:
16535 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
16536 &lt;br&gt;
16537 char *&lt;br&gt;
16538 strncat (char *to, const char *from, size_t size)&lt;br&gt;
16539 {&lt;br&gt;
16540 to[strlen (to) + size] = '\0';&lt;br&gt;
16541 strncpy (to + strlen (to), from, size);&lt;br&gt;
16542 return to;&lt;br&gt;
16543 }&lt;br&gt;
16544 &lt;br&gt;
16545 &lt;/pre&gt;
16546 &lt;br&gt;&lt;br&gt; The behavior of &lt;CODE&gt;strncat&lt;/CODE&gt; is undefined if the strings overlap.
16547 </synopsis>
16548 </function>
16549 </construct>
16550 <construct id="function-wcsncat" type="function">
16551 <function returntype="wchar_t *">
16552 <prototype>
16553 <parameter content="wchar_t *restrict wto"/>
16554 <parameter content="const wchar_t *restrict wfrom"/>
16555 <parameter content="size_t size"/>
16556 </prototype>
16557 <headers>
16558 <header filename = "wchar.h"/>
16559 </headers>
16560 <synopsis>
16561 This function is like &lt;CODE&gt;wcscat&lt;/CODE&gt; except that not more than &lt;VAR&gt;size&lt;/VAR&gt;
16562 characters from &lt;VAR&gt;from&lt;/VAR&gt; are appended to the end of &lt;VAR&gt;to&lt;/VAR&gt;. A
16563 single null character is also always appended to &lt;VAR&gt;to&lt;/VAR&gt;, so the total
16564 allocated size of &lt;VAR&gt;to&lt;/VAR&gt; must be at least &lt;CODE&gt;&lt;VAR&gt;size&lt;/VAR&gt; + 1&lt;/CODE&gt; bytes
16565 longer than its initial length.
16566 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;wcsncat&lt;/CODE&gt; function could be implemented like this:
16567 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
16568 &lt;br&gt;
16569 wchar_t *&lt;br&gt;
16570 wcsncat (wchar_t *restrict wto, const wchar_t *restrict wfrom,&lt;br&gt;
16571 size_t size)&lt;br&gt;
16572 {&lt;br&gt;
16573 wto[wcslen (to) + size] = L'\0';&lt;br&gt;
16574 wcsncpy (wto + wcslen (wto), wfrom, size);&lt;br&gt;
16575 return wto;&lt;br&gt;
16576 }&lt;br&gt;
16577 &lt;br&gt;
16578 &lt;/pre&gt;
16579 &lt;br&gt;&lt;br&gt; The behavior of &lt;CODE&gt;wcsncat&lt;/CODE&gt; is undefined if the strings overlap.
16580 </synopsis>
16581 </function>
16582 </construct>
16583 <construct id="function-bcopy" type="function">
16584 <function returntype="void">
16585 <prototype>
16586 <parameter content="const void *from"/>
16587 <parameter content="void *to"/>
16588 <parameter content="size_t size"/>
16589 </prototype>
16590 <headers>
16591 <header filename = "string.h"/>
16592 </headers>
16593 <synopsis>
16594 This is a partially obsolete alternative for &lt;CODE&gt;memmove&lt;/CODE&gt;, derived from
16595 BSD. Note that it is not quite equivalent to &lt;CODE&gt;memmove&lt;/CODE&gt;, because the
16596 arguments are not in the same order and there is no return value.
16597 </synopsis>
16598 </function>
16599 </construct>
16600 <construct id="function-bzero" type="function">
16601 <function returntype="void">
16602 <prototype>
16603 <parameter content="void *block"/>
16604 <parameter content="size_t size"/>
16605 </prototype>
16606 <headers>
16607 <header filename = "string.h"/>
16608 </headers>
16609 <synopsis>
16610 This is a partially obsolete alternative for &lt;CODE&gt;memset&lt;/CODE&gt;, derived from
16611 BSD. Note that it is not as general as &lt;CODE&gt;memset&lt;/CODE&gt;, because the only
16612 value it can store is zero.
16613 </synopsis>
16614 </function>
16615 </construct>
16616 <construct id="function-memcmp" type="function">
16617 <function returntype="int">
16618 <prototype>
16619 <parameter content="const void *a1"/>
16620 <parameter content="const void *a2"/>
16621 <parameter content="size_t size"/>
16622 </prototype>
16623 <headers>
16624 <header filename = "string.h"/>
16625 </headers>
16626 <synopsis>
16627 The function &lt;CODE&gt;memcmp&lt;/CODE&gt; compares the &lt;VAR&gt;size&lt;/VAR&gt; bytes of memory
16628 beginning at &lt;VAR&gt;a1&lt;/VAR&gt; against the &lt;VAR&gt;size&lt;/VAR&gt; bytes of memory beginning
16629 at &lt;VAR&gt;a2&lt;/VAR&gt;. The value returned has the same sign as the difference
16630 between the first differing pair of bytes (interpreted as &lt;CODE&gt;unsigned
16631 char&lt;/CODE&gt; objects, then promoted to &lt;CODE&gt;int&lt;/CODE&gt;).
16632 &lt;br&gt;&lt;br&gt; If the contents of the two blocks are equal, &lt;CODE&gt;memcmp&lt;/CODE&gt; returns
16633 &lt;CODE&gt;0&lt;/CODE&gt;.
16634 </synopsis>
16635 </function>
16636 </construct>
16637 <construct id="function-wmemcmp" type="function">
16638 <function returntype="int">
16639 <prototype>
16640 <parameter content="const wchar_t *a1"/>
16641 <parameter content="const wchar_t *a2"/>
16642 <parameter content="size_t size"/>
16643 </prototype>
16644 <headers>
16645 <header filename = "wcjar.h"/>
16646 </headers>
16647 <synopsis>
16648 The function &lt;CODE&gt;wmemcmp&lt;/CODE&gt; compares the &lt;VAR&gt;size&lt;/VAR&gt; wide characters
16649 beginning at &lt;VAR&gt;a1&lt;/VAR&gt; against the &lt;VAR&gt;size&lt;/VAR&gt; wide characters beginning
16650 at &lt;VAR&gt;a2&lt;/VAR&gt;. The value returned is smaller than or larger than zero
16651 depending on whether the first differing wide character is &lt;VAR&gt;a1&lt;/VAR&gt; is
16652 smaller or larger than the corresponding character in &lt;VAR&gt;a2&lt;/VAR&gt;.
16653 &lt;br&gt;&lt;br&gt; If the contents of the two blocks are equal, &lt;CODE&gt;wmemcmp&lt;/CODE&gt; returns
16654 &lt;CODE&gt;0&lt;/CODE&gt;.
16655 </synopsis>
16656 </function>
16657 </construct>
16658 <construct id="function-strcmp" type="function">
16659 <function returntype="int">
16660 <prototype>
16661 <parameter content="const char *s1"/>
16662 <parameter content="const char *s2"/>
16663 </prototype>
16664 <headers>
16665 <header filename = "string.h"/>
16666 </headers>
16667 <synopsis>
16668 The &lt;CODE&gt;strcmp&lt;/CODE&gt; function compares the string &lt;VAR&gt;s1&lt;/VAR&gt; against
16669 &lt;VAR&gt;s2&lt;/VAR&gt;, returning a value that has the same sign as the difference
16670 between the first differing pair of characters (interpreted as
16671 &lt;CODE&gt;unsigned char&lt;/CODE&gt; objects, then promoted to &lt;CODE&gt;int&lt;/CODE&gt;).
16672 &lt;br&gt;&lt;br&gt; If the two strings are equal, &lt;CODE&gt;strcmp&lt;/CODE&gt; returns &lt;CODE&gt;0&lt;/CODE&gt;.
16673 &lt;br&gt;&lt;br&gt; A consequence of the ordering used by &lt;CODE&gt;strcmp&lt;/CODE&gt; is that if &lt;VAR&gt;s1&lt;/VAR&gt;
16674 is an initial substring of &lt;VAR&gt;s2&lt;/VAR&gt;, then &lt;VAR&gt;s1&lt;/VAR&gt; is considered to be
16675 ``less than'' &lt;VAR&gt;s2&lt;/VAR&gt;.
16676 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;strcmp&lt;/CODE&gt; does not take sorting conventions of the language the
16677 strings are written in into account. To get that one has to use
16678 &lt;CODE&gt;strcoll&lt;/CODE&gt;.
16679 </synopsis>
16680 </function>
16681 </construct>
16682 <construct id="function-wcscmp" type="function">
16683 <function returntype="int">
16684 <prototype>
16685 <parameter content="const wchar_t *ws1"/>
16686 <parameter content="const wchar_t *ws2"/>
16687 </prototype>
16688 <headers>
16689 <header filename = "wchar.h"/>
16690 </headers>
16691 <synopsis>
16692 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;wcscmp&lt;/CODE&gt; function compares the wide character string &lt;VAR&gt;ws1&lt;/VAR&gt;
16693 against &lt;VAR&gt;ws2&lt;/VAR&gt;. The value returned is smaller than or larger than zero
16694 depending on whether the first differing wide character is &lt;VAR&gt;ws1&lt;/VAR&gt; is
16695 smaller or larger than the corresponding character in &lt;VAR&gt;ws2&lt;/VAR&gt;.
16696 &lt;br&gt;&lt;br&gt; If the two strings are equal, &lt;CODE&gt;wcscmp&lt;/CODE&gt; returns &lt;CODE&gt;0&lt;/CODE&gt;.
16697 &lt;br&gt;&lt;br&gt; A consequence of the ordering used by &lt;CODE&gt;wcscmp&lt;/CODE&gt; is that if &lt;VAR&gt;ws1&lt;/VAR&gt;
16698 is an initial substring of &lt;VAR&gt;ws2&lt;/VAR&gt;, then &lt;VAR&gt;ws1&lt;/VAR&gt; is considered to be
16699 ``less than'' &lt;VAR&gt;ws2&lt;/VAR&gt;.
16700 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;wcscmp&lt;/CODE&gt; does not take sorting conventions of the language the
16701 strings are written in into account. To get that one has to use
16702 &lt;CODE&gt;wcscoll&lt;/CODE&gt;.
16703 </synopsis>
16704 </function>
16705 </construct>
16706 <construct id="function-strcasecmp" type="function">
16707 <function returntype="int">
16708 <prototype>
16709 <parameter content="const char *s1"/>
16710 <parameter content="const char *s2"/>
16711 </prototype>
16712 <headers>
16713 <header filename = "string.h"/>
16714 </headers>
16715 <synopsis>
16716 This function is like &lt;CODE&gt;strcmp&lt;/CODE&gt;, except that differences in case are
16717 ignored. How uppercase and lowercase characters are related is
16718 determined by the currently selected locale. In the standard &lt;CODE&gt;"C"&lt;/CODE&gt;
16719 locale the characters "A and "a do not match but in a locale which
16720 regards these characters as parts of the alphabet they do match.
16721 &lt;br&gt;&lt;br&gt;
16722 &lt;CODE&gt;strcasecmp&lt;/CODE&gt; is derived from BSD.
16723 </synopsis>
16724 </function>
16725 </construct>
16726 <construct id="function-wcscasecmp" type="function">
16727 <function returntype="int">
16728 <prototype>
16729 <parameter content="const wchar_t *ws1"/>
16730 <parameter content="const wchar_T *ws2"/>
16731 </prototype>
16732 <headers>
16733 <header filename = "wchar.h"/>
16734 </headers>
16735 <synopsis>
16736 This function is like &lt;CODE&gt;wcscmp&lt;/CODE&gt;, except that differences in case are
16737 ignored. How uppercase and lowercase characters are related is
16738 determined by the currently selected locale. In the standard &lt;CODE&gt;"C"&lt;/CODE&gt;
16739 locale the characters "A and "a do not match but in a locale which
16740 regards these characters as parts of the alphabet they do match.
16741 &lt;br&gt;&lt;br&gt;
16742 &lt;CODE&gt;wcscasecmp&lt;/CODE&gt; is a GNU extension.
16743 </synopsis>
16744 </function>
16745 </construct>
16746 <construct id="function-strncmp" type="function">
16747 <function returntype="int">
16748 <prototype>
16749 <parameter content="const char *s1"/>
16750 <parameter content="const char *s2"/>
16751 <parameter content="size_t size"/>
16752 </prototype>
16753 <headers>
16754 <header filename = "string.h"/>
16755 </headers>
16756 <synopsis>
16757 This function is the similar to &lt;CODE&gt;strcmp&lt;/CODE&gt;, except that no more than
16758 &lt;VAR&gt;size&lt;/VAR&gt; characters are compared. In other words, if the two
16759 strings are the same in their first &lt;VAR&gt;size&lt;/VAR&gt; characters, the
16760 return value is zero.
16761 </synopsis>
16762 </function>
16763 </construct>
16764 <construct id="function-wcsncmp" type="function">
16765 <function returntype="int">
16766 <prototype>
16767 <parameter content="const wchar_t *ws1"/>
16768 <parameter content="const wchar_t *ws2"/>
16769 <parameter content="size_t size"/>
16770 </prototype>
16771 <headers>
16772 <header filename = "wchar.h"/>
16773 </headers>
16774 <synopsis>
16775 This function is the similar to &lt;CODE&gt;wcscmp&lt;/CODE&gt;, except that no more than
16776 &lt;VAR&gt;size&lt;/VAR&gt; wide characters are compared. In other words, if the two
16777 strings are the same in their first &lt;VAR&gt;size&lt;/VAR&gt; wide characters, the
16778 return value is zero.
16779 </synopsis>
16780 </function>
16781 </construct>
16782 <construct id="function-strncasecmp" type="function">
16783 <function returntype="int">
16784 <prototype>
16785 <parameter content="const char *s1"/>
16786 <parameter content="const char *s2"/>
16787 <parameter content="size_t n"/>
16788 </prototype>
16789 <headers>
16790 <header filename = "string.h"/>
16791 </headers>
16792 <synopsis>
16793 This function is like &lt;CODE&gt;strncmp&lt;/CODE&gt;, except that differences in case
16794 are ignored. Like &lt;CODE&gt;strcasecmp&lt;/CODE&gt;, it is locale dependent how
16795 uppercase and lowercase characters are related.
16796 &lt;br&gt;&lt;br&gt;
16797 &lt;CODE&gt;strncasecmp&lt;/CODE&gt; is a GNU extension.
16798 </synopsis>
16799 </function>
16800 </construct>
16801 <construct id="function-wcsncasecmp" type="function">
16802 <function returntype="int">
16803 <prototype>
16804 <parameter content="const wchar_t *ws1"/>
16805 <parameter content="const wchar_t *s2"/>
16806 <parameter content="size_t n"/>
16807 </prototype>
16808 <headers>
16809 <header filename = "wchar.h"/>
16810 </headers>
16811 <synopsis>
16812 This function is like &lt;CODE&gt;wcsncmp&lt;/CODE&gt;, except that differences in case
16813 are ignored. Like &lt;CODE&gt;wcscasecmp&lt;/CODE&gt;, it is locale dependent how
16814 uppercase and lowercase characters are related.
16815 &lt;br&gt;&lt;br&gt;
16816 &lt;CODE&gt;wcsncasecmp&lt;/CODE&gt; is a GNU extension.
16817 </synopsis>
16818 </function>
16819 </construct>
16820 <construct id="function-strverscmp" type="function">
16821 <function returntype="int">
16822 <prototype>
16823 <parameter content="const char *s1"/>
16824 <parameter content="const char *s2"/>
16825 </prototype>
16826 <headers>
16827 <header filename = "string.h"/>
16828 </headers>
16829 <synopsis>
16830 The &lt;CODE&gt;strverscmp&lt;/CODE&gt; function compares the string &lt;VAR&gt;s1&lt;/VAR&gt; against
16831 &lt;VAR&gt;s2&lt;/VAR&gt;, considering them as holding indices/version numbers. Return
16832 value follows the same conventions as found in the &lt;CODE&gt;strverscmp&lt;/CODE&gt;
16833 function. In fact, if &lt;VAR&gt;s1&lt;/VAR&gt; and &lt;VAR&gt;s2&lt;/VAR&gt; contain no digits,
16834 &lt;CODE&gt;strverscmp&lt;/CODE&gt; behaves like &lt;CODE&gt;strcmp&lt;/CODE&gt;.
16835 &lt;br&gt;&lt;br&gt; Basically, we compare strings normally (character by character), until
16836 we find a digit in each string - then we enter a special comparison
16837 mode, where each sequence of digits is taken as a whole. If we reach the
16838 end of these two parts without noticing a difference, we return to the
16839 standard comparison mode. There are two types of numeric parts:
16840 "integral" and "fractional" (those begin with a '0'). The types
16841 of the numeric parts affect the way we sort them:
16842 &lt;br&gt;&lt;br&gt; &lt;OL&gt;
16843 &lt;LI&gt;
16844 integral/integral: we compare values as you would expect.
16845 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
16846 fractional/integral: the fractional part is less than the integral one.
16847 Again, no surprise.
16848 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
16849 fractional/fractional: the things become a bit more complex.
16850 If the common prefix contains only leading zeroes, the longest part is less
16851 than the other one; else the comparison behaves normally.
16852 &lt;/OL&gt;
16853 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
16854 strverscmp ("no digit", "no digit")&lt;br&gt;
16855 0 /* same behavior as strcmp. */&lt;br&gt;
16856 strverscmp ("item#99", "item#100")&lt;br&gt;
16857 &lt;0 /* same prefix, but 99 &lt; 100. */&lt;br&gt;
16858 strverscmp ("alpha1", "alpha001")&lt;br&gt;
16859 &gt;0 /* fractional part inferior to integral one. */&lt;br&gt;
16860 strverscmp ("part1_f012", "part1_f01")&lt;br&gt;
16861 &gt;0 /* two fractional parts. */&lt;br&gt;
16862 strverscmp ("foo.009", "foo.0")&lt;br&gt;
16863 &lt;0 /* idem, but with leading zeroes only. */&lt;br&gt;
16864 &lt;/pre&gt;
16865 &lt;br&gt;&lt;br&gt; This function is especially useful when dealing with filename sorting,
16866 because filenames frequently hold indices/version numbers.
16867 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;strverscmp&lt;/CODE&gt; is a GNU extension.
16868 </synopsis>
16869 </function>
16870 </construct>
16871 <construct id="function-bcmp" type="function">
16872 <function returntype="int">
16873 <prototype>
16874 <parameter content="const void *a1"/>
16875 <parameter content="const void *a2"/>
16876 <parameter content="size_t size"/>
16877 </prototype>
16878 <headers>
16879 <header filename = "string.h"/>
16880 </headers>
16881 <synopsis>
16882 This is an obsolete alias for &lt;CODE&gt;memcmp&lt;/CODE&gt;, derived from BSD.
16883 </synopsis>
16884 </function>
16885 </construct>
16886 <construct id="function-strcoll" type="function">
16887 <function returntype="int">
16888 <prototype>
16889 <parameter content="const char *s1"/>
16890 <parameter content="const char *s2"/>
16891 </prototype>
16892 <headers>
16893 <header filename = "string.h"/>
16894 </headers>
16895 <synopsis>
16896 The &lt;CODE&gt;strcoll&lt;/CODE&gt; function is similar to &lt;CODE&gt;strcmp&lt;/CODE&gt; but uses the
16897 collating sequence of the current locale for collation (the
16898 &lt;CODE&gt;LC_COLLATE&lt;/CODE&gt; locale).
16899 </synopsis>
16900 </function>
16901 </construct>
16902 <construct id="function-wcscoll" type="function">
16903 <function returntype="int">
16904 <prototype>
16905 <parameter content="const wchar_t *ws1"/>
16906 <parameter content="const wchar_t *ws2"/>
16907 </prototype>
16908 <headers>
16909 <header filename = "wchar.h"/>
16910 </headers>
16911 <synopsis>
16912 The &lt;CODE&gt;wcscoll&lt;/CODE&gt; function is similar to &lt;CODE&gt;wcscmp&lt;/CODE&gt; but uses the
16913 collating sequence of the current locale for collation (the
16914 &lt;CODE&gt;LC_COLLATE&lt;/CODE&gt; locale).
16915 </synopsis>
16916 </function>
16917 </construct>
16918 <construct id="function-strxfrm" type="function">
16919 <function returntype="size_t">
16920 <prototype>
16921 <parameter content="char *restrict to"/>
16922 <parameter content="const char *restrict from"/>
16923 <parameter content="size_t size"/>
16924 </prototype>
16925 <headers>
16926 <header filename = "string.h"/>
16927 </headers>
16928 <synopsis>
16929 The function &lt;CODE&gt;strxfrm&lt;/CODE&gt; transforms the string &lt;VAR&gt;from&lt;/VAR&gt; using the
16930 collation transformation determined by the locale currently selected for
16931 collation, and stores the transformed string in the array &lt;VAR&gt;to&lt;/VAR&gt;. Up
16932 to &lt;VAR&gt;size&lt;/VAR&gt; characters (including a terminating null character) are
16933 stored.
16934 &lt;br&gt;&lt;br&gt; The behavior is undefined if the strings &lt;VAR&gt;to&lt;/VAR&gt; and &lt;VAR&gt;from&lt;/VAR&gt;
16935 overlap; see Copying and Concatenation.
16936 &lt;br&gt;&lt;br&gt; The return value is the length of the entire transformed string. This
16937 value is not affected by the value of &lt;VAR&gt;size&lt;/VAR&gt;, but if it is greater
16938 or equal than &lt;VAR&gt;size&lt;/VAR&gt;, it means that the transformed string did not
16939 entirely fit in the array &lt;VAR&gt;to&lt;/VAR&gt;. In this case, only as much of the
16940 string as actually fits was stored. To get the whole transformed
16941 string, call &lt;CODE&gt;strxfrm&lt;/CODE&gt; again with a bigger output array.
16942 &lt;br&gt;&lt;br&gt; The transformed string may be longer than the original string, and it
16943 may also be shorter.
16944 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;size&lt;/VAR&gt; is zero, no characters are stored in &lt;VAR&gt;to&lt;/VAR&gt;. In this
16945 case, &lt;CODE&gt;strxfrm&lt;/CODE&gt; simply returns the number of characters that would
16946 be the length of the transformed string. This is useful for determining
16947 what size the allocated array should be. It does not matter what
16948 &lt;VAR&gt;to&lt;/VAR&gt; is if &lt;VAR&gt;size&lt;/VAR&gt; is zero; &lt;VAR&gt;to&lt;/VAR&gt; may even be a null pointer.
16949 </synopsis>
16950 </function>
16951 </construct>
16952 <construct id="function-wcsxfrm" type="function">
16953 <function returntype="size_t">
16954 <prototype>
16955 <parameter content="wchar_t *restrict wto"/>
16956 <parameter content="const wchar_t *wfrom"/>
16957 <parameter content="size_t size"/>
16958 </prototype>
16959 <headers>
16960 <header filename = "wchar.h"/>
16961 </headers>
16962 <synopsis>
16963 The function &lt;CODE&gt;wcsxfrm&lt;/CODE&gt; transforms wide character string &lt;VAR&gt;wfrom&lt;/VAR&gt;
16964 using the collation transformation determined by the locale currently
16965 selected for collation, and stores the transformed string in the array
16966 &lt;VAR&gt;wto&lt;/VAR&gt;. Up to &lt;VAR&gt;size&lt;/VAR&gt; wide characters (including a terminating null
16967 character) are stored.
16968 &lt;br&gt;&lt;br&gt; The behavior is undefined if the strings &lt;VAR&gt;wto&lt;/VAR&gt; and &lt;VAR&gt;wfrom&lt;/VAR&gt;
16969 overlap; see Copying and Concatenation.
16970 &lt;br&gt;&lt;br&gt; The return value is the length of the entire transformed wide character
16971 string. This value is not affected by the value of &lt;VAR&gt;size&lt;/VAR&gt;, but if
16972 it is greater or equal than &lt;VAR&gt;size&lt;/VAR&gt;, it means that the transformed
16973 wide character string did not entirely fit in the array &lt;VAR&gt;wto&lt;/VAR&gt;. In
16974 this case, only as much of the wide character string as actually fits
16975 was stored. To get the whole transformed wide character string, call
16976 &lt;CODE&gt;wcsxfrm&lt;/CODE&gt; again with a bigger output array.
16977 &lt;br&gt;&lt;br&gt; The transformed wide character string may be longer than the original
16978 wide character string, and it may also be shorter.
16979 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;size&lt;/VAR&gt; is zero, no characters are stored in &lt;VAR&gt;to&lt;/VAR&gt;. In this
16980 case, &lt;CODE&gt;wcsxfrm&lt;/CODE&gt; simply returns the number of wide characters that
16981 would be the length of the transformed wide character string. This is
16982 useful for determining what size the allocated array should be (remember
16983 to multiply with &lt;CODE&gt;sizeof (wchar_t)&lt;/CODE&gt;). It does not matter what
16984 &lt;VAR&gt;wto&lt;/VAR&gt; is if &lt;VAR&gt;size&lt;/VAR&gt; is zero; &lt;VAR&gt;wto&lt;/VAR&gt; may even be a null pointer.
16985 </synopsis>
16986 </function>
16987 </construct>
16988 <construct id="function-memchr" type="function">
16989 <function returntype="void *">
16990 <prototype>
16991 <parameter content="const void *block"/>
16992 <parameter content="int c"/>
16993 <parameter content="size_t size"/>
16994 </prototype>
16995 <headers>
16996 <header filename = "string.h"/>
16997 </headers>
16998 <synopsis>
16999 This function finds the first occurrence of the byte &lt;VAR&gt;c&lt;/VAR&gt; (converted
17000 to an &lt;CODE&gt;unsigned char&lt;/CODE&gt;) in the initial &lt;VAR&gt;size&lt;/VAR&gt; bytes of the
17001 object beginning at &lt;VAR&gt;block&lt;/VAR&gt;. The return value is a pointer to the
17002 located byte, or a null pointer if no match was found.
17003 </synopsis>
17004 </function>
17005 </construct>
17006 <construct id="function-wmemchr" type="function">
17007 <function returntype="wchar_t *">
17008 <prototype>
17009 <parameter content="const wchar_t *block"/>
17010 <parameter content="wchar_t wc"/>
17011 <parameter content="size_t size"/>
17012 </prototype>
17013 <headers>
17014 <header filename = "wchar.h"/>
17015 </headers>
17016 <synopsis>
17017 This function finds the first occurrence of the wide character &lt;VAR&gt;wc&lt;/VAR&gt;
17018 in the initial &lt;VAR&gt;size&lt;/VAR&gt; wide characters of the object beginning at
17019 &lt;VAR&gt;block&lt;/VAR&gt;. The return value is a pointer to the located wide
17020 character, or a null pointer if no match was found.
17021 </synopsis>
17022 </function>
17023 </construct>
17024 <construct id="function-rawmemchr" type="function">
17025 <function returntype="void *">
17026 <prototype>
17027 <parameter content="const void *block"/>
17028 <parameter content="int c"/>
17029 </prototype>
17030 <headers>
17031 <header filename = "string.h"/>
17032 </headers>
17033 <synopsis>
17034 Often the &lt;CODE&gt;memchr&lt;/CODE&gt; function is used with the knowledge that the
17035 byte &lt;VAR&gt;c&lt;/VAR&gt; is available in the memory block specified by the
17036 parameters. But this means that the &lt;VAR&gt;size&lt;/VAR&gt; parameter is not really
17037 needed and that the tests performed with it at runtime (to check whether
17038 the end of the block is reached) are not needed.
17039 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;rawmemchr&lt;/CODE&gt; function exists for just this situation which is
17040 surprisingly frequent. The interface is similar to &lt;CODE&gt;memchr&lt;/CODE&gt; except
17041 that the &lt;VAR&gt;size&lt;/VAR&gt; parameter is missing. The function will look beyond
17042 the end of the block pointed to by &lt;VAR&gt;block&lt;/VAR&gt; in case the programmer
17043 made an error in assuming that the byte &lt;VAR&gt;c&lt;/VAR&gt; is present in the block.
17044 In this case the result is unspecified. Otherwise the return value is a
17045 pointer to the located byte.
17046 &lt;br&gt;&lt;br&gt; This function is of special interest when looking for the end of a
17047 string. Since all strings are terminated by a null byte a call like
17048 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
17049 rawmemchr (str, '\0')&lt;br&gt;
17050 &lt;/pre&gt;
17051 &lt;br&gt;&lt;br&gt;
17052 will never go beyond the end of the string.
17053 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
17054 </synopsis>
17055 </function>
17056 </construct>
17057 <construct id="function-memrchr" type="function">
17058 <function returntype="void *">
17059 <prototype>
17060 <parameter content="const void *block"/>
17061 <parameter content="int c"/>
17062 <parameter content="size_t size"/>
17063 </prototype>
17064 <headers>
17065 <header filename = "string.h"/>
17066 </headers>
17067 <synopsis>
17068 The function &lt;CODE&gt;memrchr&lt;/CODE&gt; is like &lt;CODE&gt;memchr&lt;/CODE&gt;, except that it searches
17069 backwards from the end of the block defined by &lt;VAR&gt;block&lt;/VAR&gt; and &lt;VAR&gt;size&lt;/VAR&gt;
17070 (instead of forwards from the front).
17071 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
17072 </synopsis>
17073 </function>
17074 </construct>
17075 <construct id="function-strchr" type="function">
17076 <function returntype="char *">
17077 <prototype>
17078 <parameter content="const char *string"/>
17079 <parameter content="int c"/>
17080 </prototype>
17081 <headers>
17082 <header filename = "string.h"/>
17083 </headers>
17084 <synopsis>
17085 The &lt;CODE&gt;strchr&lt;/CODE&gt; function finds the first occurrence of the character
17086 &lt;VAR&gt;c&lt;/VAR&gt; (converted to a &lt;CODE&gt;char&lt;/CODE&gt;) in the null-terminated string
17087 beginning at &lt;VAR&gt;string&lt;/VAR&gt;. The return value is a pointer to the located
17088 character, or a null pointer if no match was found.
17089 &lt;br&gt;&lt;br&gt; For example,
17090 &lt;pre&gt;&lt;br&gt;
17091 strchr ("hello, world", 'l')&lt;br&gt;
17092 "llo, world"&lt;br&gt;
17093 strchr ("hello, world", '?')&lt;br&gt;
17094 NULL&lt;br&gt;
17095 &lt;/pre&gt;
17096 &lt;br&gt;&lt;br&gt; The terminating null character is considered to be part of the string,
17097 so you can use this function get a pointer to the end of a string by
17098 specifying a null character as the value of the &lt;VAR&gt;c&lt;/VAR&gt; argument. It
17099 would be better (but less portable) to use &lt;CODE&gt;strchrnul&lt;/CODE&gt; in this
17100 case, though.
17101 </synopsis>
17102 </function>
17103 </construct>
17104 <construct id="function-wcschr" type="function">
17105 <function returntype="wchar_t *">
17106 <prototype>
17107 <parameter content="const wchar_t *wstring"/>
17108 <parameter content="int wc"/>
17109 </prototype>
17110 <headers>
17111 <header filename = "wchar.h"/>
17112 </headers>
17113 <synopsis>
17114 The &lt;CODE&gt;wcschr&lt;/CODE&gt; function finds the first occurrence of the wide
17115 character &lt;VAR&gt;wc&lt;/VAR&gt; in the null-terminated wide character string
17116 beginning at &lt;VAR&gt;wstring&lt;/VAR&gt;. The return value is a pointer to the
17117 located wide character, or a null pointer if no match was found.
17118 &lt;br&gt;&lt;br&gt; The terminating null character is considered to be part of the wide
17119 character string, so you can use this function get a pointer to the end
17120 of a wide character string by specifying a null wude character as the
17121 value of the &lt;VAR&gt;wc&lt;/VAR&gt; argument. It would be better (but less portable)
17122 to use &lt;CODE&gt;wcschrnul&lt;/CODE&gt; in this case, though.
17123 </synopsis>
17124 </function>
17125 </construct>
17126 <construct id="function-strchrnul" type="function">
17127 <function returntype="char *">
17128 <prototype>
17129 <parameter content="const char *string"/>
17130 <parameter content="int c"/>
17131 </prototype>
17132 <headers>
17133 <header filename = "string.h"/>
17134 </headers>
17135 <synopsis>
17136 &lt;CODE&gt;strchrnul&lt;/CODE&gt; is the same as &lt;CODE&gt;strchr&lt;/CODE&gt; except that if it does
17137 not find the character, it returns a pointer to string's terminating
17138 null character rather than a null pointer.
17139 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
17140 </synopsis>
17141 </function>
17142 </construct>
17143 <construct id="function-wcschrnul" type="function">
17144 <function returntype="wchar_t *">
17145 <prototype>
17146 <parameter content="const wchar_t *wstring"/>
17147 <parameter content="wchar_t wc"/>
17148 </prototype>
17149 <headers>
17150 <header filename = "wchar.h"/>
17151 </headers>
17152 <synopsis>
17153 &lt;CODE&gt;wcschrnul&lt;/CODE&gt; is the same as &lt;CODE&gt;wcschr&lt;/CODE&gt; except that if it does not
17154 find the wide character, it returns a pointer to wide character string's
17155 terminating null wide character rather than a null pointer.
17156 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
17157 </synopsis>
17158 </function>
17159 </construct>
17160 <construct id="function-strrchr" type="function">
17161 <function returntype="char *">
17162 <prototype>
17163 <parameter content="const char *string"/>
17164 <parameter content="int c"/>
17165 </prototype>
17166 <headers>
17167 <header filename = "string.h"/>
17168 </headers>
17169 <synopsis>
17170 The function &lt;CODE&gt;strrchr&lt;/CODE&gt; is like &lt;CODE&gt;strchr&lt;/CODE&gt;, except that it searches
17171 backwards from the end of the string &lt;VAR&gt;string&lt;/VAR&gt; (instead of forwards
17172 from the front).
17173 &lt;br&gt;&lt;br&gt; For example,
17174 &lt;pre&gt;&lt;br&gt;
17175 strrchr ("hello, world", 'l')&lt;br&gt;
17176 "ld"&lt;br&gt;
17177 &lt;/pre&gt;
17178 </synopsis>
17179 </function>
17180 </construct>
17181 <construct id="function-wcsrchr" type="function">
17182 <function returntype="wchar_t *">
17183 <prototype>
17184 <parameter content="const wchar_t *wstring"/>
17185 <parameter content="wchar_t c"/>
17186 </prototype>
17187 <headers>
17188 <header filename = "wchar.h"/>
17189 </headers>
17190 <synopsis>
17191 The function &lt;CODE&gt;wcsrchr&lt;/CODE&gt; is like &lt;CODE&gt;wcschr&lt;/CODE&gt;, except that it searches
17192 backwards from the end of the string &lt;VAR&gt;wstring&lt;/VAR&gt; (instead of forwards
17193 from the front).
17194 </synopsis>
17195 </function>
17196 </construct>
17197 <construct id="function-strstr" type="function">
17198 <function returntype="char *">
17199 <prototype>
17200 <parameter content="const char *haystack"/>
17201 <parameter content="const char *needle"/>
17202 </prototype>
17203 <headers>
17204 <header filename = "string.h"/>
17205 </headers>
17206 <synopsis>
17207 This is like &lt;CODE&gt;strchr&lt;/CODE&gt;, except that it searches &lt;VAR&gt;haystack&lt;/VAR&gt; for a
17208 substring &lt;VAR&gt;needle&lt;/VAR&gt; rather than just a single character. It
17209 returns a pointer into the string &lt;VAR&gt;haystack&lt;/VAR&gt; that is the first
17210 character of the substring, or a null pointer if no match was found. If
17211 &lt;VAR&gt;needle&lt;/VAR&gt; is an empty string, the function returns &lt;VAR&gt;haystack&lt;/VAR&gt;.
17212 &lt;br&gt;&lt;br&gt; For example,
17213 &lt;pre&gt;&lt;br&gt;
17214 strstr ("hello, world", "l")&lt;br&gt;
17215 "llo, world"&lt;br&gt;
17216 strstr ("hello, world", "wo")&lt;br&gt;
17217 "world"&lt;br&gt;
17218 &lt;/pre&gt;
17219 </synopsis>
17220 </function>
17221 </construct>
17222 <construct id="function-wcsstr" type="function">
17223 <function returntype="wchar_t *">
17224 <prototype>
17225 <parameter content="const wchar_t *haystack"/>
17226 <parameter content="const wchar_t *needle"/>
17227 </prototype>
17228 <headers>
17229 <header filename = "wchar.h"/>
17230 </headers>
17231 <synopsis>
17232 This is like &lt;CODE&gt;wcschr&lt;/CODE&gt;, except that it searches &lt;VAR&gt;haystack&lt;/VAR&gt; for a
17233 substring &lt;VAR&gt;needle&lt;/VAR&gt; rather than just a single wide character. It
17234 returns a pointer into the string &lt;VAR&gt;haystack&lt;/VAR&gt; that is the first wide
17235 character of the substring, or a null pointer if no match was found. If
17236 &lt;VAR&gt;needle&lt;/VAR&gt; is an empty string, the function returns &lt;VAR&gt;haystack&lt;/VAR&gt;.
17237 </synopsis>
17238 </function>
17239 </construct>
17240 <construct id="function-wcswcs" type="function">
17241 <function returntype="wchar_t *">
17242 <prototype>
17243 <parameter content="const wchar_t *haystack"/>
17244 <parameter content="const wchar_t *needle"/>
17245 </prototype>
17246 <headers>
17247 <header filename = "wchar.h"/>
17248 </headers>
17249 <synopsis>
17250 &lt;CODE&gt;wcswcs&lt;/CODE&gt; is an deprecated alias for &lt;CODE&gt;wcsstr&lt;/CODE&gt;. This is the
17251 name originally used in the X/Open Portability Guide before the
17252 Amendment 1 to ISO C90 was published.
17253 </synopsis>
17254 </function>
17255 </construct>
17256 <construct id="function-strcasestr" type="function">
17257 <function returntype="char *">
17258 <prototype>
17259 <parameter content="const char *haystack"/>
17260 <parameter content="const char *needle"/>
17261 </prototype>
17262 <headers>
17263 <header filename = "string.h"/>
17264 </headers>
17265 <synopsis>
17266 This is like &lt;CODE&gt;strstr&lt;/CODE&gt;, except that it ignores case in searching for
17267 the substring. Like &lt;CODE&gt;strcasecmp&lt;/CODE&gt;, it is locale dependent how
17268 uppercase and lowercase characters are related.
17269 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt; For example,
17270 &lt;pre&gt;&lt;br&gt;
17271 strcasestr ("hello, world", "L")&lt;br&gt;
17272 "llo, world"&lt;br&gt;
17273 strcasestr ("hello, World", "wo")&lt;br&gt;
17274 "World"&lt;br&gt;
17275 &lt;/pre&gt;
17276 </synopsis>
17277 </function>
17278 </construct>
17279 <construct id="function-memmem" type="function">
17280 <function returntype="void *">
17281 <prototype>
17282 <parameter content="const void *haystack"/>
17283 <parameter content="size_t haystack-len,const void *needle"/>
17284 <parameter content="size_t needle-len"/>
17285 </prototype>
17286 <headers>
17287 <header filename = "string.h"/>
17288 </headers>
17289 <synopsis>
17290 This is like &lt;CODE&gt;strstr&lt;/CODE&gt;, but &lt;VAR&gt;needle&lt;/VAR&gt; and &lt;VAR&gt;haystack&lt;/VAR&gt; are byte
17291 arrays rather than null-terminated strings. &lt;VAR&gt;needle-len&lt;/VAR&gt; is the
17292 length of &lt;VAR&gt;needle&lt;/VAR&gt; and &lt;VAR&gt;haystack-len&lt;/VAR&gt; is the length of
17293 &lt;VAR&gt;haystack&lt;/VAR&gt;.
17294 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
17295 </synopsis>
17296 </function>
17297 </construct>
17298 <construct id="function-strspn" type="function">
17299 <function returntype="size_t">
17300 <prototype>
17301 <parameter content="const char *string"/>
17302 <parameter content="const char *skipset"/>
17303 </prototype>
17304 <headers>
17305 <header filename = "string.h"/>
17306 </headers>
17307 <synopsis>
17308 The &lt;CODE&gt;strspn&lt;/CODE&gt; (``string span'') function returns the length of the
17309 initial substring of &lt;VAR&gt;string&lt;/VAR&gt; that consists entirely of characters that
17310 are members of the set specified by the string &lt;VAR&gt;skipset&lt;/VAR&gt;. The order
17311 of the characters in &lt;VAR&gt;skipset&lt;/VAR&gt; is not important.
17312 &lt;br&gt;&lt;br&gt; For example,
17313 &lt;pre&gt;&lt;br&gt;
17314 strspn ("hello, world", "abcdefghijklmnopqrstuvwxyz")&lt;br&gt;
17315 5&lt;br&gt;
17316 &lt;/pre&gt;
17317 &lt;br&gt;&lt;br&gt; Note that ``character'' is here used in the sense of byte. In a string
17318 using a multibyte character encoding (abstract) character consisting of
17319 more than one byte are not treated as an entity. Each byte is treated
17320 separately. The function is not locale-dependent.
17321 </synopsis>
17322 </function>
17323 </construct>
17324 <construct id="function-wcsspn" type="function">
17325 <function returntype="size_t">
17326 <prototype>
17327 <parameter content="const wchar_t *wstring"/>
17328 <parameter content="const wchar_t *skipset"/>
17329 </prototype>
17330 <headers>
17331 <header filename = "wchar.h"/>
17332 </headers>
17333 <synopsis>
17334 The &lt;CODE&gt;wcsspn&lt;/CODE&gt; (``wide character string span'') function returns the
17335 length of the initial substring of &lt;VAR&gt;wstring&lt;/VAR&gt; that consists entirely
17336 of wide characters that are members of the set specified by the string
17337 &lt;VAR&gt;skipset&lt;/VAR&gt;. The order of the wide characters in &lt;VAR&gt;skipset&lt;/VAR&gt; is not
17338 important.
17339 </synopsis>
17340 </function>
17341 </construct>
17342 <construct id="function-strcspn" type="function">
17343 <function returntype="size_t">
17344 <prototype>
17345 <parameter content="const char *string"/>
17346 <parameter content="const char *stopset"/>
17347 </prototype>
17348 <headers>
17349 <header filename = "string.h"/>
17350 </headers>
17351 <synopsis>
17352 The &lt;CODE&gt;strcspn&lt;/CODE&gt; (``string complement span'') function returns the length
17353 of the initial substring of &lt;VAR&gt;string&lt;/VAR&gt; that consists entirely of characters
17354 that are &lt;EM&gt;not&lt;/EM&gt; members of the set specified by the string &lt;VAR&gt;stopset&lt;/VAR&gt;.
17355 (In other words, it returns the offset of the first character in &lt;VAR&gt;string&lt;/VAR&gt;
17356 that is a member of the set &lt;VAR&gt;stopset&lt;/VAR&gt;.)
17357 &lt;br&gt;&lt;br&gt; For example,
17358 &lt;pre&gt;&lt;br&gt;
17359 strcspn ("hello, world", " \t\n,.;!?")&lt;br&gt;
17360 5&lt;br&gt;
17361 &lt;/pre&gt;
17362 &lt;br&gt;&lt;br&gt; Note that ``character'' is here used in the sense of byte. In a string
17363 using a multibyte character encoding (abstract) character consisting of
17364 more than one byte are not treated as an entity. Each byte is treated
17365 separately. The function is not locale-dependent.
17366 </synopsis>
17367 </function>
17368 </construct>
17369 <construct id="function-wcscspn" type="function">
17370 <function returntype="size_t">
17371 <prototype>
17372 <parameter content="const wchar_t *wstring"/>
17373 <parameter content="const wchar_t *stopset"/>
17374 </prototype>
17375 <headers>
17376 <header filename = "wchar.h"/>
17377 </headers>
17378 <synopsis>
17379 The &lt;CODE&gt;wcscspn&lt;/CODE&gt; (``wide character string complement span'') function
17380 returns the length of the initial substring of &lt;VAR&gt;wstring&lt;/VAR&gt; that
17381 consists entirely of wide characters that are &lt;EM&gt;not&lt;/EM&gt; members of the
17382 set specified by the string &lt;VAR&gt;stopset&lt;/VAR&gt;. (In other words, it returns
17383 the offset of the first character in &lt;VAR&gt;string&lt;/VAR&gt; that is a member of
17384 the set &lt;VAR&gt;stopset&lt;/VAR&gt;.)
17385 </synopsis>
17386 </function>
17387 </construct>
17388 <construct id="function-strpbrk" type="function">
17389 <function returntype="char *">
17390 <prototype>
17391 <parameter content="const char *string"/>
17392 <parameter content="const char *stopset"/>
17393 </prototype>
17394 <headers>
17395 <header filename = "string.h"/>
17396 </headers>
17397 <synopsis>
17398 The &lt;CODE&gt;strpbrk&lt;/CODE&gt; (``string pointer break'') function is related to
17399 &lt;CODE&gt;strcspn&lt;/CODE&gt;, except that it returns a pointer to the first character
17400 in &lt;VAR&gt;string&lt;/VAR&gt; that is a member of the set &lt;VAR&gt;stopset&lt;/VAR&gt; instead of the
17401 length of the initial substring. It returns a null pointer if no such
17402 character from &lt;VAR&gt;stopset&lt;/VAR&gt; is found.
17403 &lt;br&gt;&lt;br&gt; For example,
17404 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
17405 strpbrk ("hello, world", " \t\n,.;!?")&lt;br&gt;
17406 ", world"&lt;br&gt;
17407 &lt;/pre&gt;
17408 &lt;br&gt;&lt;br&gt; Note that ``character'' is here used in the sense of byte. In a string
17409 using a multibyte character encoding (abstract) character consisting of
17410 more than one byte are not treated as an entity. Each byte is treated
17411 separately. The function is not locale-dependent.
17412 </synopsis>
17413 </function>
17414 </construct>
17415 <construct id="function-wcspbrk" type="function">
17416 <function returntype="wchar_t *">
17417 <prototype>
17418 <parameter content="const wchar_t *wstring"/>
17419 <parameter content="const wchar_t *stopset"/>
17420 </prototype>
17421 <headers>
17422 <header filename = "wchar.h"/>
17423 </headers>
17424 <synopsis>
17425 The &lt;CODE&gt;wcspbrk&lt;/CODE&gt; (``wide character string pointer break'') function is
17426 related to &lt;CODE&gt;wcscspn&lt;/CODE&gt;, except that it returns a pointer to the first
17427 wide character in &lt;VAR&gt;wstring&lt;/VAR&gt; that is a member of the set
17428 &lt;VAR&gt;stopset&lt;/VAR&gt; instead of the length of the initial substring. It
17429 returns a null pointer if no such character from &lt;VAR&gt;stopset&lt;/VAR&gt; is found.
17430 </synopsis>
17431 </function>
17432 </construct>
17433 <construct id="function-index" type="function">
17434 <function returntype="char *">
17435 <prototype>
17436 <parameter content="const char *string"/>
17437 <parameter content="int c"/>
17438 </prototype>
17439 <headers>
17440 <header filename = "string.h"/>
17441 </headers>
17442 <synopsis>
17443 &lt;CODE&gt;index&lt;/CODE&gt; is another name for &lt;CODE&gt;strchr&lt;/CODE&gt;; they are exactly the same.
17444 New code should always use &lt;CODE&gt;strchr&lt;/CODE&gt; since this name is defined in
17445 ISO C while &lt;CODE&gt;index&lt;/CODE&gt; is a BSD invention which never was available
17446 on System V derived systems.
17447 </synopsis>
17448 </function>
17449 </construct>
17450 <construct id="function-rindex" type="function">
17451 <function returntype="char *">
17452 <prototype>
17453 <parameter content="const char *string"/>
17454 <parameter content="int c"/>
17455 </prototype>
17456 <headers>
17457 <header filename = "string.h"/>
17458 </headers>
17459 <synopsis>
17460 &lt;CODE&gt;rindex&lt;/CODE&gt; is another name for &lt;CODE&gt;strrchr&lt;/CODE&gt;; they are exactly the same.
17461 New code should always use &lt;CODE&gt;strrchr&lt;/CODE&gt; since this name is defined in
17462 ISO C while &lt;CODE&gt;rindex&lt;/CODE&gt; is a BSD invention which never was available
17463 on System V derived systems.
17464 </synopsis>
17465 </function>
17466 </construct>
17467 <construct id="function-strtok" type="function">
17468 <function returntype="char *">
17469 <prototype>
17470 <parameter content="char *restrict newstring"/>
17471 <parameter content="const char *restrict delimiters"/>
17472 </prototype>
17473 <headers>
17474 <header filename = "string.h"/>
17475 </headers>
17476 <synopsis>
17477 A string can be split into tokens by making a series of calls to the
17478 function &lt;CODE&gt;strtok&lt;/CODE&gt;.
17479 &lt;br&gt;&lt;br&gt; The string to be split up is passed as the &lt;VAR&gt;newstring&lt;/VAR&gt; argument on
17480 the first call only. The &lt;CODE&gt;strtok&lt;/CODE&gt; function uses this to set up
17481 some internal state information. Subsequent calls to get additional
17482 tokens from the same string are indicated by passing a null pointer as
17483 the &lt;VAR&gt;newstring&lt;/VAR&gt; argument. Calling &lt;CODE&gt;strtok&lt;/CODE&gt; with another
17484 non-null &lt;VAR&gt;newstring&lt;/VAR&gt; argument reinitializes the state information.
17485 It is guaranteed that no other library function ever calls &lt;CODE&gt;strtok&lt;/CODE&gt;
17486 behind your back (which would mess up this internal state information).
17487 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;delimiters&lt;/VAR&gt; argument is a string that specifies a set of delimiters
17488 that may surround the token being extracted. All the initial characters
17489 that are members of this set are discarded. The first character that is
17490 &lt;EM&gt;not&lt;/EM&gt; a member of this set of delimiters marks the beginning of the
17491 next token. The end of the token is found by looking for the next
17492 character that is a member of the delimiter set. This character in the
17493 original string &lt;VAR&gt;newstring&lt;/VAR&gt; is overwritten by a null character, and the
17494 pointer to the beginning of the token in &lt;VAR&gt;newstring&lt;/VAR&gt; is returned.
17495 &lt;br&gt;&lt;br&gt; On the next call to &lt;CODE&gt;strtok&lt;/CODE&gt;, the searching begins at the next
17496 character beyond the one that marked the end of the previous token.
17497 Note that the set of delimiters &lt;VAR&gt;delimiters&lt;/VAR&gt; do not have to be the
17498 same on every call in a series of calls to &lt;CODE&gt;strtok&lt;/CODE&gt;.
17499 &lt;br&gt;&lt;br&gt; If the end of the string &lt;VAR&gt;newstring&lt;/VAR&gt; is reached, or if the remainder of
17500 string consists only of delimiter characters, &lt;CODE&gt;strtok&lt;/CODE&gt; returns
17501 a null pointer.
17502 &lt;br&gt;&lt;br&gt; Note that ``character'' is here used in the sense of byte. In a string
17503 using a multibyte character encoding (abstract) character consisting of
17504 more than one byte are not treated as an entity. Each byte is treated
17505 separately. The function is not locale-dependent.
17506 </synopsis>
17507 </function>
17508 </construct>
17509 <construct id="function-wcstok" type="function">
17510 <function returntype="wchar_t *">
17511 <prototype>
17512 <parameter content="wchar_t *newstring"/>
17513 <parameter content="const char *delimiters"/>
17514 </prototype>
17515 <headers>
17516 <header filename = "wchar.h"/>
17517 </headers>
17518 <synopsis>
17519 A string can be split into tokens by making a series of calls to the
17520 function &lt;CODE&gt;wcstok&lt;/CODE&gt;.
17521 &lt;br&gt;&lt;br&gt; The string to be split up is passed as the &lt;VAR&gt;newstring&lt;/VAR&gt; argument on
17522 the first call only. The &lt;CODE&gt;wcstok&lt;/CODE&gt; function uses this to set up
17523 some internal state information. Subsequent calls to get additional
17524 tokens from the same wide character string are indicated by passing a
17525 null pointer as the &lt;VAR&gt;newstring&lt;/VAR&gt; argument. Calling &lt;CODE&gt;wcstok&lt;/CODE&gt;
17526 with another non-null &lt;VAR&gt;newstring&lt;/VAR&gt; argument reinitializes the state
17527 information. It is guaranteed that no other library function ever calls
17528 &lt;CODE&gt;wcstok&lt;/CODE&gt; behind your back (which would mess up this internal state
17529 information).
17530 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;delimiters&lt;/VAR&gt; argument is a wide character string that specifies
17531 a set of delimiters that may surround the token being extracted. All
17532 the initial wide characters that are members of this set are discarded.
17533 The first wide character that is &lt;EM&gt;not&lt;/EM&gt; a member of this set of
17534 delimiters marks the beginning of the next token. The end of the token
17535 is found by looking for the next wide character that is a member of the
17536 delimiter set. This wide character in the original wide character
17537 string &lt;VAR&gt;newstring&lt;/VAR&gt; is overwritten by a null wide character, and the
17538 pointer to the beginning of the token in &lt;VAR&gt;newstring&lt;/VAR&gt; is returned.
17539 &lt;br&gt;&lt;br&gt; On the next call to &lt;CODE&gt;wcstok&lt;/CODE&gt;, the searching begins at the next
17540 wide character beyond the one that marked the end of the previous token.
17541 Note that the set of delimiters &lt;VAR&gt;delimiters&lt;/VAR&gt; do not have to be the
17542 same on every call in a series of calls to &lt;CODE&gt;wcstok&lt;/CODE&gt;.
17543 &lt;br&gt;&lt;br&gt; If the end of the wide character string &lt;VAR&gt;newstring&lt;/VAR&gt; is reached, or
17544 if the remainder of string consists only of delimiter wide characters,
17545 &lt;CODE&gt;wcstok&lt;/CODE&gt; returns a null pointer.
17546 &lt;br&gt;&lt;br&gt; Note that ``character'' is here used in the sense of byte. In a string
17547 using a multibyte character encoding (abstract) character consisting of
17548 more than one byte are not treated as an entity. Each byte is treated
17549 separately. The function is not locale-dependent.
17550 </synopsis>
17551 </function>
17552 </construct>
17553 <construct id="function-strtok_r" type="function">
17554 <function returntype="char *">
17555 <prototype>
17556 <parameter content="char *newstring"/>
17557 <parameter content="const char *delimiters"/>
17558 <parameter content="char **save_ptr"/>
17559 </prototype>
17560 <headers>
17561 <header filename = "string.h"/>
17562 </headers>
17563 <synopsis>
17564 Just like &lt;CODE&gt;strtok&lt;/CODE&gt;, this function splits the string into several
17565 tokens which can be accessed by successive calls to &lt;CODE&gt;strtok_r&lt;/CODE&gt;.
17566 The difference is that the information about the next token is stored in
17567 the space pointed to by the third argument, &lt;VAR&gt;save_ptr&lt;/VAR&gt;, which is a
17568 pointer to a string pointer. Calling &lt;CODE&gt;strtok_r&lt;/CODE&gt; with a null
17569 pointer for &lt;VAR&gt;newstring&lt;/VAR&gt; and leaving &lt;VAR&gt;save_ptr&lt;/VAR&gt; between the calls
17570 unchanged does the job without hindering reentrancy.
17571 &lt;br&gt;&lt;br&gt; This function is defined in POSIX.1 and can be found on many systems
17572 which support multi-threading.
17573 </synopsis>
17574 </function>
17575 </construct>
17576 <construct id="function-strsep" type="function">
17577 <function returntype="char *">
17578 <prototype>
17579 <parameter content="char **string_ptr"/>
17580 <parameter content="const char *delimiter"/>
17581 </prototype>
17582 <headers>
17583 <header filename = "string.h"/>
17584 </headers>
17585 <synopsis>
17586 This function has a similar functionality as &lt;CODE&gt;strtok_r&lt;/CODE&gt; with the
17587 &lt;VAR&gt;newstring&lt;/VAR&gt; argument replaced by the &lt;VAR&gt;save_ptr&lt;/VAR&gt; argument. The
17588 initialization of the moving pointer has to be done by the user.
17589 Successive calls to &lt;CODE&gt;strsep&lt;/CODE&gt; move the pointer along the tokens
17590 separated by &lt;VAR&gt;delimiter&lt;/VAR&gt;, returning the address of the next token
17591 and updating &lt;VAR&gt;string_ptr&lt;/VAR&gt; to point to the beginning of the next
17592 token.
17593 &lt;br&gt;&lt;br&gt; One difference between &lt;CODE&gt;strsep&lt;/CODE&gt; and &lt;CODE&gt;strtok_r&lt;/CODE&gt; is that if the
17594 input string contains more than one character from &lt;VAR&gt;delimiter&lt;/VAR&gt; in a
17595 row &lt;CODE&gt;strsep&lt;/CODE&gt; returns an empty string for each pair of characters
17596 from &lt;VAR&gt;delimiter&lt;/VAR&gt;. This means that a program normally should test
17597 for &lt;CODE&gt;strsep&lt;/CODE&gt; returning an empty string before processing it.
17598 &lt;br&gt;&lt;br&gt; This function was introduced in 4.3BSD and therefore is widely available.
17599 </synopsis>
17600 </function>
17601 </construct>
17602 <construct id="function-basename" type="function">
17603 <function returntype="char *">
17604 <prototype>
17605 <parameter content="const char *filename"/>
17606 </prototype>
17607 <headers>
17608 <header filename = "string.h"/>
17609 </headers>
17610 <synopsis>
17611 The GNU version of the &lt;CODE&gt;basename&lt;/CODE&gt; function returns the last
17612 component of the path in &lt;VAR&gt;filename&lt;/VAR&gt;. This function is the preferred
17613 usage, since it does not modify the argument, &lt;VAR&gt;filename&lt;/VAR&gt;, and
17614 respects trailing slashes. The prototype for &lt;CODE&gt;basename&lt;/CODE&gt; can be
17615 found in &lt;TT&gt;string.h&lt;/TT&gt;. Note, this function is overriden by the XPG
17616 version, if &lt;TT&gt;libgen.h&lt;/TT&gt; is included.
17617 &lt;br&gt;&lt;br&gt; Example of using GNU &lt;CODE&gt;basename&lt;/CODE&gt;:
17618 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
17619 #include &lt;string.h&gt;&lt;br&gt;
17620 &lt;br&gt;&lt;br&gt; int&lt;br&gt;
17621 main (int argc, char *argv[])&lt;br&gt;
17622 {&lt;br&gt;
17623 char *prog = basename (argv[0]);&lt;br&gt;
17624 &lt;br&gt;&lt;br&gt; if (argc &lt; 2)&lt;br&gt;
17625 {&lt;br&gt;
17626 fprintf (stderr, "Usage %s &lt;arg&gt;\n", prog);&lt;br&gt;
17627 exit (1);&lt;br&gt;
17628 }&lt;br&gt;
17629 &lt;br&gt;&lt;br&gt; &lt;small&gt;...&lt;/small&gt;&lt;br&gt;
17630 }&lt;br&gt;
17631 &lt;/pre&gt;
17632 &lt;br&gt;&lt;br&gt; Portability Note: This function may produce different results
17633 on different systems.
17634 &lt;br&gt;&lt;br&gt;
17635 </synopsis>
17636 </function>
17637 </construct>
17638 <construct id="function-basename" type="function">
17639 <function returntype="char *">
17640 <prototype>
17641 <parameter content="char *path"/>
17642 </prototype>
17643 <headers>
17644 <header filename = "libgen.h"/>
17645 </headers>
17646 <synopsis>
17647 This is the standard XPG defined &lt;CODE&gt;basename&lt;/CODE&gt;. It is similar in
17648 spirit to the GNU version, but may modify the &lt;VAR&gt;path&lt;/VAR&gt; by removing
17649 trailing '/' characters. If the &lt;VAR&gt;path&lt;/VAR&gt; is made up entirely of '/'
17650 characters, then "/" will be returned. Also, if &lt;VAR&gt;path&lt;/VAR&gt; is
17651 &lt;CODE&gt;NULL&lt;/CODE&gt; or an empty string, then "." is returned. The prototype for
17652 the XPG version can be found in &lt;TT&gt;libgen.h&lt;/TT&gt;.
17653 &lt;br&gt;&lt;br&gt; Example of using XPG &lt;CODE&gt;basename&lt;/CODE&gt;:
17654 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
17655 #include &lt;libgen.h&gt;&lt;br&gt;
17656 &lt;br&gt;&lt;br&gt; int&lt;br&gt;
17657 main (int argc, char *argv[])&lt;br&gt;
17658 {&lt;br&gt;
17659 char *prog;&lt;br&gt;
17660 char *path = strdupa (argv[0]);&lt;br&gt;
17661 &lt;br&gt;&lt;br&gt; prog = basename (path);&lt;br&gt;
17662 &lt;br&gt;&lt;br&gt; if (argc &lt; 2)&lt;br&gt;
17663 {&lt;br&gt;
17664 fprintf (stderr, "Usage %s &lt;arg&gt;\n", prog);&lt;br&gt;
17665 exit (1);&lt;br&gt;
17666 }&lt;br&gt;
17667 &lt;br&gt;&lt;br&gt; &lt;small&gt;...&lt;/small&gt;&lt;br&gt;
17668 &lt;br&gt;&lt;br&gt; }&lt;br&gt;
17669 &lt;/pre&gt;
17670 </synopsis>
17671 </function>
17672 </construct>
17673 <construct id="function-dirname" type="function">
17674 <function returntype="char *">
17675 <prototype>
17676 <parameter content="char *path"/>
17677 </prototype>
17678 <headers>
17679 <header filename = "libgen.h"/>
17680 </headers>
17681 <synopsis>
17682 The &lt;CODE&gt;dirname&lt;/CODE&gt; function is the compliment to the XPG version of
17683 &lt;CODE&gt;basename&lt;/CODE&gt;. It returns the parent directory of the file specified
17684 by &lt;VAR&gt;path&lt;/VAR&gt;. If &lt;VAR&gt;path&lt;/VAR&gt; is &lt;CODE&gt;NULL&lt;/CODE&gt;, an empty string, or
17685 contains no '/' characters, then "." is returned. The prototype for this
17686 function can be found in &lt;TT&gt;libgen.h&lt;/TT&gt;.
17687 </synopsis>
17688 </function>
17689 </construct>
17690 <construct id="function-strfry" type="function">
17691 <function returntype="char *">
17692 <prototype>
17693 <parameter content="char *string"/>
17694 </prototype>
17695 <headers>
17696 <header filename = "string.h"/>
17697 </headers>
17698 <synopsis>
17699 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;strfry&lt;/CODE&gt; creates a pseudorandom anagram of a string, replacing the
17700 input with the anagram in place. For each position in the string,
17701 &lt;CODE&gt;strfry&lt;/CODE&gt; swaps it with a position in the string selected at random
17702 (from a uniform distribution). The two positions may be the same.
17703 &lt;br&gt;&lt;br&gt; The return value of &lt;CODE&gt;strfry&lt;/CODE&gt; is always &lt;VAR&gt;string&lt;/VAR&gt;.
17704 &lt;br&gt;&lt;br&gt; Portability Note: This function is unique to the GNU C library.
17705 &lt;br&gt;&lt;br&gt;
17706 </synopsis>
17707 </function>
17708 </construct>
17709 <construct id="function-memfrob" type="function">
17710 <function returntype="void *">
17711 <prototype>
17712 <parameter content="void *mem"/>
17713 <parameter content="size_t length"/>
17714 </prototype>
17715 <headers>
17716 <header filename = "string.h"/>
17717 </headers>
17718 <synopsis>
17719 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;memfrob&lt;/CODE&gt; transforms (frobnicates) each byte of the data structure
17720 at &lt;VAR&gt;mem&lt;/VAR&gt;, which is &lt;VAR&gt;length&lt;/VAR&gt; bytes long, by bitwise exclusive
17721 oring it with binary 00101010. It does the transformation in place and
17722 its return value is always &lt;VAR&gt;mem&lt;/VAR&gt;.
17723 &lt;br&gt;&lt;br&gt; Note that &lt;CODE&gt;memfrob&lt;/CODE&gt; a second time on the same data structure
17724 returns it to its original state.
17725 &lt;br&gt;&lt;br&gt; This is a good function for hiding information from someone who doesn't
17726 want to see it or doesn't want to see it very much. To really prevent
17727 people from retrieving the information, use stronger encryption such as
17728 that described in .
17729 &lt;br&gt;&lt;br&gt; Portability Note: This function is unique to the GNU C library.
17730 &lt;br&gt;&lt;br&gt;
17731 </synopsis>
17732 </function>
17733 </construct>
17734 <construct id="function-l64a" type="function">
17735 <function returntype="char *">
17736 <prototype>
17737 <parameter content="long int n"/>
17738 </prototype>
17739 <headers>
17740 <header filename = "stdlib.h"/>
17741 </headers>
17742 <synopsis>
17743 This function encodes a 32-bit input value using characters from the
17744 basic character set. It returns a pointer to a 7 character buffer which
17745 contains an encoded version of &lt;VAR&gt;n&lt;/VAR&gt;. To encode a series of bytes the
17746 user must copy the returned string to a destination buffer. It returns
17747 the empty string if &lt;VAR&gt;n&lt;/VAR&gt; is zero, which is somewhat bizarre but
17748 mandated by the standard.*
17749 Warning: Since a static buffer is used this function should not
17750 be used in multi-threaded programs. There is no thread-safe alternative
17751 to this function in the C library.*
17752 Compatibility Note: The XPG standard states that the return
17753 value of &lt;CODE&gt;l64a&lt;/CODE&gt; is undefined if &lt;VAR&gt;n&lt;/VAR&gt; is negative. In the GNU
17754 implementation, &lt;CODE&gt;l64a&lt;/CODE&gt; treats its argument as unsigned, so it will
17755 return a sensible encoding for any nonzero &lt;VAR&gt;n&lt;/VAR&gt;; however, portable
17756 programs should not rely on this.
17757 &lt;br&gt;&lt;br&gt; To encode a large buffer &lt;CODE&gt;l64a&lt;/CODE&gt; must be called in a loop, once for
17758 each 32-bit word of the buffer. For example, one could do something
17759 like this:
17760 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
17761 char *&lt;br&gt;
17762 encode (const void *buf, size_t len)&lt;br&gt;
17763 {&lt;br&gt;
17764 /* We know in advance how long the buffer has to be. */&lt;br&gt;
17765 unsigned char *in = (unsigned char *) buf;&lt;br&gt;
17766 char *out = malloc (6 + ((len + 3) / 4) * 6 + 1);&lt;br&gt;
17767 char *cp = out, *p;&lt;br&gt;
17768 &lt;br&gt;&lt;br&gt; /* Encode the length. */&lt;br&gt;
17769 /* Using `htonl' is necessary so that the data can be&lt;br&gt;
17770 decoded even on machines with different byte order.&lt;br&gt;
17771 `l64a' can return a string shorter than 6 bytes, so &lt;br&gt;
17772 we pad it with encoding of 0 ('.') at the end by &lt;br&gt;
17773 hand. */&lt;br&gt;
17774 &lt;br&gt;&lt;br&gt; p = stpcpy (cp, l64a (htonl (len)));&lt;br&gt;
17775 cp = mempcpy (p, "......", 6 - (p - cp));&lt;br&gt;
17776 &lt;br&gt;&lt;br&gt; while (len &gt; 3)&lt;br&gt;
17777 {&lt;br&gt;
17778 unsigned long int n = *in++;&lt;br&gt;
17779 n = (n &lt;&lt; 8) | *in++;&lt;br&gt;
17780 n = (n &lt;&lt; 8) | *in++;&lt;br&gt;
17781 n = (n &lt;&lt; 8) | *in++;&lt;br&gt;
17782 len -= 4;&lt;br&gt;
17783 p = stpcpy (cp, l64a (htonl (n)));&lt;br&gt;
17784 cp = mempcpy (p, "......", 6 - (p - cp));&lt;br&gt;
17785 }&lt;br&gt;
17786 if (len &gt; 0)&lt;br&gt;
17787 {&lt;br&gt;
17788 unsigned long int n = *in++;&lt;br&gt;
17789 if (--len &gt; 0)&lt;br&gt;
17790 {&lt;br&gt;
17791 n = (n &lt;&lt; 8) | *in++;&lt;br&gt;
17792 if (--len &gt; 0)&lt;br&gt;
17793 n = (n &lt;&lt; 8) | *in;&lt;br&gt;
17794 }&lt;br&gt;
17795 cp = stpcpy (cp, l64a (htonl (n)));&lt;br&gt;
17796 }&lt;br&gt;
17797 *cp = '\0';&lt;br&gt;
17798 return out;&lt;br&gt;
17799 }&lt;br&gt;
17800 &lt;/pre&gt;
17801 &lt;br&gt;&lt;br&gt; It is strange that the library does not provide the complete
17802 functionality needed but so be it.
17803 &lt;br&gt;&lt;br&gt;
17804 </synopsis>
17805 </function>
17806 </construct>
17807 <construct id="function-a64l" type="function">
17808 <function returntype="long int">
17809 <prototype>
17810 <parameter content="const char *string"/>
17811 </prototype>
17812 <headers>
17813 <header filename = "stdlib.h"/>
17814 </headers>
17815 <synopsis>
17816 The parameter &lt;VAR&gt;string&lt;/VAR&gt; should contain a string which was produced by
17817 a call to &lt;CODE&gt;l64a&lt;/CODE&gt;. The function processes at least 6 characters of
17818 this string, and decodes the characters it finds according to the table
17819 below. It stops decoding when it finds a character not in the table,
17820 rather like &lt;CODE&gt;atoi&lt;/CODE&gt;; if you have a buffer which has been broken into
17821 lines, you must be careful to skip over the end-of-line characters.
17822 &lt;br&gt;&lt;br&gt; The decoded number is returned as a &lt;CODE&gt;long int&lt;/CODE&gt; value.
17823 </synopsis>
17824 </function>
17825 </construct>
17826 <construct id="function-argz_create" type="function">
17827 <function returntype="error_t">
17828 <prototype>
17829 <parameter content="char *const argv[]"/>
17830 <parameter content="char **argz"/>
17831 <parameter content="size_t *argz_len"/>
17832 </prototype>
17833 <headers>
17834 <header filename = "argz.h"/>
17835 </headers>
17836 <synopsis>
17837 The &lt;CODE&gt;argz_create&lt;/CODE&gt; function converts the Unix-style argument vector
17838 &lt;VAR&gt;argv&lt;/VAR&gt; (a vector of pointers to normal C strings, terminated by
17839 &lt;CODE&gt;(char *)0&lt;/CODE&gt;; ) into an argz vector with
17840 the same elements, which is returned in &lt;VAR&gt;argz&lt;/VAR&gt; and &lt;VAR&gt;argz_len&lt;/VAR&gt;.
17841 </synopsis>
17842 </function>
17843 </construct>
17844 <construct id="function-argz_create_sep" type="function">
17845 <function returntype="error_t">
17846 <prototype>
17847 <parameter content="const char *string"/>
17848 <parameter content="int sep"/>
17849 <parameter content="char **argz"/>
17850 <parameter content="size_t *argz_len"/>
17851 </prototype>
17852 <headers>
17853 <header filename = "argz.h"/>
17854 </headers>
17855 <synopsis>
17856 The &lt;CODE&gt;argz_create_sep&lt;/CODE&gt; function converts the null-terminated string
17857 &lt;VAR&gt;string&lt;/VAR&gt; into an argz vector (returned in &lt;VAR&gt;argz&lt;/VAR&gt; and
17858 &lt;VAR&gt;argz_len&lt;/VAR&gt;) by splitting it into elements at every occurrence of the
17859 character &lt;VAR&gt;sep&lt;/VAR&gt;.
17860 </synopsis>
17861 </function>
17862 </construct>
17863 <construct id="function-argz_count" type="function">
17864 <function returntype="size_t">
17865 <prototype>
17866 <parameter content="const char *argz"/>
17867 <parameter content="size_t arg_len"/>
17868 </prototype>
17869 <headers>
17870 <header filename = "argz.h"/>
17871 </headers>
17872 <synopsis>
17873 Returns the number of elements in the argz vector &lt;VAR&gt;argz&lt;/VAR&gt; and
17874 &lt;VAR&gt;argz_len&lt;/VAR&gt;.
17875 </synopsis>
17876 </function>
17877 </construct>
17878 <construct id="function-argz_extract" type="function">
17879 <function returntype="void">
17880 <prototype>
17881 <parameter content="char *argz"/>
17882 <parameter content="size_t argz_len"/>
17883 <parameter content="char **argv"/>
17884 </prototype>
17885 <headers>
17886 <header filename = "argz.h"/>
17887 </headers>
17888 <synopsis>
17889 The &lt;CODE&gt;argz_extract&lt;/CODE&gt; function converts the argz vector &lt;VAR&gt;argz&lt;/VAR&gt; and
17890 &lt;VAR&gt;argz_len&lt;/VAR&gt; into a Unix-style argument vector stored in &lt;VAR&gt;argv&lt;/VAR&gt;,
17891 by putting pointers to every element in &lt;VAR&gt;argz&lt;/VAR&gt; into successive
17892 positions in &lt;VAR&gt;argv&lt;/VAR&gt;, followed by a terminator of &lt;CODE&gt;0&lt;/CODE&gt;.
17893 &lt;VAR&gt;Argv&lt;/VAR&gt; must be pre-allocated with enough space to hold all the
17894 elements in &lt;VAR&gt;argz&lt;/VAR&gt; plus the terminating &lt;CODE&gt;(char *)0&lt;/CODE&gt;
17895 (&lt;CODE&gt;(argz_count (&lt;VAR&gt;argz&lt;/VAR&gt;, &lt;VAR&gt;argz_len&lt;/VAR&gt;) + 1) * sizeof (char *)&lt;/CODE&gt;
17896 bytes should be enough). Note that the string pointers stored into
17897 &lt;VAR&gt;argv&lt;/VAR&gt; point into &lt;VAR&gt;argz&lt;/VAR&gt;---they are not copies---and so
17898 &lt;VAR&gt;argz&lt;/VAR&gt; must be copied if it will be changed while &lt;VAR&gt;argv&lt;/VAR&gt; is
17899 still active. This function is useful for passing the elements in
17900 &lt;VAR&gt;argz&lt;/VAR&gt; to an exec function .
17901 </synopsis>
17902 </function>
17903 </construct>
17904 <construct id="function-argz_stringify" type="function">
17905 <function returntype="void">
17906 <prototype>
17907 <parameter content="char *argz"/>
17908 <parameter content="size_t len"/>
17909 <parameter content="int sep"/>
17910 </prototype>
17911 <headers>
17912 <header filename = "argz.h"/>
17913 </headers>
17914 <synopsis>
17915 The &lt;CODE&gt;argz_stringify&lt;/CODE&gt; converts &lt;VAR&gt;argz&lt;/VAR&gt; into a normal string with
17916 the elements separated by the character &lt;VAR&gt;sep&lt;/VAR&gt;, by replacing each
17917 &lt;CODE&gt;'\0'&lt;/CODE&gt; inside &lt;VAR&gt;argz&lt;/VAR&gt; (except the last one, which terminates the
17918 string) with &lt;VAR&gt;sep&lt;/VAR&gt;. This is handy for printing &lt;VAR&gt;argz&lt;/VAR&gt; in a
17919 readable manner.
17920 </synopsis>
17921 </function>
17922 </construct>
17923 <construct id="function-argz_add" type="function">
17924 <function returntype="error_t">
17925 <prototype>
17926 <parameter content="char **argz"/>
17927 <parameter content="size_t *argz_len"/>
17928 <parameter content="const char *str"/>
17929 </prototype>
17930 <headers>
17931 <header filename = "argz.h"/>
17932 </headers>
17933 <synopsis>
17934 The &lt;CODE&gt;argz_add&lt;/CODE&gt; function adds the string &lt;VAR&gt;str&lt;/VAR&gt; to the end of the
17935 argz vector &lt;CODE&gt;*&lt;VAR&gt;argz&lt;/VAR&gt;&lt;/CODE&gt;, and updates &lt;CODE&gt;*&lt;VAR&gt;argz&lt;/VAR&gt;&lt;/CODE&gt; and
17936 &lt;CODE&gt;*&lt;VAR&gt;argz_len&lt;/VAR&gt;&lt;/CODE&gt; accordingly.
17937 </synopsis>
17938 </function>
17939 </construct>
17940 <construct id="function-argz_add_sep" type="function">
17941 <function returntype="error_t">
17942 <prototype>
17943 <parameter content="char **argz"/>
17944 <parameter content="size_t *argz_len"/>
17945 <parameter content="const char *str"/>
17946 <parameter content="int delim"/>
17947 </prototype>
17948 <headers>
17949 <header filename = "argz.h"/>
17950 </headers>
17951 <synopsis>
17952 The &lt;CODE&gt;argz_add_sep&lt;/CODE&gt; function is similar to &lt;CODE&gt;argz_add&lt;/CODE&gt;, but
17953 &lt;VAR&gt;str&lt;/VAR&gt; is split into separate elements in the result at occurrences of
17954 the character &lt;VAR&gt;delim&lt;/VAR&gt;. This is useful, for instance, for
17955 adding the components of a Unix search path to an argz vector, by using
17956 a value of &lt;CODE&gt;':'&lt;/CODE&gt; for &lt;VAR&gt;delim&lt;/VAR&gt;.
17957 </synopsis>
17958 </function>
17959 </construct>
17960 <construct id="function-argz_append" type="function">
17961 <function returntype="error_t">
17962 <prototype>
17963 <parameter content="char **argz"/>
17964 <parameter content="size_t *argz_len"/>
17965 <parameter content="const char *buf"/>
17966 <parameter content="size_t buf_len"/>
17967 </prototype>
17968 <headers>
17969 <header filename = "argz.h"/>
17970 </headers>
17971 <synopsis>
17972 The &lt;CODE&gt;argz_append&lt;/CODE&gt; function appends &lt;VAR&gt;buf_len&lt;/VAR&gt; bytes starting at
17973 &lt;VAR&gt;buf&lt;/VAR&gt; to the argz vector &lt;CODE&gt;*&lt;VAR&gt;argz&lt;/VAR&gt;&lt;/CODE&gt;, reallocating
17974 &lt;CODE&gt;*&lt;VAR&gt;argz&lt;/VAR&gt;&lt;/CODE&gt; to accommodate it, and adding &lt;VAR&gt;buf_len&lt;/VAR&gt; to
17975 &lt;CODE&gt;*&lt;VAR&gt;argz_len&lt;/VAR&gt;&lt;/CODE&gt;.
17976 </synopsis>
17977 </function>
17978 </construct>
17979 <construct id="function-argz_delete" type="function">
17980 <function returntype="void">
17981 <prototype>
17982 <parameter content="char **argz"/>
17983 <parameter content="size_t *argz_len"/>
17984 <parameter content="char *entry"/>
17985 </prototype>
17986 <headers>
17987 <header filename = "argz.h"/>
17988 </headers>
17989 <synopsis>
17990 If &lt;VAR&gt;entry&lt;/VAR&gt; points to the beginning of one of the elements in the
17991 argz vector &lt;CODE&gt;*&lt;VAR&gt;argz&lt;/VAR&gt;&lt;/CODE&gt;, the &lt;CODE&gt;argz_delete&lt;/CODE&gt; function will
17992 remove this entry and reallocate &lt;CODE&gt;*&lt;VAR&gt;argz&lt;/VAR&gt;&lt;/CODE&gt;, modifying
17993 &lt;CODE&gt;*&lt;VAR&gt;argz&lt;/VAR&gt;&lt;/CODE&gt; and &lt;CODE&gt;*&lt;VAR&gt;argz_len&lt;/VAR&gt;&lt;/CODE&gt; accordingly. Note that as
17994 destructive argz functions usually reallocate their argz argument,
17995 pointers into argz vectors such as &lt;VAR&gt;entry&lt;/VAR&gt; will then become invalid.
17996 </synopsis>
17997 </function>
17998 </construct>
17999 <construct id="function-argz_insert" type="function">
18000 <function returntype="error_t">
18001 <prototype>
18002 <parameter content="char **argz"/>
18003 <parameter content="size_t *argz_len"/>
18004 <parameter content="char *before"/>
18005 <parameter content="const char *entry"/>
18006 </prototype>
18007 <headers>
18008 <header filename = "argz.h"/>
18009 </headers>
18010 <synopsis>
18011 The &lt;CODE&gt;argz_insert&lt;/CODE&gt; function inserts the string &lt;VAR&gt;entry&lt;/VAR&gt; into the
18012 argz vector &lt;CODE&gt;*&lt;VAR&gt;argz&lt;/VAR&gt;&lt;/CODE&gt; at a point just before the existing
18013 element pointed to by &lt;VAR&gt;before&lt;/VAR&gt;, reallocating &lt;CODE&gt;*&lt;VAR&gt;argz&lt;/VAR&gt;&lt;/CODE&gt; and
18014 updating &lt;CODE&gt;*&lt;VAR&gt;argz&lt;/VAR&gt;&lt;/CODE&gt; and &lt;CODE&gt;*&lt;VAR&gt;argz_len&lt;/VAR&gt;&lt;/CODE&gt;. If &lt;VAR&gt;before&lt;/VAR&gt;
18015 is &lt;CODE&gt;0&lt;/CODE&gt;, &lt;VAR&gt;entry&lt;/VAR&gt; is added to the end instead (as if by
18016 &lt;CODE&gt;argz_add&lt;/CODE&gt;). Since the first element is in fact the same as
18017 &lt;CODE&gt;*&lt;VAR&gt;argz&lt;/VAR&gt;&lt;/CODE&gt;, passing in &lt;CODE&gt;*&lt;VAR&gt;argz&lt;/VAR&gt;&lt;/CODE&gt; as the value of
18018 &lt;VAR&gt;before&lt;/VAR&gt; will result in &lt;VAR&gt;entry&lt;/VAR&gt; being inserted at the beginning.
18019 </synopsis>
18020 </function>
18021 </construct>
18022 <construct id="function-argz_next" type="function">
18023 <function returntype="char *">
18024 <prototype>
18025 <parameter content="char *argz"/>
18026 <parameter content="size_t argz_len"/>
18027 <parameter content="const char *entry"/>
18028 </prototype>
18029 <headers>
18030 <header filename = "argz.h"/>
18031 </headers>
18032 <synopsis>
18033 The &lt;CODE&gt;argz_next&lt;/CODE&gt; function provides a convenient way of iterating
18034 over the elements in the argz vector &lt;VAR&gt;argz&lt;/VAR&gt;. It returns a pointer
18035 to the next element in &lt;VAR&gt;argz&lt;/VAR&gt; after the element &lt;VAR&gt;entry&lt;/VAR&gt;, or
18036 &lt;CODE&gt;0&lt;/CODE&gt; if there are no elements following &lt;VAR&gt;entry&lt;/VAR&gt;. If &lt;VAR&gt;entry&lt;/VAR&gt;
18037 is &lt;CODE&gt;0&lt;/CODE&gt;, the first element of &lt;VAR&gt;argz&lt;/VAR&gt; is returned.
18038 &lt;br&gt;&lt;br&gt; This behavior suggests two styles of iteration:
18039 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
18040 char *entry = 0;&lt;br&gt;
18041 while ((entry = argz_next (&lt;VAR&gt;argz&lt;/VAR&gt;, &lt;VAR&gt;argz_len&lt;/VAR&gt;, entry)))&lt;br&gt;
18042 &lt;VAR&gt;action&lt;/VAR&gt;;&lt;br&gt;
18043 &lt;/pre&gt;&lt;br&gt;
18044 &lt;br&gt;&lt;br&gt; (the double parentheses are necessary to make some C compilers shut up&lt;br&gt;
18045 about what they consider a questionable &lt;CODE&gt;while&lt;/CODE&gt;-test) and:&lt;br&gt;
18046 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
18047 char *entry;&lt;br&gt;
18048 for (entry = &lt;VAR&gt;argz&lt;/VAR&gt;;&lt;br&gt;
18049 entry;&lt;br&gt;
18050 entry = argz_next (&lt;VAR&gt;argz&lt;/VAR&gt;, &lt;VAR&gt;argz_len&lt;/VAR&gt;, entry))&lt;br&gt;
18051 &lt;VAR&gt;action&lt;/VAR&gt;;&lt;br&gt;
18052 &lt;/pre&gt;
18053 &lt;br&gt;&lt;br&gt; Note that the latter depends on &lt;VAR&gt;argz&lt;/VAR&gt; having a value of &lt;CODE&gt;0&lt;/CODE&gt; if
18054 it is empty (rather than a pointer to an empty block of memory); this
18055 invariant is maintained for argz vectors created by the functions here.
18056 </synopsis>
18057 </function>
18058 </construct>
18059 <construct id="function-argz_replace" type="function">
18060 <function returntype="error_t">
18061 <prototype>
18062 </prototype>
18063 <headers>
18064 <header filename = "argz.h"/>
18065 </headers>
18066 <synopsis>
18067 Replace any occurrences of the string &lt;VAR&gt;str&lt;/VAR&gt; in &lt;VAR&gt;argz&lt;/VAR&gt; with
18068 &lt;VAR&gt;with&lt;/VAR&gt;, reallocating &lt;VAR&gt;argz&lt;/VAR&gt; as necessary. If
18069 &lt;VAR&gt;replace_count&lt;/VAR&gt; is non-zero, &lt;CODE&gt;*&lt;VAR&gt;replace_count&lt;/VAR&gt;&lt;/CODE&gt; will be
18070 incremented by number of replacements performed.
18071 </synopsis>
18072 </function>
18073 </construct>
18074 <construct id="function-envz_entry" type="function">
18075 <function returntype="char *">
18076 <prototype>
18077 <parameter content="const char *envz"/>
18078 <parameter content="size_t envz_len"/>
18079 <parameter content="const char *name"/>
18080 </prototype>
18081 <headers>
18082 <header filename = "envz.h"/>
18083 </headers>
18084 <synopsis>
18085 The &lt;CODE&gt;envz_entry&lt;/CODE&gt; function finds the entry in &lt;VAR&gt;envz&lt;/VAR&gt; with the name
18086 &lt;VAR&gt;name&lt;/VAR&gt;, and returns a pointer to the whole entry---that is, the argz
18087 element which begins with &lt;VAR&gt;name&lt;/VAR&gt; followed by a &lt;CODE&gt;'='&lt;/CODE&gt; character. If
18088 there is no entry with that name, &lt;CODE&gt;0&lt;/CODE&gt; is returned.
18089 </synopsis>
18090 </function>
18091 </construct>
18092 <construct id="function-envz_get" type="function">
18093 <function returntype="char *">
18094 <prototype>
18095 <parameter content="const char *envz"/>
18096 <parameter content="size_t envz_len"/>
18097 <parameter content="const char *name"/>
18098 </prototype>
18099 <headers>
18100 <header filename = "envz.h"/>
18101 </headers>
18102 <synopsis>
18103 The &lt;CODE&gt;envz_get&lt;/CODE&gt; function finds the entry in &lt;VAR&gt;envz&lt;/VAR&gt; with the name
18104 &lt;VAR&gt;name&lt;/VAR&gt; (like &lt;CODE&gt;envz_entry&lt;/CODE&gt;), and returns a pointer to the value
18105 portion of that entry (following the &lt;CODE&gt;'='&lt;/CODE&gt;). If there is no entry with
18106 that name (or only a null entry), &lt;CODE&gt;0&lt;/CODE&gt; is returned.
18107 </synopsis>
18108 </function>
18109 </construct>
18110 <construct id="function-envz_add" type="function">
18111 <function returntype="error_t">
18112 <prototype>
18113 <parameter content="char **envz"/>
18114 <parameter content="size_t *envz_len"/>
18115 <parameter content="const char *name"/>
18116 <parameter content="const char *value"/>
18117 </prototype>
18118 <headers>
18119 <header filename = "envz.h"/>
18120 </headers>
18121 <synopsis>
18122 The &lt;CODE&gt;envz_add&lt;/CODE&gt; function adds an entry to &lt;CODE&gt;*&lt;VAR&gt;envz&lt;/VAR&gt;&lt;/CODE&gt;
18123 (updating &lt;CODE&gt;*&lt;VAR&gt;envz&lt;/VAR&gt;&lt;/CODE&gt; and &lt;CODE&gt;*&lt;VAR&gt;envz_len&lt;/VAR&gt;&lt;/CODE&gt;) with the name
18124 &lt;VAR&gt;name&lt;/VAR&gt;, and value &lt;VAR&gt;value&lt;/VAR&gt;. If an entry with the same name
18125 already exists in &lt;VAR&gt;envz&lt;/VAR&gt;, it is removed first. If &lt;VAR&gt;value&lt;/VAR&gt; is
18126 &lt;CODE&gt;0&lt;/CODE&gt;, then the new entry will the special null type of entry
18127 (mentioned above).
18128 </synopsis>
18129 </function>
18130 </construct>
18131 <construct id="function-envz_merge" type="function">
18132 <function returntype="error_t">
18133 <prototype>
18134 <parameter content="char **envz"/>
18135 <parameter content="size_t *envz_len"/>
18136 <parameter content="const char *envz2"/>
18137 <parameter content="size_t envz2_len"/>
18138 <parameter content="int override"/>
18139 </prototype>
18140 <headers>
18141 <header filename = "envz.h"/>
18142 </headers>
18143 <synopsis>
18144 The &lt;CODE&gt;envz_merge&lt;/CODE&gt; function adds each entry in &lt;VAR&gt;envz2&lt;/VAR&gt; to &lt;VAR&gt;envz&lt;/VAR&gt;,
18145 as if with &lt;CODE&gt;envz_add&lt;/CODE&gt;, updating &lt;CODE&gt;*&lt;VAR&gt;envz&lt;/VAR&gt;&lt;/CODE&gt; and
18146 &lt;CODE&gt;*&lt;VAR&gt;envz_len&lt;/VAR&gt;&lt;/CODE&gt;. If &lt;VAR&gt;override&lt;/VAR&gt; is true, then values in &lt;VAR&gt;envz2&lt;/VAR&gt;
18147 will supersede those with the same name in &lt;VAR&gt;envz&lt;/VAR&gt;, otherwise not.
18148 &lt;br&gt;&lt;br&gt; Null entries are treated just like other entries in this respect, so a null
18149 entry in &lt;VAR&gt;envz&lt;/VAR&gt; can prevent an entry of the same name in &lt;VAR&gt;envz2&lt;/VAR&gt; from
18150 being added to &lt;VAR&gt;envz&lt;/VAR&gt;, if &lt;VAR&gt;override&lt;/VAR&gt; is false.
18151 </synopsis>
18152 </function>
18153 </construct>
18154 <construct id="function-envz_strip" type="function">
18155 <function returntype="void">
18156 <prototype>
18157 <parameter content="char **envz"/>
18158 <parameter content="size_t *envz_len"/>
18159 </prototype>
18160 <headers>
18161 <header filename = "envz.h"/>
18162 </headers>
18163 <synopsis>
18164 The &lt;CODE&gt;envz_strip&lt;/CODE&gt; function removes any null entries from &lt;VAR&gt;envz&lt;/VAR&gt;,
18165 updating &lt;CODE&gt;*&lt;VAR&gt;envz&lt;/VAR&gt;&lt;/CODE&gt; and &lt;CODE&gt;*&lt;VAR&gt;envz_len&lt;/VAR&gt;&lt;/CODE&gt;.
18166 </synopsis>
18167 </function>
18168 </construct>
18169 <construct id="function-getopt" type="function">
18170 <function returntype="int">
18171 <prototype>
18172 <parameter content="int argc"/>
18173 <parameter content="char **argv"/>
18174 <parameter content="const char *options"/>
18175 </prototype>
18176 <headers>
18177 <header filename = "unistd.h"/>
18178 </headers>
18179 <synopsis>
18180 The &lt;CODE&gt;getopt&lt;/CODE&gt; function gets the next option argument from the
18181 argument list specified by the &lt;VAR&gt;argv&lt;/VAR&gt; and &lt;VAR&gt;argc&lt;/VAR&gt; arguments.
18182 Normally these values come directly from the arguments received by
18183 &lt;CODE&gt;main&lt;/CODE&gt;.
18184 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;options&lt;/VAR&gt; argument is a string that specifies the option
18185 characters that are valid for this program. An option character in this
18186 string can be followed by a colon (&lt;samp&gt;:&lt;/samp&gt;) to indicate that it takes a
18187 required argument. If an option character is followed by two colons
18188 (&lt;samp&gt;::&lt;/samp&gt;), its argument is optional; this is a GNU extension.
18189 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;getopt&lt;/CODE&gt; has three ways to deal with options that follow
18190 non-options &lt;VAR&gt;argv&lt;/VAR&gt; elements. The special argument &lt;samp&gt;--&lt;/samp&gt; forces
18191 in all cases the end of option scanning.
18192 &lt;br&gt;&lt;br&gt; &lt;OL&gt;
18193 &lt;LI&gt;
18194 The default is to permute the contents of &lt;VAR&gt;argv&lt;/VAR&gt; while scanning it
18195 so that eventually all the non-options are at the end. This allows
18196 options to be given in any order, even with programs that were not
18197 written to expect this.
18198 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
18199 If the &lt;VAR&gt;options&lt;/VAR&gt; argument string begins with a hyphen (&lt;samp&gt;-&lt;/samp&gt;), this
18200 is treated specially. It permits arguments that are not options to be
18201 returned as if they were associated with option character &lt;samp&gt;\1&lt;/samp&gt;.
18202 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
18203 POSIX demands the following behavior: The first non-option stops option
18204 processing. This mode is selected by either setting the environment
18205 variable &lt;CODE&gt;POSIXLY_CORRECT&lt;/CODE&gt; or beginning the &lt;VAR&gt;options&lt;/VAR&gt; argument
18206 string with a plus sign (&lt;samp&gt;+&lt;/samp&gt;).
18207 &lt;/OL&gt;
18208 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;getopt&lt;/CODE&gt; function returns the option character for the next
18209 command line option. When no more option arguments are available, it
18210 returns &lt;CODE&gt;-1&lt;/CODE&gt;. There may still be more non-option arguments; you
18211 must compare the external variable &lt;CODE&gt;optind&lt;/CODE&gt; against the &lt;VAR&gt;argc&lt;/VAR&gt;
18212 parameter to check this.
18213 &lt;br&gt;&lt;br&gt; If the option has an argument, &lt;CODE&gt;getopt&lt;/CODE&gt; returns the argument by
18214 storing it in the variable &lt;VAR&gt;optarg&lt;/VAR&gt;. You don't ordinarily need to
18215 copy the &lt;CODE&gt;optarg&lt;/CODE&gt; string, since it is a pointer into the original
18216 &lt;VAR&gt;argv&lt;/VAR&gt; array, not into a static area that might be overwritten.
18217 &lt;br&gt;&lt;br&gt; If &lt;CODE&gt;getopt&lt;/CODE&gt; finds an option character in &lt;VAR&gt;argv&lt;/VAR&gt; that was not
18218 included in &lt;VAR&gt;options&lt;/VAR&gt;, or a missing option argument, it returns
18219 &lt;samp&gt;?&lt;/samp&gt; and sets the external variable &lt;CODE&gt;optopt&lt;/CODE&gt; to the actual
18220 option character. If the first character of &lt;VAR&gt;options&lt;/VAR&gt; is a colon
18221 (&lt;samp&gt;:&lt;/samp&gt;), then &lt;CODE&gt;getopt&lt;/CODE&gt; returns &lt;samp&gt;:&lt;/samp&gt; instead of &lt;samp&gt;?&lt;/samp&gt; to
18222 indicate a missing option argument. In addition, if the external
18223 variable &lt;CODE&gt;opterr&lt;/CODE&gt; is nonzero (which is the default), &lt;CODE&gt;getopt&lt;/CODE&gt;
18224 prints an error message.
18225 </synopsis>
18226 </function>
18227 </construct>
18228 <construct id="struct-option" type="struct">
18229 <structure>
18230 <synopsis>
18231 This structure describes a single long option name for the sake of
18232 &lt;CODE&gt;getopt_long&lt;/CODE&gt;. The argument &lt;VAR&gt;longopts&lt;/VAR&gt; must be an array of
18233 these structures, one for each long option. Terminate the array with an
18234 element containing all zeros.
18235 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;struct option&lt;/CODE&gt; structure has these fields:
18236 &lt;br&gt;&lt;br&gt;
18237 </synopsis>
18238 <elements>
18239 <element content="const char *name">
18240 <synopsis>
18241 This field is the name of the option. It is a string.
18242 &lt;br&gt;&lt;br&gt;
18243 </synopsis>
18244 </element>
18245 <element content="int has_arg">
18246 <synopsis>
18247 This field says whether the option takes an argument. It is an integer,
18248 and there are three legitimate values: &lt;CODE&gt;no_argument&lt;/CODE&gt;,
18249 &lt;CODE&gt;required_argument&lt;/CODE&gt; and &lt;CODE&gt;optional_argument&lt;/CODE&gt;.
18250 &lt;br&gt;&lt;br&gt;
18251 </synopsis>
18252 </element>
18253 <element content="int *flag">
18254 </element>
18255 </elements>
18256 </structure>
18257 </construct>
18258 <construct id="function-getopt_long" type="function">
18259 <function returntype="int">
18260 <prototype>
18261 <parameter content="int argc"/>
18262 <parameter content="char *const *argv"/>
18263 <parameter content="const char *shortopts"/>
18264 <parameter content="const struct option *longopts"/>
18265 <parameter content="int *indexptr"/>
18266 </prototype>
18267 <headers>
18268 <header filename = "getopt.h"/>
18269 </headers>
18270 <synopsis>
18271 Decode options from the vector &lt;VAR&gt;argv&lt;/VAR&gt; (whose length is &lt;VAR&gt;argc&lt;/VAR&gt;).
18272 The argument &lt;VAR&gt;shortopts&lt;/VAR&gt; describes the short options to accept, just as
18273 it does in &lt;CODE&gt;getopt&lt;/CODE&gt;. The argument &lt;VAR&gt;longopts&lt;/VAR&gt; describes the long
18274 options to accept (see above).
18275 &lt;br&gt;&lt;br&gt; When &lt;CODE&gt;getopt_long&lt;/CODE&gt; encounters a short option, it does the same
18276 thing that &lt;CODE&gt;getopt&lt;/CODE&gt; would do: it returns the character code for the
18277 option, and stores the options argument (if it has one) in &lt;CODE&gt;optarg&lt;/CODE&gt;.
18278 &lt;br&gt;&lt;br&gt; When &lt;CODE&gt;getopt_long&lt;/CODE&gt; encounters a long option, it takes actions based
18279 on the &lt;CODE&gt;flag&lt;/CODE&gt; and &lt;CODE&gt;val&lt;/CODE&gt; fields of the definition of that
18280 option.
18281 &lt;br&gt;&lt;br&gt; If &lt;CODE&gt;flag&lt;/CODE&gt; is a null pointer, then &lt;CODE&gt;getopt_long&lt;/CODE&gt; returns the
18282 contents of &lt;CODE&gt;val&lt;/CODE&gt; to indicate which option it found. You should
18283 arrange distinct values in the &lt;CODE&gt;val&lt;/CODE&gt; field for options with
18284 different meanings, so you can decode these values after
18285 &lt;CODE&gt;getopt_long&lt;/CODE&gt; returns. If the long option is equivalent to a short
18286 option, you can use the short option's character code in &lt;CODE&gt;val&lt;/CODE&gt;.
18287 &lt;br&gt;&lt;br&gt; If &lt;CODE&gt;flag&lt;/CODE&gt; is not a null pointer, that means this option should just
18288 set a flag in the program. The flag is a variable of type &lt;CODE&gt;int&lt;/CODE&gt;
18289 that you define. Put the address of the flag in the &lt;CODE&gt;flag&lt;/CODE&gt; field.
18290 Put in the &lt;CODE&gt;val&lt;/CODE&gt; field the value you would like this option to
18291 store in the flag. In this case, &lt;CODE&gt;getopt_long&lt;/CODE&gt; returns &lt;CODE&gt;0&lt;/CODE&gt;.
18292 &lt;br&gt;&lt;br&gt; For any long option, &lt;CODE&gt;getopt_long&lt;/CODE&gt; tells you the index in the array
18293 &lt;VAR&gt;longopts&lt;/VAR&gt; of the options definition, by storing it into
18294 &lt;CODE&gt;*&lt;VAR&gt;indexptr&lt;/VAR&gt;&lt;/CODE&gt;. You can get the name of the option with
18295 &lt;CODE&gt;&lt;VAR&gt;longopts&lt;/VAR&gt;[*&lt;VAR&gt;indexptr&lt;/VAR&gt;].name&lt;/CODE&gt;. So you can distinguish among
18296 long options either by the values in their &lt;CODE&gt;val&lt;/CODE&gt; fields or by their
18297 indices. You can also distinguish in this way among long options that
18298 set flags.
18299 &lt;br&gt;&lt;br&gt; When a long option has an argument, &lt;CODE&gt;getopt_long&lt;/CODE&gt; puts the argument
18300 value in the variable &lt;CODE&gt;optarg&lt;/CODE&gt; before returning. When the option
18301 has no argument, the value in &lt;CODE&gt;optarg&lt;/CODE&gt; is a null pointer. This is
18302 how you can tell whether an optional argument was supplied.
18303 &lt;br&gt;&lt;br&gt; When &lt;CODE&gt;getopt_long&lt;/CODE&gt; has no more options to handle, it returns
18304 &lt;CODE&gt;-1&lt;/CODE&gt;, and leaves in the variable &lt;CODE&gt;optind&lt;/CODE&gt; the index in
18305 &lt;VAR&gt;argv&lt;/VAR&gt; of the next remaining argument.
18306 </synopsis>
18307 </function>
18308 </construct>
18309 <construct id="function-getopt_long_only" type="function">
18310 <function returntype="int">
18311 <prototype>
18312 <parameter content="int argc"/>
18313 <parameter content="char *const *argv"/>
18314 <parameter content="const char *shortopts"/>
18315 <parameter content="const struct option *longopts"/>
18316 <parameter content="int *indexptr"/>
18317 </prototype>
18318 <headers>
18319 <header filename = "getopt.h"/>
18320 </headers>
18321 <synopsis>
18322 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;getopt_long_only&lt;/CODE&gt; function is equivalent to the
18323 &lt;CODE&gt;getopt_long&lt;/CODE&gt; function but it allows to specify the user of the
18324 application to pass long options with only &lt;samp&gt;-&lt;/samp&gt; instead of
18325 &lt;samp&gt;--&lt;/samp&gt;. The &lt;samp&gt;--&lt;/samp&gt; prefix is still recognized but instead of
18326 looking through the short options if a &lt;samp&gt;-&lt;/samp&gt; is seen it is first
18327 tried whether this parameter names a long option. If not, it is parsed
18328 as a short option.
18329 &lt;br&gt;&lt;br&gt; Assuming &lt;CODE&gt;getopt_long_only&lt;/CODE&gt; is used starting an application with
18330 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
18331 app -foo&lt;br&gt;
18332 &lt;/pre&gt;
18333 &lt;br&gt;&lt;br&gt;
18334 the &lt;CODE&gt;getopt_long_only&lt;/CODE&gt; will first look for a long option named
18335 &lt;samp&gt;foo&lt;/samp&gt;. If this is not found, the short options &lt;samp&gt;f&lt;/samp&gt;, &lt;samp&gt;o&lt;/samp&gt;,
18336 and again &lt;samp&gt;o&lt;/samp&gt; are recognized.
18337 </synopsis>
18338 </function>
18339 </construct>
18340 <construct id="dtype-div_t" type="dtype">
18341 <structure>
18342 <synopsis>
18343 This is a structure type used to hold the result returned by the &lt;CODE&gt;div&lt;/CODE&gt;
18344 function. It has the following members:
18345 &lt;br&gt;&lt;br&gt;
18346 </synopsis>
18347 <elements>
18348 <element content="int quot">
18349 <synopsis>
18350 The quotient from the division.
18351 &lt;br&gt;&lt;br&gt;
18352 </synopsis>
18353 </element>
18354 </elements>
18355 </structure>
18356 </construct>
18357 <construct id="function-div" type="function">
18358 <function returntype="div_t">
18359 <prototype>
18360 <parameter content="int numerator"/>
18361 <parameter content="int denominator"/>
18362 </prototype>
18363 <headers>
18364 <header filename = "stdlib.h"/>
18365 </headers>
18366 <synopsis>
18367 This function &lt;CODE&gt;div&lt;/CODE&gt; computes the quotient and remainder from
18368 the division of &lt;VAR&gt;numerator&lt;/VAR&gt; by &lt;VAR&gt;denominator&lt;/VAR&gt;, returning the
18369 result in a structure of type &lt;CODE&gt;div_t&lt;/CODE&gt;.
18370 &lt;br&gt;&lt;br&gt; If the result cannot be represented (as in a division by zero), the
18371 behavior is undefined.
18372 &lt;br&gt;&lt;br&gt; Here is an example, albeit not a very useful one.
18373 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
18374 div_t result;&lt;br&gt;
18375 result = div (20, -6);&lt;br&gt;
18376 &lt;/pre&gt;
18377 &lt;br&gt;&lt;br&gt;
18378 Now &lt;CODE&gt;result.quot&lt;/CODE&gt; is &lt;CODE&gt;-3&lt;/CODE&gt; and &lt;CODE&gt;result.rem&lt;/CODE&gt; is &lt;CODE&gt;2&lt;/CODE&gt;.
18379 </synopsis>
18380 </function>
18381 </construct>
18382 <construct id="dtype-ldiv_t" type="dtype">
18383 <structure>
18384 <synopsis>
18385 This is a structure type used to hold the result returned by the &lt;CODE&gt;ldiv&lt;/CODE&gt;
18386 function. It has the following members:
18387 &lt;br&gt;&lt;br&gt;
18388 </synopsis>
18389 <elements>
18390 <element content="long int quot">
18391 <synopsis>
18392 The quotient from the division.
18393 &lt;br&gt;&lt;br&gt;
18394 </synopsis>
18395 </element>
18396 </elements>
18397 </structure>
18398 </construct>
18399 <construct id="function-ldiv" type="function">
18400 <function returntype="ldiv_t">
18401 <prototype>
18402 <parameter content="long int numerator"/>
18403 <parameter content="long int denominator"/>
18404 </prototype>
18405 <headers>
18406 <header filename = "stdlib.h"/>
18407 </headers>
18408 <synopsis>
18409 The &lt;CODE&gt;ldiv&lt;/CODE&gt; function is similar to &lt;CODE&gt;div&lt;/CODE&gt;, except that the
18410 arguments are of type &lt;CODE&gt;long int&lt;/CODE&gt; and the result is returned as a
18411 structure of type &lt;CODE&gt;ldiv_t&lt;/CODE&gt;.
18412 </synopsis>
18413 </function>
18414 </construct>
18415 <construct id="dtype-lldiv_t" type="dtype">
18416 <structure>
18417 <synopsis>
18418 This is a structure type used to hold the result returned by the &lt;CODE&gt;lldiv&lt;/CODE&gt;
18419 function. It has the following members:
18420 &lt;br&gt;&lt;br&gt;
18421 </synopsis>
18422 <elements>
18423 <element content="long long int quot">
18424 <synopsis>
18425 The quotient from the division.
18426 &lt;br&gt;&lt;br&gt;
18427 </synopsis>
18428 </element>
18429 </elements>
18430 </structure>
18431 </construct>
18432 <construct id="function-lldiv" type="function">
18433 <function returntype="lldiv_t">
18434 <prototype>
18435 <parameter content="long long int numerator"/>
18436 <parameter content="long long int denominator"/>
18437 </prototype>
18438 <headers>
18439 <header filename = "stdlib.h"/>
18440 </headers>
18441 <synopsis>
18442 The &lt;CODE&gt;lldiv&lt;/CODE&gt; function is like the &lt;CODE&gt;div&lt;/CODE&gt; function, but the
18443 arguments are of type &lt;CODE&gt;long long int&lt;/CODE&gt; and the result is returned as
18444 a structure of type &lt;CODE&gt;lldiv_t&lt;/CODE&gt;.
18445 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;lldiv&lt;/CODE&gt; function was added in ISO C99.
18446 </synopsis>
18447 </function>
18448 </construct>
18449 <construct id="dtype-imaxdiv_t" type="dtype">
18450 <structure>
18451 <synopsis>
18452 This is a structure type used to hold the result returned by the &lt;CODE&gt;imaxdiv&lt;/CODE&gt;
18453 function. It has the following members:
18454 &lt;br&gt;&lt;br&gt;
18455 </synopsis>
18456 <elements>
18457 <element content="intmax_t quot">
18458 <synopsis>
18459 The quotient from the division.
18460 &lt;br&gt;&lt;br&gt;
18461 </synopsis>
18462 </element>
18463 </elements>
18464 </structure>
18465 </construct>
18466 <construct id="function-imaxdiv" type="function">
18467 <function returntype="imaxdiv_t">
18468 <prototype>
18469 <parameter content="intmax_t numerator"/>
18470 <parameter content="intmax_t denominator"/>
18471 </prototype>
18472 <headers>
18473 <header filename = "inttypes.h"/>
18474 </headers>
18475 <synopsis>
18476 The &lt;CODE&gt;imaxdiv&lt;/CODE&gt; function is like the &lt;CODE&gt;div&lt;/CODE&gt; function, but the
18477 arguments are of type &lt;CODE&gt;intmax_t&lt;/CODE&gt; and the result is returned as
18478 a structure of type &lt;CODE&gt;imaxdiv_t&lt;/CODE&gt;.
18479 &lt;br&gt;&lt;br&gt; See Integers for a description of the &lt;CODE&gt;intmax_t&lt;/CODE&gt; type.
18480 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;imaxdiv&lt;/CODE&gt; function was added in ISO C99.
18481 </synopsis>
18482 </function>
18483 </construct>
18484 <construct id="function-isinf" type="function">
18485 <function returntype="int">
18486 <prototype>
18487 <parameter content="double x"/>
18488 </prototype>
18489 <headers>
18490 <header filename = "math.h"/>
18491 </headers>
18492 <synopsis>
18493 This function returns &lt;CODE&gt;-1&lt;/CODE&gt; if &lt;VAR&gt;x&lt;/VAR&gt; represents negative infinity,
18494 &lt;CODE&gt;1&lt;/CODE&gt; if &lt;VAR&gt;x&lt;/VAR&gt; represents positive infinity, and &lt;CODE&gt;0&lt;/CODE&gt; otherwise.
18495 </synopsis>
18496 </function>
18497 </construct>
18498 <construct id="function-isinff" type="function">
18499 <function returntype="int">
18500 <prototype>
18501 <parameter content="float x"/>
18502 </prototype>
18503 <headers>
18504 <header filename = "math.h"/>
18505 </headers>
18506 <synopsis>
18507 This function returns &lt;CODE&gt;-1&lt;/CODE&gt; if &lt;VAR&gt;x&lt;/VAR&gt; represents negative infinity,
18508 &lt;CODE&gt;1&lt;/CODE&gt; if &lt;VAR&gt;x&lt;/VAR&gt; represents positive infinity, and &lt;CODE&gt;0&lt;/CODE&gt; otherwise.
18509 </synopsis>
18510 </function>
18511 </construct>
18512 <construct id="function-isinfl" type="function">
18513 <function returntype="int">
18514 <prototype>
18515 <parameter content="long double x"/>
18516 </prototype>
18517 <headers>
18518 <header filename = "math.h"/>
18519 </headers>
18520 <synopsis>
18521 This function returns &lt;CODE&gt;-1&lt;/CODE&gt; if &lt;VAR&gt;x&lt;/VAR&gt; represents negative infinity,
18522 &lt;CODE&gt;1&lt;/CODE&gt; if &lt;VAR&gt;x&lt;/VAR&gt; represents positive infinity, and &lt;CODE&gt;0&lt;/CODE&gt; otherwise.
18523 </synopsis>
18524 </function>
18525 </construct>
18526 <construct id="function-isnan" type="function">
18527 <function returntype="int">
18528 <prototype>
18529 <parameter content="double x"/>
18530 </prototype>
18531 <headers>
18532 <header filename = "math.h"/>
18533 </headers>
18534 <synopsis>
18535 This function returns a nonzero value if &lt;VAR&gt;x&lt;/VAR&gt; is a ``not a number''
18536 value, and zero otherwise.
18537 &lt;br&gt;&lt;br&gt; NB: The &lt;CODE&gt;isnan&lt;/CODE&gt; macro defined by ISO C99 overrides
18538 the BSD function. This is normally not a problem, because the two
18539 routines behave identically. However, if you really need to get the BSD
18540 function for some reason, you can write
18541 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
18542 (isnan) (x)&lt;br&gt;
18543 &lt;/pre&gt;
18544 </synopsis>
18545 </function>
18546 </construct>
18547 <construct id="function-isnanf" type="function">
18548 <function returntype="int">
18549 <prototype>
18550 <parameter content="float x"/>
18551 </prototype>
18552 <headers>
18553 <header filename = "math.h"/>
18554 </headers>
18555 <synopsis>
18556 This function returns a nonzero value if &lt;VAR&gt;x&lt;/VAR&gt; is a ``not a number''
18557 value, and zero otherwise.
18558 &lt;br&gt;&lt;br&gt; NB: The &lt;CODE&gt;isnan&lt;/CODE&gt; macro defined by ISO C99 overrides
18559 the BSD function. This is normally not a problem, because the two
18560 routines behave identically. However, if you really need to get the BSD
18561 function for some reason, you can write
18562 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
18563 (isnan) (x)&lt;br&gt;
18564 &lt;/pre&gt;
18565 </synopsis>
18566 </function>
18567 </construct>
18568 <construct id="function-isnanl" type="function">
18569 <function returntype="int">
18570 <prototype>
18571 <parameter content="long double x"/>
18572 </prototype>
18573 <headers>
18574 <header filename = "math.h"/>
18575 </headers>
18576 <synopsis>
18577 This function returns a nonzero value if &lt;VAR&gt;x&lt;/VAR&gt; is a ``not a number''
18578 value, and zero otherwise.
18579 &lt;br&gt;&lt;br&gt; NB: The &lt;CODE&gt;isnan&lt;/CODE&gt; macro defined by ISO C99 overrides
18580 the BSD function. This is normally not a problem, because the two
18581 routines behave identically. However, if you really need to get the BSD
18582 function for some reason, you can write
18583 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
18584 (isnan) (x)&lt;br&gt;
18585 &lt;/pre&gt;
18586 </synopsis>
18587 </function>
18588 </construct>
18589 <construct id="function-finite" type="function">
18590 <function returntype="int">
18591 <prototype>
18592 <parameter content="double x"/>
18593 </prototype>
18594 <headers>
18595 <header filename = "math.h"/>
18596 </headers>
18597 <synopsis>
18598 This function returns a nonzero value if &lt;VAR&gt;x&lt;/VAR&gt; is finite or a ``not a
18599 number'' value, and zero otherwise.
18600 </synopsis>
18601 </function>
18602 </construct>
18603 <construct id="function-finitef" type="function">
18604 <function returntype="int">
18605 <prototype>
18606 <parameter content="float x"/>
18607 </prototype>
18608 <headers>
18609 <header filename = "math.h"/>
18610 </headers>
18611 <synopsis>
18612 This function returns a nonzero value if &lt;VAR&gt;x&lt;/VAR&gt; is finite or a ``not a
18613 number'' value, and zero otherwise.
18614 </synopsis>
18615 </function>
18616 </construct>
18617 <construct id="function-finitel" type="function">
18618 <function returntype="int">
18619 <prototype>
18620 <parameter content="long double x"/>
18621 </prototype>
18622 <headers>
18623 <header filename = "math.h"/>
18624 </headers>
18625 <synopsis>
18626 This function returns a nonzero value if &lt;VAR&gt;x&lt;/VAR&gt; is finite or a ``not a
18627 number'' value, and zero otherwise.
18628 </synopsis>
18629 </function>
18630 </construct>
18631 <construct id="function-feclearexcept" type="function">
18632 <function returntype="int">
18633 <prototype>
18634 <parameter content="int excepts"/>
18635 </prototype>
18636 <headers>
18637 <header filename = "math.h"/>
18638 <header filename = "fenv.h"/>
18639 </headers>
18640 <synopsis>
18641 This function clears all of the supported exception flags indicated by
18642 &lt;VAR&gt;excepts&lt;/VAR&gt;.
18643 &lt;br&gt;&lt;br&gt; The function returns zero in case the operation was successful, a
18644 non-zero value otherwise.
18645 </synopsis>
18646 </function>
18647 </construct>
18648 <construct id="function-feraiseexcept" type="function">
18649 <function returntype="int">
18650 <prototype>
18651 <parameter content="int excepts"/>
18652 </prototype>
18653 <headers>
18654 <header filename = "fenv.h"/>
18655 </headers>
18656 <synopsis>
18657 This function raises the supported exceptions indicated by
18658 &lt;VAR&gt;excepts&lt;/VAR&gt;. If more than one exception bit in &lt;VAR&gt;excepts&lt;/VAR&gt; is set
18659 the order in which the exceptions are raised is undefined except that
18660 overflow (&lt;CODE&gt;FE_OVERFLOW&lt;/CODE&gt;) or underflow (&lt;CODE&gt;FE_UNDERFLOW&lt;/CODE&gt;) are
18661 raised before inexact (&lt;CODE&gt;FE_INEXACT&lt;/CODE&gt;). Whether for overflow or
18662 underflow the inexact exception is also raised is also implementation
18663 dependent.
18664 &lt;br&gt;&lt;br&gt; The function returns zero in case the operation was successful, a
18665 non-zero value otherwise.
18666 </synopsis>
18667 </function>
18668 </construct>
18669 <construct id="function-fetestexcept" type="function">
18670 <function returntype="int">
18671 <prototype>
18672 <parameter content="int excepts"/>
18673 </prototype>
18674 <headers>
18675 <header filename = "fenv.h"/>
18676 </headers>
18677 <synopsis>
18678 Test whether the exception flags indicated by the parameter &lt;VAR&gt;except&lt;/VAR&gt;
18679 are currently set. If any of them are, a nonzero value is returned
18680 which specifies which exceptions are set. Otherwise the result is zero.
18681 </synopsis>
18682 </function>
18683 </construct>
18684 <construct id="function-fegetexceptflag" type="function">
18685 <function returntype="int">
18686 <prototype>
18687 <parameter content="fexcept_t *flagp"/>
18688 <parameter content="int excepts"/>
18689 </prototype>
18690 <headers>
18691 <header filename = "fenv.h"/>
18692 </headers>
18693 <synopsis>
18694 This function stores in the variable pointed to by &lt;VAR&gt;flagp&lt;/VAR&gt; an
18695 implementation-defined value representing the current setting of the
18696 exception flags indicated by &lt;VAR&gt;excepts&lt;/VAR&gt;.
18697 &lt;br&gt;&lt;br&gt; The function returns zero in case the operation was successful, a
18698 non-zero value otherwise.
18699 </synopsis>
18700 </function>
18701 </construct>
18702 <construct id="function-fesetexceptflag" type="function">
18703 <function returntype="int">
18704 <prototype>
18705 <parameter content="const fexcept_t *flagp"/>
18706 <parameter content="int excepts"/>
18707 </prototype>
18708 <headers>
18709 <header filename = "fenv.h"/>
18710 </headers>
18711 <synopsis>
18712 This function restores the flags for the exceptions indicated by
18713 &lt;VAR&gt;excepts&lt;/VAR&gt; to the values stored in the variable pointed to by
18714 &lt;VAR&gt;flagp&lt;/VAR&gt;.
18715 &lt;br&gt;&lt;br&gt; The function returns zero in case the operation was successful, a
18716 non-zero value otherwise.
18717 </synopsis>
18718 </function>
18719 </construct>
18720 <construct id="function-fegetround" type="function">
18721 <function returntype="int">
18722 <prototype>
18723 <parameter content="void"/>
18724 </prototype>
18725 <headers>
18726 <header filename = "math.h"/>
18727 <header filename = "fenv.h"/>
18728 </headers>
18729 <synopsis>
18730 Returns the currently selected rounding mode, represented by one of the
18731 values of the defined rounding mode macros.
18732 </synopsis>
18733 </function>
18734 </construct>
18735 <construct id="function-fesetround" type="function">
18736 <function returntype="int">
18737 <prototype>
18738 <parameter content="int round"/>
18739 </prototype>
18740 <headers>
18741 <header filename = "fenv.h"/>
18742 </headers>
18743 <synopsis>
18744 Changes the currently selected rounding mode to &lt;VAR&gt;round&lt;/VAR&gt;. If
18745 &lt;VAR&gt;round&lt;/VAR&gt; does not correspond to one of the supported rounding modes
18746 nothing is changed. &lt;CODE&gt;fesetround&lt;/CODE&gt; returns zero if it changed the
18747 rounding mode, a nonzero value if the mode is not supported.
18748 </synopsis>
18749 </function>
18750 </construct>
18751 <construct id="function-fegetenv" type="function">
18752 <function returntype="int">
18753 <prototype>
18754 <parameter content="fenv_t *envp"/>
18755 </prototype>
18756 <headers>
18757 <header filename = "fenv.h"/>
18758 </headers>
18759 <synopsis>
18760 Store the floating-point environment in the variable pointed to by
18761 &lt;VAR&gt;envp&lt;/VAR&gt;.
18762 &lt;br&gt;&lt;br&gt; The function returns zero in case the operation was successful, a
18763 non-zero value otherwise.
18764 </synopsis>
18765 </function>
18766 </construct>
18767 <construct id="function-feholdexcept" type="function">
18768 <function returntype="int">
18769 <prototype>
18770 <parameter content="fenv_t *envp"/>
18771 </prototype>
18772 <headers>
18773 <header filename = "fenv.h"/>
18774 </headers>
18775 <synopsis>
18776 Store the current floating-point environment in the object pointed to by
18777 &lt;VAR&gt;envp&lt;/VAR&gt;. Then clear all exception flags, and set the FPU to trap no
18778 exceptions. Not all FPUs support trapping no exceptions; if
18779 &lt;CODE&gt;feholdexcept&lt;/CODE&gt; cannot set this mode, it returns nonzero value. If it
18780 succeeds, it returns zero.
18781 </synopsis>
18782 </function>
18783 </construct>
18784 <construct id="function-fesetenv" type="function">
18785 <function returntype="int">
18786 <prototype>
18787 <parameter content="const fenv_t *envp"/>
18788 </prototype>
18789 <headers>
18790 <header filename = "fenv.h"/>
18791 </headers>
18792 <synopsis>
18793 Set the floating-point environment to that described by &lt;VAR&gt;envp&lt;/VAR&gt;.
18794 &lt;br&gt;&lt;br&gt; The function returns zero in case the operation was successful, a
18795 non-zero value otherwise.
18796 </synopsis>
18797 </function>
18798 </construct>
18799 <construct id="function-feupdateenv" type="function">
18800 <function returntype="int">
18801 <prototype>
18802 <parameter content="const fenv_t *envp"/>
18803 </prototype>
18804 <headers>
18805 <header filename = "fenv.h"/>
18806 </headers>
18807 <synopsis>
18808 Like &lt;CODE&gt;fesetenv&lt;/CODE&gt;, this function sets the floating-point environment
18809 to that described by &lt;VAR&gt;envp&lt;/VAR&gt;. However, if any exceptions were
18810 flagged in the status word before &lt;CODE&gt;feupdateenv&lt;/CODE&gt; was called, they
18811 remain flagged after the call. In other words, after &lt;CODE&gt;feupdateenv&lt;/CODE&gt;
18812 is called, the status word is the bitwise OR of the previous status word
18813 and the one saved in &lt;VAR&gt;envp&lt;/VAR&gt;.
18814 &lt;br&gt;&lt;br&gt; The function returns zero in case the operation was successful, a
18815 non-zero value otherwise.
18816 </synopsis>
18817 </function>
18818 </construct>
18819 <construct id="function-feenableexcept" type="function">
18820 <function returntype="int">
18821 <prototype>
18822 <parameter content="int excepts"/>
18823 </prototype>
18824 <headers>
18825 <header filename = "fenv.h"/>
18826 </headers>
18827 <synopsis>
18828 This functions enables traps for each of the exceptions as indicated by
18829 the parameter &lt;VAR&gt;except&lt;/VAR&gt;. The individual excepetions are described in
18830 Status bit operations. Only the specified exceptions are
18831 enabled, the status of the other exceptions is not changed.
18832 &lt;br&gt;&lt;br&gt; The function returns the previous enabled exceptions in case the
18833 operation was successful, &lt;CODE&gt;-1&lt;/CODE&gt; otherwise.
18834 </synopsis>
18835 </function>
18836 </construct>
18837 <construct id="function-fedisableexcept" type="function">
18838 <function returntype="int">
18839 <prototype>
18840 <parameter content="int excepts"/>
18841 </prototype>
18842 <headers>
18843 <header filename = "fenv.h"/>
18844 </headers>
18845 <synopsis>
18846 This functions disables traps for each of the exceptions as indicated by
18847 the parameter &lt;VAR&gt;except&lt;/VAR&gt;. The individual excepetions are described in
18848 Status bit operations. Only the specified exceptions are
18849 disabled, the status of the other exceptions is not changed.
18850 &lt;br&gt;&lt;br&gt; The function returns the previous enabled exceptions in case the
18851 operation was successful, &lt;CODE&gt;-1&lt;/CODE&gt; otherwise.
18852 </synopsis>
18853 </function>
18854 </construct>
18855 <construct id="function-fegetexcept" type="function">
18856 <function returntype="int">
18857 <prototype>
18858 <parameter content="int excepts"/>
18859 </prototype>
18860 <headers>
18861 <header filename = "fenv.h"/>
18862 </headers>
18863 <synopsis>
18864 The function returns a bitmask of all currently enabled exceptions. It
18865 returns &lt;CODE&gt;-1&lt;/CODE&gt; in case of failure.
18866 </synopsis>
18867 </function>
18868 </construct>
18869 <construct id="function-abs" type="function">
18870 <function returntype="int">
18871 <prototype>
18872 <parameter content="int number"/>
18873 </prototype>
18874 <headers>
18875 <header filename = "stdlib.h"/>
18876 </headers>
18877 <synopsis>
18878 These functions return the absolute value of &lt;VAR&gt;number&lt;/VAR&gt;.
18879 &lt;br&gt;&lt;br&gt; Most computers use a two's complement integer representation, in which
18880 the absolute value of &lt;CODE&gt;INT_MIN&lt;/CODE&gt; (the smallest possible &lt;CODE&gt;int&lt;/CODE&gt;)
18881 cannot be represented; thus, &lt;CODE&gt;abs (INT_MIN)&lt;/CODE&gt; is not defined.
18882 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;llabs&lt;/CODE&gt; and &lt;CODE&gt;imaxdiv&lt;/CODE&gt; are new to ISO C99.
18883 &lt;br&gt;&lt;br&gt; See Integers for a description of the &lt;CODE&gt;intmax_t&lt;/CODE&gt; type.
18884 &lt;br&gt;&lt;br&gt;
18885 </synopsis>
18886 </function>
18887 </construct>
18888 <construct id="function-labs" type="function">
18889 <function returntype="long int">
18890 <prototype>
18891 <parameter content="long int number"/>
18892 </prototype>
18893 <headers>
18894 <header filename = "stdlib.h"/>
18895 </headers>
18896 <synopsis>
18897 These functions return the absolute value of &lt;VAR&gt;number&lt;/VAR&gt;.
18898 &lt;br&gt;&lt;br&gt; Most computers use a two's complement integer representation, in which
18899 the absolute value of &lt;CODE&gt;INT_MIN&lt;/CODE&gt; (the smallest possible &lt;CODE&gt;int&lt;/CODE&gt;)
18900 cannot be represented; thus, &lt;CODE&gt;abs (INT_MIN)&lt;/CODE&gt; is not defined.
18901 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;llabs&lt;/CODE&gt; and &lt;CODE&gt;imaxdiv&lt;/CODE&gt; are new to ISO C99.
18902 &lt;br&gt;&lt;br&gt; See Integers for a description of the &lt;CODE&gt;intmax_t&lt;/CODE&gt; type.
18903 &lt;br&gt;&lt;br&gt;
18904 </synopsis>
18905 </function>
18906 </construct>
18907 <construct id="function-llabs" type="function">
18908 <function returntype="long long int">
18909 <prototype>
18910 <parameter content="long long int number"/>
18911 </prototype>
18912 <headers>
18913 <header filename = "stdlib.h"/>
18914 </headers>
18915 <synopsis>
18916 These functions return the absolute value of &lt;VAR&gt;number&lt;/VAR&gt;.
18917 &lt;br&gt;&lt;br&gt; Most computers use a two's complement integer representation, in which
18918 the absolute value of &lt;CODE&gt;INT_MIN&lt;/CODE&gt; (the smallest possible &lt;CODE&gt;int&lt;/CODE&gt;)
18919 cannot be represented; thus, &lt;CODE&gt;abs (INT_MIN)&lt;/CODE&gt; is not defined.
18920 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;llabs&lt;/CODE&gt; and &lt;CODE&gt;imaxdiv&lt;/CODE&gt; are new to ISO C99.
18921 &lt;br&gt;&lt;br&gt; See Integers for a description of the &lt;CODE&gt;intmax_t&lt;/CODE&gt; type.
18922 &lt;br&gt;&lt;br&gt;
18923 </synopsis>
18924 </function>
18925 </construct>
18926 <construct id="function-imaxabs" type="function">
18927 <function returntype="intmax_t">
18928 <prototype>
18929 <parameter content="intmax_t number"/>
18930 </prototype>
18931 <headers>
18932 <header filename = "inttypes.h"/>
18933 </headers>
18934 <synopsis>
18935 These functions return the absolute value of &lt;VAR&gt;number&lt;/VAR&gt;.
18936 &lt;br&gt;&lt;br&gt; Most computers use a two's complement integer representation, in which
18937 the absolute value of &lt;CODE&gt;INT_MIN&lt;/CODE&gt; (the smallest possible &lt;CODE&gt;int&lt;/CODE&gt;)
18938 cannot be represented; thus, &lt;CODE&gt;abs (INT_MIN)&lt;/CODE&gt; is not defined.
18939 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;llabs&lt;/CODE&gt; and &lt;CODE&gt;imaxdiv&lt;/CODE&gt; are new to ISO C99.
18940 &lt;br&gt;&lt;br&gt; See Integers for a description of the &lt;CODE&gt;intmax_t&lt;/CODE&gt; type.
18941 &lt;br&gt;&lt;br&gt;
18942 </synopsis>
18943 </function>
18944 </construct>
18945 <construct id="function-fabs" type="function">
18946 <function returntype="double">
18947 <prototype>
18948 <parameter content="double number"/>
18949 </prototype>
18950 <headers>
18951 <header filename = "math.h"/>
18952 </headers>
18953 <synopsis>
18954 This function returns the absolute value of the floating-point number
18955 &lt;VAR&gt;number&lt;/VAR&gt;.
18956 </synopsis>
18957 </function>
18958 </construct>
18959 <construct id="function-fabsf" type="function">
18960 <function returntype="float">
18961 <prototype>
18962 <parameter content="float number"/>
18963 </prototype>
18964 <headers>
18965 <header filename = "math.h"/>
18966 </headers>
18967 <synopsis>
18968 This function returns the absolute value of the floating-point number
18969 &lt;VAR&gt;number&lt;/VAR&gt;.
18970 </synopsis>
18971 </function>
18972 </construct>
18973 <construct id="function-fabsl" type="function">
18974 <function returntype="long double">
18975 <prototype>
18976 <parameter content="long double number"/>
18977 </prototype>
18978 <headers>
18979 <header filename = "math.h"/>
18980 </headers>
18981 <synopsis>
18982 This function returns the absolute value of the floating-point number
18983 &lt;VAR&gt;number&lt;/VAR&gt;.
18984 </synopsis>
18985 </function>
18986 </construct>
18987 <construct id="function-cabs" type="function">
18988 <function returntype="double">
18989 <prototype>
18990 <parameter content="complex double z"/>
18991 </prototype>
18992 <headers>
18993 <header filename = "complex.h"/>
18994 </headers>
18995 <synopsis>
18996 These functions return the absolute value of the complex number &lt;VAR&gt;z&lt;/VAR&gt;
18997 . The absolute value of a complex number is:
18998 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
18999 sqrt (creal (&lt;VAR&gt;z&lt;/VAR&gt;) * creal (&lt;VAR&gt;z&lt;/VAR&gt;) + cimag (&lt;VAR&gt;z&lt;/VAR&gt;) * cimag (&lt;VAR&gt;z&lt;/VAR&gt;))&lt;br&gt;
19000 &lt;/pre&gt;
19001 &lt;br&gt;&lt;br&gt; This function should always be used instead of the direct formula
19002 because it takes special care to avoid losing precision. It may also
19003 take advantage of hardware support for this operation. See &lt;CODE&gt;hypot&lt;/CODE&gt;
19004 in Exponents and Logarithms.
19005 </synopsis>
19006 </function>
19007 </construct>
19008 <construct id="function-cabsf" type="function">
19009 <function returntype="float">
19010 <prototype>
19011 <parameter content="complex float z"/>
19012 </prototype>
19013 <headers>
19014 <header filename = "complex.h"/>
19015 </headers>
19016 <synopsis>
19017 These functions return the absolute value of the complex number &lt;VAR&gt;z&lt;/VAR&gt;
19018 . The absolute value of a complex number is:
19019 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
19020 sqrt (creal (&lt;VAR&gt;z&lt;/VAR&gt;) * creal (&lt;VAR&gt;z&lt;/VAR&gt;) + cimag (&lt;VAR&gt;z&lt;/VAR&gt;) * cimag (&lt;VAR&gt;z&lt;/VAR&gt;))&lt;br&gt;
19021 &lt;/pre&gt;
19022 &lt;br&gt;&lt;br&gt; This function should always be used instead of the direct formula
19023 because it takes special care to avoid losing precision. It may also
19024 take advantage of hardware support for this operation. See &lt;CODE&gt;hypot&lt;/CODE&gt;
19025 in Exponents and Logarithms.
19026 </synopsis>
19027 </function>
19028 </construct>
19029 <construct id="function-cabsl" type="function">
19030 <function returntype="long double">
19031 <prototype>
19032 <parameter content="complex long double z"/>
19033 </prototype>
19034 <headers>
19035 <header filename = "complex.h"/>
19036 </headers>
19037 <synopsis>
19038 These functions return the absolute value of the complex number &lt;VAR&gt;z&lt;/VAR&gt;
19039 . The absolute value of a complex number is:
19040 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
19041 sqrt (creal (&lt;VAR&gt;z&lt;/VAR&gt;) * creal (&lt;VAR&gt;z&lt;/VAR&gt;) + cimag (&lt;VAR&gt;z&lt;/VAR&gt;) * cimag (&lt;VAR&gt;z&lt;/VAR&gt;))&lt;br&gt;
19042 &lt;/pre&gt;
19043 &lt;br&gt;&lt;br&gt; This function should always be used instead of the direct formula
19044 because it takes special care to avoid losing precision. It may also
19045 take advantage of hardware support for this operation. See &lt;CODE&gt;hypot&lt;/CODE&gt;
19046 in Exponents and Logarithms.
19047 </synopsis>
19048 </function>
19049 </construct>
19050 <construct id="function-frexp" type="function">
19051 <function returntype="double">
19052 <prototype>
19053 <parameter content="double value"/>
19054 <parameter content="int *exponent"/>
19055 </prototype>
19056 <headers>
19057 <header filename = "math.h"/>
19058 </headers>
19059 <synopsis>
19060 These functions are used to split the number &lt;VAR&gt;value&lt;/VAR&gt;
19061 into a normalized fraction and an exponent.
19062 &lt;br&gt;&lt;br&gt; If the argument &lt;VAR&gt;value&lt;/VAR&gt; is not zero, the return value is &lt;VAR&gt;value&lt;/VAR&gt;
19063 times a power of two, and is always in the range 1/2 (inclusive) to 1
19064 (exclusive). The corresponding exponent is stored in
19065 &lt;CODE&gt;*&lt;VAR&gt;exponent&lt;/VAR&gt;&lt;/CODE&gt;; the return value multiplied by 2 raised to this
19066 exponent equals the original number &lt;VAR&gt;value&lt;/VAR&gt;.
19067 &lt;br&gt;&lt;br&gt; For example, &lt;CODE&gt;frexp (12.8, &amp;exponent)&lt;/CODE&gt; returns &lt;CODE&gt;0.8&lt;/CODE&gt; and
19068 stores &lt;CODE&gt;4&lt;/CODE&gt; in &lt;CODE&gt;exponent&lt;/CODE&gt;.
19069 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;value&lt;/VAR&gt; is zero, then the return value is zero and
19070 zero is stored in &lt;CODE&gt;*&lt;VAR&gt;exponent&lt;/VAR&gt;&lt;/CODE&gt;.
19071 </synopsis>
19072 </function>
19073 </construct>
19074 <construct id="function-frexpf" type="function">
19075 <function returntype="float">
19076 <prototype>
19077 <parameter content="float value"/>
19078 <parameter content="int *exponent"/>
19079 </prototype>
19080 <headers>
19081 <header filename = "math.h"/>
19082 </headers>
19083 <synopsis>
19084 These functions are used to split the number &lt;VAR&gt;value&lt;/VAR&gt;
19085 into a normalized fraction and an exponent.
19086 &lt;br&gt;&lt;br&gt; If the argument &lt;VAR&gt;value&lt;/VAR&gt; is not zero, the return value is &lt;VAR&gt;value&lt;/VAR&gt;
19087 times a power of two, and is always in the range 1/2 (inclusive) to 1
19088 (exclusive). The corresponding exponent is stored in
19089 &lt;CODE&gt;*&lt;VAR&gt;exponent&lt;/VAR&gt;&lt;/CODE&gt;; the return value multiplied by 2 raised to this
19090 exponent equals the original number &lt;VAR&gt;value&lt;/VAR&gt;.
19091 &lt;br&gt;&lt;br&gt; For example, &lt;CODE&gt;frexp (12.8, &amp;exponent)&lt;/CODE&gt; returns &lt;CODE&gt;0.8&lt;/CODE&gt; and
19092 stores &lt;CODE&gt;4&lt;/CODE&gt; in &lt;CODE&gt;exponent&lt;/CODE&gt;.
19093 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;value&lt;/VAR&gt; is zero, then the return value is zero and
19094 zero is stored in &lt;CODE&gt;*&lt;VAR&gt;exponent&lt;/VAR&gt;&lt;/CODE&gt;.
19095 </synopsis>
19096 </function>
19097 </construct>
19098 <construct id="function-frexpl" type="function">
19099 <function returntype="long double">
19100 <prototype>
19101 <parameter content="long double value"/>
19102 <parameter content="int *exponent"/>
19103 </prototype>
19104 <headers>
19105 <header filename = "math.h"/>
19106 </headers>
19107 <synopsis>
19108 These functions are used to split the number &lt;VAR&gt;value&lt;/VAR&gt;
19109 into a normalized fraction and an exponent.
19110 &lt;br&gt;&lt;br&gt; If the argument &lt;VAR&gt;value&lt;/VAR&gt; is not zero, the return value is &lt;VAR&gt;value&lt;/VAR&gt;
19111 times a power of two, and is always in the range 1/2 (inclusive) to 1
19112 (exclusive). The corresponding exponent is stored in
19113 &lt;CODE&gt;*&lt;VAR&gt;exponent&lt;/VAR&gt;&lt;/CODE&gt;; the return value multiplied by 2 raised to this
19114 exponent equals the original number &lt;VAR&gt;value&lt;/VAR&gt;.
19115 &lt;br&gt;&lt;br&gt; For example, &lt;CODE&gt;frexp (12.8, &amp;exponent)&lt;/CODE&gt; returns &lt;CODE&gt;0.8&lt;/CODE&gt; and
19116 stores &lt;CODE&gt;4&lt;/CODE&gt; in &lt;CODE&gt;exponent&lt;/CODE&gt;.
19117 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;value&lt;/VAR&gt; is zero, then the return value is zero and
19118 zero is stored in &lt;CODE&gt;*&lt;VAR&gt;exponent&lt;/VAR&gt;&lt;/CODE&gt;.
19119 </synopsis>
19120 </function>
19121 </construct>
19122 <construct id="function-ldexp" type="function">
19123 <function returntype="double">
19124 <prototype>
19125 <parameter content="double value"/>
19126 <parameter content="int exponent"/>
19127 </prototype>
19128 <headers>
19129 <header filename = "math.h"/>
19130 </headers>
19131 <synopsis>
19132 These functions return the result of multiplying the floating-point
19133 number &lt;VAR&gt;value&lt;/VAR&gt; by 2 raised to the power &lt;VAR&gt;exponent&lt;/VAR&gt;. (It can
19134 be used to reassemble floating-point numbers that were taken apart
19135 by &lt;CODE&gt;frexp&lt;/CODE&gt;.)
19136 &lt;br&gt;&lt;br&gt; For example, &lt;CODE&gt;ldexp (0.8, 4)&lt;/CODE&gt; returns &lt;CODE&gt;12.8&lt;/CODE&gt;.
19137 </synopsis>
19138 </function>
19139 </construct>
19140 <construct id="function-ldexpf" type="function">
19141 <function returntype="float">
19142 <prototype>
19143 <parameter content="float value"/>
19144 <parameter content="int exponent"/>
19145 </prototype>
19146 <headers>
19147 <header filename = "math.h"/>
19148 </headers>
19149 <synopsis>
19150 These functions return the result of multiplying the floating-point
19151 number &lt;VAR&gt;value&lt;/VAR&gt; by 2 raised to the power &lt;VAR&gt;exponent&lt;/VAR&gt;. (It can
19152 be used to reassemble floating-point numbers that were taken apart
19153 by &lt;CODE&gt;frexp&lt;/CODE&gt;.)
19154 &lt;br&gt;&lt;br&gt; For example, &lt;CODE&gt;ldexp (0.8, 4)&lt;/CODE&gt; returns &lt;CODE&gt;12.8&lt;/CODE&gt;.
19155 </synopsis>
19156 </function>
19157 </construct>
19158 <construct id="function-ldexpl" type="function">
19159 <function returntype="long double">
19160 <prototype>
19161 <parameter content="long double value"/>
19162 <parameter content="int exponent"/>
19163 </prototype>
19164 <headers>
19165 <header filename = "math.h"/>
19166 </headers>
19167 <synopsis>
19168 These functions return the result of multiplying the floating-point
19169 number &lt;VAR&gt;value&lt;/VAR&gt; by 2 raised to the power &lt;VAR&gt;exponent&lt;/VAR&gt;. (It can
19170 be used to reassemble floating-point numbers that were taken apart
19171 by &lt;CODE&gt;frexp&lt;/CODE&gt;.)
19172 &lt;br&gt;&lt;br&gt; For example, &lt;CODE&gt;ldexp (0.8, 4)&lt;/CODE&gt; returns &lt;CODE&gt;12.8&lt;/CODE&gt;.
19173 </synopsis>
19174 </function>
19175 </construct>
19176 <construct id="function-scalb" type="function">
19177 <function returntype="double">
19178 <prototype>
19179 <parameter content="double value"/>
19180 <parameter content="int exponent"/>
19181 </prototype>
19182 <headers>
19183 <header filename = "math.h"/>
19184 </headers>
19185 <synopsis>
19186 The &lt;CODE&gt;scalb&lt;/CODE&gt; function is the BSD name for &lt;CODE&gt;ldexp&lt;/CODE&gt;.
19187 </synopsis>
19188 </function>
19189 </construct>
19190 <construct id="function-scalbf" type="function">
19191 <function returntype="float">
19192 <prototype>
19193 <parameter content="float value"/>
19194 <parameter content="int exponent"/>
19195 </prototype>
19196 <headers>
19197 <header filename = "math.h"/>
19198 </headers>
19199 <synopsis>
19200 The &lt;CODE&gt;scalb&lt;/CODE&gt; function is the BSD name for &lt;CODE&gt;ldexp&lt;/CODE&gt;.
19201 </synopsis>
19202 </function>
19203 </construct>
19204 <construct id="function-scalbl" type="function">
19205 <function returntype="long double">
19206 <prototype>
19207 <parameter content="long double value"/>
19208 <parameter content="int exponent"/>
19209 </prototype>
19210 <headers>
19211 <header filename = "math.h"/>
19212 </headers>
19213 <synopsis>
19214 The &lt;CODE&gt;scalb&lt;/CODE&gt; function is the BSD name for &lt;CODE&gt;ldexp&lt;/CODE&gt;.
19215 </synopsis>
19216 </function>
19217 </construct>
19218 <construct id="function-scalbn" type="function">
19219 <function returntype="long long int">
19220 <prototype>
19221 <parameter content="double x"/>
19222 <parameter content="int n"/>
19223 </prototype>
19224 <headers>
19225 <header filename = "math.h"/>
19226 </headers>
19227 <synopsis>
19228 &lt;CODE&gt;scalbn&lt;/CODE&gt; is identical to &lt;CODE&gt;scalb&lt;/CODE&gt;, except that the exponent
19229 &lt;VAR&gt;n&lt;/VAR&gt; is an &lt;CODE&gt;int&lt;/CODE&gt; instead of a floating-point number.
19230 </synopsis>
19231 </function>
19232 </construct>
19233 <construct id="function-scalbnf" type="function">
19234 <function returntype="long long int">
19235 <prototype>
19236 <parameter content="float x"/>
19237 <parameter content="int n"/>
19238 </prototype>
19239 <headers>
19240 <header filename = "math.h"/>
19241 </headers>
19242 <synopsis>
19243 &lt;CODE&gt;scalbn&lt;/CODE&gt; is identical to &lt;CODE&gt;scalb&lt;/CODE&gt;, except that the exponent
19244 &lt;VAR&gt;n&lt;/VAR&gt; is an &lt;CODE&gt;int&lt;/CODE&gt; instead of a floating-point number.
19245 </synopsis>
19246 </function>
19247 </construct>
19248 <construct id="function-scalbnl" type="function">
19249 <function returntype="long long int">
19250 <prototype>
19251 <parameter content="long double x"/>
19252 <parameter content="int n"/>
19253 </prototype>
19254 <headers>
19255 <header filename = "math.h"/>
19256 </headers>
19257 <synopsis>
19258 &lt;CODE&gt;scalbn&lt;/CODE&gt; is identical to &lt;CODE&gt;scalb&lt;/CODE&gt;, except that the exponent
19259 &lt;VAR&gt;n&lt;/VAR&gt; is an &lt;CODE&gt;int&lt;/CODE&gt; instead of a floating-point number.
19260 </synopsis>
19261 </function>
19262 </construct>
19263 <construct id="function-scalbln" type="function">
19264 <function returntype="long long int">
19265 <prototype>
19266 <parameter content="double x"/>
19267 <parameter content="long int n"/>
19268 </prototype>
19269 <headers>
19270 <header filename = "math.h"/>
19271 </headers>
19272 <synopsis>
19273 &lt;CODE&gt;scalbln&lt;/CODE&gt; is identical to &lt;CODE&gt;scalb&lt;/CODE&gt;, except that the exponent
19274 &lt;VAR&gt;n&lt;/VAR&gt; is a &lt;CODE&gt;long int&lt;/CODE&gt; instead of a floating-point number.
19275 </synopsis>
19276 </function>
19277 </construct>
19278 <construct id="function-scalblnf" type="function">
19279 <function returntype="long long int">
19280 <prototype>
19281 <parameter content="float x"/>
19282 <parameter content="long int n"/>
19283 </prototype>
19284 <headers>
19285 <header filename = "math.h"/>
19286 </headers>
19287 <synopsis>
19288 &lt;CODE&gt;scalbln&lt;/CODE&gt; is identical to &lt;CODE&gt;scalb&lt;/CODE&gt;, except that the exponent
19289 &lt;VAR&gt;n&lt;/VAR&gt; is a &lt;CODE&gt;long int&lt;/CODE&gt; instead of a floating-point number.
19290 </synopsis>
19291 </function>
19292 </construct>
19293 <construct id="function-scalblnl" type="function">
19294 <function returntype="long long int">
19295 <prototype>
19296 <parameter content="long double x"/>
19297 <parameter content="long int n"/>
19298 </prototype>
19299 <headers>
19300 <header filename = "math.h"/>
19301 </headers>
19302 <synopsis>
19303 &lt;CODE&gt;scalbln&lt;/CODE&gt; is identical to &lt;CODE&gt;scalb&lt;/CODE&gt;, except that the exponent
19304 &lt;VAR&gt;n&lt;/VAR&gt; is a &lt;CODE&gt;long int&lt;/CODE&gt; instead of a floating-point number.
19305 </synopsis>
19306 </function>
19307 </construct>
19308 <construct id="function-significand" type="function">
19309 <function returntype="long long int">
19310 <prototype>
19311 <parameter content="double x"/>
19312 </prototype>
19313 <headers>
19314 <header filename = "math.h"/>
19315 </headers>
19316 <synopsis>
19317 &lt;CODE&gt;significand&lt;/CODE&gt; returns the mantissa of &lt;VAR&gt;x&lt;/VAR&gt; scaled to the range
19318 [1, 2).
19319 It is equivalent to &lt;CODE&gt;scalb (&lt;VAR&gt;x&lt;/VAR&gt;, (double) -ilogb (&lt;VAR&gt;x&lt;/VAR&gt;))&lt;/CODE&gt;.
19320 &lt;br&gt;&lt;br&gt; This function exists mainly for use in certain standardized tests
19321 of IEEE 754 conformance.
19322 </synopsis>
19323 </function>
19324 </construct>
19325 <construct id="function-significandf" type="function">
19326 <function returntype="long long int">
19327 <prototype>
19328 <parameter content="float x"/>
19329 </prototype>
19330 <headers>
19331 <header filename = "math.h"/>
19332 </headers>
19333 <synopsis>
19334 &lt;CODE&gt;significand&lt;/CODE&gt; returns the mantissa of &lt;VAR&gt;x&lt;/VAR&gt; scaled to the range
19335 [1, 2).
19336 It is equivalent to &lt;CODE&gt;scalb (&lt;VAR&gt;x&lt;/VAR&gt;, (double) -ilogb (&lt;VAR&gt;x&lt;/VAR&gt;))&lt;/CODE&gt;.
19337 &lt;br&gt;&lt;br&gt; This function exists mainly for use in certain standardized tests
19338 of IEEE 754 conformance.
19339 </synopsis>
19340 </function>
19341 </construct>
19342 <construct id="function-significandl" type="function">
19343 <function returntype="long long int">
19344 <prototype>
19345 <parameter content="long double x"/>
19346 </prototype>
19347 <headers>
19348 <header filename = "math.h"/>
19349 </headers>
19350 <synopsis>
19351 &lt;CODE&gt;significand&lt;/CODE&gt; returns the mantissa of &lt;VAR&gt;x&lt;/VAR&gt; scaled to the range
19352 [1, 2).
19353 It is equivalent to &lt;CODE&gt;scalb (&lt;VAR&gt;x&lt;/VAR&gt;, (double) -ilogb (&lt;VAR&gt;x&lt;/VAR&gt;))&lt;/CODE&gt;.
19354 &lt;br&gt;&lt;br&gt; This function exists mainly for use in certain standardized tests
19355 of IEEE 754 conformance.
19356 </synopsis>
19357 </function>
19358 </construct>
19359 <construct id="function-ceil" type="function">
19360 <function returntype="double">
19361 <prototype>
19362 <parameter content="double x"/>
19363 </prototype>
19364 <headers>
19365 <header filename = "math.h"/>
19366 </headers>
19367 <synopsis>
19368 These functions round &lt;VAR&gt;x&lt;/VAR&gt; upwards to the nearest integer,
19369 returning that value as a &lt;CODE&gt;double&lt;/CODE&gt;. Thus, &lt;CODE&gt;ceil (1.5)&lt;/CODE&gt;
19370 is &lt;CODE&gt;2.0&lt;/CODE&gt;.
19371 </synopsis>
19372 </function>
19373 </construct>
19374 <construct id="function-ceilf" type="function">
19375 <function returntype="float">
19376 <prototype>
19377 <parameter content="float x"/>
19378 </prototype>
19379 <headers>
19380 <header filename = "math.h"/>
19381 </headers>
19382 <synopsis>
19383 These functions round &lt;VAR&gt;x&lt;/VAR&gt; upwards to the nearest integer,
19384 returning that value as a &lt;CODE&gt;double&lt;/CODE&gt;. Thus, &lt;CODE&gt;ceil (1.5)&lt;/CODE&gt;
19385 is &lt;CODE&gt;2.0&lt;/CODE&gt;.
19386 </synopsis>
19387 </function>
19388 </construct>
19389 <construct id="function-ceill" type="function">
19390 <function returntype="long double">
19391 <prototype>
19392 <parameter content="long double x"/>
19393 </prototype>
19394 <headers>
19395 <header filename = "math.h"/>
19396 </headers>
19397 <synopsis>
19398 These functions round &lt;VAR&gt;x&lt;/VAR&gt; upwards to the nearest integer,
19399 returning that value as a &lt;CODE&gt;double&lt;/CODE&gt;. Thus, &lt;CODE&gt;ceil (1.5)&lt;/CODE&gt;
19400 is &lt;CODE&gt;2.0&lt;/CODE&gt;.
19401 </synopsis>
19402 </function>
19403 </construct>
19404 <construct id="function-floor" type="function">
19405 <function returntype="double">
19406 <prototype>
19407 <parameter content="double x"/>
19408 </prototype>
19409 <headers>
19410 <header filename = "math.h"/>
19411 </headers>
19412 <synopsis>
19413 These functions round &lt;VAR&gt;x&lt;/VAR&gt; downwards to the nearest
19414 integer, returning that value as a &lt;CODE&gt;double&lt;/CODE&gt;. Thus, &lt;CODE&gt;floor
19415 (1.5)&lt;/CODE&gt; is &lt;CODE&gt;1.0&lt;/CODE&gt; and &lt;CODE&gt;floor (-1.5)&lt;/CODE&gt; is &lt;CODE&gt;-2.0&lt;/CODE&gt;.
19416 </synopsis>
19417 </function>
19418 </construct>
19419 <construct id="function-floorf" type="function">
19420 <function returntype="float">
19421 <prototype>
19422 <parameter content="float x"/>
19423 </prototype>
19424 <headers>
19425 <header filename = "math.h"/>
19426 </headers>
19427 <synopsis>
19428 These functions round &lt;VAR&gt;x&lt;/VAR&gt; downwards to the nearest
19429 integer, returning that value as a &lt;CODE&gt;double&lt;/CODE&gt;. Thus, &lt;CODE&gt;floor
19430 (1.5)&lt;/CODE&gt; is &lt;CODE&gt;1.0&lt;/CODE&gt; and &lt;CODE&gt;floor (-1.5)&lt;/CODE&gt; is &lt;CODE&gt;-2.0&lt;/CODE&gt;.
19431 </synopsis>
19432 </function>
19433 </construct>
19434 <construct id="function-floorl" type="function">
19435 <function returntype="long double">
19436 <prototype>
19437 <parameter content="long double x"/>
19438 </prototype>
19439 <headers>
19440 <header filename = "math.h"/>
19441 </headers>
19442 <synopsis>
19443 These functions round &lt;VAR&gt;x&lt;/VAR&gt; downwards to the nearest
19444 integer, returning that value as a &lt;CODE&gt;double&lt;/CODE&gt;. Thus, &lt;CODE&gt;floor
19445 (1.5)&lt;/CODE&gt; is &lt;CODE&gt;1.0&lt;/CODE&gt; and &lt;CODE&gt;floor (-1.5)&lt;/CODE&gt; is &lt;CODE&gt;-2.0&lt;/CODE&gt;.
19446 </synopsis>
19447 </function>
19448 </construct>
19449 <construct id="function-trunc" type="function">
19450 <function returntype="double">
19451 <prototype>
19452 <parameter content="double x"/>
19453 </prototype>
19454 <headers>
19455 <header filename = "math.h"/>
19456 </headers>
19457 <synopsis>
19458 The &lt;CODE&gt;trunc&lt;/CODE&gt; functions round &lt;VAR&gt;x&lt;/VAR&gt; towards zero to the nearest
19459 integer (returned in floating-point format). Thus, &lt;CODE&gt;trunc (1.5)&lt;/CODE&gt;
19460 is &lt;CODE&gt;1.0&lt;/CODE&gt; and &lt;CODE&gt;trunc (-1.5)&lt;/CODE&gt; is &lt;CODE&gt;-1.0&lt;/CODE&gt;.
19461 </synopsis>
19462 </function>
19463 </construct>
19464 <construct id="function-truncf" type="function">
19465 <function returntype="float">
19466 <prototype>
19467 <parameter content="float x"/>
19468 </prototype>
19469 <headers>
19470 <header filename = "math.h"/>
19471 </headers>
19472 <synopsis>
19473 The &lt;CODE&gt;trunc&lt;/CODE&gt; functions round &lt;VAR&gt;x&lt;/VAR&gt; towards zero to the nearest
19474 integer (returned in floating-point format). Thus, &lt;CODE&gt;trunc (1.5)&lt;/CODE&gt;
19475 is &lt;CODE&gt;1.0&lt;/CODE&gt; and &lt;CODE&gt;trunc (-1.5)&lt;/CODE&gt; is &lt;CODE&gt;-1.0&lt;/CODE&gt;.
19476 </synopsis>
19477 </function>
19478 </construct>
19479 <construct id="function-truncl" type="function">
19480 <function returntype="long double">
19481 <prototype>
19482 <parameter content="long double x"/>
19483 </prototype>
19484 <headers>
19485 <header filename = "math.h"/>
19486 </headers>
19487 <synopsis>
19488 The &lt;CODE&gt;trunc&lt;/CODE&gt; functions round &lt;VAR&gt;x&lt;/VAR&gt; towards zero to the nearest
19489 integer (returned in floating-point format). Thus, &lt;CODE&gt;trunc (1.5)&lt;/CODE&gt;
19490 is &lt;CODE&gt;1.0&lt;/CODE&gt; and &lt;CODE&gt;trunc (-1.5)&lt;/CODE&gt; is &lt;CODE&gt;-1.0&lt;/CODE&gt;.
19491 </synopsis>
19492 </function>
19493 </construct>
19494 <construct id="function-rint" type="function">
19495 <function returntype="double">
19496 <prototype>
19497 <parameter content="double x"/>
19498 </prototype>
19499 <headers>
19500 <header filename = "math.h"/>
19501 </headers>
19502 <synopsis>
19503 These functions round &lt;VAR&gt;x&lt;/VAR&gt; to an integer value according to the
19504 current rounding mode. , for
19505 information about the various rounding modes. The default
19506 rounding mode is to round to the nearest integer; some machines
19507 support other modes, but round-to-nearest is always used unless
19508 you explicitly select another.
19509 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;x&lt;/VAR&gt; was not initially an integer, these functions raise the
19510 inexact exception.
19511 </synopsis>
19512 </function>
19513 </construct>
19514 <construct id="function-rintf" type="function">
19515 <function returntype="float">
19516 <prototype>
19517 <parameter content="float x"/>
19518 </prototype>
19519 <headers>
19520 <header filename = "math.h"/>
19521 </headers>
19522 <synopsis>
19523 These functions round &lt;VAR&gt;x&lt;/VAR&gt; to an integer value according to the
19524 current rounding mode. , for
19525 information about the various rounding modes. The default
19526 rounding mode is to round to the nearest integer; some machines
19527 support other modes, but round-to-nearest is always used unless
19528 you explicitly select another.
19529 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;x&lt;/VAR&gt; was not initially an integer, these functions raise the
19530 inexact exception.
19531 </synopsis>
19532 </function>
19533 </construct>
19534 <construct id="function-rintl" type="function">
19535 <function returntype="long double">
19536 <prototype>
19537 <parameter content="long double x"/>
19538 </prototype>
19539 <headers>
19540 <header filename = "math.h"/>
19541 </headers>
19542 <synopsis>
19543 These functions round &lt;VAR&gt;x&lt;/VAR&gt; to an integer value according to the
19544 current rounding mode. , for
19545 information about the various rounding modes. The default
19546 rounding mode is to round to the nearest integer; some machines
19547 support other modes, but round-to-nearest is always used unless
19548 you explicitly select another.
19549 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;x&lt;/VAR&gt; was not initially an integer, these functions raise the
19550 inexact exception.
19551 </synopsis>
19552 </function>
19553 </construct>
19554 <construct id="function-nearbyint" type="function">
19555 <function returntype="double">
19556 <prototype>
19557 <parameter content="double x"/>
19558 </prototype>
19559 <headers>
19560 <header filename = "math.h"/>
19561 </headers>
19562 <synopsis>
19563 These functions return the same value as the &lt;CODE&gt;rint&lt;/CODE&gt; functions, but
19564 do not raise the inexact exception if &lt;VAR&gt;x&lt;/VAR&gt; is not an integer.
19565 </synopsis>
19566 </function>
19567 </construct>
19568 <construct id="function-nearbyintf" type="function">
19569 <function returntype="float">
19570 <prototype>
19571 <parameter content="float x"/>
19572 </prototype>
19573 <headers>
19574 <header filename = "math.h"/>
19575 </headers>
19576 <synopsis>
19577 These functions return the same value as the &lt;CODE&gt;rint&lt;/CODE&gt; functions, but
19578 do not raise the inexact exception if &lt;VAR&gt;x&lt;/VAR&gt; is not an integer.
19579 </synopsis>
19580 </function>
19581 </construct>
19582 <construct id="function-nearbyintl" type="function">
19583 <function returntype="long double">
19584 <prototype>
19585 <parameter content="long double x"/>
19586 </prototype>
19587 <headers>
19588 <header filename = "math.h"/>
19589 </headers>
19590 <synopsis>
19591 These functions return the same value as the &lt;CODE&gt;rint&lt;/CODE&gt; functions, but
19592 do not raise the inexact exception if &lt;VAR&gt;x&lt;/VAR&gt; is not an integer.
19593 </synopsis>
19594 </function>
19595 </construct>
19596 <construct id="function-round" type="function">
19597 <function returntype="double">
19598 <prototype>
19599 <parameter content="double x"/>
19600 </prototype>
19601 <headers>
19602 <header filename = "math.h"/>
19603 </headers>
19604 <synopsis>
19605 These functions are similar to &lt;CODE&gt;rint&lt;/CODE&gt;, but they round halfway
19606 cases away from zero instead of to the nearest integer (or other
19607 current rounding mode).
19608 </synopsis>
19609 </function>
19610 </construct>
19611 <construct id="function-roundf" type="function">
19612 <function returntype="float">
19613 <prototype>
19614 <parameter content="float x"/>
19615 </prototype>
19616 <headers>
19617 <header filename = "math.h"/>
19618 </headers>
19619 <synopsis>
19620 These functions are similar to &lt;CODE&gt;rint&lt;/CODE&gt;, but they round halfway
19621 cases away from zero instead of to the nearest integer (or other
19622 current rounding mode).
19623 </synopsis>
19624 </function>
19625 </construct>
19626 <construct id="function-roundl" type="function">
19627 <function returntype="long double">
19628 <prototype>
19629 <parameter content="long double x"/>
19630 </prototype>
19631 <headers>
19632 <header filename = "math.h"/>
19633 </headers>
19634 <synopsis>
19635 These functions are similar to &lt;CODE&gt;rint&lt;/CODE&gt;, but they round halfway
19636 cases away from zero instead of to the nearest integer (or other
19637 current rounding mode).
19638 </synopsis>
19639 </function>
19640 </construct>
19641 <construct id="function-lrint" type="function">
19642 <function returntype="long int">
19643 <prototype>
19644 <parameter content="double x"/>
19645 </prototype>
19646 <headers>
19647 <header filename = "math.h"/>
19648 </headers>
19649 <synopsis>
19650 These functions are just like &lt;CODE&gt;rint&lt;/CODE&gt;, but they return a
19651 &lt;CODE&gt;long int&lt;/CODE&gt; instead of a floating-point number.
19652 </synopsis>
19653 </function>
19654 </construct>
19655 <construct id="function-lrintf" type="function">
19656 <function returntype="long int">
19657 <prototype>
19658 <parameter content="float x"/>
19659 </prototype>
19660 <headers>
19661 <header filename = "math.h"/>
19662 </headers>
19663 <synopsis>
19664 These functions are just like &lt;CODE&gt;rint&lt;/CODE&gt;, but they return a
19665 &lt;CODE&gt;long int&lt;/CODE&gt; instead of a floating-point number.
19666 </synopsis>
19667 </function>
19668 </construct>
19669 <construct id="function-lrintl" type="function">
19670 <function returntype="long int">
19671 <prototype>
19672 <parameter content="long double x"/>
19673 </prototype>
19674 <headers>
19675 <header filename = "math.h"/>
19676 </headers>
19677 <synopsis>
19678 These functions are just like &lt;CODE&gt;rint&lt;/CODE&gt;, but they return a
19679 &lt;CODE&gt;long int&lt;/CODE&gt; instead of a floating-point number.
19680 </synopsis>
19681 </function>
19682 </construct>
19683 <construct id="function-llrint" type="function">
19684 <function returntype="long long int">
19685 <prototype>
19686 <parameter content="double x"/>
19687 </prototype>
19688 <headers>
19689 <header filename = "math.h"/>
19690 </headers>
19691 <synopsis>
19692 These functions are just like &lt;CODE&gt;rint&lt;/CODE&gt;, but they return a
19693 &lt;CODE&gt;long long int&lt;/CODE&gt; instead of a floating-point number.
19694 </synopsis>
19695 </function>
19696 </construct>
19697 <construct id="function-llrintf" type="function">
19698 <function returntype="long long int">
19699 <prototype>
19700 <parameter content="float x"/>
19701 </prototype>
19702 <headers>
19703 <header filename = "math.h"/>
19704 </headers>
19705 <synopsis>
19706 These functions are just like &lt;CODE&gt;rint&lt;/CODE&gt;, but they return a
19707 &lt;CODE&gt;long long int&lt;/CODE&gt; instead of a floating-point number.
19708 </synopsis>
19709 </function>
19710 </construct>
19711 <construct id="function-llrintl" type="function">
19712 <function returntype="long long int">
19713 <prototype>
19714 <parameter content="long double x"/>
19715 </prototype>
19716 <headers>
19717 <header filename = "math.h"/>
19718 </headers>
19719 <synopsis>
19720 These functions are just like &lt;CODE&gt;rint&lt;/CODE&gt;, but they return a
19721 &lt;CODE&gt;long long int&lt;/CODE&gt; instead of a floating-point number.
19722 </synopsis>
19723 </function>
19724 </construct>
19725 <construct id="function-lround" type="function">
19726 <function returntype="long int">
19727 <prototype>
19728 <parameter content="double x"/>
19729 </prototype>
19730 <headers>
19731 <header filename = "math.h"/>
19732 </headers>
19733 <synopsis>
19734 These functions are just like &lt;CODE&gt;round&lt;/CODE&gt;, but they return a
19735 &lt;CODE&gt;long int&lt;/CODE&gt; instead of a floating-point number.
19736 </synopsis>
19737 </function>
19738 </construct>
19739 <construct id="function-lroundf" type="function">
19740 <function returntype="long int">
19741 <prototype>
19742 <parameter content="float x"/>
19743 </prototype>
19744 <headers>
19745 <header filename = "math.h"/>
19746 </headers>
19747 <synopsis>
19748 These functions are just like &lt;CODE&gt;round&lt;/CODE&gt;, but they return a
19749 &lt;CODE&gt;long int&lt;/CODE&gt; instead of a floating-point number.
19750 </synopsis>
19751 </function>
19752 </construct>
19753 <construct id="function-lroundl" type="function">
19754 <function returntype="long int">
19755 <prototype>
19756 <parameter content="long double x"/>
19757 </prototype>
19758 <headers>
19759 <header filename = "math.h"/>
19760 </headers>
19761 <synopsis>
19762 These functions are just like &lt;CODE&gt;round&lt;/CODE&gt;, but they return a
19763 &lt;CODE&gt;long int&lt;/CODE&gt; instead of a floating-point number.
19764 </synopsis>
19765 </function>
19766 </construct>
19767 <construct id="function-llround" type="function">
19768 <function returntype="long long int">
19769 <prototype>
19770 <parameter content="double x"/>
19771 </prototype>
19772 <headers>
19773 <header filename = "math.h"/>
19774 </headers>
19775 <synopsis>
19776 These functions are just like &lt;CODE&gt;round&lt;/CODE&gt;, but they return a
19777 &lt;CODE&gt;long long int&lt;/CODE&gt; instead of a floating-point number.
19778 </synopsis>
19779 </function>
19780 </construct>
19781 <construct id="function-llroundf" type="function">
19782 <function returntype="long long int">
19783 <prototype>
19784 <parameter content="float x"/>
19785 </prototype>
19786 <headers>
19787 <header filename = "math.h"/>
19788 </headers>
19789 <synopsis>
19790 These functions are just like &lt;CODE&gt;round&lt;/CODE&gt;, but they return a
19791 &lt;CODE&gt;long long int&lt;/CODE&gt; instead of a floating-point number.
19792 </synopsis>
19793 </function>
19794 </construct>
19795 <construct id="function-llroundl" type="function">
19796 <function returntype="long long int">
19797 <prototype>
19798 <parameter content="long double x"/>
19799 </prototype>
19800 <headers>
19801 <header filename = "math.h"/>
19802 </headers>
19803 <synopsis>
19804 These functions are just like &lt;CODE&gt;round&lt;/CODE&gt;, but they return a
19805 &lt;CODE&gt;long long int&lt;/CODE&gt; instead of a floating-point number.
19806 </synopsis>
19807 </function>
19808 </construct>
19809 <construct id="function-modf" type="function">
19810 <function returntype="double">
19811 <prototype>
19812 <parameter content="double value"/>
19813 <parameter content="double *integer-part"/>
19814 </prototype>
19815 <headers>
19816 <header filename = "math.h"/>
19817 </headers>
19818 <synopsis>
19819 These functions break the argument &lt;VAR&gt;value&lt;/VAR&gt; into an integer part and a
19820 fractional part (between &lt;CODE&gt;-1&lt;/CODE&gt; and &lt;CODE&gt;1&lt;/CODE&gt;, exclusive). Their sum
19821 equals &lt;VAR&gt;value&lt;/VAR&gt;. Each of the parts has the same sign as &lt;VAR&gt;value&lt;/VAR&gt;,
19822 and the integer part is always rounded toward zero.
19823 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;modf&lt;/CODE&gt; stores the integer part in &lt;CODE&gt;*&lt;VAR&gt;integer-part&lt;/VAR&gt;&lt;/CODE&gt;, and
19824 returns the fractional part. For example, &lt;CODE&gt;modf (2.5, &amp;intpart)&lt;/CODE&gt;
19825 returns &lt;CODE&gt;0.5&lt;/CODE&gt; and stores &lt;CODE&gt;2.0&lt;/CODE&gt; into &lt;CODE&gt;intpart&lt;/CODE&gt;.
19826 </synopsis>
19827 </function>
19828 </construct>
19829 <construct id="function-modff" type="function">
19830 <function returntype="float">
19831 <prototype>
19832 <parameter content="float value"/>
19833 <parameter content="float *integer-part"/>
19834 </prototype>
19835 <headers>
19836 <header filename = "math.h"/>
19837 </headers>
19838 <synopsis>
19839 These functions break the argument &lt;VAR&gt;value&lt;/VAR&gt; into an integer part and a
19840 fractional part (between &lt;CODE&gt;-1&lt;/CODE&gt; and &lt;CODE&gt;1&lt;/CODE&gt;, exclusive). Their sum
19841 equals &lt;VAR&gt;value&lt;/VAR&gt;. Each of the parts has the same sign as &lt;VAR&gt;value&lt;/VAR&gt;,
19842 and the integer part is always rounded toward zero.
19843 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;modf&lt;/CODE&gt; stores the integer part in &lt;CODE&gt;*&lt;VAR&gt;integer-part&lt;/VAR&gt;&lt;/CODE&gt;, and
19844 returns the fractional part. For example, &lt;CODE&gt;modf (2.5, &amp;intpart)&lt;/CODE&gt;
19845 returns &lt;CODE&gt;0.5&lt;/CODE&gt; and stores &lt;CODE&gt;2.0&lt;/CODE&gt; into &lt;CODE&gt;intpart&lt;/CODE&gt;.
19846 </synopsis>
19847 </function>
19848 </construct>
19849 <construct id="function-modfl" type="function">
19850 <function returntype="long double">
19851 <prototype>
19852 <parameter content="long double value"/>
19853 <parameter content="long double *integer-part"/>
19854 </prototype>
19855 <headers>
19856 <header filename = "math.h"/>
19857 </headers>
19858 <synopsis>
19859 These functions break the argument &lt;VAR&gt;value&lt;/VAR&gt; into an integer part and a
19860 fractional part (between &lt;CODE&gt;-1&lt;/CODE&gt; and &lt;CODE&gt;1&lt;/CODE&gt;, exclusive). Their sum
19861 equals &lt;VAR&gt;value&lt;/VAR&gt;. Each of the parts has the same sign as &lt;VAR&gt;value&lt;/VAR&gt;,
19862 and the integer part is always rounded toward zero.
19863 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;modf&lt;/CODE&gt; stores the integer part in &lt;CODE&gt;*&lt;VAR&gt;integer-part&lt;/VAR&gt;&lt;/CODE&gt;, and
19864 returns the fractional part. For example, &lt;CODE&gt;modf (2.5, &amp;intpart)&lt;/CODE&gt;
19865 returns &lt;CODE&gt;0.5&lt;/CODE&gt; and stores &lt;CODE&gt;2.0&lt;/CODE&gt; into &lt;CODE&gt;intpart&lt;/CODE&gt;.
19866 </synopsis>
19867 </function>
19868 </construct>
19869 <construct id="function-fmod" type="function">
19870 <function returntype="double">
19871 <prototype>
19872 <parameter content="double numerator"/>
19873 <parameter content="double denominator"/>
19874 </prototype>
19875 <headers>
19876 <header filename = "math.h"/>
19877 </headers>
19878 <synopsis>
19879 These functions compute the remainder from the division of
19880 &lt;VAR&gt;numerator&lt;/VAR&gt; by &lt;VAR&gt;denominator&lt;/VAR&gt;. Specifically, the return value is
19881 &lt;CODE&gt;&lt;VAR&gt;numerator&lt;/VAR&gt; - &lt;VAR&gt;n&lt;/VAR&gt; * &lt;VAR&gt;denominator&lt;/VAR&gt;&lt;/CODE&gt;, where &lt;VAR&gt;n&lt;/VAR&gt;
19882 is the quotient of &lt;VAR&gt;numerator&lt;/VAR&gt; divided by &lt;VAR&gt;denominator&lt;/VAR&gt;, rounded
19883 towards zero to an integer. Thus, &lt;CODE&gt;fmod (6.5, 2.3)&lt;/CODE&gt; returns
19884 &lt;CODE&gt;1.9&lt;/CODE&gt;, which is &lt;CODE&gt;6.5&lt;/CODE&gt; minus &lt;CODE&gt;4.6&lt;/CODE&gt;.
19885 &lt;br&gt;&lt;br&gt; The result has the same sign as the &lt;VAR&gt;numerator&lt;/VAR&gt; and has magnitude
19886 less than the magnitude of the &lt;VAR&gt;denominator&lt;/VAR&gt;.
19887 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;denominator&lt;/VAR&gt; is zero, &lt;CODE&gt;fmod&lt;/CODE&gt; signals a domain error.
19888 </synopsis>
19889 </function>
19890 </construct>
19891 <construct id="function-fmodf" type="function">
19892 <function returntype="float">
19893 <prototype>
19894 <parameter content="float numerator"/>
19895 <parameter content="float denominator"/>
19896 </prototype>
19897 <headers>
19898 <header filename = "math.h"/>
19899 </headers>
19900 <synopsis>
19901 These functions compute the remainder from the division of
19902 &lt;VAR&gt;numerator&lt;/VAR&gt; by &lt;VAR&gt;denominator&lt;/VAR&gt;. Specifically, the return value is
19903 &lt;CODE&gt;&lt;VAR&gt;numerator&lt;/VAR&gt; - &lt;VAR&gt;n&lt;/VAR&gt; * &lt;VAR&gt;denominator&lt;/VAR&gt;&lt;/CODE&gt;, where &lt;VAR&gt;n&lt;/VAR&gt;
19904 is the quotient of &lt;VAR&gt;numerator&lt;/VAR&gt; divided by &lt;VAR&gt;denominator&lt;/VAR&gt;, rounded
19905 towards zero to an integer. Thus, &lt;CODE&gt;fmod (6.5, 2.3)&lt;/CODE&gt; returns
19906 &lt;CODE&gt;1.9&lt;/CODE&gt;, which is &lt;CODE&gt;6.5&lt;/CODE&gt; minus &lt;CODE&gt;4.6&lt;/CODE&gt;.
19907 &lt;br&gt;&lt;br&gt; The result has the same sign as the &lt;VAR&gt;numerator&lt;/VAR&gt; and has magnitude
19908 less than the magnitude of the &lt;VAR&gt;denominator&lt;/VAR&gt;.
19909 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;denominator&lt;/VAR&gt; is zero, &lt;CODE&gt;fmod&lt;/CODE&gt; signals a domain error.
19910 </synopsis>
19911 </function>
19912 </construct>
19913 <construct id="function-fmodl" type="function">
19914 <function returntype="long double">
19915 <prototype>
19916 <parameter content="long double numerator"/>
19917 <parameter content="long double denominator"/>
19918 </prototype>
19919 <headers>
19920 <header filename = "math.h"/>
19921 </headers>
19922 <synopsis>
19923 These functions compute the remainder from the division of
19924 &lt;VAR&gt;numerator&lt;/VAR&gt; by &lt;VAR&gt;denominator&lt;/VAR&gt;. Specifically, the return value is
19925 &lt;CODE&gt;&lt;VAR&gt;numerator&lt;/VAR&gt; - &lt;VAR&gt;n&lt;/VAR&gt; * &lt;VAR&gt;denominator&lt;/VAR&gt;&lt;/CODE&gt;, where &lt;VAR&gt;n&lt;/VAR&gt;
19926 is the quotient of &lt;VAR&gt;numerator&lt;/VAR&gt; divided by &lt;VAR&gt;denominator&lt;/VAR&gt;, rounded
19927 towards zero to an integer. Thus, &lt;CODE&gt;fmod (6.5, 2.3)&lt;/CODE&gt; returns
19928 &lt;CODE&gt;1.9&lt;/CODE&gt;, which is &lt;CODE&gt;6.5&lt;/CODE&gt; minus &lt;CODE&gt;4.6&lt;/CODE&gt;.
19929 &lt;br&gt;&lt;br&gt; The result has the same sign as the &lt;VAR&gt;numerator&lt;/VAR&gt; and has magnitude
19930 less than the magnitude of the &lt;VAR&gt;denominator&lt;/VAR&gt;.
19931 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;denominator&lt;/VAR&gt; is zero, &lt;CODE&gt;fmod&lt;/CODE&gt; signals a domain error.
19932 </synopsis>
19933 </function>
19934 </construct>
19935 <construct id="function-drem" type="function">
19936 <function returntype="double">
19937 <prototype>
19938 <parameter content="double numerator"/>
19939 <parameter content="double denominator"/>
19940 </prototype>
19941 <headers>
19942 <header filename = "math.h"/>
19943 </headers>
19944 <synopsis>
19945 These functions are like &lt;CODE&gt;fmod&lt;/CODE&gt; except that they round the
19946 internal quotient &lt;VAR&gt;n&lt;/VAR&gt; to the nearest integer instead of towards zero
19947 to an integer. For example, &lt;CODE&gt;drem (6.5, 2.3)&lt;/CODE&gt; returns &lt;CODE&gt;-0.4&lt;/CODE&gt;,
19948 which is &lt;CODE&gt;6.5&lt;/CODE&gt; minus &lt;CODE&gt;6.9&lt;/CODE&gt;.
19949 &lt;br&gt;&lt;br&gt; The absolute value of the result is less than or equal to half the
19950 absolute value of the &lt;VAR&gt;denominator&lt;/VAR&gt;. The difference between
19951 &lt;CODE&gt;fmod (&lt;VAR&gt;numerator&lt;/VAR&gt;, &lt;VAR&gt;denominator&lt;/VAR&gt;)&lt;/CODE&gt; and &lt;CODE&gt;drem
19952 (&lt;VAR&gt;numerator&lt;/VAR&gt;, &lt;VAR&gt;denominator&lt;/VAR&gt;)&lt;/CODE&gt; is always either
19953 &lt;VAR&gt;denominator&lt;/VAR&gt;, minus &lt;VAR&gt;denominator&lt;/VAR&gt;, or zero.
19954 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;denominator&lt;/VAR&gt; is zero, &lt;CODE&gt;drem&lt;/CODE&gt; signals a domain error.
19955 </synopsis>
19956 </function>
19957 </construct>
19958 <construct id="function-dremf" type="function">
19959 <function returntype="float">
19960 <prototype>
19961 <parameter content="float numerator"/>
19962 <parameter content="float denominator"/>
19963 </prototype>
19964 <headers>
19965 <header filename = "math.h"/>
19966 </headers>
19967 <synopsis>
19968 These functions are like &lt;CODE&gt;fmod&lt;/CODE&gt; except that they round the
19969 internal quotient &lt;VAR&gt;n&lt;/VAR&gt; to the nearest integer instead of towards zero
19970 to an integer. For example, &lt;CODE&gt;drem (6.5, 2.3)&lt;/CODE&gt; returns &lt;CODE&gt;-0.4&lt;/CODE&gt;,
19971 which is &lt;CODE&gt;6.5&lt;/CODE&gt; minus &lt;CODE&gt;6.9&lt;/CODE&gt;.
19972 &lt;br&gt;&lt;br&gt; The absolute value of the result is less than or equal to half the
19973 absolute value of the &lt;VAR&gt;denominator&lt;/VAR&gt;. The difference between
19974 &lt;CODE&gt;fmod (&lt;VAR&gt;numerator&lt;/VAR&gt;, &lt;VAR&gt;denominator&lt;/VAR&gt;)&lt;/CODE&gt; and &lt;CODE&gt;drem
19975 (&lt;VAR&gt;numerator&lt;/VAR&gt;, &lt;VAR&gt;denominator&lt;/VAR&gt;)&lt;/CODE&gt; is always either
19976 &lt;VAR&gt;denominator&lt;/VAR&gt;, minus &lt;VAR&gt;denominator&lt;/VAR&gt;, or zero.
19977 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;denominator&lt;/VAR&gt; is zero, &lt;CODE&gt;drem&lt;/CODE&gt; signals a domain error.
19978 </synopsis>
19979 </function>
19980 </construct>
19981 <construct id="function-dreml" type="function">
19982 <function returntype="long double">
19983 <prototype>
19984 <parameter content="long double numerator"/>
19985 <parameter content="long double denominator"/>
19986 </prototype>
19987 <headers>
19988 <header filename = "math.h"/>
19989 </headers>
19990 <synopsis>
19991 These functions are like &lt;CODE&gt;fmod&lt;/CODE&gt; except that they round the
19992 internal quotient &lt;VAR&gt;n&lt;/VAR&gt; to the nearest integer instead of towards zero
19993 to an integer. For example, &lt;CODE&gt;drem (6.5, 2.3)&lt;/CODE&gt; returns &lt;CODE&gt;-0.4&lt;/CODE&gt;,
19994 which is &lt;CODE&gt;6.5&lt;/CODE&gt; minus &lt;CODE&gt;6.9&lt;/CODE&gt;.
19995 &lt;br&gt;&lt;br&gt; The absolute value of the result is less than or equal to half the
19996 absolute value of the &lt;VAR&gt;denominator&lt;/VAR&gt;. The difference between
19997 &lt;CODE&gt;fmod (&lt;VAR&gt;numerator&lt;/VAR&gt;, &lt;VAR&gt;denominator&lt;/VAR&gt;)&lt;/CODE&gt; and &lt;CODE&gt;drem
19998 (&lt;VAR&gt;numerator&lt;/VAR&gt;, &lt;VAR&gt;denominator&lt;/VAR&gt;)&lt;/CODE&gt; is always either
19999 &lt;VAR&gt;denominator&lt;/VAR&gt;, minus &lt;VAR&gt;denominator&lt;/VAR&gt;, or zero.
20000 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;denominator&lt;/VAR&gt; is zero, &lt;CODE&gt;drem&lt;/CODE&gt; signals a domain error.
20001 </synopsis>
20002 </function>
20003 </construct>
20004 <construct id="function-remainder" type="function">
20005 <function returntype="double">
20006 <prototype>
20007 <parameter content="double numerator"/>
20008 <parameter content="double denominator"/>
20009 </prototype>
20010 <headers>
20011 <header filename = "math.h"/>
20012 </headers>
20013 <synopsis>
20014 This function is another name for &lt;CODE&gt;drem&lt;/CODE&gt;.
20015 </synopsis>
20016 </function>
20017 </construct>
20018 <construct id="function-remainderf" type="function">
20019 <function returntype="float">
20020 <prototype>
20021 <parameter content="float numerator"/>
20022 <parameter content="float denominator"/>
20023 </prototype>
20024 <headers>
20025 <header filename = "math.h"/>
20026 </headers>
20027 <synopsis>
20028 This function is another name for &lt;CODE&gt;drem&lt;/CODE&gt;.
20029 </synopsis>
20030 </function>
20031 </construct>
20032 <construct id="function-remainderl" type="function">
20033 <function returntype="long double">
20034 <prototype>
20035 <parameter content="long double numerator"/>
20036 <parameter content="long double denominator"/>
20037 </prototype>
20038 <headers>
20039 <header filename = "math.h"/>
20040 </headers>
20041 <synopsis>
20042 This function is another name for &lt;CODE&gt;drem&lt;/CODE&gt;.
20043 </synopsis>
20044 </function>
20045 </construct>
20046 <construct id="function-copysign" type="function">
20047 <function returntype="double">
20048 <prototype>
20049 <parameter content="double x"/>
20050 <parameter content="double y"/>
20051 </prototype>
20052 <headers>
20053 <header filename = "math.h"/>
20054 </headers>
20055 <synopsis>
20056 These functions return &lt;VAR&gt;x&lt;/VAR&gt; but with the sign of &lt;VAR&gt;y&lt;/VAR&gt;. They work
20057 even if &lt;VAR&gt;x&lt;/VAR&gt; or &lt;VAR&gt;y&lt;/VAR&gt; are NaN or zero. Both of these can carry a
20058 sign (although not all implementations support it) and this is one of
20059 the few operations that can tell the difference.
20060 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;copysign&lt;/CODE&gt; never raises an exception.
20061 &lt;br&gt;&lt;br&gt; This function is defined in IEC 559 (and the appendix with
20062 recommended functions in IEEE 754/IEEE 854).
20063 </synopsis>
20064 </function>
20065 </construct>
20066 <construct id="function-copysignf" type="function">
20067 <function returntype="float">
20068 <prototype>
20069 <parameter content="float x"/>
20070 <parameter content="float y"/>
20071 </prototype>
20072 <headers>
20073 <header filename = "math.h"/>
20074 </headers>
20075 <synopsis>
20076 These functions return &lt;VAR&gt;x&lt;/VAR&gt; but with the sign of &lt;VAR&gt;y&lt;/VAR&gt;. They work
20077 even if &lt;VAR&gt;x&lt;/VAR&gt; or &lt;VAR&gt;y&lt;/VAR&gt; are NaN or zero. Both of these can carry a
20078 sign (although not all implementations support it) and this is one of
20079 the few operations that can tell the difference.
20080 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;copysign&lt;/CODE&gt; never raises an exception.
20081 &lt;br&gt;&lt;br&gt; This function is defined in IEC 559 (and the appendix with
20082 recommended functions in IEEE 754/IEEE 854).
20083 </synopsis>
20084 </function>
20085 </construct>
20086 <construct id="function-copysignl" type="function">
20087 <function returntype="long double">
20088 <prototype>
20089 <parameter content="long double x"/>
20090 <parameter content="long double y"/>
20091 </prototype>
20092 <headers>
20093 <header filename = "math.h"/>
20094 </headers>
20095 <synopsis>
20096 These functions return &lt;VAR&gt;x&lt;/VAR&gt; but with the sign of &lt;VAR&gt;y&lt;/VAR&gt;. They work
20097 even if &lt;VAR&gt;x&lt;/VAR&gt; or &lt;VAR&gt;y&lt;/VAR&gt; are NaN or zero. Both of these can carry a
20098 sign (although not all implementations support it) and this is one of
20099 the few operations that can tell the difference.
20100 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;copysign&lt;/CODE&gt; never raises an exception.
20101 &lt;br&gt;&lt;br&gt; This function is defined in IEC 559 (and the appendix with
20102 recommended functions in IEEE 754/IEEE 854).
20103 </synopsis>
20104 </function>
20105 </construct>
20106 <construct id="function-signbit" type="function">
20107 <function returntype="int">
20108 <prototype>
20109 <parameter content=" x"/>
20110 </prototype>
20111 <headers>
20112 <header filename = "math.h"/>
20113 </headers>
20114 <synopsis>
20115 &lt;CODE&gt;signbit&lt;/CODE&gt; is a generic macro which can work on all floating-point
20116 types. It returns a nonzero value if the value of &lt;VAR&gt;x&lt;/VAR&gt; has its sign
20117 bit set.
20118 &lt;br&gt;&lt;br&gt; This is not the same as &lt;CODE&gt;x &lt; 0.0&lt;/CODE&gt;, because IEEE 754 floating
20119 point allows zero to be signed. The comparison &lt;CODE&gt;-0.0 &lt; 0.0&lt;/CODE&gt; is
20120 false, but &lt;CODE&gt;signbit (-0.0)&lt;/CODE&gt; will return a nonzero value.
20121 </synopsis>
20122 </function>
20123 </construct>
20124 <construct id="function-nextafter" type="function">
20125 <function returntype="double">
20126 <prototype>
20127 <parameter content="double x"/>
20128 <parameter content="double y"/>
20129 </prototype>
20130 <headers>
20131 <header filename = "math.h"/>
20132 </headers>
20133 <synopsis>
20134 The &lt;CODE&gt;nextafter&lt;/CODE&gt; function returns the next representable neighbor of
20135 &lt;VAR&gt;x&lt;/VAR&gt; in the direction towards &lt;VAR&gt;y&lt;/VAR&gt;. The size of the step between
20136 &lt;VAR&gt;x&lt;/VAR&gt; and the result depends on the type of the result. If
20137 &lt;VAR&gt;x&lt;/VAR&gt; = &lt;VAR&gt;y&lt;/VAR&gt; the function simply returns &lt;VAR&gt;y&lt;/VAR&gt;. If either
20138 value is &lt;CODE&gt;NaN&lt;/CODE&gt;, &lt;CODE&gt;NaN&lt;/CODE&gt; is returned. Otherwise
20139 a value corresponding to the value of the least significant bit in the
20140 mantissa is added or subtracted, depending on the direction.
20141 &lt;CODE&gt;nextafter&lt;/CODE&gt; will signal overflow or underflow if the result goes
20142 outside of the range of normalized numbers.
20143 &lt;br&gt;&lt;br&gt; This function is defined in IEC 559 (and the appendix with
20144 recommended functions in IEEE 754/IEEE 854).
20145 </synopsis>
20146 </function>
20147 </construct>
20148 <construct id="function-nextafterf" type="function">
20149 <function returntype="float">
20150 <prototype>
20151 <parameter content="float x"/>
20152 <parameter content="float y"/>
20153 </prototype>
20154 <headers>
20155 <header filename = "math.h"/>
20156 </headers>
20157 <synopsis>
20158 The &lt;CODE&gt;nextafter&lt;/CODE&gt; function returns the next representable neighbor of
20159 &lt;VAR&gt;x&lt;/VAR&gt; in the direction towards &lt;VAR&gt;y&lt;/VAR&gt;. The size of the step between
20160 &lt;VAR&gt;x&lt;/VAR&gt; and the result depends on the type of the result. If
20161 &lt;VAR&gt;x&lt;/VAR&gt; = &lt;VAR&gt;y&lt;/VAR&gt; the function simply returns &lt;VAR&gt;y&lt;/VAR&gt;. If either
20162 value is &lt;CODE&gt;NaN&lt;/CODE&gt;, &lt;CODE&gt;NaN&lt;/CODE&gt; is returned. Otherwise
20163 a value corresponding to the value of the least significant bit in the
20164 mantissa is added or subtracted, depending on the direction.
20165 &lt;CODE&gt;nextafter&lt;/CODE&gt; will signal overflow or underflow if the result goes
20166 outside of the range of normalized numbers.
20167 &lt;br&gt;&lt;br&gt; This function is defined in IEC 559 (and the appendix with
20168 recommended functions in IEEE 754/IEEE 854).
20169 </synopsis>
20170 </function>
20171 </construct>
20172 <construct id="function-nextafterl" type="function">
20173 <function returntype="long double">
20174 <prototype>
20175 <parameter content="long double x"/>
20176 <parameter content="long double y"/>
20177 </prototype>
20178 <headers>
20179 <header filename = "math.h"/>
20180 </headers>
20181 <synopsis>
20182 The &lt;CODE&gt;nextafter&lt;/CODE&gt; function returns the next representable neighbor of
20183 &lt;VAR&gt;x&lt;/VAR&gt; in the direction towards &lt;VAR&gt;y&lt;/VAR&gt;. The size of the step between
20184 &lt;VAR&gt;x&lt;/VAR&gt; and the result depends on the type of the result. If
20185 &lt;VAR&gt;x&lt;/VAR&gt; = &lt;VAR&gt;y&lt;/VAR&gt; the function simply returns &lt;VAR&gt;y&lt;/VAR&gt;. If either
20186 value is &lt;CODE&gt;NaN&lt;/CODE&gt;, &lt;CODE&gt;NaN&lt;/CODE&gt; is returned. Otherwise
20187 a value corresponding to the value of the least significant bit in the
20188 mantissa is added or subtracted, depending on the direction.
20189 &lt;CODE&gt;nextafter&lt;/CODE&gt; will signal overflow or underflow if the result goes
20190 outside of the range of normalized numbers.
20191 &lt;br&gt;&lt;br&gt; This function is defined in IEC 559 (and the appendix with
20192 recommended functions in IEEE 754/IEEE 854).
20193 </synopsis>
20194 </function>
20195 </construct>
20196 <construct id="function-nexttoward" type="function">
20197 <function returntype="double">
20198 <prototype>
20199 <parameter content="double x"/>
20200 <parameter content="long double y"/>
20201 </prototype>
20202 <headers>
20203 <header filename = "math.h"/>
20204 </headers>
20205 <synopsis>
20206 These functions are identical to the corresponding versions of
20207 &lt;CODE&gt;nextafter&lt;/CODE&gt; except that their second argument is a &lt;CODE&gt;long
20208 double&lt;/CODE&gt;.
20209 </synopsis>
20210 </function>
20211 </construct>
20212 <construct id="function-nexttowardf" type="function">
20213 <function returntype="float">
20214 <prototype>
20215 <parameter content="float x"/>
20216 <parameter content="long double y"/>
20217 </prototype>
20218 <headers>
20219 <header filename = "math.h"/>
20220 </headers>
20221 <synopsis>
20222 These functions are identical to the corresponding versions of
20223 &lt;CODE&gt;nextafter&lt;/CODE&gt; except that their second argument is a &lt;CODE&gt;long
20224 double&lt;/CODE&gt;.
20225 </synopsis>
20226 </function>
20227 </construct>
20228 <construct id="function-nexttowardl" type="function">
20229 <function returntype="long double">
20230 <prototype>
20231 <parameter content="long double x"/>
20232 <parameter content="long double y"/>
20233 </prototype>
20234 <headers>
20235 <header filename = "math.h"/>
20236 </headers>
20237 <synopsis>
20238 These functions are identical to the corresponding versions of
20239 &lt;CODE&gt;nextafter&lt;/CODE&gt; except that their second argument is a &lt;CODE&gt;long
20240 double&lt;/CODE&gt;.
20241 </synopsis>
20242 </function>
20243 </construct>
20244 <construct id="function-nan" type="function">
20245 <function returntype="double">
20246 <prototype>
20247 <parameter content="const char *tagp"/>
20248 </prototype>
20249 <headers>
20250 <header filename = "math.h"/>
20251 </headers>
20252 <synopsis>
20253 The &lt;CODE&gt;nan&lt;/CODE&gt; function returns a representation of NaN, provided that
20254 NaN is supported by the target platform.
20255 &lt;CODE&gt;nan ("&lt;VAR&gt;n-char-sequence&lt;/VAR&gt;")&lt;/CODE&gt; is equivalent to
20256 &lt;CODE&gt;strtod ("NAN(&lt;VAR&gt;n-char-sequence&lt;/VAR&gt;)")&lt;/CODE&gt;.
20257 &lt;br&gt;&lt;br&gt; The argument &lt;VAR&gt;tagp&lt;/VAR&gt; is used in an unspecified manner. On IEEE
20258 754 systems, there are many representations of NaN, and &lt;VAR&gt;tagp&lt;/VAR&gt;
20259 selects one. On other systems it may do nothing.
20260 </synopsis>
20261 </function>
20262 </construct>
20263 <construct id="function-nanf" type="function">
20264 <function returntype="float">
20265 <prototype>
20266 <parameter content="const char *tagp"/>
20267 </prototype>
20268 <headers>
20269 <header filename = "math.h"/>
20270 </headers>
20271 <synopsis>
20272 The &lt;CODE&gt;nan&lt;/CODE&gt; function returns a representation of NaN, provided that
20273 NaN is supported by the target platform.
20274 &lt;CODE&gt;nan ("&lt;VAR&gt;n-char-sequence&lt;/VAR&gt;")&lt;/CODE&gt; is equivalent to
20275 &lt;CODE&gt;strtod ("NAN(&lt;VAR&gt;n-char-sequence&lt;/VAR&gt;)")&lt;/CODE&gt;.
20276 &lt;br&gt;&lt;br&gt; The argument &lt;VAR&gt;tagp&lt;/VAR&gt; is used in an unspecified manner. On IEEE
20277 754 systems, there are many representations of NaN, and &lt;VAR&gt;tagp&lt;/VAR&gt;
20278 selects one. On other systems it may do nothing.
20279 </synopsis>
20280 </function>
20281 </construct>
20282 <construct id="function-nanl" type="function">
20283 <function returntype="long double">
20284 <prototype>
20285 <parameter content="const char *tagp"/>
20286 </prototype>
20287 <headers>
20288 <header filename = "math.h"/>
20289 </headers>
20290 <synopsis>
20291 The &lt;CODE&gt;nan&lt;/CODE&gt; function returns a representation of NaN, provided that
20292 NaN is supported by the target platform.
20293 &lt;CODE&gt;nan ("&lt;VAR&gt;n-char-sequence&lt;/VAR&gt;")&lt;/CODE&gt; is equivalent to
20294 &lt;CODE&gt;strtod ("NAN(&lt;VAR&gt;n-char-sequence&lt;/VAR&gt;)")&lt;/CODE&gt;.
20295 &lt;br&gt;&lt;br&gt; The argument &lt;VAR&gt;tagp&lt;/VAR&gt; is used in an unspecified manner. On IEEE
20296 754 systems, there are many representations of NaN, and &lt;VAR&gt;tagp&lt;/VAR&gt;
20297 selects one. On other systems it may do nothing.
20298 </synopsis>
20299 </function>
20300 </construct>
20301 <construct id="function-fmin" type="function">
20302 <function returntype="double">
20303 <prototype>
20304 <parameter content="double x"/>
20305 <parameter content="double y"/>
20306 </prototype>
20307 <headers>
20308 <header filename = "math.h"/>
20309 </headers>
20310 <synopsis>
20311 The &lt;CODE&gt;fmin&lt;/CODE&gt; function returns the lesser of the two values &lt;VAR&gt;x&lt;/VAR&gt;
20312 and &lt;VAR&gt;y&lt;/VAR&gt;. It is similar to the expression
20313 &lt;pre&gt;&lt;br&gt;
20314 ((x) &lt; (y) ? (x) : (y))&lt;br&gt;
20315 &lt;/pre&gt;
20316 except that &lt;VAR&gt;x&lt;/VAR&gt; and &lt;VAR&gt;y&lt;/VAR&gt; are only evaluated once.
20317 &lt;br&gt;&lt;br&gt; If an argument is NaN, the other argument is returned. If both arguments
20318 are NaN, NaN is returned.
20319 </synopsis>
20320 </function>
20321 </construct>
20322 <construct id="function-fminf" type="function">
20323 <function returntype="float">
20324 <prototype>
20325 <parameter content="float x"/>
20326 <parameter content="float y"/>
20327 </prototype>
20328 <headers>
20329 <header filename = "math.h"/>
20330 </headers>
20331 <synopsis>
20332 The &lt;CODE&gt;fmin&lt;/CODE&gt; function returns the lesser of the two values &lt;VAR&gt;x&lt;/VAR&gt;
20333 and &lt;VAR&gt;y&lt;/VAR&gt;. It is similar to the expression
20334 &lt;pre&gt;&lt;br&gt;
20335 ((x) &lt; (y) ? (x) : (y))&lt;br&gt;
20336 &lt;/pre&gt;
20337 except that &lt;VAR&gt;x&lt;/VAR&gt; and &lt;VAR&gt;y&lt;/VAR&gt; are only evaluated once.
20338 &lt;br&gt;&lt;br&gt; If an argument is NaN, the other argument is returned. If both arguments
20339 are NaN, NaN is returned.
20340 </synopsis>
20341 </function>
20342 </construct>
20343 <construct id="function-fminl" type="function">
20344 <function returntype="long double">
20345 <prototype>
20346 <parameter content="long double x"/>
20347 <parameter content="long double y"/>
20348 </prototype>
20349 <headers>
20350 <header filename = "math.h"/>
20351 </headers>
20352 <synopsis>
20353 The &lt;CODE&gt;fmin&lt;/CODE&gt; function returns the lesser of the two values &lt;VAR&gt;x&lt;/VAR&gt;
20354 and &lt;VAR&gt;y&lt;/VAR&gt;. It is similar to the expression
20355 &lt;pre&gt;&lt;br&gt;
20356 ((x) &lt; (y) ? (x) : (y))&lt;br&gt;
20357 &lt;/pre&gt;
20358 except that &lt;VAR&gt;x&lt;/VAR&gt; and &lt;VAR&gt;y&lt;/VAR&gt; are only evaluated once.
20359 &lt;br&gt;&lt;br&gt; If an argument is NaN, the other argument is returned. If both arguments
20360 are NaN, NaN is returned.
20361 </synopsis>
20362 </function>
20363 </construct>
20364 <construct id="function-fmax" type="function">
20365 <function returntype="double">
20366 <prototype>
20367 <parameter content="double x"/>
20368 <parameter content="double y"/>
20369 </prototype>
20370 <headers>
20371 <header filename = "math.h"/>
20372 </headers>
20373 <synopsis>
20374 The &lt;CODE&gt;fmax&lt;/CODE&gt; function returns the greater of the two values &lt;VAR&gt;x&lt;/VAR&gt;
20375 and &lt;VAR&gt;y&lt;/VAR&gt;.
20376 &lt;br&gt;&lt;br&gt; If an argument is NaN, the other argument is returned. If both arguments
20377 are NaN, NaN is returned.
20378 </synopsis>
20379 </function>
20380 </construct>
20381 <construct id="function-fmaxf" type="function">
20382 <function returntype="float">
20383 <prototype>
20384 <parameter content="float x"/>
20385 <parameter content="float y"/>
20386 </prototype>
20387 <headers>
20388 <header filename = "math.h"/>
20389 </headers>
20390 <synopsis>
20391 The &lt;CODE&gt;fmax&lt;/CODE&gt; function returns the greater of the two values &lt;VAR&gt;x&lt;/VAR&gt;
20392 and &lt;VAR&gt;y&lt;/VAR&gt;.
20393 &lt;br&gt;&lt;br&gt; If an argument is NaN, the other argument is returned. If both arguments
20394 are NaN, NaN is returned.
20395 </synopsis>
20396 </function>
20397 </construct>
20398 <construct id="function-fmaxl" type="function">
20399 <function returntype="long double">
20400 <prototype>
20401 <parameter content="long double x"/>
20402 <parameter content="long double y"/>
20403 </prototype>
20404 <headers>
20405 <header filename = "math.h"/>
20406 </headers>
20407 <synopsis>
20408 The &lt;CODE&gt;fmax&lt;/CODE&gt; function returns the greater of the two values &lt;VAR&gt;x&lt;/VAR&gt;
20409 and &lt;VAR&gt;y&lt;/VAR&gt;.
20410 &lt;br&gt;&lt;br&gt; If an argument is NaN, the other argument is returned. If both arguments
20411 are NaN, NaN is returned.
20412 </synopsis>
20413 </function>
20414 </construct>
20415 <construct id="function-fdim" type="function">
20416 <function returntype="double">
20417 <prototype>
20418 <parameter content="double x"/>
20419 <parameter content="double y"/>
20420 </prototype>
20421 <headers>
20422 <header filename = "math.h"/>
20423 </headers>
20424 <synopsis>
20425 The &lt;CODE&gt;fdim&lt;/CODE&gt; function returns the positive difference between
20426 &lt;VAR&gt;x&lt;/VAR&gt; and &lt;VAR&gt;y&lt;/VAR&gt;. The positive difference is &lt;VAR&gt;x&lt;/VAR&gt; -
20427 &lt;VAR&gt;y&lt;/VAR&gt; if &lt;VAR&gt;x&lt;/VAR&gt; is greater than &lt;VAR&gt;y&lt;/VAR&gt;, and 0 otherwise.
20428 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;x&lt;/VAR&gt;, &lt;VAR&gt;y&lt;/VAR&gt;, or both are NaN, NaN is returned.
20429 </synopsis>
20430 </function>
20431 </construct>
20432 <construct id="function-fdimf" type="function">
20433 <function returntype="float">
20434 <prototype>
20435 <parameter content="float x"/>
20436 <parameter content="float y"/>
20437 </prototype>
20438 <headers>
20439 <header filename = "math.h"/>
20440 </headers>
20441 <synopsis>
20442 The &lt;CODE&gt;fdim&lt;/CODE&gt; function returns the positive difference between
20443 &lt;VAR&gt;x&lt;/VAR&gt; and &lt;VAR&gt;y&lt;/VAR&gt;. The positive difference is &lt;VAR&gt;x&lt;/VAR&gt; -
20444 &lt;VAR&gt;y&lt;/VAR&gt; if &lt;VAR&gt;x&lt;/VAR&gt; is greater than &lt;VAR&gt;y&lt;/VAR&gt;, and 0 otherwise.
20445 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;x&lt;/VAR&gt;, &lt;VAR&gt;y&lt;/VAR&gt;, or both are NaN, NaN is returned.
20446 </synopsis>
20447 </function>
20448 </construct>
20449 <construct id="function-fdiml" type="function">
20450 <function returntype="long double">
20451 <prototype>
20452 <parameter content="long double x"/>
20453 <parameter content="long double y"/>
20454 </prototype>
20455 <headers>
20456 <header filename = "math.h"/>
20457 </headers>
20458 <synopsis>
20459 The &lt;CODE&gt;fdim&lt;/CODE&gt; function returns the positive difference between
20460 &lt;VAR&gt;x&lt;/VAR&gt; and &lt;VAR&gt;y&lt;/VAR&gt;. The positive difference is &lt;VAR&gt;x&lt;/VAR&gt; -
20461 &lt;VAR&gt;y&lt;/VAR&gt; if &lt;VAR&gt;x&lt;/VAR&gt; is greater than &lt;VAR&gt;y&lt;/VAR&gt;, and 0 otherwise.
20462 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;x&lt;/VAR&gt;, &lt;VAR&gt;y&lt;/VAR&gt;, or both are NaN, NaN is returned.
20463 </synopsis>
20464 </function>
20465 </construct>
20466 <construct id="function-fma" type="function">
20467 <function returntype="double">
20468 <prototype>
20469 <parameter content="double x"/>
20470 <parameter content="double y"/>
20471 <parameter content="double z"/>
20472 </prototype>
20473 <headers>
20474 <header filename = "math.h"/>
20475 </headers>
20476 <synopsis>
20477
20478 The &lt;CODE&gt;fma&lt;/CODE&gt; function performs floating-point multiply-add. This is
20479 the operation (&lt;VAR&gt;x&lt;/VAR&gt; &lt;VAR&gt;y&lt;/VAR&gt;) + &lt;VAR&gt;z&lt;/VAR&gt;, but the
20480 intermediate result is not rounded to the destination type. This can
20481 sometimes improve the precision of a calculation.
20482 &lt;br&gt;&lt;br&gt; This function was introduced because some processors have a special
20483 instruction to perform multiply-add. The C compiler cannot use it
20484 directly, because the expression &lt;samp&gt;x*y + z&lt;/samp&gt; is defined to round the
20485 intermediate result. &lt;CODE&gt;fma&lt;/CODE&gt; lets you choose when you want to round
20486 only once.
20487 &lt;br&gt;&lt;br&gt;
20488 On processors which do not implement multiply-add in hardware,
20489 &lt;CODE&gt;fma&lt;/CODE&gt; can be very slow since it must avoid intermediate rounding.
20490 &lt;TT&gt;math.h&lt;/TT&gt; defines the symbols &lt;CODE&gt;FP_FAST_FMA&lt;/CODE&gt;,
20491 &lt;CODE&gt;FP_FAST_FMAF&lt;/CODE&gt;, and &lt;CODE&gt;FP_FAST_FMAL&lt;/CODE&gt; when the corresponding
20492 version of &lt;CODE&gt;fma&lt;/CODE&gt; is no slower than the expression &lt;samp&gt;x*y + z&lt;/samp&gt;.
20493 In the GNU C library, this always means the operation is implemented in
20494 hardware.
20495 </synopsis>
20496 </function>
20497 </construct>
20498 <construct id="function-fmaf" type="function">
20499 <function returntype="float">
20500 <prototype>
20501 <parameter content="float x"/>
20502 <parameter content="float y"/>
20503 <parameter content="float z"/>
20504 </prototype>
20505 <headers>
20506 <header filename = "math.h"/>
20507 </headers>
20508 <synopsis>
20509
20510 The &lt;CODE&gt;fma&lt;/CODE&gt; function performs floating-point multiply-add. This is
20511 the operation (&lt;VAR&gt;x&lt;/VAR&gt; &lt;VAR&gt;y&lt;/VAR&gt;) + &lt;VAR&gt;z&lt;/VAR&gt;, but the
20512 intermediate result is not rounded to the destination type. This can
20513 sometimes improve the precision of a calculation.
20514 &lt;br&gt;&lt;br&gt; This function was introduced because some processors have a special
20515 instruction to perform multiply-add. The C compiler cannot use it
20516 directly, because the expression &lt;samp&gt;x*y + z&lt;/samp&gt; is defined to round the
20517 intermediate result. &lt;CODE&gt;fma&lt;/CODE&gt; lets you choose when you want to round
20518 only once.
20519 &lt;br&gt;&lt;br&gt;
20520 On processors which do not implement multiply-add in hardware,
20521 &lt;CODE&gt;fma&lt;/CODE&gt; can be very slow since it must avoid intermediate rounding.
20522 &lt;TT&gt;math.h&lt;/TT&gt; defines the symbols &lt;CODE&gt;FP_FAST_FMA&lt;/CODE&gt;,
20523 &lt;CODE&gt;FP_FAST_FMAF&lt;/CODE&gt;, and &lt;CODE&gt;FP_FAST_FMAL&lt;/CODE&gt; when the corresponding
20524 version of &lt;CODE&gt;fma&lt;/CODE&gt; is no slower than the expression &lt;samp&gt;x*y + z&lt;/samp&gt;.
20525 In the GNU C library, this always means the operation is implemented in
20526 hardware.
20527 </synopsis>
20528 </function>
20529 </construct>
20530 <construct id="function-fmal" type="function">
20531 <function returntype="long double">
20532 <prototype>
20533 <parameter content="long double x"/>
20534 <parameter content="long double y"/>
20535 <parameter content="long double z"/>
20536 </prototype>
20537 <headers>
20538 <header filename = "math.h"/>
20539 </headers>
20540 <synopsis>
20541
20542 The &lt;CODE&gt;fma&lt;/CODE&gt; function performs floating-point multiply-add. This is
20543 the operation (&lt;VAR&gt;x&lt;/VAR&gt; &lt;VAR&gt;y&lt;/VAR&gt;) + &lt;VAR&gt;z&lt;/VAR&gt;, but the
20544 intermediate result is not rounded to the destination type. This can
20545 sometimes improve the precision of a calculation.
20546 &lt;br&gt;&lt;br&gt; This function was introduced because some processors have a special
20547 instruction to perform multiply-add. The C compiler cannot use it
20548 directly, because the expression &lt;samp&gt;x*y + z&lt;/samp&gt; is defined to round the
20549 intermediate result. &lt;CODE&gt;fma&lt;/CODE&gt; lets you choose when you want to round
20550 only once.
20551 &lt;br&gt;&lt;br&gt;
20552 On processors which do not implement multiply-add in hardware,
20553 &lt;CODE&gt;fma&lt;/CODE&gt; can be very slow since it must avoid intermediate rounding.
20554 &lt;TT&gt;math.h&lt;/TT&gt; defines the symbols &lt;CODE&gt;FP_FAST_FMA&lt;/CODE&gt;,
20555 &lt;CODE&gt;FP_FAST_FMAF&lt;/CODE&gt;, and &lt;CODE&gt;FP_FAST_FMAL&lt;/CODE&gt; when the corresponding
20556 version of &lt;CODE&gt;fma&lt;/CODE&gt; is no slower than the expression &lt;samp&gt;x*y + z&lt;/samp&gt;.
20557 In the GNU C library, this always means the operation is implemented in
20558 hardware.
20559 </synopsis>
20560 </function>
20561 </construct>
20562 <construct id="function-creal" type="function">
20563 <function returntype="double">
20564 <prototype>
20565 <parameter content="complex double z"/>
20566 </prototype>
20567 <headers>
20568 <header filename = "complex.h"/>
20569 </headers>
20570 <synopsis>
20571 These functions return the real part of the complex number &lt;VAR&gt;z&lt;/VAR&gt;.
20572 </synopsis>
20573 </function>
20574 </construct>
20575 <construct id="function-crealf" type="function">
20576 <function returntype="float">
20577 <prototype>
20578 <parameter content="complex float z"/>
20579 </prototype>
20580 <headers>
20581 <header filename = "complex.h"/>
20582 </headers>
20583 <synopsis>
20584 These functions return the real part of the complex number &lt;VAR&gt;z&lt;/VAR&gt;.
20585 </synopsis>
20586 </function>
20587 </construct>
20588 <construct id="function-creall" type="function">
20589 <function returntype="long double">
20590 <prototype>
20591 <parameter content="complex long double z"/>
20592 </prototype>
20593 <headers>
20594 <header filename = "complex.h"/>
20595 </headers>
20596 <synopsis>
20597 These functions return the real part of the complex number &lt;VAR&gt;z&lt;/VAR&gt;.
20598 </synopsis>
20599 </function>
20600 </construct>
20601 <construct id="function-cimag" type="function">
20602 <function returntype="double">
20603 <prototype>
20604 <parameter content="complex double z"/>
20605 </prototype>
20606 <headers>
20607 <header filename = "complex.h"/>
20608 </headers>
20609 <synopsis>
20610 These functions return the imaginary part of the complex number &lt;VAR&gt;z&lt;/VAR&gt;.
20611 </synopsis>
20612 </function>
20613 </construct>
20614 <construct id="function-cimagf" type="function">
20615 <function returntype="float">
20616 <prototype>
20617 <parameter content="complex float z"/>
20618 </prototype>
20619 <headers>
20620 <header filename = "complex.h"/>
20621 </headers>
20622 <synopsis>
20623 These functions return the imaginary part of the complex number &lt;VAR&gt;z&lt;/VAR&gt;.
20624 </synopsis>
20625 </function>
20626 </construct>
20627 <construct id="function-cimagl" type="function">
20628 <function returntype="long double">
20629 <prototype>
20630 <parameter content="complex long double z"/>
20631 </prototype>
20632 <headers>
20633 <header filename = "complex.h"/>
20634 </headers>
20635 <synopsis>
20636 These functions return the imaginary part of the complex number &lt;VAR&gt;z&lt;/VAR&gt;.
20637 </synopsis>
20638 </function>
20639 </construct>
20640 <construct id="function-conj" type="function">
20641 <function returntype="complex double">
20642 <prototype>
20643 <parameter content="complex double z"/>
20644 </prototype>
20645 <headers>
20646 <header filename = "complex.h"/>
20647 </headers>
20648 <synopsis>
20649 These functions return the conjugate value of the complex number
20650 &lt;VAR&gt;z&lt;/VAR&gt;. The conjugate of a complex number has the same real part and a
20651 negated imaginary part. In other words, &lt;samp&gt;conj(a + bi) = a + -bi&lt;/samp&gt;.
20652 </synopsis>
20653 </function>
20654 </construct>
20655 <construct id="function-conjf" type="function">
20656 <function returntype="complex float">
20657 <prototype>
20658 <parameter content="complex float z"/>
20659 </prototype>
20660 <headers>
20661 <header filename = "complex.h"/>
20662 </headers>
20663 <synopsis>
20664 These functions return the conjugate value of the complex number
20665 &lt;VAR&gt;z&lt;/VAR&gt;. The conjugate of a complex number has the same real part and a
20666 negated imaginary part. In other words, &lt;samp&gt;conj(a + bi) = a + -bi&lt;/samp&gt;.
20667 </synopsis>
20668 </function>
20669 </construct>
20670 <construct id="function-conjl" type="function">
20671 <function returntype="complex long double">
20672 <prototype>
20673 <parameter content="complex long double z"/>
20674 </prototype>
20675 <headers>
20676 <header filename = "complex.h"/>
20677 </headers>
20678 <synopsis>
20679 These functions return the conjugate value of the complex number
20680 &lt;VAR&gt;z&lt;/VAR&gt;. The conjugate of a complex number has the same real part and a
20681 negated imaginary part. In other words, &lt;samp&gt;conj(a + bi) = a + -bi&lt;/samp&gt;.
20682 </synopsis>
20683 </function>
20684 </construct>
20685 <construct id="function-carg" type="function">
20686 <function returntype="double">
20687 <prototype>
20688 <parameter content="complex double z"/>
20689 </prototype>
20690 <headers>
20691 <header filename = "complex.h"/>
20692 </headers>
20693 <synopsis>
20694 These functions return the argument of the complex number &lt;VAR&gt;z&lt;/VAR&gt;.
20695 The argument of a complex number is the angle in the complex plane
20696 between the positive real axis and a line passing through zero and the
20697 number. This angle is measured in the usual fashion and ranges from 0
20698 to 2.
20699 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;carg&lt;/CODE&gt; has a branch cut along the positive real axis.
20700 </synopsis>
20701 </function>
20702 </construct>
20703 <construct id="function-cargf" type="function">
20704 <function returntype="float">
20705 <prototype>
20706 <parameter content="complex float z"/>
20707 </prototype>
20708 <headers>
20709 <header filename = "complex.h"/>
20710 </headers>
20711 <synopsis>
20712 These functions return the argument of the complex number &lt;VAR&gt;z&lt;/VAR&gt;.
20713 The argument of a complex number is the angle in the complex plane
20714 between the positive real axis and a line passing through zero and the
20715 number. This angle is measured in the usual fashion and ranges from 0
20716 to 2.
20717 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;carg&lt;/CODE&gt; has a branch cut along the positive real axis.
20718 </synopsis>
20719 </function>
20720 </construct>
20721 <construct id="function-cargl" type="function">
20722 <function returntype="long double">
20723 <prototype>
20724 <parameter content="complex long double z"/>
20725 </prototype>
20726 <headers>
20727 <header filename = "complex.h"/>
20728 </headers>
20729 <synopsis>
20730 These functions return the argument of the complex number &lt;VAR&gt;z&lt;/VAR&gt;.
20731 The argument of a complex number is the angle in the complex plane
20732 between the positive real axis and a line passing through zero and the
20733 number. This angle is measured in the usual fashion and ranges from 0
20734 to 2.
20735 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;carg&lt;/CODE&gt; has a branch cut along the positive real axis.
20736 </synopsis>
20737 </function>
20738 </construct>
20739 <construct id="function-cproj" type="function">
20740 <function returntype="complex double">
20741 <prototype>
20742 <parameter content="complex double z"/>
20743 </prototype>
20744 <headers>
20745 <header filename = "complex.h"/>
20746 </headers>
20747 <synopsis>
20748 These functions return the projection of the complex value &lt;VAR&gt;z&lt;/VAR&gt; onto
20749 the Riemann sphere. Values with a infinite imaginary part are projected
20750 to positive infinity on the real axis, even if the real part is NaN. If
20751 the real part is infinite, the result is equivalent to
20752 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
20753 INFINITY + I * copysign (0.0, cimag (z))&lt;br&gt;
20754 &lt;/pre&gt;
20755 </synopsis>
20756 </function>
20757 </construct>
20758 <construct id="function-cprojf" type="function">
20759 <function returntype="complex float">
20760 <prototype>
20761 <parameter content="complex float z"/>
20762 </prototype>
20763 <headers>
20764 <header filename = "complex.h"/>
20765 </headers>
20766 <synopsis>
20767 These functions return the projection of the complex value &lt;VAR&gt;z&lt;/VAR&gt; onto
20768 the Riemann sphere. Values with a infinite imaginary part are projected
20769 to positive infinity on the real axis, even if the real part is NaN. If
20770 the real part is infinite, the result is equivalent to
20771 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
20772 INFINITY + I * copysign (0.0, cimag (z))&lt;br&gt;
20773 &lt;/pre&gt;
20774 </synopsis>
20775 </function>
20776 </construct>
20777 <construct id="function-cprojl" type="function">
20778 <function returntype="complex long double">
20779 <prototype>
20780 <parameter content="complex long double z"/>
20781 </prototype>
20782 <headers>
20783 <header filename = "complex.h"/>
20784 </headers>
20785 <synopsis>
20786 These functions return the projection of the complex value &lt;VAR&gt;z&lt;/VAR&gt; onto
20787 the Riemann sphere. Values with a infinite imaginary part are projected
20788 to positive infinity on the real axis, even if the real part is NaN. If
20789 the real part is infinite, the result is equivalent to
20790 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
20791 INFINITY + I * copysign (0.0, cimag (z))&lt;br&gt;
20792 &lt;/pre&gt;
20793 </synopsis>
20794 </function>
20795 </construct>
20796 <construct id="function-strtol" type="function">
20797 <function returntype="long int">
20798 <prototype>
20799 <parameter content="const char *restrict string"/>
20800 <parameter content="char **restrict tailptr"/>
20801 <parameter content="int base"/>
20802 </prototype>
20803 <headers>
20804 <header filename = "stdlib.h"/>
20805 </headers>
20806 <synopsis>
20807 The &lt;CODE&gt;strtol&lt;/CODE&gt; (``string-to-long'') function converts the initial
20808 part of &lt;VAR&gt;string&lt;/VAR&gt; to a signed integer, which is returned as a value
20809 of type &lt;CODE&gt;long int&lt;/CODE&gt;.
20810 &lt;br&gt;&lt;br&gt; This function attempts to decompose &lt;VAR&gt;string&lt;/VAR&gt; as follows:
20811 &lt;br&gt;&lt;br&gt; &lt;OL&gt;
20812 &lt;LI&gt;
20813 A (possibly empty) sequence of whitespace characters. Which characters
20814 are whitespace is determined by the &lt;CODE&gt;isspace&lt;/CODE&gt; function
20815 . These are discarded.
20816 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
20817 An optional plus or minus sign (&lt;samp&gt;+&lt;/samp&gt; or &lt;samp&gt;-&lt;/samp&gt;).
20818 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
20819 A nonempty sequence of digits in the radix specified by &lt;VAR&gt;base&lt;/VAR&gt;.
20820 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;base&lt;/VAR&gt; is zero, decimal radix is assumed unless the series of
20821 digits begins with &lt;samp&gt;0&lt;/samp&gt; (specifying octal radix), or &lt;samp&gt;0x&lt;/samp&gt; or
20822 &lt;samp&gt;0X&lt;/samp&gt; (specifying hexadecimal radix); in other words, the same
20823 syntax used for integer constants in C.
20824 &lt;br&gt;&lt;br&gt; Otherwise &lt;VAR&gt;base&lt;/VAR&gt; must have a value between &lt;CODE&gt;2&lt;/CODE&gt; and &lt;CODE&gt;36&lt;/CODE&gt;.
20825 If &lt;VAR&gt;base&lt;/VAR&gt; is &lt;CODE&gt;16&lt;/CODE&gt;, the digits may optionally be preceded by
20826 &lt;samp&gt;0x&lt;/samp&gt; or &lt;samp&gt;0X&lt;/samp&gt;. If base has no legal value the value returned
20827 is &lt;CODE&gt;0l&lt;/CODE&gt; and the global variable &lt;CODE&gt;errno&lt;/CODE&gt; is set to &lt;CODE&gt;EINVAL&lt;/CODE&gt;.
20828 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
20829 Any remaining characters in the string. If &lt;VAR&gt;tailptr&lt;/VAR&gt; is not a null
20830 pointer, &lt;CODE&gt;strtol&lt;/CODE&gt; stores a pointer to this tail in
20831 &lt;CODE&gt;*&lt;VAR&gt;tailptr&lt;/VAR&gt;&lt;/CODE&gt;.
20832 &lt;/OL&gt;
20833 &lt;br&gt;&lt;br&gt; If the string is empty, contains only whitespace, or does not contain an
20834 initial substring that has the expected syntax for an integer in the
20835 specified &lt;VAR&gt;base&lt;/VAR&gt;, no conversion is performed. In this case,
20836 &lt;CODE&gt;strtol&lt;/CODE&gt; returns a value of zero and the value stored in
20837 &lt;CODE&gt;*&lt;VAR&gt;tailptr&lt;/VAR&gt;&lt;/CODE&gt; is the value of &lt;VAR&gt;string&lt;/VAR&gt;.
20838 &lt;br&gt;&lt;br&gt; In a locale other than the standard &lt;CODE&gt;"C"&lt;/CODE&gt; locale, this function
20839 may recognize additional implementation-dependent syntax.
20840 &lt;br&gt;&lt;br&gt; If the string has valid syntax for an integer but the value is not
20841 representable because of overflow, &lt;CODE&gt;strtol&lt;/CODE&gt; returns either
20842 &lt;CODE&gt;LONG_MAX&lt;/CODE&gt; or &lt;CODE&gt;LONG_MIN&lt;/CODE&gt; , as
20843 appropriate for the sign of the value. It also sets &lt;CODE&gt;errno&lt;/CODE&gt;
20844 to &lt;CODE&gt;ERANGE&lt;/CODE&gt; to indicate there was overflow.
20845 &lt;br&gt;&lt;br&gt; You should not check for errors by examining the return value of
20846 &lt;CODE&gt;strtol&lt;/CODE&gt;, because the string might be a valid representation of
20847 &lt;CODE&gt;0l&lt;/CODE&gt;, &lt;CODE&gt;LONG_MAX&lt;/CODE&gt;, or &lt;CODE&gt;LONG_MIN&lt;/CODE&gt;. Instead, check whether
20848 &lt;VAR&gt;tailptr&lt;/VAR&gt; points to what you expect after the number
20849 (e.g. &lt;CODE&gt;'\0'&lt;/CODE&gt; if the string should end after the number). You also
20850 need to clear &lt;VAR&gt;errno&lt;/VAR&gt; before the call and check it afterward, in
20851 case there was overflow.
20852 &lt;br&gt;&lt;br&gt; There is an example at the end of this section.
20853 </synopsis>
20854 </function>
20855 </construct>
20856 <construct id="function-wcstol" type="function">
20857 <function returntype="long int">
20858 <prototype>
20859 <parameter content="const wchar_t *restrict string"/>
20860 <parameter content="wchar_t **restrict tailptr"/>
20861 <parameter content="int base"/>
20862 </prototype>
20863 <headers>
20864 <header filename = "wchar.h"/>
20865 </headers>
20866 <synopsis>
20867 The &lt;CODE&gt;wcstol&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;strtol&lt;/CODE&gt; function
20868 in nearly all aspects but handles wide character strings.
20869 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;wcstol&lt;/CODE&gt; function was introduced in Amendment 1 of ISO C90.
20870 </synopsis>
20871 </function>
20872 </construct>
20873 <construct id="function-strtoul" type="function">
20874 <function returntype="unsigned long int">
20875 <prototype>
20876 <parameter content="const char *retrict string"/>
20877 <parameter content="char **restrict tailptr"/>
20878 <parameter content="int base"/>
20879 </prototype>
20880 <headers>
20881 <header filename = "stdlib.h"/>
20882 </headers>
20883 <synopsis>
20884 The &lt;CODE&gt;strtoul&lt;/CODE&gt; (``string-to-unsigned-long'') function is like
20885 &lt;CODE&gt;strtol&lt;/CODE&gt; except it converts to an &lt;CODE&gt;unsigned long int&lt;/CODE&gt; value.
20886 The syntax is the same as described above for &lt;CODE&gt;strtol&lt;/CODE&gt;. The value
20887 returned on overflow is &lt;CODE&gt;ULONG_MAX&lt;/CODE&gt; .
20888 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;string&lt;/VAR&gt; depicts a negative number, &lt;CODE&gt;strtoul&lt;/CODE&gt; acts the same
20889 as &lt;VAR&gt;strtol&lt;/VAR&gt; but casts the result to an unsigned integer. That means
20890 for example that &lt;CODE&gt;strtoul&lt;/CODE&gt; on &lt;CODE&gt;"-1"&lt;/CODE&gt; returns &lt;CODE&gt;ULONG_MAX&lt;/CODE&gt;
20891 and an input more negative than &lt;CODE&gt;LONG_MIN&lt;/CODE&gt; returns
20892 (&lt;CODE&gt;ULONG_MAX&lt;/CODE&gt; + 1) / 2.
20893 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;strtoul&lt;/CODE&gt; sets &lt;VAR&gt;errno&lt;/VAR&gt; to &lt;CODE&gt;EINVAL&lt;/CODE&gt; if &lt;VAR&gt;base&lt;/VAR&gt; is out of
20894 range, or &lt;CODE&gt;ERANGE&lt;/CODE&gt; on overflow.
20895 </synopsis>
20896 </function>
20897 </construct>
20898 <construct id="function-wcstoul" type="function">
20899 <function returntype="unsigned long int">
20900 <prototype>
20901 <parameter content="const wchar_t *restrict string"/>
20902 <parameter content="wchar_t **restrict tailptr"/>
20903 <parameter content="int base"/>
20904 </prototype>
20905 <headers>
20906 <header filename = "wchar.h"/>
20907 </headers>
20908 <synopsis>
20909 The &lt;CODE&gt;wcstoul&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;strtoul&lt;/CODE&gt; function
20910 in nearly all aspects but handles wide character strings.
20911 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;wcstoul&lt;/CODE&gt; function was introduced in Amendment 1 of ISO C90.
20912 </synopsis>
20913 </function>
20914 </construct>
20915 <construct id="function-strtoll" type="function">
20916 <function returntype="long long int">
20917 <prototype>
20918 <parameter content="const char *restrict string"/>
20919 <parameter content="char **restrict tailptr"/>
20920 <parameter content="int base"/>
20921 </prototype>
20922 <headers>
20923 <header filename = "stdlib.h"/>
20924 </headers>
20925 <synopsis>
20926 The &lt;CODE&gt;strtoll&lt;/CODE&gt; function is like &lt;CODE&gt;strtol&lt;/CODE&gt; except that it returns
20927 a &lt;CODE&gt;long long int&lt;/CODE&gt; value, and accepts numbers with a correspondingly
20928 larger range.
20929 &lt;br&gt;&lt;br&gt; If the string has valid syntax for an integer but the value is not
20930 representable because of overflow, &lt;CODE&gt;strtoll&lt;/CODE&gt; returns either
20931 &lt;CODE&gt;LONG_LONG_MAX&lt;/CODE&gt; or &lt;CODE&gt;LONG_LONG_MIN&lt;/CODE&gt; , as
20932 appropriate for the sign of the value. It also sets &lt;CODE&gt;errno&lt;/CODE&gt; to
20933 &lt;CODE&gt;ERANGE&lt;/CODE&gt; to indicate there was overflow.
20934 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;strtoll&lt;/CODE&gt; function was introduced in ISO C99.
20935 </synopsis>
20936 </function>
20937 </construct>
20938 <construct id="function-wcstoll" type="function">
20939 <function returntype="long long int">
20940 <prototype>
20941 <parameter content="const wchar_t *restrict string"/>
20942 <parameter content="wchar_t **restrict tailptr"/>
20943 <parameter content="int base"/>
20944 </prototype>
20945 <headers>
20946 <header filename = "wchar.h"/>
20947 </headers>
20948 <synopsis>
20949 The &lt;CODE&gt;wcstoll&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;strtoll&lt;/CODE&gt; function
20950 in nearly all aspects but handles wide character strings.
20951 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;wcstoll&lt;/CODE&gt; function was introduced in Amendment 1 of ISO C90.
20952 </synopsis>
20953 </function>
20954 </construct>
20955 <construct id="function-strtoq" type="function">
20956 <function returntype="long long int">
20957 <prototype>
20958 <parameter content="const char *restrict string"/>
20959 <parameter content="char **restrict tailptr"/>
20960 <parameter content="int base"/>
20961 </prototype>
20962 <headers>
20963 <header filename = "stdlib.h"/>
20964 </headers>
20965 <synopsis>
20966 &lt;CODE&gt;strtoq&lt;/CODE&gt; (``string-to-quad-word'') is the BSD name for &lt;CODE&gt;strtoll&lt;/CODE&gt;.
20967 </synopsis>
20968 </function>
20969 </construct>
20970 <construct id="function-wcstoq" type="function">
20971 <function returntype="long long int">
20972 <prototype>
20973 <parameter content="const wchar_t *restrict string"/>
20974 <parameter content="wchar_t **restrict tailptr"/>
20975 <parameter content="int base"/>
20976 </prototype>
20977 <headers>
20978 <header filename = "wchar.h"/>
20979 </headers>
20980 <synopsis>
20981 The &lt;CODE&gt;wcstoq&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;strtoq&lt;/CODE&gt; function
20982 in nearly all aspects but handles wide character strings.
20983 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;wcstoq&lt;/CODE&gt; function is a GNU extension.
20984 </synopsis>
20985 </function>
20986 </construct>
20987 <construct id="function-strtoull" type="function">
20988 <function returntype="unsigned long long int">
20989 <prototype>
20990 <parameter content="const char *restrict string"/>
20991 <parameter content="char **restrict tailptr"/>
20992 <parameter content="int base"/>
20993 </prototype>
20994 <headers>
20995 <header filename = "stdlib.h"/>
20996 </headers>
20997 <synopsis>
20998 The &lt;CODE&gt;strtoull&lt;/CODE&gt; function is related to &lt;CODE&gt;strtoll&lt;/CODE&gt; the same way
20999 &lt;CODE&gt;strtoul&lt;/CODE&gt; is related to &lt;CODE&gt;strtol&lt;/CODE&gt;.
21000 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;strtoull&lt;/CODE&gt; function was introduced in ISO C99.
21001 </synopsis>
21002 </function>
21003 </construct>
21004 <construct id="function-wcstoull" type="function">
21005 <function returntype="unsigned long long int">
21006 <prototype>
21007 <parameter content="const wchar_t *restrict string"/>
21008 <parameter content="wchar_t **restrict tailptr"/>
21009 <parameter content="int base"/>
21010 </prototype>
21011 <headers>
21012 <header filename = "wchar.h"/>
21013 </headers>
21014 <synopsis>
21015 The &lt;CODE&gt;wcstoull&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;strtoull&lt;/CODE&gt; function
21016 in nearly all aspects but handles wide character strings.
21017 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;wcstoull&lt;/CODE&gt; function was introduced in Amendment 1 of ISO C90.
21018 </synopsis>
21019 </function>
21020 </construct>
21021 <construct id="function-strtouq" type="function">
21022 <function returntype="unsigned long long int">
21023 <prototype>
21024 <parameter content="const char *restrict string"/>
21025 <parameter content="char **restrict tailptr"/>
21026 <parameter content="int base"/>
21027 </prototype>
21028 <headers>
21029 <header filename = "stdlib.h"/>
21030 </headers>
21031 <synopsis>
21032 &lt;CODE&gt;strtouq&lt;/CODE&gt; is the BSD name for &lt;CODE&gt;strtoull&lt;/CODE&gt;.
21033 </synopsis>
21034 </function>
21035 </construct>
21036 <construct id="function-wcstouq" type="function">
21037 <function returntype="unsigned long long int">
21038 <prototype>
21039 <parameter content="const wchar_t *restrict string"/>
21040 <parameter content="wchar_t **restrict tailptr"/>
21041 <parameter content="int base"/>
21042 </prototype>
21043 <headers>
21044 <header filename = "wchar.h"/>
21045 </headers>
21046 <synopsis>
21047 The &lt;CODE&gt;wcstouq&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;strtouq&lt;/CODE&gt; function
21048 in nearly all aspects but handles wide character strings.
21049 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;wcstouq&lt;/CODE&gt; function is a GNU extension.
21050 </synopsis>
21051 </function>
21052 </construct>
21053 <construct id="function-strtoimax" type="function">
21054 <function returntype="intmax_t">
21055 <prototype>
21056 <parameter content="const char *restrict string"/>
21057 <parameter content="char **restrict tailptr"/>
21058 <parameter content="int base"/>
21059 </prototype>
21060 <headers>
21061 <header filename = "inttypes.h"/>
21062 </headers>
21063 <synopsis>
21064 The &lt;CODE&gt;strtoimax&lt;/CODE&gt; function is like &lt;CODE&gt;strtol&lt;/CODE&gt; except that it returns
21065 a &lt;CODE&gt;intmax_t&lt;/CODE&gt; value, and accepts numbers of a corresponding range.
21066 &lt;br&gt;&lt;br&gt; If the string has valid syntax for an integer but the value is not
21067 representable because of overflow, &lt;CODE&gt;strtoimax&lt;/CODE&gt; returns either
21068 &lt;CODE&gt;INTMAX_MAX&lt;/CODE&gt; or &lt;CODE&gt;INTMAX_MIN&lt;/CODE&gt; , as
21069 appropriate for the sign of the value. It also sets &lt;CODE&gt;errno&lt;/CODE&gt; to
21070 &lt;CODE&gt;ERANGE&lt;/CODE&gt; to indicate there was overflow.
21071 &lt;br&gt;&lt;br&gt; See Integers for a description of the &lt;CODE&gt;intmax_t&lt;/CODE&gt; type. The
21072 &lt;CODE&gt;strtoimax&lt;/CODE&gt; function was introduced in ISO C99.
21073 </synopsis>
21074 </function>
21075 </construct>
21076 <construct id="function-wcstoimax" type="function">
21077 <function returntype="intmax_t">
21078 <prototype>
21079 <parameter content="const wchar_t *restrict string"/>
21080 <parameter content="wchar_t **restrict tailptr"/>
21081 <parameter content="int base"/>
21082 </prototype>
21083 <headers>
21084 <header filename = "wchar.h"/>
21085 </headers>
21086 <synopsis>
21087 The &lt;CODE&gt;wcstoimax&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;strtoimax&lt;/CODE&gt; function
21088 in nearly all aspects but handles wide character strings.
21089 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;wcstoimax&lt;/CODE&gt; function was introduced in ISO C99.
21090 </synopsis>
21091 </function>
21092 </construct>
21093 <construct id="function-strtoumax" type="function">
21094 <function returntype="uintmax_t">
21095 <prototype>
21096 <parameter content="const char *restrict string"/>
21097 <parameter content="char **restrict tailptr"/>
21098 <parameter content="int base"/>
21099 </prototype>
21100 <headers>
21101 <header filename = "inttypes.h"/>
21102 </headers>
21103 <synopsis>
21104 The &lt;CODE&gt;strtoumax&lt;/CODE&gt; function is related to &lt;CODE&gt;strtoimax&lt;/CODE&gt;
21105 the same way that &lt;CODE&gt;strtoul&lt;/CODE&gt; is related to &lt;CODE&gt;strtol&lt;/CODE&gt;.
21106 &lt;br&gt;&lt;br&gt; See Integers for a description of the &lt;CODE&gt;intmax_t&lt;/CODE&gt; type. The
21107 &lt;CODE&gt;strtoumax&lt;/CODE&gt; function was introduced in ISO C99.
21108 </synopsis>
21109 </function>
21110 </construct>
21111 <construct id="function-wcstoumax" type="function">
21112 <function returntype="uintmax_t">
21113 <prototype>
21114 <parameter content="const wchar_t *restrict string"/>
21115 <parameter content="wchar_t **restrict tailptr"/>
21116 <parameter content="int base"/>
21117 </prototype>
21118 <headers>
21119 <header filename = "wchar.h"/>
21120 </headers>
21121 <synopsis>
21122 The &lt;CODE&gt;wcstoumax&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;strtoumax&lt;/CODE&gt; function
21123 in nearly all aspects but handles wide character strings.
21124 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;wcstoumax&lt;/CODE&gt; function was introduced in ISO C99.
21125 </synopsis>
21126 </function>
21127 </construct>
21128 <construct id="function-atol" type="function">
21129 <function returntype="long int">
21130 <prototype>
21131 <parameter content="const char *string"/>
21132 </prototype>
21133 <headers>
21134 <header filename = "stdlib.h"/>
21135 </headers>
21136 <synopsis>
21137 This function is similar to the &lt;CODE&gt;strtol&lt;/CODE&gt; function with a &lt;VAR&gt;base&lt;/VAR&gt;
21138 argument of &lt;CODE&gt;10&lt;/CODE&gt;, except that it need not detect overflow errors.
21139 The &lt;CODE&gt;atol&lt;/CODE&gt; function is provided mostly for compatibility with
21140 existing code; using &lt;CODE&gt;strtol&lt;/CODE&gt; is more robust.
21141 </synopsis>
21142 </function>
21143 </construct>
21144 <construct id="function-atoi" type="function">
21145 <function returntype="int">
21146 <prototype>
21147 <parameter content="const char *string"/>
21148 </prototype>
21149 <headers>
21150 <header filename = "stdlib.h"/>
21151 </headers>
21152 <synopsis>
21153 This function is like &lt;CODE&gt;atol&lt;/CODE&gt;, except that it returns an &lt;CODE&gt;int&lt;/CODE&gt;.
21154 The &lt;CODE&gt;atoi&lt;/CODE&gt; function is also considered obsolete; use &lt;CODE&gt;strtol&lt;/CODE&gt;
21155 instead.
21156 </synopsis>
21157 </function>
21158 </construct>
21159 <construct id="function-atoll" type="function">
21160 <function returntype="long long int">
21161 <prototype>
21162 <parameter content="const char *string"/>
21163 </prototype>
21164 <headers>
21165 <header filename = "stdlib.h"/>
21166 </headers>
21167 <synopsis>
21168 This function is similar to &lt;CODE&gt;atol&lt;/CODE&gt;, except it returns a &lt;CODE&gt;long
21169 long int&lt;/CODE&gt;.
21170 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;atoll&lt;/CODE&gt; function was introduced in ISO C99. It too is
21171 obsolete (despite having just been added); use &lt;CODE&gt;strtoll&lt;/CODE&gt; instead.
21172 </synopsis>
21173 </function>
21174 </construct>
21175 <construct id="function-strtod" type="function">
21176 <function returntype="double">
21177 <prototype>
21178 <parameter content="const char *restrict string"/>
21179 <parameter content="char **restrict tailptr"/>
21180 </prototype>
21181 <headers>
21182 <header filename = "stdlib.h"/>
21183 </headers>
21184 <synopsis>
21185 The &lt;CODE&gt;strtod&lt;/CODE&gt; (``string-to-double'') function converts the initial
21186 part of &lt;VAR&gt;string&lt;/VAR&gt; to a floating-point number, which is returned as a
21187 value of type &lt;CODE&gt;double&lt;/CODE&gt;.
21188 &lt;br&gt;&lt;br&gt; This function attempts to decompose &lt;VAR&gt;string&lt;/VAR&gt; as follows:
21189 &lt;br&gt;&lt;br&gt; &lt;OL&gt;
21190 &lt;LI&gt;
21191 A (possibly empty) sequence of whitespace characters. Which characters
21192 are whitespace is determined by the &lt;CODE&gt;isspace&lt;/CODE&gt; function
21193 . These are discarded.
21194 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
21195 An optional plus or minus sign (&lt;samp&gt;+&lt;/samp&gt; or &lt;samp&gt;-&lt;/samp&gt;).
21196 &lt;br&gt;&lt;br&gt; &lt;LI&gt; A floating point number in decimal or hexadecimal format. The
21197 decimal format is:
21198 &lt;UL&gt;
21199 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
21200 A nonempty sequence of digits optionally containing a decimal-point
21201 character---normally &lt;samp&gt;.&lt;/samp&gt;, but it depends on the locale
21202 .
21203 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
21204 An optional exponent part, consisting of a character &lt;samp&gt;e&lt;/samp&gt; or
21205 &lt;samp&gt;E&lt;/samp&gt;, an optional sign, and a sequence of digits.
21206 &lt;br&gt;&lt;br&gt; &lt;/UL&gt;
21207 &lt;br&gt;&lt;br&gt; The hexadecimal format is as follows:
21208 &lt;UL&gt;
21209 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
21210 A 0x or 0X followed by a nonempty sequence of hexadecimal digits
21211 optionally containing a decimal-point character---normally &lt;samp&gt;.&lt;/samp&gt;, but
21212 it depends on the locale .
21213 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
21214 An optional binary-exponent part, consisting of a character &lt;samp&gt;p&lt;/samp&gt; or
21215 &lt;samp&gt;P&lt;/samp&gt;, an optional sign, and a sequence of digits.
21216 &lt;br&gt;&lt;br&gt; &lt;/UL&gt;
21217 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
21218 Any remaining characters in the string. If &lt;VAR&gt;tailptr&lt;/VAR&gt; is not a null
21219 pointer, a pointer to this tail of the string is stored in
21220 &lt;CODE&gt;*&lt;VAR&gt;tailptr&lt;/VAR&gt;&lt;/CODE&gt;.
21221 &lt;/OL&gt;
21222 &lt;br&gt;&lt;br&gt; If the string is empty, contains only whitespace, or does not contain an
21223 initial substring that has the expected syntax for a floating-point
21224 number, no conversion is performed. In this case, &lt;CODE&gt;strtod&lt;/CODE&gt; returns
21225 a value of zero and the value returned in &lt;CODE&gt;*&lt;VAR&gt;tailptr&lt;/VAR&gt;&lt;/CODE&gt; is the
21226 value of &lt;VAR&gt;string&lt;/VAR&gt;.
21227 &lt;br&gt;&lt;br&gt; In a locale other than the standard &lt;CODE&gt;"C"&lt;/CODE&gt; or &lt;CODE&gt;"POSIX"&lt;/CODE&gt; locales,
21228 this function may recognize additional locale-dependent syntax.
21229 &lt;br&gt;&lt;br&gt; If the string has valid syntax for a floating-point number but the value
21230 is outside the range of a &lt;CODE&gt;double&lt;/CODE&gt;, &lt;CODE&gt;strtod&lt;/CODE&gt; will signal
21231 overflow or underflow as described in Math Error Reporting.
21232 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;strtod&lt;/CODE&gt; recognizes four special input strings. The strings
21233 &lt;CODE&gt;"inf"&lt;/CODE&gt; and &lt;CODE&gt;"infinity"&lt;/CODE&gt; are converted to infinity{},
21234 or to the largest representable value if the floating-point format
21235 doesn't support infinities. You can prepend a &lt;CODE&gt;"+"&lt;/CODE&gt; or &lt;CODE&gt;"-"&lt;/CODE&gt;
21236 to specify the sign. Case is ignored when scanning these strings.
21237 &lt;br&gt;&lt;br&gt; The strings &lt;CODE&gt;"nan"&lt;/CODE&gt; and &lt;CODE&gt;"nan(&lt;VAR&gt;chars&lt;/VAR&gt;&lt;/CODE&gt;)" are converted
21238 to NaN. Again, case is ignored. If &lt;VAR&gt;chars&lt;/VAR&gt; are provided, they
21239 are used in some unspecified fashion to select a particular
21240 representation of NaN (there can be several).
21241 &lt;br&gt;&lt;br&gt; Since zero is a valid result as well as the value returned on error, you
21242 should check for errors in the same way as for &lt;CODE&gt;strtol&lt;/CODE&gt;, by
21243 examining &lt;VAR&gt;errno&lt;/VAR&gt; and &lt;VAR&gt;tailptr&lt;/VAR&gt;.
21244 </synopsis>
21245 </function>
21246 </construct>
21247 <construct id="function-strtof" type="function">
21248 <function returntype="float">
21249 <prototype>
21250 <parameter content="const char *string"/>
21251 <parameter content="char **tailptr"/>
21252 </prototype>
21253 <headers>
21254 <header filename = "stdlib.h"/>
21255 </headers>
21256 <synopsis>
21257 These functions are analogous to &lt;CODE&gt;strtod&lt;/CODE&gt;, but return &lt;CODE&gt;float&lt;/CODE&gt;
21258 and &lt;CODE&gt;long double&lt;/CODE&gt; values respectively. They report errors in the
21259 same way as &lt;CODE&gt;strtod&lt;/CODE&gt;. &lt;CODE&gt;strtof&lt;/CODE&gt; can be substantially faster
21260 than &lt;CODE&gt;strtod&lt;/CODE&gt;, but has less precision; conversely, &lt;CODE&gt;strtold&lt;/CODE&gt;
21261 can be much slower but has more precision (on systems where &lt;CODE&gt;long
21262 double&lt;/CODE&gt; is a separate type).
21263 &lt;br&gt;&lt;br&gt; These functions have been GNU extensions and are new to ISO C99.
21264 </synopsis>
21265 </function>
21266 </construct>
21267 <construct id="function-strtold" type="function">
21268 <function returntype="long double">
21269 <prototype>
21270 <parameter content="const char *string"/>
21271 <parameter content="char **tailptr"/>
21272 </prototype>
21273 <headers>
21274 <header filename = "stdlib.h"/>
21275 </headers>
21276 <synopsis>
21277 These functions are analogous to &lt;CODE&gt;strtod&lt;/CODE&gt;, but return &lt;CODE&gt;float&lt;/CODE&gt;
21278 and &lt;CODE&gt;long double&lt;/CODE&gt; values respectively. They report errors in the
21279 same way as &lt;CODE&gt;strtod&lt;/CODE&gt;. &lt;CODE&gt;strtof&lt;/CODE&gt; can be substantially faster
21280 than &lt;CODE&gt;strtod&lt;/CODE&gt;, but has less precision; conversely, &lt;CODE&gt;strtold&lt;/CODE&gt;
21281 can be much slower but has more precision (on systems where &lt;CODE&gt;long
21282 double&lt;/CODE&gt; is a separate type).
21283 &lt;br&gt;&lt;br&gt; These functions have been GNU extensions and are new to ISO C99.
21284 </synopsis>
21285 </function>
21286 </construct>
21287 <construct id="function-wcstod" type="function">
21288 <function returntype="double">
21289 <prototype>
21290 <parameter content="const wchar_t *restrict string"/>
21291 <parameter content="wchar_t **restrict tailptr"/>
21292 </prototype>
21293 <headers>
21294 <header filename = "wchar.h"/>
21295 </headers>
21296 <synopsis>
21297 The &lt;CODE&gt;wcstod&lt;/CODE&gt;, &lt;CODE&gt;wcstof&lt;/CODE&gt;, and &lt;CODE&gt;wcstol&lt;/CODE&gt; functions are
21298 equivalent in nearly all aspect to the &lt;CODE&gt;strtod&lt;/CODE&gt;, &lt;CODE&gt;strtof&lt;/CODE&gt;, and
21299 &lt;CODE&gt;strtold&lt;/CODE&gt; functions but it handles wide character string.
21300 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;wcstod&lt;/CODE&gt; function was introduced in Amendment 1 of ISO
21301 C90. The &lt;CODE&gt;wcstof&lt;/CODE&gt; and &lt;CODE&gt;wcstold&lt;/CODE&gt; functions were introduced in
21302 ISO C99.
21303 </synopsis>
21304 </function>
21305 </construct>
21306 <construct id="function-wcstof" type="function">
21307 <function returntype="float">
21308 <prototype>
21309 <parameter content="const wchar_t *string"/>
21310 <parameter content="wchar_t **tailptr"/>
21311 </prototype>
21312 <headers>
21313 <header filename = "stdlib.h"/>
21314 </headers>
21315 <synopsis>
21316 The &lt;CODE&gt;wcstod&lt;/CODE&gt;, &lt;CODE&gt;wcstof&lt;/CODE&gt;, and &lt;CODE&gt;wcstol&lt;/CODE&gt; functions are
21317 equivalent in nearly all aspect to the &lt;CODE&gt;strtod&lt;/CODE&gt;, &lt;CODE&gt;strtof&lt;/CODE&gt;, and
21318 &lt;CODE&gt;strtold&lt;/CODE&gt; functions but it handles wide character string.
21319 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;wcstod&lt;/CODE&gt; function was introduced in Amendment 1 of ISO
21320 C90. The &lt;CODE&gt;wcstof&lt;/CODE&gt; and &lt;CODE&gt;wcstold&lt;/CODE&gt; functions were introduced in
21321 ISO C99.
21322 </synopsis>
21323 </function>
21324 </construct>
21325 <construct id="function-wcstold" type="function">
21326 <function returntype="long double">
21327 <prototype>
21328 <parameter content="const wchar_t *string"/>
21329 <parameter content="wchar_t **tailptr"/>
21330 </prototype>
21331 <headers>
21332 <header filename = "stdlib.h"/>
21333 </headers>
21334 <synopsis>
21335 The &lt;CODE&gt;wcstod&lt;/CODE&gt;, &lt;CODE&gt;wcstof&lt;/CODE&gt;, and &lt;CODE&gt;wcstol&lt;/CODE&gt; functions are
21336 equivalent in nearly all aspect to the &lt;CODE&gt;strtod&lt;/CODE&gt;, &lt;CODE&gt;strtof&lt;/CODE&gt;, and
21337 &lt;CODE&gt;strtold&lt;/CODE&gt; functions but it handles wide character string.
21338 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;wcstod&lt;/CODE&gt; function was introduced in Amendment 1 of ISO
21339 C90. The &lt;CODE&gt;wcstof&lt;/CODE&gt; and &lt;CODE&gt;wcstold&lt;/CODE&gt; functions were introduced in
21340 ISO C99.
21341 </synopsis>
21342 </function>
21343 </construct>
21344 <construct id="function-atof" type="function">
21345 <function returntype="double">
21346 <prototype>
21347 <parameter content="const char *string"/>
21348 </prototype>
21349 <headers>
21350 <header filename = "stdlib.h"/>
21351 </headers>
21352 <synopsis>
21353 This function is similar to the &lt;CODE&gt;strtod&lt;/CODE&gt; function, except that it
21354 need not detect overflow and underflow errors. The &lt;CODE&gt;atof&lt;/CODE&gt; function
21355 is provided mostly for compatibility with existing code; using
21356 &lt;CODE&gt;strtod&lt;/CODE&gt; is more robust.
21357 </synopsis>
21358 </function>
21359 </construct>
21360 <construct id="function-ecvt" type="function">
21361 <function returntype="char *">
21362 <prototype>
21363 <parameter content="double value"/>
21364 <parameter content="int ndigit"/>
21365 <parameter content="int *decpt"/>
21366 <parameter content="int *neg"/>
21367 </prototype>
21368 <headers>
21369 <header filename = "stdlib.h"/>
21370 </headers>
21371 <synopsis>
21372 The function &lt;CODE&gt;ecvt&lt;/CODE&gt; converts the floating-point number &lt;VAR&gt;value&lt;/VAR&gt;
21373 to a string with at most &lt;VAR&gt;ndigit&lt;/VAR&gt; decimal digits. The
21374 returned string contains no decimal point or sign. The first digit of
21375 the string is non-zero (unless &lt;VAR&gt;value&lt;/VAR&gt; is actually zero) and the
21376 last digit is rounded to nearest. &lt;CODE&gt;*&lt;VAR&gt;decpt&lt;/VAR&gt;&lt;/CODE&gt; is set to the
21377 index in the string of the first digit after the decimal point.
21378 &lt;CODE&gt;*&lt;VAR&gt;neg&lt;/VAR&gt;&lt;/CODE&gt; is set to a nonzero value if &lt;VAR&gt;value&lt;/VAR&gt; is negative,
21379 zero otherwise.
21380 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;ndigit&lt;/VAR&gt; decimal digits would exceed the precision of a
21381 &lt;CODE&gt;double&lt;/CODE&gt; it is reduced to a system-specific value.
21382 &lt;br&gt;&lt;br&gt; The returned string is statically allocated and overwritten by each call
21383 to &lt;CODE&gt;ecvt&lt;/CODE&gt;.
21384 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;value&lt;/VAR&gt; is zero, it is implementation defined whether
21385 &lt;CODE&gt;*&lt;VAR&gt;decpt&lt;/VAR&gt;&lt;/CODE&gt; is &lt;CODE&gt;0&lt;/CODE&gt; or &lt;CODE&gt;1&lt;/CODE&gt;.
21386 &lt;br&gt;&lt;br&gt; For example: &lt;CODE&gt;ecvt (12.3, 5, &amp;d, &amp;n)&lt;/CODE&gt; returns &lt;CODE&gt;"12300"&lt;/CODE&gt;
21387 and sets &lt;VAR&gt;d&lt;/VAR&gt; to &lt;CODE&gt;2&lt;/CODE&gt; and &lt;VAR&gt;n&lt;/VAR&gt; to &lt;CODE&gt;0&lt;/CODE&gt;.
21388 </synopsis>
21389 </function>
21390 </construct>
21391 <construct id="function-fcvt" type="function">
21392 <function returntype="char *">
21393 <prototype>
21394 <parameter content="double value"/>
21395 <parameter content="int ndigit"/>
21396 <parameter content="int *decpt"/>
21397 <parameter content="int *neg"/>
21398 </prototype>
21399 <headers>
21400 <header filename = "stdlib.h"/>
21401 </headers>
21402 <synopsis>
21403 The function &lt;CODE&gt;fcvt&lt;/CODE&gt; is like &lt;CODE&gt;ecvt&lt;/CODE&gt;, but &lt;VAR&gt;ndigit&lt;/VAR&gt; specifies
21404 the number of digits after the decimal point. If &lt;VAR&gt;ndigit&lt;/VAR&gt; is less
21405 than zero, &lt;VAR&gt;value&lt;/VAR&gt; is rounded to the &lt;VAR&gt;ndigit&lt;/VAR&gt;+1'th place to the
21406 left of the decimal point. For example, if &lt;VAR&gt;ndigit&lt;/VAR&gt; is &lt;CODE&gt;-1&lt;/CODE&gt;,
21407 &lt;VAR&gt;value&lt;/VAR&gt; will be rounded to the nearest 10. If &lt;VAR&gt;ndigit&lt;/VAR&gt; is
21408 negative and larger than the number of digits to the left of the decimal
21409 point in &lt;VAR&gt;value&lt;/VAR&gt;, &lt;VAR&gt;value&lt;/VAR&gt; will be rounded to one significant digit.
21410 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;ndigit&lt;/VAR&gt; decimal digits would exceed the precision of a
21411 &lt;CODE&gt;double&lt;/CODE&gt; it is reduced to a system-specific value.
21412 &lt;br&gt;&lt;br&gt; The returned string is statically allocated and overwritten by each call
21413 to &lt;CODE&gt;fcvt&lt;/CODE&gt;.
21414 </synopsis>
21415 </function>
21416 </construct>
21417 <construct id="function-gcvt" type="function">
21418 <function returntype="char *">
21419 <prototype>
21420 <parameter content="double value"/>
21421 <parameter content="int ndigit"/>
21422 <parameter content="char *buf"/>
21423 </prototype>
21424 <headers>
21425 <header filename = "stdlib.h"/>
21426 </headers>
21427 <synopsis>
21428 &lt;CODE&gt;gcvt&lt;/CODE&gt; is functionally equivalent to &lt;samp&gt;sprintf(buf, "%*g",
21429 ndigit, value&lt;/samp&gt;. It is provided only for compatibility's sake. It
21430 returns &lt;VAR&gt;buf&lt;/VAR&gt;.
21431 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;ndigit&lt;/VAR&gt; decimal digits would exceed the precision of a
21432 &lt;CODE&gt;double&lt;/CODE&gt; it is reduced to a system-specific value.
21433 </synopsis>
21434 </function>
21435 </construct>
21436 <construct id="function-qecvt" type="function">
21437 <function returntype="char *">
21438 <prototype>
21439 <parameter content="long double value"/>
21440 <parameter content="int ndigit"/>
21441 <parameter content="int *decpt"/>
21442 <parameter content="int *neg"/>
21443 </prototype>
21444 <headers>
21445 <header filename = "stdlib.h"/>
21446 </headers>
21447 <synopsis>
21448 This function is equivalent to &lt;CODE&gt;ecvt&lt;/CODE&gt; except that it takes a
21449 &lt;CODE&gt;long double&lt;/CODE&gt; for the first parameter and that &lt;VAR&gt;ndigit&lt;/VAR&gt; is
21450 restricted by the precision of a &lt;CODE&gt;long double&lt;/CODE&gt;.
21451 </synopsis>
21452 </function>
21453 </construct>
21454 <construct id="function-qfcvt" type="function">
21455 <function returntype="char *">
21456 <prototype>
21457 <parameter content="long double value"/>
21458 <parameter content="int ndigit"/>
21459 <parameter content="int *decpt"/>
21460 <parameter content="int *neg"/>
21461 </prototype>
21462 <headers>
21463 <header filename = "stdlib.h"/>
21464 </headers>
21465 <synopsis>
21466 This function is equivalent to &lt;CODE&gt;fcvt&lt;/CODE&gt; except that it
21467 takes a &lt;CODE&gt;long double&lt;/CODE&gt; for the first parameter and that &lt;VAR&gt;ndigit&lt;/VAR&gt; is
21468 restricted by the precision of a &lt;CODE&gt;long double&lt;/CODE&gt;.
21469 </synopsis>
21470 </function>
21471 </construct>
21472 <construct id="function-qgcvt" type="function">
21473 <function returntype="char *">
21474 <prototype>
21475 <parameter content="long double value"/>
21476 <parameter content="int ndigit"/>
21477 <parameter content="char *buf"/>
21478 </prototype>
21479 <headers>
21480 <header filename = "stdlib.h"/>
21481 </headers>
21482 <synopsis>
21483 This function is equivalent to &lt;CODE&gt;gcvt&lt;/CODE&gt; except that it takes a
21484 &lt;CODE&gt;long double&lt;/CODE&gt; for the first parameter and that &lt;VAR&gt;ndigit&lt;/VAR&gt; is
21485 restricted by the precision of a &lt;CODE&gt;long double&lt;/CODE&gt;.
21486 </synopsis>
21487 </function>
21488 </construct>
21489 <construct id="function-ecvt_r" type="function">
21490 <function returntype="int">
21491 <prototype>
21492 <parameter content="double value"/>
21493 <parameter content="int ndigit"/>
21494 <parameter content="int *decpt"/>
21495 <parameter content="int *neg"/>
21496 <parameter content="char *buf"/>
21497 <parameter content="size_t len"/>
21498 </prototype>
21499 <headers>
21500 <header filename = "stdlib.h"/>
21501 </headers>
21502 <synopsis>
21503 The &lt;CODE&gt;ecvt_r&lt;/CODE&gt; function is the same as &lt;CODE&gt;ecvt&lt;/CODE&gt;, except
21504 that it places its result into the user-specified buffer pointed to by
21505 &lt;VAR&gt;buf&lt;/VAR&gt;, with length &lt;VAR&gt;len&lt;/VAR&gt;. The return value is &lt;CODE&gt;-1&lt;/CODE&gt; in
21506 case of an error and zero otherwise.
21507 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
21508 </synopsis>
21509 </function>
21510 </construct>
21511 <construct id="function-fcvt_r" type="function">
21512 <function returntype="int">
21513 <prototype>
21514 <parameter content="double value"/>
21515 <parameter content="int ndigit"/>
21516 <parameter content="int *decpt"/>
21517 <parameter content="int *neg"/>
21518 <parameter content="char *buf"/>
21519 <parameter content="size_t len"/>
21520 </prototype>
21521 <headers>
21522 <header filename = "stdlib.h"/>
21523 </headers>
21524 <synopsis>
21525 The &lt;CODE&gt;fcvt_r&lt;/CODE&gt; function is the same as &lt;CODE&gt;fcvt&lt;/CODE&gt;, except that it
21526 places its result into the user-specified buffer pointed to by
21527 &lt;VAR&gt;buf&lt;/VAR&gt;, with length &lt;VAR&gt;len&lt;/VAR&gt;. The return value is &lt;CODE&gt;-1&lt;/CODE&gt; in
21528 case of an error and zero otherwise.
21529 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
21530 </synopsis>
21531 </function>
21532 </construct>
21533 <construct id="function-qecvt_r" type="function">
21534 <function returntype="int">
21535 <prototype>
21536 <parameter content="long double value"/>
21537 <parameter content="int ndigit"/>
21538 <parameter content="int *decpt"/>
21539 <parameter content="int *neg"/>
21540 <parameter content="char *buf"/>
21541 <parameter content="size_t len"/>
21542 </prototype>
21543 <headers>
21544 <header filename = "stdlib.h"/>
21545 </headers>
21546 <synopsis>
21547 The &lt;CODE&gt;qecvt_r&lt;/CODE&gt; function is the same as &lt;CODE&gt;qecvt&lt;/CODE&gt;, except
21548 that it places its result into the user-specified buffer pointed to by
21549 &lt;VAR&gt;buf&lt;/VAR&gt;, with length &lt;VAR&gt;len&lt;/VAR&gt;. The return value is &lt;CODE&gt;-1&lt;/CODE&gt; in
21550 case of an error and zero otherwise.
21551 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
21552 </synopsis>
21553 </function>
21554 </construct>
21555 <construct id="function-qfcvt_r" type="function">
21556 <function returntype="int">
21557 <prototype>
21558 <parameter content="long double value"/>
21559 <parameter content="int ndigit"/>
21560 <parameter content="int *decpt"/>
21561 <parameter content="int *neg"/>
21562 <parameter content="char *buf"/>
21563 <parameter content="size_t len"/>
21564 </prototype>
21565 <headers>
21566 <header filename = "stdlib.h"/>
21567 </headers>
21568 <synopsis>
21569 The &lt;CODE&gt;qfcvt_r&lt;/CODE&gt; function is the same as &lt;CODE&gt;qfcvt&lt;/CODE&gt;, except
21570 that it places its result into the user-specified buffer pointed to by
21571 &lt;VAR&gt;buf&lt;/VAR&gt;, with length &lt;VAR&gt;len&lt;/VAR&gt;. The return value is &lt;CODE&gt;-1&lt;/CODE&gt; in
21572 case of an error and zero otherwise.
21573 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
21574 </synopsis>
21575 </function>
21576 </construct>
21577 <construct id="dtype-wchar_t" type="dtype">
21578 <structure>
21579 </structure>
21580 </construct>
21581 <construct id="dtype-wint_t" type="dtype">
21582 <structure>
21583 </structure>
21584 </construct>
21585 <construct id="dtype-mbstate_t" type="dtype">
21586 <structure>
21587 </structure>
21588 </construct>
21589 <construct id="function-mbsinit" type="function">
21590 <function returntype="int">
21591 <prototype>
21592 <parameter content="const mbstate_t *ps"/>
21593 </prototype>
21594 <headers>
21595 <header filename = "stddef.h"/>
21596 <header filename = "wchar.h"/>
21597 <header filename = "limits.h"/>
21598 <header filename = "stdlib.h"/>
21599 </headers>
21600 <synopsis>
21601 The &lt;CODE&gt;mbsinit&lt;/CODE&gt; function determines whether the state object pointed
21602 to by &lt;VAR&gt;ps&lt;/VAR&gt; is in the initial state. If &lt;VAR&gt;ps&lt;/VAR&gt; is a null pointer or
21603 the object is in the initial state the return value is nonzero. Otherwise
21604 it is zero.
21605 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;mbsinit&lt;/CODE&gt; was introduced in Amendment 1 to ISO C90 and is
21606 declared in &lt;TT&gt;wchar.h&lt;/TT&gt;.
21607 </synopsis>
21608 </function>
21609 </construct>
21610 <construct id="function-btowc" type="function">
21611 <function returntype="wint_t">
21612 <prototype>
21613 <parameter content="int c"/>
21614 </prototype>
21615 <headers>
21616 <header filename = "wchar.h"/>
21617 </headers>
21618 <synopsis>
21619 The &lt;CODE&gt;btowc&lt;/CODE&gt; function (``byte to wide character'') converts a valid
21620 single byte character &lt;VAR&gt;c&lt;/VAR&gt; in the initial shift state into the wide
21621 character equivalent using the conversion rules from the currently
21622 selected locale of the &lt;CODE&gt;LC_CTYPE&lt;/CODE&gt; category.
21623 &lt;br&gt;&lt;br&gt; If &lt;CODE&gt;(unsigned char) &lt;VAR&gt;c&lt;/VAR&gt;&lt;/CODE&gt; is no valid single byte multibyte
21624 character or if &lt;VAR&gt;c&lt;/VAR&gt; is &lt;CODE&gt;EOF&lt;/CODE&gt;, the function returns &lt;CODE&gt;WEOF&lt;/CODE&gt;.
21625 &lt;br&gt;&lt;br&gt; Please note the restriction of &lt;VAR&gt;c&lt;/VAR&gt; being tested for validity only in
21626 the initial shift state. No &lt;CODE&gt;mbstate_t&lt;/CODE&gt; object is used from
21627 which the state information is taken, and the function also does not use
21628 any static state.
21629 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;btowc&lt;/CODE&gt; function was introduced in Amendment 1 to ISO C90
21630 and is declared in &lt;TT&gt;wchar.h&lt;/TT&gt;.
21631 </synopsis>
21632 </function>
21633 </construct>
21634 <construct id="function-wctob" type="function">
21635 <function returntype="int">
21636 <prototype>
21637 <parameter content="wint_t c"/>
21638 </prototype>
21639 <headers>
21640 <header filename = "wchar.h"/>
21641 </headers>
21642 <synopsis>
21643 The &lt;CODE&gt;wctob&lt;/CODE&gt; function (``wide character to byte'') takes as the
21644 parameter a valid wide character. If the multibyte representation for
21645 this character in the initial state is exactly one byte long, the return
21646 value of this function is this character. Otherwise the return value is
21647 &lt;CODE&gt;EOF&lt;/CODE&gt;.
21648 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;wctob&lt;/CODE&gt; was introduced in Amendment 1 to ISO C90 and
21649 is declared in &lt;TT&gt;wchar.h&lt;/TT&gt;.
21650 </synopsis>
21651 </function>
21652 </construct>
21653 <construct id="function-mbrtowc" type="function">
21654 <function returntype="size_t">
21655 <prototype>
21656 <parameter content="wchar_t *restrict pwc"/>
21657 <parameter content="const char *restrict s"/>
21658 <parameter content="size_t n"/>
21659 <parameter content="mbstate_t *restrict ps"/>
21660 </prototype>
21661 <headers>
21662 <header filename = "wchar.h"/>
21663 </headers>
21664 <synopsis>
21665
21666 The &lt;CODE&gt;mbrtowc&lt;/CODE&gt; function (``multibyte restartable to wide
21667 character'') converts the next multibyte character in the string pointed
21668 to by &lt;VAR&gt;s&lt;/VAR&gt; into a wide character and stores it in the wide character
21669 string pointed to by &lt;VAR&gt;pwc&lt;/VAR&gt;. The conversion is performed according
21670 to the locale currently selected for the &lt;CODE&gt;LC_CTYPE&lt;/CODE&gt; category. If
21671 the conversion for the character set used in the locale requires a state,
21672 the multibyte string is interpreted in the state represented by the
21673 object pointed to by &lt;VAR&gt;ps&lt;/VAR&gt;. If &lt;VAR&gt;ps&lt;/VAR&gt; is a null pointer, a static,
21674 internal state variable used only by the &lt;CODE&gt;mbrtowc&lt;/CODE&gt; function is
21675 used.
21676 &lt;br&gt;&lt;br&gt; If the next multibyte character corresponds to the NUL wide character,
21677 the return value of the function is 0 and the state object is
21678 afterwards in the initial state. If the next &lt;VAR&gt;n&lt;/VAR&gt; or fewer bytes
21679 form a correct multibyte character, the return value is the number of
21680 bytes starting from &lt;VAR&gt;s&lt;/VAR&gt; that form the multibyte character. The
21681 conversion state is updated according to the bytes consumed in the
21682 conversion. In both cases the wide character (either the &lt;CODE&gt;L'\0'&lt;/CODE&gt;
21683 or the one found in the conversion) is stored in the string pointed to
21684 by &lt;VAR&gt;pwc&lt;/VAR&gt; if &lt;VAR&gt;pwc&lt;/VAR&gt; is not null.
21685 &lt;br&gt;&lt;br&gt; If the first &lt;VAR&gt;n&lt;/VAR&gt; bytes of the multibyte string possibly form a valid
21686 multibyte character but there are more than &lt;VAR&gt;n&lt;/VAR&gt; bytes needed to
21687 complete it, the return value of the function is &lt;CODE&gt;(size_t) -2&lt;/CODE&gt; and
21688 no value is stored. Please note that this can happen even if &lt;VAR&gt;n&lt;/VAR&gt;
21689 has a value greater than or equal to &lt;CODE&gt;MB_CUR_MAX&lt;/CODE&gt; since the input
21690 might contain redundant shift sequences.
21691 &lt;br&gt;&lt;br&gt; If the first &lt;CODE&gt;n&lt;/CODE&gt; bytes of the multibyte string cannot possibly form
21692 a valid multibyte character, no value is stored, the global variable
21693 &lt;CODE&gt;errno&lt;/CODE&gt; is set to the value &lt;CODE&gt;EILSEQ&lt;/CODE&gt;, and the function returns
21694 &lt;CODE&gt;(size_t) -1&lt;/CODE&gt;. The conversion state is afterwards undefined.
21695 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;mbrtowc&lt;/CODE&gt; was introduced in Amendment 1 to ISO C90 and
21696 is declared in &lt;TT&gt;wchar.h&lt;/TT&gt;.
21697 </synopsis>
21698 </function>
21699 </construct>
21700 <construct id="function-mbrlen" type="function">
21701 <function returntype="size_t">
21702 <prototype>
21703 <parameter content="const char *restrict s"/>
21704 <parameter content="size_t n"/>
21705 <parameter content="mbstate_t *ps"/>
21706 </prototype>
21707 <headers>
21708 <header filename = "wchar.h"/>
21709 </headers>
21710 <synopsis>
21711 The &lt;CODE&gt;mbrlen&lt;/CODE&gt; function (``multibyte restartable length'') computes
21712 the number of at most &lt;VAR&gt;n&lt;/VAR&gt; bytes starting at &lt;VAR&gt;s&lt;/VAR&gt;, which form the
21713 next valid and complete multibyte character.
21714 &lt;br&gt;&lt;br&gt; If the next multibyte character corresponds to the NUL wide character,
21715 the return value is 0. If the next &lt;VAR&gt;n&lt;/VAR&gt; bytes form a valid
21716 multibyte character, the number of bytes belonging to this multibyte
21717 character byte sequence is returned.
21718 &lt;br&gt;&lt;br&gt; If the first &lt;VAR&gt;n&lt;/VAR&gt; bytes possibly form a valid multibyte
21719 character but the character is incomplete, the return value is
21720 &lt;CODE&gt;(size_t) -2&lt;/CODE&gt;. Otherwise the multibyte character sequence is invalid
21721 and the return value is &lt;CODE&gt;(size_t) -1&lt;/CODE&gt;.
21722 &lt;br&gt;&lt;br&gt; The multibyte sequence is interpreted in the state represented by the
21723 object pointed to by &lt;VAR&gt;ps&lt;/VAR&gt;. If &lt;VAR&gt;ps&lt;/VAR&gt; is a null pointer, a state
21724 object local to &lt;CODE&gt;mbrlen&lt;/CODE&gt; is used.
21725 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;mbrlen&lt;/CODE&gt; was introduced in Amendment 1 to ISO C90 and
21726 is declared in &lt;TT&gt;wchar.h&lt;/TT&gt;.
21727 </synopsis>
21728 </function>
21729 </construct>
21730 <construct id="function-wcrtomb" type="function">
21731 <function returntype="size_t">
21732 <prototype>
21733 <parameter content="char *restrict s"/>
21734 <parameter content="wchar_t wc"/>
21735 <parameter content="mbstate_t *restrict ps"/>
21736 </prototype>
21737 <headers>
21738 <header filename = "wchar.h"/>
21739 </headers>
21740 <synopsis>
21741 The &lt;CODE&gt;wcrtomb&lt;/CODE&gt; function (``wide character restartable to
21742 multibyte'') converts a single wide character into a multibyte string
21743 corresponding to that wide character.
21744 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;s&lt;/VAR&gt; is a null pointer, the function resets the state stored in
21745 the objects pointed to by &lt;VAR&gt;ps&lt;/VAR&gt; (or the internal &lt;CODE&gt;mbstate_t&lt;/CODE&gt;
21746 object) to the initial state. This can also be achieved by a call like
21747 this:
21748 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
21749 wcrtombs (temp_buf, L'\0', ps)&lt;br&gt;
21750 &lt;/pre&gt;
21751 &lt;br&gt;&lt;br&gt;
21752 since, if &lt;VAR&gt;s&lt;/VAR&gt; is a null pointer, &lt;CODE&gt;wcrtomb&lt;/CODE&gt; performs as if it
21753 writes into an internal buffer, which is guaranteed to be large enough.
21754 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;wc&lt;/VAR&gt; is the NUL wide character, &lt;CODE&gt;wcrtomb&lt;/CODE&gt; emits, if
21755 necessary, a shift sequence to get the state &lt;VAR&gt;ps&lt;/VAR&gt; into the initial
21756 state followed by a single NUL byte, which is stored in the string
21757 &lt;VAR&gt;s&lt;/VAR&gt;.
21758 &lt;br&gt;&lt;br&gt; Otherwise a byte sequence (possibly including shift sequences) is written
21759 into the string &lt;VAR&gt;s&lt;/VAR&gt;. This only happens if &lt;VAR&gt;wc&lt;/VAR&gt; is a valid wide
21760 character (i.e., it has a multibyte representation in the character set
21761 selected by locale of the &lt;CODE&gt;LC_CTYPE&lt;/CODE&gt; category). If &lt;VAR&gt;wc&lt;/VAR&gt; is no
21762 valid wide character, nothing is stored in the strings &lt;VAR&gt;s&lt;/VAR&gt;,
21763 &lt;CODE&gt;errno&lt;/CODE&gt; is set to &lt;CODE&gt;EILSEQ&lt;/CODE&gt;, the conversion state in &lt;VAR&gt;ps&lt;/VAR&gt;
21764 is undefined and the return value is &lt;CODE&gt;(size_t) -1&lt;/CODE&gt;.
21765 &lt;br&gt;&lt;br&gt; If no error occurred the function returns the number of bytes stored in
21766 the string &lt;VAR&gt;s&lt;/VAR&gt;. This includes all bytes representing shift
21767 sequences.
21768 &lt;br&gt;&lt;br&gt; One word about the interface of the function: there is no parameter
21769 specifying the length of the array &lt;VAR&gt;s&lt;/VAR&gt;. Instead the function
21770 assumes that there are at least &lt;CODE&gt;MB_CUR_MAX&lt;/CODE&gt; bytes available since
21771 this is the maximum length of any byte sequence representing a single
21772 character. So the caller has to make sure that there is enough space
21773 available, otherwise buffer overruns can occur.
21774 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;wcrtomb&lt;/CODE&gt; was introduced in Amendment 1 to ISO C90 and is
21775 declared in &lt;TT&gt;wchar.h&lt;/TT&gt;.
21776 </synopsis>
21777 </function>
21778 </construct>
21779 <construct id="function-mbsrtowcs" type="function">
21780 <function returntype="size_t">
21781 <prototype>
21782 <parameter content="wchar_t *restrict dst"/>
21783 <parameter content="const char **restrict src"/>
21784 <parameter content="size_t len"/>
21785 <parameter content="mbstate_t *restrict ps"/>
21786 </prototype>
21787 <headers>
21788 <header filename = "wchar.h"/>
21789 </headers>
21790 <synopsis>
21791 The &lt;CODE&gt;mbsrtowcs&lt;/CODE&gt; function (``multibyte string restartable to wide
21792 character string'') converts an NUL-terminated multibyte character
21793 string at &lt;CODE&gt;*&lt;VAR&gt;src&lt;/VAR&gt;&lt;/CODE&gt; into an equivalent wide character string,
21794 including the NUL wide character at the end. The conversion is started
21795 using the state information from the object pointed to by &lt;VAR&gt;ps&lt;/VAR&gt; or
21796 from an internal object of &lt;CODE&gt;mbsrtowcs&lt;/CODE&gt; if &lt;VAR&gt;ps&lt;/VAR&gt; is a null
21797 pointer. Before returning, the state object is updated to match the state
21798 after the last converted character. The state is the initial state if the
21799 terminating NUL byte is reached and converted.
21800 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;dst&lt;/VAR&gt; is not a null pointer, the result is stored in the array
21801 pointed to by &lt;VAR&gt;dst&lt;/VAR&gt;; otherwise, the conversion result is not
21802 available since it is stored in an internal buffer.
21803 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;len&lt;/VAR&gt; wide characters are stored in the array &lt;VAR&gt;dst&lt;/VAR&gt; before
21804 reaching the end of the input string, the conversion stops and &lt;VAR&gt;len&lt;/VAR&gt;
21805 is returned. If &lt;VAR&gt;dst&lt;/VAR&gt; is a null pointer, &lt;VAR&gt;len&lt;/VAR&gt; is never checked.
21806 &lt;br&gt;&lt;br&gt; Another reason for a premature return from the function call is if the
21807 input string contains an invalid multibyte sequence. In this case the
21808 global variable &lt;CODE&gt;errno&lt;/CODE&gt; is set to &lt;CODE&gt;EILSEQ&lt;/CODE&gt; and the function
21809 returns &lt;CODE&gt;(size_t) -1&lt;/CODE&gt;.
21810 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt; In all other cases the function returns the number of wide characters
21811 converted during this call. If &lt;VAR&gt;dst&lt;/VAR&gt; is not null, &lt;CODE&gt;mbsrtowcs&lt;/CODE&gt;
21812 stores in the pointer pointed to by &lt;VAR&gt;src&lt;/VAR&gt; either a null pointer (if
21813 the NUL byte in the input string was reached) or the address of the byte
21814 following the last converted multibyte character.
21815 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;mbsrtowcs&lt;/CODE&gt; was introduced in Amendment 1 to ISO C90 and is
21816 declared in &lt;TT&gt;wchar.h&lt;/TT&gt;.
21817 </synopsis>
21818 </function>
21819 </construct>
21820 <construct id="function-wcsrtombs" type="function">
21821 <function returntype="size_t">
21822 <prototype>
21823 <parameter content="char *restrict dst"/>
21824 <parameter content="const wchar_t **restrict src"/>
21825 <parameter content="size_t len"/>
21826 <parameter content="mbstate_t *restrict ps"/>
21827 </prototype>
21828 <headers>
21829 <header filename = "wchar.h"/>
21830 </headers>
21831 <synopsis>
21832 The &lt;CODE&gt;wcsrtombs&lt;/CODE&gt; function (``wide character string restartable to
21833 multibyte string'') converts the NUL-terminated wide character string at
21834 &lt;CODE&gt;*&lt;VAR&gt;src&lt;/VAR&gt;&lt;/CODE&gt; into an equivalent multibyte character string and
21835 stores the result in the array pointed to by &lt;VAR&gt;dst&lt;/VAR&gt;. The NUL wide
21836 character is also converted. The conversion starts in the state
21837 described in the object pointed to by &lt;VAR&gt;ps&lt;/VAR&gt; or by a state object
21838 locally to &lt;CODE&gt;wcsrtombs&lt;/CODE&gt; in case &lt;VAR&gt;ps&lt;/VAR&gt; is a null pointer. If
21839 &lt;VAR&gt;dst&lt;/VAR&gt; is a null pointer, the conversion is performed as usual but the
21840 result is not available. If all characters of the input string were
21841 successfully converted and if &lt;VAR&gt;dst&lt;/VAR&gt; is not a null pointer, the
21842 pointer pointed to by &lt;VAR&gt;src&lt;/VAR&gt; gets assigned a null pointer.
21843 &lt;br&gt;&lt;br&gt; If one of the wide characters in the input string has no valid multibyte
21844 character equivalent, the conversion stops early, sets the global
21845 variable &lt;CODE&gt;errno&lt;/CODE&gt; to &lt;CODE&gt;EILSEQ&lt;/CODE&gt;, and returns &lt;CODE&gt;(size_t) -1&lt;/CODE&gt;.
21846 &lt;br&gt;&lt;br&gt; Another reason for a premature stop is if &lt;VAR&gt;dst&lt;/VAR&gt; is not a null
21847 pointer and the next converted character would require more than
21848 &lt;VAR&gt;len&lt;/VAR&gt; bytes in total to the array &lt;VAR&gt;dst&lt;/VAR&gt;. In this case (and if
21849 &lt;VAR&gt;dest&lt;/VAR&gt; is not a null pointer) the pointer pointed to by &lt;VAR&gt;src&lt;/VAR&gt; is
21850 assigned a value pointing to the wide character right after the last one
21851 successfully converted.
21852 &lt;br&gt;&lt;br&gt; Except in the case of an encoding error the return value of the
21853 &lt;CODE&gt;wcsrtombs&lt;/CODE&gt; function is the number of bytes in all the multibyte
21854 character sequences stored in &lt;VAR&gt;dst&lt;/VAR&gt;. Before returning the state in
21855 the object pointed to by &lt;VAR&gt;ps&lt;/VAR&gt; (or the internal object in case
21856 &lt;VAR&gt;ps&lt;/VAR&gt; is a null pointer) is updated to reflect the state after the
21857 last conversion. The state is the initial shift state in case the
21858 terminating NUL wide character was converted.
21859 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;wcsrtombs&lt;/CODE&gt; function was introduced in Amendment 1 to
21860 ISO C90 and is declared in &lt;TT&gt;wchar.h&lt;/TT&gt;.
21861 </synopsis>
21862 </function>
21863 </construct>
21864 <construct id="function-mbsnrtowcs" type="function">
21865 <function returntype="size_t">
21866 <prototype>
21867 <parameter content="wchar_t *restrict dst"/>
21868 <parameter content="const char **restrict src"/>
21869 <parameter content="size_t nmc"/>
21870 <parameter content="size_t len"/>
21871 <parameter content="mbstate_t *restrict ps"/>
21872 </prototype>
21873 <headers>
21874 <header filename = "wchar.h"/>
21875 </headers>
21876 <synopsis>
21877 The &lt;CODE&gt;mbsnrtowcs&lt;/CODE&gt; function is very similar to the &lt;CODE&gt;mbsrtowcs&lt;/CODE&gt;
21878 function. All the parameters are the same except for &lt;VAR&gt;nmc&lt;/VAR&gt;, which is
21879 new. The return value is the same as for &lt;CODE&gt;mbsrtowcs&lt;/CODE&gt;.
21880 &lt;br&gt;&lt;br&gt; This new parameter specifies how many bytes at most can be used from the
21881 multibyte character string. In other words, the multibyte character
21882 string &lt;CODE&gt;*&lt;VAR&gt;src&lt;/VAR&gt;&lt;/CODE&gt; need not be NUL-terminated. But if a NUL byte
21883 is found within the &lt;VAR&gt;nmc&lt;/VAR&gt; first bytes of the string, the conversion
21884 stops here.
21885 &lt;br&gt;&lt;br&gt; This function is a GNU extension. It is meant to work around the
21886 problems mentioned above. Now it is possible to convert a buffer with
21887 multibyte character text piece for piece without having to care about
21888 inserting NUL bytes and the effect of NUL bytes on the conversion state.
21889 </synopsis>
21890 </function>
21891 </construct>
21892 <construct id="function-wcsnrtombs" type="function">
21893 <function returntype="size_t">
21894 <prototype>
21895 <parameter content="char *restrict dst"/>
21896 <parameter content="const wchar_t **restrict src"/>
21897 <parameter content="size_t nwc"/>
21898 <parameter content="size_t len"/>
21899 <parameter content="mbstate_t *restrict ps"/>
21900 </prototype>
21901 <headers>
21902 <header filename = "wchar.h"/>
21903 </headers>
21904 <synopsis>
21905 The &lt;CODE&gt;wcsnrtombs&lt;/CODE&gt; function implements the conversion from wide
21906 character strings to multibyte character strings. It is similar to
21907 &lt;CODE&gt;wcsrtombs&lt;/CODE&gt; but, just like &lt;CODE&gt;mbsnrtowcs&lt;/CODE&gt;, it takes an extra
21908 parameter, which specifies the length of the input string.
21909 &lt;br&gt;&lt;br&gt; No more than &lt;VAR&gt;nwc&lt;/VAR&gt; wide characters from the input string
21910 &lt;CODE&gt;*&lt;VAR&gt;src&lt;/VAR&gt;&lt;/CODE&gt; are converted. If the input string contains a NUL
21911 wide character in the first &lt;VAR&gt;nwc&lt;/VAR&gt; characters, the conversion stops at
21912 this place.
21913 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;wcsnrtombs&lt;/CODE&gt; function is a GNU extension and just like
21914 &lt;CODE&gt;mbsnrtowcs&lt;/CODE&gt; helps in situations where no NUL-terminated input
21915 strings are available.
21916 </synopsis>
21917 </function>
21918 </construct>
21919 <construct id="function-mbtowc" type="function">
21920 <function returntype="int">
21921 <prototype>
21922 <parameter content="wchar_t *restrict result"/>
21923 <parameter content="const char *restrict string"/>
21924 <parameter content="size_t size"/>
21925 </prototype>
21926 <headers>
21927 <header filename = "stdlib.h"/>
21928 </headers>
21929 <synopsis>
21930 The &lt;CODE&gt;mbtowc&lt;/CODE&gt; (``multibyte to wide character'') function when called
21931 with non-null &lt;VAR&gt;string&lt;/VAR&gt; converts the first multibyte character
21932 beginning at &lt;VAR&gt;string&lt;/VAR&gt; to its corresponding wide character code. It
21933 stores the result in &lt;CODE&gt;*&lt;VAR&gt;result&lt;/VAR&gt;&lt;/CODE&gt;.
21934 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;mbtowc&lt;/CODE&gt; never examines more than &lt;VAR&gt;size&lt;/VAR&gt; bytes. (The idea is
21935 to supply for &lt;VAR&gt;size&lt;/VAR&gt; the number of bytes of data you have in hand.)
21936 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;mbtowc&lt;/CODE&gt; with non-null &lt;VAR&gt;string&lt;/VAR&gt; distinguishes three
21937 possibilities: the first &lt;VAR&gt;size&lt;/VAR&gt; bytes at &lt;VAR&gt;string&lt;/VAR&gt; start with
21938 valid multibyte characters, they start with an invalid byte sequence or
21939 just part of a character, or &lt;VAR&gt;string&lt;/VAR&gt; points to an empty string (a
21940 null character).
21941 &lt;br&gt;&lt;br&gt; For a valid multibyte character, &lt;CODE&gt;mbtowc&lt;/CODE&gt; converts it to a wide
21942 character and stores that in &lt;CODE&gt;*&lt;VAR&gt;result&lt;/VAR&gt;&lt;/CODE&gt;, and returns the
21943 number of bytes in that character (always at least 1 and never
21944 more than &lt;VAR&gt;size&lt;/VAR&gt;).
21945 &lt;br&gt;&lt;br&gt; For an invalid byte sequence, &lt;CODE&gt;mbtowc&lt;/CODE&gt; returns -1. For an
21946 empty string, it returns 0, also storing &lt;CODE&gt;'\0'&lt;/CODE&gt; in
21947 &lt;CODE&gt;*&lt;VAR&gt;result&lt;/VAR&gt;&lt;/CODE&gt;.
21948 &lt;br&gt;&lt;br&gt; If the multibyte character code uses shift characters, then
21949 &lt;CODE&gt;mbtowc&lt;/CODE&gt; maintains and updates a shift state as it scans. If you
21950 call &lt;CODE&gt;mbtowc&lt;/CODE&gt; with a null pointer for &lt;VAR&gt;string&lt;/VAR&gt;, that
21951 initializes the shift state to its standard initial value. It also
21952 returns nonzero if the multibyte character code in use actually has a
21953 shift state. .
21954 </synopsis>
21955 </function>
21956 </construct>
21957 <construct id="function-wctomb" type="function">
21958 <function returntype="int">
21959 <prototype>
21960 <parameter content="char *string"/>
21961 <parameter content="wchar_t wchar"/>
21962 </prototype>
21963 <headers>
21964 <header filename = "stdlib.h"/>
21965 </headers>
21966 <synopsis>
21967 The &lt;CODE&gt;wctomb&lt;/CODE&gt; (``wide character to multibyte'') function converts
21968 the wide character code &lt;VAR&gt;wchar&lt;/VAR&gt; to its corresponding multibyte
21969 character sequence, and stores the result in bytes starting at
21970 &lt;VAR&gt;string&lt;/VAR&gt;. At most &lt;CODE&gt;MB_CUR_MAX&lt;/CODE&gt; characters are stored.
21971 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;wctomb&lt;/CODE&gt; with non-null &lt;VAR&gt;string&lt;/VAR&gt; distinguishes three
21972 possibilities for &lt;VAR&gt;wchar&lt;/VAR&gt;: a valid wide character code (one that can
21973 be translated to a multibyte character), an invalid code, and
21974 &lt;CODE&gt;L'\0'&lt;/CODE&gt;.
21975 &lt;br&gt;&lt;br&gt; Given a valid code, &lt;CODE&gt;wctomb&lt;/CODE&gt; converts it to a multibyte character,
21976 storing the bytes starting at &lt;VAR&gt;string&lt;/VAR&gt;. Then it returns the number
21977 of bytes in that character (always at least 1 and never more
21978 than &lt;CODE&gt;MB_CUR_MAX&lt;/CODE&gt;).
21979 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;wchar&lt;/VAR&gt; is an invalid wide character code, &lt;CODE&gt;wctomb&lt;/CODE&gt; returns
21980 -1. If &lt;VAR&gt;wchar&lt;/VAR&gt; is &lt;CODE&gt;L'\0'&lt;/CODE&gt;, it returns &lt;CODE&gt;0&lt;/CODE&gt;, also
21981 storing &lt;CODE&gt;'\0'&lt;/CODE&gt; in &lt;CODE&gt;*&lt;VAR&gt;string&lt;/VAR&gt;&lt;/CODE&gt;.
21982 &lt;br&gt;&lt;br&gt; If the multibyte character code uses shift characters, then
21983 &lt;CODE&gt;wctomb&lt;/CODE&gt; maintains and updates a shift state as it scans. If you
21984 call &lt;CODE&gt;wctomb&lt;/CODE&gt; with a null pointer for &lt;VAR&gt;string&lt;/VAR&gt;, that
21985 initializes the shift state to its standard initial value. It also
21986 returns nonzero if the multibyte character code in use actually has a
21987 shift state. .
21988 &lt;br&gt;&lt;br&gt; Calling this function with a &lt;VAR&gt;wchar&lt;/VAR&gt; argument of zero when
21989 &lt;VAR&gt;string&lt;/VAR&gt; is not null has the side-effect of reinitializing the
21990 stored shift state &lt;EM&gt;as well as&lt;/EM&gt; storing the multibyte character
21991 &lt;CODE&gt;'\0'&lt;/CODE&gt; and returning 0.
21992 </synopsis>
21993 </function>
21994 </construct>
21995 <construct id="function-mblen" type="function">
21996 <function returntype="int">
21997 <prototype>
21998 <parameter content="const char *string"/>
21999 <parameter content="size_t size"/>
22000 </prototype>
22001 <headers>
22002 <header filename = "stdlib.h"/>
22003 </headers>
22004 <synopsis>
22005 The &lt;CODE&gt;mblen&lt;/CODE&gt; function with a non-null &lt;VAR&gt;string&lt;/VAR&gt; argument returns
22006 the number of bytes that make up the multibyte character beginning at
22007 &lt;VAR&gt;string&lt;/VAR&gt;, never examining more than &lt;VAR&gt;size&lt;/VAR&gt; bytes. (The idea is
22008 to supply for &lt;VAR&gt;size&lt;/VAR&gt; the number of bytes of data you have in hand.)
22009 &lt;br&gt;&lt;br&gt; The return value of &lt;CODE&gt;mblen&lt;/CODE&gt; distinguishes three possibilities: the
22010 first &lt;VAR&gt;size&lt;/VAR&gt; bytes at &lt;VAR&gt;string&lt;/VAR&gt; start with valid multibyte
22011 characters, they start with an invalid byte sequence or just part of a
22012 character, or &lt;VAR&gt;string&lt;/VAR&gt; points to an empty string (a null character).
22013 &lt;br&gt;&lt;br&gt; For a valid multibyte character, &lt;CODE&gt;mblen&lt;/CODE&gt; returns the number of
22014 bytes in that character (always at least &lt;CODE&gt;1&lt;/CODE&gt; and never more than
22015 &lt;VAR&gt;size&lt;/VAR&gt;). For an invalid byte sequence, &lt;CODE&gt;mblen&lt;/CODE&gt; returns
22016 -1. For an empty string, it returns 0.
22017 &lt;br&gt;&lt;br&gt; If the multibyte character code uses shift characters, then &lt;CODE&gt;mblen&lt;/CODE&gt;
22018 maintains and updates a shift state as it scans. If you call
22019 &lt;CODE&gt;mblen&lt;/CODE&gt; with a null pointer for &lt;VAR&gt;string&lt;/VAR&gt;, that initializes the
22020 shift state to its standard initial value. It also returns a nonzero
22021 value if the multibyte character code in use actually has a shift state.
22022 .
22023 &lt;br&gt;&lt;br&gt; The function &lt;CODE&gt;mblen&lt;/CODE&gt; is declared in &lt;TT&gt;stdlib.h&lt;/TT&gt;.
22024 </synopsis>
22025 </function>
22026 </construct>
22027 <construct id="function-mbstowcs" type="function">
22028 <function returntype="size_t">
22029 <prototype>
22030 <parameter content="wchar_t *wstring"/>
22031 <parameter content="const char *string"/>
22032 <parameter content="size_t size"/>
22033 </prototype>
22034 <headers>
22035 <header filename = "stdlib.h"/>
22036 </headers>
22037 <synopsis>
22038 The &lt;CODE&gt;mbstowcs&lt;/CODE&gt; (``multibyte string to wide character string'')
22039 function converts the null-terminated string of multibyte characters
22040 &lt;VAR&gt;string&lt;/VAR&gt; to an array of wide character codes, storing not more than
22041 &lt;VAR&gt;size&lt;/VAR&gt; wide characters into the array beginning at &lt;VAR&gt;wstring&lt;/VAR&gt;.
22042 The terminating null character counts towards the size, so if &lt;VAR&gt;size&lt;/VAR&gt;
22043 is less than the actual number of wide characters resulting from
22044 &lt;VAR&gt;string&lt;/VAR&gt;, no terminating null character is stored.
22045 &lt;br&gt;&lt;br&gt; The conversion of characters from &lt;VAR&gt;string&lt;/VAR&gt; begins in the initial
22046 shift state.
22047 &lt;br&gt;&lt;br&gt; If an invalid multibyte character sequence is found, the &lt;CODE&gt;mbstowcs&lt;/CODE&gt;
22048 function returns a value of -1. Otherwise, it returns the number
22049 of wide characters stored in the array &lt;VAR&gt;wstring&lt;/VAR&gt;. This number does
22050 not include the terminating null character, which is present if the
22051 number is less than &lt;VAR&gt;size&lt;/VAR&gt;.
22052 &lt;br&gt;&lt;br&gt; Here is an example showing how to convert a string of multibyte
22053 characters, allocating enough space for the result.
22054 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
22055 wchar_t *&lt;br&gt;
22056 mbstowcs_alloc (const char *string)&lt;br&gt;
22057 {&lt;br&gt;
22058 size_t size = strlen (string) + 1;&lt;br&gt;
22059 wchar_t *buf = xmalloc (size * sizeof (wchar_t));&lt;br&gt;
22060 &lt;br&gt;&lt;br&gt; size = mbstowcs (buf, string, size);&lt;br&gt;
22061 if (size == (size_t) -1)&lt;br&gt;
22062 return NULL;&lt;br&gt;
22063 buf = xrealloc (buf, (size + 1) * sizeof (wchar_t));&lt;br&gt;
22064 return buf;&lt;br&gt;
22065 }&lt;br&gt;
22066 &lt;/pre&gt;
22067 &lt;br&gt;&lt;br&gt;
22068 </synopsis>
22069 </function>
22070 </construct>
22071 <construct id="function-wcstombs" type="function">
22072 <function returntype="size_t">
22073 <prototype>
22074 <parameter content="char *string"/>
22075 <parameter content="const wchar_t *wstring"/>
22076 <parameter content="size_t size"/>
22077 </prototype>
22078 <headers>
22079 <header filename = "stdlib.h"/>
22080 </headers>
22081 <synopsis>
22082 The &lt;CODE&gt;wcstombs&lt;/CODE&gt; (``wide character string to multibyte string'')
22083 function converts the null-terminated wide character array &lt;VAR&gt;wstring&lt;/VAR&gt;
22084 into a string containing multibyte characters, storing not more than
22085 &lt;VAR&gt;size&lt;/VAR&gt; bytes starting at &lt;VAR&gt;string&lt;/VAR&gt;, followed by a terminating
22086 null character if there is room. The conversion of characters begins in
22087 the initial shift state.
22088 &lt;br&gt;&lt;br&gt; The terminating null character counts towards the size, so if &lt;VAR&gt;size&lt;/VAR&gt;
22089 is less than or equal to the number of bytes needed in &lt;VAR&gt;wstring&lt;/VAR&gt;, no
22090 terminating null character is stored.
22091 &lt;br&gt;&lt;br&gt; If a code that does not correspond to a valid multibyte character is
22092 found, the &lt;CODE&gt;wcstombs&lt;/CODE&gt; function returns a value of -1.
22093 Otherwise, the return value is the number of bytes stored in the array
22094 &lt;VAR&gt;string&lt;/VAR&gt;. This number does not include the terminating null character,
22095 which is present if the number is less than &lt;VAR&gt;size&lt;/VAR&gt;.
22096 </synopsis>
22097 </function>
22098 </construct>
22099 <construct id="dtype-iconv_t" type="dtype">
22100 <structure>
22101 </structure>
22102 </construct>
22103 <construct id="function-iconv_open" type="function">
22104 <function returntype="iconv_t">
22105 <prototype>
22106 <parameter content="const char *tocode"/>
22107 <parameter content="const char *fromcode"/>
22108 </prototype>
22109 <headers>
22110 <header filename = "iconv.h"/>
22111 </headers>
22112 <synopsis>
22113 The &lt;CODE&gt;iconv_open&lt;/CODE&gt; function has to be used before starting a
22114 conversion. The two parameters this function takes determine the
22115 source and destination character set for the conversion, and if the
22116 implementation has the possibility to perform such a conversion, the
22117 function returns a handle.
22118 &lt;br&gt;&lt;br&gt; If the wanted conversion is not available, the &lt;CODE&gt;iconv_open&lt;/CODE&gt; function
22119 returns &lt;CODE&gt;(iconv_t) -1&lt;/CODE&gt;. In this case the global variable
22120 &lt;CODE&gt;errno&lt;/CODE&gt; can have the following values:
22121 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
22122
22123 &lt;DT&gt;&lt;CODE&gt;EMFILE&lt;/CODE&gt;
22124 &lt;DD&gt;
22125 The process already has &lt;CODE&gt;OPEN_MAX&lt;/CODE&gt; file descriptors open.
22126 &lt;LI&gt; ENFILE
22127 The system limit of open file is reached.
22128 &lt;LI&gt; ENOMEM
22129 Not enough memory to carry out the operation.
22130 &lt;LI&gt; EINVAL
22131 The conversion from &lt;VAR&gt;fromcode&lt;/VAR&gt; to &lt;VAR&gt;tocode&lt;/VAR&gt; is not supported.
22132
22133 &lt;br&gt;&lt;br&gt; It is not possible to use the same descriptor in different threads to
22134 perform independent conversions. The data structures associated
22135 with the descriptor include information about the conversion state.
22136 This must not be messed up by using it in different conversions.
22137 &lt;br&gt;&lt;br&gt; An &lt;CODE&gt;iconv&lt;/CODE&gt; descriptor is like a file descriptor as for every use a
22138 new descriptor must be created. The descriptor does not stand for all
22139 of the conversions from &lt;VAR&gt;fromset&lt;/VAR&gt; to &lt;VAR&gt;toset&lt;/VAR&gt;.
22140 &lt;br&gt;&lt;br&gt; The GNU C library implementation of &lt;CODE&gt;iconv_open&lt;/CODE&gt; has one
22141 significant extension to other implementations. To ease the extension
22142 of the set of available conversions, the implementation allows storing
22143 the necessary files with data and code in an arbitrary number of
22144 directories. How this extension must be written will be explained below
22145 . Here it is only important to say
22146 that all directories mentioned in the &lt;CODE&gt;GCONV_PATH&lt;/CODE&gt; environment
22147 variable are considered only if they contain a file &lt;TT&gt;gconv-modules&lt;/TT&gt;.
22148 These directories need not necessarily be created by the system
22149 administrator. In fact, this extension is introduced to help users
22150 writing and using their own, new conversions. Of course, this does not
22151 work for security reasons in SUID binaries; in this case only the system
22152 directory is considered and this normally is
22153 &lt;TT&gt;&lt;VAR&gt;prefix&lt;/VAR&gt;/lib/gconv&lt;/TT&gt;. The &lt;CODE&gt;GCONV_PATH&lt;/CODE&gt; environment
22154 variable is examined exactly once at the first call of the
22155 &lt;CODE&gt;iconv_open&lt;/CODE&gt; function. Later modifications of the variable have no
22156 effect.
22157 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;iconv_open&lt;/CODE&gt; function was introduced early in the X/Open
22158 Portability Guide, version 2. It is supported by all commercial
22159 Unices as it is required for the Unix branding. However, the quality and
22160 completeness of the implementation varies widely. The &lt;CODE&gt;iconv_open&lt;/CODE&gt;
22161 function is declared in &lt;TT&gt;iconv.h&lt;/TT&gt;.
22162 </synopsis>
22163 </function>
22164 </construct>
22165 <construct id="function-iconv_close" type="function">
22166 <function returntype="int">
22167 <prototype>
22168 <parameter content="iconv_t cd"/>
22169 </prototype>
22170 <headers>
22171 <header filename = "iconv.h"/>
22172 </headers>
22173 <synopsis>
22174 The &lt;CODE&gt;iconv_close&lt;/CODE&gt; function frees all resources associated with the
22175 handle &lt;VAR&gt;cd&lt;/VAR&gt;, which must have been returned by a successful call to
22176 the &lt;CODE&gt;iconv_open&lt;/CODE&gt; function.
22177 &lt;br&gt;&lt;br&gt; If the function call was successful the return value is 0.
22178 Otherwise it is -1 and &lt;CODE&gt;errno&lt;/CODE&gt; is set appropriately.
22179 Defined error are:
22180 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
22181
22182 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
22183 &lt;DD&gt;
22184 The conversion descriptor is invalid.
22185
22186 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;iconv_close&lt;/CODE&gt; function was introduced together with the rest
22187 of the &lt;CODE&gt;iconv&lt;/CODE&gt; functions in XPG2 and is declared in &lt;TT&gt;iconv.h&lt;/TT&gt;.
22188 </synopsis>
22189 </function>
22190 </construct>
22191 <construct id="function-iconv" type="function">
22192 <function returntype="size_t">
22193 <prototype>
22194 <parameter content="iconv_t cd"/>
22195 <parameter content="char **inbuf"/>
22196 <parameter content="size_t *inbytesleft"/>
22197 <parameter content="char **outbuf"/>
22198 <parameter content="size_t *outbytesleft"/>
22199 </prototype>
22200 <headers>
22201 <header filename = "iconv.h"/>
22202 </headers>
22203 <synopsis>
22204
22205 The &lt;CODE&gt;iconv&lt;/CODE&gt; function converts the text in the input buffer
22206 according to the rules associated with the descriptor &lt;VAR&gt;cd&lt;/VAR&gt; and
22207 stores the result in the output buffer. It is possible to call the
22208 function for the same text several times in a row since for stateful
22209 character sets the necessary state information is kept in the data
22210 structures associated with the descriptor.
22211 &lt;br&gt;&lt;br&gt; The input buffer is specified by &lt;CODE&gt;*&lt;VAR&gt;inbuf&lt;/VAR&gt;&lt;/CODE&gt; and it contains
22212 &lt;CODE&gt;*&lt;VAR&gt;inbytesleft&lt;/VAR&gt;&lt;/CODE&gt; bytes. The extra indirection is necessary for
22213 communicating the used input back to the caller (see below). It is
22214 important to note that the buffer pointer is of type &lt;CODE&gt;char&lt;/CODE&gt; and the
22215 length is measured in bytes even if the input text is encoded in wide
22216 characters.
22217 &lt;br&gt;&lt;br&gt; The output buffer is specified in a similar way. &lt;CODE&gt;*&lt;VAR&gt;outbuf&lt;/VAR&gt;&lt;/CODE&gt;
22218 points to the beginning of the buffer with at least
22219 &lt;CODE&gt;*&lt;VAR&gt;outbytesleft&lt;/VAR&gt;&lt;/CODE&gt; bytes room for the result. The buffer
22220 pointer again is of type &lt;CODE&gt;char&lt;/CODE&gt; and the length is measured in
22221 bytes. If &lt;VAR&gt;outbuf&lt;/VAR&gt; or &lt;CODE&gt;*&lt;VAR&gt;outbuf&lt;/VAR&gt;&lt;/CODE&gt; is a null pointer, the
22222 conversion is performed but no output is available.
22223 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;inbuf&lt;/VAR&gt; is a null pointer, the &lt;CODE&gt;iconv&lt;/CODE&gt; function performs the
22224 necessary action to put the state of the conversion into the initial
22225 state. This is obviously a no-op for non-stateful encodings, but if the
22226 encoding has a state, such a function call might put some byte sequences
22227 in the output buffer, which perform the necessary state changes. The
22228 next call with &lt;VAR&gt;inbuf&lt;/VAR&gt; not being a null pointer then simply goes on
22229 from the initial state. It is important that the programmer never makes
22230 any assumption as to whether the conversion has to deal with states.
22231 Even if the input and output character sets are not stateful, the
22232 implementation might still have to keep states. This is due to the
22233 implementation chosen for the GNU C library as it is described below.
22234 Therefore an &lt;CODE&gt;iconv&lt;/CODE&gt; call to reset the state should always be
22235 performed if some protocol requires this for the output text.
22236 &lt;br&gt;&lt;br&gt; The conversion stops for one of three reasons. The first is that all
22237 characters from the input buffer are converted. This actually can mean
22238 two things: either all bytes from the input buffer are consumed or
22239 there are some bytes at the end of the buffer that possibly can form a
22240 complete character but the input is incomplete. The second reason for a
22241 stop is that the output buffer is full. And the third reason is that
22242 the input contains invalid characters.
22243 &lt;br&gt;&lt;br&gt; In all of these cases the buffer pointers after the last successful
22244 conversion, for input and output buffer, are stored in &lt;VAR&gt;inbuf&lt;/VAR&gt; and
22245 &lt;VAR&gt;outbuf&lt;/VAR&gt;, and the available room in each buffer is stored in
22246 &lt;VAR&gt;inbytesleft&lt;/VAR&gt; and &lt;VAR&gt;outbytesleft&lt;/VAR&gt;.
22247 &lt;br&gt;&lt;br&gt; Since the character sets selected in the &lt;CODE&gt;iconv_open&lt;/CODE&gt; call can be
22248 almost arbitrary, there can be situations where the input buffer contains
22249 valid characters, which have no identical representation in the output
22250 character set. The behavior in this situation is undefined. The
22251 &lt;EM&gt;current&lt;/EM&gt; behavior of the GNU C library in this situation is to
22252 return with an error immediately. This certainly is not the most
22253 desirable solution; therefore, future versions will provide better ones,
22254 but they are not yet finished.
22255 &lt;br&gt;&lt;br&gt; If all input from the input buffer is successfully converted and stored
22256 in the output buffer, the function returns the number of non-reversible
22257 conversions performed. In all other cases the return value is
22258 &lt;CODE&gt;(size_t) -1&lt;/CODE&gt; and &lt;CODE&gt;errno&lt;/CODE&gt; is set appropriately. In such cases
22259 the value pointed to by &lt;VAR&gt;inbytesleft&lt;/VAR&gt; is nonzero.
22260 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
22261
22262 &lt;DT&gt;&lt;CODE&gt;EILSEQ&lt;/CODE&gt;
22263 &lt;DD&gt;
22264 The conversion stopped because of an invalid byte sequence in the input.
22265 After the call, &lt;CODE&gt;*&lt;VAR&gt;inbuf&lt;/VAR&gt;&lt;/CODE&gt; points at the first byte of the
22266 invalid byte sequence.
22267 &lt;br&gt;&lt;br&gt; &lt;LI&gt; E2BIG
22268 The conversion stopped because it ran out of space in the output buffer.
22269 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
22270 The conversion stopped because of an incomplete byte sequence at the end
22271 of the input buffer.
22272 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EBADF
22273 The &lt;VAR&gt;cd&lt;/VAR&gt; argument is invalid.
22274
22275 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;iconv&lt;/CODE&gt; function was introduced in the XPG2 standard and is
22276 declared in the &lt;TT&gt;iconv.h&lt;/TT&gt; header.
22277 </synopsis>
22278 </function>
22279 </construct>
22280 <construct id="struct-__gconv_step" type="struct">
22281 <structure>
22282 <synopsis>
22283 This data structure describes one conversion a module can perform. For
22284 each function in a loaded module with conversion functions there is
22285 exactly one object of this type. This object is shared by all users of
22286 the conversion (i.e., this object does not contain any information
22287 corresponding to an actual conversion; it only describes the conversion
22288 itself).
22289 &lt;br&gt;&lt;br&gt;
22290 </synopsis>
22291 <elements>
22292 <element content="struct __gconv_loaded_object *__shlib_handle">
22293 </element>
22294 <element content="&lt;LI&gt;x const char *__modname">
22295 </element>
22296 <element content="&lt;LI&gt;x int __counter">
22297 <synopsis>
22298 All these elements of the structure are used internally in the C library
22299 to coordinate loading and unloading the shared. One must not expect any
22300 of the other elements to be available or initialized.
22301 &lt;br&gt;&lt;br&gt;
22302 </synopsis>
22303 </element>
22304 <element content="const char *__from_name">
22305 </element>
22306 <element content="&lt;LI&gt;x const char *__to_name">
22307 <synopsis>
22308 &lt;CODE&gt;__from_name&lt;/CODE&gt; and &lt;CODE&gt;__to_name&lt;/CODE&gt; contain the names of the source and
22309 destination character sets. They can be used to identify the actual
22310 conversion to be carried out since one module might implement conversions
22311 for more than one character set and/or direction.
22312 &lt;br&gt;&lt;br&gt;
22313 </synopsis>
22314 </element>
22315 <element content="gconv_fct __fct">
22316 </element>
22317 <element content="&lt;LI&gt;x gconv_init_fct __init_fct">
22318 </element>
22319 <element content="&lt;LI&gt;x gconv_end_fct __end_fct">
22320 <synopsis>
22321 These elements contain pointers to the functions in the loadable module.
22322 The interface will be explained below.
22323 &lt;br&gt;&lt;br&gt;
22324 </synopsis>
22325 </element>
22326 <element content="int __min_needed_from">
22327 </element>
22328 <element content="&lt;LI&gt;x int __max_needed_from">
22329 </element>
22330 <element content="&lt;LI&gt;x int __min_needed_to">
22331 </element>
22332 <element content="&lt;LI&gt;x int __max_needed_to;">
22333 <synopsis>
22334 These values have to be supplied in the init function of the module. The
22335 &lt;CODE&gt;__min_needed_from&lt;/CODE&gt; value specifies how many bytes a character of
22336 the source character set at least needs. The &lt;CODE&gt;__max_needed_from&lt;/CODE&gt;
22337 specifies the maximum value that also includes possible shift sequences.
22338 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;__min_needed_to&lt;/CODE&gt; and &lt;CODE&gt;__max_needed_to&lt;/CODE&gt; values serve the
22339 same purpose as &lt;CODE&gt;__min_needed_from&lt;/CODE&gt; and &lt;CODE&gt;__max_needed_from&lt;/CODE&gt; but
22340 this time for the destination character set.
22341 &lt;br&gt;&lt;br&gt; It is crucial that these values be accurate since otherwise the
22342 conversion functions will have problems or not work at all.
22343 &lt;br&gt;&lt;br&gt;
22344 </synopsis>
22345 </element>
22346 <element content="int __stateful">
22347 <synopsis>
22348 This element must also be initialized by the init function.
22349 &lt;CODE&gt;int __stateful&lt;/CODE&gt; is nonzero if the source character set is stateful.
22350 Otherwise it is zero.
22351 &lt;br&gt;&lt;br&gt;
22352 </synopsis>
22353 </element>
22354 </elements>
22355 </structure>
22356 </construct>
22357 <construct id="struct-__gconv_step_data" type="struct">
22358 <structure>
22359 <synopsis>
22360 This is the data structure that contains the information specific to
22361 each use of the conversion functions.
22362 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt;
22363 </synopsis>
22364 <elements>
22365 <element content="char *__outbuf">
22366 </element>
22367 <element content="&lt;LI&gt;x char *__outbufend">
22368 <synopsis>
22369 These elements specify the output buffer for the conversion step. The
22370 &lt;CODE&gt;__outbuf&lt;/CODE&gt; element points to the beginning of the buffer, and
22371 &lt;CODE&gt;__outbufend&lt;/CODE&gt; points to the byte following the last byte in the
22372 buffer. The conversion function must not assume anything about the size
22373 of the buffer but it can be safely assumed the there is room for at
22374 least one complete character in the output buffer.
22375 &lt;br&gt;&lt;br&gt; Once the conversion is finished, if the conversion is the last step, the
22376 &lt;CODE&gt;__outbuf&lt;/CODE&gt; element must be modified to point after the last byte
22377 written into the buffer to signal how much output is available. If this
22378 conversion step is not the last one, the element must not be modified.
22379 The &lt;CODE&gt;__outbufend&lt;/CODE&gt; element must not be modified.
22380 &lt;br&gt;&lt;br&gt;
22381 </synopsis>
22382 </element>
22383 <element content="int __is_last">
22384 <synopsis>
22385 This element is nonzero if this conversion step is the last one. This
22386 information is necessary for the recursion. See the description of the
22387 conversion function internals below. This element must never be
22388 modified.
22389 &lt;br&gt;&lt;br&gt;
22390 </synopsis>
22391 </element>
22392 <element content="int __invocation_counter">
22393 <synopsis>
22394 The conversion function can use this element to see how many calls of
22395 the conversion function already happened. Some character sets require a
22396 certain prolog when generating output, and by comparing this value with
22397 zero, one can find out whether it is the first call and whether,
22398 therefore, the prolog should be emitted. This element must never be
22399 modified.
22400 &lt;br&gt;&lt;br&gt;
22401 </synopsis>
22402 </element>
22403 <element content="int __internal_use">
22404 <synopsis>
22405 This element is another one rarely used but needed in certain
22406 situations. It is assigned a nonzero value in case the conversion
22407 functions are used to implement &lt;CODE&gt;mbsrtowcs&lt;/CODE&gt; et.al.: (i.e., the
22408 function is not used directly through the &lt;CODE&gt;iconv&lt;/CODE&gt; interface).
22409 &lt;br&gt;&lt;br&gt; This sometimes makes a difference as it is expected that the
22410 &lt;CODE&gt;iconv&lt;/CODE&gt; functions are used to translate entire texts while the
22411 &lt;CODE&gt;mbsrtowcs&lt;/CODE&gt; functions are normally used only to convert single
22412 strings and might be used multiple times to convert entire texts.
22413 &lt;br&gt;&lt;br&gt; But in this situation we would have problem complying with some rules of
22414 the character set specification. Some character sets require a prolog,
22415 which must appear exactly once for an entire text. If a number of
22416 &lt;CODE&gt;mbsrtowcs&lt;/CODE&gt; calls are used to convert the text, only the first call
22417 must add the prolog. However, because there is no communication between the
22418 different calls of &lt;CODE&gt;mbsrtowcs&lt;/CODE&gt;, the conversion functions have no
22419 possibility to find this out. The situation is different for sequences
22420 of &lt;CODE&gt;iconv&lt;/CODE&gt; calls since the handle allows access to the needed
22421 information.
22422 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;int __internal_use&lt;/CODE&gt; element is mostly used together with
22423 &lt;CODE&gt;__invocation_counter&lt;/CODE&gt; as follows:
22424 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
22425 if (!data-&gt;__internal_use&lt;br&gt;
22426 &amp;&amp; data-&gt;__invocation_counter == 0)&lt;br&gt;
22427 /* Emit prolog. */&lt;br&gt;
22428 &lt;small&gt;...&lt;/small&gt;&lt;br&gt;
22429 &lt;/pre&gt;
22430 &lt;br&gt;&lt;br&gt; This element must never be modified.
22431 &lt;br&gt;&lt;br&gt;
22432 </synopsis>
22433 </element>
22434 <element content="mbstate_t *__statep">
22435 <synopsis>
22436 The &lt;CODE&gt;__statep&lt;/CODE&gt; element points to an object of type &lt;CODE&gt;mbstate_t&lt;/CODE&gt;
22437 . The conversion of a stateful character
22438 set must use the object pointed to by &lt;CODE&gt;__statep&lt;/CODE&gt; to store
22439 information about the conversion state. The &lt;CODE&gt;__statep&lt;/CODE&gt; element
22440 itself must never be modified.
22441 &lt;br&gt;&lt;br&gt;
22442 </synopsis>
22443 </element>
22444 </elements>
22445 </structure>
22446 </construct>
22447 <construct id="function-argp_parse" type="function">
22448 <function returntype="error_t">
22449 <prototype>
22450 <parameter content="const struct argp *argp"/>
22451 <parameter content="int argc"/>
22452 <parameter content="char **argv"/>
22453 <parameter content="unsigned flags"/>
22454 <parameter content="int *arg_index"/>
22455 <parameter content="void *input"/>
22456 </prototype>
22457 <headers>
22458 <header filename = "gconv.h"/>
22459 <header filename = "argp.h"/>
22460 </headers>
22461 <synopsis>
22462 The &lt;CODE&gt;argp_parse&lt;/CODE&gt; function parses the arguments in &lt;VAR&gt;argv&lt;/VAR&gt;, of
22463 length &lt;VAR&gt;argc&lt;/VAR&gt;, using the argp parser &lt;VAR&gt;argp&lt;/VAR&gt;. .
22464 &lt;br&gt;&lt;br&gt; A value of zero is the same as a &lt;CODE&gt;struct argp&lt;/CODE&gt;containing all
22465 zeros. &lt;VAR&gt;flags&lt;/VAR&gt; is a set of flag bits that modify the parsing
22466 behavior. . &lt;VAR&gt;input&lt;/VAR&gt; is passed through to the argp
22467 parser &lt;VAR&gt;argp&lt;/VAR&gt;, and has meaning defined by &lt;VAR&gt;argp&lt;/VAR&gt;. A typical
22468 usage is to pass a pointer to a structure which is used for specifying
22469 parameters to the parser and passing back the results.
22470 &lt;br&gt;&lt;br&gt; Unless the &lt;CODE&gt;ARGP_NO_EXIT&lt;/CODE&gt; or &lt;CODE&gt;ARGP_NO_HELP&lt;/CODE&gt; flags are included
22471 in &lt;VAR&gt;flags&lt;/VAR&gt;, calling &lt;CODE&gt;argp_parse&lt;/CODE&gt; may result in the program
22472 exiting. This behavior is true if an error is detected, or when an
22473 unknown option is encountered. .
22474 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;arg_index&lt;/VAR&gt; is non-null, the index of the first unparsed option
22475 in &lt;VAR&gt;argv&lt;/VAR&gt; is returned as a value.
22476 &lt;br&gt;&lt;br&gt; The return value is zero for successful parsing, or an error code
22477 if an error is detected. Different argp parsers
22478 may return arbitrary error codes, but the standard error codes are:
22479 &lt;CODE&gt;ENOMEM&lt;/CODE&gt; if a memory allocation error occurred, or &lt;CODE&gt;EINVAL&lt;/CODE&gt; if
22480 an unknown option or option argument is encountered.
22481 </synopsis>
22482 </function>
22483 </construct>
22484 <construct id="struct-argp" type="struct">
22485 <structure>
22486 <synopsis>
22487 This structure specifies how to parse a given set of options and
22488 arguments, perhaps in conjunction with other argp parsers. It has the
22489 following fields:
22490 &lt;br&gt;&lt;br&gt;
22491 </synopsis>
22492 <elements>
22493 <element content="const struct argp_option *options">
22494 <synopsis>
22495 A pointer to a vector of &lt;CODE&gt;argp_option&lt;/CODE&gt; structures specifying which
22496 options this argp parser understands; it may be zero if there are no
22497 options at all. .
22498 &lt;br&gt;&lt;br&gt;
22499 </synopsis>
22500 </element>
22501 <element content="argp_parser_t parser">
22502 <synopsis>
22503 A pointer to a function that defines actions for this parser; it is
22504 called for each option parsed, and at other well-defined points in the
22505 parsing process. A value of zero is the same as a pointer to a function
22506 that always returns &lt;CODE&gt;ARGP_ERR_UNKNOWN&lt;/CODE&gt;. .
22507 &lt;br&gt;&lt;br&gt;
22508 </synopsis>
22509 </element>
22510 <element content="const char *args_doc">
22511 <synopsis>
22512 If non-zero, a string describing what non-option arguments are called by
22513 this parser. This is only used to print the &lt;samp&gt;Usage:&lt;/samp&gt; message. If
22514 it contains newlines, the strings separated by them are considered
22515 alternative usage patterns and printed on separate lines. Lines after
22516 the first are prefixed by &lt;samp&gt; or: &lt;/samp&gt; instead of &lt;samp&gt;Usage:&lt;/samp&gt;.
22517 &lt;br&gt;&lt;br&gt;
22518 </synopsis>
22519 </element>
22520 <element content="const char *doc">
22521 <synopsis>
22522 If non-zero, a string containing extra text to be printed before and
22523 after the options in a long help message, with the two sections
22524 separated by a vertical tab (&lt;CODE&gt;'\v'&lt;/CODE&gt;, &lt;CODE&gt;'\013'&lt;/CODE&gt;) character. By
22525 convention, the documentation before the options is just a short string
22526 explaining what the program does. Documentation printed after the
22527 options describe behavior in more detail.
22528 &lt;br&gt;&lt;br&gt;
22529 </synopsis>
22530 </element>
22531 <element content="const struct argp_child *children">
22532 <synopsis>
22533 A pointer to a vector of &lt;CODE&gt;argp_children&lt;/CODE&gt; structures. This pointer
22534 specifies which additional argp parsers should be combined with this
22535 one. .
22536 &lt;br&gt;&lt;br&gt;
22537 </synopsis>
22538 </element>
22539 <element content="char *(*help_filter)(int &lt;VAR&gt;key&lt;/VAR&gt;, const char *&lt;VAR&gt;text&lt;/VAR&gt;, void *&lt;VAR&gt;input&lt;/VAR&gt;)">
22540 <synopsis>
22541 If non-zero, a pointer to a function that filters the output of help
22542 messages. .
22543 &lt;br&gt;&lt;br&gt;
22544 </synopsis>
22545 </element>
22546 </elements>
22547 </structure>
22548 </construct>
22549 <construct id="struct-argp_option" type="struct">
22550 <structure>
22551 <synopsis>
22552 This structure specifies a single option that an argp parser
22553 understands, as well as how to parse and document that option. It has
22554 the following fields:
22555 &lt;br&gt;&lt;br&gt;
22556 </synopsis>
22557 <elements>
22558 <element content="const char *name">
22559 <synopsis>
22560 The long name for this option, corresponding to the long option
22561 &lt;samp&gt;--&lt;VAR&gt;name&lt;/VAR&gt;&lt;/samp&gt;; this field may be zero if this option &lt;EM&gt;only&lt;/EM&gt;
22562 has a short name. To specify multiple names for an option, additional
22563 entries may follow this one, with the &lt;CODE&gt;OPTION_ALIAS&lt;/CODE&gt; flag
22564 set. .
22565 &lt;br&gt;&lt;br&gt;
22566 </synopsis>
22567 </element>
22568 <element content="int key">
22569 <synopsis>
22570 The integer key provided by the current option to the option parser. If
22571 &lt;VAR&gt;key&lt;/VAR&gt; has a value that is a printable ascii character (i.e.,
22572 &lt;CODE&gt;isascii (&lt;VAR&gt;key&lt;/VAR&gt;)&lt;/CODE&gt; is true), it &lt;EM&gt;also&lt;/EM&gt; specifies a short
22573 option &lt;samp&gt;-&lt;VAR&gt;char&lt;/VAR&gt;&lt;/samp&gt;, where &lt;VAR&gt;char&lt;/VAR&gt; is the ascii character
22574 with the code &lt;VAR&gt;key&lt;/VAR&gt;.
22575 &lt;br&gt;&lt;br&gt;
22576 </synopsis>
22577 </element>
22578 <element content="const char *arg">
22579 <synopsis>
22580 If non-zero, this is the name of an argument associated with this
22581 option, which must be provided (e.g., with the
22582 &lt;samp&gt;--&lt;VAR&gt;name&lt;/VAR&gt;=&lt;VAR&gt;value&lt;/VAR&gt;&lt;/samp&gt; or &lt;samp&gt;-&lt;VAR&gt;char&lt;/VAR&gt; &lt;VAR&gt;value&lt;/VAR&gt;&lt;/samp&gt;
22583 syntaxes), unless the &lt;CODE&gt;OPTION_ARG_OPTIONAL&lt;/CODE&gt; flag is set, in which case it &lt;EM&gt;may&lt;/EM&gt; be provided.
22584 &lt;br&gt;&lt;br&gt;
22585 </synopsis>
22586 </element>
22587 <element content="int flags">
22588 <synopsis>
22589 Flags associated with this option, some of which are referred to above.
22590 .
22591 &lt;br&gt;&lt;br&gt;
22592 </synopsis>
22593 </element>
22594 <element content="const char *doc">
22595 <synopsis>
22596 A documentation string for this option, for printing in help messages.
22597 &lt;br&gt;&lt;br&gt; If both the &lt;CODE&gt;name&lt;/CODE&gt; and &lt;CODE&gt;key&lt;/CODE&gt; fields are zero, this string
22598 will be printed tabbed left from the normal option column, making it
22599 useful as a group header. This will be the first thing printed in its
22600 group. In this usage, it's conventional to end the string with a
22601 &lt;samp&gt;:&lt;/samp&gt; character.
22602 &lt;br&gt;&lt;br&gt;
22603 </synopsis>
22604 </element>
22605 </elements>
22606 </structure>
22607 </construct>
22608 <construct id="function-argp_usage" type="function">
22609 <function returntype="void">
22610 <prototype>
22611 <parameter content="const struct argp_state *state"/>
22612 </prototype>
22613 <headers>
22614 <header filename = "argp.h"/>
22615 </headers>
22616 <synopsis>
22617 Outputs the standard usage message for the argp parser referred to by
22618 &lt;VAR&gt;state&lt;/VAR&gt; to &lt;CODE&gt;&lt;VAR&gt;state&lt;/VAR&gt;-&gt;err_stream&lt;/CODE&gt; and terminate the program
22619 with &lt;CODE&gt;exit (argp_err_exit_status)&lt;/CODE&gt;. .
22620 </synopsis>
22621 </function>
22622 </construct>
22623 <construct id="function-argp_error" type="function">
22624 <function returntype="void">
22625 <prototype>
22626 <parameter content="const struct argp_state *state"/>
22627 <parameter content="const char *fmt"/>
22628 <parameter content="..."/>
22629 </prototype>
22630 <headers>
22631 <header filename = "argp.h"/>
22632 </headers>
22633 <synopsis>
22634 Prints the printf format string &lt;VAR&gt;fmt&lt;/VAR&gt; and following args, preceded
22635 by the program name and &lt;samp&gt;:&lt;/samp&gt;, and followed by a &lt;samp&gt;Try &lt;small&gt;...&lt;/small&gt;
22636 --help&lt;/samp&gt; message, and terminates the program with an exit status of
22637 &lt;CODE&gt;argp_err_exit_status&lt;/CODE&gt;. .
22638 </synopsis>
22639 </function>
22640 </construct>
22641 <construct id="function-argp_failure" type="function">
22642 <function returntype="void">
22643 <prototype>
22644 <parameter content="const struct argp_state *state"/>
22645 <parameter content="int status"/>
22646 <parameter content="int errnum"/>
22647 <parameter content="const char *fmt"/>
22648 <parameter content="..."/>
22649 </prototype>
22650 <headers>
22651 <header filename = "argp.h"/>
22652 </headers>
22653 <synopsis>
22654 Similar to the standard gnu error-reporting function &lt;CODE&gt;error&lt;/CODE&gt;, this
22655 prints the program name and &lt;samp&gt;:&lt;/samp&gt;, the printf format string
22656 &lt;VAR&gt;fmt&lt;/VAR&gt;, and the appropriate following args. If it is non-zero, the
22657 standard unix error text for &lt;VAR&gt;errnum&lt;/VAR&gt; is printed. If &lt;VAR&gt;status&lt;/VAR&gt; is
22658 non-zero, it terminates the program with that value as its exit status.
22659 &lt;br&gt;&lt;br&gt; The difference between &lt;CODE&gt;argp_failure&lt;/CODE&gt; and &lt;CODE&gt;argp_error&lt;/CODE&gt; is that
22660 &lt;CODE&gt;argp_error&lt;/CODE&gt; is for &lt;EM&gt;parsing errors&lt;/EM&gt;, whereas
22661 &lt;CODE&gt;argp_failure&lt;/CODE&gt; is for other problems that occur during parsing but
22662 don't reflect a syntactic problem with the input, such as illegal values
22663 for options, bad phase of the moon, etc.
22664 </synopsis>
22665 </function>
22666 </construct>
22667 <construct id="function-argp_state_help" type="function">
22668 <function returntype="void">
22669 <prototype>
22670 <parameter content="const struct argp_state *state"/>
22671 <parameter content="FILE *stream"/>
22672 <parameter content="unsigned flags"/>
22673 </prototype>
22674 <headers>
22675 <header filename = "argp.h"/>
22676 </headers>
22677 <synopsis>
22678 Outputs a help message for the argp parser referred to by &lt;VAR&gt;state&lt;/VAR&gt;,
22679 to &lt;VAR&gt;stream&lt;/VAR&gt;. The &lt;VAR&gt;flags&lt;/VAR&gt; argument determines what sort of help
22680 message is produced. .
22681 </synopsis>
22682 </function>
22683 </construct>
22684 <construct id="struct-argp_state" type="struct">
22685 <structure>
22686 <synopsis>
22687 This structure has the following fields, which may be modified as noted:
22688 &lt;br&gt;&lt;br&gt;
22689 </synopsis>
22690 <elements>
22691 <element content="const struct argp *const root_argp">
22692 <synopsis>
22693 The top level argp parser being parsed. Note that this is often
22694 &lt;EM&gt;not&lt;/EM&gt; the same &lt;CODE&gt;struct argp&lt;/CODE&gt; passed into &lt;CODE&gt;argp_parse&lt;/CODE&gt; by
22695 the invoking program. . It is an internal argp parser that
22696 contains options implemented by &lt;CODE&gt;argp_parse&lt;/CODE&gt; itself, such as
22697 &lt;samp&gt;--help&lt;/samp&gt;.
22698 &lt;br&gt;&lt;br&gt;
22699 </synopsis>
22700 </element>
22701 <element content="int argc">
22702 </element>
22703 <element content="&lt;LI&gt;x char **argv">
22704 <synopsis>
22705 The argument vector being parsed. This may be modified.
22706 &lt;br&gt;&lt;br&gt;
22707 </synopsis>
22708 </element>
22709 <element content="int next">
22710 <synopsis>
22711 The index in &lt;CODE&gt;argv&lt;/CODE&gt; of the next argument to be parsed. This may be
22712 modified.
22713 &lt;br&gt;&lt;br&gt; One way to consume all remaining arguments in the input is to set
22714 &lt;CODE&gt;&lt;VAR&gt;state&lt;/VAR&gt;-&gt;next = &lt;VAR&gt;state&lt;/VAR&gt;-&gt;argc&lt;/CODE&gt;, perhaps after recording
22715 the value of the &lt;CODE&gt;next&lt;/CODE&gt; field to find the consumed arguments. The
22716 current option can be re-parsed immediately by decrementing this field,
22717 then modifying &lt;CODE&gt;&lt;VAR&gt;state&lt;/VAR&gt;-&gt;argv[&lt;VAR&gt;state&lt;/VAR&gt;-&gt;next]&lt;/CODE&gt; to reflect
22718 the option that should be reexamined.
22719 &lt;br&gt;&lt;br&gt;
22720 </synopsis>
22721 </element>
22722 <element content="unsigned flags">
22723 <synopsis>
22724 The flags supplied to &lt;CODE&gt;argp_parse&lt;/CODE&gt;. These may be modified, although
22725 some flags may only take effect when &lt;CODE&gt;argp_parse&lt;/CODE&gt; is first
22726 invoked. .
22727 &lt;br&gt;&lt;br&gt;
22728 </synopsis>
22729 </element>
22730 <element content="unsigned arg_num">
22731 <synopsis>
22732 While calling a parsing function with the &lt;VAR&gt;key&lt;/VAR&gt; argument
22733 &lt;CODE&gt;ARGP_KEY_ARG&lt;/CODE&gt;, this represents the number of the current arg,
22734 starting at 0. It is incremented after each &lt;CODE&gt;ARGP_KEY_ARG&lt;/CODE&gt; call
22735 returns. At all other times, this is the number of &lt;CODE&gt;ARGP_KEY_ARG&lt;/CODE&gt;
22736 arguments that have been processed.
22737 &lt;br&gt;&lt;br&gt;
22738 </synopsis>
22739 </element>
22740 <element content="int quoted">
22741 <synopsis>
22742 If non-zero, the index in &lt;CODE&gt;argv&lt;/CODE&gt; of the first argument following a
22743 special &lt;samp&gt;--&lt;/samp&gt; argument. This prevents anything that follows from
22744 being interpreted as an option. It is only set after argument parsing
22745 has proceeded past this point.
22746 &lt;br&gt;&lt;br&gt;
22747 </synopsis>
22748 </element>
22749 <element content="void *input">
22750 <synopsis>
22751 An arbitrary pointer passed in from the caller of &lt;CODE&gt;argp_parse&lt;/CODE&gt;, in
22752 the &lt;VAR&gt;input&lt;/VAR&gt; argument.
22753 &lt;br&gt;&lt;br&gt;
22754 </synopsis>
22755 </element>
22756 <element content="void **child_inputs">
22757 <synopsis>
22758 These are values that will be passed to child parsers. This vector will
22759 be the same length as the number of children in the current parser. Each
22760 child parser will be given the value of
22761 &lt;CODE&gt;&lt;VAR&gt;state&lt;/VAR&gt;-&gt;child_inputs[&lt;VAR&gt;i&lt;/VAR&gt;]&lt;/CODE&gt; as &lt;EM&gt;its&lt;/EM&gt;
22762 &lt;CODE&gt;&lt;VAR&gt;state&lt;/VAR&gt;-&gt;input&lt;/CODE&gt; field, where &lt;VAR&gt;i&lt;/VAR&gt; is the index of the child
22763 in the this parser's &lt;CODE&gt;children&lt;/CODE&gt; field. .
22764 &lt;br&gt;&lt;br&gt;
22765 </synopsis>
22766 </element>
22767 <element content="void *hook">
22768 <synopsis>
22769 For the parser function's use. Initialized to 0, but otherwise ignored
22770 by argp.
22771 &lt;br&gt;&lt;br&gt;
22772 </synopsis>
22773 </element>
22774 <element content="char *name">
22775 <synopsis>
22776 The name used when printing messages. This is initialized to
22777 &lt;CODE&gt;argv[0]&lt;/CODE&gt;, or &lt;CODE&gt;program_invocation_name&lt;/CODE&gt; if &lt;CODE&gt;argv[0]&lt;/CODE&gt; is
22778 unavailable.
22779 &lt;br&gt;&lt;br&gt;
22780 </synopsis>
22781 </element>
22782 <element content="FILE *err_stream">
22783 </element>
22784 <element content="&lt;LI&gt;x FILE *out_stream">
22785 <synopsis>
22786 The stdio streams used when argp prints. Error messages are printed to
22787 &lt;CODE&gt;err_stream&lt;/CODE&gt;, all other output, such as &lt;samp&gt;--help&lt;/samp&gt; output) to
22788 &lt;CODE&gt;out_stream&lt;/CODE&gt;. These are initialized to &lt;CODE&gt;stderr&lt;/CODE&gt; and
22789 &lt;CODE&gt;stdout&lt;/CODE&gt; respectively. .
22790 &lt;br&gt;&lt;br&gt;
22791 </synopsis>
22792 </element>
22793 </elements>
22794 </structure>
22795 </construct>
22796 <construct id="struct-argp_child" type="struct">
22797 <structure>
22798 <synopsis>
22799 An entry in the list of subsidiary argp parsers pointed to by the
22800 &lt;CODE&gt;children&lt;/CODE&gt; field in a &lt;CODE&gt;struct argp&lt;/CODE&gt;. The fields are as
22801 follows:
22802 &lt;br&gt;&lt;br&gt;
22803 </synopsis>
22804 <elements>
22805 <element content="const struct argp *argp">
22806 <synopsis>
22807 The child argp parser, or zero to end of the list.
22808 &lt;br&gt;&lt;br&gt;
22809 </synopsis>
22810 </element>
22811 <element content="int flags">
22812 <synopsis>
22813 Flags for this child.
22814 &lt;br&gt;&lt;br&gt;
22815 </synopsis>
22816 </element>
22817 <element content="const char *header">
22818 <synopsis>
22819 If non-zero, this is an optional header to be printed within help output
22820 before the child options. As a side-effect, a non-zero value forces the
22821 child options to be grouped together. To achieve this effect without
22822 actually printing a header string, use a value of &lt;CODE&gt;""&lt;/CODE&gt;. As with
22823 header strings specified in an option entry, the conventional value of
22824 the last character is &lt;samp&gt;:&lt;/samp&gt;. .
22825 &lt;br&gt;&lt;br&gt;
22826 </synopsis>
22827 </element>
22828 </elements>
22829 </structure>
22830 </construct>
22831 <construct id="function-argp_help" type="function">
22832 <function returntype="void">
22833 <prototype>
22834 <parameter content="const struct argp *argp"/>
22835 <parameter content="FILE *stream"/>
22836 <parameter content="unsigned flags"/>
22837 <parameter content="char *name"/>
22838 </prototype>
22839 <headers>
22840 <header filename = "argp.h"/>
22841 </headers>
22842 <synopsis>
22843 This outputs a help message for the argp parser &lt;VAR&gt;argp&lt;/VAR&gt; to
22844 &lt;VAR&gt;stream&lt;/VAR&gt;. The type of messages printed will be determined by
22845 &lt;VAR&gt;flags&lt;/VAR&gt;.
22846 &lt;br&gt;&lt;br&gt; Any options such as &lt;samp&gt;--help&lt;/samp&gt; that are implemented automatically by
22847 argp itself will &lt;EM&gt;not&lt;/EM&gt; be present in the help output; for this
22848 reason it is best to use &lt;CODE&gt;argp_state_help&lt;/CODE&gt; if calling from within
22849 an argp parser function. .
22850 </synopsis>
22851 </function>
22852 </construct>
22853 <construct id="function-malloc" type="function">
22854 <function returntype="void *">
22855 <prototype>
22856 <parameter content="size_t size"/>
22857 </prototype>
22858 <headers>
22859 <header filename = "stdlib.h"/>
22860 </headers>
22861 <synopsis>
22862 This function returns a pointer to a newly allocated block &lt;VAR&gt;size&lt;/VAR&gt;
22863 bytes long, or a null pointer if the block could not be allocated.
22864 </synopsis>
22865 </function>
22866 </construct>
22867 <construct id="function-free" type="function">
22868 <function returntype="void">
22869 <prototype>
22870 <parameter content="void *ptr"/>
22871 </prototype>
22872 <headers>
22873 <header filename = "stdlib.h"/>
22874 </headers>
22875 <synopsis>
22876 The &lt;CODE&gt;free&lt;/CODE&gt; function deallocates the block of memory pointed at
22877 by &lt;VAR&gt;ptr&lt;/VAR&gt;.
22878 </synopsis>
22879 </function>
22880 </construct>
22881 <construct id="function-cfree" type="function">
22882 <function returntype="void">
22883 <prototype>
22884 <parameter content="void *ptr"/>
22885 </prototype>
22886 <headers>
22887 <header filename = "stdlib.h"/>
22888 </headers>
22889 <synopsis>
22890 This function does the same thing as &lt;CODE&gt;free&lt;/CODE&gt;. It's provided for
22891 backward compatibility with SunOS; you should use &lt;CODE&gt;free&lt;/CODE&gt; instead.
22892 </synopsis>
22893 </function>
22894 </construct>
22895 <construct id="function-realloc" type="function">
22896 <function returntype="void *">
22897 <prototype>
22898 <parameter content="void *ptr"/>
22899 <parameter content="size_t newsize"/>
22900 </prototype>
22901 <headers>
22902 <header filename = "stdlib.h"/>
22903 </headers>
22904 <synopsis>
22905 The &lt;CODE&gt;realloc&lt;/CODE&gt; function changes the size of the block whose address is
22906 &lt;VAR&gt;ptr&lt;/VAR&gt; to be &lt;VAR&gt;newsize&lt;/VAR&gt;.
22907 &lt;br&gt;&lt;br&gt; Since the space after the end of the block may be in use, &lt;CODE&gt;realloc&lt;/CODE&gt;
22908 may find it necessary to copy the block to a new address where more free
22909 space is available. The value of &lt;CODE&gt;realloc&lt;/CODE&gt; is the new address of the
22910 block. If the block needs to be moved, &lt;CODE&gt;realloc&lt;/CODE&gt; copies the old
22911 contents.
22912 &lt;br&gt;&lt;br&gt; If you pass a null pointer for &lt;VAR&gt;ptr&lt;/VAR&gt;, &lt;CODE&gt;realloc&lt;/CODE&gt; behaves just
22913 like &lt;samp&gt;malloc (&lt;VAR&gt;newsize&lt;/VAR&gt;)&lt;/samp&gt;. This can be convenient, but beware
22914 that older implementations (before ISO C) may not support this
22915 behavior, and will probably crash when &lt;CODE&gt;realloc&lt;/CODE&gt; is passed a null
22916 pointer.
22917 </synopsis>
22918 </function>
22919 </construct>
22920 <construct id="function-calloc" type="function">
22921 <function returntype="void *">
22922 <prototype>
22923 <parameter content="size_t count"/>
22924 <parameter content="size_t eltsize"/>
22925 </prototype>
22926 <headers>
22927 <header filename = "stdlib.h"/>
22928 </headers>
22929 <synopsis>
22930 This function allocates a block long enough to contain a vector of
22931 &lt;VAR&gt;count&lt;/VAR&gt; elements, each of size &lt;VAR&gt;eltsize&lt;/VAR&gt;. Its contents are
22932 cleared to zero before &lt;CODE&gt;calloc&lt;/CODE&gt; returns.
22933 </synopsis>
22934 </function>
22935 </construct>
22936 <construct id="function-memalign" type="function">
22937 <function returntype="void *">
22938 <prototype>
22939 <parameter content="size_t boundary"/>
22940 <parameter content="size_t size"/>
22941 </prototype>
22942 <headers>
22943 <header filename = "malloc.h"/>
22944 </headers>
22945 <synopsis>
22946 The &lt;CODE&gt;memalign&lt;/CODE&gt; function allocates a block of &lt;VAR&gt;size&lt;/VAR&gt; bytes whose
22947 address is a multiple of &lt;VAR&gt;boundary&lt;/VAR&gt;. The &lt;VAR&gt;boundary&lt;/VAR&gt; must be a
22948 power of two! The function &lt;CODE&gt;memalign&lt;/CODE&gt; works by allocating a
22949 somewhat larger block, and then returning an address within the block
22950 that is on the specified boundary.
22951 </synopsis>
22952 </function>
22953 </construct>
22954 <construct id="function-posix_memalign" type="function">
22955 <function returntype="int">
22956 <prototype>
22957 <parameter content="void **memptr"/>
22958 <parameter content="size_t alignment"/>
22959 <parameter content="size_t size"/>
22960 </prototype>
22961 <headers>
22962 <header filename = "stdlib.h"/>
22963 </headers>
22964 <synopsis>
22965 The &lt;CODE&gt;posix_memalign&lt;/CODE&gt; function is similar to the &lt;CODE&gt;memalign&lt;/CODE&gt;
22966 function in that it returns a buffer of &lt;VAR&gt;size&lt;/VAR&gt; bytes aligned to a
22967 multiple of &lt;VAR&gt;alignment&lt;/VAR&gt;. But it adds one requirement to the
22968 parameter &lt;VAR&gt;alignment&lt;/VAR&gt;: the value must be a power of two multiple of
22969 &lt;CODE&gt;sizeof (void *)&lt;/CODE&gt;.
22970 &lt;br&gt;&lt;br&gt; If the function succeeds in allocation memory a pointer to the allocated
22971 memory is returned in &lt;CODE&gt;*&lt;VAR&gt;memptr&lt;/VAR&gt;&lt;/CODE&gt; and the return value is zero.
22972 Otherwise the function returns an error value indicating the problem.
22973 &lt;br&gt;&lt;br&gt; This function was introduced in POSIX 1003.1d.
22974 </synopsis>
22975 </function>
22976 </construct>
22977 <construct id="function-valloc" type="function">
22978 <function returntype="void *">
22979 <prototype>
22980 <parameter content="size_t size"/>
22981 </prototype>
22982 <headers>
22983 <header filename = "stdlib.h"/>
22984 </headers>
22985 <synopsis>
22986 Using &lt;CODE&gt;valloc&lt;/CODE&gt; is like using &lt;CODE&gt;memalign&lt;/CODE&gt; and passing the page size
22987 as the value of the second argument. It is implemented like this:
22988 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
22989 void *&lt;br&gt;
22990 valloc (size_t size)&lt;br&gt;
22991 {&lt;br&gt;
22992 return memalign (getpagesize (), size);&lt;br&gt;
22993 }&lt;br&gt;
22994 &lt;/pre&gt;
22995 &lt;br&gt;&lt;br&gt; Query Memory Parameters for more information about the memory
22996 subsystem.
22997 </synopsis>
22998 </function>
22999 </construct>
23000 <construct id="function-mallopt" type="function">
23001 <function returntype="int">
23002 <prototype>
23003 <parameter content="int param"/>
23004 <parameter content="int value"/>
23005 </prototype>
23006 <synopsis>
23007 When calling &lt;CODE&gt;mallopt&lt;/CODE&gt;, the &lt;VAR&gt;param&lt;/VAR&gt; argument specifies the
23008 parameter to be set, and &lt;VAR&gt;value&lt;/VAR&gt; the new value to be set. Possible
23009 choices for &lt;VAR&gt;param&lt;/VAR&gt;, as defined in &lt;TT&gt;malloc.h&lt;/TT&gt;, are:
23010 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
23011
23012 &lt;DT&gt;&lt;CODE&gt;M_TRIM_THRESHOLD&lt;/CODE&gt;
23013 &lt;DD&gt;
23014 This is the minimum size (in bytes) of the top-most, releasable chunk
23015 that will cause &lt;CODE&gt;sbrk&lt;/CODE&gt; to be called with a negative argument in
23016 order to return memory to the system.
23017 &lt;LI&gt; M_TOP_PAD
23018 This parameter determines the amount of extra memory to obtain from the
23019 system when a call to &lt;CODE&gt;sbrk&lt;/CODE&gt; is required. It also specifies the
23020 number of bytes to retain when shrinking the heap by calling &lt;CODE&gt;sbrk&lt;/CODE&gt;
23021 with a negative argument. This provides the necessary hysteresis in
23022 heap size such that excessive amounts of system calls can be avoided.
23023 &lt;LI&gt; M_MMAP_THRESHOLD
23024 All chunks larger than this value are allocated outside the normal
23025 heap, using the &lt;CODE&gt;mmap&lt;/CODE&gt; system call. This way it is guaranteed
23026 that the memory for these chunks can be returned to the system on
23027 &lt;CODE&gt;free&lt;/CODE&gt;. Note that requests smaller than this threshold might still
23028 be allocated via &lt;CODE&gt;mmap&lt;/CODE&gt;.
23029 &lt;LI&gt; M_MMAP_MAX
23030 The maximum number of chunks to allocate with &lt;CODE&gt;mmap&lt;/CODE&gt;. Setting this
23031 to zero disables all use of &lt;CODE&gt;mmap&lt;/CODE&gt;.
23032 &lt;LI&gt; M_PERTURB
23033 If non-zero, memory blocks are filled with values depending on some
23034 low order bits of this parameter when they are allocated (except when
23035 allocated by &lt;CODE&gt;calloc&lt;/CODE&gt;) and freed. This can be used to debug the
23036 use of uninitialized or freed heap memory.
23037
23038 &lt;br&gt;&lt;br&gt;
23039 </synopsis>
23040 </function>
23041 </construct>
23042 <construct id="function-mcheck" type="function">
23043 <function returntype="int">
23044 <prototype>
23045 <parameter content="void (*abortfn) (enum mcheck_status status)"/>
23046 </prototype>
23047 <headers>
23048 <header filename = "mcheck.h"/>
23049 </headers>
23050 <synopsis>
23051 Calling &lt;CODE&gt;mcheck&lt;/CODE&gt; tells &lt;CODE&gt;malloc&lt;/CODE&gt; to perform occasional
23052 consistency checks. These will catch things such as writing
23053 past the end of a block that was allocated with &lt;CODE&gt;malloc&lt;/CODE&gt;.
23054 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;abortfn&lt;/VAR&gt; argument is the function to call when an inconsistency
23055 is found. If you supply a null pointer, then &lt;CODE&gt;mcheck&lt;/CODE&gt; uses a
23056 default function which prints a message and calls &lt;CODE&gt;abort&lt;/CODE&gt;
23057 . The function you supply is called with
23058 one argument, which says what sort of inconsistency was detected; its
23059 type is described below.
23060 &lt;br&gt;&lt;br&gt; It is too late to begin allocation checking once you have allocated
23061 anything with &lt;CODE&gt;malloc&lt;/CODE&gt;. So &lt;CODE&gt;mcheck&lt;/CODE&gt; does nothing in that
23062 case. The function returns &lt;CODE&gt;-1&lt;/CODE&gt; if you call it too late, and
23063 &lt;CODE&gt;0&lt;/CODE&gt; otherwise (when it is successful).
23064 &lt;br&gt;&lt;br&gt; The easiest way to arrange to call &lt;CODE&gt;mcheck&lt;/CODE&gt; early enough is to use
23065 the option &lt;samp&gt;-lmcheck&lt;/samp&gt; when you link your program; then you don't
23066 need to modify your program source at all. Alternatively you might use
23067 a debugger to insert a call to &lt;CODE&gt;mcheck&lt;/CODE&gt; whenever the program is
23068 started, for example these gdb commands will automatically call &lt;CODE&gt;mcheck&lt;/CODE&gt;
23069 whenever the program starts:
23070 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
23071 (gdb) break main&lt;br&gt;
23072 Breakpoint 1, main (argc=2, argv=0xbffff964) at whatever.c:10&lt;br&gt;
23073 (gdb) command 1&lt;br&gt;
23074 Type commands for when breakpoint 1 is hit, one per line.&lt;br&gt;
23075 End with a line saying just "end".&lt;br&gt;
23076 &gt;call mcheck(0)&lt;br&gt;
23077 &gt;continue&lt;br&gt;
23078 &gt;end&lt;br&gt;
23079 (gdb) &lt;small&gt;...&lt;/small&gt;&lt;br&gt;
23080 &lt;/pre&gt;
23081 &lt;br&gt;&lt;br&gt; This will however only work if no initialization function of any object
23082 involved calls any of the &lt;CODE&gt;malloc&lt;/CODE&gt; functions since &lt;CODE&gt;mcheck&lt;/CODE&gt;
23083 must be called before the first such function.
23084 &lt;br&gt;&lt;br&gt;
23085 </synopsis>
23086 </function>
23087 </construct>
23088 <construct id="function-mprobe" type="function">
23089 <function returntype="enum mcheck_status">
23090 <prototype>
23091 <parameter content="void *pointer"/>
23092 </prototype>
23093 <synopsis>
23094 The &lt;CODE&gt;mprobe&lt;/CODE&gt; function lets you explicitly check for inconsistencies
23095 in a particular allocated block. You must have already called
23096 &lt;CODE&gt;mcheck&lt;/CODE&gt; at the beginning of the program, to do its occasional
23097 checks; calling &lt;CODE&gt;mprobe&lt;/CODE&gt; requests an additional consistency check
23098 to be done at the time of the call.
23099 &lt;br&gt;&lt;br&gt; The argument &lt;VAR&gt;pointer&lt;/VAR&gt; must be a pointer returned by &lt;CODE&gt;malloc&lt;/CODE&gt;
23100 or &lt;CODE&gt;realloc&lt;/CODE&gt;. &lt;CODE&gt;mprobe&lt;/CODE&gt; returns a value that says what
23101 inconsistency, if any, was found. The values are described below.
23102 </synopsis>
23103 </function>
23104 </construct>
23105 <construct id="enum-mcheck_status" type="enum">
23106 <structure>
23107 <synopsis>
23108 This enumerated type describes what kind of inconsistency was detected
23109 in an allocated block, if any. Here are the possible values:
23110 &lt;br&gt;&lt;br&gt;
23111 </synopsis>
23112 <elements>
23113 <element content="MCHECK_DISABLED">
23114 <synopsis>
23115 &lt;CODE&gt;mcheck&lt;/CODE&gt; was not called before the first allocation.
23116 No consistency checking can be done.
23117 </synopsis>
23118 </element>
23119 <element content="MCHECK_OK">
23120 <synopsis>
23121 No inconsistency detected.
23122 </synopsis>
23123 </element>
23124 <element content="MCHECK_HEAD">
23125 <synopsis>
23126 The data immediately before the block was modified.
23127 This commonly happens when an array index or pointer
23128 is decremented too far.
23129 </synopsis>
23130 </element>
23131 <element content="MCHECK_TAIL">
23132 <synopsis>
23133 The data immediately after the block was modified.
23134 This commonly happens when an array index or pointer
23135 is incremented too far.
23136 </synopsis>
23137 </element>
23138 </elements>
23139 </structure>
23140 </construct>
23141 <construct id="struct-mallinfo" type="struct">
23142 <structure>
23143 <synopsis>
23144 This structure type is used to return information about the dynamic
23145 memory allocator. It contains the following members:
23146 &lt;br&gt;&lt;br&gt;
23147 </synopsis>
23148 <elements>
23149 <element content="int arena">
23150 <synopsis>
23151 This is the total size of memory allocated with &lt;CODE&gt;sbrk&lt;/CODE&gt; by
23152 &lt;CODE&gt;malloc&lt;/CODE&gt;, in bytes.
23153 &lt;br&gt;&lt;br&gt;
23154 </synopsis>
23155 </element>
23156 <element content="int ordblks">
23157 <synopsis>
23158 This is the number of chunks not in use. (The memory allocator
23159 internally gets chunks of memory from the operating system, and then
23160 carves them up to satisfy individual &lt;CODE&gt;malloc&lt;/CODE&gt; requests; see
23161 Efficiency and Malloc.)
23162 &lt;br&gt;&lt;br&gt;
23163 </synopsis>
23164 </element>
23165 <element content="int smblks">
23166 <synopsis>
23167 This field is unused.
23168 &lt;br&gt;&lt;br&gt;
23169 </synopsis>
23170 </element>
23171 <element content="int hblks">
23172 <synopsis>
23173 This is the total number of chunks allocated with &lt;CODE&gt;mmap&lt;/CODE&gt;.
23174 &lt;br&gt;&lt;br&gt;
23175 </synopsis>
23176 </element>
23177 <element content="int hblkhd">
23178 <synopsis>
23179 This is the total size of memory allocated with &lt;CODE&gt;mmap&lt;/CODE&gt;, in bytes.
23180 &lt;br&gt;&lt;br&gt;
23181 </synopsis>
23182 </element>
23183 <element content="int usmblks">
23184 <synopsis>
23185 This field is unused.
23186 &lt;br&gt;&lt;br&gt;
23187 </synopsis>
23188 </element>
23189 <element content="int fsmblks">
23190 <synopsis>
23191 This field is unused.
23192 &lt;br&gt;&lt;br&gt;
23193 </synopsis>
23194 </element>
23195 <element content="int uordblks">
23196 <synopsis>
23197 This is the total size of memory occupied by chunks handed out by
23198 &lt;CODE&gt;malloc&lt;/CODE&gt;.
23199 &lt;br&gt;&lt;br&gt;
23200 </synopsis>
23201 </element>
23202 <element content="int fordblks">
23203 <synopsis>
23204 This is the total size of memory occupied by free (not in use) chunks.
23205 &lt;br&gt;&lt;br&gt;
23206 </synopsis>
23207 </element>
23208 </elements>
23209 </structure>
23210 </construct>
23211 <construct id="function-mallinfo" type="function">
23212 <function returntype="struct mallinfo">
23213 <prototype>
23214 <parameter content="void"/>
23215 </prototype>
23216 <headers>
23217 <header filename = "malloc.h"/>
23218 </headers>
23219 <synopsis>
23220 This function returns information about the current dynamic memory usage
23221 in a structure of type &lt;CODE&gt;struct mallinfo&lt;/CODE&gt;.
23222 </synopsis>
23223 </function>
23224 </construct>
23225 <construct id="function-mtrace" type="function">
23226 <function returntype="void">
23227 <prototype>
23228 <parameter content="void"/>
23229 </prototype>
23230 <headers>
23231 <header filename = "mcheck.h"/>
23232 </headers>
23233 <synopsis>
23234 When the &lt;CODE&gt;mtrace&lt;/CODE&gt; function is called it looks for an environment
23235 variable named &lt;CODE&gt;MALLOC_TRACE&lt;/CODE&gt;. This variable is supposed to
23236 contain a valid file name. The user must have write access. If the
23237 file already exists it is truncated. If the environment variable is not
23238 set or it does not name a valid file which can be opened for writing
23239 nothing is done. The behavior of &lt;CODE&gt;malloc&lt;/CODE&gt; etc. is not changed.
23240 For obvious reasons this also happens if the application is installed
23241 with the SUID or SGID bit set.
23242 &lt;br&gt;&lt;br&gt; If the named file is successfully opened, &lt;CODE&gt;mtrace&lt;/CODE&gt; installs special
23243 handlers for the functions &lt;CODE&gt;malloc&lt;/CODE&gt;, &lt;CODE&gt;realloc&lt;/CODE&gt;, and
23244 &lt;CODE&gt;free&lt;/CODE&gt; . From then on, all uses of these
23245 functions are traced and protocolled into the file. There is now of
23246 course a speed penalty for all calls to the traced functions so tracing
23247 should not be enabled during normal use.
23248 &lt;br&gt;&lt;br&gt; This function is a GNU extension and generally not available on other
23249 systems. The prototype can be found in &lt;TT&gt;mcheck.h&lt;/TT&gt;.
23250 </synopsis>
23251 </function>
23252 </construct>
23253 <construct id="function-muntrace" type="function">
23254 <function returntype="void">
23255 <prototype>
23256 <parameter content="void"/>
23257 </prototype>
23258 <headers>
23259 <header filename = "mcheck.h"/>
23260 </headers>
23261 <synopsis>
23262 The &lt;CODE&gt;muntrace&lt;/CODE&gt; function can be called after &lt;CODE&gt;mtrace&lt;/CODE&gt; was used
23263 to enable tracing the &lt;CODE&gt;malloc&lt;/CODE&gt; calls. If no (successful) call of
23264 &lt;CODE&gt;mtrace&lt;/CODE&gt; was made &lt;CODE&gt;muntrace&lt;/CODE&gt; does nothing.
23265 &lt;br&gt;&lt;br&gt; Otherwise it deinstalls the handlers for &lt;CODE&gt;malloc&lt;/CODE&gt;, &lt;CODE&gt;realloc&lt;/CODE&gt;,
23266 and &lt;CODE&gt;free&lt;/CODE&gt; and then closes the protocol file. No calls are
23267 protocolled anymore and the program runs again at full speed.
23268 &lt;br&gt;&lt;br&gt; This function is a GNU extension and generally not available on other
23269 systems. The prototype can be found in &lt;TT&gt;mcheck.h&lt;/TT&gt;.
23270 </synopsis>
23271 </function>
23272 </construct>
23273 <construct id="struct-obstack" type="struct">
23274 <structure>
23275 </structure>
23276 </construct>
23277 <construct id="function-obstack_init" type="function">
23278 <function returntype="int">
23279 <prototype>
23280 <parameter content="struct obstack *obstack-ptr"/>
23281 </prototype>
23282 <headers>
23283 <header filename = "obstack.h"/>
23284 </headers>
23285 <synopsis>
23286 Initialize obstack &lt;VAR&gt;obstack-ptr&lt;/VAR&gt; for allocation of objects. This
23287 function calls the obstack's &lt;CODE&gt;obstack_chunk_alloc&lt;/CODE&gt; function. If
23288 allocation of memory fails, the function pointed to by
23289 &lt;CODE&gt;obstack_alloc_failed_handler&lt;/CODE&gt; is called. The &lt;CODE&gt;obstack_init&lt;/CODE&gt;
23290 function always returns 1 (Compatibility notice: Former versions of
23291 obstack returned 0 if allocation failed).
23292 </synopsis>
23293 </function>
23294 </construct>
23295 <construct id="function-obstack_alloc" type="function">
23296 <function returntype="void *">
23297 <prototype>
23298 <parameter content="struct obstack *obstack-ptr"/>
23299 <parameter content="int size"/>
23300 </prototype>
23301 <headers>
23302 <header filename = "obstack.h"/>
23303 </headers>
23304 <synopsis>
23305 This allocates an uninitialized block of &lt;VAR&gt;size&lt;/VAR&gt; bytes in an obstack
23306 and returns its address. Here &lt;VAR&gt;obstack-ptr&lt;/VAR&gt; specifies which obstack
23307 to allocate the block in; it is the address of the &lt;CODE&gt;struct obstack&lt;/CODE&gt;
23308 object which represents the obstack. Each obstack function or macro
23309 requires you to specify an &lt;VAR&gt;obstack-ptr&lt;/VAR&gt; as the first argument.
23310 &lt;br&gt;&lt;br&gt; This function calls the obstack's &lt;CODE&gt;obstack_chunk_alloc&lt;/CODE&gt; function if
23311 it needs to allocate a new chunk of memory; it calls
23312 &lt;CODE&gt;obstack_alloc_failed_handler&lt;/CODE&gt; if allocation of memory by
23313 &lt;CODE&gt;obstack_chunk_alloc&lt;/CODE&gt; failed.
23314 </synopsis>
23315 </function>
23316 </construct>
23317 <construct id="function-obstack_copy" type="function">
23318 <function returntype="void *">
23319 <prototype>
23320 <parameter content="struct obstack *obstack-ptr"/>
23321 <parameter content="void *address"/>
23322 <parameter content="int size"/>
23323 </prototype>
23324 <headers>
23325 <header filename = "obstack.h"/>
23326 </headers>
23327 <synopsis>
23328 This allocates a block and initializes it by copying &lt;VAR&gt;size&lt;/VAR&gt;
23329 bytes of data starting at &lt;VAR&gt;address&lt;/VAR&gt;. It calls
23330 &lt;CODE&gt;obstack_alloc_failed_handler&lt;/CODE&gt; if allocation of memory by
23331 &lt;CODE&gt;obstack_chunk_alloc&lt;/CODE&gt; failed.
23332 </synopsis>
23333 </function>
23334 </construct>
23335 <construct id="function-obstack_copy0" type="function">
23336 <function returntype="void *">
23337 <prototype>
23338 <parameter content="struct obstack *obstack-ptr"/>
23339 <parameter content="void *address"/>
23340 <parameter content="int size"/>
23341 </prototype>
23342 <headers>
23343 <header filename = "obstack.h"/>
23344 </headers>
23345 <synopsis>
23346 Like &lt;CODE&gt;obstack_copy&lt;/CODE&gt;, but appends an extra byte containing a null
23347 character. This extra byte is not counted in the argument &lt;VAR&gt;size&lt;/VAR&gt;.
23348 </synopsis>
23349 </function>
23350 </construct>
23351 <construct id="function-obstack_free" type="function">
23352 <function returntype="void">
23353 <prototype>
23354 <parameter content="struct obstack *obstack-ptr"/>
23355 <parameter content="void *object"/>
23356 </prototype>
23357 <headers>
23358 <header filename = "obstack.h"/>
23359 </headers>
23360 <synopsis>
23361 If &lt;VAR&gt;object&lt;/VAR&gt; is a null pointer, everything allocated in the obstack
23362 is freed. Otherwise, &lt;VAR&gt;object&lt;/VAR&gt; must be the address of an object
23363 allocated in the obstack. Then &lt;VAR&gt;object&lt;/VAR&gt; is freed, along with
23364 everything allocated in &lt;VAR&gt;obstack&lt;/VAR&gt; since &lt;VAR&gt;object&lt;/VAR&gt;.
23365 </synopsis>
23366 </function>
23367 </construct>
23368 <construct id="function-obstack_blank" type="function">
23369 <function returntype="void">
23370 <prototype>
23371 <parameter content="struct obstack *obstack-ptr"/>
23372 <parameter content="int size"/>
23373 </prototype>
23374 <headers>
23375 <header filename = "obstack.h"/>
23376 </headers>
23377 <synopsis>
23378 The most basic function for adding to a growing object is
23379 &lt;CODE&gt;obstack_blank&lt;/CODE&gt;, which adds space without initializing it.
23380 </synopsis>
23381 </function>
23382 </construct>
23383 <construct id="function-obstack_grow" type="function">
23384 <function returntype="void">
23385 <prototype>
23386 <parameter content="struct obstack *obstack-ptr"/>
23387 <parameter content="void *data"/>
23388 <parameter content="int size"/>
23389 </prototype>
23390 <headers>
23391 <header filename = "obstack.h"/>
23392 </headers>
23393 <synopsis>
23394 To add a block of initialized space, use &lt;CODE&gt;obstack_grow&lt;/CODE&gt;, which is
23395 the growing-object analogue of &lt;CODE&gt;obstack_copy&lt;/CODE&gt;. It adds &lt;VAR&gt;size&lt;/VAR&gt;
23396 bytes of data to the growing object, copying the contents from
23397 &lt;VAR&gt;data&lt;/VAR&gt;.
23398 </synopsis>
23399 </function>
23400 </construct>
23401 <construct id="function-obstack_grow0" type="function">
23402 <function returntype="void">
23403 <prototype>
23404 <parameter content="struct obstack *obstack-ptr"/>
23405 <parameter content="void *data"/>
23406 <parameter content="int size"/>
23407 </prototype>
23408 <headers>
23409 <header filename = "obstack.h"/>
23410 </headers>
23411 <synopsis>
23412 This is the growing-object analogue of &lt;CODE&gt;obstack_copy0&lt;/CODE&gt;. It adds
23413 &lt;VAR&gt;size&lt;/VAR&gt; bytes copied from &lt;VAR&gt;data&lt;/VAR&gt;, followed by an additional null
23414 character.
23415 </synopsis>
23416 </function>
23417 </construct>
23418 <construct id="function-obstack_1grow" type="function">
23419 <function returntype="void">
23420 <prototype>
23421 <parameter content="struct obstack *obstack-ptr"/>
23422 <parameter content="char c"/>
23423 </prototype>
23424 <headers>
23425 <header filename = "obstack.h"/>
23426 </headers>
23427 <synopsis>
23428 To add one character at a time, use the function &lt;CODE&gt;obstack_1grow&lt;/CODE&gt;.
23429 It adds a single byte containing &lt;VAR&gt;c&lt;/VAR&gt; to the growing object.
23430 </synopsis>
23431 </function>
23432 </construct>
23433 <construct id="function-obstack_ptr_grow" type="function">
23434 <function returntype="void">
23435 <prototype>
23436 <parameter content="struct obstack *obstack-ptr"/>
23437 <parameter content="void *data"/>
23438 </prototype>
23439 <headers>
23440 <header filename = "obstack.h"/>
23441 </headers>
23442 <synopsis>
23443 Adding the value of a pointer one can use the function
23444 &lt;CODE&gt;obstack_ptr_grow&lt;/CODE&gt;. It adds &lt;CODE&gt;sizeof (void *)&lt;/CODE&gt; bytes
23445 containing the value of &lt;VAR&gt;data&lt;/VAR&gt;.
23446 </synopsis>
23447 </function>
23448 </construct>
23449 <construct id="function-obstack_int_grow" type="function">
23450 <function returntype="void">
23451 <prototype>
23452 <parameter content="struct obstack *obstack-ptr"/>
23453 <parameter content="int data"/>
23454 </prototype>
23455 <headers>
23456 <header filename = "obstack.h"/>
23457 </headers>
23458 <synopsis>
23459 A single value of type &lt;CODE&gt;int&lt;/CODE&gt; can be added by using the
23460 &lt;CODE&gt;obstack_int_grow&lt;/CODE&gt; function. It adds &lt;CODE&gt;sizeof (int)&lt;/CODE&gt; bytes to
23461 the growing object and initializes them with the value of &lt;VAR&gt;data&lt;/VAR&gt;.
23462 </synopsis>
23463 </function>
23464 </construct>
23465 <construct id="function-obstack_finish" type="function">
23466 <function returntype="void *">
23467 <prototype>
23468 <parameter content="struct obstack *obstack-ptr"/>
23469 </prototype>
23470 <headers>
23471 <header filename = "obstack.h"/>
23472 </headers>
23473 <synopsis>
23474 When you are finished growing the object, use the function
23475 &lt;CODE&gt;obstack_finish&lt;/CODE&gt; to close it off and return its final address.
23476 &lt;br&gt;&lt;br&gt; Once you have finished the object, the obstack is available for ordinary
23477 allocation or for growing another object.
23478 &lt;br&gt;&lt;br&gt; This function can return a null pointer under the same conditions as
23479 &lt;CODE&gt;obstack_alloc&lt;/CODE&gt; .
23480 </synopsis>
23481 </function>
23482 </construct>
23483 <construct id="function-obstack_object_size" type="function">
23484 <function returntype="int">
23485 <prototype>
23486 <parameter content="struct obstack *obstack-ptr"/>
23487 </prototype>
23488 <headers>
23489 <header filename = "obstack.h"/>
23490 </headers>
23491 <synopsis>
23492 This function returns the current size of the growing object, in bytes.
23493 Remember to call this function &lt;EM&gt;before&lt;/EM&gt; finishing the object.
23494 After it is finished, &lt;CODE&gt;obstack_object_size&lt;/CODE&gt; will return zero.
23495 </synopsis>
23496 </function>
23497 </construct>
23498 <construct id="function-obstack_room" type="function">
23499 <function returntype="int">
23500 <prototype>
23501 <parameter content="struct obstack *obstack-ptr"/>
23502 </prototype>
23503 <headers>
23504 <header filename = "obstack.h"/>
23505 </headers>
23506 <synopsis>
23507 This returns the number of bytes that can be added safely to the current
23508 growing object (or to an object about to be started) in obstack
23509 &lt;VAR&gt;obstack&lt;/VAR&gt; using the fast growth functions.
23510 </synopsis>
23511 </function>
23512 </construct>
23513 <construct id="function-obstack_1grow_fast" type="function">
23514 <function returntype="void">
23515 <prototype>
23516 <parameter content="struct obstack *obstack-ptr"/>
23517 <parameter content="char c"/>
23518 </prototype>
23519 <headers>
23520 <header filename = "obstack.h"/>
23521 </headers>
23522 <synopsis>
23523 The function &lt;CODE&gt;obstack_1grow_fast&lt;/CODE&gt; adds one byte containing the
23524 character &lt;VAR&gt;c&lt;/VAR&gt; to the growing object in obstack &lt;VAR&gt;obstack-ptr&lt;/VAR&gt;.
23525 </synopsis>
23526 </function>
23527 </construct>
23528 <construct id="function-obstack_ptr_grow_fast" type="function">
23529 <function returntype="void">
23530 <prototype>
23531 <parameter content="struct obstack *obstack-ptr"/>
23532 <parameter content="void *data"/>
23533 </prototype>
23534 <headers>
23535 <header filename = "obstack.h"/>
23536 </headers>
23537 <synopsis>
23538 The function &lt;CODE&gt;obstack_ptr_grow_fast&lt;/CODE&gt; adds &lt;CODE&gt;sizeof (void *)&lt;/CODE&gt;
23539 bytes containing the value of &lt;VAR&gt;data&lt;/VAR&gt; to the growing object in
23540 obstack &lt;VAR&gt;obstack-ptr&lt;/VAR&gt;.
23541 </synopsis>
23542 </function>
23543 </construct>
23544 <construct id="function-obstack_int_grow_fast" type="function">
23545 <function returntype="void">
23546 <prototype>
23547 <parameter content="struct obstack *obstack-ptr"/>
23548 <parameter content="int data"/>
23549 </prototype>
23550 <headers>
23551 <header filename = "obstack.h"/>
23552 </headers>
23553 <synopsis>
23554 The function &lt;CODE&gt;obstack_int_grow_fast&lt;/CODE&gt; adds &lt;CODE&gt;sizeof (int)&lt;/CODE&gt; bytes
23555 containing the value of &lt;VAR&gt;data&lt;/VAR&gt; to the growing object in obstack
23556 &lt;VAR&gt;obstack-ptr&lt;/VAR&gt;.
23557 </synopsis>
23558 </function>
23559 </construct>
23560 <construct id="function-obstack_blank_fast" type="function">
23561 <function returntype="void">
23562 <prototype>
23563 <parameter content="struct obstack *obstack-ptr"/>
23564 <parameter content="int size"/>
23565 </prototype>
23566 <headers>
23567 <header filename = "obstack.h"/>
23568 </headers>
23569 <synopsis>
23570 The function &lt;CODE&gt;obstack_blank_fast&lt;/CODE&gt; adds &lt;VAR&gt;size&lt;/VAR&gt; bytes to the
23571 growing object in obstack &lt;VAR&gt;obstack-ptr&lt;/VAR&gt; without initializing them.
23572 </synopsis>
23573 </function>
23574 </construct>
23575 <construct id="function-obstack_base" type="function">
23576 <function returntype="void *">
23577 <prototype>
23578 <parameter content="struct obstack *obstack-ptr"/>
23579 </prototype>
23580 <headers>
23581 <header filename = "obstack.h"/>
23582 </headers>
23583 <synopsis>
23584 This function returns the tentative address of the beginning of the
23585 currently growing object in &lt;VAR&gt;obstack-ptr&lt;/VAR&gt;. If you finish the object
23586 immediately, it will have that address. If you make it larger first, it
23587 may outgrow the current chunk---then its address will change!
23588 &lt;br&gt;&lt;br&gt; If no object is growing, this value says where the next object you
23589 allocate will start (once again assuming it fits in the current
23590 chunk).
23591 </synopsis>
23592 </function>
23593 </construct>
23594 <construct id="function-obstack_next_free" type="function">
23595 <function returntype="void *">
23596 <prototype>
23597 <parameter content="struct obstack *obstack-ptr"/>
23598 </prototype>
23599 <headers>
23600 <header filename = "obstack.h"/>
23601 </headers>
23602 <synopsis>
23603 This function returns the address of the first free byte in the current
23604 chunk of obstack &lt;VAR&gt;obstack-ptr&lt;/VAR&gt;. This is the end of the currently
23605 growing object. If no object is growing, &lt;CODE&gt;obstack_next_free&lt;/CODE&gt;
23606 returns the same value as &lt;CODE&gt;obstack_base&lt;/CODE&gt;.
23607 </synopsis>
23608 </function>
23609 </construct>
23610 <construct id="function-obstack_object_size" type="function">
23611 <function returntype="int">
23612 <prototype>
23613 <parameter content="struct obstack *obstack-ptr"/>
23614 </prototype>
23615 <headers>
23616 <header filename = "obstack.h"/>
23617 </headers>
23618 <synopsis>
23619 This function returns the size in bytes of the currently growing object.
23620 This is equivalent to
23621 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
23622 obstack_next_free (&lt;VAR&gt;obstack-ptr&lt;/VAR&gt;) - obstack_base (&lt;VAR&gt;obstack-ptr&lt;/VAR&gt;)&lt;br&gt;
23623 &lt;/pre&gt;
23624 </synopsis>
23625 </function>
23626 </construct>
23627 <construct id="function-alloca" type="function">
23628 <function returntype="void *">
23629 <prototype>
23630 <parameter content="size_t size"/>
23631 </prototype>
23632 <headers>
23633 <header filename = "stdlib.h"/>
23634 </headers>
23635 <synopsis>
23636 The return value of &lt;CODE&gt;alloca&lt;/CODE&gt; is the address of a block of &lt;VAR&gt;size&lt;/VAR&gt;
23637 bytes of memory, allocated in the stack frame of the calling function.
23638 </synopsis>
23639 </function>
23640 </construct>
23641 <construct id="function-brk" type="function">
23642 <function returntype="int">
23643 <prototype>
23644 <parameter content="void *addr"/>
23645 </prototype>
23646 <headers>
23647 <header filename = "unistd.h"/>
23648 </headers>
23649 <synopsis>
23650 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;brk&lt;/CODE&gt; sets the high end of the calling process' data segment to
23651 &lt;VAR&gt;addr&lt;/VAR&gt;.
23652 &lt;br&gt;&lt;br&gt; The address of the end of a segment is defined to be the address of the
23653 last byte in the segment plus 1.
23654 &lt;br&gt;&lt;br&gt; The function has no effect if &lt;VAR&gt;addr&lt;/VAR&gt; is lower than the low end of
23655 the data segment. (This is considered success, by the way).
23656 &lt;br&gt;&lt;br&gt; The function fails if it would cause the data segment to overlap another
23657 segment or exceed the process' data storage limit .
23658 &lt;br&gt;&lt;br&gt; The function is named for a common historical case where data storage
23659 and the stack are in the same segment. Data storage allocation grows
23660 upward from the bottom of the segment while the stack grows downward
23661 toward it from the top of the segment and the curtain between them is
23662 called the break.
23663 &lt;br&gt;&lt;br&gt; The return value is zero on success. On failure, the return value is
23664 &lt;CODE&gt;-1&lt;/CODE&gt; and &lt;CODE&gt;errno&lt;/CODE&gt; is set accordingly. The following &lt;CODE&gt;errno&lt;/CODE&gt;
23665 values are specific to this function:
23666 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
23667
23668 &lt;DT&gt;&lt;CODE&gt;ENOMEM&lt;/CODE&gt;
23669 &lt;DD&gt;
23670 The request would cause the data segment to overlap another segment or
23671 exceed the process' data storage limit.
23672
23673 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt;
23674 </synopsis>
23675 </function>
23676 </construct>
23677 <construct id="function-mlock" type="function">
23678 <function returntype="int">
23679 <prototype>
23680 <parameter content="const void *addr"/>
23681 <parameter content="size_t len"/>
23682 </prototype>
23683 <headers>
23684 <header filename = "unistd.h"/>
23685 <header filename = "sys/mman.h"/>
23686 </headers>
23687 <synopsis>
23688 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;mlock&lt;/CODE&gt; locks a range of the calling process' virtual pages.
23689 &lt;br&gt;&lt;br&gt; The range of memory starts at address &lt;VAR&gt;addr&lt;/VAR&gt; and is &lt;VAR&gt;len&lt;/VAR&gt; bytes
23690 long. Actually, since you must lock whole pages, it is the range of
23691 pages that include any part of the specified range.
23692 &lt;br&gt;&lt;br&gt; When the function returns successfully, each of those pages is backed by
23693 (connected to) a real frame (is resident) and is marked to stay that
23694 way. This means the function may cause page-ins and have to wait for
23695 them.
23696 &lt;br&gt;&lt;br&gt; When the function fails, it does not affect the lock status of any
23697 pages.
23698 &lt;br&gt;&lt;br&gt; The return value is zero if the function succeeds. Otherwise, it is
23699 &lt;CODE&gt;-1&lt;/CODE&gt; and &lt;CODE&gt;errno&lt;/CODE&gt; is set accordingly. &lt;CODE&gt;errno&lt;/CODE&gt; values
23700 specific to this function are:
23701 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
23702
23703 &lt;DT&gt;&lt;CODE&gt;ENOMEM&lt;/CODE&gt;
23704 &lt;DD&gt;
23705 &lt;OL&gt;
23706 &lt;LI&gt;
23707 At least some of the specified address range does not exist in the
23708 calling process' virtual address space.
23709 &lt;LI&gt;
23710 The locking would cause the process to exceed its locked page limit.
23711 &lt;/OL&gt;
23712 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EPERM
23713 The calling process is not superuser.
23714 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
23715 &lt;VAR&gt;len&lt;/VAR&gt; is not positive.
23716 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOSYS
23717 The kernel does not provide &lt;CODE&gt;mlock&lt;/CODE&gt; capability.
23718 &lt;br&gt;&lt;br&gt;
23719 &lt;br&gt;&lt;br&gt; You can lock &lt;EM&gt;all&lt;/EM&gt; a process' memory with &lt;CODE&gt;mlockall&lt;/CODE&gt;. You
23720 unlock memory with &lt;CODE&gt;munlock&lt;/CODE&gt; or &lt;CODE&gt;munlockall&lt;/CODE&gt;.
23721 &lt;br&gt;&lt;br&gt; To avoid all page faults in a C program, you have to use
23722 &lt;CODE&gt;mlockall&lt;/CODE&gt;, because some of the memory a program uses is hidden
23723 from the C code, e.g. the stack and automatic variables, and you
23724 wouldn't know what address to tell &lt;CODE&gt;mlock&lt;/CODE&gt;.
23725 &lt;br&gt;&lt;br&gt;
23726 </synopsis>
23727 </function>
23728 </construct>
23729 <construct id="function-munlock" type="function">
23730 <function returntype="int">
23731 <prototype>
23732 <parameter content="const void *addr"/>
23733 <parameter content="size_t len"/>
23734 </prototype>
23735 <headers>
23736 <header filename = "sys/mman.h"/>
23737 </headers>
23738 <synopsis>
23739 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;munlock&lt;/CODE&gt; unlocks a range of the calling process' virtual pages.
23740 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;munlock&lt;/CODE&gt; is the inverse of &lt;CODE&gt;mlock&lt;/CODE&gt; and functions completely
23741 analogously to &lt;CODE&gt;mlock&lt;/CODE&gt;, except that there is no &lt;CODE&gt;EPERM&lt;/CODE&gt;
23742 failure.
23743 &lt;br&gt;&lt;br&gt;
23744 </synopsis>
23745 </function>
23746 </construct>
23747 <construct id="function-mlockall" type="function">
23748 <function returntype="int">
23749 <prototype>
23750 <parameter content="int flags"/>
23751 </prototype>
23752 <headers>
23753 <header filename = "sys/mman.h"/>
23754 </headers>
23755 <synopsis>
23756 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;mlockall&lt;/CODE&gt; locks all the pages in a process' virtual memory address
23757 space, and/or any that are added to it in the future. This includes the
23758 pages of the code, data and stack segment, as well as shared libraries,
23759 user space kernel data, shared memory, and memory mapped files.
23760 &lt;br&gt;&lt;br&gt; &lt;VAR&gt;flags&lt;/VAR&gt; is a string of single bit flags represented by the following
23761 macros. They tell &lt;CODE&gt;mlockall&lt;/CODE&gt; which of its functions you want. All
23762 other bits must be zero.
23763 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
23764
23765 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;MCL_CURRENT&lt;/CODE&gt;
23766 &lt;DD&gt;
23767 Lock all pages which currently exist in the calling process' virtual
23768 address space.
23769 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;MCL_FUTURE&lt;/CODE&gt;
23770 &lt;DD&gt;
23771 Set a mode such that any pages added to the process' virtual address
23772 space in the future will be locked from birth. This mode does not
23773 affect future address spaces owned by the same process so exec, which
23774 replaces a process' address space, wipes out &lt;CODE&gt;MCL_FUTURE&lt;/CODE&gt;.
23775 .
23776 &lt;br&gt;&lt;br&gt;
23777 &lt;br&gt;&lt;br&gt; When the function returns successfully, and you specified
23778 &lt;CODE&gt;MCL_CURRENT&lt;/CODE&gt;, all of the process' pages are backed by (connected
23779 to) real frames (they are resident) and are marked to stay that way.
23780 This means the function may cause page-ins and have to wait for them.
23781 &lt;br&gt;&lt;br&gt; When the process is in &lt;CODE&gt;MCL_FUTURE&lt;/CODE&gt; mode because it successfully
23782 executed this function and specified &lt;CODE&gt;MCL_CURRENT&lt;/CODE&gt;, any system call
23783 by the process that requires space be added to its virtual address space
23784 fails with &lt;CODE&gt;errno&lt;/CODE&gt; = &lt;CODE&gt;ENOMEM&lt;/CODE&gt; if locking the additional space
23785 would cause the process to exceed its locked page limit. In the case
23786 that the address space addition that can't be accommodated is stack
23787 expansion, the stack expansion fails and the kernel sends a
23788 &lt;CODE&gt;SIGSEGV&lt;/CODE&gt; signal to the process.
23789 &lt;br&gt;&lt;br&gt; When the function fails, it does not affect the lock status of any pages
23790 or the future locking mode.
23791 &lt;br&gt;&lt;br&gt; The return value is zero if the function succeeds. Otherwise, it is
23792 &lt;CODE&gt;-1&lt;/CODE&gt; and &lt;CODE&gt;errno&lt;/CODE&gt; is set accordingly. &lt;CODE&gt;errno&lt;/CODE&gt; values
23793 specific to this function are:
23794 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
23795
23796 &lt;LI&gt; ENOMEM
23797 &lt;OL&gt;
23798 &lt;LI&gt;
23799 At least some of the specified address range does not exist in the
23800 calling process' virtual address space.
23801 &lt;LI&gt;
23802 The locking would cause the process to exceed its locked page limit.
23803 &lt;/OL&gt;
23804 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EPERM
23805 The calling process is not superuser.
23806 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
23807 Undefined bits in &lt;VAR&gt;flags&lt;/VAR&gt; are not zero.
23808 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOSYS
23809 The kernel does not provide &lt;CODE&gt;mlockall&lt;/CODE&gt; capability.
23810 &lt;br&gt;&lt;br&gt;
23811 &lt;br&gt;&lt;br&gt; You can lock just specific pages with &lt;CODE&gt;mlock&lt;/CODE&gt;. You unlock pages
23812 with &lt;CODE&gt;munlockall&lt;/CODE&gt; and &lt;CODE&gt;munlock&lt;/CODE&gt;.
23813 &lt;br&gt;&lt;br&gt;
23814 </synopsis>
23815 </function>
23816 </construct>
23817 <construct id="function-munlockall" type="function">
23818 <function returntype="int">
23819 <prototype>
23820 <parameter content="void"/>
23821 </prototype>
23822 <headers>
23823 <header filename = "sys/mman.h"/>
23824 </headers>
23825 <synopsis>
23826 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;munlockall&lt;/CODE&gt; unlocks every page in the calling process' virtual
23827 address space and turn off &lt;CODE&gt;MCL_FUTURE&lt;/CODE&gt; future locking mode.
23828 &lt;br&gt;&lt;br&gt; The return value is zero if the function succeeds. Otherwise, it is
23829 &lt;CODE&gt;-1&lt;/CODE&gt; and &lt;CODE&gt;errno&lt;/CODE&gt; is set accordingly. The only way this
23830 function can fail is for generic reasons that all functions and system
23831 calls can fail, so there are no specific &lt;CODE&gt;errno&lt;/CODE&gt; values.
23832 &lt;br&gt;&lt;br&gt;
23833 </synopsis>
23834 </function>
23835 </construct>
23836 <construct id="function-getrusage" type="function">
23837 <function returntype="int">
23838 <prototype>
23839 <parameter content="int processes"/>
23840 <parameter content="struct rusage *rusage"/>
23841 </prototype>
23842 <headers>
23843 <header filename = "malloc.h"/>
23844 <header filename = "sys/resource.h"/>
23845 </headers>
23846 <synopsis>
23847 This function reports resource usage totals for processes specified by
23848 &lt;VAR&gt;processes&lt;/VAR&gt;, storing the information in &lt;CODE&gt;*&lt;VAR&gt;rusage&lt;/VAR&gt;&lt;/CODE&gt;.
23849 &lt;br&gt;&lt;br&gt; In most systems, &lt;VAR&gt;processes&lt;/VAR&gt; has only two valid values:
23850 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
23851
23852 &lt;DT&gt;&lt;CODE&gt;RUSAGE_SELF&lt;/CODE&gt;
23853 &lt;DD&gt;
23854 Just the current process.
23855 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;RUSAGE_CHILDREN&lt;/CODE&gt;
23856 &lt;DD&gt;
23857 All child processes (direct and indirect) that have already terminated.
23858
23859 &lt;br&gt;&lt;br&gt; In the GNU system, you can also inquire about a particular child process
23860 by specifying its process ID.
23861 &lt;br&gt;&lt;br&gt; The return value of &lt;CODE&gt;getrusage&lt;/CODE&gt; is zero for success, and &lt;CODE&gt;-1&lt;/CODE&gt;
23862 for failure.
23863 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
23864
23865 &lt;LI&gt; EINVAL
23866 The argument &lt;VAR&gt;processes&lt;/VAR&gt; is not valid.
23867
23868 </synopsis>
23869 </function>
23870 </construct>
23871 <construct id="struct-rusage" type="struct">
23872 <structure>
23873 <synopsis>
23874 This data type stores various resource usage statistics. It has the
23875 following members, and possibly others:
23876 &lt;br&gt;&lt;br&gt;
23877 </synopsis>
23878 <elements>
23879 <element content="struct timeval ru_utime">
23880 <synopsis>
23881 Time spent executing user instructions.
23882 &lt;br&gt;&lt;br&gt;
23883 </synopsis>
23884 </element>
23885 <element content="struct timeval ru_stime">
23886 <synopsis>
23887 Time spent in operating system code on behalf of &lt;VAR&gt;processes&lt;/VAR&gt;.
23888 &lt;br&gt;&lt;br&gt;
23889 </synopsis>
23890 </element>
23891 <element content="long int ru_maxrss">
23892 <synopsis>
23893 The maximum resident set size used, in kilobytes. That is, the maximum
23894 number of kilobytes of physical memory that &lt;VAR&gt;processes&lt;/VAR&gt; used
23895 simultaneously.
23896 &lt;br&gt;&lt;br&gt;
23897 </synopsis>
23898 </element>
23899 <element content="long int ru_ixrss">
23900 <synopsis>
23901 An integral value expressed in kilobytes times ticks of execution, which
23902 indicates the amount of memory used by text that was shared with other
23903 processes.
23904 &lt;br&gt;&lt;br&gt;
23905 </synopsis>
23906 </element>
23907 <element content="long int ru_idrss">
23908 <synopsis>
23909 An integral value expressed the same way, which is the amount of
23910 unshared memory used for data.
23911 &lt;br&gt;&lt;br&gt;
23912 </synopsis>
23913 </element>
23914 <element content="long int ru_isrss">
23915 <synopsis>
23916 An integral value expressed the same way, which is the amount of
23917 unshared memory used for stack space.
23918 &lt;br&gt;&lt;br&gt;
23919 </synopsis>
23920 </element>
23921 <element content="long int ru_minflt">
23922 <synopsis>
23923 The number of page faults which were serviced without requiring any I/O.
23924 &lt;br&gt;&lt;br&gt;
23925 </synopsis>
23926 </element>
23927 <element content="long int ru_majflt">
23928 <synopsis>
23929 The number of page faults which were serviced by doing I/O.
23930 &lt;br&gt;&lt;br&gt;
23931 </synopsis>
23932 </element>
23933 <element content="long int ru_nswap">
23934 <synopsis>
23935 The number of times &lt;VAR&gt;processes&lt;/VAR&gt; was swapped entirely out of main memory.
23936 &lt;br&gt;&lt;br&gt;
23937 </synopsis>
23938 </element>
23939 <element content="long int ru_inblock">
23940 <synopsis>
23941 The number of times the file system had to read from the disk on behalf
23942 of &lt;VAR&gt;processes&lt;/VAR&gt;.
23943 &lt;br&gt;&lt;br&gt;
23944 </synopsis>
23945 </element>
23946 <element content="long int ru_oublock">
23947 <synopsis>
23948 The number of times the file system had to write to the disk on behalf
23949 of &lt;VAR&gt;processes&lt;/VAR&gt;.
23950 &lt;br&gt;&lt;br&gt;
23951 </synopsis>
23952 </element>
23953 <element content="long int ru_msgsnd">
23954 <synopsis>
23955 Number of IPC messages sent.
23956 &lt;br&gt;&lt;br&gt;
23957 </synopsis>
23958 </element>
23959 <element content="long int ru_msgrcv">
23960 <synopsis>
23961 Number of IPC messages received.
23962 &lt;br&gt;&lt;br&gt;
23963 </synopsis>
23964 </element>
23965 <element content="long int ru_nsignals">
23966 <synopsis>
23967 Number of signals received.
23968 &lt;br&gt;&lt;br&gt;
23969 </synopsis>
23970 </element>
23971 <element content="long int ru_nvcsw">
23972 <synopsis>
23973 The number of times &lt;VAR&gt;processes&lt;/VAR&gt; voluntarily invoked a context switch
23974 (usually to wait for some service).
23975 &lt;br&gt;&lt;br&gt;
23976 </synopsis>
23977 </element>
23978 </elements>
23979 </structure>
23980 </construct>
23981 <construct id="function-vtimes" type="function">
23982 <function returntype="int">
23983 <prototype>
23984 <parameter content="struct vtimes current"/>
23985 <parameter content="struct vtimes child"/>
23986 </prototype>
23987 <headers>
23988 <header filename = "sys/resource.h"/>
23989 <header filename = "vtimes.h"/>
23990 </headers>
23991 <synopsis>
23992 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;vtimes&lt;/CODE&gt; reports resource usage totals for a process.
23993 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;current&lt;/VAR&gt; is non-null, &lt;CODE&gt;vtimes&lt;/CODE&gt; stores resource usage totals for
23994 the invoking process alone in the structure to which it points. If
23995 &lt;VAR&gt;child&lt;/VAR&gt; is non-null, &lt;CODE&gt;vtimes&lt;/CODE&gt; stores resource usage totals for all
23996 past children (which have terminated) of the invoking process in the structure
23997 to which it points.
23998 &lt;br&gt;&lt;br&gt; &lt;h4&gt;Data Type - struct vtimes&lt;/h4&gt;
23999 This data type contains information about the resource usage of a process.
24000 Each member corresponds to a member of the &lt;CODE&gt;struct rusage&lt;/CODE&gt; data type
24001 described above.
24002 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
24003
24004 &lt;DT&gt;&lt;CODE&gt;vm_utime&lt;/CODE&gt;
24005 &lt;DD&gt;
24006 User CPU time. Analogous to &lt;CODE&gt;ru_utime&lt;/CODE&gt; in &lt;CODE&gt;struct rusage&lt;/CODE&gt;
24007 &lt;LI&gt; vm_stime
24008 System CPU time. Analogous to &lt;CODE&gt;ru_stime&lt;/CODE&gt; in &lt;CODE&gt;struct rusage&lt;/CODE&gt;
24009 &lt;LI&gt; vm_idsrss
24010 Data and stack memory. The sum of the values that would be reported as
24011 &lt;CODE&gt;ru_idrss&lt;/CODE&gt; and &lt;CODE&gt;ru_isrss&lt;/CODE&gt; in &lt;CODE&gt;struct rusage&lt;/CODE&gt;
24012 &lt;LI&gt; vm_ixrss
24013 Shared memory. Analogous to &lt;CODE&gt;ru_ixrss&lt;/CODE&gt; in &lt;CODE&gt;struct rusage&lt;/CODE&gt;
24014 &lt;LI&gt; vm_maxrss
24015 Maximent resident set size. Analogous to &lt;CODE&gt;ru_maxrss&lt;/CODE&gt; in
24016 &lt;CODE&gt;struct rusage&lt;/CODE&gt;
24017 &lt;LI&gt; vm_majflt
24018 Major page faults. Analogous to &lt;CODE&gt;ru_majflt&lt;/CODE&gt; in &lt;CODE&gt;struct rusage&lt;/CODE&gt;
24019 &lt;LI&gt; vm_minflt
24020 Minor page faults. Analogous to &lt;CODE&gt;ru_minflt&lt;/CODE&gt; in &lt;CODE&gt;struct rusage&lt;/CODE&gt;
24021 &lt;LI&gt; vm_nswap
24022 Swap count. Analogous to &lt;CODE&gt;ru_nswap&lt;/CODE&gt; in &lt;CODE&gt;struct rusage&lt;/CODE&gt;
24023 &lt;LI&gt; vm_inblk
24024 Disk reads. Analogous to &lt;CODE&gt;ru_inblk&lt;/CODE&gt; in &lt;CODE&gt;struct rusage&lt;/CODE&gt;
24025 &lt;LI&gt; vm_oublk
24026 Disk writes. Analogous to &lt;CODE&gt;ru_oublk&lt;/CODE&gt; in &lt;CODE&gt;struct rusage&lt;/CODE&gt;
24027
24028
24029 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt; The return value is zero if the function succeeds; &lt;CODE&gt;-1&lt;/CODE&gt; otherwise.
24030 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt;
24031 </synopsis>
24032 </function>
24033 </construct>
24034 <construct id="function-getrlimit" type="function">
24035 <function returntype="int">
24036 <prototype>
24037 <parameter content="int resource"/>
24038 <parameter content="struct rlimit *rlp"/>
24039 </prototype>
24040 <headers>
24041 <header filename = "sys/resource.h"/>
24042 </headers>
24043 <synopsis>
24044 Read the current and maximum limits for the resource &lt;VAR&gt;resource&lt;/VAR&gt;
24045 and store them in &lt;CODE&gt;*&lt;VAR&gt;rlp&lt;/VAR&gt;&lt;/CODE&gt;.
24046 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt; on failure. The
24047 only possible &lt;CODE&gt;errno&lt;/CODE&gt; error condition is &lt;CODE&gt;EFAULT&lt;/CODE&gt;.
24048 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a
24049 32-bit system this function is in fact &lt;CODE&gt;getrlimit64&lt;/CODE&gt;. Thus, the
24050 LFS interface transparently replaces the old interface.
24051 </synopsis>
24052 </function>
24053 </construct>
24054 <construct id="function-getrlimit64" type="function">
24055 <function returntype="int">
24056 <prototype>
24057 <parameter content="int resource"/>
24058 <parameter content="struct rlimit64 *rlp"/>
24059 </prototype>
24060 <headers>
24061 <header filename = "sys/resource.h"/>
24062 </headers>
24063 <synopsis>
24064 This function is similar to &lt;CODE&gt;getrlimit&lt;/CODE&gt; but its second parameter is
24065 a pointer to a variable of type &lt;CODE&gt;struct rlimit64&lt;/CODE&gt;, which allows it
24066 to read values which wouldn't fit in the member of a &lt;CODE&gt;struct
24067 rlimit&lt;/CODE&gt;.
24068 &lt;br&gt;&lt;br&gt; If the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a
24069 32-bit machine, this function is available under the name
24070 &lt;CODE&gt;getrlimit&lt;/CODE&gt; and so transparently replaces the old interface.
24071 </synopsis>
24072 </function>
24073 </construct>
24074 <construct id="function-setrlimit" type="function">
24075 <function returntype="int">
24076 <prototype>
24077 <parameter content="int resource"/>
24078 <parameter content="const struct rlimit *rlp"/>
24079 </prototype>
24080 <headers>
24081 <header filename = "sys/resource.h"/>
24082 </headers>
24083 <synopsis>
24084 Store the current and maximum limits for the resource &lt;VAR&gt;resource&lt;/VAR&gt;
24085 in &lt;CODE&gt;*&lt;VAR&gt;rlp&lt;/VAR&gt;&lt;/CODE&gt;.
24086 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt; on failure. The
24087 following &lt;CODE&gt;errno&lt;/CODE&gt; error condition is possible:
24088 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
24089
24090 &lt;DT&gt;&lt;CODE&gt;EPERM&lt;/CODE&gt;
24091 &lt;DD&gt;
24092 &lt;OL&gt;
24093 &lt;LI&gt;
24094 The process tried to raise a current limit beyond the maximum limit.
24095 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
24096 The process tried to raise a maximum limit, but is not superuser.
24097 &lt;/OL&gt;
24098
24099 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a
24100 32-bit system this function is in fact &lt;CODE&gt;setrlimit64&lt;/CODE&gt;. Thus, the
24101 LFS interface transparently replaces the old interface.
24102 </synopsis>
24103 </function>
24104 </construct>
24105 <construct id="function-setrlimit64" type="function">
24106 <function returntype="int">
24107 <prototype>
24108 <parameter content="int resource"/>
24109 <parameter content="const struct rlimit64 *rlp"/>
24110 </prototype>
24111 <headers>
24112 <header filename = "sys/resource.h"/>
24113 </headers>
24114 <synopsis>
24115 This function is similar to &lt;CODE&gt;setrlimit&lt;/CODE&gt; but its second parameter is
24116 a pointer to a variable of type &lt;CODE&gt;struct rlimit64&lt;/CODE&gt; which allows it
24117 to set values which wouldn't fit in the member of a &lt;CODE&gt;struct
24118 rlimit&lt;/CODE&gt;.
24119 &lt;br&gt;&lt;br&gt; If the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a
24120 32-bit machine this function is available under the name
24121 &lt;CODE&gt;setrlimit&lt;/CODE&gt; and so transparently replaces the old interface.
24122 </synopsis>
24123 </function>
24124 </construct>
24125 <construct id="struct-rlimit" type="struct">
24126 <structure>
24127 <synopsis>
24128 This structure is used with &lt;CODE&gt;getrlimit&lt;/CODE&gt; to receive limit values,
24129 and with &lt;CODE&gt;setrlimit&lt;/CODE&gt; to specify limit values for a particular process
24130 and resource. It has two fields:
24131 &lt;br&gt;&lt;br&gt;
24132 </synopsis>
24133 <elements>
24134 <element content="rlim_t rlim_cur">
24135 <synopsis>
24136 The current limit
24137 &lt;br&gt;&lt;br&gt;
24138 </synopsis>
24139 </element>
24140 </elements>
24141 </structure>
24142 </construct>
24143 <construct id="struct-rlimit64" type="struct">
24144 <structure>
24145 <synopsis>
24146 This structure is analogous to the &lt;CODE&gt;rlimit&lt;/CODE&gt; structure above, but
24147 its components have wider ranges. It has two fields:
24148 &lt;br&gt;&lt;br&gt;
24149 </synopsis>
24150 <elements>
24151 <element content="rlim64_t rlim_cur">
24152 <synopsis>
24153 This is analogous to &lt;CODE&gt;rlimit.rlim_cur&lt;/CODE&gt;, but with a different type.
24154 &lt;br&gt;&lt;br&gt;
24155 </synopsis>
24156 </element>
24157 </elements>
24158 </structure>
24159 </construct>
24160 <construct id="function-ulimit" type="function">
24161 <function returntype="int">
24162 <prototype>
24163 <parameter content="int cmd"/>
24164 <parameter content="..."/>
24165 </prototype>
24166 <headers>
24167 <header filename = "sys/resource.h"/>
24168 <header filename = "ulimit.h"/>
24169 </headers>
24170 <synopsis>
24171 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;ulimit&lt;/CODE&gt; gets the current limit or sets the current and maximum
24172 limit for a particular resource for the calling process according to the
24173 command &lt;VAR&gt;cmd&lt;/VAR&gt;.a
24174 &lt;br&gt;&lt;br&gt; If you are getting a limit, the command argument is the only argument.
24175 If you are setting a limit, there is a second argument:
24176 &lt;CODE&gt;long int&lt;/CODE&gt; &lt;VAR&gt;limit&lt;/VAR&gt; which is the value to which you are setting
24177 the limit.
24178 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;cmd&lt;/VAR&gt; values and the operations they specify are:
24179 &lt;DL&gt;
24180
24181 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;GETFSIZE&lt;/CODE&gt;
24182 &lt;DD&gt;
24183 Get the current limit on the size of a file, in units of 512 bytes.
24184 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;SETFSIZE&lt;/CODE&gt;
24185 &lt;DD&gt;
24186 Set the current and maximum limit on the size of a file to &lt;VAR&gt;limit&lt;/VAR&gt; *
24187 512 bytes.
24188 &lt;br&gt;&lt;br&gt;
24189 &lt;br&gt;&lt;br&gt; There are also some other &lt;VAR&gt;cmd&lt;/VAR&gt; values that may do things on some
24190 systems, but they are not supported.
24191 &lt;br&gt;&lt;br&gt; Only the superuser may increase a maximum limit.
24192 &lt;br&gt;&lt;br&gt; When you successfully get a limit, the return value of &lt;CODE&gt;ulimit&lt;/CODE&gt; is
24193 that limit, which is never negative. When you successfully set a limit,
24194 the return value is zero. When the function fails, the return value is
24195 &lt;CODE&gt;-1&lt;/CODE&gt; and &lt;CODE&gt;errno&lt;/CODE&gt; is set according to the reason:
24196 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
24197
24198 &lt;LI&gt; EPERM
24199 A process tried to increase a maximum limit, but is not superuser.
24200
24201 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt;
24202 </synopsis>
24203 </function>
24204 </construct>
24205 <construct id="function-vlimit" type="function">
24206 <function returntype="int">
24207 <prototype>
24208 <parameter content="int resource"/>
24209 <parameter content="int limit"/>
24210 </prototype>
24211 <headers>
24212 <header filename = "sys/vlimit.h"/>
24213 </headers>
24214 <synopsis>
24215 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;vlimit&lt;/CODE&gt; sets the current limit for a resource for a process.
24216 &lt;br&gt;&lt;br&gt; &lt;VAR&gt;resource&lt;/VAR&gt; identifies the resource:
24217 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
24218
24219 &lt;DT&gt;&lt;CODE&gt;LIM_CPU&lt;/CODE&gt;
24220 &lt;DD&gt;
24221 Maximum CPU time. Same as &lt;CODE&gt;RLIMIT_CPU&lt;/CODE&gt; for &lt;CODE&gt;setrlimit&lt;/CODE&gt;.
24222 &lt;DT&gt;&lt;CODE&gt;LIM_FSIZE&lt;/CODE&gt;
24223 &lt;DD&gt;
24224 Maximum file size. Same as &lt;CODE&gt;RLIMIT_FSIZE&lt;/CODE&gt; for &lt;CODE&gt;setrlimit&lt;/CODE&gt;.
24225 &lt;LI&gt; LIM_DATA
24226 Maximum data memory. Same as &lt;CODE&gt;RLIMIT_DATA&lt;/CODE&gt; for &lt;CODE&gt;setrlimit&lt;/CODE&gt;.
24227 &lt;LI&gt; LIM_STACK
24228 Maximum stack size. Same as &lt;CODE&gt;RLIMIT_STACK&lt;/CODE&gt; for &lt;CODE&gt;setrlimit&lt;/CODE&gt;.
24229 &lt;LI&gt; LIM_CORE
24230 Maximum core file size. Same as &lt;CODE&gt;RLIMIT_COR&lt;/CODE&gt; for &lt;CODE&gt;setrlimit&lt;/CODE&gt;.
24231 &lt;LI&gt; LIM_MAXRSS
24232 Maximum physical memory. Same as &lt;CODE&gt;RLIMIT_RSS&lt;/CODE&gt; for &lt;CODE&gt;setrlimit&lt;/CODE&gt;.
24233
24234 &lt;br&gt;&lt;br&gt; The return value is zero for success, and &lt;CODE&gt;-1&lt;/CODE&gt; with &lt;CODE&gt;errno&lt;/CODE&gt; set
24235 accordingly for failure:
24236 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
24237
24238 &lt;LI&gt; EPERM
24239 The process tried to set its current limit beyond its maximum limit.
24240
24241 &lt;br&gt;&lt;br&gt;
24242 </synopsis>
24243 </function>
24244 </construct>
24245 <construct id="struct-sched_param" type="struct">
24246 <structure>
24247 <synopsis>
24248 This structure describes an absolute priority.
24249 </synopsis>
24250 </structure>
24251 </construct>
24252 <construct id="function-sched_setscheduler" type="function">
24253 <function returntype="int">
24254 <prototype>
24255 <parameter content="pid_t pid"/>
24256 <parameter content="int policy"/>
24257 <parameter content="const struct sched_param *param"/>
24258 </prototype>
24259 <headers>
24260 <header filename = "sched.h"/>
24261 </headers>
24262 <synopsis>
24263 &lt;br&gt;&lt;br&gt; This function sets both the absolute priority and the scheduling policy
24264 for a process.
24265 &lt;br&gt;&lt;br&gt; It assigns the absolute priority value given by &lt;VAR&gt;param&lt;/VAR&gt; and the
24266 scheduling policy &lt;VAR&gt;policy&lt;/VAR&gt; to the process with Process ID &lt;VAR&gt;pid&lt;/VAR&gt;,
24267 or the calling process if &lt;VAR&gt;pid&lt;/VAR&gt; is zero. If &lt;VAR&gt;policy&lt;/VAR&gt; is
24268 negative, &lt;CODE&gt;sched_setscheduler&lt;/CODE&gt; keeps the existing scheduling policy.
24269 &lt;br&gt;&lt;br&gt; The following macros represent the valid values for &lt;VAR&gt;policy&lt;/VAR&gt;:
24270 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
24271
24272 &lt;DT&gt;&lt;CODE&gt;SCHED_OTHER&lt;/CODE&gt;
24273 &lt;DD&gt;
24274 Traditional Scheduling
24275 &lt;DT&gt;&lt;CODE&gt;SCHED_FIFO&lt;/CODE&gt;
24276 &lt;DD&gt;
24277 First In First Out
24278 &lt;LI&gt; SCHED_RR
24279 Round Robin
24280
24281 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt; On success, the return value is &lt;CODE&gt;0&lt;/CODE&gt;. Otherwise, it is &lt;CODE&gt;-1&lt;/CODE&gt;
24282 and &lt;CODE&gt;ERRNO&lt;/CODE&gt; is set accordingly. The &lt;CODE&gt;errno&lt;/CODE&gt; values specific
24283 to this function are:
24284 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
24285
24286 &lt;LI&gt; EPERM
24287 &lt;OL&gt;
24288 &lt;LI&gt;
24289 The calling process does not have &lt;CODE&gt;CAP_SYS_NICE&lt;/CODE&gt; permission and
24290 &lt;VAR&gt;policy&lt;/VAR&gt; is not &lt;CODE&gt;SCHED_OTHER&lt;/CODE&gt; (or it's negative and the
24291 existing policy is not &lt;CODE&gt;SCHED_OTHER&lt;/CODE&gt;.
24292 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
24293 The calling process does not have &lt;CODE&gt;CAP_SYS_NICE&lt;/CODE&gt; permission and its
24294 owner is not the target process' owner. I.e., the effective uid of the
24295 calling process is neither the effective nor the real uid of process
24296 &lt;VAR&gt;pid&lt;/VAR&gt;.
24297 &lt;/OL&gt;
24298 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ESRCH
24299 There is no process with pid &lt;VAR&gt;pid&lt;/VAR&gt; and &lt;VAR&gt;pid&lt;/VAR&gt; is not zero.
24300 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
24301 &lt;OL&gt;
24302 &lt;LI&gt;
24303 &lt;VAR&gt;policy&lt;/VAR&gt; does not identify an existing scheduling policy.
24304 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
24305 The absolute priority value identified by *&lt;VAR&gt;param&lt;/VAR&gt; is outside the
24306 valid range for the scheduling policy &lt;VAR&gt;policy&lt;/VAR&gt; (or the existing
24307 scheduling policy if &lt;VAR&gt;policy&lt;/VAR&gt; is negative) or &lt;VAR&gt;param&lt;/VAR&gt; is
24308 null. &lt;CODE&gt;sched_get_priority_max&lt;/CODE&gt; and &lt;CODE&gt;sched_get_priority_min&lt;/CODE&gt;
24309 tell you what the valid range is.
24310 &lt;br&gt;&lt;br&gt; &lt;LI&gt;
24311 &lt;VAR&gt;pid&lt;/VAR&gt; is negative.
24312 &lt;/OL&gt;
24313
24314 &lt;br&gt;&lt;br&gt;
24315 </synopsis>
24316 </function>
24317 </construct>
24318 <construct id="function-sched_getscheduler" type="function">
24319 <function returntype="int">
24320 <prototype>
24321 <parameter content="pid_t pid"/>
24322 </prototype>
24323 <headers>
24324 <header filename = "sched.h"/>
24325 </headers>
24326 <synopsis>
24327 &lt;br&gt;&lt;br&gt; This function returns the scheduling policy assigned to the process with
24328 Process ID (pid) &lt;VAR&gt;pid&lt;/VAR&gt;, or the calling process if &lt;VAR&gt;pid&lt;/VAR&gt; is zero.
24329 &lt;br&gt;&lt;br&gt; The return value is the scheduling policy. See
24330 &lt;CODE&gt;sched_setscheduler&lt;/CODE&gt; for the possible values.
24331 &lt;br&gt;&lt;br&gt; If the function fails, the return value is instead &lt;CODE&gt;-1&lt;/CODE&gt; and
24332 &lt;CODE&gt;errno&lt;/CODE&gt; is set accordingly.
24333 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;errno&lt;/CODE&gt; values specific to this function are:
24334 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
24335
24336 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;ESRCH&lt;/CODE&gt;
24337 &lt;DD&gt;
24338 There is no process with pid &lt;VAR&gt;pid&lt;/VAR&gt; and it is not zero.
24339 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
24340 &lt;VAR&gt;pid&lt;/VAR&gt; is negative.
24341 &lt;br&gt;&lt;br&gt;
24342 &lt;br&gt;&lt;br&gt; Note that this function is not an exact mate to &lt;CODE&gt;sched_setscheduler&lt;/CODE&gt;
24343 because while that function sets the scheduling policy and the absolute
24344 priority, this function gets only the scheduling policy. To get the
24345 absolute priority, use &lt;CODE&gt;sched_getparam&lt;/CODE&gt;.
24346 &lt;br&gt;&lt;br&gt;
24347 </synopsis>
24348 </function>
24349 </construct>
24350 <construct id="function-sched_setparam" type="function">
24351 <function returntype="int">
24352 <prototype>
24353 <parameter content="pid_t pid"/>
24354 <parameter content="const struct sched_param *param"/>
24355 </prototype>
24356 <headers>
24357 <header filename = "sched.h"/>
24358 </headers>
24359 <synopsis>
24360 &lt;br&gt;&lt;br&gt; This function sets a process' absolute priority.
24361 &lt;br&gt;&lt;br&gt; It is functionally identical to &lt;CODE&gt;sched_setscheduler&lt;/CODE&gt; with
24362 &lt;VAR&gt;policy&lt;/VAR&gt; = &lt;CODE&gt;-1&lt;/CODE&gt;.
24363 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt;
24364 </synopsis>
24365 </function>
24366 </construct>
24367 <construct id="function-sched_getparam" type="function">
24368 <function returntype="int">
24369 <prototype>
24370 <parameter content="pid_t pid"/>
24371 <parameter content="const struct sched_param *param"/>
24372 </prototype>
24373 <headers>
24374 <header filename = "sched.h"/>
24375 </headers>
24376 <synopsis>
24377 &lt;br&gt;&lt;br&gt; This function returns a process' absolute priority.
24378 &lt;br&gt;&lt;br&gt; &lt;VAR&gt;pid&lt;/VAR&gt; is the Process ID (pid) of the process whose absolute priority
24379 you want to know.
24380 &lt;br&gt;&lt;br&gt; &lt;VAR&gt;param&lt;/VAR&gt; is a pointer to a structure in which the function stores the
24381 absolute priority of the process.
24382 &lt;br&gt;&lt;br&gt; On success, the return value is &lt;CODE&gt;0&lt;/CODE&gt;. Otherwise, it is &lt;CODE&gt;-1&lt;/CODE&gt;
24383 and &lt;CODE&gt;ERRNO&lt;/CODE&gt; is set accordingly. The &lt;CODE&gt;errno&lt;/CODE&gt; values specific
24384 to this function are:
24385 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
24386
24387 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;ESRCH&lt;/CODE&gt;
24388 &lt;DD&gt;
24389 There is no process with pid &lt;VAR&gt;pid&lt;/VAR&gt; and it is not zero.
24390 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
24391 &lt;VAR&gt;pid&lt;/VAR&gt; is negative.
24392 &lt;br&gt;&lt;br&gt;
24393 &lt;br&gt;&lt;br&gt;
24394 </synopsis>
24395 </function>
24396 </construct>
24397 <construct id="function-sched_get_priority_min" type="function">
24398 <function returntype="int">
24399 <prototype>
24400 <parameter content="int *policy"/>
24401 </prototype>
24402 <headers>
24403 <header filename = "sched.h"/>
24404 </headers>
24405 <synopsis>
24406 &lt;br&gt;&lt;br&gt; This function returns the lowest absolute priority value that is
24407 allowable for a process with scheduling policy &lt;VAR&gt;policy&lt;/VAR&gt;.
24408 &lt;br&gt;&lt;br&gt; On Linux, it is 0 for SCHED_OTHER and 1 for everything else.
24409 &lt;br&gt;&lt;br&gt; On success, the return value is &lt;CODE&gt;0&lt;/CODE&gt;. Otherwise, it is &lt;CODE&gt;-1&lt;/CODE&gt;
24410 and &lt;CODE&gt;ERRNO&lt;/CODE&gt; is set accordingly. The &lt;CODE&gt;errno&lt;/CODE&gt; values specific
24411 to this function are:
24412 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
24413
24414 &lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
24415 &lt;DD&gt;
24416 &lt;VAR&gt;policy&lt;/VAR&gt; does not identify an existing scheduling policy.
24417
24418 &lt;br&gt;&lt;br&gt;
24419 </synopsis>
24420 </function>
24421 </construct>
24422 <construct id="function-sched_get_priority_max" type="function">
24423 <function returntype="int">
24424 <prototype>
24425 <parameter content="int *policy"/>
24426 </prototype>
24427 <headers>
24428 <header filename = "sched.h"/>
24429 </headers>
24430 <synopsis>
24431 &lt;br&gt;&lt;br&gt; This function returns the highest absolute priority value that is
24432 allowable for a process that with scheduling policy &lt;VAR&gt;policy&lt;/VAR&gt;.
24433 &lt;br&gt;&lt;br&gt; On Linux, it is 0 for SCHED_OTHER and 99 for everything else.
24434 &lt;br&gt;&lt;br&gt; On success, the return value is &lt;CODE&gt;0&lt;/CODE&gt;. Otherwise, it is &lt;CODE&gt;-1&lt;/CODE&gt;
24435 and &lt;CODE&gt;ERRNO&lt;/CODE&gt; is set accordingly. The &lt;CODE&gt;errno&lt;/CODE&gt; values specific
24436 to this function are:
24437 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
24438
24439 &lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
24440 &lt;DD&gt;
24441 &lt;VAR&gt;policy&lt;/VAR&gt; does not identify an existing scheduling policy.
24442
24443 &lt;br&gt;&lt;br&gt;
24444 </synopsis>
24445 </function>
24446 </construct>
24447 <construct id="function-sched_rr_get_interval" type="function">
24448 <function returntype="int">
24449 <prototype>
24450 <parameter content="pid_t pid"/>
24451 <parameter content="struct timespec *interval"/>
24452 </prototype>
24453 <headers>
24454 <header filename = "sched.h"/>
24455 </headers>
24456 <synopsis>
24457 &lt;br&gt;&lt;br&gt; This function returns the length of the quantum (time slice) used with
24458 the Round Robin scheduling policy, if it is used, for the process with
24459 Process ID &lt;VAR&gt;pid&lt;/VAR&gt;.
24460 &lt;br&gt;&lt;br&gt; It returns the length of time as &lt;VAR&gt;interval&lt;/VAR&gt;.
24461 &lt;br&gt;&lt;br&gt; With a Linux kernel, the round robin time slice is always 150
24462 microseconds, and &lt;VAR&gt;pid&lt;/VAR&gt; need not even be a real pid.
24463 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and in the pathological case
24464 that it fails, the return value is &lt;CODE&gt;-1&lt;/CODE&gt; and &lt;CODE&gt;errno&lt;/CODE&gt; is set
24465 accordingly. There is nothing specific that can go wrong with this
24466 function, so there are no specific &lt;CODE&gt;errno&lt;/CODE&gt; values.
24467 &lt;br&gt;&lt;br&gt;
24468 </synopsis>
24469 </function>
24470 </construct>
24471 <construct id="function-sched_yield" type="function">
24472 <function returntype="int">
24473 <prototype>
24474 <parameter content="void"/>
24475 </prototype>
24476 <headers>
24477 <header filename = "sched.h"/>
24478 </headers>
24479 <synopsis>
24480 &lt;br&gt;&lt;br&gt; This function voluntarily gives up the process' claim on the CPU.
24481 &lt;br&gt;&lt;br&gt; Technically, &lt;CODE&gt;sched_yield&lt;/CODE&gt; causes the calling process to be made
24482 immediately ready to run (as opposed to running, which is what it was
24483 before). This means that if it has absolute priority higher than 0, it
24484 gets pushed onto the tail of the queue of processes that share its
24485 absolute priority and are ready to run, and it will run again when its
24486 turn next arrives. If its absolute priority is 0, it is more
24487 complicated, but still has the effect of yielding the CPU to other
24488 processes.
24489 &lt;br&gt;&lt;br&gt; If there are no other processes that share the calling process' absolute
24490 priority, this function doesn't have any effect.
24491 &lt;br&gt;&lt;br&gt; To the extent that the containing program is oblivious to what other
24492 processes in the system are doing and how fast it executes, this
24493 function appears as a no-op.
24494 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and in the pathological case
24495 that it fails, the return value is &lt;CODE&gt;-1&lt;/CODE&gt; and &lt;CODE&gt;errno&lt;/CODE&gt; is set
24496 accordingly. There is nothing specific that can go wrong with this
24497 function, so there are no specific &lt;CODE&gt;errno&lt;/CODE&gt; values.
24498 &lt;br&gt;&lt;br&gt;
24499 </synopsis>
24500 </function>
24501 </construct>
24502 <construct id="function-getpriority" type="function">
24503 <function returntype="int">
24504 <prototype>
24505 <parameter content="int class"/>
24506 <parameter content="int id"/>
24507 </prototype>
24508 <headers>
24509 <header filename = "sys/resource.h"/>
24510 </headers>
24511 <synopsis>
24512 Return the nice value of a set of processes; &lt;VAR&gt;class&lt;/VAR&gt; and &lt;VAR&gt;id&lt;/VAR&gt;
24513 specify which ones (see below). If the processes specified do not all
24514 have the same nice value, this returns the lowest value that any of them
24515 has.
24516 &lt;br&gt;&lt;br&gt; On success, the return value is &lt;CODE&gt;0&lt;/CODE&gt;. Otherwise, it is &lt;CODE&gt;-1&lt;/CODE&gt;
24517 and &lt;CODE&gt;ERRNO&lt;/CODE&gt; is set accordingly. The &lt;CODE&gt;errno&lt;/CODE&gt; values specific
24518 to this function are:
24519 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
24520
24521 &lt;DT&gt;&lt;CODE&gt;ESRCH&lt;/CODE&gt;
24522 &lt;DD&gt;
24523 The combination of &lt;VAR&gt;class&lt;/VAR&gt; and &lt;VAR&gt;id&lt;/VAR&gt; does not match any existing
24524 process.
24525 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
24526 The value of &lt;VAR&gt;class&lt;/VAR&gt; is not valid.
24527
24528 &lt;br&gt;&lt;br&gt; If the return value is &lt;CODE&gt;-1&lt;/CODE&gt;, it could indicate failure, or it could
24529 be the nice value. The only way to make certain is to set &lt;CODE&gt;errno =
24530 0&lt;/CODE&gt; before calling &lt;CODE&gt;getpriority&lt;/CODE&gt;, then use &lt;CODE&gt;errno != 0&lt;/CODE&gt;
24531 afterward as the criterion for failure.
24532 </synopsis>
24533 </function>
24534 </construct>
24535 <construct id="function-setpriority" type="function">
24536 <function returntype="int">
24537 <prototype>
24538 <parameter content="int class"/>
24539 <parameter content="int id"/>
24540 <parameter content="int niceval"/>
24541 </prototype>
24542 <headers>
24543 <header filename = "sys/resource.h"/>
24544 </headers>
24545 <synopsis>
24546 Set the nice value of a set of processes to &lt;VAR&gt;niceval&lt;/VAR&gt;; &lt;VAR&gt;class&lt;/VAR&gt;
24547 and &lt;VAR&gt;id&lt;/VAR&gt; specify which ones (see below).
24548 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success, and &lt;CODE&gt;-1&lt;/CODE&gt; on
24549 failure. The following &lt;CODE&gt;errno&lt;/CODE&gt; error condition are possible for
24550 this function:
24551 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
24552
24553 &lt;DT&gt;&lt;CODE&gt;ESRCH&lt;/CODE&gt;
24554 &lt;DD&gt;
24555 The combination of &lt;VAR&gt;class&lt;/VAR&gt; and &lt;VAR&gt;id&lt;/VAR&gt; does not match any existing
24556 process.
24557 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
24558 The value of &lt;VAR&gt;class&lt;/VAR&gt; is not valid.
24559 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EPERM
24560 The call would set the nice value of a process which is owned by a different
24561 user than the calling process (i.e., the target process' real or effective
24562 uid does not match the calling process' effective uid) and the calling
24563 process does not have &lt;CODE&gt;CAP_SYS_NICE&lt;/CODE&gt; permission.
24564 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EACCES
24565 The call would lower the process' nice value and the process does not have
24566 &lt;CODE&gt;CAP_SYS_NICE&lt;/CODE&gt; permission.
24567
24568 &lt;br&gt;&lt;br&gt;
24569 </synopsis>
24570 </function>
24571 </construct>
24572 <construct id="function-nice" type="function">
24573 <function returntype="int">
24574 <prototype>
24575 <parameter content="int increment"/>
24576 </prototype>
24577 <headers>
24578 <header filename = "sys/resource.h"/>
24579 <header filename = "unistd.h"/>
24580 </headers>
24581 <synopsis>
24582 Increment the nice value of the calling process by &lt;VAR&gt;increment&lt;/VAR&gt;.
24583 The return value is the new nice value on success, and &lt;CODE&gt;-1&lt;/CODE&gt; on
24584 failure. In the case of failure, &lt;CODE&gt;errno&lt;/CODE&gt; will be set to the
24585 same values as for &lt;CODE&gt;setpriority&lt;/CODE&gt;.
24586 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt; Here is an equivalent definition of &lt;CODE&gt;nice&lt;/CODE&gt;:
24587 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
24588 int&lt;br&gt;
24589 nice (int increment)&lt;br&gt;
24590 {&lt;br&gt;
24591 int result, old = getpriority (PRIO_PROCESS, 0);&lt;br&gt;
24592 result = setpriority (PRIO_PROCESS, 0, old + increment);&lt;br&gt;
24593 if (result != -1)&lt;br&gt;
24594 return old + increment;&lt;br&gt;
24595 else&lt;br&gt;
24596 return -1;&lt;br&gt;
24597 }&lt;br&gt;
24598 &lt;/pre&gt;
24599 </synopsis>
24600 </function>
24601 </construct>
24602 <construct id="dtype-cpu_set_t" type="dtype">
24603 <structure>
24604 </structure>
24605 </construct>
24606 <construct id="function-sched_getaffinity" type="function">
24607 <function returntype="int">
24608 <prototype>
24609 <parameter content="pid_t pid"/>
24610 <parameter content="size_t cpusetsize"/>
24611 <parameter content="cpu_set_t *cpuset"/>
24612 </prototype>
24613 <headers>
24614 <header filename = "sched.h"/>
24615 </headers>
24616 <synopsis>
24617 &lt;br&gt;&lt;br&gt; This functions stores the CPU affinity mask for the process or thread
24618 with the ID &lt;VAR&gt;pid&lt;/VAR&gt; in the &lt;VAR&gt;cpusetsize&lt;/VAR&gt; bytes long bitmap
24619 pointed to by &lt;VAR&gt;cpuset&lt;/VAR&gt;. If successful, the function always
24620 initializes all bits in the &lt;CODE&gt;cpu_set_t&lt;/CODE&gt; object and returns zero.
24621 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;pid&lt;/VAR&gt; does not correspond to a process or thread on the system
24622 the or the function fails for some other reason, it returns &lt;CODE&gt;-1&lt;/CODE&gt;
24623 and &lt;CODE&gt;errno&lt;/CODE&gt; is set to represent the error condition.
24624 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
24625
24626 &lt;DT&gt;&lt;CODE&gt;ESRCH&lt;/CODE&gt;
24627 &lt;DD&gt;
24628 No process or thread with the given ID found.
24629 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EFAULT
24630 The pointer &lt;VAR&gt;cpuset&lt;/VAR&gt; is does not point to a valid object.
24631
24632 &lt;br&gt;&lt;br&gt; This function is a GNU extension and is declared in &lt;TT&gt;sched.h&lt;/TT&gt;.
24633 </synopsis>
24634 </function>
24635 </construct>
24636 <construct id="function-sched_setaffinity" type="function">
24637 <function returntype="int">
24638 <prototype>
24639 <parameter content="pid_t pid"/>
24640 <parameter content="size_t cpusetsize"/>
24641 <parameter content="const cpu_set_t *cpuset"/>
24642 </prototype>
24643 <headers>
24644 <header filename = "sched.h"/>
24645 </headers>
24646 <synopsis>
24647 &lt;br&gt;&lt;br&gt; This function installs the &lt;VAR&gt;cpusetsize&lt;/VAR&gt; bytes long affinity mask
24648 pointed to by &lt;VAR&gt;cpuset&lt;/VAR&gt; for the process or thread with the ID &lt;VAR&gt;pid&lt;/VAR&gt;.
24649 If successful the function returns zero and the scheduler will in future
24650 take the affinity information into account.
24651 &lt;br&gt;&lt;br&gt; If the function fails it will return &lt;CODE&gt;-1&lt;/CODE&gt; and &lt;CODE&gt;errno&lt;/CODE&gt; is set
24652 to the error code:
24653 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
24654
24655 &lt;DT&gt;&lt;CODE&gt;ESRCH&lt;/CODE&gt;
24656 &lt;DD&gt;
24657 No process or thread with the given ID found.
24658 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EFAULT
24659 The pointer &lt;VAR&gt;cpuset&lt;/VAR&gt; is does not point to a valid object.
24660 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
24661 The bitset is not valid. This might mean that the affinity set might
24662 not leave a processor for the process or thread to run on.
24663
24664 &lt;br&gt;&lt;br&gt; This function is a GNU extension and is declared in &lt;TT&gt;sched.h&lt;/TT&gt;.
24665 </synopsis>
24666 </function>
24667 </construct>
24668 <construct id="function-getpagesize" type="function">
24669 <function returntype="int">
24670 <prototype>
24671 <parameter content="void"/>
24672 </prototype>
24673 <headers>
24674 <header filename = "unistd.h"/>
24675 </headers>
24676 <synopsis>
24677 The &lt;CODE&gt;getpagesize&lt;/CODE&gt; function returns the page size of the process.
24678 This value is fixed for the runtime of the process but can vary in
24679 different runs of the application.
24680 &lt;br&gt;&lt;br&gt; The function is declared in &lt;TT&gt;unistd.h&lt;/TT&gt;.
24681 </synopsis>
24682 </function>
24683 </construct>
24684 <construct id="function-get_phys_pages" type="function">
24685 <function returntype="long int">
24686 <prototype>
24687 <parameter content="void"/>
24688 </prototype>
24689 <headers>
24690 <header filename = "sys/sysinfo.h"/>
24691 </headers>
24692 <synopsis>
24693 The &lt;CODE&gt;get_phys_pages&lt;/CODE&gt; function returns the total number of pages of
24694 physical the system has. To get the amount of memory this number has to
24695 be multiplied by the page size.
24696 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
24697 </synopsis>
24698 </function>
24699 </construct>
24700 <construct id="function-get_avphys_pages" type="function">
24701 <function returntype="long int">
24702 <prototype>
24703 <parameter content="void"/>
24704 </prototype>
24705 <headers>
24706 <header filename = "sys/sysinfo.h"/>
24707 </headers>
24708 <synopsis>
24709 The &lt;CODE&gt;get_phys_pages&lt;/CODE&gt; function returns the number of available pages of
24710 physical the system has. To get the amount of memory this number has to
24711 be multiplied by the page size.
24712 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
24713 </synopsis>
24714 </function>
24715 </construct>
24716 <construct id="function-get_nprocs_conf" type="function">
24717 <function returntype="int">
24718 <prototype>
24719 <parameter content="void"/>
24720 </prototype>
24721 <headers>
24722 <header filename = "sys/sysinfo.h"/>
24723 </headers>
24724 <synopsis>
24725 The &lt;CODE&gt;get_nprocs_conf&lt;/CODE&gt; function returns the number of processors the
24726 operating system configured.
24727 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
24728 </synopsis>
24729 </function>
24730 </construct>
24731 <construct id="function-get_nprocs" type="function">
24732 <function returntype="int">
24733 <prototype>
24734 <parameter content="void"/>
24735 </prototype>
24736 <headers>
24737 <header filename = "sys/sysinfo.h"/>
24738 </headers>
24739 <synopsis>
24740 The &lt;CODE&gt;get_nprocs&lt;/CODE&gt; function returns the number of available processors.
24741 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
24742 </synopsis>
24743 </function>
24744 </construct>
24745 <construct id="function-getloadavg" type="function">
24746 <function returntype="int">
24747 <prototype>
24748 <parameter content="double loadavg[]"/>
24749 <parameter content="int nelem"/>
24750 </prototype>
24751 <headers>
24752 <header filename = "stdlib.h"/>
24753 </headers>
24754 <synopsis>
24755 This function gets the 1, 5 and 15 minute load averages of the
24756 system. The values are placed in &lt;VAR&gt;loadavg&lt;/VAR&gt;. &lt;CODE&gt;getloadavg&lt;/CODE&gt; will
24757 place at most &lt;VAR&gt;nelem&lt;/VAR&gt; elements into the array but never more than
24758 three elements. The return value is the number of elements written to
24759 &lt;VAR&gt;loadavg&lt;/VAR&gt;, or -1 on error.
24760 &lt;br&gt;&lt;br&gt; This function is declared in &lt;TT&gt;stdlib.h&lt;/TT&gt;.
24761 </synopsis>
24762 </function>
24763 </construct>
24764 <construct id="function-isatty" type="function">
24765 <function returntype="int">
24766 <prototype>
24767 <parameter content="int filedes"/>
24768 </prototype>
24769 <headers>
24770 <header filename = "unistd.h"/>
24771 </headers>
24772 <synopsis>
24773 This function returns &lt;CODE&gt;1&lt;/CODE&gt; if &lt;VAR&gt;filedes&lt;/VAR&gt; is a file descriptor
24774 associated with an open terminal device, and 0 otherwise.
24775 </synopsis>
24776 </function>
24777 </construct>
24778 <construct id="function-ttyname" type="function">
24779 <function returntype="char *">
24780 <prototype>
24781 <parameter content="int filedes"/>
24782 </prototype>
24783 <headers>
24784 <header filename = "unistd.h"/>
24785 </headers>
24786 <synopsis>
24787 If the file descriptor &lt;VAR&gt;filedes&lt;/VAR&gt; is associated with a terminal
24788 device, the &lt;CODE&gt;ttyname&lt;/CODE&gt; function returns a pointer to a
24789 statically-allocated, null-terminated string containing the file name of
24790 the terminal file. The value is a null pointer if the file descriptor
24791 isn't associated with a terminal, or the file name cannot be determined.
24792 </synopsis>
24793 </function>
24794 </construct>
24795 <construct id="function-ttyname_r" type="function">
24796 <function returntype="int">
24797 <prototype>
24798 <parameter content="int filedes"/>
24799 <parameter content="char *buf"/>
24800 <parameter content="size_t len"/>
24801 </prototype>
24802 <headers>
24803 <header filename = "unistd.h"/>
24804 </headers>
24805 <synopsis>
24806 The &lt;CODE&gt;ttyname_r&lt;/CODE&gt; function is similar to the &lt;CODE&gt;ttyname&lt;/CODE&gt; function
24807 except that it places its result into the user-specified buffer starting
24808 at &lt;VAR&gt;buf&lt;/VAR&gt; with length &lt;VAR&gt;len&lt;/VAR&gt;.
24809 &lt;br&gt;&lt;br&gt; The normal return value from &lt;CODE&gt;ttyname_r&lt;/CODE&gt; is 0. Otherwise an
24810 error number is returned to indicate the error. The following
24811 &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
24812 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
24813
24814 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
24815 &lt;DD&gt;
24816 The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not a valid file descriptor.
24817 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTTY
24818 The &lt;VAR&gt;filedes&lt;/VAR&gt; is not associated with a terminal.
24819 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ERANGE
24820 The buffer length &lt;VAR&gt;len&lt;/VAR&gt; is too small to store the string to be
24821 returned.
24822
24823 </synopsis>
24824 </function>
24825 </construct>
24826 <construct id="struct-termios" type="struct">
24827 <structure>
24828 <synopsis>
24829 Structure that records all the I/O attributes of a terminal. The
24830 structure includes at least the following members:
24831 &lt;br&gt;&lt;br&gt;
24832 </synopsis>
24833 <elements>
24834 <element content="tcflag_t c_iflag">
24835 <synopsis>
24836 A bit mask specifying flags for input modes; see Input Modes.
24837 &lt;br&gt;&lt;br&gt;
24838 </synopsis>
24839 </element>
24840 <element content="tcflag_t c_oflag">
24841 <synopsis>
24842 A bit mask specifying flags for output modes; see Output Modes.
24843 &lt;br&gt;&lt;br&gt;
24844 </synopsis>
24845 </element>
24846 <element content="tcflag_t c_cflag">
24847 <synopsis>
24848 A bit mask specifying flags for control modes; see Control Modes.
24849 &lt;br&gt;&lt;br&gt;
24850 </synopsis>
24851 </element>
24852 <element content="tcflag_t c_lflag">
24853 <synopsis>
24854 A bit mask specifying flags for local modes; see Local Modes.
24855 &lt;br&gt;&lt;br&gt;
24856 </synopsis>
24857 </element>
24858 </elements>
24859 </structure>
24860 </construct>
24861 <construct id="dtype-tcflag_t" type="dtype">
24862 <structure>
24863 </structure>
24864 </construct>
24865 <construct id="dtype-cc_t" type="dtype">
24866 <structure>
24867 </structure>
24868 </construct>
24869 <construct id="function-tcgetattr" type="function">
24870 <function returntype="int">
24871 <prototype>
24872 <parameter content="int filedes"/>
24873 <parameter content="struct termios *termios-p"/>
24874 </prototype>
24875 <headers>
24876 <header filename = "termios.h"/>
24877 </headers>
24878 <synopsis>
24879 This function is used to examine the attributes of the terminal
24880 device with file descriptor &lt;VAR&gt;filedes&lt;/VAR&gt;. The attributes are returned
24881 in the structure that &lt;VAR&gt;termios-p&lt;/VAR&gt; points to.
24882 &lt;br&gt;&lt;br&gt; If successful, &lt;CODE&gt;tcgetattr&lt;/CODE&gt; returns 0. A return value of -1
24883 indicates an error. The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are
24884 defined for this function:
24885 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
24886
24887 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
24888 &lt;DD&gt;
24889 The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not a valid file descriptor.
24890 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTTY
24891 The &lt;VAR&gt;filedes&lt;/VAR&gt; is not associated with a terminal.
24892
24893 </synopsis>
24894 </function>
24895 </construct>
24896 <construct id="function-tcsetattr" type="function">
24897 <function returntype="int">
24898 <prototype>
24899 <parameter content="int filedes"/>
24900 <parameter content="int when"/>
24901 <parameter content="const struct termios *termios-p"/>
24902 </prototype>
24903 <headers>
24904 <header filename = "termios.h"/>
24905 </headers>
24906 <synopsis>
24907 This function sets the attributes of the terminal device with file
24908 descriptor &lt;VAR&gt;filedes&lt;/VAR&gt;. The new attributes are taken from the
24909 structure that &lt;VAR&gt;termios-p&lt;/VAR&gt; points to.
24910 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;when&lt;/VAR&gt; argument specifies how to deal with input and output
24911 already queued. It can be one of the following values:
24912 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
24913
24914 &lt;DT&gt;&lt;CODE&gt;TCSANOW&lt;/CODE&gt;
24915 &lt;DD&gt;
24916
24917 Make the change immediately.
24918 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;TCSADRAIN&lt;/CODE&gt;
24919 &lt;DD&gt;
24920
24921 Make the change after waiting until all queued output has been written.
24922 You should usually use this option when changing parameters that affect
24923 output.
24924 &lt;br&gt;&lt;br&gt; &lt;LI&gt; TCSAFLUSH
24925
24926 This is like &lt;CODE&gt;TCSADRAIN&lt;/CODE&gt;, but also discards any queued input.
24927 &lt;br&gt;&lt;br&gt; &lt;LI&gt; TCSASOFT
24928
24929 This is a flag bit that you can add to any of the above alternatives.
24930 Its meaning is to inhibit alteration of the state of the terminal
24931 hardware. It is a BSD extension; it is only supported on BSD systems
24932 and the GNU system.
24933 &lt;br&gt;&lt;br&gt; Using &lt;CODE&gt;TCSASOFT&lt;/CODE&gt; is exactly the same as setting the &lt;CODE&gt;CIGNORE&lt;/CODE&gt;
24934 bit in the &lt;CODE&gt;c_cflag&lt;/CODE&gt; member of the structure &lt;VAR&gt;termios-p&lt;/VAR&gt; points
24935 to. , for a description of &lt;CODE&gt;CIGNORE&lt;/CODE&gt;.
24936
24937 &lt;br&gt;&lt;br&gt; If this function is called from a background process on its controlling
24938 terminal, normally all processes in the process group are sent a
24939 &lt;CODE&gt;SIGTTOU&lt;/CODE&gt; signal, in the same way as if the process were trying to
24940 write to the terminal. The exception is if the calling process itself
24941 is ignoring or blocking &lt;CODE&gt;SIGTTOU&lt;/CODE&gt; signals, in which case the
24942 operation is performed and no signal is sent. .
24943 &lt;br&gt;&lt;br&gt; If successful, &lt;CODE&gt;tcsetattr&lt;/CODE&gt; returns 0. A return value of
24944 -1 indicates an error. The following &lt;CODE&gt;errno&lt;/CODE&gt; error
24945 conditions are defined for this function:
24946 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
24947
24948 &lt;LI&gt; EBADF
24949 The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not a valid file descriptor.
24950 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTTY
24951 The &lt;VAR&gt;filedes&lt;/VAR&gt; is not associated with a terminal.
24952 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
24953 Either the value of the &lt;CODE&gt;when&lt;/CODE&gt; argument is not valid, or there is
24954 something wrong with the data in the &lt;VAR&gt;termios-p&lt;/VAR&gt; argument.
24955
24956 </synopsis>
24957 </function>
24958 </construct>
24959 <construct id="function-cfgetospeed" type="function">
24960 <function returntype="speed_t">
24961 <prototype>
24962 <parameter content="const struct termios *termios-p"/>
24963 </prototype>
24964 <headers>
24965 <header filename = "termios.h"/>
24966 </headers>
24967 <synopsis>
24968 This function returns the output line speed stored in the structure
24969 &lt;CODE&gt;*&lt;VAR&gt;termios-p&lt;/VAR&gt;&lt;/CODE&gt;.
24970 </synopsis>
24971 </function>
24972 </construct>
24973 <construct id="function-cfgetispeed" type="function">
24974 <function returntype="speed_t">
24975 <prototype>
24976 <parameter content="const struct termios *termios-p"/>
24977 </prototype>
24978 <headers>
24979 <header filename = "termios.h"/>
24980 </headers>
24981 <synopsis>
24982 This function returns the input line speed stored in the structure
24983 &lt;CODE&gt;*&lt;VAR&gt;termios-p&lt;/VAR&gt;&lt;/CODE&gt;.
24984 </synopsis>
24985 </function>
24986 </construct>
24987 <construct id="function-cfsetospeed" type="function">
24988 <function returntype="int">
24989 <prototype>
24990 <parameter content="struct termios *termios-p"/>
24991 <parameter content="speed_t speed"/>
24992 </prototype>
24993 <headers>
24994 <header filename = "termios.h"/>
24995 </headers>
24996 <synopsis>
24997 This function stores &lt;VAR&gt;speed&lt;/VAR&gt; in &lt;CODE&gt;*&lt;VAR&gt;termios-p&lt;/VAR&gt;&lt;/CODE&gt; as the output
24998 speed. The normal return value is 0; a value of -1
24999 indicates an error. If &lt;VAR&gt;speed&lt;/VAR&gt; is not a speed, &lt;CODE&gt;cfsetospeed&lt;/CODE&gt;
25000 returns -1.
25001 </synopsis>
25002 </function>
25003 </construct>
25004 <construct id="function-cfsetispeed" type="function">
25005 <function returntype="int">
25006 <prototype>
25007 <parameter content="struct termios *termios-p"/>
25008 <parameter content="speed_t speed"/>
25009 </prototype>
25010 <headers>
25011 <header filename = "termios.h"/>
25012 </headers>
25013 <synopsis>
25014 This function stores &lt;VAR&gt;speed&lt;/VAR&gt; in &lt;CODE&gt;*&lt;VAR&gt;termios-p&lt;/VAR&gt;&lt;/CODE&gt; as the input
25015 speed. The normal return value is 0; a value of -1
25016 indicates an error. If &lt;VAR&gt;speed&lt;/VAR&gt; is not a speed, &lt;CODE&gt;cfsetospeed&lt;/CODE&gt;
25017 returns -1.
25018 </synopsis>
25019 </function>
25020 </construct>
25021 <construct id="function-cfsetspeed" type="function">
25022 <function returntype="int">
25023 <prototype>
25024 <parameter content="struct termios *termios-p"/>
25025 <parameter content="speed_t speed"/>
25026 </prototype>
25027 <headers>
25028 <header filename = "termios.h"/>
25029 </headers>
25030 <synopsis>
25031 This function stores &lt;VAR&gt;speed&lt;/VAR&gt; in &lt;CODE&gt;*&lt;VAR&gt;termios-p&lt;/VAR&gt;&lt;/CODE&gt; as both the
25032 input and output speeds. The normal return value is 0; a value
25033 of -1 indicates an error. If &lt;VAR&gt;speed&lt;/VAR&gt; is not a speed,
25034 &lt;CODE&gt;cfsetspeed&lt;/CODE&gt; returns -1. This function is an extension in
25035 4.4 BSD.
25036 </synopsis>
25037 </function>
25038 </construct>
25039 <construct id="dtype-speed_t" type="dtype">
25040 <structure>
25041 </structure>
25042 </construct>
25043 <construct id="function-cfmakeraw" type="function">
25044 <function returntype="void">
25045 <prototype>
25046 <parameter content="struct termios *termios-p"/>
25047 </prototype>
25048 <headers>
25049 <header filename = "termios.h"/>
25050 </headers>
25051 <synopsis>
25052 This function provides an easy way to set up &lt;CODE&gt;*&lt;VAR&gt;termios-p&lt;/VAR&gt;&lt;/CODE&gt; for
25053 what has traditionally been called ``raw mode'' in BSD. This uses
25054 noncanonical input, and turns off most processing to give an unmodified
25055 channel to the terminal.
25056 &lt;br&gt;&lt;br&gt; It does exactly this:
25057 &lt;pre&gt;&lt;br&gt;
25058 &lt;VAR&gt;termios-p&lt;/VAR&gt;-&gt;c_iflag &amp;= ~(IGNBRK|BRKINT|PARMRK|ISTRIP&lt;br&gt;
25059 |INLCR|IGNCR|ICRNL|IXON);&lt;br&gt;
25060 &lt;VAR&gt;termios-p&lt;/VAR&gt;-&gt;c_oflag &amp;= ~OPOST;&lt;br&gt;
25061 &lt;VAR&gt;termios-p&lt;/VAR&gt;-&gt;c_lflag &amp;= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);&lt;br&gt;
25062 &lt;VAR&gt;termios-p&lt;/VAR&gt;-&gt;c_cflag &amp;= ~(CSIZE|PARENB);&lt;br&gt;
25063 &lt;VAR&gt;termios-p&lt;/VAR&gt;-&gt;c_cflag |= CS8;&lt;br&gt;
25064 &lt;/pre&gt;
25065 </synopsis>
25066 </function>
25067 </construct>
25068 <construct id="struct-sgttyb" type="struct">
25069 <structure>
25070 <synopsis>
25071 This structure is an input or output parameter list for &lt;CODE&gt;gtty&lt;/CODE&gt; and
25072 &lt;CODE&gt;stty&lt;/CODE&gt;.
25073 &lt;br&gt;&lt;br&gt;
25074 </synopsis>
25075 <elements>
25076 <element content="char sg_ispeed">
25077 <synopsis>
25078 Line speed for input
25079 </synopsis>
25080 </element>
25081 <element content="char sg_ospeed">
25082 <synopsis>
25083 Line speed for output
25084 </synopsis>
25085 </element>
25086 <element content="char sg_erase">
25087 <synopsis>
25088 Erase character
25089 </synopsis>
25090 </element>
25091 <element content="char sg_kill">
25092 <synopsis>
25093 Kill character
25094 </synopsis>
25095 </element>
25096 </elements>
25097 </structure>
25098 </construct>
25099 <construct id="function-gtty" type="function">
25100 <function returntype="int">
25101 <prototype>
25102 <parameter content="int filedes"/>
25103 <parameter content="struct sgttyb *attributes"/>
25104 </prototype>
25105 <headers>
25106 <header filename = "termios.h"/>
25107 <header filename = "sgtty.h"/>
25108 </headers>
25109 <synopsis>
25110 This function gets the attributes of a terminal.
25111 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;gtty&lt;/CODE&gt; sets *&lt;VAR&gt;attributes&lt;/VAR&gt; to describe the terminal attributes
25112 of the terminal which is open with file descriptor &lt;VAR&gt;filedes&lt;/VAR&gt;.
25113 </synopsis>
25114 </function>
25115 </construct>
25116 <construct id="function-stty" type="function">
25117 <function returntype="int">
25118 <prototype>
25119 <parameter content="int filedes"/>
25120 <parameter content="struct sgttyb * attributes"/>
25121 </prototype>
25122 <headers>
25123 <header filename = "sgtty.h"/>
25124 </headers>
25125 <synopsis>
25126 &lt;br&gt;&lt;br&gt; This function sets the attributes of a terminal.
25127 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;stty&lt;/CODE&gt; sets the terminal attributes of the terminal which is open with
25128 file descriptor &lt;VAR&gt;filedes&lt;/VAR&gt; to those described by *&lt;VAR&gt;filedes&lt;/VAR&gt;.
25129 </synopsis>
25130 </function>
25131 </construct>
25132 <construct id="function-tcsendbreak" type="function">
25133 <function returntype="int">
25134 <prototype>
25135 <parameter content="int filedes"/>
25136 <parameter content="int duration"/>
25137 </prototype>
25138 <headers>
25139 <header filename = "termios.h"/>
25140 </headers>
25141 <synopsis>
25142 This function generates a break condition by transmitting a stream of
25143 zero bits on the terminal associated with the file descriptor
25144 &lt;VAR&gt;filedes&lt;/VAR&gt;. The duration of the break is controlled by the
25145 &lt;VAR&gt;duration&lt;/VAR&gt; argument. If zero, the duration is between 0.25 and 0.5
25146 seconds. The meaning of a nonzero value depends on the operating system.
25147 &lt;br&gt;&lt;br&gt; This function does nothing if the terminal is not an asynchronous serial
25148 data port.
25149 &lt;br&gt;&lt;br&gt; The return value is normally zero. In the event of an error, a value
25150 of -1 is returned. The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions
25151 are defined for this function:
25152 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
25153
25154 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
25155 &lt;DD&gt;
25156 The &lt;VAR&gt;filedes&lt;/VAR&gt; is not a valid file descriptor.
25157 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTTY
25158 The &lt;VAR&gt;filedes&lt;/VAR&gt; is not associated with a terminal device.
25159
25160 </synopsis>
25161 </function>
25162 </construct>
25163 <construct id="function-tcdrain" type="function">
25164 <function returntype="int">
25165 <prototype>
25166 <parameter content="int filedes"/>
25167 </prototype>
25168 <headers>
25169 <header filename = "termios.h"/>
25170 </headers>
25171 <synopsis>
25172 The &lt;CODE&gt;tcdrain&lt;/CODE&gt; function waits until all queued
25173 output to the terminal &lt;VAR&gt;filedes&lt;/VAR&gt; has been transmitted.
25174 &lt;br&gt;&lt;br&gt; This function is a cancellation point in multi-threaded programs. This
25175 is a problem if the thread allocates some resources (like memory, file
25176 descriptors, semaphores or whatever) at the time &lt;CODE&gt;tcdrain&lt;/CODE&gt; is
25177 called. If the thread gets canceled these resources stay allocated
25178 until the program ends. To avoid this calls to &lt;CODE&gt;tcdrain&lt;/CODE&gt; should be
25179 protected using cancellation handlers.
25180 &lt;br&gt;&lt;br&gt; The return value is normally zero. In the event of an error, a value
25181 of -1 is returned. The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions
25182 are defined for this function:
25183 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
25184
25185 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
25186 &lt;DD&gt;
25187 The &lt;VAR&gt;filedes&lt;/VAR&gt; is not a valid file descriptor.
25188 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTTY
25189 The &lt;VAR&gt;filedes&lt;/VAR&gt; is not associated with a terminal device.
25190 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINTR
25191 The operation was interrupted by delivery of a signal.
25192 .
25193
25194 </synopsis>
25195 </function>
25196 </construct>
25197 <construct id="function-tcflush" type="function">
25198 <function returntype="int">
25199 <prototype>
25200 <parameter content="int filedes"/>
25201 <parameter content="int queue"/>
25202 </prototype>
25203 <headers>
25204 <header filename = "termios.h"/>
25205 </headers>
25206 <synopsis>
25207 The &lt;CODE&gt;tcflush&lt;/CODE&gt; function is used to clear the input and/or output
25208 queues associated with the terminal file &lt;VAR&gt;filedes&lt;/VAR&gt;. The &lt;VAR&gt;queue&lt;/VAR&gt;
25209 argument specifies which queue(s) to clear, and can be one of the
25210 following values:
25211 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
25212
25213
25214 &lt;DT&gt;&lt;CODE&gt;TCIFLUSH&lt;/CODE&gt;
25215 &lt;DD&gt;
25216 &lt;br&gt;&lt;br&gt; Clear any input data received, but not yet read.
25217 &lt;br&gt;&lt;br&gt;
25218 &lt;DT&gt;&lt;CODE&gt;TCOFLUSH&lt;/CODE&gt;
25219 &lt;DD&gt;
25220 &lt;br&gt;&lt;br&gt; Clear any output data written, but not yet transmitted.
25221 &lt;br&gt;&lt;br&gt;
25222 &lt;LI&gt; TCIOFLUSH
25223 &lt;br&gt;&lt;br&gt; Clear both queued input and output.
25224
25225 &lt;br&gt;&lt;br&gt; The return value is normally zero. In the event of an error, a value
25226 of -1 is returned. The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions
25227 are defined for this function:
25228 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
25229
25230 &lt;LI&gt; EBADF
25231 The &lt;VAR&gt;filedes&lt;/VAR&gt; is not a valid file descriptor.
25232 &lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTTY
25233 The &lt;VAR&gt;filedes&lt;/VAR&gt; is not associated with a terminal device.
25234 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
25235 A bad value was supplied as the &lt;VAR&gt;queue&lt;/VAR&gt; argument.
25236
25237 &lt;br&gt;&lt;br&gt; It is unfortunate that this function is named &lt;CODE&gt;tcflush&lt;/CODE&gt;, because
25238 the term ``flush'' is normally used for quite another operation---waiting
25239 until all output is transmitted---and using it for discarding input or
25240 output would be confusing. Unfortunately, the name &lt;CODE&gt;tcflush&lt;/CODE&gt; comes
25241 from POSIX and we cannot change it.
25242 </synopsis>
25243 </function>
25244 </construct>
25245 <construct id="function-tcflow" type="function">
25246 <function returntype="int">
25247 <prototype>
25248 <parameter content="int filedes"/>
25249 <parameter content="int action"/>
25250 </prototype>
25251 <headers>
25252 <header filename = "termios.h"/>
25253 </headers>
25254 <synopsis>
25255 The &lt;CODE&gt;tcflow&lt;/CODE&gt; function is used to perform operations relating to
25256 XON/XOFF flow control on the terminal file specified by &lt;VAR&gt;filedes&lt;/VAR&gt;.
25257 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;action&lt;/VAR&gt; argument specifies what operation to perform, and can
25258 be one of the following values:
25259 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
25260
25261
25262 &lt;DT&gt;&lt;CODE&gt;TCOOFF&lt;/CODE&gt;
25263 &lt;DD&gt;
25264 Suspend transmission of output.
25265 &lt;br&gt;&lt;br&gt;
25266 &lt;DT&gt;&lt;CODE&gt;TCOON&lt;/CODE&gt;
25267 &lt;DD&gt;
25268 Restart transmission of output.
25269 &lt;br&gt;&lt;br&gt;
25270 &lt;LI&gt; TCIOFF
25271 Transmit a STOP character.
25272 &lt;br&gt;&lt;br&gt;
25273 &lt;LI&gt; TCION
25274 Transmit a START character.
25275
25276 &lt;br&gt;&lt;br&gt; For more information about the STOP and START characters, see Special
25277 Characters.
25278 &lt;br&gt;&lt;br&gt; The return value is normally zero. In the event of an error, a value
25279 of -1 is returned. The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions
25280 are defined for this function:
25281 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
25282
25283
25284 &lt;LI&gt; EBADF
25285 The &lt;VAR&gt;filedes&lt;/VAR&gt; is not a valid file descriptor.
25286 &lt;br&gt;&lt;br&gt;
25287 &lt;LI&gt; ENOTTY
25288 The &lt;VAR&gt;filedes&lt;/VAR&gt; is not associated with a terminal device.
25289 &lt;br&gt;&lt;br&gt;
25290 &lt;LI&gt; EINVAL
25291 A bad value was supplied as the &lt;VAR&gt;action&lt;/VAR&gt; argument.
25292
25293 </synopsis>
25294 </function>
25295 </construct>
25296 <construct id="function-getpt" type="function">
25297 <function returntype="int">
25298 <prototype>
25299 <parameter content="void"/>
25300 </prototype>
25301 <headers>
25302 <header filename = "stdlib.h"/>
25303 </headers>
25304 <synopsis>
25305 The &lt;CODE&gt;getpt&lt;/CODE&gt; function returns a new file descriptor for the next
25306 available master pseudo-terminal. The normal return value from
25307 &lt;CODE&gt;getpt&lt;/CODE&gt; is a non-negative integer file descriptor. In the case of
25308 an error, a value of -1 is returned instead. The following
25309 &lt;CODE&gt;errno&lt;/CODE&gt; conditions are defined for this function:
25310 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
25311
25312 &lt;DT&gt;&lt;CODE&gt;ENOENT&lt;/CODE&gt;
25313 &lt;DD&gt;
25314 There are no free master pseudo-terminals available.
25315
25316 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
25317 </synopsis>
25318 </function>
25319 </construct>
25320 <construct id="function-grantpt" type="function">
25321 <function returntype="int">
25322 <prototype>
25323 <parameter content="int filedes"/>
25324 </prototype>
25325 <headers>
25326 <header filename = "stdlib.h"/>
25327 </headers>
25328 <synopsis>
25329 The &lt;CODE&gt;grantpt&lt;/CODE&gt; function changes the ownership and access permission
25330 of the slave pseudo-terminal device corresponding to the master
25331 pseudo-terminal device associated with the file descriptor
25332 &lt;VAR&gt;filedes&lt;/VAR&gt;. The owner is set from the real user ID of the calling
25333 process , and the group is set to a special
25334 group (typically tty) or from the real group ID of the calling
25335 process. The access permission is set such that the file is both
25336 readable and writable by the owner and only writable by the group.
25337 &lt;br&gt;&lt;br&gt; On some systems this function is implemented by invoking a special
25338 &lt;CODE&gt;setuid&lt;/CODE&gt; root program. As a
25339 consequence, installing a signal handler for the &lt;CODE&gt;SIGCHLD&lt;/CODE&gt; signal
25340 may interfere with a call to
25341 &lt;CODE&gt;grantpt&lt;/CODE&gt;.
25342 &lt;br&gt;&lt;br&gt; The normal return value from &lt;CODE&gt;grantpt&lt;/CODE&gt; is 0; a value of
25343 -1 is returned in case of failure. The following &lt;CODE&gt;errno&lt;/CODE&gt;
25344 error conditions are defined for this function:
25345 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
25346
25347 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
25348 &lt;DD&gt;
25349 The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not a valid file descriptor.
25350 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
25351 The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not associated with a master pseudo-terminal
25352 device.
25353 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EACCES
25354 The slave pseudo-terminal device corresponding to the master associated
25355 with &lt;VAR&gt;filedes&lt;/VAR&gt; could not be accessed.
25356
25357 &lt;br&gt;&lt;br&gt;
25358 </synopsis>
25359 </function>
25360 </construct>
25361 <construct id="function-unlockpt" type="function">
25362 <function returntype="int">
25363 <prototype>
25364 <parameter content="int filedes"/>
25365 </prototype>
25366 <headers>
25367 <header filename = "stdlib.h"/>
25368 </headers>
25369 <synopsis>
25370 The &lt;CODE&gt;unlockpt&lt;/CODE&gt; function unlocks the slave pseudo-terminal device
25371 corresponding to the master pseudo-terminal device associated with the
25372 file descriptor &lt;VAR&gt;filedes&lt;/VAR&gt;. On many systems, the slave can only be
25373 opened after unlocking, so portable applications should always call
25374 &lt;CODE&gt;unlockpt&lt;/CODE&gt; before trying to open the slave.
25375 &lt;br&gt;&lt;br&gt; The normal return value from &lt;CODE&gt;unlockpt&lt;/CODE&gt; is 0; a value of
25376 -1 is returned in case of failure. The following &lt;CODE&gt;errno&lt;/CODE&gt;
25377 error conditions are defined for this function:
25378 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
25379
25380 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
25381 &lt;DD&gt;
25382 The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not a valid file descriptor.
25383 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
25384 The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not associated with a master pseudo-terminal
25385 device.
25386
25387 </synopsis>
25388 </function>
25389 </construct>
25390 <construct id="function-ptsname" type="function">
25391 <function returntype="char *">
25392 <prototype>
25393 <parameter content="int filedes"/>
25394 </prototype>
25395 <headers>
25396 <header filename = "stdlib.h"/>
25397 </headers>
25398 <synopsis>
25399 If the file descriptor &lt;VAR&gt;filedes&lt;/VAR&gt; is associated with a
25400 master pseudo-terminal device, the &lt;CODE&gt;ptsname&lt;/CODE&gt; function returns a
25401 pointer to a statically-allocated, null-terminated string containing the
25402 file name of the associated slave pseudo-terminal file. This string
25403 might be overwritten by subsequent calls to &lt;CODE&gt;ptsname&lt;/CODE&gt;.
25404 </synopsis>
25405 </function>
25406 </construct>
25407 <construct id="function-ptsname_r" type="function">
25408 <function returntype="int">
25409 <prototype>
25410 <parameter content="int filedes"/>
25411 <parameter content="char *buf"/>
25412 <parameter content="size_t len"/>
25413 </prototype>
25414 <headers>
25415 <header filename = "stdlib.h"/>
25416 </headers>
25417 <synopsis>
25418 The &lt;CODE&gt;ptsname_r&lt;/CODE&gt; function is similar to the &lt;CODE&gt;ptsname&lt;/CODE&gt; function
25419 except that it places its result into the user-specified buffer starting
25420 at &lt;VAR&gt;buf&lt;/VAR&gt; with length &lt;VAR&gt;len&lt;/VAR&gt;.
25421 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
25422 </synopsis>
25423 </function>
25424 </construct>
25425 <construct id="function-openpty" type="function">
25426 <function returntype="int">
25427 <prototype>
25428 <parameter content="int *amaster"/>
25429 <parameter content="int *aslave"/>
25430 <parameter content="char *name"/>
25431 <parameter content="const struct termios *termp"/>
25432 <parameter content="const struct winsize *winp"/>
25433 </prototype>
25434 <headers>
25435 <header filename = "pty.h"/>
25436 </headers>
25437 <synopsis>
25438 This function allocates and opens a pseudo-terminal pair, returning the
25439 file descriptor for the master in &lt;VAR&gt;*amaster&lt;/VAR&gt;, and the file
25440 descriptor for the slave in &lt;VAR&gt;*aslave&lt;/VAR&gt;. If the argument &lt;VAR&gt;name&lt;/VAR&gt;
25441 is not a null pointer, the file name of the slave pseudo-terminal
25442 device is stored in &lt;CODE&gt;*name&lt;/CODE&gt;. If &lt;VAR&gt;termp&lt;/VAR&gt; is not a null pointer,
25443 the terminal attributes of the slave are set to the ones specified in
25444 the structure that &lt;VAR&gt;termp&lt;/VAR&gt; points to .
25445 Likewise, if the &lt;VAR&gt;winp&lt;/VAR&gt; is not a null pointer, the screen size of
25446 the slave is set to the values specified in the structure that
25447 &lt;VAR&gt;winp&lt;/VAR&gt; points to.
25448 &lt;br&gt;&lt;br&gt; The normal return value from &lt;CODE&gt;openpty&lt;/CODE&gt; is 0; a value of
25449 -1 is returned in case of failure. The following &lt;CODE&gt;errno&lt;/CODE&gt;
25450 conditions are defined for this function:
25451 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
25452
25453 &lt;DT&gt;&lt;CODE&gt;ENOENT&lt;/CODE&gt;
25454 &lt;DD&gt;
25455 There are no free pseudo-terminal pairs available.
25456
25457 &lt;br&gt;&lt;br&gt; Warning: Using the &lt;CODE&gt;openpty&lt;/CODE&gt; function with &lt;VAR&gt;name&lt;/VAR&gt; not
25458 set to &lt;CODE&gt;NULL&lt;/CODE&gt; is very dangerous because it provides no
25459 protection against overflowing the string &lt;VAR&gt;name&lt;/VAR&gt;. You should use
25460 the &lt;CODE&gt;ttyname&lt;/CODE&gt; function on the file descriptor returned in
25461 &lt;VAR&gt;*slave&lt;/VAR&gt; to find out the file name of the slave pseudo-terminal
25462 device instead.
25463 </synopsis>
25464 </function>
25465 </construct>
25466 <construct id="function-forkpty" type="function">
25467 <function returntype="int">
25468 <prototype>
25469 <parameter content="int *amaster"/>
25470 <parameter content="char *name"/>
25471 <parameter content="const struct termios *termp"/>
25472 <parameter content="const struct winsize *winp"/>
25473 </prototype>
25474 <headers>
25475 <header filename = "pty.h"/>
25476 </headers>
25477 <synopsis>
25478 This function is similar to the &lt;CODE&gt;openpty&lt;/CODE&gt; function, but in
25479 addition, forks a new process and makes the
25480 newly opened slave pseudo-terminal device the controlling terminal
25481 for the child process.
25482 &lt;br&gt;&lt;br&gt; If the operation is successful, there are then both parent and child
25483 processes and both see &lt;CODE&gt;forkpty&lt;/CODE&gt; return, but with different values:
25484 it returns a value of 0 in the child process and returns the child's
25485 process ID in the parent process.
25486 &lt;br&gt;&lt;br&gt; If the allocation of a pseudo-terminal pair or the process creation
25487 failed, &lt;CODE&gt;forkpty&lt;/CODE&gt; returns a value of -1 in the parent
25488 process.
25489 &lt;br&gt;&lt;br&gt; Warning: The &lt;CODE&gt;forkpty&lt;/CODE&gt; function has the same problems with
25490 respect to the &lt;VAR&gt;name&lt;/VAR&gt; argument as &lt;CODE&gt;openpty&lt;/CODE&gt;.
25491 </synopsis>
25492 </function>
25493 </construct>
25494 <construct id="function-openlog" type="function">
25495 <function returntype="void">
25496 <prototype>
25497 <parameter content="const char *ident"/>
25498 <parameter content="int option"/>
25499 <parameter content="int facility"/>
25500 </prototype>
25501 <headers>
25502 <header filename = "syslog.h"/>
25503 </headers>
25504 <synopsis>
25505 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;openlog&lt;/CODE&gt; opens or reopens a connection to Syslog in preparation
25506 for submitting messages.
25507 &lt;br&gt;&lt;br&gt; &lt;VAR&gt;ident&lt;/VAR&gt; is an arbitrary identification string which future
25508 &lt;CODE&gt;syslog&lt;/CODE&gt; invocations will prefix to each message. This is intended
25509 to identify the source of the message, and people conventionally set it
25510 to the name of the program that will submit the messages.
25511 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;ident&lt;/VAR&gt; is NULL, or if &lt;CODE&gt;openlog&lt;/CODE&gt; is not called, the default
25512 identification string used in Syslog messages will be the program name,
25513 taken from argv[0].
25514 &lt;br&gt;&lt;br&gt; Please note that the string pointer &lt;VAR&gt;ident&lt;/VAR&gt; will be retained
25515 internally by the Syslog routines. You must not free the memory that
25516 &lt;VAR&gt;ident&lt;/VAR&gt; points to. It is also dangerous to pass a reference to an
25517 automatic variable since leaving the scope would mean ending the
25518 lifetime of the variable. If you want to change the &lt;VAR&gt;ident&lt;/VAR&gt; string,
25519 you must call &lt;CODE&gt;openlog&lt;/CODE&gt; again; overwriting the string pointed to by
25520 &lt;VAR&gt;ident&lt;/VAR&gt; is not thread-safe.
25521 &lt;br&gt;&lt;br&gt; You can cause the Syslog routines to drop the reference to &lt;VAR&gt;ident&lt;/VAR&gt; and
25522 go back to the default string (the program name taken from argv[0]), by
25523 calling &lt;CODE&gt;closelog&lt;/CODE&gt;: .
25524 &lt;br&gt;&lt;br&gt; In particular, if you are writing code for a shared library that might get
25525 loaded and then unloaded (e.g. a PAM module), and you use &lt;CODE&gt;openlog&lt;/CODE&gt;,
25526 you must call &lt;CODE&gt;closelog&lt;/CODE&gt; before any point where your library might
25527 get unloaded, as in this example:
25528 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
25529 #include &lt;syslog.h&gt;&lt;br&gt;
25530 &lt;br&gt;&lt;br&gt; void&lt;br&gt;
25531 shared_library_function (void)&lt;br&gt;
25532 {&lt;br&gt;
25533 openlog ("mylibrary", option, priority);&lt;br&gt;
25534 &lt;br&gt;&lt;br&gt; syslog (LOG_INFO, "shared library has been invoked");&lt;br&gt;
25535 &lt;br&gt;&lt;br&gt; closelog ();&lt;br&gt;
25536 }&lt;br&gt;
25537 &lt;/pre&gt;
25538 &lt;br&gt;&lt;br&gt; Without the call to &lt;CODE&gt;closelog&lt;/CODE&gt;, future invocations of &lt;CODE&gt;syslog&lt;/CODE&gt;
25539 by the program using the shared library may crash, if the library gets
25540 unloaded and the memory containing the string &lt;CODE&gt;"mylibrary"&lt;/CODE&gt; becomes
25541 unmapped. This is a limitation of the BSD syslog interface.
25542 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;openlog&lt;/CODE&gt; may or may not open the &lt;TT&gt;/dev/log&lt;/TT&gt; socket, depending
25543 on &lt;VAR&gt;option&lt;/VAR&gt;. If it does, it tries to open it and connect it as a
25544 stream socket. If that doesn't work, it tries to open it and connect it
25545 as a datagram socket. The socket has the ``Close on Exec'' attribute,
25546 so the kernel will close it if the process performs an exec.
25547 &lt;br&gt;&lt;br&gt; You don't have to use &lt;CODE&gt;openlog&lt;/CODE&gt;. If you call &lt;CODE&gt;syslog&lt;/CODE&gt; without
25548 having called &lt;CODE&gt;openlog&lt;/CODE&gt;, &lt;CODE&gt;syslog&lt;/CODE&gt; just opens the connection
25549 implicitly and uses defaults for the information in &lt;VAR&gt;ident&lt;/VAR&gt; and
25550 &lt;VAR&gt;options&lt;/VAR&gt;.
25551 &lt;br&gt;&lt;br&gt; &lt;VAR&gt;options&lt;/VAR&gt; is a bit string, with the bits as defined by the following
25552 single bit masks:
25553 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
25554
25555 &lt;DT&gt;&lt;CODE&gt;LOG_PERROR&lt;/CODE&gt;
25556 &lt;DD&gt;
25557 If on, &lt;CODE&gt;openlog&lt;/CODE&gt; sets up the connection so that any &lt;CODE&gt;syslog&lt;/CODE&gt;
25558 on this connection writes its message to the calling process' Standard
25559 Error stream in addition to submitting it to Syslog. If off, &lt;CODE&gt;syslog&lt;/CODE&gt;
25560 does not write the message to Standard Error.
25561 &lt;br&gt;&lt;br&gt; &lt;LI&gt; LOG_CONS
25562 If on, &lt;CODE&gt;openlog&lt;/CODE&gt; sets up the connection so that a &lt;CODE&gt;syslog&lt;/CODE&gt; on
25563 this connection that fails to submit a message to Syslog writes the
25564 message instead to system console. If off, &lt;CODE&gt;syslog&lt;/CODE&gt; does not write
25565 to the system console (but of course Syslog may write messages it
25566 receives to the console).
25567 &lt;br&gt;&lt;br&gt; &lt;LI&gt; LOG_PID
25568 When on, &lt;CODE&gt;openlog&lt;/CODE&gt; sets up the connection so that a &lt;CODE&gt;syslog&lt;/CODE&gt;
25569 on this connection inserts the calling process' Process ID (PID) into
25570 the message. When off, &lt;CODE&gt;openlog&lt;/CODE&gt; does not insert the PID.
25571 &lt;br&gt;&lt;br&gt; &lt;LI&gt; LOG_NDELAY
25572 When on, &lt;CODE&gt;openlog&lt;/CODE&gt; opens and connects the &lt;TT&gt;/dev/log&lt;/TT&gt; socket.
25573 When off, a future &lt;CODE&gt;syslog&lt;/CODE&gt; call must open and connect the socket.
25574 &lt;br&gt;&lt;br&gt; Portability note: In early systems, the sense of this bit was
25575 exactly the opposite.
25576 &lt;br&gt;&lt;br&gt; &lt;LI&gt; LOG_ODELAY
25577 This bit does nothing. It exists for backward compatibility.
25578 &lt;br&gt;&lt;br&gt;
25579 &lt;br&gt;&lt;br&gt; If any other bit in &lt;VAR&gt;options&lt;/VAR&gt; is on, the result is undefined.
25580 &lt;br&gt;&lt;br&gt; &lt;VAR&gt;facility&lt;/VAR&gt; is the default facility code for this connection. A
25581 &lt;CODE&gt;syslog&lt;/CODE&gt; on this connection that specifies default facility causes
25582 this facility to be associated with the message. See &lt;CODE&gt;syslog&lt;/CODE&gt; for
25583 possible values. A value of zero means the default default, which is
25584 &lt;CODE&gt;LOG_USER&lt;/CODE&gt;.
25585 &lt;br&gt;&lt;br&gt; If a Syslog connection is already open when you call &lt;CODE&gt;openlog&lt;/CODE&gt;,
25586 &lt;CODE&gt;openlog&lt;/CODE&gt; ``reopens'' the connection. Reopening is like opening
25587 except that if you specify zero for the default facility code, the
25588 default facility code simply remains unchanged and if you specify
25589 LOG_NDELAY and the socket is already open and connected, &lt;CODE&gt;openlog&lt;/CODE&gt;
25590 just leaves it that way.
25591 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt;
25592 </synopsis>
25593 </function>
25594 </construct>
25595 <construct id="function-syslog" type="function">
25596 <function returntype="void">
25597 <prototype>
25598 <parameter content="int facility_priority"/>
25599 <parameter content="char *format"/>
25600 <parameter content="..."/>
25601 </prototype>
25602 <headers>
25603 <header filename = "syslog.h"/>
25604 </headers>
25605 <synopsis>
25606 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;syslog&lt;/CODE&gt; submits a message to the Syslog facility. It does this by
25607 writing to the Unix domain socket &lt;CODE&gt;/dev/log&lt;/CODE&gt;.
25608 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;syslog&lt;/CODE&gt; submits the message with the facility and priority indicated
25609 by &lt;VAR&gt;facility_priority&lt;/VAR&gt;. The macro &lt;CODE&gt;LOG_MAKEPRI&lt;/CODE&gt; generates a
25610 facility/priority from a facility and a priority, as in the following
25611 example:
25612 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
25613 LOG_MAKEPRI(LOG_USER, LOG_WARNING)&lt;br&gt;
25614 &lt;/pre&gt;&lt;br&gt;
25615 &lt;br&gt;&lt;br&gt; The possible values for the facility code are (macros):&lt;br&gt;
25616 &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt; &lt;DL&gt;
25617 &lt;br&gt;
25618 &lt;DT&gt;&lt;CODE&gt;LOG_USER&lt;br&gt;&lt;/CODE&gt;
25619 &lt;DD&gt;
25620 A miscellaneous user process&lt;br&gt;
25621 &lt;DT&gt;&lt;CODE&gt;LOG_MAIL&lt;br&gt;&lt;/CODE&gt;
25622 &lt;DD&gt;
25623 Mail&lt;br&gt;
25624 &lt;DT&gt;&lt;CODE&gt;LOG_DAEMON&lt;br&gt;&lt;/CODE&gt;
25625 &lt;DD&gt;
25626 A miscellaneous system daemon&lt;br&gt;
25627 &lt;DT&gt;&lt;CODE&gt;LOG_AUTH&lt;br&gt;&lt;/CODE&gt;
25628 &lt;DD&gt;
25629 Security (authorization)&lt;br&gt;
25630 &lt;DT&gt;&lt;CODE&gt;LOG_SYSLOG&lt;br&gt;&lt;/CODE&gt;
25631 &lt;DD&gt;
25632 Syslog&lt;br&gt;
25633 &lt;DT&gt;&lt;CODE&gt;LOG_LPR&lt;br&gt;&lt;/CODE&gt;
25634 &lt;DD&gt;
25635 Central printer&lt;br&gt;
25636 &lt;DT&gt;&lt;CODE&gt;LOG_NEWS&lt;br&gt;&lt;/CODE&gt;
25637 &lt;DD&gt;
25638 Network news (e.g. Usenet)&lt;br&gt;
25639 &lt;DT&gt;&lt;CODE&gt;LOG_UUCP&lt;br&gt;&lt;/CODE&gt;
25640 &lt;DD&gt;
25641 UUCP&lt;br&gt;
25642 &lt;DT&gt;&lt;CODE&gt;LOG_CRON&lt;br&gt;&lt;/CODE&gt;
25643 &lt;DD&gt;
25644 Cron and At&lt;br&gt;
25645 &lt;DT&gt;&lt;CODE&gt;LOG_AUTHPRIV&lt;br&gt;&lt;/CODE&gt;
25646 &lt;DD&gt;
25647 Private security (authorization)&lt;br&gt;
25648 &lt;DT&gt;&lt;CODE&gt;LOG_FTP&lt;br&gt;&lt;/CODE&gt;
25649 &lt;DD&gt;
25650 Ftp server&lt;br&gt;
25651 &lt;DT&gt;&lt;CODE&gt;LOG_LOCAL0&lt;br&gt;&lt;/CODE&gt;
25652 &lt;DD&gt;
25653 Locally defined&lt;br&gt;
25654 &lt;DT&gt;&lt;CODE&gt;LOG_LOCAL1&lt;br&gt;&lt;/CODE&gt;
25655 &lt;DD&gt;
25656 Locally defined&lt;br&gt;
25657 &lt;DT&gt;&lt;CODE&gt;LOG_LOCAL2&lt;br&gt;&lt;/CODE&gt;
25658 &lt;DD&gt;
25659 Locally defined&lt;br&gt;
25660 &lt;DT&gt;&lt;CODE&gt;LOG_LOCAL3&lt;br&gt;&lt;/CODE&gt;
25661 &lt;DD&gt;
25662 Locally defined&lt;br&gt;
25663 &lt;DT&gt;&lt;CODE&gt;LOG_LOCAL4&lt;br&gt;&lt;/CODE&gt;
25664 &lt;DD&gt;
25665 Locally defined&lt;br&gt;
25666 &lt;DT&gt;&lt;CODE&gt;LOG_LOCAL5&lt;br&gt;&lt;/CODE&gt;
25667 &lt;DD&gt;
25668 Locally defined&lt;br&gt;
25669 &lt;DT&gt;&lt;CODE&gt;LOG_LOCAL6&lt;br&gt;&lt;/CODE&gt;
25670 &lt;DD&gt;
25671 Locally defined&lt;br&gt;
25672 &lt;DT&gt;&lt;CODE&gt;LOG_LOCAL7&lt;br&gt;&lt;/CODE&gt;
25673 &lt;DD&gt;
25674 Locally defined&lt;br&gt;
25675 &lt;/DL&gt;&lt;br&gt;
25676 &lt;br&gt;&lt;br&gt; Results are undefined if the facility code is anything else.&lt;br&gt;
25677 &lt;br&gt;&lt;br&gt; NB: &lt;CODE&gt;syslog&lt;/CODE&gt; recognizes one other facility code: that of&lt;br&gt;
25678 the kernel. But you can't specify that facility code with these&lt;br&gt;
25679 functions. If you try, it looks the same to &lt;CODE&gt;syslog&lt;/CODE&gt; as if you are&lt;br&gt;
25680 requesting the default facility. But you wouldn't want to anyway,&lt;br&gt;
25681 because any program that uses the GNU C library is not the kernel.&lt;br&gt;
25682 &lt;br&gt;&lt;br&gt; You can use just a priority code as &lt;VAR&gt;facility_priority&lt;/VAR&gt;. In that&lt;br&gt;
25683 case, &lt;CODE&gt;syslog&lt;/CODE&gt; assumes the default facility established when the&lt;br&gt;
25684 Syslog connection was opened. .&lt;br&gt;
25685 &lt;br&gt;&lt;br&gt; The possible values for the priority code are (macros):&lt;br&gt;
25686 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
25687 &lt;br&gt;
25688 &lt;DT&gt;&lt;CODE&gt;LOG_EMERG&lt;br&gt;&lt;/CODE&gt;
25689 &lt;DD&gt;
25690 The message says the system is unusable.&lt;br&gt;
25691 &lt;DT&gt;&lt;CODE&gt;LOG_ALERT&lt;br&gt;&lt;/CODE&gt;
25692 &lt;DD&gt;
25693 Action on the message must be taken immediately.&lt;br&gt;
25694 &lt;DT&gt;&lt;CODE&gt;LOG_CRIT&lt;br&gt;&lt;/CODE&gt;
25695 &lt;DD&gt;
25696 The message states a critical condition.&lt;br&gt;
25697 &lt;DT&gt;&lt;CODE&gt;LOG_ERR&lt;br&gt;&lt;/CODE&gt;
25698 &lt;DD&gt;
25699 The message describes an error.&lt;br&gt;
25700 &lt;DT&gt;&lt;CODE&gt;LOG_WARNING&lt;br&gt;&lt;/CODE&gt;
25701 &lt;DD&gt;
25702 The message is a warning.&lt;br&gt;
25703 &lt;DT&gt;&lt;CODE&gt;LOG_NOTICE&lt;br&gt;&lt;/CODE&gt;
25704 &lt;DD&gt;
25705 The message describes a normal but important event.&lt;br&gt;
25706 &lt;DT&gt;&lt;CODE&gt;LOG_INFO&lt;br&gt;&lt;/CODE&gt;
25707 &lt;DD&gt;
25708 The message is purely informational.&lt;br&gt;
25709 &lt;DT&gt;&lt;CODE&gt;LOG_DEBUG&lt;br&gt;&lt;/CODE&gt;
25710 &lt;DD&gt;
25711 The message is only for debugging purposes.&lt;br&gt;
25712 &lt;/DL&gt;&lt;br&gt;
25713 &lt;br&gt;&lt;br&gt; Results are undefined if the priority code is anything else.&lt;br&gt;
25714 &lt;br&gt;&lt;br&gt; If the process does not presently have a Syslog connection open (i.e.,&lt;br&gt;
25715 it did not call &lt;CODE&gt;openlog&lt;/CODE&gt;), &lt;CODE&gt;syslog&lt;/CODE&gt; implicitly opens the&lt;br&gt;
25716 connection the same as &lt;CODE&gt;openlog&lt;/CODE&gt; would, with the following defaults&lt;br&gt;
25717 for information that would otherwise be included in an &lt;CODE&gt;openlog&lt;/CODE&gt;&lt;br&gt;
25718 call: The default identification string is the program name. The&lt;br&gt;
25719 default default facility is &lt;CODE&gt;LOG_USER&lt;/CODE&gt;. The default for all the&lt;br&gt;
25720 connection options in &lt;VAR&gt;options&lt;/VAR&gt; is as if those bits were off.&lt;br&gt;
25721 &lt;CODE&gt;syslog&lt;/CODE&gt; leaves the Syslog connection open.&lt;br&gt;
25722 &lt;br&gt;&lt;br&gt; If the &lt;TT&gt;dev/log&lt;/TT&gt; socket is not open and connected, &lt;CODE&gt;syslog&lt;/CODE&gt;&lt;br&gt;
25723 opens and connects it, the same as &lt;CODE&gt;openlog&lt;/CODE&gt; with the&lt;br&gt;
25724 &lt;CODE&gt;LOG_NDELAY&lt;/CODE&gt; option would.&lt;br&gt;
25725 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;syslog&lt;/CODE&gt; leaves &lt;TT&gt;/dev/log&lt;/TT&gt; open and connected unless its attempt&lt;br&gt;
25726 to send the message failed, in which case &lt;CODE&gt;syslog&lt;/CODE&gt; closes it (with the&lt;br&gt;
25727 hope that a future implicit open will restore the Syslog connection to a&lt;br&gt;
25728 usable state).&lt;br&gt;
25729 &lt;br&gt;&lt;br&gt; Example:&lt;br&gt;
25730 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
25731 &lt;br&gt;&lt;br&gt; #include &lt;syslog.h&gt;&lt;br&gt;
25732 syslog (LOG_MAKEPRI(LOG_LOCAL1, LOG_ERROR),&lt;br&gt;
25733 "Unable to make network connection to %s. Error=%m", host);&lt;br&gt;
25734 &lt;br&gt;&lt;br&gt; &lt;/pre&gt;
25735 &lt;br&gt;&lt;br&gt;
25736 </synopsis>
25737 </function>
25738 </construct>
25739 <construct id="function-vsyslog" type="function">
25740 <function returntype="void">
25741 <prototype>
25742 <parameter content="int facility_priority"/>
25743 <parameter content="char *format"/>
25744 <parameter content="va_list arglist"/>
25745 </prototype>
25746 <headers>
25747 <header filename = "syslog.h"/>
25748 </headers>
25749 <synopsis>
25750 &lt;br&gt;&lt;br&gt; This is functionally identical to &lt;CODE&gt;syslog&lt;/CODE&gt;, with the BSD style variable
25751 length argument.
25752 &lt;br&gt;&lt;br&gt;
25753 </synopsis>
25754 </function>
25755 </construct>
25756 <construct id="function-closelog" type="function">
25757 <function returntype="void">
25758 <prototype>
25759 <parameter content="void"/>
25760 </prototype>
25761 <headers>
25762 <header filename = "syslog.h"/>
25763 </headers>
25764 <synopsis>
25765 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;closelog&lt;/CODE&gt; closes the current Syslog connection, if there is one.
25766 This includes closing the &lt;TT&gt;dev/log&lt;/TT&gt; socket, if it is open.
25767 &lt;CODE&gt;closelog&lt;/CODE&gt; also sets the identification string for Syslog messages
25768 back to the default, if &lt;CODE&gt;openlog&lt;/CODE&gt; was called with a non-NULL argument
25769 to &lt;VAR&gt;ident&lt;/VAR&gt;. The default identification string is the program name
25770 taken from argv[0].
25771 &lt;br&gt;&lt;br&gt; If you are writing shared library code that uses &lt;CODE&gt;openlog&lt;/CODE&gt; to
25772 generate custom syslog output, you should use &lt;CODE&gt;closelog&lt;/CODE&gt; to drop the
25773 GNU C library's internal reference to the &lt;VAR&gt;ident&lt;/VAR&gt; pointer when you are
25774 done. Please read the section on &lt;CODE&gt;openlog&lt;/CODE&gt; for more information:
25775 .
25776 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;closelog&lt;/CODE&gt; does not flush any buffers. You do not have to call
25777 &lt;CODE&gt;closelog&lt;/CODE&gt; before re-opening a Syslog connection with &lt;CODE&gt;initlog&lt;/CODE&gt;.
25778 Syslog connections are automatically closed on exec or exit.
25779 &lt;br&gt;&lt;br&gt;
25780 </synopsis>
25781 </function>
25782 </construct>
25783 <construct id="function-setlogmask" type="function">
25784 <function returntype="int">
25785 <prototype>
25786 <parameter content="int mask"/>
25787 </prototype>
25788 <headers>
25789 <header filename = "syslog.h"/>
25790 </headers>
25791 <synopsis>
25792 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;setlogmask&lt;/CODE&gt; sets a mask (the ``logmask'') that determines which
25793 future &lt;CODE&gt;syslog&lt;/CODE&gt; calls shall be ignored. If a program has not
25794 called &lt;CODE&gt;setlogmask&lt;/CODE&gt;, &lt;CODE&gt;syslog&lt;/CODE&gt; doesn't ignore any calls. You
25795 can use &lt;CODE&gt;setlogmask&lt;/CODE&gt; to specify that messages of particular
25796 priorities shall be ignored in the future.
25797 &lt;br&gt;&lt;br&gt; A &lt;CODE&gt;setlogmask&lt;/CODE&gt; call overrides any previous &lt;CODE&gt;setlogmask&lt;/CODE&gt; call.
25798 &lt;br&gt;&lt;br&gt; Note that the logmask exists entirely independently of opening and
25799 closing of Syslog connections.
25800 &lt;br&gt;&lt;br&gt; Setting the logmask has a similar effect to, but is not the same as,
25801 configuring Syslog. The Syslog configuration may cause Syslog to
25802 discard certain messages it receives, but the logmask causes certain
25803 messages never to get submitted to Syslog in the first place.
25804 &lt;br&gt;&lt;br&gt; &lt;VAR&gt;mask&lt;/VAR&gt; is a bit string with one bit corresponding to each of the
25805 possible message priorities. If the bit is on, &lt;CODE&gt;syslog&lt;/CODE&gt; handles
25806 messages of that priority normally. If it is off, &lt;CODE&gt;syslog&lt;/CODE&gt;
25807 discards messages of that priority. Use the message priority macros
25808 described in syslog; vsyslog and the &lt;CODE&gt;LOG_MASK&lt;/CODE&gt; to construct
25809 an appropriate &lt;VAR&gt;mask&lt;/VAR&gt; value, as in this example:
25810 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
25811 LOG_MASK(LOG_EMERG) | LOG_MASK(LOG_ERROR)&lt;br&gt;
25812 &lt;/pre&gt;&lt;br&gt;
25813 &lt;br&gt;&lt;br&gt; or&lt;br&gt;
25814 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
25815 ~(LOG_MASK(LOG_INFO))&lt;br&gt;
25816 &lt;/pre&gt;&lt;br&gt;
25817 &lt;br&gt;&lt;br&gt; There is also a &lt;CODE&gt;LOG_UPTO&lt;/CODE&gt; macro, which generates a mask with the bits&lt;br&gt;
25818 on for a certain priority and all priorities above it:&lt;br&gt;
25819 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
25820 LOG_UPTO(LOG_ERROR)&lt;br&gt;
25821 &lt;/pre&gt;
25822 &lt;br&gt;&lt;br&gt; The unfortunate naming of the macro is due to the fact that internally,
25823 higher numbers are used for lower message priorities.
25824 &lt;br&gt;&lt;br&gt;
25825 </synopsis>
25826 </function>
25827 </construct>
25828 <construct id="function-getsubopt" type="function">
25829 <function returntype="int">
25830 <prototype>
25831 <parameter content="char **optionp"/>
25832 <parameter content="const char* const *tokens"/>
25833 <parameter content="char **valuep"/>
25834 </prototype>
25835 <headers>
25836 <header filename = "stdlib.h"/>
25837 </headers>
25838 <synopsis>
25839 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;optionp&lt;/VAR&gt; parameter must be a pointer to a variable containing
25840 the address of the string to process. When the function returns the
25841 reference is updated to point to the next suboption or to the
25842 terminating &lt;samp&gt;\0&lt;/samp&gt; character if there is no more suboption available.
25843 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;tokens&lt;/VAR&gt; parameter references an array of strings containing the
25844 known suboptions. All strings must be &lt;samp&gt;\0&lt;/samp&gt; terminated and to mark
25845 the end a null pointer must be stored. When &lt;CODE&gt;getsubopt&lt;/CODE&gt; finds a
25846 possible legal suboption it compares it with all strings available in
25847 the &lt;VAR&gt;tokens&lt;/VAR&gt; array and returns the index in the string as the
25848 indicator.
25849 &lt;br&gt;&lt;br&gt; In case the suboption has an associated value introduced by a &lt;samp&gt;=&lt;/samp&gt;
25850 character, a pointer to the value is returned in &lt;VAR&gt;valuep&lt;/VAR&gt;. The
25851 string is &lt;samp&gt;\0&lt;/samp&gt; terminated. If no argument is available
25852 &lt;VAR&gt;valuep&lt;/VAR&gt; is set to the null pointer. By doing this the caller can
25853 check whether a necessary value is given or whether no unexpected value
25854 is present.
25855 &lt;br&gt;&lt;br&gt; In case the next suboption in the string is not mentioned in the
25856 &lt;VAR&gt;tokens&lt;/VAR&gt; array the starting address of the suboption including a
25857 possible value is returned in &lt;VAR&gt;valuep&lt;/VAR&gt; and the return value of the
25858 function is &lt;samp&gt;-1&lt;/samp&gt;.
25859 </synopsis>
25860 </function>
25861 </construct>
25862 <construct id="function-getenv" type="function">
25863 <function returntype="char *">
25864 <prototype>
25865 <parameter content="const char *name"/>
25866 </prototype>
25867 <headers>
25868 <header filename = "stdlib.h"/>
25869 </headers>
25870 <synopsis>
25871 This function returns a string that is the value of the environment
25872 variable &lt;VAR&gt;name&lt;/VAR&gt;. You must not modify this string. In some non-Unix
25873 systems not using the GNU library, it might be overwritten by subsequent
25874 calls to &lt;CODE&gt;getenv&lt;/CODE&gt; (but not by any other library function). If the
25875 environment variable &lt;VAR&gt;name&lt;/VAR&gt; is not defined, the value is a null
25876 pointer.
25877 </synopsis>
25878 </function>
25879 </construct>
25880 <construct id="function-putenv" type="function">
25881 <function returntype="int">
25882 <prototype>
25883 <parameter content="char *string"/>
25884 </prototype>
25885 <headers>
25886 <header filename = "stdlib.h"/>
25887 </headers>
25888 <synopsis>
25889 The &lt;CODE&gt;putenv&lt;/CODE&gt; function adds or removes definitions from the environment.
25890 If the &lt;VAR&gt;string&lt;/VAR&gt; is of the form &lt;samp&gt;&lt;VAR&gt;name&lt;/VAR&gt;=&lt;VAR&gt;value&lt;/VAR&gt;&lt;/samp&gt;, the
25891 definition is added to the environment. Otherwise, the &lt;VAR&gt;string&lt;/VAR&gt; is
25892 interpreted as the name of an environment variable, and any definition
25893 for this variable in the environment is removed.
25894 &lt;br&gt;&lt;br&gt; The difference to the &lt;CODE&gt;setenv&lt;/CODE&gt; function is that the exact string
25895 given as the parameter &lt;VAR&gt;string&lt;/VAR&gt; is put into the environment. If the
25896 user should change the string after the &lt;CODE&gt;putenv&lt;/CODE&gt; call this will
25897 reflect in automatically in the environment. This also requires that
25898 &lt;VAR&gt;string&lt;/VAR&gt; is no automatic variable which scope is left before the
25899 variable is removed from the environment. The same applies of course to
25900 dynamically allocated variables which are freed later.
25901 &lt;br&gt;&lt;br&gt; This function is part of the extended Unix interface. Since it was also
25902 available in old SVID libraries you should define either
25903 &lt;VAR&gt;_XOPEN_SOURCE&lt;/VAR&gt; or &lt;VAR&gt;_SVID_SOURCE&lt;/VAR&gt; before including any header.
25904 </synopsis>
25905 </function>
25906 </construct>
25907 <construct id="function-setenv" type="function">
25908 <function returntype="int">
25909 <prototype>
25910 <parameter content="const char *name"/>
25911 <parameter content="const char *value"/>
25912 <parameter content="int replace"/>
25913 </prototype>
25914 <headers>
25915 <header filename = "stdlib.h"/>
25916 </headers>
25917 <synopsis>
25918 The &lt;CODE&gt;setenv&lt;/CODE&gt; function can be used to add a new definition to the
25919 environment. The entry with the name &lt;VAR&gt;name&lt;/VAR&gt; is replaced by the
25920 value &lt;samp&gt;&lt;VAR&gt;name&lt;/VAR&gt;=&lt;VAR&gt;value&lt;/VAR&gt;&lt;/samp&gt;. Please note that this is also true
25921 if &lt;VAR&gt;value&lt;/VAR&gt; is the empty string. To do this a new string is created
25922 and the strings &lt;VAR&gt;name&lt;/VAR&gt; and &lt;VAR&gt;value&lt;/VAR&gt; are copied. A null pointer
25923 for the &lt;VAR&gt;value&lt;/VAR&gt; parameter is illegal. If the environment already
25924 contains an entry with key &lt;VAR&gt;name&lt;/VAR&gt; the &lt;VAR&gt;replace&lt;/VAR&gt; parameter
25925 controls the action. If replace is zero, nothing happens. Otherwise
25926 the old entry is replaced by the new one.
25927 &lt;br&gt;&lt;br&gt; Please note that you cannot remove an entry completely using this function.
25928 &lt;br&gt;&lt;br&gt; This function was originally part of the BSD library but is now part of
25929 the Unix standard.
25930 </synopsis>
25931 </function>
25932 </construct>
25933 <construct id="function-unsetenv" type="function">
25934 <function returntype="int">
25935 <prototype>
25936 <parameter content="const char *name"/>
25937 </prototype>
25938 <headers>
25939 <header filename = "stdlib.h"/>
25940 </headers>
25941 <synopsis>
25942 Using this function one can remove an entry completely from the
25943 environment. If the environment contains an entry with the key
25944 &lt;VAR&gt;name&lt;/VAR&gt; this whole entry is removed. A call to this function is
25945 equivalent to a call to &lt;CODE&gt;putenv&lt;/CODE&gt; when the &lt;VAR&gt;value&lt;/VAR&gt; part of the
25946 string is empty.
25947 &lt;br&gt;&lt;br&gt; The function return &lt;CODE&gt;-1&lt;/CODE&gt; if &lt;VAR&gt;name&lt;/VAR&gt; is a null pointer, points to
25948 an empty string, or points to a string containing a &lt;CODE&gt;=&lt;/CODE&gt; character.
25949 It returns &lt;CODE&gt;0&lt;/CODE&gt; if the call succeeded.
25950 &lt;br&gt;&lt;br&gt; This function was originally part of the BSD library but is now part of
25951 the Unix standard. The BSD version had no return value, though.
25952 </synopsis>
25953 </function>
25954 </construct>
25955 <construct id="function-clearenv" type="function">
25956 <function returntype="int">
25957 <prototype>
25958 <parameter content="void"/>
25959 </prototype>
25960 <headers>
25961 <header filename = "stdlib.h"/>
25962 </headers>
25963 <synopsis>
25964 The &lt;CODE&gt;clearenv&lt;/CODE&gt; function removes all entries from the environment.
25965 Using &lt;CODE&gt;putenv&lt;/CODE&gt; and &lt;CODE&gt;setenv&lt;/CODE&gt; new entries can be added again
25966 later.
25967 &lt;br&gt;&lt;br&gt; If the function is successful it returns &lt;CODE&gt;0&lt;/CODE&gt;. Otherwise the return
25968 value is nonzero.
25969 </synopsis>
25970 </function>
25971 </construct>
25972 <construct id="function-syscall" type="function">
25973 <function returntype="long int">
25974 <prototype>
25975 <parameter content="long int sysno"/>
25976 <parameter content="..."/>
25977 </prototype>
25978 <headers>
25979 <header filename = "unistd.h"/>
25980 </headers>
25981 <synopsis>
25982 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;syscall&lt;/CODE&gt; performs a generic system call.
25983 &lt;br&gt;&lt;br&gt; call number
25984 &lt;VAR&gt;sysno&lt;/VAR&gt; is the system call number. Each kind of system call is
25985 identified by a number. Macros for all the possible system call numbers
25986 are defined in &lt;TT&gt;sys/syscall.h&lt;/TT&gt;
25987 &lt;br&gt;&lt;br&gt; The remaining arguments are the arguments for the system call, in
25988 order, and their meanings depend on the kind of system call. Each kind
25989 of system call has a definite number of arguments, from zero to five.
25990 If you code more arguments than the system call takes, the extra ones to
25991 the right are ignored.
25992 &lt;br&gt;&lt;br&gt; The return value is the return value from the system call, unless the
25993 system call failed. In that case, &lt;CODE&gt;syscall&lt;/CODE&gt; returns &lt;CODE&gt;-1&lt;/CODE&gt; and
25994 sets &lt;CODE&gt;errno&lt;/CODE&gt; to an error code that the system call returned. Note
25995 that system calls do not return &lt;CODE&gt;-1&lt;/CODE&gt; when they succeed.
25996
25997 &lt;br&gt;&lt;br&gt; If you specify an invalid &lt;VAR&gt;sysno&lt;/VAR&gt;, &lt;CODE&gt;syscall&lt;/CODE&gt; returns &lt;CODE&gt;-1&lt;/CODE&gt;
25998 with &lt;CODE&gt;errno&lt;/CODE&gt; = &lt;CODE&gt;ENOSYS&lt;/CODE&gt;.
25999 &lt;br&gt;&lt;br&gt; Example:
26000 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
26001 &lt;br&gt;&lt;br&gt; #include &lt;unistd.h&gt;&lt;br&gt;
26002 #include &lt;sys/syscall.h&gt;&lt;br&gt;
26003 #include &lt;errno.h&gt;&lt;br&gt;
26004 &lt;br&gt;&lt;br&gt; &lt;small&gt;...&lt;/small&gt;&lt;br&gt;
26005 &lt;br&gt;&lt;br&gt; int rc;&lt;br&gt;
26006 &lt;br&gt;&lt;br&gt; rc = syscall(SYS_chmod, "/etc/passwd", 0444);&lt;br&gt;
26007 &lt;br&gt;&lt;br&gt; if (rc == -1)&lt;br&gt;
26008 fprintf(stderr, "chmod failed, errno = %d\n", errno);&lt;br&gt;
26009 &lt;br&gt;&lt;br&gt; &lt;/pre&gt;&lt;br&gt;
26010 &lt;br&gt;&lt;br&gt; This, if all the compatibility stars are aligned, is equivalent to the&lt;br&gt;
26011 following preferable code:&lt;br&gt;
26012 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
26013 &lt;br&gt;&lt;br&gt; #include &lt;sys/types.h&gt;&lt;br&gt;
26014 #include &lt;sys/stat.h&gt;&lt;br&gt;
26015 #include &lt;errno.h&gt;&lt;br&gt;
26016 &lt;br&gt;&lt;br&gt; &lt;small&gt;...&lt;/small&gt;&lt;br&gt;
26017 &lt;br&gt;&lt;br&gt; int rc;&lt;br&gt;
26018 &lt;br&gt;&lt;br&gt; rc = chmod("/etc/passwd", 0444);&lt;br&gt;
26019 if (rc == -1)&lt;br&gt;
26020 fprintf(stderr, "chmod failed, errno = %d\n", errno);&lt;br&gt;
26021 &lt;br&gt;&lt;br&gt; &lt;/pre&gt;
26022 &lt;br&gt;&lt;br&gt;
26023 </synopsis>
26024 </function>
26025 </construct>
26026 <construct id="function-exit" type="function">
26027 <function returntype="void">
26028 <prototype>
26029 <parameter content="int status"/>
26030 </prototype>
26031 <headers>
26032 <header filename = "stdlib.h"/>
26033 </headers>
26034 <synopsis>
26035 The &lt;CODE&gt;exit&lt;/CODE&gt; function tells the system that the program is done, which
26036 causes it to terminate the process.
26037 &lt;br&gt;&lt;br&gt; &lt;VAR&gt;status&lt;/VAR&gt; is the program's exit status, which becomes part of the
26038 process' termination status. This function does not return.
26039 </synopsis>
26040 </function>
26041 </construct>
26042 <construct id="function-atexit" type="function">
26043 <function returntype="int">
26044 <prototype>
26045 <parameter content="void (*function) (void)"/>
26046 </prototype>
26047 <headers>
26048 <header filename = "stdlib.h"/>
26049 </headers>
26050 <synopsis>
26051 The &lt;CODE&gt;atexit&lt;/CODE&gt; function registers the function &lt;VAR&gt;function&lt;/VAR&gt; to be
26052 called at normal program termination. The &lt;VAR&gt;function&lt;/VAR&gt; is called with
26053 no arguments.
26054 &lt;br&gt;&lt;br&gt; The return value from &lt;CODE&gt;atexit&lt;/CODE&gt; is zero on success and nonzero if
26055 the function cannot be registered.
26056 </synopsis>
26057 </function>
26058 </construct>
26059 <construct id="function-on_exit" type="function">
26060 <function returntype="int">
26061 <prototype>
26062 <parameter content="void (*function)(int status"/>
26063 <parameter content="void *arg)"/>
26064 <parameter content="void *arg"/>
26065 </prototype>
26066 <headers>
26067 <header filename = "stdlib.h"/>
26068 </headers>
26069 <synopsis>
26070 This function is a somewhat more powerful variant of &lt;CODE&gt;atexit&lt;/CODE&gt;. It
26071 accepts two arguments, a function &lt;VAR&gt;function&lt;/VAR&gt; and an arbitrary
26072 pointer &lt;VAR&gt;arg&lt;/VAR&gt;. At normal program termination, the &lt;VAR&gt;function&lt;/VAR&gt; is
26073 called with two arguments: the &lt;VAR&gt;status&lt;/VAR&gt; value passed to &lt;CODE&gt;exit&lt;/CODE&gt;,
26074 and the &lt;VAR&gt;arg&lt;/VAR&gt;.
26075 &lt;br&gt;&lt;br&gt; This function is included in the GNU C library only for compatibility
26076 for SunOS, and may not be supported by other implementations.
26077 </synopsis>
26078 </function>
26079 </construct>
26080 <construct id="function-abort" type="function">
26081 <function returntype="void">
26082 <prototype>
26083 <parameter content="void"/>
26084 </prototype>
26085 <headers>
26086 <header filename = "stdlib.h"/>
26087 </headers>
26088 <synopsis>
26089 The &lt;CODE&gt;abort&lt;/CODE&gt; function causes abnormal program termination. This
26090 does not execute cleanup functions registered with &lt;CODE&gt;atexit&lt;/CODE&gt; or
26091 &lt;CODE&gt;on_exit&lt;/CODE&gt;.
26092 &lt;br&gt;&lt;br&gt; This function actually terminates the process by raising a
26093 &lt;CODE&gt;SIGABRT&lt;/CODE&gt; signal, and your program can include a handler to
26094 intercept this signal; see Signal Handling.
26095 </synopsis>
26096 </function>
26097 </construct>
26098 <construct id="function-_exit" type="function">
26099 <function returntype="void">
26100 <prototype>
26101 <parameter content="int status"/>
26102 </prototype>
26103 <headers>
26104 <header filename = "unistd.h"/>
26105 </headers>
26106 <synopsis>
26107 The &lt;CODE&gt;_exit&lt;/CODE&gt; function is the primitive for causing a process to
26108 terminate with status &lt;VAR&gt;status&lt;/VAR&gt;. Calling this function does not
26109 execute cleanup functions registered with &lt;CODE&gt;atexit&lt;/CODE&gt; or
26110 &lt;CODE&gt;on_exit&lt;/CODE&gt;.
26111 </synopsis>
26112 </function>
26113 </construct>
26114 <construct id="function-_Exit" type="function">
26115 <function returntype="void">
26116 <prototype>
26117 <parameter content="int status"/>
26118 </prototype>
26119 <headers>
26120 <header filename = "stdlib.h"/>
26121 </headers>
26122 <synopsis>
26123 The &lt;CODE&gt;_Exit&lt;/CODE&gt; function is the ISO C equivalent to &lt;CODE&gt;_exit&lt;/CODE&gt;.
26124 The ISO C committee members were not sure whether the definitions of
26125 &lt;CODE&gt;_exit&lt;/CODE&gt; and &lt;CODE&gt;_Exit&lt;/CODE&gt; were compatible so they have not used the
26126 POSIX name.
26127 &lt;br&gt;&lt;br&gt; This function was introduced in ISO C99 and is declared in
26128 &lt;TT&gt;stdlib.h&lt;/TT&gt;.
26129 </synopsis>
26130 </function>
26131 </construct>
26132 <construct id="function-sin" type="function">
26133 <function returntype="double">
26134 <prototype>
26135 <parameter content="double x"/>
26136 </prototype>
26137 <headers>
26138 <header filename = "math.h"/>
26139 </headers>
26140 <synopsis>
26141 These functions return the sine of &lt;VAR&gt;x&lt;/VAR&gt;, where &lt;VAR&gt;x&lt;/VAR&gt; is given in
26142 radians. The return value is in the range &lt;CODE&gt;-1&lt;/CODE&gt; to &lt;CODE&gt;1&lt;/CODE&gt;.
26143 </synopsis>
26144 </function>
26145 </construct>
26146 <construct id="function-sinf" type="function">
26147 <function returntype="float">
26148 <prototype>
26149 <parameter content="float x"/>
26150 </prototype>
26151 <headers>
26152 <header filename = "math.h"/>
26153 </headers>
26154 <synopsis>
26155 These functions return the sine of &lt;VAR&gt;x&lt;/VAR&gt;, where &lt;VAR&gt;x&lt;/VAR&gt; is given in
26156 radians. The return value is in the range &lt;CODE&gt;-1&lt;/CODE&gt; to &lt;CODE&gt;1&lt;/CODE&gt;.
26157 </synopsis>
26158 </function>
26159 </construct>
26160 <construct id="function-sinl" type="function">
26161 <function returntype="long double">
26162 <prototype>
26163 <parameter content="long double x"/>
26164 </prototype>
26165 <headers>
26166 <header filename = "math.h"/>
26167 </headers>
26168 <synopsis>
26169 These functions return the sine of &lt;VAR&gt;x&lt;/VAR&gt;, where &lt;VAR&gt;x&lt;/VAR&gt; is given in
26170 radians. The return value is in the range &lt;CODE&gt;-1&lt;/CODE&gt; to &lt;CODE&gt;1&lt;/CODE&gt;.
26171 </synopsis>
26172 </function>
26173 </construct>
26174 <construct id="function-cos" type="function">
26175 <function returntype="double">
26176 <prototype>
26177 <parameter content="double x"/>
26178 </prototype>
26179 <headers>
26180 <header filename = "math.h"/>
26181 </headers>
26182 <synopsis>
26183 These functions return the cosine of &lt;VAR&gt;x&lt;/VAR&gt;, where &lt;VAR&gt;x&lt;/VAR&gt; is given in
26184 radians. The return value is in the range &lt;CODE&gt;-1&lt;/CODE&gt; to &lt;CODE&gt;1&lt;/CODE&gt;.
26185 </synopsis>
26186 </function>
26187 </construct>
26188 <construct id="function-cosf" type="function">
26189 <function returntype="float">
26190 <prototype>
26191 <parameter content="float x"/>
26192 </prototype>
26193 <headers>
26194 <header filename = "math.h"/>
26195 </headers>
26196 <synopsis>
26197 These functions return the cosine of &lt;VAR&gt;x&lt;/VAR&gt;, where &lt;VAR&gt;x&lt;/VAR&gt; is given in
26198 radians. The return value is in the range &lt;CODE&gt;-1&lt;/CODE&gt; to &lt;CODE&gt;1&lt;/CODE&gt;.
26199 </synopsis>
26200 </function>
26201 </construct>
26202 <construct id="function-cosl" type="function">
26203 <function returntype="long double">
26204 <prototype>
26205 <parameter content="long double x"/>
26206 </prototype>
26207 <headers>
26208 <header filename = "math.h"/>
26209 </headers>
26210 <synopsis>
26211 These functions return the cosine of &lt;VAR&gt;x&lt;/VAR&gt;, where &lt;VAR&gt;x&lt;/VAR&gt; is given in
26212 radians. The return value is in the range &lt;CODE&gt;-1&lt;/CODE&gt; to &lt;CODE&gt;1&lt;/CODE&gt;.
26213 </synopsis>
26214 </function>
26215 </construct>
26216 <construct id="function-tan" type="function">
26217 <function returntype="double">
26218 <prototype>
26219 <parameter content="double x"/>
26220 </prototype>
26221 <headers>
26222 <header filename = "math.h"/>
26223 </headers>
26224 <synopsis>
26225 These functions return the tangent of &lt;VAR&gt;x&lt;/VAR&gt;, where &lt;VAR&gt;x&lt;/VAR&gt; is given in
26226 radians.
26227 &lt;br&gt;&lt;br&gt; Mathematically, the tangent function has singularities at odd multiples
26228 of pi/2. If the argument &lt;VAR&gt;x&lt;/VAR&gt; is too close to one of these
26229 singularities, &lt;CODE&gt;tan&lt;/CODE&gt; will signal overflow.
26230 </synopsis>
26231 </function>
26232 </construct>
26233 <construct id="function-tanf" type="function">
26234 <function returntype="float">
26235 <prototype>
26236 <parameter content="float x"/>
26237 </prototype>
26238 <headers>
26239 <header filename = "math.h"/>
26240 </headers>
26241 <synopsis>
26242 These functions return the tangent of &lt;VAR&gt;x&lt;/VAR&gt;, where &lt;VAR&gt;x&lt;/VAR&gt; is given in
26243 radians.
26244 &lt;br&gt;&lt;br&gt; Mathematically, the tangent function has singularities at odd multiples
26245 of pi/2. If the argument &lt;VAR&gt;x&lt;/VAR&gt; is too close to one of these
26246 singularities, &lt;CODE&gt;tan&lt;/CODE&gt; will signal overflow.
26247 </synopsis>
26248 </function>
26249 </construct>
26250 <construct id="function-tanl" type="function">
26251 <function returntype="long double">
26252 <prototype>
26253 <parameter content="long double x"/>
26254 </prototype>
26255 <headers>
26256 <header filename = "math.h"/>
26257 </headers>
26258 <synopsis>
26259 These functions return the tangent of &lt;VAR&gt;x&lt;/VAR&gt;, where &lt;VAR&gt;x&lt;/VAR&gt; is given in
26260 radians.
26261 &lt;br&gt;&lt;br&gt; Mathematically, the tangent function has singularities at odd multiples
26262 of pi/2. If the argument &lt;VAR&gt;x&lt;/VAR&gt; is too close to one of these
26263 singularities, &lt;CODE&gt;tan&lt;/CODE&gt; will signal overflow.
26264 </synopsis>
26265 </function>
26266 </construct>
26267 <construct id="function-sincos" type="function">
26268 <function returntype="void">
26269 <prototype>
26270 <parameter content="double x"/>
26271 <parameter content="double *sinx"/>
26272 <parameter content="double *cosx"/>
26273 </prototype>
26274 <headers>
26275 <header filename = "math.h"/>
26276 </headers>
26277 <synopsis>
26278 These functions return the sine of &lt;VAR&gt;x&lt;/VAR&gt; in &lt;CODE&gt;*&lt;VAR&gt;sinx&lt;/VAR&gt;&lt;/CODE&gt; and the
26279 cosine of &lt;VAR&gt;x&lt;/VAR&gt; in &lt;CODE&gt;*&lt;VAR&gt;cos&lt;/VAR&gt;&lt;/CODE&gt;, where &lt;VAR&gt;x&lt;/VAR&gt; is given in
26280 radians. Both values, &lt;CODE&gt;*&lt;VAR&gt;sinx&lt;/VAR&gt;&lt;/CODE&gt; and &lt;CODE&gt;*&lt;VAR&gt;cosx&lt;/VAR&gt;&lt;/CODE&gt;, are in
26281 the range of &lt;CODE&gt;-1&lt;/CODE&gt; to &lt;CODE&gt;1&lt;/CODE&gt;.
26282 &lt;br&gt;&lt;br&gt; This function is a GNU extension. Portable programs should be prepared
26283 to cope with its absence.
26284 </synopsis>
26285 </function>
26286 </construct>
26287 <construct id="function-sincosf" type="function">
26288 <function returntype="void">
26289 <prototype>
26290 <parameter content="float x"/>
26291 <parameter content="float *sinx"/>
26292 <parameter content="float *cosx"/>
26293 </prototype>
26294 <headers>
26295 <header filename = "math.h"/>
26296 </headers>
26297 <synopsis>
26298 These functions return the sine of &lt;VAR&gt;x&lt;/VAR&gt; in &lt;CODE&gt;*&lt;VAR&gt;sinx&lt;/VAR&gt;&lt;/CODE&gt; and the
26299 cosine of &lt;VAR&gt;x&lt;/VAR&gt; in &lt;CODE&gt;*&lt;VAR&gt;cos&lt;/VAR&gt;&lt;/CODE&gt;, where &lt;VAR&gt;x&lt;/VAR&gt; is given in
26300 radians. Both values, &lt;CODE&gt;*&lt;VAR&gt;sinx&lt;/VAR&gt;&lt;/CODE&gt; and &lt;CODE&gt;*&lt;VAR&gt;cosx&lt;/VAR&gt;&lt;/CODE&gt;, are in
26301 the range of &lt;CODE&gt;-1&lt;/CODE&gt; to &lt;CODE&gt;1&lt;/CODE&gt;.
26302 &lt;br&gt;&lt;br&gt; This function is a GNU extension. Portable programs should be prepared
26303 to cope with its absence.
26304 </synopsis>
26305 </function>
26306 </construct>
26307 <construct id="function-sincosl" type="function">
26308 <function returntype="void">
26309 <prototype>
26310 <parameter content="long double x"/>
26311 <parameter content="long double *sinx"/>
26312 <parameter content="long double *cosx"/>
26313 </prototype>
26314 <headers>
26315 <header filename = "math.h"/>
26316 </headers>
26317 <synopsis>
26318 These functions return the sine of &lt;VAR&gt;x&lt;/VAR&gt; in &lt;CODE&gt;*&lt;VAR&gt;sinx&lt;/VAR&gt;&lt;/CODE&gt; and the
26319 cosine of &lt;VAR&gt;x&lt;/VAR&gt; in &lt;CODE&gt;*&lt;VAR&gt;cos&lt;/VAR&gt;&lt;/CODE&gt;, where &lt;VAR&gt;x&lt;/VAR&gt; is given in
26320 radians. Both values, &lt;CODE&gt;*&lt;VAR&gt;sinx&lt;/VAR&gt;&lt;/CODE&gt; and &lt;CODE&gt;*&lt;VAR&gt;cosx&lt;/VAR&gt;&lt;/CODE&gt;, are in
26321 the range of &lt;CODE&gt;-1&lt;/CODE&gt; to &lt;CODE&gt;1&lt;/CODE&gt;.
26322 &lt;br&gt;&lt;br&gt; This function is a GNU extension. Portable programs should be prepared
26323 to cope with its absence.
26324 </synopsis>
26325 </function>
26326 </construct>
26327 <construct id="function-csin" type="function">
26328 <function returntype="complex double">
26329 <prototype>
26330 <parameter content="complex double z"/>
26331 </prototype>
26332 <headers>
26333 <header filename = "complex.h"/>
26334 </headers>
26335 <synopsis>
26336 These functions return the complex sine of &lt;VAR&gt;z&lt;/VAR&gt;.
26337 The mathematical definition of the complex sine is
26338 &lt;br&gt;&lt;br&gt;
26339 sin (z) = 1/(2*i) * (exp (z*i) - exp (-z*i)).
26340
26341
26342 </synopsis>
26343 </function>
26344 </construct>
26345 <construct id="function-csinf" type="function">
26346 <function returntype="complex float">
26347 <prototype>
26348 <parameter content="complex float z"/>
26349 </prototype>
26350 <headers>
26351 <header filename = "complex.h"/>
26352 </headers>
26353 <synopsis>
26354 These functions return the complex sine of &lt;VAR&gt;z&lt;/VAR&gt;.
26355 The mathematical definition of the complex sine is
26356 &lt;br&gt;&lt;br&gt;
26357 sin (z) = 1/(2*i) * (exp (z*i) - exp (-z*i)).
26358
26359
26360 </synopsis>
26361 </function>
26362 </construct>
26363 <construct id="function-csinl" type="function">
26364 <function returntype="complex long double">
26365 <prototype>
26366 <parameter content="complex long double z"/>
26367 </prototype>
26368 <headers>
26369 <header filename = "complex.h"/>
26370 </headers>
26371 <synopsis>
26372 These functions return the complex sine of &lt;VAR&gt;z&lt;/VAR&gt;.
26373 The mathematical definition of the complex sine is
26374 &lt;br&gt;&lt;br&gt;
26375 sin (z) = 1/(2*i) * (exp (z*i) - exp (-z*i)).
26376
26377
26378 </synopsis>
26379 </function>
26380 </construct>
26381 <construct id="function-ccos" type="function">
26382 <function returntype="complex double">
26383 <prototype>
26384 <parameter content="complex double z"/>
26385 </prototype>
26386 <headers>
26387 <header filename = "complex.h"/>
26388 </headers>
26389 <synopsis>
26390 These functions return the complex cosine of &lt;VAR&gt;z&lt;/VAR&gt;.
26391 The mathematical definition of the complex cosine is
26392 &lt;br&gt;&lt;br&gt;
26393 cos (z) = 1/2 * (exp (z*i) + exp (-z*i))
26394
26395
26396 </synopsis>
26397 </function>
26398 </construct>
26399 <construct id="function-ccosf" type="function">
26400 <function returntype="complex float">
26401 <prototype>
26402 <parameter content="complex float z"/>
26403 </prototype>
26404 <headers>
26405 <header filename = "complex.h"/>
26406 </headers>
26407 <synopsis>
26408 These functions return the complex cosine of &lt;VAR&gt;z&lt;/VAR&gt;.
26409 The mathematical definition of the complex cosine is
26410 &lt;br&gt;&lt;br&gt;
26411 cos (z) = 1/2 * (exp (z*i) + exp (-z*i))
26412
26413
26414 </synopsis>
26415 </function>
26416 </construct>
26417 <construct id="function-ccosl" type="function">
26418 <function returntype="complex long double">
26419 <prototype>
26420 <parameter content="complex long double z"/>
26421 </prototype>
26422 <headers>
26423 <header filename = "complex.h"/>
26424 </headers>
26425 <synopsis>
26426 These functions return the complex cosine of &lt;VAR&gt;z&lt;/VAR&gt;.
26427 The mathematical definition of the complex cosine is
26428 &lt;br&gt;&lt;br&gt;
26429 cos (z) = 1/2 * (exp (z*i) + exp (-z*i))
26430
26431
26432 </synopsis>
26433 </function>
26434 </construct>
26435 <construct id="function-ctan" type="function">
26436 <function returntype="complex double">
26437 <prototype>
26438 <parameter content="complex double z"/>
26439 </prototype>
26440 <headers>
26441 <header filename = "complex.h"/>
26442 </headers>
26443 <synopsis>
26444 These functions return the complex tangent of &lt;VAR&gt;z&lt;/VAR&gt;.
26445 The mathematical definition of the complex tangent is
26446 &lt;br&gt;&lt;br&gt;
26447 tan (z) = -i * (exp (z*i) - exp (-z*i)) / (exp (z*i) + exp (-z*i))
26448
26449
26450 &lt;br&gt;&lt;br&gt;
26451 The complex tangent has poles at pi/2 + 2n, where n is an
26452 integer. &lt;CODE&gt;ctan&lt;/CODE&gt; may signal overflow if &lt;VAR&gt;z&lt;/VAR&gt; is too close to a
26453 pole.
26454 </synopsis>
26455 </function>
26456 </construct>
26457 <construct id="function-ctanf" type="function">
26458 <function returntype="complex float">
26459 <prototype>
26460 <parameter content="complex float z"/>
26461 </prototype>
26462 <headers>
26463 <header filename = "complex.h"/>
26464 </headers>
26465 <synopsis>
26466 These functions return the complex tangent of &lt;VAR&gt;z&lt;/VAR&gt;.
26467 The mathematical definition of the complex tangent is
26468 &lt;br&gt;&lt;br&gt;
26469 tan (z) = -i * (exp (z*i) - exp (-z*i)) / (exp (z*i) + exp (-z*i))
26470
26471
26472 &lt;br&gt;&lt;br&gt;
26473 The complex tangent has poles at pi/2 + 2n, where n is an
26474 integer. &lt;CODE&gt;ctan&lt;/CODE&gt; may signal overflow if &lt;VAR&gt;z&lt;/VAR&gt; is too close to a
26475 pole.
26476 </synopsis>
26477 </function>
26478 </construct>
26479 <construct id="function-ctanl" type="function">
26480 <function returntype="complex long double">
26481 <prototype>
26482 <parameter content="complex long double z"/>
26483 </prototype>
26484 <headers>
26485 <header filename = "complex.h"/>
26486 </headers>
26487 <synopsis>
26488 These functions return the complex tangent of &lt;VAR&gt;z&lt;/VAR&gt;.
26489 The mathematical definition of the complex tangent is
26490 &lt;br&gt;&lt;br&gt;
26491 tan (z) = -i * (exp (z*i) - exp (-z*i)) / (exp (z*i) + exp (-z*i))
26492
26493
26494 &lt;br&gt;&lt;br&gt;
26495 The complex tangent has poles at pi/2 + 2n, where n is an
26496 integer. &lt;CODE&gt;ctan&lt;/CODE&gt; may signal overflow if &lt;VAR&gt;z&lt;/VAR&gt; is too close to a
26497 pole.
26498 </synopsis>
26499 </function>
26500 </construct>
26501 <construct id="function-asin" type="function">
26502 <function returntype="double">
26503 <prototype>
26504 <parameter content="double x"/>
26505 </prototype>
26506 <headers>
26507 <header filename = "math.h"/>
26508 </headers>
26509 <synopsis>
26510 These functions compute the arc sine of &lt;VAR&gt;x&lt;/VAR&gt;---that is, the value whose
26511 sine is &lt;VAR&gt;x&lt;/VAR&gt;. The value is in units of radians. Mathematically,
26512 there are infinitely many such values; the one actually returned is the
26513 one between &lt;CODE&gt;-pi/2&lt;/CODE&gt; and &lt;CODE&gt;pi/2&lt;/CODE&gt; (inclusive).
26514 &lt;br&gt;&lt;br&gt; The arc sine function is defined mathematically only
26515 over the domain &lt;CODE&gt;-1&lt;/CODE&gt; to &lt;CODE&gt;1&lt;/CODE&gt;. If &lt;VAR&gt;x&lt;/VAR&gt; is outside the
26516 domain, &lt;CODE&gt;asin&lt;/CODE&gt; signals a domain error.
26517 </synopsis>
26518 </function>
26519 </construct>
26520 <construct id="function-asinf" type="function">
26521 <function returntype="float">
26522 <prototype>
26523 <parameter content="float x"/>
26524 </prototype>
26525 <headers>
26526 <header filename = "math.h"/>
26527 </headers>
26528 <synopsis>
26529 These functions compute the arc sine of &lt;VAR&gt;x&lt;/VAR&gt;---that is, the value whose
26530 sine is &lt;VAR&gt;x&lt;/VAR&gt;. The value is in units of radians. Mathematically,
26531 there are infinitely many such values; the one actually returned is the
26532 one between &lt;CODE&gt;-pi/2&lt;/CODE&gt; and &lt;CODE&gt;pi/2&lt;/CODE&gt; (inclusive).
26533 &lt;br&gt;&lt;br&gt; The arc sine function is defined mathematically only
26534 over the domain &lt;CODE&gt;-1&lt;/CODE&gt; to &lt;CODE&gt;1&lt;/CODE&gt;. If &lt;VAR&gt;x&lt;/VAR&gt; is outside the
26535 domain, &lt;CODE&gt;asin&lt;/CODE&gt; signals a domain error.
26536 </synopsis>
26537 </function>
26538 </construct>
26539 <construct id="function-asinl" type="function">
26540 <function returntype="long double">
26541 <prototype>
26542 <parameter content="long double x"/>
26543 </prototype>
26544 <headers>
26545 <header filename = "math.h"/>
26546 </headers>
26547 <synopsis>
26548 These functions compute the arc sine of &lt;VAR&gt;x&lt;/VAR&gt;---that is, the value whose
26549 sine is &lt;VAR&gt;x&lt;/VAR&gt;. The value is in units of radians. Mathematically,
26550 there are infinitely many such values; the one actually returned is the
26551 one between &lt;CODE&gt;-pi/2&lt;/CODE&gt; and &lt;CODE&gt;pi/2&lt;/CODE&gt; (inclusive).
26552 &lt;br&gt;&lt;br&gt; The arc sine function is defined mathematically only
26553 over the domain &lt;CODE&gt;-1&lt;/CODE&gt; to &lt;CODE&gt;1&lt;/CODE&gt;. If &lt;VAR&gt;x&lt;/VAR&gt; is outside the
26554 domain, &lt;CODE&gt;asin&lt;/CODE&gt; signals a domain error.
26555 </synopsis>
26556 </function>
26557 </construct>
26558 <construct id="function-acos" type="function">
26559 <function returntype="double">
26560 <prototype>
26561 <parameter content="double x"/>
26562 </prototype>
26563 <headers>
26564 <header filename = "math.h"/>
26565 </headers>
26566 <synopsis>
26567 These functions compute the arc cosine of &lt;VAR&gt;x&lt;/VAR&gt;---that is, the value
26568 whose cosine is &lt;VAR&gt;x&lt;/VAR&gt;. The value is in units of radians.
26569 Mathematically, there are infinitely many such values; the one actually
26570 returned is the one between &lt;CODE&gt;0&lt;/CODE&gt; and &lt;CODE&gt;pi&lt;/CODE&gt; (inclusive).
26571 &lt;br&gt;&lt;br&gt; The arc cosine function is defined mathematically only
26572 over the domain &lt;CODE&gt;-1&lt;/CODE&gt; to &lt;CODE&gt;1&lt;/CODE&gt;. If &lt;VAR&gt;x&lt;/VAR&gt; is outside the
26573 domain, &lt;CODE&gt;acos&lt;/CODE&gt; signals a domain error.
26574 </synopsis>
26575 </function>
26576 </construct>
26577 <construct id="function-acosf" type="function">
26578 <function returntype="float">
26579 <prototype>
26580 <parameter content="float x"/>
26581 </prototype>
26582 <headers>
26583 <header filename = "math.h"/>
26584 </headers>
26585 <synopsis>
26586 These functions compute the arc cosine of &lt;VAR&gt;x&lt;/VAR&gt;---that is, the value
26587 whose cosine is &lt;VAR&gt;x&lt;/VAR&gt;. The value is in units of radians.
26588 Mathematically, there are infinitely many such values; the one actually
26589 returned is the one between &lt;CODE&gt;0&lt;/CODE&gt; and &lt;CODE&gt;pi&lt;/CODE&gt; (inclusive).
26590 &lt;br&gt;&lt;br&gt; The arc cosine function is defined mathematically only
26591 over the domain &lt;CODE&gt;-1&lt;/CODE&gt; to &lt;CODE&gt;1&lt;/CODE&gt;. If &lt;VAR&gt;x&lt;/VAR&gt; is outside the
26592 domain, &lt;CODE&gt;acos&lt;/CODE&gt; signals a domain error.
26593 </synopsis>
26594 </function>
26595 </construct>
26596 <construct id="function-acosl" type="function">
26597 <function returntype="long double">
26598 <prototype>
26599 <parameter content="long double x"/>
26600 </prototype>
26601 <headers>
26602 <header filename = "math.h"/>
26603 </headers>
26604 <synopsis>
26605 These functions compute the arc cosine of &lt;VAR&gt;x&lt;/VAR&gt;---that is, the value
26606 whose cosine is &lt;VAR&gt;x&lt;/VAR&gt;. The value is in units of radians.
26607 Mathematically, there are infinitely many such values; the one actually
26608 returned is the one between &lt;CODE&gt;0&lt;/CODE&gt; and &lt;CODE&gt;pi&lt;/CODE&gt; (inclusive).
26609 &lt;br&gt;&lt;br&gt; The arc cosine function is defined mathematically only
26610 over the domain &lt;CODE&gt;-1&lt;/CODE&gt; to &lt;CODE&gt;1&lt;/CODE&gt;. If &lt;VAR&gt;x&lt;/VAR&gt; is outside the
26611 domain, &lt;CODE&gt;acos&lt;/CODE&gt; signals a domain error.
26612 </synopsis>
26613 </function>
26614 </construct>
26615 <construct id="function-atan" type="function">
26616 <function returntype="double">
26617 <prototype>
26618 <parameter content="double x"/>
26619 </prototype>
26620 <headers>
26621 <header filename = "math.h"/>
26622 </headers>
26623 <synopsis>
26624 These functions compute the arc tangent of &lt;VAR&gt;x&lt;/VAR&gt;---that is, the value
26625 whose tangent is &lt;VAR&gt;x&lt;/VAR&gt;. The value is in units of radians.
26626 Mathematically, there are infinitely many such values; the one actually
26627 returned is the one between &lt;CODE&gt;-pi/2&lt;/CODE&gt; and &lt;CODE&gt;pi/2&lt;/CODE&gt; (inclusive).
26628 </synopsis>
26629 </function>
26630 </construct>
26631 <construct id="function-atanf" type="function">
26632 <function returntype="float">
26633 <prototype>
26634 <parameter content="float x"/>
26635 </prototype>
26636 <headers>
26637 <header filename = "math.h"/>
26638 </headers>
26639 <synopsis>
26640 These functions compute the arc tangent of &lt;VAR&gt;x&lt;/VAR&gt;---that is, the value
26641 whose tangent is &lt;VAR&gt;x&lt;/VAR&gt;. The value is in units of radians.
26642 Mathematically, there are infinitely many such values; the one actually
26643 returned is the one between &lt;CODE&gt;-pi/2&lt;/CODE&gt; and &lt;CODE&gt;pi/2&lt;/CODE&gt; (inclusive).
26644 </synopsis>
26645 </function>
26646 </construct>
26647 <construct id="function-atanl" type="function">
26648 <function returntype="long double">
26649 <prototype>
26650 <parameter content="long double x"/>
26651 </prototype>
26652 <headers>
26653 <header filename = "math.h"/>
26654 </headers>
26655 <synopsis>
26656 These functions compute the arc tangent of &lt;VAR&gt;x&lt;/VAR&gt;---that is, the value
26657 whose tangent is &lt;VAR&gt;x&lt;/VAR&gt;. The value is in units of radians.
26658 Mathematically, there are infinitely many such values; the one actually
26659 returned is the one between &lt;CODE&gt;-pi/2&lt;/CODE&gt; and &lt;CODE&gt;pi/2&lt;/CODE&gt; (inclusive).
26660 </synopsis>
26661 </function>
26662 </construct>
26663 <construct id="function-atan2" type="function">
26664 <function returntype="double">
26665 <prototype>
26666 <parameter content="double y"/>
26667 <parameter content="double x"/>
26668 </prototype>
26669 <headers>
26670 <header filename = "math.h"/>
26671 </headers>
26672 <synopsis>
26673 This function computes the arc tangent of &lt;VAR&gt;y&lt;/VAR&gt;/&lt;VAR&gt;x&lt;/VAR&gt;, but the signs
26674 of both arguments are used to determine the quadrant of the result, and
26675 &lt;VAR&gt;x&lt;/VAR&gt; is permitted to be zero. The return value is given in radians
26676 and is in the range &lt;CODE&gt;-pi&lt;/CODE&gt; to &lt;CODE&gt;pi&lt;/CODE&gt;, inclusive.
26677 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;x&lt;/VAR&gt; and &lt;VAR&gt;y&lt;/VAR&gt; are coordinates of a point in the plane,
26678 &lt;CODE&gt;atan2&lt;/CODE&gt; returns the signed angle between the line from the origin
26679 to that point and the x-axis. Thus, &lt;CODE&gt;atan2&lt;/CODE&gt; is useful for
26680 converting Cartesian coordinates to polar coordinates. (To compute the
26681 radial coordinate, use &lt;CODE&gt;hypot&lt;/CODE&gt;; see Exponents and
26682 Logarithms.)
26683 &lt;br&gt;&lt;br&gt; If both &lt;VAR&gt;x&lt;/VAR&gt; and &lt;VAR&gt;y&lt;/VAR&gt; are zero, &lt;CODE&gt;atan2&lt;/CODE&gt; returns zero.
26684 </synopsis>
26685 </function>
26686 </construct>
26687 <construct id="function-atan2f" type="function">
26688 <function returntype="float">
26689 <prototype>
26690 <parameter content="float y"/>
26691 <parameter content="float x"/>
26692 </prototype>
26693 <headers>
26694 <header filename = "math.h"/>
26695 </headers>
26696 <synopsis>
26697 This function computes the arc tangent of &lt;VAR&gt;y&lt;/VAR&gt;/&lt;VAR&gt;x&lt;/VAR&gt;, but the signs
26698 of both arguments are used to determine the quadrant of the result, and
26699 &lt;VAR&gt;x&lt;/VAR&gt; is permitted to be zero. The return value is given in radians
26700 and is in the range &lt;CODE&gt;-pi&lt;/CODE&gt; to &lt;CODE&gt;pi&lt;/CODE&gt;, inclusive.
26701 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;x&lt;/VAR&gt; and &lt;VAR&gt;y&lt;/VAR&gt; are coordinates of a point in the plane,
26702 &lt;CODE&gt;atan2&lt;/CODE&gt; returns the signed angle between the line from the origin
26703 to that point and the x-axis. Thus, &lt;CODE&gt;atan2&lt;/CODE&gt; is useful for
26704 converting Cartesian coordinates to polar coordinates. (To compute the
26705 radial coordinate, use &lt;CODE&gt;hypot&lt;/CODE&gt;; see Exponents and
26706 Logarithms.)
26707 &lt;br&gt;&lt;br&gt; If both &lt;VAR&gt;x&lt;/VAR&gt; and &lt;VAR&gt;y&lt;/VAR&gt; are zero, &lt;CODE&gt;atan2&lt;/CODE&gt; returns zero.
26708 </synopsis>
26709 </function>
26710 </construct>
26711 <construct id="function-atan2l" type="function">
26712 <function returntype="long double">
26713 <prototype>
26714 <parameter content="long double y"/>
26715 <parameter content="long double x"/>
26716 </prototype>
26717 <headers>
26718 <header filename = "math.h"/>
26719 </headers>
26720 <synopsis>
26721 This function computes the arc tangent of &lt;VAR&gt;y&lt;/VAR&gt;/&lt;VAR&gt;x&lt;/VAR&gt;, but the signs
26722 of both arguments are used to determine the quadrant of the result, and
26723 &lt;VAR&gt;x&lt;/VAR&gt; is permitted to be zero. The return value is given in radians
26724 and is in the range &lt;CODE&gt;-pi&lt;/CODE&gt; to &lt;CODE&gt;pi&lt;/CODE&gt;, inclusive.
26725 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;x&lt;/VAR&gt; and &lt;VAR&gt;y&lt;/VAR&gt; are coordinates of a point in the plane,
26726 &lt;CODE&gt;atan2&lt;/CODE&gt; returns the signed angle between the line from the origin
26727 to that point and the x-axis. Thus, &lt;CODE&gt;atan2&lt;/CODE&gt; is useful for
26728 converting Cartesian coordinates to polar coordinates. (To compute the
26729 radial coordinate, use &lt;CODE&gt;hypot&lt;/CODE&gt;; see Exponents and
26730 Logarithms.)
26731 &lt;br&gt;&lt;br&gt; If both &lt;VAR&gt;x&lt;/VAR&gt; and &lt;VAR&gt;y&lt;/VAR&gt; are zero, &lt;CODE&gt;atan2&lt;/CODE&gt; returns zero.
26732 </synopsis>
26733 </function>
26734 </construct>
26735 <construct id="function-casin" type="function">
26736 <function returntype="complex double">
26737 <prototype>
26738 <parameter content="complex double z"/>
26739 </prototype>
26740 <headers>
26741 <header filename = "complex.h"/>
26742 </headers>
26743 <synopsis>
26744 These functions compute the complex arc sine of &lt;VAR&gt;z&lt;/VAR&gt;---that is, the
26745 value whose sine is &lt;VAR&gt;z&lt;/VAR&gt;. The value returned is in radians.
26746 &lt;br&gt;&lt;br&gt; Unlike the real-valued functions, &lt;CODE&gt;casin&lt;/CODE&gt; is defined for all
26747 values of &lt;VAR&gt;z&lt;/VAR&gt;.
26748 </synopsis>
26749 </function>
26750 </construct>
26751 <construct id="function-casinf" type="function">
26752 <function returntype="complex float">
26753 <prototype>
26754 <parameter content="complex float z"/>
26755 </prototype>
26756 <headers>
26757 <header filename = "complex.h"/>
26758 </headers>
26759 <synopsis>
26760 These functions compute the complex arc sine of &lt;VAR&gt;z&lt;/VAR&gt;---that is, the
26761 value whose sine is &lt;VAR&gt;z&lt;/VAR&gt;. The value returned is in radians.
26762 &lt;br&gt;&lt;br&gt; Unlike the real-valued functions, &lt;CODE&gt;casin&lt;/CODE&gt; is defined for all
26763 values of &lt;VAR&gt;z&lt;/VAR&gt;.
26764 </synopsis>
26765 </function>
26766 </construct>
26767 <construct id="function-casinl" type="function">
26768 <function returntype="complex long double">
26769 <prototype>
26770 <parameter content="complex long double z"/>
26771 </prototype>
26772 <headers>
26773 <header filename = "complex.h"/>
26774 </headers>
26775 <synopsis>
26776 These functions compute the complex arc sine of &lt;VAR&gt;z&lt;/VAR&gt;---that is, the
26777 value whose sine is &lt;VAR&gt;z&lt;/VAR&gt;. The value returned is in radians.
26778 &lt;br&gt;&lt;br&gt; Unlike the real-valued functions, &lt;CODE&gt;casin&lt;/CODE&gt; is defined for all
26779 values of &lt;VAR&gt;z&lt;/VAR&gt;.
26780 </synopsis>
26781 </function>
26782 </construct>
26783 <construct id="function-cacos" type="function">
26784 <function returntype="complex double">
26785 <prototype>
26786 <parameter content="complex double z"/>
26787 </prototype>
26788 <headers>
26789 <header filename = "complex.h"/>
26790 </headers>
26791 <synopsis>
26792 These functions compute the complex arc cosine of &lt;VAR&gt;z&lt;/VAR&gt;---that is, the
26793 value whose cosine is &lt;VAR&gt;z&lt;/VAR&gt;. The value returned is in radians.
26794 &lt;br&gt;&lt;br&gt; Unlike the real-valued functions, &lt;CODE&gt;cacos&lt;/CODE&gt; is defined for all
26795 values of &lt;VAR&gt;z&lt;/VAR&gt;.
26796 </synopsis>
26797 </function>
26798 </construct>
26799 <construct id="function-cacosf" type="function">
26800 <function returntype="complex float">
26801 <prototype>
26802 <parameter content="complex float z"/>
26803 </prototype>
26804 <headers>
26805 <header filename = "complex.h"/>
26806 </headers>
26807 <synopsis>
26808 These functions compute the complex arc cosine of &lt;VAR&gt;z&lt;/VAR&gt;---that is, the
26809 value whose cosine is &lt;VAR&gt;z&lt;/VAR&gt;. The value returned is in radians.
26810 &lt;br&gt;&lt;br&gt; Unlike the real-valued functions, &lt;CODE&gt;cacos&lt;/CODE&gt; is defined for all
26811 values of &lt;VAR&gt;z&lt;/VAR&gt;.
26812 </synopsis>
26813 </function>
26814 </construct>
26815 <construct id="function-cacosl" type="function">
26816 <function returntype="complex long double">
26817 <prototype>
26818 <parameter content="complex long double z"/>
26819 </prototype>
26820 <headers>
26821 <header filename = "complex.h"/>
26822 </headers>
26823 <synopsis>
26824 These functions compute the complex arc cosine of &lt;VAR&gt;z&lt;/VAR&gt;---that is, the
26825 value whose cosine is &lt;VAR&gt;z&lt;/VAR&gt;. The value returned is in radians.
26826 &lt;br&gt;&lt;br&gt; Unlike the real-valued functions, &lt;CODE&gt;cacos&lt;/CODE&gt; is defined for all
26827 values of &lt;VAR&gt;z&lt;/VAR&gt;.
26828 </synopsis>
26829 </function>
26830 </construct>
26831 <construct id="function-catan" type="function">
26832 <function returntype="complex double">
26833 <prototype>
26834 <parameter content="complex double z"/>
26835 </prototype>
26836 <headers>
26837 <header filename = "complex.h"/>
26838 </headers>
26839 <synopsis>
26840 These functions compute the complex arc tangent of &lt;VAR&gt;z&lt;/VAR&gt;---that is,
26841 the value whose tangent is &lt;VAR&gt;z&lt;/VAR&gt;. The value is in units of radians.
26842 </synopsis>
26843 </function>
26844 </construct>
26845 <construct id="function-catanf" type="function">
26846 <function returntype="complex float">
26847 <prototype>
26848 <parameter content="complex float z"/>
26849 </prototype>
26850 <headers>
26851 <header filename = "complex.h"/>
26852 </headers>
26853 <synopsis>
26854 These functions compute the complex arc tangent of &lt;VAR&gt;z&lt;/VAR&gt;---that is,
26855 the value whose tangent is &lt;VAR&gt;z&lt;/VAR&gt;. The value is in units of radians.
26856 </synopsis>
26857 </function>
26858 </construct>
26859 <construct id="function-catanl" type="function">
26860 <function returntype="complex long double">
26861 <prototype>
26862 <parameter content="complex long double z"/>
26863 </prototype>
26864 <headers>
26865 <header filename = "complex.h"/>
26866 </headers>
26867 <synopsis>
26868 These functions compute the complex arc tangent of &lt;VAR&gt;z&lt;/VAR&gt;---that is,
26869 the value whose tangent is &lt;VAR&gt;z&lt;/VAR&gt;. The value is in units of radians.
26870 </synopsis>
26871 </function>
26872 </construct>
26873 <construct id="function-exp" type="function">
26874 <function returntype="double">
26875 <prototype>
26876 <parameter content="double x"/>
26877 </prototype>
26878 <headers>
26879 <header filename = "math.h"/>
26880 </headers>
26881 <synopsis>
26882 These functions compute &lt;CODE&gt;e&lt;/CODE&gt; (the base of natural logarithms) raised
26883 to the power &lt;VAR&gt;x&lt;/VAR&gt;.
26884 &lt;br&gt;&lt;br&gt; If the magnitude of the result is too large to be representable,
26885 &lt;CODE&gt;exp&lt;/CODE&gt; signals overflow.
26886 </synopsis>
26887 </function>
26888 </construct>
26889 <construct id="function-expf" type="function">
26890 <function returntype="float">
26891 <prototype>
26892 <parameter content="float x"/>
26893 </prototype>
26894 <headers>
26895 <header filename = "math.h"/>
26896 </headers>
26897 <synopsis>
26898 These functions compute &lt;CODE&gt;e&lt;/CODE&gt; (the base of natural logarithms) raised
26899 to the power &lt;VAR&gt;x&lt;/VAR&gt;.
26900 &lt;br&gt;&lt;br&gt; If the magnitude of the result is too large to be representable,
26901 &lt;CODE&gt;exp&lt;/CODE&gt; signals overflow.
26902 </synopsis>
26903 </function>
26904 </construct>
26905 <construct id="function-expl" type="function">
26906 <function returntype="long double">
26907 <prototype>
26908 <parameter content="long double x"/>
26909 </prototype>
26910 <headers>
26911 <header filename = "math.h"/>
26912 </headers>
26913 <synopsis>
26914 These functions compute &lt;CODE&gt;e&lt;/CODE&gt; (the base of natural logarithms) raised
26915 to the power &lt;VAR&gt;x&lt;/VAR&gt;.
26916 &lt;br&gt;&lt;br&gt; If the magnitude of the result is too large to be representable,
26917 &lt;CODE&gt;exp&lt;/CODE&gt; signals overflow.
26918 </synopsis>
26919 </function>
26920 </construct>
26921 <construct id="function-exp2" type="function">
26922 <function returntype="double">
26923 <prototype>
26924 <parameter content="double x"/>
26925 </prototype>
26926 <headers>
26927 <header filename = "math.h"/>
26928 </headers>
26929 <synopsis>
26930 These functions compute &lt;CODE&gt;2&lt;/CODE&gt; raised to the power &lt;VAR&gt;x&lt;/VAR&gt;.
26931 Mathematically, &lt;CODE&gt;exp2 (x)&lt;/CODE&gt; is the same as &lt;CODE&gt;exp (x * log (2))&lt;/CODE&gt;.
26932 </synopsis>
26933 </function>
26934 </construct>
26935 <construct id="function-exp2f" type="function">
26936 <function returntype="float">
26937 <prototype>
26938 <parameter content="float x"/>
26939 </prototype>
26940 <headers>
26941 <header filename = "math.h"/>
26942 </headers>
26943 <synopsis>
26944 These functions compute &lt;CODE&gt;2&lt;/CODE&gt; raised to the power &lt;VAR&gt;x&lt;/VAR&gt;.
26945 Mathematically, &lt;CODE&gt;exp2 (x)&lt;/CODE&gt; is the same as &lt;CODE&gt;exp (x * log (2))&lt;/CODE&gt;.
26946 </synopsis>
26947 </function>
26948 </construct>
26949 <construct id="function-exp2l" type="function">
26950 <function returntype="long double">
26951 <prototype>
26952 <parameter content="long double x"/>
26953 </prototype>
26954 <headers>
26955 <header filename = "math.h"/>
26956 </headers>
26957 <synopsis>
26958 These functions compute &lt;CODE&gt;2&lt;/CODE&gt; raised to the power &lt;VAR&gt;x&lt;/VAR&gt;.
26959 Mathematically, &lt;CODE&gt;exp2 (x)&lt;/CODE&gt; is the same as &lt;CODE&gt;exp (x * log (2))&lt;/CODE&gt;.
26960 </synopsis>
26961 </function>
26962 </construct>
26963 <construct id="function-exp10" type="function">
26964 <function returntype="double">
26965 <prototype>
26966 <parameter content="double x"/>
26967 </prototype>
26968 <headers>
26969 <header filename = "math.h"/>
26970 </headers>
26971 <synopsis>
26972 These functions compute &lt;CODE&gt;10&lt;/CODE&gt; raised to the power &lt;VAR&gt;x&lt;/VAR&gt;.
26973 Mathematically, &lt;CODE&gt;exp10 (x)&lt;/CODE&gt; is the same as &lt;CODE&gt;exp (x * log (10))&lt;/CODE&gt;.
26974 &lt;br&gt;&lt;br&gt; These functions are GNU extensions. The name &lt;CODE&gt;exp10&lt;/CODE&gt; is
26975 preferred, since it is analogous to &lt;CODE&gt;exp&lt;/CODE&gt; and &lt;CODE&gt;exp2&lt;/CODE&gt;.
26976 </synopsis>
26977 </function>
26978 </construct>
26979 <construct id="function-exp10f" type="function">
26980 <function returntype="float">
26981 <prototype>
26982 <parameter content="float x"/>
26983 </prototype>
26984 <headers>
26985 <header filename = "math.h"/>
26986 </headers>
26987 <synopsis>
26988 These functions compute &lt;CODE&gt;10&lt;/CODE&gt; raised to the power &lt;VAR&gt;x&lt;/VAR&gt;.
26989 Mathematically, &lt;CODE&gt;exp10 (x)&lt;/CODE&gt; is the same as &lt;CODE&gt;exp (x * log (10))&lt;/CODE&gt;.
26990 &lt;br&gt;&lt;br&gt; These functions are GNU extensions. The name &lt;CODE&gt;exp10&lt;/CODE&gt; is
26991 preferred, since it is analogous to &lt;CODE&gt;exp&lt;/CODE&gt; and &lt;CODE&gt;exp2&lt;/CODE&gt;.
26992 </synopsis>
26993 </function>
26994 </construct>
26995 <construct id="function-exp10l" type="function">
26996 <function returntype="long double">
26997 <prototype>
26998 <parameter content="long double x"/>
26999 </prototype>
27000 <headers>
27001 <header filename = "math.h"/>
27002 </headers>
27003 <synopsis>
27004 These functions compute &lt;CODE&gt;10&lt;/CODE&gt; raised to the power &lt;VAR&gt;x&lt;/VAR&gt;.
27005 Mathematically, &lt;CODE&gt;exp10 (x)&lt;/CODE&gt; is the same as &lt;CODE&gt;exp (x * log (10))&lt;/CODE&gt;.
27006 &lt;br&gt;&lt;br&gt; These functions are GNU extensions. The name &lt;CODE&gt;exp10&lt;/CODE&gt; is
27007 preferred, since it is analogous to &lt;CODE&gt;exp&lt;/CODE&gt; and &lt;CODE&gt;exp2&lt;/CODE&gt;.
27008 </synopsis>
27009 </function>
27010 </construct>
27011 <construct id="function-pow10" type="function">
27012 <function returntype="double">
27013 <prototype>
27014 <parameter content="double x"/>
27015 </prototype>
27016 <headers>
27017 <header filename = "math.h"/>
27018 </headers>
27019 <synopsis>
27020 These functions compute &lt;CODE&gt;10&lt;/CODE&gt; raised to the power &lt;VAR&gt;x&lt;/VAR&gt;.
27021 Mathematically, &lt;CODE&gt;exp10 (x)&lt;/CODE&gt; is the same as &lt;CODE&gt;exp (x * log (10))&lt;/CODE&gt;.
27022 &lt;br&gt;&lt;br&gt; These functions are GNU extensions. The name &lt;CODE&gt;exp10&lt;/CODE&gt; is
27023 preferred, since it is analogous to &lt;CODE&gt;exp&lt;/CODE&gt; and &lt;CODE&gt;exp2&lt;/CODE&gt;.
27024 </synopsis>
27025 </function>
27026 </construct>
27027 <construct id="function-pow10f" type="function">
27028 <function returntype="float">
27029 <prototype>
27030 <parameter content="float x"/>
27031 </prototype>
27032 <headers>
27033 <header filename = "math.h"/>
27034 </headers>
27035 <synopsis>
27036 These functions compute &lt;CODE&gt;10&lt;/CODE&gt; raised to the power &lt;VAR&gt;x&lt;/VAR&gt;.
27037 Mathematically, &lt;CODE&gt;exp10 (x)&lt;/CODE&gt; is the same as &lt;CODE&gt;exp (x * log (10))&lt;/CODE&gt;.
27038 &lt;br&gt;&lt;br&gt; These functions are GNU extensions. The name &lt;CODE&gt;exp10&lt;/CODE&gt; is
27039 preferred, since it is analogous to &lt;CODE&gt;exp&lt;/CODE&gt; and &lt;CODE&gt;exp2&lt;/CODE&gt;.
27040 </synopsis>
27041 </function>
27042 </construct>
27043 <construct id="function-pow10l" type="function">
27044 <function returntype="long double">
27045 <prototype>
27046 <parameter content="long double x"/>
27047 </prototype>
27048 <headers>
27049 <header filename = "math.h"/>
27050 </headers>
27051 <synopsis>
27052 These functions compute &lt;CODE&gt;10&lt;/CODE&gt; raised to the power &lt;VAR&gt;x&lt;/VAR&gt;.
27053 Mathematically, &lt;CODE&gt;exp10 (x)&lt;/CODE&gt; is the same as &lt;CODE&gt;exp (x * log (10))&lt;/CODE&gt;.
27054 &lt;br&gt;&lt;br&gt; These functions are GNU extensions. The name &lt;CODE&gt;exp10&lt;/CODE&gt; is
27055 preferred, since it is analogous to &lt;CODE&gt;exp&lt;/CODE&gt; and &lt;CODE&gt;exp2&lt;/CODE&gt;.
27056 </synopsis>
27057 </function>
27058 </construct>
27059 <construct id="function-log" type="function">
27060 <function returntype="double">
27061 <prototype>
27062 <parameter content="double x"/>
27063 </prototype>
27064 <headers>
27065 <header filename = "math.h"/>
27066 </headers>
27067 <synopsis>
27068 These functions compute the natural logarithm of &lt;VAR&gt;x&lt;/VAR&gt;. &lt;CODE&gt;exp (log
27069 (&lt;VAR&gt;x&lt;/VAR&gt;))&lt;/CODE&gt; equals &lt;VAR&gt;x&lt;/VAR&gt;, exactly in mathematics and approximately in
27070 C.
27071 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;x&lt;/VAR&gt; is negative, &lt;CODE&gt;log&lt;/CODE&gt; signals a domain error. If &lt;VAR&gt;x&lt;/VAR&gt;
27072 is zero, it returns negative infinity; if &lt;VAR&gt;x&lt;/VAR&gt; is too close to zero,
27073 it may signal overflow.
27074 </synopsis>
27075 </function>
27076 </construct>
27077 <construct id="function-logf" type="function">
27078 <function returntype="float">
27079 <prototype>
27080 <parameter content="float x"/>
27081 </prototype>
27082 <headers>
27083 <header filename = "math.h"/>
27084 </headers>
27085 <synopsis>
27086 These functions compute the natural logarithm of &lt;VAR&gt;x&lt;/VAR&gt;. &lt;CODE&gt;exp (log
27087 (&lt;VAR&gt;x&lt;/VAR&gt;))&lt;/CODE&gt; equals &lt;VAR&gt;x&lt;/VAR&gt;, exactly in mathematics and approximately in
27088 C.
27089 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;x&lt;/VAR&gt; is negative, &lt;CODE&gt;log&lt;/CODE&gt; signals a domain error. If &lt;VAR&gt;x&lt;/VAR&gt;
27090 is zero, it returns negative infinity; if &lt;VAR&gt;x&lt;/VAR&gt; is too close to zero,
27091 it may signal overflow.
27092 </synopsis>
27093 </function>
27094 </construct>
27095 <construct id="function-logl" type="function">
27096 <function returntype="long double">
27097 <prototype>
27098 <parameter content="long double x"/>
27099 </prototype>
27100 <headers>
27101 <header filename = "math.h"/>
27102 </headers>
27103 <synopsis>
27104 These functions compute the natural logarithm of &lt;VAR&gt;x&lt;/VAR&gt;. &lt;CODE&gt;exp (log
27105 (&lt;VAR&gt;x&lt;/VAR&gt;))&lt;/CODE&gt; equals &lt;VAR&gt;x&lt;/VAR&gt;, exactly in mathematics and approximately in
27106 C.
27107 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;x&lt;/VAR&gt; is negative, &lt;CODE&gt;log&lt;/CODE&gt; signals a domain error. If &lt;VAR&gt;x&lt;/VAR&gt;
27108 is zero, it returns negative infinity; if &lt;VAR&gt;x&lt;/VAR&gt; is too close to zero,
27109 it may signal overflow.
27110 </synopsis>
27111 </function>
27112 </construct>
27113 <construct id="function-log10" type="function">
27114 <function returntype="double">
27115 <prototype>
27116 <parameter content="double x"/>
27117 </prototype>
27118 <headers>
27119 <header filename = "math.h"/>
27120 </headers>
27121 <synopsis>
27122 These functions return the base-10 logarithm of &lt;VAR&gt;x&lt;/VAR&gt;.
27123 &lt;CODE&gt;log10 (&lt;VAR&gt;x&lt;/VAR&gt;)&lt;/CODE&gt; equals &lt;CODE&gt;log (&lt;VAR&gt;x&lt;/VAR&gt;) / log (10)&lt;/CODE&gt;.
27124 &lt;br&gt;&lt;br&gt;
27125 </synopsis>
27126 </function>
27127 </construct>
27128 <construct id="function-log10f" type="function">
27129 <function returntype="float">
27130 <prototype>
27131 <parameter content="float x"/>
27132 </prototype>
27133 <headers>
27134 <header filename = "math.h"/>
27135 </headers>
27136 <synopsis>
27137 These functions return the base-10 logarithm of &lt;VAR&gt;x&lt;/VAR&gt;.
27138 &lt;CODE&gt;log10 (&lt;VAR&gt;x&lt;/VAR&gt;)&lt;/CODE&gt; equals &lt;CODE&gt;log (&lt;VAR&gt;x&lt;/VAR&gt;) / log (10)&lt;/CODE&gt;.
27139 &lt;br&gt;&lt;br&gt;
27140 </synopsis>
27141 </function>
27142 </construct>
27143 <construct id="function-log10l" type="function">
27144 <function returntype="long double">
27145 <prototype>
27146 <parameter content="long double x"/>
27147 </prototype>
27148 <headers>
27149 <header filename = "math.h"/>
27150 </headers>
27151 <synopsis>
27152 These functions return the base-10 logarithm of &lt;VAR&gt;x&lt;/VAR&gt;.
27153 &lt;CODE&gt;log10 (&lt;VAR&gt;x&lt;/VAR&gt;)&lt;/CODE&gt; equals &lt;CODE&gt;log (&lt;VAR&gt;x&lt;/VAR&gt;) / log (10)&lt;/CODE&gt;.
27154 &lt;br&gt;&lt;br&gt;
27155 </synopsis>
27156 </function>
27157 </construct>
27158 <construct id="function-log2" type="function">
27159 <function returntype="double">
27160 <prototype>
27161 <parameter content="double x"/>
27162 </prototype>
27163 <headers>
27164 <header filename = "math.h"/>
27165 </headers>
27166 <synopsis>
27167 These functions return the base-2 logarithm of &lt;VAR&gt;x&lt;/VAR&gt;.
27168 &lt;CODE&gt;log2 (&lt;VAR&gt;x&lt;/VAR&gt;)&lt;/CODE&gt; equals &lt;CODE&gt;log (&lt;VAR&gt;x&lt;/VAR&gt;) / log (2)&lt;/CODE&gt;.
27169 </synopsis>
27170 </function>
27171 </construct>
27172 <construct id="function-log2f" type="function">
27173 <function returntype="float">
27174 <prototype>
27175 <parameter content="float x"/>
27176 </prototype>
27177 <headers>
27178 <header filename = "math.h"/>
27179 </headers>
27180 <synopsis>
27181 These functions return the base-2 logarithm of &lt;VAR&gt;x&lt;/VAR&gt;.
27182 &lt;CODE&gt;log2 (&lt;VAR&gt;x&lt;/VAR&gt;)&lt;/CODE&gt; equals &lt;CODE&gt;log (&lt;VAR&gt;x&lt;/VAR&gt;) / log (2)&lt;/CODE&gt;.
27183 </synopsis>
27184 </function>
27185 </construct>
27186 <construct id="function-log2l" type="function">
27187 <function returntype="long double">
27188 <prototype>
27189 <parameter content="long double x"/>
27190 </prototype>
27191 <headers>
27192 <header filename = "math.h"/>
27193 </headers>
27194 <synopsis>
27195 These functions return the base-2 logarithm of &lt;VAR&gt;x&lt;/VAR&gt;.
27196 &lt;CODE&gt;log2 (&lt;VAR&gt;x&lt;/VAR&gt;)&lt;/CODE&gt; equals &lt;CODE&gt;log (&lt;VAR&gt;x&lt;/VAR&gt;) / log (2)&lt;/CODE&gt;.
27197 </synopsis>
27198 </function>
27199 </construct>
27200 <construct id="function-logb" type="function">
27201 <function returntype="double">
27202 <prototype>
27203 <parameter content="double x"/>
27204 </prototype>
27205 <headers>
27206 <header filename = "math.h"/>
27207 </headers>
27208 <synopsis>
27209 These functions extract the exponent of &lt;VAR&gt;x&lt;/VAR&gt; and return it as a
27210 floating-point value. If &lt;CODE&gt;FLT_RADIX&lt;/CODE&gt; is two, &lt;CODE&gt;logb&lt;/CODE&gt; is equal
27211 to &lt;CODE&gt;floor (log2 (x))&lt;/CODE&gt;, except it's probably faster.
27212 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;x&lt;/VAR&gt; is de-normalized, &lt;CODE&gt;logb&lt;/CODE&gt; returns the exponent &lt;VAR&gt;x&lt;/VAR&gt;
27213 would have if it were normalized. If &lt;VAR&gt;x&lt;/VAR&gt; is infinity (positive or
27214 negative), &lt;CODE&gt;logb&lt;/CODE&gt; returns infinity{}. If &lt;VAR&gt;x&lt;/VAR&gt; is zero,
27215 &lt;CODE&gt;logb&lt;/CODE&gt; returns infinity{}. It does not signal.
27216 </synopsis>
27217 </function>
27218 </construct>
27219 <construct id="function-logbf" type="function">
27220 <function returntype="float">
27221 <prototype>
27222 <parameter content="float x"/>
27223 </prototype>
27224 <headers>
27225 <header filename = "math.h"/>
27226 </headers>
27227 <synopsis>
27228 These functions extract the exponent of &lt;VAR&gt;x&lt;/VAR&gt; and return it as a
27229 floating-point value. If &lt;CODE&gt;FLT_RADIX&lt;/CODE&gt; is two, &lt;CODE&gt;logb&lt;/CODE&gt; is equal
27230 to &lt;CODE&gt;floor (log2 (x))&lt;/CODE&gt;, except it's probably faster.
27231 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;x&lt;/VAR&gt; is de-normalized, &lt;CODE&gt;logb&lt;/CODE&gt; returns the exponent &lt;VAR&gt;x&lt;/VAR&gt;
27232 would have if it were normalized. If &lt;VAR&gt;x&lt;/VAR&gt; is infinity (positive or
27233 negative), &lt;CODE&gt;logb&lt;/CODE&gt; returns infinity{}. If &lt;VAR&gt;x&lt;/VAR&gt; is zero,
27234 &lt;CODE&gt;logb&lt;/CODE&gt; returns infinity{}. It does not signal.
27235 </synopsis>
27236 </function>
27237 </construct>
27238 <construct id="function-logbl" type="function">
27239 <function returntype="long double">
27240 <prototype>
27241 <parameter content="long double x"/>
27242 </prototype>
27243 <headers>
27244 <header filename = "math.h"/>
27245 </headers>
27246 <synopsis>
27247 These functions extract the exponent of &lt;VAR&gt;x&lt;/VAR&gt; and return it as a
27248 floating-point value. If &lt;CODE&gt;FLT_RADIX&lt;/CODE&gt; is two, &lt;CODE&gt;logb&lt;/CODE&gt; is equal
27249 to &lt;CODE&gt;floor (log2 (x))&lt;/CODE&gt;, except it's probably faster.
27250 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;x&lt;/VAR&gt; is de-normalized, &lt;CODE&gt;logb&lt;/CODE&gt; returns the exponent &lt;VAR&gt;x&lt;/VAR&gt;
27251 would have if it were normalized. If &lt;VAR&gt;x&lt;/VAR&gt; is infinity (positive or
27252 negative), &lt;CODE&gt;logb&lt;/CODE&gt; returns infinity{}. If &lt;VAR&gt;x&lt;/VAR&gt; is zero,
27253 &lt;CODE&gt;logb&lt;/CODE&gt; returns infinity{}. It does not signal.
27254 </synopsis>
27255 </function>
27256 </construct>
27257 <construct id="function-ilogb" type="function">
27258 <function returntype="int">
27259 <prototype>
27260 <parameter content="double x"/>
27261 </prototype>
27262 <headers>
27263 <header filename = "math.h"/>
27264 </headers>
27265 <synopsis>
27266 These functions are equivalent to the corresponding &lt;CODE&gt;logb&lt;/CODE&gt;
27267 functions except that they return signed integer values.
27268 </synopsis>
27269 </function>
27270 </construct>
27271 <construct id="function-ilogbf" type="function">
27272 <function returntype="int">
27273 <prototype>
27274 <parameter content="float x"/>
27275 </prototype>
27276 <headers>
27277 <header filename = "math.h"/>
27278 </headers>
27279 <synopsis>
27280 These functions are equivalent to the corresponding &lt;CODE&gt;logb&lt;/CODE&gt;
27281 functions except that they return signed integer values.
27282 </synopsis>
27283 </function>
27284 </construct>
27285 <construct id="function-ilogbl" type="function">
27286 <function returntype="int">
27287 <prototype>
27288 <parameter content="long double x"/>
27289 </prototype>
27290 <headers>
27291 <header filename = "math.h"/>
27292 </headers>
27293 <synopsis>
27294 These functions are equivalent to the corresponding &lt;CODE&gt;logb&lt;/CODE&gt;
27295 functions except that they return signed integer values.
27296 </synopsis>
27297 </function>
27298 </construct>
27299 <construct id="function-pow" type="function">
27300 <function returntype="double">
27301 <prototype>
27302 <parameter content="double base"/>
27303 <parameter content="double power"/>
27304 </prototype>
27305 <headers>
27306 <header filename = "math.h"/>
27307 </headers>
27308 <synopsis>
27309 These are general exponentiation functions, returning &lt;VAR&gt;base&lt;/VAR&gt; raised
27310 to &lt;VAR&gt;power&lt;/VAR&gt;.
27311 &lt;br&gt;&lt;br&gt; Mathematically, &lt;CODE&gt;pow&lt;/CODE&gt; would return a complex number when &lt;VAR&gt;base&lt;/VAR&gt;
27312 is negative and &lt;VAR&gt;power&lt;/VAR&gt; is not an integral value. &lt;CODE&gt;pow&lt;/CODE&gt; can't
27313 do that, so instead it signals a domain error. &lt;CODE&gt;pow&lt;/CODE&gt; may also
27314 underflow or overflow the destination type.
27315 </synopsis>
27316 </function>
27317 </construct>
27318 <construct id="function-powf" type="function">
27319 <function returntype="float">
27320 <prototype>
27321 <parameter content="float base"/>
27322 <parameter content="float power"/>
27323 </prototype>
27324 <headers>
27325 <header filename = "math.h"/>
27326 </headers>
27327 <synopsis>
27328 These are general exponentiation functions, returning &lt;VAR&gt;base&lt;/VAR&gt; raised
27329 to &lt;VAR&gt;power&lt;/VAR&gt;.
27330 &lt;br&gt;&lt;br&gt; Mathematically, &lt;CODE&gt;pow&lt;/CODE&gt; would return a complex number when &lt;VAR&gt;base&lt;/VAR&gt;
27331 is negative and &lt;VAR&gt;power&lt;/VAR&gt; is not an integral value. &lt;CODE&gt;pow&lt;/CODE&gt; can't
27332 do that, so instead it signals a domain error. &lt;CODE&gt;pow&lt;/CODE&gt; may also
27333 underflow or overflow the destination type.
27334 </synopsis>
27335 </function>
27336 </construct>
27337 <construct id="function-powl" type="function">
27338 <function returntype="long double">
27339 <prototype>
27340 <parameter content="long double base"/>
27341 <parameter content="long double power"/>
27342 </prototype>
27343 <headers>
27344 <header filename = "math.h"/>
27345 </headers>
27346 <synopsis>
27347 These are general exponentiation functions, returning &lt;VAR&gt;base&lt;/VAR&gt; raised
27348 to &lt;VAR&gt;power&lt;/VAR&gt;.
27349 &lt;br&gt;&lt;br&gt; Mathematically, &lt;CODE&gt;pow&lt;/CODE&gt; would return a complex number when &lt;VAR&gt;base&lt;/VAR&gt;
27350 is negative and &lt;VAR&gt;power&lt;/VAR&gt; is not an integral value. &lt;CODE&gt;pow&lt;/CODE&gt; can't
27351 do that, so instead it signals a domain error. &lt;CODE&gt;pow&lt;/CODE&gt; may also
27352 underflow or overflow the destination type.
27353 </synopsis>
27354 </function>
27355 </construct>
27356 <construct id="function-sqrt" type="function">
27357 <function returntype="double">
27358 <prototype>
27359 <parameter content="double x"/>
27360 </prototype>
27361 <headers>
27362 <header filename = "math.h"/>
27363 </headers>
27364 <synopsis>
27365 These functions return the nonnegative square root of &lt;VAR&gt;x&lt;/VAR&gt;.
27366 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;x&lt;/VAR&gt; is negative, &lt;CODE&gt;sqrt&lt;/CODE&gt; signals a domain error.
27367 Mathematically, it should return a complex number.
27368 </synopsis>
27369 </function>
27370 </construct>
27371 <construct id="function-sqrtf" type="function">
27372 <function returntype="float">
27373 <prototype>
27374 <parameter content="float x"/>
27375 </prototype>
27376 <headers>
27377 <header filename = "math.h"/>
27378 </headers>
27379 <synopsis>
27380 These functions return the nonnegative square root of &lt;VAR&gt;x&lt;/VAR&gt;.
27381 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;x&lt;/VAR&gt; is negative, &lt;CODE&gt;sqrt&lt;/CODE&gt; signals a domain error.
27382 Mathematically, it should return a complex number.
27383 </synopsis>
27384 </function>
27385 </construct>
27386 <construct id="function-sqrtl" type="function">
27387 <function returntype="long double">
27388 <prototype>
27389 <parameter content="long double x"/>
27390 </prototype>
27391 <headers>
27392 <header filename = "math.h"/>
27393 </headers>
27394 <synopsis>
27395 These functions return the nonnegative square root of &lt;VAR&gt;x&lt;/VAR&gt;.
27396 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;x&lt;/VAR&gt; is negative, &lt;CODE&gt;sqrt&lt;/CODE&gt; signals a domain error.
27397 Mathematically, it should return a complex number.
27398 </synopsis>
27399 </function>
27400 </construct>
27401 <construct id="function-cbrt" type="function">
27402 <function returntype="double">
27403 <prototype>
27404 <parameter content="double x"/>
27405 </prototype>
27406 <headers>
27407 <header filename = "math.h"/>
27408 </headers>
27409 <synopsis>
27410 These functions return the cube root of &lt;VAR&gt;x&lt;/VAR&gt;. They cannot
27411 fail; every representable real value has a representable real cube root.
27412 </synopsis>
27413 </function>
27414 </construct>
27415 <construct id="function-cbrtf" type="function">
27416 <function returntype="float">
27417 <prototype>
27418 <parameter content="float x"/>
27419 </prototype>
27420 <headers>
27421 <header filename = "math.h"/>
27422 </headers>
27423 <synopsis>
27424 These functions return the cube root of &lt;VAR&gt;x&lt;/VAR&gt;. They cannot
27425 fail; every representable real value has a representable real cube root.
27426 </synopsis>
27427 </function>
27428 </construct>
27429 <construct id="function-cbrtl" type="function">
27430 <function returntype="long double">
27431 <prototype>
27432 <parameter content="long double x"/>
27433 </prototype>
27434 <headers>
27435 <header filename = "math.h"/>
27436 </headers>
27437 <synopsis>
27438 These functions return the cube root of &lt;VAR&gt;x&lt;/VAR&gt;. They cannot
27439 fail; every representable real value has a representable real cube root.
27440 </synopsis>
27441 </function>
27442 </construct>
27443 <construct id="function-hypot" type="function">
27444 <function returntype="double">
27445 <prototype>
27446 <parameter content="double x"/>
27447 <parameter content="double y"/>
27448 </prototype>
27449 <headers>
27450 <header filename = "math.h"/>
27451 </headers>
27452 <synopsis>
27453 These functions return &lt;CODE&gt;sqrt (&lt;VAR&gt;x&lt;/VAR&gt;*&lt;VAR&gt;x&lt;/VAR&gt; +
27454 &lt;VAR&gt;y&lt;/VAR&gt;*&lt;VAR&gt;y&lt;/VAR&gt;)&lt;/CODE&gt;. This is the length of the hypotenuse of a right
27455 triangle with sides of length &lt;VAR&gt;x&lt;/VAR&gt; and &lt;VAR&gt;y&lt;/VAR&gt;, or the distance
27456 of the point (&lt;VAR&gt;x&lt;/VAR&gt;, &lt;VAR&gt;y&lt;/VAR&gt;) from the origin. Using this function
27457 instead of the direct formula is wise, since the error is
27458 much smaller. See also the function &lt;CODE&gt;cabs&lt;/CODE&gt; in Absolute Value.
27459 </synopsis>
27460 </function>
27461 </construct>
27462 <construct id="function-hypotf" type="function">
27463 <function returntype="float">
27464 <prototype>
27465 <parameter content="float x"/>
27466 <parameter content="float y"/>
27467 </prototype>
27468 <headers>
27469 <header filename = "math.h"/>
27470 </headers>
27471 <synopsis>
27472 These functions return &lt;CODE&gt;sqrt (&lt;VAR&gt;x&lt;/VAR&gt;*&lt;VAR&gt;x&lt;/VAR&gt; +
27473 &lt;VAR&gt;y&lt;/VAR&gt;*&lt;VAR&gt;y&lt;/VAR&gt;)&lt;/CODE&gt;. This is the length of the hypotenuse of a right
27474 triangle with sides of length &lt;VAR&gt;x&lt;/VAR&gt; and &lt;VAR&gt;y&lt;/VAR&gt;, or the distance
27475 of the point (&lt;VAR&gt;x&lt;/VAR&gt;, &lt;VAR&gt;y&lt;/VAR&gt;) from the origin. Using this function
27476 instead of the direct formula is wise, since the error is
27477 much smaller. See also the function &lt;CODE&gt;cabs&lt;/CODE&gt; in Absolute Value.
27478 </synopsis>
27479 </function>
27480 </construct>
27481 <construct id="function-hypotl" type="function">
27482 <function returntype="long double">
27483 <prototype>
27484 <parameter content="long double x"/>
27485 <parameter content="long double y"/>
27486 </prototype>
27487 <headers>
27488 <header filename = "math.h"/>
27489 </headers>
27490 <synopsis>
27491 These functions return &lt;CODE&gt;sqrt (&lt;VAR&gt;x&lt;/VAR&gt;*&lt;VAR&gt;x&lt;/VAR&gt; +
27492 &lt;VAR&gt;y&lt;/VAR&gt;*&lt;VAR&gt;y&lt;/VAR&gt;)&lt;/CODE&gt;. This is the length of the hypotenuse of a right
27493 triangle with sides of length &lt;VAR&gt;x&lt;/VAR&gt; and &lt;VAR&gt;y&lt;/VAR&gt;, or the distance
27494 of the point (&lt;VAR&gt;x&lt;/VAR&gt;, &lt;VAR&gt;y&lt;/VAR&gt;) from the origin. Using this function
27495 instead of the direct formula is wise, since the error is
27496 much smaller. See also the function &lt;CODE&gt;cabs&lt;/CODE&gt; in Absolute Value.
27497 </synopsis>
27498 </function>
27499 </construct>
27500 <construct id="function-expm1" type="function">
27501 <function returntype="double">
27502 <prototype>
27503 <parameter content="double x"/>
27504 </prototype>
27505 <headers>
27506 <header filename = "math.h"/>
27507 </headers>
27508 <synopsis>
27509 These functions return a value equivalent to &lt;CODE&gt;exp (&lt;VAR&gt;x&lt;/VAR&gt;) - 1&lt;/CODE&gt;.
27510 They are computed in a way that is accurate even if &lt;VAR&gt;x&lt;/VAR&gt; is
27511 near zero---a case where &lt;CODE&gt;exp (&lt;VAR&gt;x&lt;/VAR&gt;) - 1&lt;/CODE&gt; would be inaccurate owing
27512 to subtraction of two numbers that are nearly equal.
27513 </synopsis>
27514 </function>
27515 </construct>
27516 <construct id="function-expm1f" type="function">
27517 <function returntype="float">
27518 <prototype>
27519 <parameter content="float x"/>
27520 </prototype>
27521 <headers>
27522 <header filename = "math.h"/>
27523 </headers>
27524 <synopsis>
27525 These functions return a value equivalent to &lt;CODE&gt;exp (&lt;VAR&gt;x&lt;/VAR&gt;) - 1&lt;/CODE&gt;.
27526 They are computed in a way that is accurate even if &lt;VAR&gt;x&lt;/VAR&gt; is
27527 near zero---a case where &lt;CODE&gt;exp (&lt;VAR&gt;x&lt;/VAR&gt;) - 1&lt;/CODE&gt; would be inaccurate owing
27528 to subtraction of two numbers that are nearly equal.
27529 </synopsis>
27530 </function>
27531 </construct>
27532 <construct id="function-expm1l" type="function">
27533 <function returntype="long double">
27534 <prototype>
27535 <parameter content="long double x"/>
27536 </prototype>
27537 <headers>
27538 <header filename = "math.h"/>
27539 </headers>
27540 <synopsis>
27541 These functions return a value equivalent to &lt;CODE&gt;exp (&lt;VAR&gt;x&lt;/VAR&gt;) - 1&lt;/CODE&gt;.
27542 They are computed in a way that is accurate even if &lt;VAR&gt;x&lt;/VAR&gt; is
27543 near zero---a case where &lt;CODE&gt;exp (&lt;VAR&gt;x&lt;/VAR&gt;) - 1&lt;/CODE&gt; would be inaccurate owing
27544 to subtraction of two numbers that are nearly equal.
27545 </synopsis>
27546 </function>
27547 </construct>
27548 <construct id="function-log1p" type="function">
27549 <function returntype="double">
27550 <prototype>
27551 <parameter content="double x"/>
27552 </prototype>
27553 <headers>
27554 <header filename = "math.h"/>
27555 </headers>
27556 <synopsis>
27557 These functions returns a value equivalent to &lt;CODE&gt;log (1 + &lt;VAR&gt;x&lt;/VAR&gt;)&lt;/CODE&gt;.
27558 They are computed in a way that is accurate even if &lt;VAR&gt;x&lt;/VAR&gt; is
27559 near zero.
27560 </synopsis>
27561 </function>
27562 </construct>
27563 <construct id="function-log1pf" type="function">
27564 <function returntype="float">
27565 <prototype>
27566 <parameter content="float x"/>
27567 </prototype>
27568 <headers>
27569 <header filename = "math.h"/>
27570 </headers>
27571 <synopsis>
27572 These functions returns a value equivalent to &lt;CODE&gt;log (1 + &lt;VAR&gt;x&lt;/VAR&gt;)&lt;/CODE&gt;.
27573 They are computed in a way that is accurate even if &lt;VAR&gt;x&lt;/VAR&gt; is
27574 near zero.
27575 </synopsis>
27576 </function>
27577 </construct>
27578 <construct id="function-log1pl" type="function">
27579 <function returntype="long double">
27580 <prototype>
27581 <parameter content="long double x"/>
27582 </prototype>
27583 <headers>
27584 <header filename = "math.h"/>
27585 </headers>
27586 <synopsis>
27587 These functions returns a value equivalent to &lt;CODE&gt;log (1 + &lt;VAR&gt;x&lt;/VAR&gt;)&lt;/CODE&gt;.
27588 They are computed in a way that is accurate even if &lt;VAR&gt;x&lt;/VAR&gt; is
27589 near zero.
27590 </synopsis>
27591 </function>
27592 </construct>
27593 <construct id="function-cexp" type="function">
27594 <function returntype="complex double">
27595 <prototype>
27596 <parameter content="complex double z"/>
27597 </prototype>
27598 <headers>
27599 <header filename = "complex.h"/>
27600 </headers>
27601 <synopsis>
27602 These functions return &lt;CODE&gt;e&lt;/CODE&gt; (the base of natural
27603 logarithms) raised to the power of &lt;VAR&gt;z&lt;/VAR&gt;.
27604 Mathematically, this corresponds to the value
27605 &lt;br&gt;&lt;br&gt;
27606 exp (z) = exp (creal (z)) * (cos (cimag (z)) + I * sin (cimag (z)))
27607
27608
27609 </synopsis>
27610 </function>
27611 </construct>
27612 <construct id="function-cexpf" type="function">
27613 <function returntype="complex float">
27614 <prototype>
27615 <parameter content="complex float z"/>
27616 </prototype>
27617 <headers>
27618 <header filename = "complex.h"/>
27619 </headers>
27620 <synopsis>
27621 These functions return &lt;CODE&gt;e&lt;/CODE&gt; (the base of natural
27622 logarithms) raised to the power of &lt;VAR&gt;z&lt;/VAR&gt;.
27623 Mathematically, this corresponds to the value
27624 &lt;br&gt;&lt;br&gt;
27625 exp (z) = exp (creal (z)) * (cos (cimag (z)) + I * sin (cimag (z)))
27626
27627
27628 </synopsis>
27629 </function>
27630 </construct>
27631 <construct id="function-cexpl" type="function">
27632 <function returntype="complex long double">
27633 <prototype>
27634 <parameter content="complex long double z"/>
27635 </prototype>
27636 <headers>
27637 <header filename = "complex.h"/>
27638 </headers>
27639 <synopsis>
27640 These functions return &lt;CODE&gt;e&lt;/CODE&gt; (the base of natural
27641 logarithms) raised to the power of &lt;VAR&gt;z&lt;/VAR&gt;.
27642 Mathematically, this corresponds to the value
27643 &lt;br&gt;&lt;br&gt;
27644 exp (z) = exp (creal (z)) * (cos (cimag (z)) + I * sin (cimag (z)))
27645
27646
27647 </synopsis>
27648 </function>
27649 </construct>
27650 <construct id="function-clog" type="function">
27651 <function returntype="complex double">
27652 <prototype>
27653 <parameter content="complex double z"/>
27654 </prototype>
27655 <headers>
27656 <header filename = "complex.h"/>
27657 </headers>
27658 <synopsis>
27659 These functions return the natural logarithm of &lt;VAR&gt;z&lt;/VAR&gt;.
27660 Mathematically, this corresponds to the value
27661 &lt;br&gt;&lt;br&gt;
27662 log (z) = log (cabs (z)) + I * carg (z)
27663
27664
27665 &lt;br&gt;&lt;br&gt;
27666 &lt;CODE&gt;clog&lt;/CODE&gt; has a pole at 0, and will signal overflow if &lt;VAR&gt;z&lt;/VAR&gt; equals
27667 or is very close to 0. It is well-defined for all other values of
27668 &lt;VAR&gt;z&lt;/VAR&gt;.
27669 </synopsis>
27670 </function>
27671 </construct>
27672 <construct id="function-clogf" type="function">
27673 <function returntype="complex float">
27674 <prototype>
27675 <parameter content="complex float z"/>
27676 </prototype>
27677 <headers>
27678 <header filename = "complex.h"/>
27679 </headers>
27680 <synopsis>
27681 These functions return the natural logarithm of &lt;VAR&gt;z&lt;/VAR&gt;.
27682 Mathematically, this corresponds to the value
27683 &lt;br&gt;&lt;br&gt;
27684 log (z) = log (cabs (z)) + I * carg (z)
27685
27686
27687 &lt;br&gt;&lt;br&gt;
27688 &lt;CODE&gt;clog&lt;/CODE&gt; has a pole at 0, and will signal overflow if &lt;VAR&gt;z&lt;/VAR&gt; equals
27689 or is very close to 0. It is well-defined for all other values of
27690 &lt;VAR&gt;z&lt;/VAR&gt;.
27691 </synopsis>
27692 </function>
27693 </construct>
27694 <construct id="function-clogl" type="function">
27695 <function returntype="complex long double">
27696 <prototype>
27697 <parameter content="complex long double z"/>
27698 </prototype>
27699 <headers>
27700 <header filename = "complex.h"/>
27701 </headers>
27702 <synopsis>
27703 These functions return the natural logarithm of &lt;VAR&gt;z&lt;/VAR&gt;.
27704 Mathematically, this corresponds to the value
27705 &lt;br&gt;&lt;br&gt;
27706 log (z) = log (cabs (z)) + I * carg (z)
27707
27708
27709 &lt;br&gt;&lt;br&gt;
27710 &lt;CODE&gt;clog&lt;/CODE&gt; has a pole at 0, and will signal overflow if &lt;VAR&gt;z&lt;/VAR&gt; equals
27711 or is very close to 0. It is well-defined for all other values of
27712 &lt;VAR&gt;z&lt;/VAR&gt;.
27713 </synopsis>
27714 </function>
27715 </construct>
27716 <construct id="function-clog10" type="function">
27717 <function returntype="complex double">
27718 <prototype>
27719 <parameter content="complex double z"/>
27720 </prototype>
27721 <headers>
27722 <header filename = "complex.h"/>
27723 </headers>
27724 <synopsis>
27725 These functions return the base 10 logarithm of the complex value
27726 &lt;VAR&gt;z&lt;/VAR&gt;. Mathematically, this corresponds to the value
27727 &lt;br&gt;&lt;br&gt;
27728 log (z) = log10 (cabs (z)) + I * carg (z)
27729
27730
27731 &lt;br&gt;&lt;br&gt; These functions are GNU extensions.
27732 </synopsis>
27733 </function>
27734 </construct>
27735 <construct id="function-clog10f" type="function">
27736 <function returntype="complex float">
27737 <prototype>
27738 <parameter content="complex float z"/>
27739 </prototype>
27740 <headers>
27741 <header filename = "complex.h"/>
27742 </headers>
27743 <synopsis>
27744 These functions return the base 10 logarithm of the complex value
27745 &lt;VAR&gt;z&lt;/VAR&gt;. Mathematically, this corresponds to the value
27746 &lt;br&gt;&lt;br&gt;
27747 log (z) = log10 (cabs (z)) + I * carg (z)
27748
27749
27750 &lt;br&gt;&lt;br&gt; These functions are GNU extensions.
27751 </synopsis>
27752 </function>
27753 </construct>
27754 <construct id="function-clog10l" type="function">
27755 <function returntype="complex long double">
27756 <prototype>
27757 <parameter content="complex long double z"/>
27758 </prototype>
27759 <headers>
27760 <header filename = "complex.h"/>
27761 </headers>
27762 <synopsis>
27763 These functions return the base 10 logarithm of the complex value
27764 &lt;VAR&gt;z&lt;/VAR&gt;. Mathematically, this corresponds to the value
27765 &lt;br&gt;&lt;br&gt;
27766 log (z) = log10 (cabs (z)) + I * carg (z)
27767
27768
27769 &lt;br&gt;&lt;br&gt; These functions are GNU extensions.
27770 </synopsis>
27771 </function>
27772 </construct>
27773 <construct id="function-csqrt" type="function">
27774 <function returntype="complex double">
27775 <prototype>
27776 <parameter content="complex double z"/>
27777 </prototype>
27778 <headers>
27779 <header filename = "complex.h"/>
27780 </headers>
27781 <synopsis>
27782 These functions return the complex square root of the argument &lt;VAR&gt;z&lt;/VAR&gt;. Unlike
27783 the real-valued functions, they are defined for all values of &lt;VAR&gt;z&lt;/VAR&gt;.
27784 </synopsis>
27785 </function>
27786 </construct>
27787 <construct id="function-csqrtf" type="function">
27788 <function returntype="complex float">
27789 <prototype>
27790 <parameter content="complex float z"/>
27791 </prototype>
27792 <headers>
27793 <header filename = "complex.h"/>
27794 </headers>
27795 <synopsis>
27796 These functions return the complex square root of the argument &lt;VAR&gt;z&lt;/VAR&gt;. Unlike
27797 the real-valued functions, they are defined for all values of &lt;VAR&gt;z&lt;/VAR&gt;.
27798 </synopsis>
27799 </function>
27800 </construct>
27801 <construct id="function-csqrtl" type="function">
27802 <function returntype="complex long double">
27803 <prototype>
27804 <parameter content="complex long double z"/>
27805 </prototype>
27806 <headers>
27807 <header filename = "complex.h"/>
27808 </headers>
27809 <synopsis>
27810 These functions return the complex square root of the argument &lt;VAR&gt;z&lt;/VAR&gt;. Unlike
27811 the real-valued functions, they are defined for all values of &lt;VAR&gt;z&lt;/VAR&gt;.
27812 </synopsis>
27813 </function>
27814 </construct>
27815 <construct id="function-cpow" type="function">
27816 <function returntype="complex double">
27817 <prototype>
27818 <parameter content="complex double base"/>
27819 <parameter content="complex double power"/>
27820 </prototype>
27821 <headers>
27822 <header filename = "complex.h"/>
27823 </headers>
27824 <synopsis>
27825 These functions return &lt;VAR&gt;base&lt;/VAR&gt; raised to the power of
27826 &lt;VAR&gt;power&lt;/VAR&gt;. This is equivalent to &lt;CODE&gt;cexp (y * clog (x))&lt;/CODE&gt;
27827 </synopsis>
27828 </function>
27829 </construct>
27830 <construct id="function-cpowf" type="function">
27831 <function returntype="complex float">
27832 <prototype>
27833 <parameter content="complex float base"/>
27834 <parameter content="complex float power"/>
27835 </prototype>
27836 <headers>
27837 <header filename = "complex.h"/>
27838 </headers>
27839 <synopsis>
27840 These functions return &lt;VAR&gt;base&lt;/VAR&gt; raised to the power of
27841 &lt;VAR&gt;power&lt;/VAR&gt;. This is equivalent to &lt;CODE&gt;cexp (y * clog (x))&lt;/CODE&gt;
27842 </synopsis>
27843 </function>
27844 </construct>
27845 <construct id="function-cpowl" type="function">
27846 <function returntype="complex long double">
27847 <prototype>
27848 <parameter content="complex long double base"/>
27849 <parameter content="complex long double power"/>
27850 </prototype>
27851 <headers>
27852 <header filename = "complex.h"/>
27853 </headers>
27854 <synopsis>
27855 These functions return &lt;VAR&gt;base&lt;/VAR&gt; raised to the power of
27856 &lt;VAR&gt;power&lt;/VAR&gt;. This is equivalent to &lt;CODE&gt;cexp (y * clog (x))&lt;/CODE&gt;
27857 </synopsis>
27858 </function>
27859 </construct>
27860 <construct id="function-sinh" type="function">
27861 <function returntype="double">
27862 <prototype>
27863 <parameter content="double x"/>
27864 </prototype>
27865 <headers>
27866 <header filename = "math.h"/>
27867 </headers>
27868 <synopsis>
27869 These functions return the hyperbolic sine of &lt;VAR&gt;x&lt;/VAR&gt;, defined
27870 mathematically as &lt;CODE&gt;(exp (&lt;VAR&gt;x&lt;/VAR&gt;) - exp (-&lt;VAR&gt;x&lt;/VAR&gt;)) / 2&lt;/CODE&gt;. They
27871 may signal overflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large.
27872 </synopsis>
27873 </function>
27874 </construct>
27875 <construct id="function-sinhf" type="function">
27876 <function returntype="float">
27877 <prototype>
27878 <parameter content="float x"/>
27879 </prototype>
27880 <headers>
27881 <header filename = "math.h"/>
27882 </headers>
27883 <synopsis>
27884 These functions return the hyperbolic sine of &lt;VAR&gt;x&lt;/VAR&gt;, defined
27885 mathematically as &lt;CODE&gt;(exp (&lt;VAR&gt;x&lt;/VAR&gt;) - exp (-&lt;VAR&gt;x&lt;/VAR&gt;)) / 2&lt;/CODE&gt;. They
27886 may signal overflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large.
27887 </synopsis>
27888 </function>
27889 </construct>
27890 <construct id="function-sinhl" type="function">
27891 <function returntype="long double">
27892 <prototype>
27893 <parameter content="long double x"/>
27894 </prototype>
27895 <headers>
27896 <header filename = "math.h"/>
27897 </headers>
27898 <synopsis>
27899 These functions return the hyperbolic sine of &lt;VAR&gt;x&lt;/VAR&gt;, defined
27900 mathematically as &lt;CODE&gt;(exp (&lt;VAR&gt;x&lt;/VAR&gt;) - exp (-&lt;VAR&gt;x&lt;/VAR&gt;)) / 2&lt;/CODE&gt;. They
27901 may signal overflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large.
27902 </synopsis>
27903 </function>
27904 </construct>
27905 <construct id="function-cosh" type="function">
27906 <function returntype="double">
27907 <prototype>
27908 <parameter content="double x"/>
27909 </prototype>
27910 <headers>
27911 <header filename = "math.h"/>
27912 </headers>
27913 <synopsis>
27914 These function return the hyperbolic cosine of &lt;VAR&gt;x&lt;/VAR&gt;,
27915 defined mathematically as &lt;CODE&gt;(exp (&lt;VAR&gt;x&lt;/VAR&gt;) + exp (-&lt;VAR&gt;x&lt;/VAR&gt;)) / 2&lt;/CODE&gt;.
27916 They may signal overflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large.
27917 </synopsis>
27918 </function>
27919 </construct>
27920 <construct id="function-coshf" type="function">
27921 <function returntype="float">
27922 <prototype>
27923 <parameter content="float x"/>
27924 </prototype>
27925 <headers>
27926 <header filename = "math.h"/>
27927 </headers>
27928 <synopsis>
27929 These function return the hyperbolic cosine of &lt;VAR&gt;x&lt;/VAR&gt;,
27930 defined mathematically as &lt;CODE&gt;(exp (&lt;VAR&gt;x&lt;/VAR&gt;) + exp (-&lt;VAR&gt;x&lt;/VAR&gt;)) / 2&lt;/CODE&gt;.
27931 They may signal overflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large.
27932 </synopsis>
27933 </function>
27934 </construct>
27935 <construct id="function-coshl" type="function">
27936 <function returntype="long double">
27937 <prototype>
27938 <parameter content="long double x"/>
27939 </prototype>
27940 <headers>
27941 <header filename = "math.h"/>
27942 </headers>
27943 <synopsis>
27944 These function return the hyperbolic cosine of &lt;VAR&gt;x&lt;/VAR&gt;,
27945 defined mathematically as &lt;CODE&gt;(exp (&lt;VAR&gt;x&lt;/VAR&gt;) + exp (-&lt;VAR&gt;x&lt;/VAR&gt;)) / 2&lt;/CODE&gt;.
27946 They may signal overflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large.
27947 </synopsis>
27948 </function>
27949 </construct>
27950 <construct id="function-tanh" type="function">
27951 <function returntype="double">
27952 <prototype>
27953 <parameter content="double x"/>
27954 </prototype>
27955 <headers>
27956 <header filename = "math.h"/>
27957 </headers>
27958 <synopsis>
27959 These functions return the hyperbolic tangent of &lt;VAR&gt;x&lt;/VAR&gt;,
27960 defined mathematically as &lt;CODE&gt;sinh (&lt;VAR&gt;x&lt;/VAR&gt;) / cosh (&lt;VAR&gt;x&lt;/VAR&gt;)&lt;/CODE&gt;.
27961 They may signal overflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large.
27962 </synopsis>
27963 </function>
27964 </construct>
27965 <construct id="function-tanhf" type="function">
27966 <function returntype="float">
27967 <prototype>
27968 <parameter content="float x"/>
27969 </prototype>
27970 <headers>
27971 <header filename = "math.h"/>
27972 </headers>
27973 <synopsis>
27974 These functions return the hyperbolic tangent of &lt;VAR&gt;x&lt;/VAR&gt;,
27975 defined mathematically as &lt;CODE&gt;sinh (&lt;VAR&gt;x&lt;/VAR&gt;) / cosh (&lt;VAR&gt;x&lt;/VAR&gt;)&lt;/CODE&gt;.
27976 They may signal overflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large.
27977 </synopsis>
27978 </function>
27979 </construct>
27980 <construct id="function-tanhl" type="function">
27981 <function returntype="long double">
27982 <prototype>
27983 <parameter content="long double x"/>
27984 </prototype>
27985 <headers>
27986 <header filename = "math.h"/>
27987 </headers>
27988 <synopsis>
27989 These functions return the hyperbolic tangent of &lt;VAR&gt;x&lt;/VAR&gt;,
27990 defined mathematically as &lt;CODE&gt;sinh (&lt;VAR&gt;x&lt;/VAR&gt;) / cosh (&lt;VAR&gt;x&lt;/VAR&gt;)&lt;/CODE&gt;.
27991 They may signal overflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large.
27992 </synopsis>
27993 </function>
27994 </construct>
27995 <construct id="function-csinh" type="function">
27996 <function returntype="complex double">
27997 <prototype>
27998 <parameter content="complex double z"/>
27999 </prototype>
28000 <headers>
28001 <header filename = "complex.h"/>
28002 </headers>
28003 <synopsis>
28004 These functions return the complex hyperbolic sine of &lt;VAR&gt;z&lt;/VAR&gt;, defined
28005 mathematically as &lt;CODE&gt;(exp (&lt;VAR&gt;z&lt;/VAR&gt;) - exp (-&lt;VAR&gt;z&lt;/VAR&gt;)) / 2&lt;/CODE&gt;.
28006 </synopsis>
28007 </function>
28008 </construct>
28009 <construct id="function-csinhf" type="function">
28010 <function returntype="complex float">
28011 <prototype>
28012 <parameter content="complex float z"/>
28013 </prototype>
28014 <headers>
28015 <header filename = "complex.h"/>
28016 </headers>
28017 <synopsis>
28018 These functions return the complex hyperbolic sine of &lt;VAR&gt;z&lt;/VAR&gt;, defined
28019 mathematically as &lt;CODE&gt;(exp (&lt;VAR&gt;z&lt;/VAR&gt;) - exp (-&lt;VAR&gt;z&lt;/VAR&gt;)) / 2&lt;/CODE&gt;.
28020 </synopsis>
28021 </function>
28022 </construct>
28023 <construct id="function-csinhl" type="function">
28024 <function returntype="complex long double">
28025 <prototype>
28026 <parameter content="complex long double z"/>
28027 </prototype>
28028 <headers>
28029 <header filename = "complex.h"/>
28030 </headers>
28031 <synopsis>
28032 These functions return the complex hyperbolic sine of &lt;VAR&gt;z&lt;/VAR&gt;, defined
28033 mathematically as &lt;CODE&gt;(exp (&lt;VAR&gt;z&lt;/VAR&gt;) - exp (-&lt;VAR&gt;z&lt;/VAR&gt;)) / 2&lt;/CODE&gt;.
28034 </synopsis>
28035 </function>
28036 </construct>
28037 <construct id="function-ccosh" type="function">
28038 <function returntype="complex double">
28039 <prototype>
28040 <parameter content="complex double z"/>
28041 </prototype>
28042 <headers>
28043 <header filename = "complex.h"/>
28044 </headers>
28045 <synopsis>
28046 These functions return the complex hyperbolic cosine of &lt;VAR&gt;z&lt;/VAR&gt;, defined
28047 mathematically as &lt;CODE&gt;(exp (&lt;VAR&gt;z&lt;/VAR&gt;) + exp (-&lt;VAR&gt;z&lt;/VAR&gt;)) / 2&lt;/CODE&gt;.
28048 </synopsis>
28049 </function>
28050 </construct>
28051 <construct id="function-ccoshf" type="function">
28052 <function returntype="complex float">
28053 <prototype>
28054 <parameter content="complex float z"/>
28055 </prototype>
28056 <headers>
28057 <header filename = "complex.h"/>
28058 </headers>
28059 <synopsis>
28060 These functions return the complex hyperbolic cosine of &lt;VAR&gt;z&lt;/VAR&gt;, defined
28061 mathematically as &lt;CODE&gt;(exp (&lt;VAR&gt;z&lt;/VAR&gt;) + exp (-&lt;VAR&gt;z&lt;/VAR&gt;)) / 2&lt;/CODE&gt;.
28062 </synopsis>
28063 </function>
28064 </construct>
28065 <construct id="function-ccoshl" type="function">
28066 <function returntype="complex long double">
28067 <prototype>
28068 <parameter content="complex long double z"/>
28069 </prototype>
28070 <headers>
28071 <header filename = "complex.h"/>
28072 </headers>
28073 <synopsis>
28074 These functions return the complex hyperbolic cosine of &lt;VAR&gt;z&lt;/VAR&gt;, defined
28075 mathematically as &lt;CODE&gt;(exp (&lt;VAR&gt;z&lt;/VAR&gt;) + exp (-&lt;VAR&gt;z&lt;/VAR&gt;)) / 2&lt;/CODE&gt;.
28076 </synopsis>
28077 </function>
28078 </construct>
28079 <construct id="function-ctanh" type="function">
28080 <function returntype="complex double">
28081 <prototype>
28082 <parameter content="complex double z"/>
28083 </prototype>
28084 <headers>
28085 <header filename = "complex.h"/>
28086 </headers>
28087 <synopsis>
28088 These functions return the complex hyperbolic tangent of &lt;VAR&gt;z&lt;/VAR&gt;,
28089 defined mathematically as &lt;CODE&gt;csinh (&lt;VAR&gt;z&lt;/VAR&gt;) / ccosh (&lt;VAR&gt;z&lt;/VAR&gt;)&lt;/CODE&gt;.
28090 </synopsis>
28091 </function>
28092 </construct>
28093 <construct id="function-ctanhf" type="function">
28094 <function returntype="complex float">
28095 <prototype>
28096 <parameter content="complex float z"/>
28097 </prototype>
28098 <headers>
28099 <header filename = "complex.h"/>
28100 </headers>
28101 <synopsis>
28102 These functions return the complex hyperbolic tangent of &lt;VAR&gt;z&lt;/VAR&gt;,
28103 defined mathematically as &lt;CODE&gt;csinh (&lt;VAR&gt;z&lt;/VAR&gt;) / ccosh (&lt;VAR&gt;z&lt;/VAR&gt;)&lt;/CODE&gt;.
28104 </synopsis>
28105 </function>
28106 </construct>
28107 <construct id="function-ctanhl" type="function">
28108 <function returntype="complex long double">
28109 <prototype>
28110 <parameter content="complex long double z"/>
28111 </prototype>
28112 <headers>
28113 <header filename = "complex.h"/>
28114 </headers>
28115 <synopsis>
28116 These functions return the complex hyperbolic tangent of &lt;VAR&gt;z&lt;/VAR&gt;,
28117 defined mathematically as &lt;CODE&gt;csinh (&lt;VAR&gt;z&lt;/VAR&gt;) / ccosh (&lt;VAR&gt;z&lt;/VAR&gt;)&lt;/CODE&gt;.
28118 </synopsis>
28119 </function>
28120 </construct>
28121 <construct id="function-asinh" type="function">
28122 <function returntype="double">
28123 <prototype>
28124 <parameter content="double x"/>
28125 </prototype>
28126 <headers>
28127 <header filename = "math.h"/>
28128 </headers>
28129 <synopsis>
28130 These functions return the inverse hyperbolic sine of &lt;VAR&gt;x&lt;/VAR&gt;---the
28131 value whose hyperbolic sine is &lt;VAR&gt;x&lt;/VAR&gt;.
28132 </synopsis>
28133 </function>
28134 </construct>
28135 <construct id="function-asinhf" type="function">
28136 <function returntype="float">
28137 <prototype>
28138 <parameter content="float x"/>
28139 </prototype>
28140 <headers>
28141 <header filename = "math.h"/>
28142 </headers>
28143 <synopsis>
28144 These functions return the inverse hyperbolic sine of &lt;VAR&gt;x&lt;/VAR&gt;---the
28145 value whose hyperbolic sine is &lt;VAR&gt;x&lt;/VAR&gt;.
28146 </synopsis>
28147 </function>
28148 </construct>
28149 <construct id="function-asinhl" type="function">
28150 <function returntype="long double">
28151 <prototype>
28152 <parameter content="long double x"/>
28153 </prototype>
28154 <headers>
28155 <header filename = "math.h"/>
28156 </headers>
28157 <synopsis>
28158 These functions return the inverse hyperbolic sine of &lt;VAR&gt;x&lt;/VAR&gt;---the
28159 value whose hyperbolic sine is &lt;VAR&gt;x&lt;/VAR&gt;.
28160 </synopsis>
28161 </function>
28162 </construct>
28163 <construct id="function-acosh" type="function">
28164 <function returntype="double">
28165 <prototype>
28166 <parameter content="double x"/>
28167 </prototype>
28168 <headers>
28169 <header filename = "math.h"/>
28170 </headers>
28171 <synopsis>
28172 These functions return the inverse hyperbolic cosine of &lt;VAR&gt;x&lt;/VAR&gt;---the
28173 value whose hyperbolic cosine is &lt;VAR&gt;x&lt;/VAR&gt;. If &lt;VAR&gt;x&lt;/VAR&gt; is less than
28174 &lt;CODE&gt;1&lt;/CODE&gt;, &lt;CODE&gt;acosh&lt;/CODE&gt; signals a domain error.
28175 </synopsis>
28176 </function>
28177 </construct>
28178 <construct id="function-acoshf" type="function">
28179 <function returntype="float">
28180 <prototype>
28181 <parameter content="float x"/>
28182 </prototype>
28183 <headers>
28184 <header filename = "math.h"/>
28185 </headers>
28186 <synopsis>
28187 These functions return the inverse hyperbolic cosine of &lt;VAR&gt;x&lt;/VAR&gt;---the
28188 value whose hyperbolic cosine is &lt;VAR&gt;x&lt;/VAR&gt;. If &lt;VAR&gt;x&lt;/VAR&gt; is less than
28189 &lt;CODE&gt;1&lt;/CODE&gt;, &lt;CODE&gt;acosh&lt;/CODE&gt; signals a domain error.
28190 </synopsis>
28191 </function>
28192 </construct>
28193 <construct id="function-acoshl" type="function">
28194 <function returntype="long double">
28195 <prototype>
28196 <parameter content="long double x"/>
28197 </prototype>
28198 <headers>
28199 <header filename = "math.h"/>
28200 </headers>
28201 <synopsis>
28202 These functions return the inverse hyperbolic cosine of &lt;VAR&gt;x&lt;/VAR&gt;---the
28203 value whose hyperbolic cosine is &lt;VAR&gt;x&lt;/VAR&gt;. If &lt;VAR&gt;x&lt;/VAR&gt; is less than
28204 &lt;CODE&gt;1&lt;/CODE&gt;, &lt;CODE&gt;acosh&lt;/CODE&gt; signals a domain error.
28205 </synopsis>
28206 </function>
28207 </construct>
28208 <construct id="function-atanh" type="function">
28209 <function returntype="double">
28210 <prototype>
28211 <parameter content="double x"/>
28212 </prototype>
28213 <headers>
28214 <header filename = "math.h"/>
28215 </headers>
28216 <synopsis>
28217 These functions return the inverse hyperbolic tangent of &lt;VAR&gt;x&lt;/VAR&gt;---the
28218 value whose hyperbolic tangent is &lt;VAR&gt;x&lt;/VAR&gt;. If the absolute value of
28219 &lt;VAR&gt;x&lt;/VAR&gt; is greater than &lt;CODE&gt;1&lt;/CODE&gt;, &lt;CODE&gt;atanh&lt;/CODE&gt; signals a domain error;
28220 if it is equal to 1, &lt;CODE&gt;atanh&lt;/CODE&gt; returns infinity.
28221 </synopsis>
28222 </function>
28223 </construct>
28224 <construct id="function-atanhf" type="function">
28225 <function returntype="float">
28226 <prototype>
28227 <parameter content="float x"/>
28228 </prototype>
28229 <headers>
28230 <header filename = "math.h"/>
28231 </headers>
28232 <synopsis>
28233 These functions return the inverse hyperbolic tangent of &lt;VAR&gt;x&lt;/VAR&gt;---the
28234 value whose hyperbolic tangent is &lt;VAR&gt;x&lt;/VAR&gt;. If the absolute value of
28235 &lt;VAR&gt;x&lt;/VAR&gt; is greater than &lt;CODE&gt;1&lt;/CODE&gt;, &lt;CODE&gt;atanh&lt;/CODE&gt; signals a domain error;
28236 if it is equal to 1, &lt;CODE&gt;atanh&lt;/CODE&gt; returns infinity.
28237 </synopsis>
28238 </function>
28239 </construct>
28240 <construct id="function-atanhl" type="function">
28241 <function returntype="long double">
28242 <prototype>
28243 <parameter content="long double x"/>
28244 </prototype>
28245 <headers>
28246 <header filename = "math.h"/>
28247 </headers>
28248 <synopsis>
28249 These functions return the inverse hyperbolic tangent of &lt;VAR&gt;x&lt;/VAR&gt;---the
28250 value whose hyperbolic tangent is &lt;VAR&gt;x&lt;/VAR&gt;. If the absolute value of
28251 &lt;VAR&gt;x&lt;/VAR&gt; is greater than &lt;CODE&gt;1&lt;/CODE&gt;, &lt;CODE&gt;atanh&lt;/CODE&gt; signals a domain error;
28252 if it is equal to 1, &lt;CODE&gt;atanh&lt;/CODE&gt; returns infinity.
28253 </synopsis>
28254 </function>
28255 </construct>
28256 <construct id="function-casinh" type="function">
28257 <function returntype="complex double">
28258 <prototype>
28259 <parameter content="complex double z"/>
28260 </prototype>
28261 <headers>
28262 <header filename = "complex.h"/>
28263 </headers>
28264 <synopsis>
28265 These functions return the inverse complex hyperbolic sine of
28266 &lt;VAR&gt;z&lt;/VAR&gt;---the value whose complex hyperbolic sine is &lt;VAR&gt;z&lt;/VAR&gt;.
28267 </synopsis>
28268 </function>
28269 </construct>
28270 <construct id="function-casinhf" type="function">
28271 <function returntype="complex float">
28272 <prototype>
28273 <parameter content="complex float z"/>
28274 </prototype>
28275 <headers>
28276 <header filename = "complex.h"/>
28277 </headers>
28278 <synopsis>
28279 These functions return the inverse complex hyperbolic sine of
28280 &lt;VAR&gt;z&lt;/VAR&gt;---the value whose complex hyperbolic sine is &lt;VAR&gt;z&lt;/VAR&gt;.
28281 </synopsis>
28282 </function>
28283 </construct>
28284 <construct id="function-casinhl" type="function">
28285 <function returntype="complex long double">
28286 <prototype>
28287 <parameter content="complex long double z"/>
28288 </prototype>
28289 <headers>
28290 <header filename = "complex.h"/>
28291 </headers>
28292 <synopsis>
28293 These functions return the inverse complex hyperbolic sine of
28294 &lt;VAR&gt;z&lt;/VAR&gt;---the value whose complex hyperbolic sine is &lt;VAR&gt;z&lt;/VAR&gt;.
28295 </synopsis>
28296 </function>
28297 </construct>
28298 <construct id="function-cacosh" type="function">
28299 <function returntype="complex double">
28300 <prototype>
28301 <parameter content="complex double z"/>
28302 </prototype>
28303 <headers>
28304 <header filename = "complex.h"/>
28305 </headers>
28306 <synopsis>
28307 These functions return the inverse complex hyperbolic cosine of
28308 &lt;VAR&gt;z&lt;/VAR&gt;---the value whose complex hyperbolic cosine is &lt;VAR&gt;z&lt;/VAR&gt;. Unlike
28309 the real-valued functions, there are no restrictions on the value of &lt;VAR&gt;z&lt;/VAR&gt;.
28310 </synopsis>
28311 </function>
28312 </construct>
28313 <construct id="function-cacoshf" type="function">
28314 <function returntype="complex float">
28315 <prototype>
28316 <parameter content="complex float z"/>
28317 </prototype>
28318 <headers>
28319 <header filename = "complex.h"/>
28320 </headers>
28321 <synopsis>
28322 These functions return the inverse complex hyperbolic cosine of
28323 &lt;VAR&gt;z&lt;/VAR&gt;---the value whose complex hyperbolic cosine is &lt;VAR&gt;z&lt;/VAR&gt;. Unlike
28324 the real-valued functions, there are no restrictions on the value of &lt;VAR&gt;z&lt;/VAR&gt;.
28325 </synopsis>
28326 </function>
28327 </construct>
28328 <construct id="function-cacoshl" type="function">
28329 <function returntype="complex long double">
28330 <prototype>
28331 <parameter content="complex long double z"/>
28332 </prototype>
28333 <headers>
28334 <header filename = "complex.h"/>
28335 </headers>
28336 <synopsis>
28337 These functions return the inverse complex hyperbolic cosine of
28338 &lt;VAR&gt;z&lt;/VAR&gt;---the value whose complex hyperbolic cosine is &lt;VAR&gt;z&lt;/VAR&gt;. Unlike
28339 the real-valued functions, there are no restrictions on the value of &lt;VAR&gt;z&lt;/VAR&gt;.
28340 </synopsis>
28341 </function>
28342 </construct>
28343 <construct id="function-catanh" type="function">
28344 <function returntype="complex double">
28345 <prototype>
28346 <parameter content="complex double z"/>
28347 </prototype>
28348 <headers>
28349 <header filename = "complex.h"/>
28350 </headers>
28351 <synopsis>
28352 These functions return the inverse complex hyperbolic tangent of
28353 &lt;VAR&gt;z&lt;/VAR&gt;---the value whose complex hyperbolic tangent is &lt;VAR&gt;z&lt;/VAR&gt;. Unlike
28354 the real-valued functions, there are no restrictions on the value of
28355 &lt;VAR&gt;z&lt;/VAR&gt;.
28356 </synopsis>
28357 </function>
28358 </construct>
28359 <construct id="function-catanhf" type="function">
28360 <function returntype="complex float">
28361 <prototype>
28362 <parameter content="complex float z"/>
28363 </prototype>
28364 <headers>
28365 <header filename = "complex.h"/>
28366 </headers>
28367 <synopsis>
28368 These functions return the inverse complex hyperbolic tangent of
28369 &lt;VAR&gt;z&lt;/VAR&gt;---the value whose complex hyperbolic tangent is &lt;VAR&gt;z&lt;/VAR&gt;. Unlike
28370 the real-valued functions, there are no restrictions on the value of
28371 &lt;VAR&gt;z&lt;/VAR&gt;.
28372 </synopsis>
28373 </function>
28374 </construct>
28375 <construct id="function-catanhl" type="function">
28376 <function returntype="complex long double">
28377 <prototype>
28378 <parameter content="complex long double z"/>
28379 </prototype>
28380 <headers>
28381 <header filename = "complex.h"/>
28382 </headers>
28383 <synopsis>
28384 These functions return the inverse complex hyperbolic tangent of
28385 &lt;VAR&gt;z&lt;/VAR&gt;---the value whose complex hyperbolic tangent is &lt;VAR&gt;z&lt;/VAR&gt;. Unlike
28386 the real-valued functions, there are no restrictions on the value of
28387 &lt;VAR&gt;z&lt;/VAR&gt;.
28388 </synopsis>
28389 </function>
28390 </construct>
28391 <construct id="function-erf" type="function">
28392 <function returntype="double">
28393 <prototype>
28394 <parameter content="double x"/>
28395 </prototype>
28396 <headers>
28397 <header filename = "math.h"/>
28398 </headers>
28399 <synopsis>
28400 &lt;CODE&gt;erf&lt;/CODE&gt; returns the error function of &lt;VAR&gt;x&lt;/VAR&gt;. The error
28401 function is defined as
28402
28403
28404 &lt;pre&gt;&lt;br&gt;
28405 erf (x) = 2/sqrt(pi) * integral from 0 to x of exp(-t^2) dt&lt;br&gt;
28406 &lt;/pre&gt;
28407
28408 </synopsis>
28409 </function>
28410 </construct>
28411 <construct id="function-erff" type="function">
28412 <function returntype="float">
28413 <prototype>
28414 <parameter content="float x"/>
28415 </prototype>
28416 <headers>
28417 <header filename = "math.h"/>
28418 </headers>
28419 <synopsis>
28420 &lt;CODE&gt;erf&lt;/CODE&gt; returns the error function of &lt;VAR&gt;x&lt;/VAR&gt;. The error
28421 function is defined as
28422
28423
28424 &lt;pre&gt;&lt;br&gt;
28425 erf (x) = 2/sqrt(pi) * integral from 0 to x of exp(-t^2) dt&lt;br&gt;
28426 &lt;/pre&gt;
28427
28428 </synopsis>
28429 </function>
28430 </construct>
28431 <construct id="function-erfl" type="function">
28432 <function returntype="long double">
28433 <prototype>
28434 <parameter content="long double x"/>
28435 </prototype>
28436 <headers>
28437 <header filename = "math.h"/>
28438 </headers>
28439 <synopsis>
28440 &lt;CODE&gt;erf&lt;/CODE&gt; returns the error function of &lt;VAR&gt;x&lt;/VAR&gt;. The error
28441 function is defined as
28442
28443
28444 &lt;pre&gt;&lt;br&gt;
28445 erf (x) = 2/sqrt(pi) * integral from 0 to x of exp(-t^2) dt&lt;br&gt;
28446 &lt;/pre&gt;
28447
28448 </synopsis>
28449 </function>
28450 </construct>
28451 <construct id="function-erfc" type="function">
28452 <function returntype="double">
28453 <prototype>
28454 <parameter content="double x"/>
28455 </prototype>
28456 <headers>
28457 <header filename = "math.h"/>
28458 </headers>
28459 <synopsis>
28460 &lt;CODE&gt;erfc&lt;/CODE&gt; returns &lt;CODE&gt;1.0 - erf(&lt;VAR&gt;x&lt;/VAR&gt;)&lt;/CODE&gt;, but computed in a
28461 fashion that avoids round-off error when &lt;VAR&gt;x&lt;/VAR&gt; is large.
28462 </synopsis>
28463 </function>
28464 </construct>
28465 <construct id="function-erfcf" type="function">
28466 <function returntype="float">
28467 <prototype>
28468 <parameter content="float x"/>
28469 </prototype>
28470 <headers>
28471 <header filename = "math.h"/>
28472 </headers>
28473 <synopsis>
28474 &lt;CODE&gt;erfc&lt;/CODE&gt; returns &lt;CODE&gt;1.0 - erf(&lt;VAR&gt;x&lt;/VAR&gt;)&lt;/CODE&gt;, but computed in a
28475 fashion that avoids round-off error when &lt;VAR&gt;x&lt;/VAR&gt; is large.
28476 </synopsis>
28477 </function>
28478 </construct>
28479 <construct id="function-erfcl" type="function">
28480 <function returntype="long double">
28481 <prototype>
28482 <parameter content="long double x"/>
28483 </prototype>
28484 <headers>
28485 <header filename = "math.h"/>
28486 </headers>
28487 <synopsis>
28488 &lt;CODE&gt;erfc&lt;/CODE&gt; returns &lt;CODE&gt;1.0 - erf(&lt;VAR&gt;x&lt;/VAR&gt;)&lt;/CODE&gt;, but computed in a
28489 fashion that avoids round-off error when &lt;VAR&gt;x&lt;/VAR&gt; is large.
28490 </synopsis>
28491 </function>
28492 </construct>
28493 <construct id="function-lgamma" type="function">
28494 <function returntype="double">
28495 <prototype>
28496 <parameter content="double x"/>
28497 </prototype>
28498 <headers>
28499 <header filename = "math.h"/>
28500 </headers>
28501 <synopsis>
28502 &lt;CODE&gt;lgamma&lt;/CODE&gt; returns the natural logarithm of the absolute value of
28503 the gamma function of &lt;VAR&gt;x&lt;/VAR&gt;. The gamma function is defined as
28504
28505
28506 &lt;pre&gt;&lt;br&gt;
28507 gamma (x) = integral from 0 to infinity{} of t^(x-1) e^-t dt&lt;br&gt;
28508 &lt;/pre&gt;&lt;br&gt;
28509 &lt;br&gt;
28510 &lt;br&gt;&lt;br&gt; &lt;br&gt;
28511 The sign of the gamma function is stored in the global variable&lt;br&gt;
28512 &lt;VAR&gt;signgam&lt;/VAR&gt;, which is declared in &lt;TT&gt;math.h&lt;/TT&gt;. It is &lt;CODE&gt;1&lt;/CODE&gt; if&lt;br&gt;
28513 the intermediate result was positive or zero, or &lt;CODE&gt;-1&lt;/CODE&gt; if it was&lt;br&gt;
28514 negative.&lt;br&gt;
28515 &lt;br&gt;&lt;br&gt; To compute the real gamma function you can use the &lt;CODE&gt;tgamma&lt;/CODE&gt;&lt;br&gt;
28516 function or you can compute the values as follows:&lt;br&gt;
28517 &lt;pre&gt;&lt;br&gt;
28518 lgam = lgamma(x);&lt;br&gt;
28519 gam = signgam*exp(lgam);&lt;br&gt;
28520 &lt;/pre&gt;
28521 &lt;br&gt;&lt;br&gt; The gamma function has singularities at the non-positive integers.
28522 &lt;CODE&gt;lgamma&lt;/CODE&gt; will raise the zero divide exception if evaluated at a
28523 singularity.
28524 </synopsis>
28525 </function>
28526 </construct>
28527 <construct id="function-lgammaf" type="function">
28528 <function returntype="float">
28529 <prototype>
28530 <parameter content="float x"/>
28531 </prototype>
28532 <headers>
28533 <header filename = "math.h"/>
28534 </headers>
28535 <synopsis>
28536 &lt;CODE&gt;lgamma&lt;/CODE&gt; returns the natural logarithm of the absolute value of
28537 the gamma function of &lt;VAR&gt;x&lt;/VAR&gt;. The gamma function is defined as
28538
28539
28540 &lt;pre&gt;&lt;br&gt;
28541 gamma (x) = integral from 0 to infinity{} of t^(x-1) e^-t dt&lt;br&gt;
28542 &lt;/pre&gt;&lt;br&gt;
28543 &lt;br&gt;
28544 &lt;br&gt;&lt;br&gt; &lt;br&gt;
28545 The sign of the gamma function is stored in the global variable&lt;br&gt;
28546 &lt;VAR&gt;signgam&lt;/VAR&gt;, which is declared in &lt;TT&gt;math.h&lt;/TT&gt;. It is &lt;CODE&gt;1&lt;/CODE&gt; if&lt;br&gt;
28547 the intermediate result was positive or zero, or &lt;CODE&gt;-1&lt;/CODE&gt; if it was&lt;br&gt;
28548 negative.&lt;br&gt;
28549 &lt;br&gt;&lt;br&gt; To compute the real gamma function you can use the &lt;CODE&gt;tgamma&lt;/CODE&gt;&lt;br&gt;
28550 function or you can compute the values as follows:&lt;br&gt;
28551 &lt;pre&gt;&lt;br&gt;
28552 lgam = lgamma(x);&lt;br&gt;
28553 gam = signgam*exp(lgam);&lt;br&gt;
28554 &lt;/pre&gt;
28555 &lt;br&gt;&lt;br&gt; The gamma function has singularities at the non-positive integers.
28556 &lt;CODE&gt;lgamma&lt;/CODE&gt; will raise the zero divide exception if evaluated at a
28557 singularity.
28558 </synopsis>
28559 </function>
28560 </construct>
28561 <construct id="function-lgammal" type="function">
28562 <function returntype="long double">
28563 <prototype>
28564 <parameter content="long double x"/>
28565 </prototype>
28566 <headers>
28567 <header filename = "math.h"/>
28568 </headers>
28569 <synopsis>
28570 &lt;CODE&gt;lgamma&lt;/CODE&gt; returns the natural logarithm of the absolute value of
28571 the gamma function of &lt;VAR&gt;x&lt;/VAR&gt;. The gamma function is defined as
28572
28573
28574 &lt;pre&gt;&lt;br&gt;
28575 gamma (x) = integral from 0 to infinity{} of t^(x-1) e^-t dt&lt;br&gt;
28576 &lt;/pre&gt;&lt;br&gt;
28577 &lt;br&gt;
28578 &lt;br&gt;&lt;br&gt; &lt;br&gt;
28579 The sign of the gamma function is stored in the global variable&lt;br&gt;
28580 &lt;VAR&gt;signgam&lt;/VAR&gt;, which is declared in &lt;TT&gt;math.h&lt;/TT&gt;. It is &lt;CODE&gt;1&lt;/CODE&gt; if&lt;br&gt;
28581 the intermediate result was positive or zero, or &lt;CODE&gt;-1&lt;/CODE&gt; if it was&lt;br&gt;
28582 negative.&lt;br&gt;
28583 &lt;br&gt;&lt;br&gt; To compute the real gamma function you can use the &lt;CODE&gt;tgamma&lt;/CODE&gt;&lt;br&gt;
28584 function or you can compute the values as follows:&lt;br&gt;
28585 &lt;pre&gt;&lt;br&gt;
28586 lgam = lgamma(x);&lt;br&gt;
28587 gam = signgam*exp(lgam);&lt;br&gt;
28588 &lt;/pre&gt;
28589 &lt;br&gt;&lt;br&gt; The gamma function has singularities at the non-positive integers.
28590 &lt;CODE&gt;lgamma&lt;/CODE&gt; will raise the zero divide exception if evaluated at a
28591 singularity.
28592 </synopsis>
28593 </function>
28594 </construct>
28595 <construct id="function-lgamma_r" type="function">
28596 <function returntype="double">
28597 <prototype>
28598 <parameter content="double x"/>
28599 <parameter content="int *signp"/>
28600 </prototype>
28601 <headers>
28602 <header filename = "math.h"/>
28603 </headers>
28604 <synopsis>
28605 &lt;CODE&gt;lgamma_r&lt;/CODE&gt; is just like &lt;CODE&gt;lgamma&lt;/CODE&gt;, but it stores the sign of
28606 the intermediate result in the variable pointed to by &lt;VAR&gt;signp&lt;/VAR&gt;
28607 instead of in the &lt;VAR&gt;signgam&lt;/VAR&gt; global. This means it is reentrant.
28608 </synopsis>
28609 </function>
28610 </construct>
28611 <construct id="function-lgammaf_r" type="function">
28612 <function returntype="float">
28613 <prototype>
28614 <parameter content="float x"/>
28615 <parameter content="int *signp"/>
28616 </prototype>
28617 <headers>
28618 <header filename = "math.h"/>
28619 </headers>
28620 <synopsis>
28621 &lt;CODE&gt;lgamma_r&lt;/CODE&gt; is just like &lt;CODE&gt;lgamma&lt;/CODE&gt;, but it stores the sign of
28622 the intermediate result in the variable pointed to by &lt;VAR&gt;signp&lt;/VAR&gt;
28623 instead of in the &lt;VAR&gt;signgam&lt;/VAR&gt; global. This means it is reentrant.
28624 </synopsis>
28625 </function>
28626 </construct>
28627 <construct id="function-lgammal_r" type="function">
28628 <function returntype="long double">
28629 <prototype>
28630 <parameter content="long double x"/>
28631 <parameter content="int *signp"/>
28632 </prototype>
28633 <headers>
28634 <header filename = "math.h"/>
28635 </headers>
28636 <synopsis>
28637 &lt;CODE&gt;lgamma_r&lt;/CODE&gt; is just like &lt;CODE&gt;lgamma&lt;/CODE&gt;, but it stores the sign of
28638 the intermediate result in the variable pointed to by &lt;VAR&gt;signp&lt;/VAR&gt;
28639 instead of in the &lt;VAR&gt;signgam&lt;/VAR&gt; global. This means it is reentrant.
28640 </synopsis>
28641 </function>
28642 </construct>
28643 <construct id="function-gamma" type="function">
28644 <function returntype="double">
28645 <prototype>
28646 <parameter content="double x"/>
28647 </prototype>
28648 <headers>
28649 <header filename = "math.h"/>
28650 </headers>
28651 <synopsis>
28652 These functions exist for compatibility reasons. They are equivalent to
28653 &lt;CODE&gt;lgamma&lt;/CODE&gt; etc. It is better to use &lt;CODE&gt;lgamma&lt;/CODE&gt; since for one the
28654 name reflects better the actual computation, moreover &lt;CODE&gt;lgamma&lt;/CODE&gt; is
28655 standardized in ISO C99 while &lt;CODE&gt;gamma&lt;/CODE&gt; is not.
28656 </synopsis>
28657 </function>
28658 </construct>
28659 <construct id="function-gammaf" type="function">
28660 <function returntype="float">
28661 <prototype>
28662 <parameter content="float x"/>
28663 </prototype>
28664 <headers>
28665 <header filename = "math.h"/>
28666 </headers>
28667 <synopsis>
28668 These functions exist for compatibility reasons. They are equivalent to
28669 &lt;CODE&gt;lgamma&lt;/CODE&gt; etc. It is better to use &lt;CODE&gt;lgamma&lt;/CODE&gt; since for one the
28670 name reflects better the actual computation, moreover &lt;CODE&gt;lgamma&lt;/CODE&gt; is
28671 standardized in ISO C99 while &lt;CODE&gt;gamma&lt;/CODE&gt; is not.
28672 </synopsis>
28673 </function>
28674 </construct>
28675 <construct id="function-gammal" type="function">
28676 <function returntype="long double">
28677 <prototype>
28678 <parameter content="long double x"/>
28679 </prototype>
28680 <headers>
28681 <header filename = "math.h"/>
28682 </headers>
28683 <synopsis>
28684 These functions exist for compatibility reasons. They are equivalent to
28685 &lt;CODE&gt;lgamma&lt;/CODE&gt; etc. It is better to use &lt;CODE&gt;lgamma&lt;/CODE&gt; since for one the
28686 name reflects better the actual computation, moreover &lt;CODE&gt;lgamma&lt;/CODE&gt; is
28687 standardized in ISO C99 while &lt;CODE&gt;gamma&lt;/CODE&gt; is not.
28688 </synopsis>
28689 </function>
28690 </construct>
28691 <construct id="function-tgamma" type="function">
28692 <function returntype="double">
28693 <prototype>
28694 <parameter content="double x"/>
28695 </prototype>
28696 <headers>
28697 <header filename = "math.h"/>
28698 </headers>
28699 <synopsis>
28700 &lt;CODE&gt;tgamma&lt;/CODE&gt; applies the gamma function to &lt;VAR&gt;x&lt;/VAR&gt;. The gamma
28701 function is defined as
28702
28703
28704 &lt;pre&gt;&lt;br&gt;
28705 gamma (x) = integral from 0 to infinity{} of t^(x-1) e^-t dt&lt;br&gt;
28706 &lt;/pre&gt;
28707
28708 &lt;br&gt;&lt;br&gt; This function was introduced in ISO C99.
28709 </synopsis>
28710 </function>
28711 </construct>
28712 <construct id="function-tgammaf" type="function">
28713 <function returntype="float">
28714 <prototype>
28715 <parameter content="float x"/>
28716 </prototype>
28717 <headers>
28718 <header filename = "math.h"/>
28719 </headers>
28720 <synopsis>
28721 &lt;CODE&gt;tgamma&lt;/CODE&gt; applies the gamma function to &lt;VAR&gt;x&lt;/VAR&gt;. The gamma
28722 function is defined as
28723
28724
28725 &lt;pre&gt;&lt;br&gt;
28726 gamma (x) = integral from 0 to infinity{} of t^(x-1) e^-t dt&lt;br&gt;
28727 &lt;/pre&gt;
28728
28729 &lt;br&gt;&lt;br&gt; This function was introduced in ISO C99.
28730 </synopsis>
28731 </function>
28732 </construct>
28733 <construct id="function-tgammal" type="function">
28734 <function returntype="long double">
28735 <prototype>
28736 <parameter content="long double x"/>
28737 </prototype>
28738 <headers>
28739 <header filename = "math.h"/>
28740 </headers>
28741 <synopsis>
28742 &lt;CODE&gt;tgamma&lt;/CODE&gt; applies the gamma function to &lt;VAR&gt;x&lt;/VAR&gt;. The gamma
28743 function is defined as
28744
28745
28746 &lt;pre&gt;&lt;br&gt;
28747 gamma (x) = integral from 0 to infinity{} of t^(x-1) e^-t dt&lt;br&gt;
28748 &lt;/pre&gt;
28749
28750 &lt;br&gt;&lt;br&gt; This function was introduced in ISO C99.
28751 </synopsis>
28752 </function>
28753 </construct>
28754 <construct id="function-j0" type="function">
28755 <function returntype="double">
28756 <prototype>
28757 <parameter content="double x"/>
28758 </prototype>
28759 <headers>
28760 <header filename = "math.h"/>
28761 </headers>
28762 <synopsis>
28763 &lt;CODE&gt;j0&lt;/CODE&gt; returns the Bessel function of the first kind of order 0 of
28764 &lt;VAR&gt;x&lt;/VAR&gt;. It may signal underflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large.
28765 </synopsis>
28766 </function>
28767 </construct>
28768 <construct id="function-j0f" type="function">
28769 <function returntype="float">
28770 <prototype>
28771 <parameter content="float x"/>
28772 </prototype>
28773 <headers>
28774 <header filename = "math.h"/>
28775 </headers>
28776 <synopsis>
28777 &lt;CODE&gt;j0&lt;/CODE&gt; returns the Bessel function of the first kind of order 0 of
28778 &lt;VAR&gt;x&lt;/VAR&gt;. It may signal underflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large.
28779 </synopsis>
28780 </function>
28781 </construct>
28782 <construct id="function-j0l" type="function">
28783 <function returntype="long double">
28784 <prototype>
28785 <parameter content="long double x"/>
28786 </prototype>
28787 <headers>
28788 <header filename = "math.h"/>
28789 </headers>
28790 <synopsis>
28791 &lt;CODE&gt;j0&lt;/CODE&gt; returns the Bessel function of the first kind of order 0 of
28792 &lt;VAR&gt;x&lt;/VAR&gt;. It may signal underflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large.
28793 </synopsis>
28794 </function>
28795 </construct>
28796 <construct id="function-j1" type="function">
28797 <function returntype="double">
28798 <prototype>
28799 <parameter content="double x"/>
28800 </prototype>
28801 <headers>
28802 <header filename = "math.h"/>
28803 </headers>
28804 <synopsis>
28805 &lt;CODE&gt;j1&lt;/CODE&gt; returns the Bessel function of the first kind of order 1 of
28806 &lt;VAR&gt;x&lt;/VAR&gt;. It may signal underflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large.
28807 </synopsis>
28808 </function>
28809 </construct>
28810 <construct id="function-j1f" type="function">
28811 <function returntype="float">
28812 <prototype>
28813 <parameter content="float x"/>
28814 </prototype>
28815 <headers>
28816 <header filename = "math.h"/>
28817 </headers>
28818 <synopsis>
28819 &lt;CODE&gt;j1&lt;/CODE&gt; returns the Bessel function of the first kind of order 1 of
28820 &lt;VAR&gt;x&lt;/VAR&gt;. It may signal underflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large.
28821 </synopsis>
28822 </function>
28823 </construct>
28824 <construct id="function-j1l" type="function">
28825 <function returntype="long double">
28826 <prototype>
28827 <parameter content="long double x"/>
28828 </prototype>
28829 <headers>
28830 <header filename = "math.h"/>
28831 </headers>
28832 <synopsis>
28833 &lt;CODE&gt;j1&lt;/CODE&gt; returns the Bessel function of the first kind of order 1 of
28834 &lt;VAR&gt;x&lt;/VAR&gt;. It may signal underflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large.
28835 </synopsis>
28836 </function>
28837 </construct>
28838 <construct id="function-jn" type="function">
28839 <function returntype="double">
28840 <prototype>
28841 <parameter content="int n"/>
28842 <parameter content="double x"/>
28843 </prototype>
28844 <headers>
28845 <header filename = "math.h"/>
28846 </headers>
28847 <synopsis>
28848 &lt;CODE&gt;jn&lt;/CODE&gt; returns the Bessel function of the first kind of order
28849 &lt;VAR&gt;n&lt;/VAR&gt; of &lt;VAR&gt;x&lt;/VAR&gt;. It may signal underflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large.
28850 </synopsis>
28851 </function>
28852 </construct>
28853 <construct id="function-jnf" type="function">
28854 <function returntype="float">
28855 <prototype>
28856 <parameter content="int n"/>
28857 <parameter content="float x"/>
28858 </prototype>
28859 <headers>
28860 <header filename = "math.h"/>
28861 </headers>
28862 <synopsis>
28863 &lt;CODE&gt;jn&lt;/CODE&gt; returns the Bessel function of the first kind of order
28864 &lt;VAR&gt;n&lt;/VAR&gt; of &lt;VAR&gt;x&lt;/VAR&gt;. It may signal underflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large.
28865 </synopsis>
28866 </function>
28867 </construct>
28868 <construct id="function-jnl" type="function">
28869 <function returntype="long double">
28870 <prototype>
28871 <parameter content="int n"/>
28872 <parameter content="long double x"/>
28873 </prototype>
28874 <headers>
28875 <header filename = "math.h"/>
28876 </headers>
28877 <synopsis>
28878 &lt;CODE&gt;jn&lt;/CODE&gt; returns the Bessel function of the first kind of order
28879 &lt;VAR&gt;n&lt;/VAR&gt; of &lt;VAR&gt;x&lt;/VAR&gt;. It may signal underflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large.
28880 </synopsis>
28881 </function>
28882 </construct>
28883 <construct id="function-y0" type="function">
28884 <function returntype="double">
28885 <prototype>
28886 <parameter content="double x"/>
28887 </prototype>
28888 <headers>
28889 <header filename = "math.h"/>
28890 </headers>
28891 <synopsis>
28892 &lt;CODE&gt;y0&lt;/CODE&gt; returns the Bessel function of the second kind of order 0 of
28893 &lt;VAR&gt;x&lt;/VAR&gt;. It may signal underflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large. If &lt;VAR&gt;x&lt;/VAR&gt;
28894 is negative, &lt;CODE&gt;y0&lt;/CODE&gt; signals a domain error; if it is zero,
28895 &lt;CODE&gt;y0&lt;/CODE&gt; signals overflow and returns -infinity.
28896 </synopsis>
28897 </function>
28898 </construct>
28899 <construct id="function-y0f" type="function">
28900 <function returntype="float">
28901 <prototype>
28902 <parameter content="float x"/>
28903 </prototype>
28904 <headers>
28905 <header filename = "math.h"/>
28906 </headers>
28907 <synopsis>
28908 &lt;CODE&gt;y0&lt;/CODE&gt; returns the Bessel function of the second kind of order 0 of
28909 &lt;VAR&gt;x&lt;/VAR&gt;. It may signal underflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large. If &lt;VAR&gt;x&lt;/VAR&gt;
28910 is negative, &lt;CODE&gt;y0&lt;/CODE&gt; signals a domain error; if it is zero,
28911 &lt;CODE&gt;y0&lt;/CODE&gt; signals overflow and returns -infinity.
28912 </synopsis>
28913 </function>
28914 </construct>
28915 <construct id="function-y0l" type="function">
28916 <function returntype="long double">
28917 <prototype>
28918 <parameter content="long double x"/>
28919 </prototype>
28920 <headers>
28921 <header filename = "math.h"/>
28922 </headers>
28923 <synopsis>
28924 &lt;CODE&gt;y0&lt;/CODE&gt; returns the Bessel function of the second kind of order 0 of
28925 &lt;VAR&gt;x&lt;/VAR&gt;. It may signal underflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large. If &lt;VAR&gt;x&lt;/VAR&gt;
28926 is negative, &lt;CODE&gt;y0&lt;/CODE&gt; signals a domain error; if it is zero,
28927 &lt;CODE&gt;y0&lt;/CODE&gt; signals overflow and returns -infinity.
28928 </synopsis>
28929 </function>
28930 </construct>
28931 <construct id="function-y1" type="function">
28932 <function returntype="double">
28933 <prototype>
28934 <parameter content="double x"/>
28935 </prototype>
28936 <headers>
28937 <header filename = "math.h"/>
28938 </headers>
28939 <synopsis>
28940 &lt;CODE&gt;y1&lt;/CODE&gt; returns the Bessel function of the second kind of order 1 of
28941 &lt;VAR&gt;x&lt;/VAR&gt;. It may signal underflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large. If &lt;VAR&gt;x&lt;/VAR&gt;
28942 is negative, &lt;CODE&gt;y1&lt;/CODE&gt; signals a domain error; if it is zero,
28943 &lt;CODE&gt;y1&lt;/CODE&gt; signals overflow and returns -infinity.
28944 </synopsis>
28945 </function>
28946 </construct>
28947 <construct id="function-y1f" type="function">
28948 <function returntype="float">
28949 <prototype>
28950 <parameter content="float x"/>
28951 </prototype>
28952 <headers>
28953 <header filename = "math.h"/>
28954 </headers>
28955 <synopsis>
28956 &lt;CODE&gt;y1&lt;/CODE&gt; returns the Bessel function of the second kind of order 1 of
28957 &lt;VAR&gt;x&lt;/VAR&gt;. It may signal underflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large. If &lt;VAR&gt;x&lt;/VAR&gt;
28958 is negative, &lt;CODE&gt;y1&lt;/CODE&gt; signals a domain error; if it is zero,
28959 &lt;CODE&gt;y1&lt;/CODE&gt; signals overflow and returns -infinity.
28960 </synopsis>
28961 </function>
28962 </construct>
28963 <construct id="function-y1l" type="function">
28964 <function returntype="long double">
28965 <prototype>
28966 <parameter content="long double x"/>
28967 </prototype>
28968 <headers>
28969 <header filename = "math.h"/>
28970 </headers>
28971 <synopsis>
28972 &lt;CODE&gt;y1&lt;/CODE&gt; returns the Bessel function of the second kind of order 1 of
28973 &lt;VAR&gt;x&lt;/VAR&gt;. It may signal underflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large. If &lt;VAR&gt;x&lt;/VAR&gt;
28974 is negative, &lt;CODE&gt;y1&lt;/CODE&gt; signals a domain error; if it is zero,
28975 &lt;CODE&gt;y1&lt;/CODE&gt; signals overflow and returns -infinity.
28976 </synopsis>
28977 </function>
28978 </construct>
28979 <construct id="function-yn" type="function">
28980 <function returntype="double">
28981 <prototype>
28982 <parameter content="int n"/>
28983 <parameter content="double x"/>
28984 </prototype>
28985 <headers>
28986 <header filename = "math.h"/>
28987 </headers>
28988 <synopsis>
28989 &lt;CODE&gt;yn&lt;/CODE&gt; returns the Bessel function of the second kind of order &lt;VAR&gt;n&lt;/VAR&gt; of
28990 &lt;VAR&gt;x&lt;/VAR&gt;. It may signal underflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large. If &lt;VAR&gt;x&lt;/VAR&gt;
28991 is negative, &lt;CODE&gt;yn&lt;/CODE&gt; signals a domain error; if it is zero,
28992 &lt;CODE&gt;yn&lt;/CODE&gt; signals overflow and returns -infinity.
28993 </synopsis>
28994 </function>
28995 </construct>
28996 <construct id="function-ynf" type="function">
28997 <function returntype="float">
28998 <prototype>
28999 <parameter content="int n"/>
29000 <parameter content="float x"/>
29001 </prototype>
29002 <headers>
29003 <header filename = "math.h"/>
29004 </headers>
29005 <synopsis>
29006 &lt;CODE&gt;yn&lt;/CODE&gt; returns the Bessel function of the second kind of order &lt;VAR&gt;n&lt;/VAR&gt; of
29007 &lt;VAR&gt;x&lt;/VAR&gt;. It may signal underflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large. If &lt;VAR&gt;x&lt;/VAR&gt;
29008 is negative, &lt;CODE&gt;yn&lt;/CODE&gt; signals a domain error; if it is zero,
29009 &lt;CODE&gt;yn&lt;/CODE&gt; signals overflow and returns -infinity.
29010 </synopsis>
29011 </function>
29012 </construct>
29013 <construct id="function-ynl" type="function">
29014 <function returntype="long double">
29015 <prototype>
29016 <parameter content="int n"/>
29017 <parameter content="long double x"/>
29018 </prototype>
29019 <headers>
29020 <header filename = "math.h"/>
29021 </headers>
29022 <synopsis>
29023 &lt;CODE&gt;yn&lt;/CODE&gt; returns the Bessel function of the second kind of order &lt;VAR&gt;n&lt;/VAR&gt; of
29024 &lt;VAR&gt;x&lt;/VAR&gt;. It may signal underflow if &lt;VAR&gt;x&lt;/VAR&gt; is too large. If &lt;VAR&gt;x&lt;/VAR&gt;
29025 is negative, &lt;CODE&gt;yn&lt;/CODE&gt; signals a domain error; if it is zero,
29026 &lt;CODE&gt;yn&lt;/CODE&gt; signals overflow and returns -infinity.
29027 </synopsis>
29028 </function>
29029 </construct>
29030 <construct id="function-rand" type="function">
29031 <function returntype="int">
29032 <prototype>
29033 <parameter content="void"/>
29034 </prototype>
29035 <headers>
29036 <header filename = "stdlib.h"/>
29037 </headers>
29038 <synopsis>
29039 The &lt;CODE&gt;rand&lt;/CODE&gt; function returns the next pseudo-random number in the
29040 series. The value ranges from &lt;CODE&gt;0&lt;/CODE&gt; to &lt;CODE&gt;RAND_MAX&lt;/CODE&gt;.
29041 </synopsis>
29042 </function>
29043 </construct>
29044 <construct id="function-srand" type="function">
29045 <function returntype="void">
29046 <prototype>
29047 <parameter content="unsigned int seed"/>
29048 </prototype>
29049 <headers>
29050 <header filename = "stdlib.h"/>
29051 </headers>
29052 <synopsis>
29053 This function establishes &lt;VAR&gt;seed&lt;/VAR&gt; as the seed for a new series of
29054 pseudo-random numbers. If you call &lt;CODE&gt;rand&lt;/CODE&gt; before a seed has been
29055 established with &lt;CODE&gt;srand&lt;/CODE&gt;, it uses the value &lt;CODE&gt;1&lt;/CODE&gt; as a default
29056 seed.
29057 &lt;br&gt;&lt;br&gt; To produce a different pseudo-random series each time your program is
29058 run, do &lt;CODE&gt;srand (time (0))&lt;/CODE&gt;.
29059 </synopsis>
29060 </function>
29061 </construct>
29062 <construct id="function-rand_r" type="function">
29063 <function returntype="int">
29064 <prototype>
29065 <parameter content="unsigned int *seed"/>
29066 </prototype>
29067 <headers>
29068 <header filename = "stdlib.h"/>
29069 </headers>
29070 <synopsis>
29071 This function returns a random number in the range 0 to &lt;CODE&gt;RAND_MAX&lt;/CODE&gt;
29072 just as &lt;CODE&gt;rand&lt;/CODE&gt; does. However, all its state is stored in the
29073 &lt;VAR&gt;seed&lt;/VAR&gt; argument. This means the RNG's state can only have as many
29074 bits as the type &lt;CODE&gt;unsigned int&lt;/CODE&gt; has. This is far too few to
29075 provide a good RNG.
29076 &lt;br&gt;&lt;br&gt; If your program requires a reentrant RNG, we recommend you use the
29077 reentrant GNU extensions to the SVID random number generator. The
29078 POSIX.1 interface should only be used when the GNU extensions are not
29079 available.
29080 </synopsis>
29081 </function>
29082 </construct>
29083 <construct id="function-random" type="function">
29084 <function returntype="long int">
29085 <prototype>
29086 <parameter content="void"/>
29087 </prototype>
29088 <headers>
29089 <header filename = "stdlib.h"/>
29090 </headers>
29091 <synopsis>
29092 This function returns the next pseudo-random number in the sequence.
29093 The value returned ranges from &lt;CODE&gt;0&lt;/CODE&gt; to &lt;CODE&gt;RAND_MAX&lt;/CODE&gt;.
29094 &lt;br&gt;&lt;br&gt; NB: Temporarily this function was defined to return a
29095 &lt;CODE&gt;int32_t&lt;/CODE&gt; value to indicate that the return value always contains
29096 32 bits even if &lt;CODE&gt;long int&lt;/CODE&gt; is wider. The standard demands it
29097 differently. Users must always be aware of the 32-bit limitation,
29098 though.
29099 </synopsis>
29100 </function>
29101 </construct>
29102 <construct id="function-srandom" type="function">
29103 <function returntype="void">
29104 <prototype>
29105 <parameter content="unsigned int seed"/>
29106 </prototype>
29107 <headers>
29108 <header filename = "stdlib.h"/>
29109 </headers>
29110 <synopsis>
29111 The &lt;CODE&gt;srandom&lt;/CODE&gt; function sets the state of the random number
29112 generator based on the integer &lt;VAR&gt;seed&lt;/VAR&gt;. If you supply a &lt;VAR&gt;seed&lt;/VAR&gt; value
29113 of &lt;CODE&gt;1&lt;/CODE&gt;, this will cause &lt;CODE&gt;random&lt;/CODE&gt; to reproduce the default set
29114 of random numbers.
29115 &lt;br&gt;&lt;br&gt; To produce a different set of pseudo-random numbers each time your
29116 program runs, do &lt;CODE&gt;srandom (time (0))&lt;/CODE&gt;.
29117 </synopsis>
29118 </function>
29119 </construct>
29120 <construct id="function-initstate" type="function">
29121 <function returntype="void *">
29122 <prototype>
29123 <parameter content="unsigned int seed"/>
29124 <parameter content="void *state"/>
29125 <parameter content="size_t size"/>
29126 </prototype>
29127 <headers>
29128 <header filename = "stdlib.h"/>
29129 </headers>
29130 <synopsis>
29131 The &lt;CODE&gt;initstate&lt;/CODE&gt; function is used to initialize the random number
29132 generator state. The argument &lt;VAR&gt;state&lt;/VAR&gt; is an array of &lt;VAR&gt;size&lt;/VAR&gt;
29133 bytes, used to hold the state information. It is initialized based on
29134 &lt;VAR&gt;seed&lt;/VAR&gt;. The size must be between 8 and 256 bytes, and should be a
29135 power of two. The bigger the &lt;VAR&gt;state&lt;/VAR&gt; array, the better.
29136 &lt;br&gt;&lt;br&gt; The return value is the previous value of the state information array.
29137 You can use this value later as an argument to &lt;CODE&gt;setstate&lt;/CODE&gt; to
29138 restore that state.
29139 </synopsis>
29140 </function>
29141 </construct>
29142 <construct id="function-setstate" type="function">
29143 <function returntype="void *">
29144 <prototype>
29145 <parameter content="void *state"/>
29146 </prototype>
29147 <headers>
29148 <header filename = "stdlib.h"/>
29149 </headers>
29150 <synopsis>
29151 The &lt;CODE&gt;setstate&lt;/CODE&gt; function restores the random number state
29152 information &lt;VAR&gt;state&lt;/VAR&gt;. The argument must have been the result of
29153 a previous call to &lt;VAR&gt;initstate&lt;/VAR&gt; or &lt;VAR&gt;setstate&lt;/VAR&gt;.
29154 &lt;br&gt;&lt;br&gt; The return value is the previous value of the state information array.
29155 You can use this value later as an argument to &lt;CODE&gt;setstate&lt;/CODE&gt; to
29156 restore that state.
29157 &lt;br&gt;&lt;br&gt; If the function fails the return value is &lt;CODE&gt;NULL&lt;/CODE&gt;.
29158 </synopsis>
29159 </function>
29160 </construct>
29161 <construct id="struct-random_data" type="struct">
29162 <structure>
29163 </structure>
29164 </construct>
29165 <construct id="function-random_r" type="function">
29166 <function returntype="int">
29167 <prototype>
29168 <parameter content="struct random_data *restrict buf"/>
29169 <parameter content="int32_t *restrict result"/>
29170 </prototype>
29171 <headers>
29172 <header filename = "stdlib.h"/>
29173 </headers>
29174 <synopsis>
29175 The &lt;CODE&gt;random_r&lt;/CODE&gt; function behaves exactly like the &lt;CODE&gt;random&lt;/CODE&gt;
29176 function except that it uses and modifies the state in the object
29177 pointed to by the first parameter instead of the global state.
29178 </synopsis>
29179 </function>
29180 </construct>
29181 <construct id="function-srandom_r" type="function">
29182 <function returntype="int">
29183 <prototype>
29184 <parameter content="unsigned int seed"/>
29185 <parameter content="struct random_data *buf"/>
29186 </prototype>
29187 <headers>
29188 <header filename = "stdlib.h"/>
29189 </headers>
29190 <synopsis>
29191 The &lt;CODE&gt;srandom_r&lt;/CODE&gt; function behaves exactly like the &lt;CODE&gt;srandom&lt;/CODE&gt;
29192 function except that it uses and modifies the state in the object
29193 pointed to by the second parameter instead of the global state.
29194 </synopsis>
29195 </function>
29196 </construct>
29197 <construct id="function-initstate_r" type="function">
29198 <function returntype="int">
29199 <prototype>
29200 <parameter content="unsigned int seed"/>
29201 <parameter content="char *restrict statebuf"/>
29202 <parameter content="size_t statelen"/>
29203 <parameter content="struct random_data *restrict buf"/>
29204 </prototype>
29205 <headers>
29206 <header filename = "stdlib.h"/>
29207 </headers>
29208 <synopsis>
29209 The &lt;CODE&gt;initstate_r&lt;/CODE&gt; function behaves exactly like the &lt;CODE&gt;initstate&lt;/CODE&gt;
29210 function except that it uses and modifies the state in the object
29211 pointed to by the fourth parameter instead of the global state.
29212 </synopsis>
29213 </function>
29214 </construct>
29215 <construct id="function-setstate_r" type="function">
29216 <function returntype="int">
29217 <prototype>
29218 <parameter content="char *restrict statebuf"/>
29219 <parameter content="struct random_data *restrict buf"/>
29220 </prototype>
29221 <headers>
29222 <header filename = "stdlib.h"/>
29223 </headers>
29224 <synopsis>
29225 The &lt;CODE&gt;setstate_r&lt;/CODE&gt; function behaves exactly like the &lt;CODE&gt;setstate&lt;/CODE&gt;
29226 function except that it uses and modifies the state in the object
29227 pointed to by the first parameter instead of the global state.
29228 </synopsis>
29229 </function>
29230 </construct>
29231 <construct id="function-drand48" type="function">
29232 <function returntype="double">
29233 <prototype>
29234 <parameter content="void"/>
29235 </prototype>
29236 <headers>
29237 <header filename = "stdlib.h"/>
29238 </headers>
29239 <synopsis>
29240 This function returns a &lt;CODE&gt;double&lt;/CODE&gt; value in the range of &lt;CODE&gt;0.0&lt;/CODE&gt;
29241 to &lt;CODE&gt;1.0&lt;/CODE&gt; (exclusive). The random bits are determined by the global
29242 state of the random number generator in the C library.
29243 &lt;br&gt;&lt;br&gt; Since the &lt;CODE&gt;double&lt;/CODE&gt; type according to IEEE 754 has a 52-bit
29244 mantissa this means 4 bits are not initialized by the random number
29245 generator. These are (of course) chosen to be the least significant
29246 bits and they are initialized to &lt;CODE&gt;0&lt;/CODE&gt;.
29247 </synopsis>
29248 </function>
29249 </construct>
29250 <construct id="function-erand48" type="function">
29251 <function returntype="double">
29252 <prototype>
29253 <parameter content="unsigned short int xsubi[3]"/>
29254 </prototype>
29255 <headers>
29256 <header filename = "stdlib.h"/>
29257 </headers>
29258 <synopsis>
29259 This function returns a &lt;CODE&gt;double&lt;/CODE&gt; value in the range of &lt;CODE&gt;0.0&lt;/CODE&gt;
29260 to &lt;CODE&gt;1.0&lt;/CODE&gt; (exclusive), similarly to &lt;CODE&gt;drand48&lt;/CODE&gt;. The argument is
29261 an array describing the state of the random number generator.
29262 &lt;br&gt;&lt;br&gt; This function can be called subsequently since it updates the array to
29263 guarantee random numbers. The array should have been initialized before
29264 initial use to obtain reproducible results.
29265 </synopsis>
29266 </function>
29267 </construct>
29268 <construct id="function-lrand48" type="function">
29269 <function returntype="long int">
29270 <prototype>
29271 <parameter content="void"/>
29272 </prototype>
29273 <headers>
29274 <header filename = "stdlib.h"/>
29275 </headers>
29276 <synopsis>
29277 The &lt;CODE&gt;lrand48&lt;/CODE&gt; function returns an integer value in the range of
29278 &lt;CODE&gt;0&lt;/CODE&gt; to &lt;CODE&gt;2^31&lt;/CODE&gt; (exclusive). Even if the size of the &lt;CODE&gt;long
29279 int&lt;/CODE&gt; type can take more than 32 bits, no higher numbers are returned.
29280 The random bits are determined by the global state of the random number
29281 generator in the C library.
29282 </synopsis>
29283 </function>
29284 </construct>
29285 <construct id="function-nrand48" type="function">
29286 <function returntype="long int">
29287 <prototype>
29288 <parameter content="unsigned short int xsubi[3]"/>
29289 </prototype>
29290 <headers>
29291 <header filename = "stdlib.h"/>
29292 </headers>
29293 <synopsis>
29294 This function is similar to the &lt;CODE&gt;lrand48&lt;/CODE&gt; function in that it
29295 returns a number in the range of &lt;CODE&gt;0&lt;/CODE&gt; to &lt;CODE&gt;2^31&lt;/CODE&gt; (exclusive) but
29296 the state of the random number generator used to produce the random bits
29297 is determined by the array provided as the parameter to the function.
29298 &lt;br&gt;&lt;br&gt; The numbers in the array are updated afterwards so that subsequent calls
29299 to this function yield different results (as is expected of a random
29300 number generator). The array should have been initialized before the
29301 first call to obtain reproducible results.
29302 </synopsis>
29303 </function>
29304 </construct>
29305 <construct id="function-mrand48" type="function">
29306 <function returntype="long int">
29307 <prototype>
29308 <parameter content="void"/>
29309 </prototype>
29310 <headers>
29311 <header filename = "stdlib.h"/>
29312 </headers>
29313 <synopsis>
29314 The &lt;CODE&gt;mrand48&lt;/CODE&gt; function is similar to &lt;CODE&gt;lrand48&lt;/CODE&gt;. The only
29315 difference is that the numbers returned are in the range &lt;CODE&gt;-2^31&lt;/CODE&gt; to
29316 &lt;CODE&gt;2^31&lt;/CODE&gt; (exclusive).
29317 </synopsis>
29318 </function>
29319 </construct>
29320 <construct id="function-jrand48" type="function">
29321 <function returntype="long int">
29322 <prototype>
29323 <parameter content="unsigned short int xsubi[3]"/>
29324 </prototype>
29325 <headers>
29326 <header filename = "stdlib.h"/>
29327 </headers>
29328 <synopsis>
29329 The &lt;CODE&gt;jrand48&lt;/CODE&gt; function is similar to &lt;CODE&gt;nrand48&lt;/CODE&gt;. The only
29330 difference is that the numbers returned are in the range &lt;CODE&gt;-2^31&lt;/CODE&gt; to
29331 &lt;CODE&gt;2^31&lt;/CODE&gt; (exclusive). For the &lt;CODE&gt;xsubi&lt;/CODE&gt; parameter the same
29332 requirements are necessary.
29333 </synopsis>
29334 </function>
29335 </construct>
29336 <construct id="function-srand48" type="function">
29337 <function returntype="void">
29338 <prototype>
29339 <parameter content="long int seedval"/>
29340 </prototype>
29341 <headers>
29342 <header filename = "stdlib.h"/>
29343 </headers>
29344 <synopsis>
29345 The &lt;CODE&gt;srand48&lt;/CODE&gt; function sets the most significant 32 bits of the
29346 internal state of the random number generator to the least
29347 significant 32 bits of the &lt;VAR&gt;seedval&lt;/VAR&gt; parameter. The lower 16 bits
29348 are initialized to the value &lt;CODE&gt;0x330E&lt;/CODE&gt;. Even if the &lt;CODE&gt;long
29349 int&lt;/CODE&gt; type contains more than 32 bits only the lower 32 bits are used.
29350 &lt;br&gt;&lt;br&gt; Owing to this limitation, initialization of the state of this
29351 function is not very useful. But it makes it easy to use a construct
29352 like &lt;CODE&gt;srand48 (time (0))&lt;/CODE&gt;.
29353 &lt;br&gt;&lt;br&gt; A side-effect of this function is that the values &lt;CODE&gt;a&lt;/CODE&gt; and &lt;CODE&gt;c&lt;/CODE&gt;
29354 from the internal state, which are used in the congruential formula,
29355 are reset to the default values given above. This is of importance once
29356 the user has called the &lt;CODE&gt;lcong48&lt;/CODE&gt; function (see below).
29357 </synopsis>
29358 </function>
29359 </construct>
29360 <construct id="function-seed48" type="function">
29361 <function returntype="unsigned short int *">
29362 <prototype>
29363 <parameter content="unsigned short int seed16v[3]"/>
29364 </prototype>
29365 <headers>
29366 <header filename = "stdlib.h"/>
29367 </headers>
29368 <synopsis>
29369 The &lt;CODE&gt;seed48&lt;/CODE&gt; function initializes all 48 bits of the state of the
29370 internal random number generator from the contents of the parameter
29371 &lt;VAR&gt;seed16v&lt;/VAR&gt;. Here the lower 16 bits of the first element of
29372 &lt;VAR&gt;see16v&lt;/VAR&gt; initialize the least significant 16 bits of the internal
29373 state, the lower 16 bits of &lt;CODE&gt;&lt;VAR&gt;seed16v&lt;/VAR&gt;[1]&lt;/CODE&gt; initialize the mid-order
29374 16 bits of the state and the 16 lower bits of &lt;CODE&gt;&lt;VAR&gt;seed16v&lt;/VAR&gt;[2]&lt;/CODE&gt;
29375 initialize the most significant 16 bits of the state.
29376 &lt;br&gt;&lt;br&gt; Unlike &lt;CODE&gt;srand48&lt;/CODE&gt; this function lets the user initialize all 48 bits
29377 of the state.
29378 &lt;br&gt;&lt;br&gt; The value returned by &lt;CODE&gt;seed48&lt;/CODE&gt; is a pointer to an array containing
29379 the values of the internal state before the change. This might be
29380 useful to restart the random number generator at a certain state.
29381 Otherwise the value can simply be ignored.
29382 &lt;br&gt;&lt;br&gt; As for &lt;CODE&gt;srand48&lt;/CODE&gt;, the values &lt;CODE&gt;a&lt;/CODE&gt; and &lt;CODE&gt;c&lt;/CODE&gt; from the
29383 congruential formula are reset to the default values.
29384 </synopsis>
29385 </function>
29386 </construct>
29387 <construct id="function-lcong48" type="function">
29388 <function returntype="void">
29389 <prototype>
29390 <parameter content="unsigned short int param[7]"/>
29391 </prototype>
29392 <headers>
29393 <header filename = "stdlib.h"/>
29394 </headers>
29395 <synopsis>
29396 The &lt;CODE&gt;lcong48&lt;/CODE&gt; function allows the user to change the complete state
29397 of the random number generator. Unlike &lt;CODE&gt;srand48&lt;/CODE&gt; and
29398 &lt;CODE&gt;seed48&lt;/CODE&gt;, this function also changes the constants in the
29399 congruential formula.
29400 &lt;br&gt;&lt;br&gt; From the seven elements in the array &lt;VAR&gt;param&lt;/VAR&gt; the least significant
29401 16 bits of the entries &lt;CODE&gt;&lt;VAR&gt;param&lt;/VAR&gt;[0]&lt;/CODE&gt; to &lt;CODE&gt;&lt;VAR&gt;param&lt;/VAR&gt;[2]&lt;/CODE&gt;
29402 determine the initial state, the least significant 16 bits of
29403 &lt;CODE&gt;&lt;VAR&gt;param&lt;/VAR&gt;[3]&lt;/CODE&gt; to &lt;CODE&gt;&lt;VAR&gt;param&lt;/VAR&gt;[5]&lt;/CODE&gt; determine the 48 bit
29404 constant &lt;CODE&gt;a&lt;/CODE&gt; and &lt;CODE&gt;&lt;VAR&gt;param&lt;/VAR&gt;[6]&lt;/CODE&gt; determines the 16-bit value
29405 &lt;CODE&gt;c&lt;/CODE&gt;.
29406 </synopsis>
29407 </function>
29408 </construct>
29409 <construct id="function-drand48_r" type="function">
29410 <function returntype="int">
29411 <prototype>
29412 <parameter content="struct drand48_data *buffer"/>
29413 <parameter content="double *result"/>
29414 </prototype>
29415 <headers>
29416 <header filename = "stdlib.h"/>
29417 </headers>
29418 <synopsis>
29419 This function is equivalent to the &lt;CODE&gt;drand48&lt;/CODE&gt; function with the
29420 difference that it does not modify the global random number generator
29421 parameters but instead the parameters in the buffer supplied through the
29422 pointer &lt;VAR&gt;buffer&lt;/VAR&gt;. The random number is returned in the variable
29423 pointed to by &lt;VAR&gt;result&lt;/VAR&gt;.
29424 &lt;br&gt;&lt;br&gt; The return value of the function indicates whether the call succeeded.
29425 If the value is less than &lt;CODE&gt;0&lt;/CODE&gt; an error occurred and &lt;VAR&gt;errno&lt;/VAR&gt; is
29426 set to indicate the problem.
29427 &lt;br&gt;&lt;br&gt; This function is a GNU extension and should not be used in portable
29428 programs.
29429 </synopsis>
29430 </function>
29431 </construct>
29432 <construct id="function-erand48_r" type="function">
29433 <function returntype="int">
29434 <prototype>
29435 <parameter content="unsigned short int xsubi[3]"/>
29436 <parameter content="struct drand48_data *buffer"/>
29437 <parameter content="double *result"/>
29438 </prototype>
29439 <headers>
29440 <header filename = "stdlib.h"/>
29441 </headers>
29442 <synopsis>
29443 The &lt;CODE&gt;erand48_r&lt;/CODE&gt; function works like &lt;CODE&gt;erand48&lt;/CODE&gt;, but in addition
29444 it takes an argument &lt;VAR&gt;buffer&lt;/VAR&gt; which describes the random number
29445 generator. The state of the random number generator is taken from the
29446 &lt;CODE&gt;xsubi&lt;/CODE&gt; array, the parameters for the congruential formula from the
29447 global random number generator data. The random number is returned in
29448 the variable pointed to by &lt;VAR&gt;result&lt;/VAR&gt;.
29449 &lt;br&gt;&lt;br&gt; The return value is non-negative if the call succeeded.
29450 &lt;br&gt;&lt;br&gt; This function is a GNU extension and should not be used in portable
29451 programs.
29452 </synopsis>
29453 </function>
29454 </construct>
29455 <construct id="function-lrand48_r" type="function">
29456 <function returntype="int">
29457 <prototype>
29458 <parameter content="struct drand48_data *buffer"/>
29459 <parameter content="double *result"/>
29460 </prototype>
29461 <headers>
29462 <header filename = "stdlib.h"/>
29463 </headers>
29464 <synopsis>
29465 This function is similar to &lt;CODE&gt;lrand48&lt;/CODE&gt;, but in addition it takes a
29466 pointer to a buffer describing the state of the random number generator
29467 just like &lt;CODE&gt;drand48&lt;/CODE&gt;.
29468 &lt;br&gt;&lt;br&gt; If the return value of the function is non-negative the variable pointed
29469 to by &lt;VAR&gt;result&lt;/VAR&gt; contains the result. Otherwise an error occurred.
29470 &lt;br&gt;&lt;br&gt; This function is a GNU extension and should not be used in portable
29471 programs.
29472 </synopsis>
29473 </function>
29474 </construct>
29475 <construct id="function-nrand48_r" type="function">
29476 <function returntype="int">
29477 <prototype>
29478 <parameter content="unsigned short int xsubi[3]"/>
29479 <parameter content="struct drand48_data *buffer"/>
29480 <parameter content="long int *result"/>
29481 </prototype>
29482 <headers>
29483 <header filename = "stdlib.h"/>
29484 </headers>
29485 <synopsis>
29486 The &lt;CODE&gt;nrand48_r&lt;/CODE&gt; function works like &lt;CODE&gt;nrand48&lt;/CODE&gt; in that it
29487 produces a random number in the range &lt;CODE&gt;0&lt;/CODE&gt; to &lt;CODE&gt;2^31&lt;/CODE&gt;. But instead
29488 of using the global parameters for the congruential formula it uses the
29489 information from the buffer pointed to by &lt;VAR&gt;buffer&lt;/VAR&gt;. The state is
29490 described by the values in &lt;VAR&gt;xsubi&lt;/VAR&gt;.
29491 &lt;br&gt;&lt;br&gt; If the return value is non-negative the variable pointed to by
29492 &lt;VAR&gt;result&lt;/VAR&gt; contains the result.
29493 &lt;br&gt;&lt;br&gt; This function is a GNU extension and should not be used in portable
29494 programs.
29495 </synopsis>
29496 </function>
29497 </construct>
29498 <construct id="function-mrand48_r" type="function">
29499 <function returntype="int">
29500 <prototype>
29501 <parameter content="struct drand48_data *buffer"/>
29502 <parameter content="double *result"/>
29503 </prototype>
29504 <headers>
29505 <header filename = "stdlib.h"/>
29506 </headers>
29507 <synopsis>
29508 This function is similar to &lt;CODE&gt;mrand48&lt;/CODE&gt; but like the other reentrant
29509 functions it uses the random number generator described by the value in
29510 the buffer pointed to by &lt;VAR&gt;buffer&lt;/VAR&gt;.
29511 &lt;br&gt;&lt;br&gt; If the return value is non-negative the variable pointed to by
29512 &lt;VAR&gt;result&lt;/VAR&gt; contains the result.
29513 &lt;br&gt;&lt;br&gt; This function is a GNU extension and should not be used in portable
29514 programs.
29515 </synopsis>
29516 </function>
29517 </construct>
29518 <construct id="function-jrand48_r" type="function">
29519 <function returntype="int">
29520 <prototype>
29521 <parameter content="unsigned short int xsubi[3]"/>
29522 <parameter content="struct drand48_data *buffer"/>
29523 <parameter content="long int *result"/>
29524 </prototype>
29525 <headers>
29526 <header filename = "stdlib.h"/>
29527 </headers>
29528 <synopsis>
29529 The &lt;CODE&gt;jrand48_r&lt;/CODE&gt; function is similar to &lt;CODE&gt;jrand48&lt;/CODE&gt;. Like the
29530 other reentrant functions of this function family it uses the
29531 congruential formula parameters from the buffer pointed to by
29532 &lt;VAR&gt;buffer&lt;/VAR&gt;.
29533 &lt;br&gt;&lt;br&gt; If the return value is non-negative the variable pointed to by
29534 &lt;VAR&gt;result&lt;/VAR&gt; contains the result.
29535 &lt;br&gt;&lt;br&gt; This function is a GNU extension and should not be used in portable
29536 programs.
29537 </synopsis>
29538 </function>
29539 </construct>
29540 <construct id="function-srand48_r" type="function">
29541 <function returntype="int">
29542 <prototype>
29543 <parameter content="long int seedval"/>
29544 <parameter content="struct drand48_data *buffer"/>
29545 </prototype>
29546 <headers>
29547 <header filename = "stdlib.h"/>
29548 </headers>
29549 <synopsis>
29550 The description of the random number generator represented by the
29551 information in &lt;VAR&gt;buffer&lt;/VAR&gt; is initialized similarly to what the function
29552 &lt;CODE&gt;srand48&lt;/CODE&gt; does. The state is initialized from the parameter
29553 &lt;VAR&gt;seedval&lt;/VAR&gt; and the parameters for the congruential formula are
29554 initialized to their default values.
29555 &lt;br&gt;&lt;br&gt; If the return value is non-negative the function call succeeded.
29556 &lt;br&gt;&lt;br&gt; This function is a GNU extension and should not be used in portable
29557 programs.
29558 </synopsis>
29559 </function>
29560 </construct>
29561 <construct id="function-seed48_r" type="function">
29562 <function returntype="int">
29563 <prototype>
29564 <parameter content="unsigned short int seed16v[3]"/>
29565 <parameter content="struct drand48_data *buffer"/>
29566 </prototype>
29567 <headers>
29568 <header filename = "stdlib.h"/>
29569 </headers>
29570 <synopsis>
29571 This function is similar to &lt;CODE&gt;srand48_r&lt;/CODE&gt; but like &lt;CODE&gt;seed48&lt;/CODE&gt; it
29572 initializes all 48 bits of the state from the parameter &lt;VAR&gt;seed16v&lt;/VAR&gt;.
29573 &lt;br&gt;&lt;br&gt; If the return value is non-negative the function call succeeded. It
29574 does not return a pointer to the previous state of the random number
29575 generator like the &lt;CODE&gt;seed48&lt;/CODE&gt; function does. If the user wants to
29576 preserve the state for a later re-run s/he can copy the whole buffer
29577 pointed to by &lt;VAR&gt;buffer&lt;/VAR&gt;.
29578 &lt;br&gt;&lt;br&gt; This function is a GNU extension and should not be used in portable
29579 programs.
29580 </synopsis>
29581 </function>
29582 </construct>
29583 <construct id="function-lcong48_r" type="function">
29584 <function returntype="int">
29585 <prototype>
29586 <parameter content="unsigned short int param[7]"/>
29587 <parameter content="struct drand48_data *buffer"/>
29588 </prototype>
29589 <headers>
29590 <header filename = "stdlib.h"/>
29591 </headers>
29592 <synopsis>
29593 This function initializes all aspects of the random number generator
29594 described in &lt;VAR&gt;buffer&lt;/VAR&gt; with the data in &lt;VAR&gt;param&lt;/VAR&gt;. Here it is
29595 especially true that the function does more than just copying the
29596 contents of &lt;VAR&gt;param&lt;/VAR&gt; and &lt;VAR&gt;buffer&lt;/VAR&gt;. More work is required and
29597 therefore it is important to use this function rather than initializing
29598 the random number generator directly.
29599 &lt;br&gt;&lt;br&gt; If the return value is non-negative the function call succeeded.
29600 &lt;br&gt;&lt;br&gt; This function is a GNU extension and should not be used in portable
29601 programs.
29602 </synopsis>
29603 </function>
29604 </construct>
29605 <construct id="function-sysconf" type="function">
29606 <function returntype="long int">
29607 <prototype>
29608 <parameter content="int parameter"/>
29609 </prototype>
29610 <headers>
29611 <header filename = "limits.h"/>
29612 <header filename = "unistd.h"/>
29613 </headers>
29614 <synopsis>
29615 This function is used to inquire about runtime system parameters. The
29616 &lt;VAR&gt;parameter&lt;/VAR&gt; argument should be one of the &lt;samp&gt;_SC_&lt;/samp&gt; symbols listed
29617 below.
29618 &lt;br&gt;&lt;br&gt; The normal return value from &lt;CODE&gt;sysconf&lt;/CODE&gt; is the value you requested.
29619 A value of &lt;CODE&gt;-1&lt;/CODE&gt; is returned both if the implementation does not
29620 impose a limit, and in case of an error.
29621 &lt;br&gt;&lt;br&gt; The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
29622 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
29623
29624 &lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
29625 &lt;DD&gt;
29626 The value of the &lt;VAR&gt;parameter&lt;/VAR&gt; is invalid.
29627
29628 </synopsis>
29629 </function>
29630 </construct>
29631 <construct id="function-pathconf" type="function">
29632 <function returntype="long int">
29633 <prototype>
29634 <parameter content="const char *filename"/>
29635 <parameter content="int parameter"/>
29636 </prototype>
29637 <headers>
29638 <header filename = "unistd.h"/>
29639 <header filename = "unistdh.h"/>
29640 <header filename = "limits.h"/>
29641 <header filename = "dirent.h"/>
29642 <header filename = "stdio.h"/>
29643 </headers>
29644 <synopsis>
29645 This function is used to inquire about the limits that apply to
29646 the file named &lt;VAR&gt;filename&lt;/VAR&gt;.
29647 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;parameter&lt;/VAR&gt; argument should be one of the &lt;samp&gt;_PC_&lt;/samp&gt; constants
29648 listed below.
29649 &lt;br&gt;&lt;br&gt; The normal return value from &lt;CODE&gt;pathconf&lt;/CODE&gt; is the value you requested.
29650 A value of &lt;CODE&gt;-1&lt;/CODE&gt; is returned both if the implementation does not
29651 impose a limit, and in case of an error. In the former case,
29652 &lt;CODE&gt;errno&lt;/CODE&gt; is not set, while in the latter case, &lt;CODE&gt;errno&lt;/CODE&gt; is set
29653 to indicate the cause of the problem. So the only way to use this
29654 function robustly is to store &lt;CODE&gt;0&lt;/CODE&gt; into &lt;CODE&gt;errno&lt;/CODE&gt; just before
29655 calling it.
29656 &lt;br&gt;&lt;br&gt; Besides the usual file name errors ,
29657 the following error condition is defined for this function:
29658 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
29659
29660 &lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
29661 &lt;DD&gt;
29662 The value of &lt;VAR&gt;parameter&lt;/VAR&gt; is invalid, or the implementation doesn't
29663 support the &lt;VAR&gt;parameter&lt;/VAR&gt; for the specific file.
29664
29665 </synopsis>
29666 </function>
29667 </construct>
29668 <construct id="function-fpathconf" type="function">
29669 <function returntype="long int">
29670 <prototype>
29671 <parameter content="int filedes"/>
29672 <parameter content="int parameter"/>
29673 </prototype>
29674 <headers>
29675 <header filename = "unistd.h"/>
29676 </headers>
29677 <synopsis>
29678 This is just like &lt;CODE&gt;pathconf&lt;/CODE&gt; except that an open file descriptor
29679 is used to specify the file for which information is requested, instead
29680 of a file name.
29681 &lt;br&gt;&lt;br&gt; The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
29682 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
29683
29684 &lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
29685 &lt;DD&gt;
29686 The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not a valid file descriptor.
29687 &lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
29688 The value of &lt;VAR&gt;parameter&lt;/VAR&gt; is invalid, or the implementation doesn't
29689 support the &lt;VAR&gt;parameter&lt;/VAR&gt; for the specific file.
29690
29691 </synopsis>
29692 </function>
29693 </construct>
29694 <construct id="function-confstr" type="function">
29695 <function returntype="size_t">
29696 <prototype>
29697 <parameter content="int parameter"/>
29698 <parameter content="char *buf"/>
29699 <parameter content="size_t len"/>
29700 </prototype>
29701 <headers>
29702 <header filename = "unistd.h"/>
29703 <header filename = "limits.h"/>
29704 </headers>
29705 <synopsis>
29706 This function reads the value of a string-valued system parameter,
29707 storing the string into &lt;VAR&gt;len&lt;/VAR&gt; bytes of memory space starting at
29708 &lt;VAR&gt;buf&lt;/VAR&gt;. The &lt;VAR&gt;parameter&lt;/VAR&gt; argument should be one of the
29709 &lt;samp&gt;_CS_&lt;/samp&gt; symbols listed below.
29710 &lt;br&gt;&lt;br&gt; The normal return value from &lt;CODE&gt;confstr&lt;/CODE&gt; is the length of the string
29711 value that you asked for. If you supply a null pointer for &lt;VAR&gt;buf&lt;/VAR&gt;,
29712 then &lt;CODE&gt;confstr&lt;/CODE&gt; does not try to store the string; it just returns
29713 its length. A value of &lt;CODE&gt;0&lt;/CODE&gt; indicates an error.
29714 &lt;br&gt;&lt;br&gt; If the string you asked for is too long for the buffer (that is, longer
29715 than &lt;CODE&gt;&lt;VAR&gt;len&lt;/VAR&gt; - 1&lt;/CODE&gt;), then &lt;CODE&gt;confstr&lt;/CODE&gt; stores just that much
29716 (leaving room for the terminating null character). You can tell that
29717 this has happened because &lt;CODE&gt;confstr&lt;/CODE&gt; returns a value greater than or
29718 equal to &lt;VAR&gt;len&lt;/VAR&gt;.
29719 &lt;br&gt;&lt;br&gt; The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
29720 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
29721
29722 &lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
29723 &lt;DD&gt;
29724 The value of the &lt;VAR&gt;parameter&lt;/VAR&gt; is invalid.
29725
29726 </synopsis>
29727 </function>
29728 </construct>
29729 <construct id="function-setlocale" type="function">
29730 <function returntype="char *">
29731 <prototype>
29732 <parameter content="int category"/>
29733 <parameter content="const char *locale"/>
29734 </prototype>
29735 <headers>
29736 <header filename = "unistd.h"/>
29737 <header filename = "locale.h"/>
29738 </headers>
29739 <synopsis>
29740 The function &lt;CODE&gt;setlocale&lt;/CODE&gt; sets the current locale for category
29741 &lt;VAR&gt;category&lt;/VAR&gt; to &lt;VAR&gt;locale&lt;/VAR&gt;. A list of all the locales the system
29742 provides can be created by running
29743 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
29744 locale -a&lt;br&gt;
29745 &lt;/pre&gt;
29746 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;category&lt;/VAR&gt; is &lt;CODE&gt;LC_ALL&lt;/CODE&gt;, this specifies the locale for all
29747 purposes. The other possible values of &lt;VAR&gt;category&lt;/VAR&gt; specify an
29748 single purpose .
29749 &lt;br&gt;&lt;br&gt; You can also use this function to find out the current locale by passing
29750 a null pointer as the &lt;VAR&gt;locale&lt;/VAR&gt; argument. In this case,
29751 &lt;CODE&gt;setlocale&lt;/CODE&gt; returns a string that is the name of the locale
29752 currently selected for category &lt;VAR&gt;category&lt;/VAR&gt;.
29753 &lt;br&gt;&lt;br&gt; The string returned by &lt;CODE&gt;setlocale&lt;/CODE&gt; can be overwritten by subsequent
29754 calls, so you should make a copy of the string if you want to save it past any further calls to
29755 &lt;CODE&gt;setlocale&lt;/CODE&gt;. (The standard library is guaranteed never to call
29756 &lt;CODE&gt;setlocale&lt;/CODE&gt; itself.)
29757 &lt;br&gt;&lt;br&gt; You should not modify the string returned by &lt;CODE&gt;setlocale&lt;/CODE&gt;. It might
29758 be the same string that was passed as an argument in a previous call to
29759 &lt;CODE&gt;setlocale&lt;/CODE&gt;. One requirement is that the &lt;VAR&gt;category&lt;/VAR&gt; must be
29760 the same in the call the string was returned and the one when the string
29761 is passed in as &lt;VAR&gt;locale&lt;/VAR&gt; parameter.
29762 &lt;br&gt;&lt;br&gt; When you read the current locale for category &lt;CODE&gt;LC_ALL&lt;/CODE&gt;, the value
29763 encodes the entire combination of selected locales for all categories.
29764 In this case, the value is not just a single locale name. In fact, we
29765 don't make any promises about what it looks like. But if you specify
29766 the same ``locale name'' with &lt;CODE&gt;LC_ALL&lt;/CODE&gt; in a subsequent call to
29767 &lt;CODE&gt;setlocale&lt;/CODE&gt;, it restores the same combination of locale selections.
29768 &lt;br&gt;&lt;br&gt; To be sure you can use the returned string encoding the currently selected
29769 locale at a later time, you must make a copy of the string. It is not
29770 guaranteed that the returned pointer remains valid over time.
29771 &lt;br&gt;&lt;br&gt; When the &lt;VAR&gt;locale&lt;/VAR&gt; argument is not a null pointer, the string returned
29772 by &lt;CODE&gt;setlocale&lt;/CODE&gt; reflects the newly-modified locale.
29773 &lt;br&gt;&lt;br&gt; If you specify an empty string for &lt;VAR&gt;locale&lt;/VAR&gt;, this means to read the
29774 appropriate environment variable and use its value to select the locale
29775 for &lt;VAR&gt;category&lt;/VAR&gt;.
29776 &lt;br&gt;&lt;br&gt; If a nonempty string is given for &lt;VAR&gt;locale&lt;/VAR&gt;, then the locale of that
29777 name is used if possible.
29778 &lt;br&gt;&lt;br&gt; If you specify an invalid locale name, &lt;CODE&gt;setlocale&lt;/CODE&gt; returns a null
29779 pointer and leaves the current locale unchanged.
29780 </synopsis>
29781 </function>
29782 </construct>
29783 <construct id="function-localeconv" type="function">
29784 <function returntype="struct lconv *">
29785 <prototype>
29786 <parameter content="void"/>
29787 </prototype>
29788 <headers>
29789 <header filename = "locale.h"/>
29790 </headers>
29791 <synopsis>
29792 The &lt;CODE&gt;localeconv&lt;/CODE&gt; function returns a pointer to a structure whose
29793 components contain information about how numeric and monetary values
29794 should be formatted in the current locale.
29795 &lt;br&gt;&lt;br&gt; You should not modify the structure or its contents. The structure might
29796 be overwritten by subsequent calls to &lt;CODE&gt;localeconv&lt;/CODE&gt;, or by calls to
29797 &lt;CODE&gt;setlocale&lt;/CODE&gt;, but no other function in the library overwrites this
29798 value.
29799 </synopsis>
29800 </function>
29801 </construct>
29802 <construct id="struct-lconv" type="struct">
29803 <structure>
29804 </structure>
29805 </construct>
29806 <construct id="function-nl_langinfo" type="function">
29807 <function returntype="char *">
29808 <prototype>
29809 <parameter content="nl_item item"/>
29810 </prototype>
29811 <headers>
29812 <header filename = "locale.h"/>
29813 <header filename = "langinfo.h"/>
29814 </headers>
29815 <synopsis>
29816 The &lt;CODE&gt;nl_langinfo&lt;/CODE&gt; function can be used to access individual
29817 elements of the locale categories. Unlike the &lt;CODE&gt;localeconv&lt;/CODE&gt;
29818 function, which returns all the information, &lt;CODE&gt;nl_langinfo&lt;/CODE&gt;
29819 lets the caller select what information it requires. This is very
29820 fast and it is not a problem to call this function multiple times.
29821 &lt;br&gt;&lt;br&gt; A second advantage is that in addition to the numeric and monetary
29822 formatting information, information from the
29823 &lt;CODE&gt;LC_TIME&lt;/CODE&gt; and &lt;CODE&gt;LC_MESSAGES&lt;/CODE&gt; categories is available.
29824 &lt;br&gt;&lt;br&gt; The type &lt;CODE&gt;nl_type&lt;/CODE&gt; is defined in &lt;TT&gt;nl_types.h&lt;/TT&gt;. The argument
29825 &lt;VAR&gt;item&lt;/VAR&gt; is a numeric value defined in the header &lt;TT&gt;langinfo.h&lt;/TT&gt;.
29826 The X/Open standard defines the following values:
29827 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
29828
29829 &lt;DT&gt;&lt;CODE&gt;CODESET&lt;/CODE&gt;
29830 &lt;DD&gt;
29831 &lt;CODE&gt;nl_langinfo&lt;/CODE&gt; returns a string with the name of the coded character
29832 set used in the selected locale.
29833 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;ABDAY_1&lt;/CODE&gt;
29834 &lt;DD&gt;
29835 &lt;LI&gt;x ABDAY_2
29836 &lt;LI&gt;x ABDAY_3
29837 &lt;LI&gt;x ABDAY_4
29838 &lt;LI&gt;x ABDAY_5
29839 &lt;LI&gt;x ABDAY_6
29840 &lt;LI&gt;x ABDAY_7
29841 &lt;CODE&gt;nl_langinfo&lt;/CODE&gt; returns the abbreviated weekday name. &lt;CODE&gt;ABDAY_1&lt;/CODE&gt;
29842 corresponds to Sunday.
29843 &lt;DT&gt;&lt;CODE&gt;DAY_1&lt;/CODE&gt;
29844 &lt;DD&gt;
29845 &lt;LI&gt;x DAY_2
29846 &lt;LI&gt;x DAY_3
29847 &lt;LI&gt;x DAY_4
29848 &lt;LI&gt;x DAY_5
29849 &lt;LI&gt;x DAY_6
29850 &lt;LI&gt;x DAY_7
29851 Similar to &lt;CODE&gt;ABDAY_1&lt;/CODE&gt; etc., but here the return value is the
29852 unabbreviated weekday name.
29853 &lt;DT&gt;&lt;CODE&gt;ABMON_1&lt;/CODE&gt;
29854 &lt;DD&gt;
29855 &lt;LI&gt;x ABMON_2
29856 &lt;LI&gt;x ABMON_3
29857 &lt;LI&gt;x ABMON_4
29858 &lt;LI&gt;x ABMON_5
29859 &lt;LI&gt;x ABMON_6
29860 &lt;LI&gt;x ABMON_7
29861 &lt;LI&gt;x ABMON_8
29862 &lt;LI&gt;x ABMON_9
29863 &lt;LI&gt;x ABMON_10
29864 &lt;LI&gt;x ABMON_11
29865 &lt;LI&gt;x ABMON_12
29866 The return value is abbreviated name of the month. &lt;CODE&gt;ABMON_1&lt;/CODE&gt;
29867 corresponds to January.
29868 &lt;DT&gt;&lt;CODE&gt;MON_1&lt;/CODE&gt;
29869 &lt;DD&gt;
29870 &lt;LI&gt;x MON_2
29871 &lt;LI&gt;x MON_3
29872 &lt;LI&gt;x MON_4
29873 &lt;LI&gt;x MON_5
29874 &lt;LI&gt;x MON_6
29875 &lt;LI&gt;x MON_7
29876 &lt;LI&gt;x MON_8
29877 &lt;LI&gt;x MON_9
29878 &lt;LI&gt;x MON_10
29879 &lt;LI&gt;x MON_11
29880 &lt;LI&gt;x MON_12
29881 Similar to &lt;CODE&gt;ABMON_1&lt;/CODE&gt; etc., but here the month names are not abbreviated.
29882 Here the first value &lt;CODE&gt;MON_1&lt;/CODE&gt; also corresponds to January.
29883 &lt;DT&gt;&lt;CODE&gt;AM_STR&lt;/CODE&gt;
29884 &lt;DD&gt;
29885 &lt;LI&gt;x PM_STR
29886 The return values are strings which can be used in the representation of time
29887 as an hour from 1 to 12 plus an am/pm specifier.
29888 &lt;br&gt;&lt;br&gt; Note that in locales which do not use this time representation
29889 these strings might be empty, in which case the am/pm format
29890 cannot be used at all.
29891 &lt;DT&gt;&lt;CODE&gt;D_T_FMT&lt;/CODE&gt;
29892 &lt;DD&gt;
29893 The return value can be used as a format string for &lt;CODE&gt;strftime&lt;/CODE&gt; to
29894 represent time and date in a locale-specific way.
29895 &lt;DT&gt;&lt;CODE&gt;D_FMT&lt;/CODE&gt;
29896 &lt;DD&gt;
29897 The return value can be used as a format string for &lt;CODE&gt;strftime&lt;/CODE&gt; to
29898 represent a date in a locale-specific way.
29899 &lt;DT&gt;&lt;CODE&gt;T_FMT&lt;/CODE&gt;
29900 &lt;DD&gt;
29901 The return value can be used as a format string for &lt;CODE&gt;strftime&lt;/CODE&gt; to
29902 represent time in a locale-specific way.
29903 &lt;DT&gt;&lt;CODE&gt;T_FMT_AMPM&lt;/CODE&gt;
29904 &lt;DD&gt;
29905 The return value can be used as a format string for &lt;CODE&gt;strftime&lt;/CODE&gt; to
29906 represent time in the am/pm format.
29907 &lt;br&gt;&lt;br&gt; Note that if the am/pm format does not make any sense for the
29908 selected locale, the return value might be the same as the one for
29909 &lt;CODE&gt;T_FMT&lt;/CODE&gt;.
29910 &lt;DT&gt;&lt;CODE&gt;ERA&lt;/CODE&gt;
29911 &lt;DD&gt;
29912 The return value represents the era used in the current locale.
29913 &lt;br&gt;&lt;br&gt; Most locales do not define this value. An example of a locale which
29914 does define this value is the Japanese one. In Japan, the traditional
29915 representation of dates includes the name of the era corresponding to
29916 the then-emperor's reign.
29917 &lt;br&gt;&lt;br&gt; Normally it should not be necessary to use this value directly.
29918 Specifying the &lt;CODE&gt;E&lt;/CODE&gt; modifier in their format strings causes the
29919 &lt;CODE&gt;strftime&lt;/CODE&gt; functions to use this information. The format of the
29920 returned string is not specified, and therefore you should not assume
29921 knowledge of it on different systems.
29922 &lt;DT&gt;&lt;CODE&gt;ERA_YEAR&lt;/CODE&gt;
29923 &lt;DD&gt;
29924 The return value gives the year in the relevant era of the locale.
29925 As for &lt;CODE&gt;ERA&lt;/CODE&gt; it should not be necessary to use this value directly.
29926 &lt;DT&gt;&lt;CODE&gt;ERA_D_T_FMT&lt;/CODE&gt;
29927 &lt;DD&gt;
29928 This return value can be used as a format string for &lt;CODE&gt;strftime&lt;/CODE&gt; to
29929 represent dates and times in a locale-specific era-based way.
29930 &lt;DT&gt;&lt;CODE&gt;ERA_D_FMT&lt;/CODE&gt;
29931 &lt;DD&gt;
29932 This return value can be used as a format string for &lt;CODE&gt;strftime&lt;/CODE&gt; to
29933 represent a date in a locale-specific era-based way.
29934 &lt;DT&gt;&lt;CODE&gt;ERA_T_FMT&lt;/CODE&gt;
29935 &lt;DD&gt;
29936 This return value can be used as a format string for &lt;CODE&gt;strftime&lt;/CODE&gt; to
29937 represent time in a locale-specific era-based way.
29938 &lt;DT&gt;&lt;CODE&gt;ALT_DIGITS&lt;/CODE&gt;
29939 &lt;DD&gt;
29940 The return value is a representation of up to 100 values used to
29941 represent the values 0 to 99. As for &lt;CODE&gt;ERA&lt;/CODE&gt; this
29942 value is not intended to be used directly, but instead indirectly
29943 through the &lt;CODE&gt;strftime&lt;/CODE&gt; function. When the modifier &lt;CODE&gt;O&lt;/CODE&gt; is
29944 used in a format which would otherwise use numerals to represent hours,
29945 minutes, seconds, weekdays, months, or weeks, the appropriate value for
29946 the locale is used instead.
29947 &lt;DT&gt;&lt;CODE&gt;INT_CURR_SYMBOL&lt;/CODE&gt;
29948 &lt;DD&gt;
29949 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
29950 &lt;CODE&gt;int_curr_symbol&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
29951 &lt;DT&gt;&lt;CODE&gt;CURRENCY_SYMBOL&lt;/CODE&gt;
29952 &lt;DD&gt;
29953 &lt;LI&gt;x CRNCYSTR
29954 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
29955 &lt;CODE&gt;currency_symbol&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
29956 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;CRNCYSTR&lt;/CODE&gt; is a deprecated alias still required by Unix98.
29957 &lt;DT&gt;&lt;CODE&gt;MON_DECIMAL_POINT&lt;/CODE&gt;
29958 &lt;DD&gt;
29959 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
29960 &lt;CODE&gt;mon_decimal_point&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
29961 &lt;DT&gt;&lt;CODE&gt;MON_THOUSANDS_SEP&lt;/CODE&gt;
29962 &lt;DD&gt;
29963 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
29964 &lt;CODE&gt;mon_thousands_sep&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
29965 &lt;DT&gt;&lt;CODE&gt;MON_GROUPING&lt;/CODE&gt;
29966 &lt;DD&gt;
29967 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
29968 &lt;CODE&gt;mon_grouping&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
29969 &lt;DT&gt;&lt;CODE&gt;POSITIVE_SIGN&lt;/CODE&gt;
29970 &lt;DD&gt;
29971 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
29972 &lt;CODE&gt;positive_sign&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
29973 &lt;DT&gt;&lt;CODE&gt;NEGATIVE_SIGN&lt;/CODE&gt;
29974 &lt;DD&gt;
29975 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
29976 &lt;CODE&gt;negative_sign&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
29977 &lt;DT&gt;&lt;CODE&gt;INT_FRAC_DIGITS&lt;/CODE&gt;
29978 &lt;DD&gt;
29979 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
29980 &lt;CODE&gt;int_frac_digits&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
29981 &lt;DT&gt;&lt;CODE&gt;FRAC_DIGITS&lt;/CODE&gt;
29982 &lt;DD&gt;
29983 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
29984 &lt;CODE&gt;frac_digits&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
29985 &lt;DT&gt;&lt;CODE&gt;P_CS_PRECEDES&lt;/CODE&gt;
29986 &lt;DD&gt;
29987 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
29988 &lt;CODE&gt;p_cs_precedes&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
29989 &lt;DT&gt;&lt;CODE&gt;P_SEP_BY_SPACE&lt;/CODE&gt;
29990 &lt;DD&gt;
29991 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
29992 &lt;CODE&gt;p_sep_by_space&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
29993 &lt;DT&gt;&lt;CODE&gt;N_CS_PRECEDES&lt;/CODE&gt;
29994 &lt;DD&gt;
29995 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
29996 &lt;CODE&gt;n_cs_precedes&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
29997 &lt;DT&gt;&lt;CODE&gt;N_SEP_BY_SPACE&lt;/CODE&gt;
29998 &lt;DD&gt;
29999 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
30000 &lt;CODE&gt;n_sep_by_space&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
30001 &lt;DT&gt;&lt;CODE&gt;P_SIGN_POSN&lt;/CODE&gt;
30002 &lt;DD&gt;
30003 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
30004 &lt;CODE&gt;p_sign_posn&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
30005 &lt;DT&gt;&lt;CODE&gt;N_SIGN_POSN&lt;/CODE&gt;
30006 &lt;DD&gt;
30007 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
30008 &lt;CODE&gt;n_sign_posn&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
30009 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;INT_P_CS_PRECEDES&lt;/CODE&gt;
30010 &lt;DD&gt;
30011 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
30012 &lt;CODE&gt;int_p_cs_precedes&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
30013 &lt;DT&gt;&lt;CODE&gt;INT_P_SEP_BY_SPACE&lt;/CODE&gt;
30014 &lt;DD&gt;
30015 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
30016 &lt;CODE&gt;int_p_sep_by_space&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
30017 &lt;DT&gt;&lt;CODE&gt;INT_N_CS_PRECEDES&lt;/CODE&gt;
30018 &lt;DD&gt;
30019 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
30020 &lt;CODE&gt;int_n_cs_precedes&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
30021 &lt;DT&gt;&lt;CODE&gt;INT_N_SEP_BY_SPACE&lt;/CODE&gt;
30022 &lt;DD&gt;
30023 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
30024 &lt;CODE&gt;int_n_sep_by_space&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
30025 &lt;DT&gt;&lt;CODE&gt;INT_P_SIGN_POSN&lt;/CODE&gt;
30026 &lt;DD&gt;
30027 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
30028 &lt;CODE&gt;int_p_sign_posn&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
30029 &lt;DT&gt;&lt;CODE&gt;INT_N_SIGN_POSN&lt;/CODE&gt;
30030 &lt;DD&gt;
30031 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
30032 &lt;CODE&gt;int_n_sign_posn&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
30033 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;DECIMAL_POINT&lt;/CODE&gt;
30034 &lt;DD&gt;
30035 &lt;LI&gt;x RADIXCHAR
30036 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
30037 &lt;CODE&gt;decimal_point&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
30038 &lt;br&gt;&lt;br&gt; The name &lt;CODE&gt;RADIXCHAR&lt;/CODE&gt; is a deprecated alias still used in Unix98.
30039 &lt;DT&gt;&lt;CODE&gt;THOUSANDS_SEP&lt;/CODE&gt;
30040 &lt;DD&gt;
30041 &lt;LI&gt;x THOUSEP
30042 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
30043 &lt;CODE&gt;thousands_sep&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
30044 &lt;br&gt;&lt;br&gt; The name &lt;CODE&gt;THOUSEP&lt;/CODE&gt; is a deprecated alias still used in Unix98.
30045 &lt;DT&gt;&lt;CODE&gt;GROUPING&lt;/CODE&gt;
30046 &lt;DD&gt;
30047 The same as the value returned by &lt;CODE&gt;localeconv&lt;/CODE&gt; in the
30048 &lt;CODE&gt;grouping&lt;/CODE&gt; element of the &lt;CODE&gt;struct lconv&lt;/CODE&gt;.
30049 &lt;DT&gt;&lt;CODE&gt;YESEXPR&lt;/CODE&gt;
30050 &lt;DD&gt;
30051 The return value is a regular expression which can be used with the
30052 &lt;CODE&gt;regex&lt;/CODE&gt; function to recognize a positive response to a yes/no
30053 question. The GNU C library provides the &lt;CODE&gt;rpmatch&lt;/CODE&gt; function for
30054 easier handling in applications.
30055 &lt;DT&gt;&lt;CODE&gt;NOEXPR&lt;/CODE&gt;
30056 &lt;DD&gt;
30057 The return value is a regular expression which can be used with the
30058 &lt;CODE&gt;regex&lt;/CODE&gt; function to recognize a negative response to a yes/no
30059 question.
30060 &lt;DT&gt;&lt;CODE&gt;YESSTR&lt;/CODE&gt;
30061 &lt;DD&gt;
30062 The return value is a locale-specific translation of the positive response
30063 to a yes/no question.
30064 &lt;br&gt;&lt;br&gt; Using this value is deprecated since it is a very special case of
30065 message translation, and is better handled by the message
30066 translation functions .
30067 &lt;br&gt;&lt;br&gt; The use of this symbol is deprecated. Instead message translation
30068 should be used.
30069 &lt;DT&gt;&lt;CODE&gt;NOSTR&lt;/CODE&gt;
30070 &lt;DD&gt;
30071 The return value is a locale-specific translation of the negative response
30072 to a yes/no question. What is said for &lt;CODE&gt;YESSTR&lt;/CODE&gt; is also true here.
30073 &lt;br&gt;&lt;br&gt; The use of this symbol is deprecated. Instead message translation
30074 should be used.
30075 &lt;/DL&gt;
30076 &lt;br&gt;&lt;br&gt; The file &lt;TT&gt;langinfo.h&lt;/TT&gt; defines a lot more symbols but none of them
30077 is official. Using them is not portable, and the format of the
30078 return values might change. Therefore we recommended you not use
30079 them.
30080 &lt;br&gt;&lt;br&gt; Note that the return value for any valid argument can be used for
30081 in all situations (with the possible exception of the am/pm time formatting
30082 codes). If the user has not selected any locale for the
30083 appropriate category, &lt;CODE&gt;nl_langinfo&lt;/CODE&gt; returns the information from the
30084 &lt;CODE&gt;"C"&lt;/CODE&gt; locale. It is therefore possible to use this function as
30085 shown in the example below.
30086 &lt;br&gt;&lt;br&gt; If the argument &lt;VAR&gt;item&lt;/VAR&gt; is not valid, a pointer to an empty string is
30087 returned.
30088 </synopsis>
30089 </function>
30090 </construct>
30091 <construct id="function-strfmon" type="function">
30092 <function returntype="ssize_t">
30093 <prototype>
30094 <parameter content="char *s"/>
30095 <parameter content="size_t maxsize"/>
30096 <parameter content="const char *format"/>
30097 <parameter content="..."/>
30098 </prototype>
30099 <synopsis>
30100 The &lt;CODE&gt;strfmon&lt;/CODE&gt; function is similar to the &lt;CODE&gt;strftime&lt;/CODE&gt; function
30101 in that it takes a buffer, its size, a format string,
30102 and values to write into the buffer as text in a form specified
30103 by the format string. Like &lt;CODE&gt;strftime&lt;/CODE&gt;, the function
30104 also returns the number of bytes written into the buffer.
30105 &lt;br&gt;&lt;br&gt; There are two differences: &lt;CODE&gt;strfmon&lt;/CODE&gt; can take more than one
30106 argument, and, of course, the format specification is different. Like
30107 &lt;CODE&gt;strftime&lt;/CODE&gt;, the format string consists of normal text, which is
30108 output as is, and format specifiers, which are indicated by a &lt;samp&gt;%&lt;/samp&gt;.
30109 Immediately after the &lt;samp&gt;%&lt;/samp&gt;, you can optionally specify various flags
30110 and formatting information before the main formatting character, in a
30111 similar way to &lt;CODE&gt;printf&lt;/CODE&gt;:
30112 &lt;br&gt;&lt;br&gt; &lt;OL&gt;
30113 &lt;LI&gt;
30114 Immediately following the &lt;samp&gt;%&lt;/samp&gt; there can be one or more of the
30115 following flags:
30116 &lt;DL&gt;
30117
30118 &lt;LI&gt; &lt;samp&gt;=&lt;VAR&gt;f&lt;/VAR&gt;&lt;/samp&gt;
30119 The single byte character &lt;VAR&gt;f&lt;/VAR&gt; is used for this field as the numeric
30120 fill character. By default this character is a space character.
30121 Filling with this character is only performed if a left precision
30122 is specified. It is not just to fill to the given field width.
30123 &lt;LI&gt; &lt;samp&gt;^&lt;/samp&gt;
30124 The number is printed without grouping the digits according to the rules
30125 of the current locale. By default grouping is enabled.
30126 &lt;LI&gt; &lt;samp&gt;+&lt;/samp&gt;, &lt;samp&gt;(&lt;/samp&gt;
30127 At most one of these flags can be used. They select which format to
30128 represent the sign of a currency amount. By default, and if
30129 &lt;samp&gt;+&lt;/samp&gt; is given, the locale equivalent of +/- is used. If
30130 &lt;samp&gt;(&lt;/samp&gt; is given, negative amounts are enclosed in parentheses. The
30131 exact format is determined by the values of the &lt;CODE&gt;LC_MONETARY&lt;/CODE&gt;
30132 category of the locale selected at program runtime.
30133 &lt;LI&gt; &lt;samp&gt;!&lt;/samp&gt;
30134 The output will not contain the currency symbol.
30135 &lt;LI&gt; &lt;samp&gt;-&lt;/samp&gt;
30136 The output will be formatted left-justified instead of right-justified if
30137 it does not fill the entire field width.
30138 &lt;/DL&gt;
30139 &lt;/OL&gt;
30140 &lt;br&gt;&lt;br&gt; The next part of a specification is an optional field width. If no
30141 width is specified 0 is taken. During output, the function first
30142 determines how much space is required. If it requires at least as many
30143 characters as given by the field width, it is output using as much space
30144 as necessary. Otherwise, it is extended to use the full width by
30145 filling with the space character. The presence or absence of the
30146 &lt;samp&gt;-&lt;/samp&gt; flag determines the side at which such padding occurs. If
30147 present, the spaces are added at the right making the output
30148 left-justified, and vice versa.
30149 &lt;br&gt;&lt;br&gt; So far the format looks familiar, being similar to the &lt;CODE&gt;printf&lt;/CODE&gt; and
30150 &lt;CODE&gt;strftime&lt;/CODE&gt; formats. However, the next two optional fields
30151 introduce something new. The first one is a &lt;samp&gt;#&lt;/samp&gt; character followed
30152 by a decimal digit string. The value of the digit string specifies the
30153 number of &lt;EM&gt;digit&lt;/EM&gt; positions to the left of the decimal point (or
30154 equivalent). This does &lt;EM&gt;not&lt;/EM&gt; include the grouping character when
30155 the &lt;samp&gt;^&lt;/samp&gt; flag is not given. If the space needed to print the number
30156 does not fill the whole width, the field is padded at the left side with
30157 the fill character, which can be selected using the &lt;samp&gt;=&lt;/samp&gt; flag and by
30158 default is a space. For example, if the field width is selected as 6
30159 and the number is 123, the fill character is &lt;samp&gt;*&lt;/samp&gt; the result
30160 will be &lt;samp&gt;***123&lt;/samp&gt;.
30161 &lt;br&gt;&lt;br&gt; The second optional field starts with a &lt;samp&gt;.&lt;/samp&gt; (period) and consists
30162 of another decimal digit string. Its value describes the number of
30163 characters printed after the decimal point. The default is selected
30164 from the current locale (&lt;CODE&gt;frac_digits&lt;/CODE&gt;, &lt;CODE&gt;int_frac_digits&lt;/CODE&gt;, see
30165 ). If the exact representation needs more digits
30166 than given by the field width, the displayed value is rounded. If the
30167 number of fractional digits is selected to be zero, no decimal point is
30168 printed.
30169 &lt;br&gt;&lt;br&gt; As a GNU extension, the &lt;CODE&gt;strfmon&lt;/CODE&gt; implementation in the GNU libc
30170 allows an optional &lt;samp&gt;L&lt;/samp&gt; next as a format modifier. If this modifier
30171 is given, the argument is expected to be a &lt;CODE&gt;long double&lt;/CODE&gt; instead of
30172 a &lt;CODE&gt;double&lt;/CODE&gt; value.
30173 &lt;br&gt;&lt;br&gt; Finally, the last component is a format specifier. There are three
30174 specifiers defined:
30175 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
30176
30177 &lt;LI&gt; &lt;samp&gt;i&lt;/samp&gt;
30178 Use the locale's rules for formatting an international currency value.
30179 &lt;LI&gt; &lt;samp&gt;n&lt;/samp&gt;
30180 Use the locale's rules for formatting a national currency value.
30181 &lt;LI&gt; &lt;samp&gt;%&lt;/samp&gt;
30182 Place a &lt;samp&gt;%&lt;/samp&gt; in the output. There must be no flag, width
30183 specifier or modifier given, only &lt;samp&gt;%%&lt;/samp&gt; is allowed.
30184 &lt;/DL&gt;
30185 &lt;br&gt;&lt;br&gt; As for &lt;CODE&gt;printf&lt;/CODE&gt;, the function reads the format string
30186 from left to right and uses the values passed to the function following
30187 the format string. The values are expected to be either of type
30188 &lt;CODE&gt;double&lt;/CODE&gt; or &lt;CODE&gt;long double&lt;/CODE&gt;, depending on the presence of the
30189 modifier &lt;samp&gt;L&lt;/samp&gt;. The result is stored in the buffer pointed to by
30190 &lt;VAR&gt;s&lt;/VAR&gt;. At most &lt;VAR&gt;maxsize&lt;/VAR&gt; characters are stored.
30191 &lt;br&gt;&lt;br&gt; The return value of the function is the number of characters stored in
30192 &lt;VAR&gt;s&lt;/VAR&gt;, including the terminating &lt;CODE&gt;NULL&lt;/CODE&gt; byte. If the number of
30193 characters stored would exceed &lt;VAR&gt;maxsize&lt;/VAR&gt;, the function returns
30194 -1 and the content of the buffer &lt;VAR&gt;s&lt;/VAR&gt; is unspecified. In this
30195 case &lt;CODE&gt;errno&lt;/CODE&gt; is set to &lt;CODE&gt;E2BIG&lt;/CODE&gt;.
30196 </synopsis>
30197 </function>
30198 </construct>
30199 <construct id="function-rpmatch" type="function">
30200 <function returntype="int">
30201 <prototype>
30202 <parameter content="const char *response"/>
30203 </prototype>
30204 <headers>
30205 <header filename = "stdlib.h"/>
30206 </headers>
30207 <synopsis>
30208 The function &lt;CODE&gt;rpmatch&lt;/CODE&gt; checks the string in &lt;VAR&gt;response&lt;/VAR&gt; whether
30209 or not it is a correct yes-or-no answer and if yes, which one. The
30210 check uses the &lt;CODE&gt;YESEXPR&lt;/CODE&gt; and &lt;CODE&gt;NOEXPR&lt;/CODE&gt; data in the
30211 &lt;CODE&gt;LC_MESSAGES&lt;/CODE&gt; category of the currently selected locale. The
30212 return value is as follows:
30213 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
30214
30215 &lt;DT&gt;&lt;CODE&gt;1&lt;/CODE&gt;
30216 &lt;DD&gt;
30217 The user entered an affirmative answer.
30218 &lt;br&gt;&lt;br&gt; &lt;LI&gt; 0
30219 The user entered a negative answer.
30220 &lt;br&gt;&lt;br&gt; &lt;LI&gt; -1
30221 The answer matched neither the &lt;CODE&gt;YESEXPR&lt;/CODE&gt; nor the &lt;CODE&gt;NOEXPR&lt;/CODE&gt;
30222 regular expression.
30223
30224 &lt;br&gt;&lt;br&gt; This function is not standardized but available beside in GNU libc at
30225 least also in the IBM AIX library.
30226 </synopsis>
30227 </function>
30228 </construct>
30229 <construct id="dtype-FILE" type="dtype">
30230 <structure>
30231 </structure>
30232 </construct>
30233 <construct id="function-fopen" type="function">
30234 <function returntype="FILE *">
30235 <prototype>
30236 <parameter content="const char *filename"/>
30237 <parameter content="const char *opentype"/>
30238 </prototype>
30239 <headers>
30240 <header filename = "stdio.h"/>
30241 </headers>
30242 <synopsis>
30243 The &lt;CODE&gt;fopen&lt;/CODE&gt; function opens a stream for I/O to the file
30244 &lt;VAR&gt;filename&lt;/VAR&gt;, and returns a pointer to the stream.
30245 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;opentype&lt;/VAR&gt; argument is a string that controls how the file is
30246 opened and specifies attributes of the resulting stream. It must begin
30247 with one of the following sequences of characters:
30248 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
30249
30250 &lt;DT&gt;&lt;SAMP&gt;r&lt;/SAMP&gt;
30251 &lt;DD&gt;
30252 Open an existing file for reading only.
30253 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;SAMP&gt;w&lt;/SAMP&gt;
30254 &lt;DD&gt;
30255 Open the file for writing only. If the file already exists, it is
30256 truncated to zero length. Otherwise a new file is created.
30257 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;SAMP&gt;a&lt;/SAMP&gt;
30258 &lt;DD&gt;
30259 Open a file for append access; that is, writing at the end of file only.
30260 If the file already exists, its initial contents are unchanged and
30261 output to the stream is appended to the end of the file.
30262 Otherwise, a new, empty file is created.
30263 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;SAMP&gt;r+&lt;/SAMP&gt;
30264 &lt;DD&gt;
30265 Open an existing file for both reading and writing. The initial contents
30266 of the file are unchanged and the initial file position is at the
30267 beginning of the file.
30268 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;SAMP&gt;w+&lt;/SAMP&gt;
30269 &lt;DD&gt;
30270 Open a file for both reading and writing. If the file already exists, it
30271 is truncated to zero length. Otherwise, a new file is created.
30272 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;SAMP&gt;a+&lt;/SAMP&gt;
30273 &lt;DD&gt;
30274 Open or create file for both reading and appending. If the file exists,
30275 its initial contents are unchanged. Otherwise, a new file is created.
30276 The initial file position for reading is at the beginning of the file,
30277 but output is always appended to the end of the file.
30278 &lt;/DL&gt;
30279 &lt;br&gt;&lt;br&gt; As you can see, &lt;samp&gt;+&lt;/samp&gt; requests a stream that can do both input and
30280 output. When using such a stream, you must call &lt;CODE&gt;fflush&lt;/CODE&gt;
30281 or a file positioning function such as
30282 &lt;CODE&gt;fseek&lt;/CODE&gt; when switching from reading
30283 to writing or vice versa. Otherwise, internal buffers might not be
30284 emptied properly.
30285 &lt;br&gt;&lt;br&gt; Additional characters may appear after these to specify flags for the
30286 call. Always put the mode (&lt;samp&gt;r&lt;/samp&gt;, &lt;samp&gt;w+&lt;/samp&gt;, etc.) first; that is
30287 the only part you are guaranteed will be understood by all systems.
30288 &lt;br&gt;&lt;br&gt; The GNU C library defines one additional character for use in
30289 &lt;VAR&gt;opentype&lt;/VAR&gt;: the character &lt;samp&gt;x&lt;/samp&gt; insists on creating a new
30290 file---if a file &lt;VAR&gt;filename&lt;/VAR&gt; already exists, &lt;CODE&gt;fopen&lt;/CODE&gt; fails
30291 rather than opening it. If you use &lt;samp&gt;x&lt;/samp&gt; you are guaranteed that
30292 you will not clobber an existing file. This is equivalent to the
30293 &lt;CODE&gt;O_EXCL&lt;/CODE&gt; option to the &lt;CODE&gt;open&lt;/CODE&gt; function .
30294 &lt;br&gt;&lt;br&gt; The character &lt;samp&gt;b&lt;/samp&gt; in &lt;VAR&gt;opentype&lt;/VAR&gt; has a standard meaning; it
30295 requests a binary stream rather than a text stream. But this makes no
30296 difference in POSIX systems (including the GNU system). If both
30297 &lt;samp&gt;+&lt;/samp&gt; and &lt;samp&gt;b&lt;/samp&gt; are specified, they can appear in either order.
30298 .
30299 &lt;br&gt;&lt;br&gt; orientation
30300 , stream
30301 If the &lt;VAR&gt;opentype&lt;/VAR&gt; string contains the sequence
30302 &lt;CODE&gt;,ccs=&lt;VAR&gt;STRING&lt;/VAR&gt;&lt;/CODE&gt; then &lt;VAR&gt;STRING&lt;/VAR&gt; is taken as the name of a
30303 coded character set and &lt;CODE&gt;fopen&lt;/CODE&gt; will mark the stream as
30304 wide-oriented which appropriate conversion functions in place to convert
30305 from and to the character set &lt;VAR&gt;STRING&lt;/VAR&gt; is place. Any other stream
30306 is opened initially unoriented and the orientation is decided with the
30307 first file operation. If the first operation is a wide character
30308 operation, the stream is not only marked as wide-oriented, also the
30309 conversion functions to convert to the coded character set used for the
30310 current locale are loaded. This will not change anymore from this point
30311 on even if the locale selected for the &lt;CODE&gt;LC_CTYPE&lt;/CODE&gt; category is
30312 changed.
30313 &lt;br&gt;&lt;br&gt; Any other characters in &lt;VAR&gt;opentype&lt;/VAR&gt; are simply ignored. They may be
30314 meaningful in other systems.
30315 &lt;br&gt;&lt;br&gt; If the open fails, &lt;CODE&gt;fopen&lt;/CODE&gt; returns a null pointer.
30316 &lt;br&gt;&lt;br&gt; When the sources are compiling with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a
30317 32 bit machine this function is in fact &lt;CODE&gt;fopen64&lt;/CODE&gt; since the LFS
30318 interface replaces transparently the old interface.
30319 </synopsis>
30320 </function>
30321 </construct>
30322 <construct id="function-fopen64" type="function">
30323 <function returntype="FILE *">
30324 <prototype>
30325 <parameter content="const char *filename"/>
30326 <parameter content="const char *opentype"/>
30327 </prototype>
30328 <headers>
30329 <header filename = "stdio.h"/>
30330 </headers>
30331 <synopsis>
30332 This function is similar to &lt;CODE&gt;fopen&lt;/CODE&gt; but the stream it returns a
30333 pointer for is opened using &lt;CODE&gt;open64&lt;/CODE&gt;. Therefore this stream can be
30334 used even on files larger then 2^31 bytes on 32 bit machines.
30335 &lt;br&gt;&lt;br&gt; Please note that the return type is still &lt;CODE&gt;FILE *&lt;/CODE&gt;. There is no
30336 special &lt;CODE&gt;FILE&lt;/CODE&gt; type for the LFS interface.
30337 &lt;br&gt;&lt;br&gt; If the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a 32
30338 bits machine this function is available under the name &lt;CODE&gt;fopen&lt;/CODE&gt;
30339 and so transparently replaces the old interface.
30340 </synopsis>
30341 </function>
30342 </construct>
30343 <construct id="function-freopen" type="function">
30344 <function returntype="FILE *">
30345 <prototype>
30346 <parameter content="const char *filename"/>
30347 <parameter content="const char *opentype"/>
30348 <parameter content="FILE *stream"/>
30349 </prototype>
30350 <headers>
30351 <header filename = "stdio.h"/>
30352 </headers>
30353 <synopsis>
30354 This function is like a combination of &lt;CODE&gt;fclose&lt;/CODE&gt; and &lt;CODE&gt;fopen&lt;/CODE&gt;.
30355 It first closes the stream referred to by &lt;VAR&gt;stream&lt;/VAR&gt;, ignoring any
30356 errors that are detected in the process. (Because errors are ignored,
30357 you should not use &lt;CODE&gt;freopen&lt;/CODE&gt; on an output stream if you have
30358 actually done any output using the stream.) Then the file named by
30359 &lt;VAR&gt;filename&lt;/VAR&gt; is opened with mode &lt;VAR&gt;opentype&lt;/VAR&gt; as for &lt;CODE&gt;fopen&lt;/CODE&gt;,
30360 and associated with the same stream object &lt;VAR&gt;stream&lt;/VAR&gt;.
30361 &lt;br&gt;&lt;br&gt; If the operation fails, a null pointer is returned; otherwise,
30362 &lt;CODE&gt;freopen&lt;/CODE&gt; returns &lt;VAR&gt;stream&lt;/VAR&gt;.
30363 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;freopen&lt;/CODE&gt; has traditionally been used to connect a standard stream
30364 such as &lt;CODE&gt;stdin&lt;/CODE&gt; with a file of your own choice. This is useful in
30365 programs in which use of a standard stream for certain purposes is
30366 hard-coded. In the GNU C library, you can simply close the standard
30367 streams and open new ones with &lt;CODE&gt;fopen&lt;/CODE&gt;. But other systems lack
30368 this ability, so using &lt;CODE&gt;freopen&lt;/CODE&gt; is more portable.
30369 &lt;br&gt;&lt;br&gt; When the sources are compiling with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a
30370 32 bit machine this function is in fact &lt;CODE&gt;freopen64&lt;/CODE&gt; since the LFS
30371 interface replaces transparently the old interface.
30372 </synopsis>
30373 </function>
30374 </construct>
30375 <construct id="function-freopen64" type="function">
30376 <function returntype="FILE *">
30377 <prototype>
30378 <parameter content="const char *filename"/>
30379 <parameter content="const char *opentype"/>
30380 <parameter content="FILE *stream"/>
30381 </prototype>
30382 <headers>
30383 <header filename = "stdio.h"/>
30384 </headers>
30385 <synopsis>
30386 This function is similar to &lt;CODE&gt;freopen&lt;/CODE&gt;. The only difference is that
30387 on 32 bit machine the stream returned is able to read beyond the
30388 2^31 bytes limits imposed by the normal interface. It should be
30389 noted that the stream pointed to by &lt;VAR&gt;stream&lt;/VAR&gt; need not be opened
30390 using &lt;CODE&gt;fopen64&lt;/CODE&gt; or &lt;CODE&gt;freopen64&lt;/CODE&gt; since its mode is not important
30391 for this function.
30392 &lt;br&gt;&lt;br&gt; If the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a 32
30393 bits machine this function is available under the name &lt;CODE&gt;freopen&lt;/CODE&gt;
30394 and so transparently replaces the old interface.
30395 </synopsis>
30396 </function>
30397 </construct>
30398 <construct id="function-__freadable" type="function">
30399 <function returntype="int">
30400 <prototype>
30401 <parameter content="FILE *stream"/>
30402 </prototype>
30403 <headers>
30404 <header filename = "stdio_ext.h"/>
30405 </headers>
30406 <synopsis>
30407 The &lt;CODE&gt;__freadable&lt;/CODE&gt; function determines whether the stream
30408 &lt;VAR&gt;stream&lt;/VAR&gt; was opened to allow reading. In this case the return value
30409 is nonzero. For write-only streams the function returns zero.
30410 &lt;br&gt;&lt;br&gt; This function is declared in &lt;TT&gt;stdio_ext.h&lt;/TT&gt;.
30411 </synopsis>
30412 </function>
30413 </construct>
30414 <construct id="function-__fwritable" type="function">
30415 <function returntype="int">
30416 <prototype>
30417 <parameter content="FILE *stream"/>
30418 </prototype>
30419 <headers>
30420 <header filename = "stdio_ext.h"/>
30421 </headers>
30422 <synopsis>
30423 The &lt;CODE&gt;__fwritable&lt;/CODE&gt; function determines whether the stream
30424 &lt;VAR&gt;stream&lt;/VAR&gt; was opened to allow writing. In this case the return value
30425 is nonzero. For read-only streams the function returns zero.
30426 &lt;br&gt;&lt;br&gt; This function is declared in &lt;TT&gt;stdio_ext.h&lt;/TT&gt;.
30427 </synopsis>
30428 </function>
30429 </construct>
30430 <construct id="function-__freading" type="function">
30431 <function returntype="int">
30432 <prototype>
30433 <parameter content="FILE *stream"/>
30434 </prototype>
30435 <headers>
30436 <header filename = "stdio_ext.h"/>
30437 </headers>
30438 <synopsis>
30439 The &lt;CODE&gt;__freading&lt;/CODE&gt; function determines whether the stream
30440 &lt;VAR&gt;stream&lt;/VAR&gt; was last read from or whether it is opened read-only. In
30441 this case the return value is nonzero, otherwise it is zero.
30442 Determining whether a stream opened for reading and writing was last
30443 used for writing allows to draw conclusions about the content about the
30444 buffer, among other things.
30445 &lt;br&gt;&lt;br&gt; This function is declared in &lt;TT&gt;stdio_ext.h&lt;/TT&gt;.
30446 </synopsis>
30447 </function>
30448 </construct>
30449 <construct id="function-__fwriting" type="function">
30450 <function returntype="int">
30451 <prototype>
30452 <parameter content="FILE *stream"/>
30453 </prototype>
30454 <headers>
30455 <header filename = "stdio_ext.h"/>
30456 </headers>
30457 <synopsis>
30458 The &lt;CODE&gt;__fwriting&lt;/CODE&gt; function determines whether the stream
30459 &lt;VAR&gt;stream&lt;/VAR&gt; was last written to or whether it is opened write-only. In
30460 this case the return value is nonzero, otherwise it is zero.
30461 &lt;br&gt;&lt;br&gt; This function is declared in &lt;TT&gt;stdio_ext.h&lt;/TT&gt;.
30462 </synopsis>
30463 </function>
30464 </construct>
30465 <construct id="function-fclose" type="function">
30466 <function returntype="int">
30467 <prototype>
30468 <parameter content="FILE *stream"/>
30469 </prototype>
30470 <headers>
30471 <header filename = "stdio.h"/>
30472 </headers>
30473 <synopsis>
30474 This function causes &lt;VAR&gt;stream&lt;/VAR&gt; to be closed and the connection to
30475 the corresponding file to be broken. Any buffered output is written
30476 and any buffered input is discarded. The &lt;CODE&gt;fclose&lt;/CODE&gt; function returns
30477 a value of &lt;CODE&gt;0&lt;/CODE&gt; if the file was closed successfully, and &lt;CODE&gt;EOF&lt;/CODE&gt;
30478 if an error was detected.
30479 &lt;br&gt;&lt;br&gt; It is important to check for errors when you call &lt;CODE&gt;fclose&lt;/CODE&gt; to close
30480 an output stream, because real, everyday errors can be detected at this
30481 time. For example, when &lt;CODE&gt;fclose&lt;/CODE&gt; writes the remaining buffered
30482 output, it might get an error because the disk is full. Even if you
30483 know the buffer is empty, errors can still occur when closing a file if
30484 you are using NFS.
30485 &lt;br&gt;&lt;br&gt; The function &lt;CODE&gt;fclose&lt;/CODE&gt; is declared in &lt;TT&gt;stdio.h&lt;/TT&gt;.
30486 </synopsis>
30487 </function>
30488 </construct>
30489 <construct id="function-fcloseall" type="function">
30490 <function returntype="int">
30491 <prototype>
30492 <parameter content="void"/>
30493 </prototype>
30494 <headers>
30495 <header filename = "stdio.h"/>
30496 </headers>
30497 <synopsis>
30498 This function causes all open streams of the process to be closed and
30499 the connection to corresponding files to be broken. All buffered data
30500 is written and any buffered input is discarded. The &lt;CODE&gt;fcloseall&lt;/CODE&gt;
30501 function returns a value of &lt;CODE&gt;0&lt;/CODE&gt; if all the files were closed
30502 successfully, and &lt;CODE&gt;EOF&lt;/CODE&gt; if an error was detected.
30503 &lt;br&gt;&lt;br&gt; This function should be used only in special situations, e.g., when an
30504 error occurred and the program must be aborted. Normally each single
30505 stream should be closed separately so that problems with individual
30506 streams can be identified. It is also problematic since the standard
30507 streams will also be closed.
30508 &lt;br&gt;&lt;br&gt; The function &lt;CODE&gt;fcloseall&lt;/CODE&gt; is declared in &lt;TT&gt;stdio.h&lt;/TT&gt;.
30509 </synopsis>
30510 </function>
30511 </construct>
30512 <construct id="function-flockfile" type="function">
30513 <function returntype="void">
30514 <prototype>
30515 <parameter content="FILE *stream"/>
30516 </prototype>
30517 <headers>
30518 <header filename = "stdio.h"/>
30519 </headers>
30520 <synopsis>
30521 The &lt;CODE&gt;flockfile&lt;/CODE&gt; function acquires the internal locking object
30522 associated with the stream &lt;VAR&gt;stream&lt;/VAR&gt;. This ensures that no other
30523 thread can explicitly through &lt;CODE&gt;flockfile&lt;/CODE&gt;/&lt;CODE&gt;ftrylockfile&lt;/CODE&gt; or
30524 implicit through a call of a stream function lock the stream. The
30525 thread will block until the lock is acquired. An explicit call to
30526 &lt;CODE&gt;funlockfile&lt;/CODE&gt; has to be used to release the lock.
30527 </synopsis>
30528 </function>
30529 </construct>
30530 <construct id="function-ftrylockfile" type="function">
30531 <function returntype="int">
30532 <prototype>
30533 <parameter content="FILE *stream"/>
30534 </prototype>
30535 <headers>
30536 <header filename = "stdio.h"/>
30537 </headers>
30538 <synopsis>
30539 The &lt;CODE&gt;ftrylockfile&lt;/CODE&gt; function tries to acquire the internal locking
30540 object associated with the stream &lt;VAR&gt;stream&lt;/VAR&gt; just like
30541 &lt;CODE&gt;flockfile&lt;/CODE&gt;. But unlike &lt;CODE&gt;flockfile&lt;/CODE&gt; this function does not
30542 block if the lock is not available. &lt;CODE&gt;ftrylockfile&lt;/CODE&gt; returns zero if
30543 the lock was successfully acquired. Otherwise the stream is locked by
30544 another thread.
30545 </synopsis>
30546 </function>
30547 </construct>
30548 <construct id="function-funlockfile" type="function">
30549 <function returntype="void">
30550 <prototype>
30551 <parameter content="FILE *stream"/>
30552 </prototype>
30553 <headers>
30554 <header filename = "stdio.h"/>
30555 </headers>
30556 <synopsis>
30557 The &lt;CODE&gt;funlockfile&lt;/CODE&gt; function releases the internal locking object of
30558 the stream &lt;VAR&gt;stream&lt;/VAR&gt;. The stream must have been locked before by a
30559 call to &lt;CODE&gt;flockfile&lt;/CODE&gt; or a successful call of &lt;CODE&gt;ftrylockfile&lt;/CODE&gt;.
30560 The implicit locking performed by the stream operations do not count.
30561 The &lt;CODE&gt;funlockfile&lt;/CODE&gt; function does not return an error status and the
30562 behavior of a call for a stream which is not locked by the current
30563 thread is undefined.
30564 </synopsis>
30565 </function>
30566 </construct>
30567 <construct id="function-__fsetlocking" type="function">
30568 <function returntype="int">
30569 <prototype>
30570 <parameter content="FILE *stream"/>
30571 <parameter content="int type"/>
30572 </prototype>
30573 <headers>
30574 <header filename = "stdio_ext.h"/>
30575 </headers>
30576 <synopsis>
30577 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;__fsetlocking&lt;/CODE&gt; function can be used to select whether the
30578 stream operations will implicitly acquire the locking object of the
30579 stream &lt;VAR&gt;stream&lt;/VAR&gt;. By default this is done but it can be disabled and
30580 reinstated using this function. There are three values defined for the
30581 &lt;VAR&gt;type&lt;/VAR&gt; parameter.
30582 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
30583
30584 &lt;DT&gt;&lt;CODE&gt;FSETLOCKING_INTERNAL&lt;/CODE&gt;
30585 &lt;DD&gt;
30586 The stream &lt;CODE&gt;stream&lt;/CODE&gt; will from now on use the default internal
30587 locking. Every stream operation with exception of the &lt;CODE&gt;_unlocked&lt;/CODE&gt;
30588 variants will implicitly lock the stream.
30589 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;FSETLOCKING_BYCALLER&lt;/CODE&gt;
30590 &lt;DD&gt;
30591 After the &lt;CODE&gt;__fsetlocking&lt;/CODE&gt; function returns the user is responsible
30592 for locking the stream. None of the stream operations will implicitly
30593 do this anymore until the state is set back to
30594 &lt;CODE&gt;FSETLOCKING_INTERNAL&lt;/CODE&gt;.
30595 &lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;FSETLOCKING_QUERY&lt;/CODE&gt;
30596 &lt;DD&gt;
30597 &lt;CODE&gt;__fsetlocking&lt;/CODE&gt; only queries the current locking state of the
30598 stream. The return value will be &lt;CODE&gt;FSETLOCKING_INTERNAL&lt;/CODE&gt; or
30599 &lt;CODE&gt;FSETLOCKING_BYCALLER&lt;/CODE&gt; depending on the state.
30600 &lt;/DL&gt;
30601 &lt;br&gt;&lt;br&gt; The return value of &lt;CODE&gt;__fsetlocking&lt;/CODE&gt; is either
30602 &lt;CODE&gt;FSETLOCKING_INTERNAL&lt;/CODE&gt; or &lt;CODE&gt;FSETLOCKING_BYCALLER&lt;/CODE&gt; depending on
30603 the state of the stream before the call.
30604 &lt;br&gt;&lt;br&gt; This function and the values for the &lt;VAR&gt;type&lt;/VAR&gt; parameter are declared
30605 in &lt;TT&gt;stdio_ext.h&lt;/TT&gt;.
30606 </synopsis>
30607 </function>
30608 </construct>
30609 <construct id="function-fwide" type="function">
30610 <function returntype="int">
30611 <prototype>
30612 <parameter content="FILE *stream"/>
30613 <parameter content="int mode"/>
30614 </prototype>
30615 <headers>
30616 <header filename = "wchar.h"/>
30617 </headers>
30618 <synopsis>
30619 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;fwide&lt;/CODE&gt; function can be used to set and query the state of the
30620 orientation of the stream &lt;VAR&gt;stream&lt;/VAR&gt;. If the &lt;VAR&gt;mode&lt;/VAR&gt; parameter has
30621 a positive value the streams get wide oriented, for negative values
30622 narrow oriented. It is not possible to overwrite previous orientations
30623 with &lt;CODE&gt;fwide&lt;/CODE&gt;. I.e., if the stream &lt;VAR&gt;stream&lt;/VAR&gt; was already
30624 oriented before the call nothing is done.
30625 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;mode&lt;/VAR&gt; is zero the current orientation state is queried and
30626 nothing is changed.
30627 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;fwide&lt;/CODE&gt; function returns a negative value, zero, or a positive
30628 value if the stream is narrow, not at all, or wide oriented
30629 respectively.
30630 &lt;br&gt;&lt;br&gt; This function was introduced in Amendment 1 to ISO C90 and is
30631 declared in &lt;TT&gt;wchar.h&lt;/TT&gt;.
30632 </synopsis>
30633 </function>
30634 </construct>
30635 <construct id="function-fputc" type="function">
30636 <function returntype="int">
30637 <prototype>
30638 <parameter content="int c"/>
30639 <parameter content="FILE *stream"/>
30640 </prototype>
30641 <headers>
30642 <header filename = "stdio.h"/>
30643 </headers>
30644 <synopsis>
30645 The &lt;CODE&gt;fputc&lt;/CODE&gt; function converts the character &lt;VAR&gt;c&lt;/VAR&gt; to type
30646 &lt;CODE&gt;unsigned char&lt;/CODE&gt;, and writes it to the stream &lt;VAR&gt;stream&lt;/VAR&gt;.
30647 &lt;CODE&gt;EOF&lt;/CODE&gt; is returned if a write error occurs; otherwise the
30648 character &lt;VAR&gt;c&lt;/VAR&gt; is returned.
30649 </synopsis>
30650 </function>
30651 </construct>
30652 <construct id="function-fputwc" type="function">
30653 <function returntype="wint_t">
30654 <prototype>
30655 <parameter content="wchar_t wc"/>
30656 <parameter content="FILE *stream"/>
30657 </prototype>
30658 <headers>
30659 <header filename = "wchar.h"/>
30660 </headers>
30661 <synopsis>
30662 The &lt;CODE&gt;fputwc&lt;/CODE&gt; function writes the wide character &lt;VAR&gt;wc&lt;/VAR&gt; to the
30663 stream &lt;VAR&gt;stream&lt;/VAR&gt;. &lt;CODE&gt;WEOF&lt;/CODE&gt; is returned if a write error occurs;
30664 otherwise the character &lt;VAR&gt;wc&lt;/VAR&gt; is returned.
30665 </synopsis>
30666 </function>
30667 </construct>
30668 <construct id="function-fputc_unlocked" type="function">
30669 <function returntype="int">
30670 <prototype>
30671 <parameter content="int c"/>
30672 <parameter content="FILE *stream"/>
30673 </prototype>
30674 <headers>
30675 <header filename = "stdio.h"/>
30676 </headers>
30677 <synopsis>
30678 The &lt;CODE&gt;fputc_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;fputc&lt;/CODE&gt;
30679 function except that it does not implicitly lock the stream.
30680 </synopsis>
30681 </function>
30682 </construct>
30683 <construct id="function-fputwc_unlocked" type="function">
30684 <function returntype="wint_t">
30685 <prototype>
30686 <parameter content="wint_t wc"/>
30687 <parameter content="FILE *stream"/>
30688 </prototype>
30689 <headers>
30690 <header filename = "wchar.h"/>
30691 </headers>
30692 <synopsis>
30693 The &lt;CODE&gt;fputwc_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;fputwc&lt;/CODE&gt;
30694 function except that it does not implicitly lock the stream.
30695 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
30696 </synopsis>
30697 </function>
30698 </construct>
30699 <construct id="function-putc" type="function">
30700 <function returntype="int">
30701 <prototype>
30702 <parameter content="int c"/>
30703 <parameter content="FILE *stream"/>
30704 </prototype>
30705 <headers>
30706 <header filename = "stdio.h"/>
30707 </headers>
30708 <synopsis>
30709 This is just like &lt;CODE&gt;fputc&lt;/CODE&gt;, except that most systems implement it as
30710 a macro, making it faster. One consequence is that it may evaluate the
30711 &lt;VAR&gt;stream&lt;/VAR&gt; argument more than once, which is an exception to the
30712 general rule for macros. &lt;CODE&gt;putc&lt;/CODE&gt; is usually the best function to
30713 use for writing a single character.
30714 </synopsis>
30715 </function>
30716 </construct>
30717 <construct id="function-putwc" type="function">
30718 <function returntype="wint_t">
30719 <prototype>
30720 <parameter content="wchar_t wc"/>
30721 <parameter content="FILE *stream"/>
30722 </prototype>
30723 <headers>
30724 <header filename = "wchar.h"/>
30725 </headers>
30726 <synopsis>
30727 This is just like &lt;CODE&gt;fputwc&lt;/CODE&gt;, except that it can be implement as
30728 a macro, making it faster. One consequence is that it may evaluate the
30729 &lt;VAR&gt;stream&lt;/VAR&gt; argument more than once, which is an exception to the
30730 general rule for macros. &lt;CODE&gt;putwc&lt;/CODE&gt; is usually the best function to
30731 use for writing a single wide character.
30732 </synopsis>
30733 </function>
30734 </construct>
30735 <construct id="function-putc_unlocked" type="function">
30736 <function returntype="int">
30737 <prototype>
30738 <parameter content="int c"/>
30739 <parameter content="FILE *stream"/>
30740 </prototype>
30741 <headers>
30742 <header filename = "stdio.h"/>
30743 </headers>
30744 <synopsis>
30745 The &lt;CODE&gt;putc_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;putc&lt;/CODE&gt;
30746 function except that it does not implicitly lock the stream.
30747 </synopsis>
30748 </function>
30749 </construct>
30750 <construct id="function-putwc_unlocked" type="function">
30751 <function returntype="wint_t">
30752 <prototype>
30753 <parameter content="wchar_t wc"/>
30754 <parameter content="FILE *stream"/>
30755 </prototype>
30756 <headers>
30757 <header filename = "wchar.h"/>
30758 </headers>
30759 <synopsis>
30760 The &lt;CODE&gt;putwc_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;putwc&lt;/CODE&gt;
30761 function except that it does not implicitly lock the stream.
30762 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
30763 </synopsis>
30764 </function>
30765 </construct>
30766 <construct id="function-putchar" type="function">
30767 <function returntype="int">
30768 <prototype>
30769 <parameter content="int c"/>
30770 </prototype>
30771 <headers>
30772 <header filename = "stdio.h"/>
30773 </headers>
30774 <synopsis>
30775 The &lt;CODE&gt;putchar&lt;/CODE&gt; function is equivalent to &lt;CODE&gt;putc&lt;/CODE&gt; with
30776 &lt;CODE&gt;stdout&lt;/CODE&gt; as the value of the &lt;VAR&gt;stream&lt;/VAR&gt; argument.
30777 </synopsis>
30778 </function>
30779 </construct>
30780 <construct id="function-putwchar" type="function">
30781 <function returntype="wint_t">
30782 <prototype>
30783 <parameter content="wchar_t wc"/>
30784 </prototype>
30785 <headers>
30786 <header filename = "wchar.h"/>
30787 </headers>
30788 <synopsis>
30789 The &lt;CODE&gt;putwchar&lt;/CODE&gt; function is equivalent to &lt;CODE&gt;putwc&lt;/CODE&gt; with
30790 &lt;CODE&gt;stdout&lt;/CODE&gt; as the value of the &lt;VAR&gt;stream&lt;/VAR&gt; argument.
30791 </synopsis>
30792 </function>
30793 </construct>
30794 <construct id="function-putchar_unlocked" type="function">
30795 <function returntype="int">
30796 <prototype>
30797 <parameter content="int c"/>
30798 </prototype>
30799 <headers>
30800 <header filename = "stdio.h"/>
30801 </headers>
30802 <synopsis>
30803 The &lt;CODE&gt;putchar_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;putchar&lt;/CODE&gt;
30804 function except that it does not implicitly lock the stream.
30805 </synopsis>
30806 </function>
30807 </construct>
30808 <construct id="function-putwchar_unlocked" type="function">
30809 <function returntype="wint_t">
30810 <prototype>
30811 <parameter content="wchar_t wc"/>
30812 </prototype>
30813 <headers>
30814 <header filename = "wchar.h"/>
30815 </headers>
30816 <synopsis>
30817 The &lt;CODE&gt;putwchar_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;putwchar&lt;/CODE&gt;
30818 function except that it does not implicitly lock the stream.
30819 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
30820 </synopsis>
30821 </function>
30822 </construct>
30823 <construct id="function-fputs" type="function">
30824 <function returntype="int">
30825 <prototype>
30826 <parameter content="const char *s"/>
30827 <parameter content="FILE *stream"/>
30828 </prototype>
30829 <headers>
30830 <header filename = "stdio.h"/>
30831 </headers>
30832 <synopsis>
30833 The function &lt;CODE&gt;fputs&lt;/CODE&gt; writes the string &lt;VAR&gt;s&lt;/VAR&gt; to the stream
30834 &lt;VAR&gt;stream&lt;/VAR&gt;. The terminating null character is not written.
30835 This function does &lt;EM&gt;not&lt;/EM&gt; add a newline character, either.
30836 It outputs only the characters in the string.
30837 &lt;br&gt;&lt;br&gt; This function returns &lt;CODE&gt;EOF&lt;/CODE&gt; if a write error occurs, and otherwise
30838 a non-negative value.
30839 &lt;br&gt;&lt;br&gt; For example:
30840 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
30841 fputs ("Are ", stdout);&lt;br&gt;
30842 fputs ("you ", stdout);&lt;br&gt;
30843 fputs ("hungry?\n", stdout);&lt;br&gt;
30844 &lt;/pre&gt;
30845 &lt;br&gt;&lt;br&gt;
30846 outputs the text &lt;samp&gt;Are you hungry?&lt;/samp&gt; followed by a newline.
30847 </synopsis>
30848 </function>
30849 </construct>
30850 <construct id="function-fputws" type="function">
30851 <function returntype="int">
30852 <prototype>
30853 <parameter content="const wchar_t *ws"/>
30854 <parameter content="FILE *stream"/>
30855 </prototype>
30856 <headers>
30857 <header filename = "wchar.h"/>
30858 </headers>
30859 <synopsis>
30860 The function &lt;CODE&gt;fputws&lt;/CODE&gt; writes the wide character string &lt;VAR&gt;ws&lt;/VAR&gt; to
30861 the stream &lt;VAR&gt;stream&lt;/VAR&gt;. The terminating null character is not written.
30862 This function does &lt;EM&gt;not&lt;/EM&gt; add a newline character, either. It
30863 outputs only the characters in the string.
30864 &lt;br&gt;&lt;br&gt; This function returns &lt;CODE&gt;WEOF&lt;/CODE&gt; if a write error occurs, and otherwise
30865 a non-negative value.
30866 </synopsis>
30867 </function>
30868 </construct>
30869 <construct id="function-fputs_unlocked" type="function">
30870 <function returntype="int">
30871 <prototype>
30872 <parameter content="const char *s"/>
30873 <parameter content="FILE *stream"/>
30874 </prototype>
30875 <headers>
30876 <header filename = "stdio.h"/>
30877 </headers>
30878 <synopsis>
30879 The &lt;CODE&gt;fputs_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;fputs&lt;/CODE&gt;
30880 function except that it does not implicitly lock the stream.
30881 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
30882 </synopsis>
30883 </function>
30884 </construct>
30885 <construct id="function-fputws_unlocked" type="function">
30886 <function returntype="int">
30887 <prototype>
30888 <parameter content="const wchar_t *ws"/>
30889 <parameter content="FILE *stream"/>
30890 </prototype>
30891 <headers>
30892 <header filename = "wchar.h"/>
30893 </headers>
30894 <synopsis>
30895 The &lt;CODE&gt;fputws_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;fputws&lt;/CODE&gt;
30896 function except that it does not implicitly lock the stream.
30897 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
30898 </synopsis>
30899 </function>
30900 </construct>
30901 <construct id="function-puts" type="function">
30902 <function returntype="int">
30903 <prototype>
30904 <parameter content="const char *s"/>
30905 </prototype>
30906 <headers>
30907 <header filename = "stdio.h"/>
30908 </headers>
30909 <synopsis>
30910 The &lt;CODE&gt;puts&lt;/CODE&gt; function writes the string &lt;VAR&gt;s&lt;/VAR&gt; to the stream
30911 &lt;CODE&gt;stdout&lt;/CODE&gt; followed by a newline. The terminating null character of
30912 the string is not written. (Note that &lt;CODE&gt;fputs&lt;/CODE&gt; does &lt;EM&gt;not&lt;/EM&gt;
30913 write a newline as this function does.)
30914 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;puts&lt;/CODE&gt; is the most convenient function for printing simple
30915 messages. For example:
30916 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
30917 puts ("This is a message.");&lt;br&gt;
30918 &lt;/pre&gt;
30919 &lt;br&gt;&lt;br&gt;
30920 outputs the text &lt;samp&gt;This is a message.&lt;/samp&gt; followed by a newline.
30921 </synopsis>
30922 </function>
30923 </construct>
30924 <construct id="function-putw" type="function">
30925 <function returntype="int">
30926 <prototype>
30927 <parameter content="int w"/>
30928 <parameter content="FILE *stream"/>
30929 </prototype>
30930 <headers>
30931 <header filename = "stdio.h"/>
30932 </headers>
30933 <synopsis>
30934 This function writes the word &lt;VAR&gt;w&lt;/VAR&gt; (that is, an &lt;CODE&gt;int&lt;/CODE&gt;) to
30935 &lt;VAR&gt;stream&lt;/VAR&gt;. It is provided for compatibility with SVID, but we
30936 recommend you use &lt;CODE&gt;fwrite&lt;/CODE&gt; instead .
30937 </synopsis>
30938 </function>
30939 </construct>
30940 <construct id="function-fgetc" type="function">
30941 <function returntype="int">
30942 <prototype>
30943 <parameter content="FILE *stream"/>
30944 </prototype>
30945 <headers>
30946 <header filename = "stdio.h"/>
30947 </headers>
30948 <synopsis>
30949 This function reads the next character as an &lt;CODE&gt;unsigned char&lt;/CODE&gt; from
30950 the stream &lt;VAR&gt;stream&lt;/VAR&gt; and returns its value, converted to an
30951 &lt;CODE&gt;int&lt;/CODE&gt;. If an end-of-file condition or read error occurs,
30952 &lt;CODE&gt;EOF&lt;/CODE&gt; is returned instead.
30953 </synopsis>
30954 </function>
30955 </construct>
30956 <construct id="function-fgetwc" type="function">
30957 <function returntype="wint_t">
30958 <prototype>
30959 <parameter content="FILE *stream"/>
30960 </prototype>
30961 <headers>
30962 <header filename = "wchar.h"/>
30963 </headers>
30964 <synopsis>
30965 This function reads the next wide character from the stream &lt;VAR&gt;stream&lt;/VAR&gt;
30966 and returns its value. If an end-of-file condition or read error
30967 occurs, &lt;CODE&gt;WEOF&lt;/CODE&gt; is returned instead.
30968 </synopsis>
30969 </function>
30970 </construct>
30971 <construct id="function-fgetc_unlocked" type="function">
30972 <function returntype="int">
30973 <prototype>
30974 <parameter content="FILE *stream"/>
30975 </prototype>
30976 <headers>
30977 <header filename = "stdio.h"/>
30978 </headers>
30979 <synopsis>
30980 The &lt;CODE&gt;fgetc_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;fgetc&lt;/CODE&gt;
30981 function except that it does not implicitly lock the stream.
30982 </synopsis>
30983 </function>
30984 </construct>
30985 <construct id="function-fgetwc_unlocked" type="function">
30986 <function returntype="wint_t">
30987 <prototype>
30988 <parameter content="FILE *stream"/>
30989 </prototype>
30990 <headers>
30991 <header filename = "wchar.h"/>
30992 </headers>
30993 <synopsis>
30994 The &lt;CODE&gt;fgetwc_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;fgetwc&lt;/CODE&gt;
30995 function except that it does not implicitly lock the stream.
30996 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
30997 </synopsis>
30998 </function>
30999 </construct>
31000 <construct id="function-getc" type="function">
31001 <function returntype="int">
31002 <prototype>
31003 <parameter content="FILE *stream"/>
31004 </prototype>
31005 <headers>
31006 <header filename = "stdio.h"/>
31007 </headers>
31008 <synopsis>
31009 This is just like &lt;CODE&gt;fgetc&lt;/CODE&gt;, except that it is permissible (and
31010 typical) for it to be implemented as a macro that evaluates the
31011 &lt;VAR&gt;stream&lt;/VAR&gt; argument more than once. &lt;CODE&gt;getc&lt;/CODE&gt; is often highly
31012 optimized, so it is usually the best function to use to read a single
31013 character.
31014 </synopsis>
31015 </function>
31016 </construct>
31017 <construct id="function-getwc" type="function">
31018 <function returntype="wint_t">
31019 <prototype>
31020 <parameter content="FILE *stream"/>
31021 </prototype>
31022 <headers>
31023 <header filename = "wchar.h"/>
31024 </headers>
31025 <synopsis>
31026 This is just like &lt;CODE&gt;fgetwc&lt;/CODE&gt;, except that it is permissible for it to
31027 be implemented as a macro that evaluates the &lt;VAR&gt;stream&lt;/VAR&gt; argument more
31028 than once. &lt;CODE&gt;getwc&lt;/CODE&gt; can be highly optimized, so it is usually the
31029 best function to use to read a single wide character.
31030 </synopsis>
31031 </function>
31032 </construct>
31033 <construct id="function-getc_unlocked" type="function">
31034 <function returntype="int">
31035 <prototype>
31036 <parameter content="FILE *stream"/>
31037 </prototype>
31038 <headers>
31039 <header filename = "stdio.h"/>
31040 </headers>
31041 <synopsis>
31042 The &lt;CODE&gt;getc_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;getc&lt;/CODE&gt;
31043 function except that it does not implicitly lock the stream.
31044 </synopsis>
31045 </function>
31046 </construct>
31047 <construct id="function-getwc_unlocked" type="function">
31048 <function returntype="wint_t">
31049 <prototype>
31050 <parameter content="FILE *stream"/>
31051 </prototype>
31052 <headers>
31053 <header filename = "wchar.h"/>
31054 </headers>
31055 <synopsis>
31056 The &lt;CODE&gt;getwc_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;getwc&lt;/CODE&gt;
31057 function except that it does not implicitly lock the stream.
31058 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
31059 </synopsis>
31060 </function>
31061 </construct>
31062 <construct id="function-getchar" type="function">
31063 <function returntype="int">
31064 <prototype>
31065 <parameter content="void"/>
31066 </prototype>
31067 <headers>
31068 <header filename = "stdio.h"/>
31069 </headers>
31070 <synopsis>
31071 The &lt;CODE&gt;getchar&lt;/CODE&gt; function is equivalent to &lt;CODE&gt;getc&lt;/CODE&gt; with &lt;CODE&gt;stdin&lt;/CODE&gt;
31072 as the value of the &lt;VAR&gt;stream&lt;/VAR&gt; argument.
31073 </synopsis>
31074 </function>
31075 </construct>
31076 <construct id="function-getwchar" type="function">
31077 <function returntype="wint_t">
31078 <prototype>
31079 <parameter content="void"/>
31080 </prototype>
31081 <headers>
31082 <header filename = "wchar.h"/>
31083 </headers>
31084 <synopsis>
31085 The &lt;CODE&gt;getwchar&lt;/CODE&gt; function is equivalent to &lt;CODE&gt;getwc&lt;/CODE&gt; with &lt;CODE&gt;stdin&lt;/CODE&gt;
31086 as the value of the &lt;VAR&gt;stream&lt;/VAR&gt; argument.
31087 </synopsis>
31088 </function>
31089 </construct>
31090 <construct id="function-getchar_unlocked" type="function">
31091 <function returntype="int">
31092 <prototype>
31093 <parameter content="void"/>
31094 </prototype>
31095 <headers>
31096 <header filename = "stdio.h"/>
31097 </headers>
31098 <synopsis>
31099 The &lt;CODE&gt;getchar_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;getchar&lt;/CODE&gt;
31100 function except that it does not implicitly lock the stream.
31101 </synopsis>
31102 </function>
31103 </construct>
31104 <construct id="function-getwchar_unlocked" type="function">
31105 <function returntype="wint_t">
31106 <prototype>
31107 <parameter content="void"/>
31108 </prototype>
31109 <headers>
31110 <header filename = "wchar.h"/>
31111 </headers>
31112 <synopsis>
31113 The &lt;CODE&gt;getwchar_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;getwchar&lt;/CODE&gt;
31114 function except that it does not implicitly lock the stream.
31115 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
31116 </synopsis>
31117 </function>
31118 </construct>
31119 <construct id="function-getw" type="function">
31120 <function returntype="int">
31121 <prototype>
31122 <parameter content="FILE *stream"/>
31123 </prototype>
31124 <headers>
31125 <header filename = "stdio.h"/>
31126 </headers>
31127 <synopsis>
31128 This function reads a word (that is, an &lt;CODE&gt;int&lt;/CODE&gt;) from &lt;VAR&gt;stream&lt;/VAR&gt;.
31129 It's provided for compatibility with SVID. We recommend you use
31130 &lt;CODE&gt;fread&lt;/CODE&gt; instead. Unlike &lt;CODE&gt;getc&lt;/CODE&gt;,
31131 any &lt;CODE&gt;int&lt;/CODE&gt; value could be a valid result. &lt;CODE&gt;getw&lt;/CODE&gt; returns
31132 &lt;CODE&gt;EOF&lt;/CODE&gt; when it encounters end-of-file or an error, but there is no
31133 way to distinguish this from an input word with value -1.
31134 </synopsis>
31135 </function>
31136 </construct>
31137 <construct id="function-getline" type="function">
31138 <function returntype="ssize_t">
31139 <prototype>
31140 <parameter content="char **lineptr"/>
31141 <parameter content="size_t *n"/>
31142 <parameter content="FILE *stream"/>
31143 </prototype>
31144 <headers>
31145 <header filename = "stdio.h"/>
31146 </headers>
31147 <synopsis>
31148 This function reads an entire line from &lt;VAR&gt;stream&lt;/VAR&gt;, storing the text
31149 (including the newline and a terminating null character) in a buffer
31150 and storing the buffer address in &lt;CODE&gt;*&lt;VAR&gt;lineptr&lt;/VAR&gt;&lt;/CODE&gt;.
31151 &lt;br&gt;&lt;br&gt; Before calling &lt;CODE&gt;getline&lt;/CODE&gt;, you should place in &lt;CODE&gt;*&lt;VAR&gt;lineptr&lt;/VAR&gt;&lt;/CODE&gt;
31152 the address of a buffer &lt;CODE&gt;*&lt;VAR&gt;n&lt;/VAR&gt;&lt;/CODE&gt; bytes long, allocated with
31153 &lt;CODE&gt;malloc&lt;/CODE&gt;. If this buffer is long enough to hold the line,
31154 &lt;CODE&gt;getline&lt;/CODE&gt; stores the line in this buffer. Otherwise,
31155 &lt;CODE&gt;getline&lt;/CODE&gt; makes the buffer bigger using &lt;CODE&gt;realloc&lt;/CODE&gt;, storing the
31156 new buffer address back in &lt;CODE&gt;*&lt;VAR&gt;lineptr&lt;/VAR&gt;&lt;/CODE&gt; and the increased size
31157 back in &lt;CODE&gt;*&lt;VAR&gt;n&lt;/VAR&gt;&lt;/CODE&gt;.
31158 .
31159 &lt;br&gt;&lt;br&gt; If you set &lt;CODE&gt;*&lt;VAR&gt;lineptr&lt;/VAR&gt;&lt;/CODE&gt; to a null pointer, and &lt;CODE&gt;*&lt;VAR&gt;n&lt;/VAR&gt;&lt;/CODE&gt;
31160 to zero, before the call, then &lt;CODE&gt;getline&lt;/CODE&gt; allocates the initial
31161 buffer for you by calling &lt;CODE&gt;malloc&lt;/CODE&gt;.
31162 &lt;br&gt;&lt;br&gt; In either case, when &lt;CODE&gt;getline&lt;/CODE&gt; returns, &lt;CODE&gt;*&lt;VAR&gt;lineptr&lt;/VAR&gt;&lt;/CODE&gt; is
31163 a &lt;CODE&gt;char *&lt;/CODE&gt; which points to the text of the line.
31164 &lt;br&gt;&lt;br&gt; When &lt;CODE&gt;getline&lt;/CODE&gt; is successful, it returns the number of characters
31165 read (including the newline, but not including the terminating null).
31166 This value enables you to distinguish null characters that are part of
31167 the line from the null character inserted as a terminator.
31168 &lt;br&gt;&lt;br&gt; This function is a GNU extension, but it is the recommended way to read
31169 lines from a stream. The alternative standard functions are unreliable.
31170 &lt;br&gt;&lt;br&gt; If an error occurs or end of file is reached without any bytes read,
31171 &lt;CODE&gt;getline&lt;/CODE&gt; returns &lt;CODE&gt;-1&lt;/CODE&gt;.
31172 </synopsis>
31173 </function>
31174 </construct>
31175 <construct id="function-getdelim" type="function">
31176 <function returntype="ssize_t">
31177 <prototype>
31178 <parameter content="char **lineptr"/>
31179 <parameter content="size_t *n"/>
31180 <parameter content="int delimiter"/>
31181 <parameter content="FILE *stream"/>
31182 </prototype>
31183 <headers>
31184 <header filename = "stdio.h"/>
31185 </headers>
31186 <synopsis>
31187 This function is like &lt;CODE&gt;getline&lt;/CODE&gt; except that the character which
31188 tells it to stop reading is not necessarily newline. The argument
31189 &lt;VAR&gt;delimiter&lt;/VAR&gt; specifies the delimiter character; &lt;CODE&gt;getdelim&lt;/CODE&gt; keeps
31190 reading until it sees that character (or end of file).
31191 &lt;br&gt;&lt;br&gt; The text is stored in &lt;VAR&gt;lineptr&lt;/VAR&gt;, including the delimiter character
31192 and a terminating null. Like &lt;CODE&gt;getline&lt;/CODE&gt;, &lt;CODE&gt;getdelim&lt;/CODE&gt; makes
31193 &lt;VAR&gt;lineptr&lt;/VAR&gt; bigger if it isn't big enough.
31194 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;getline&lt;/CODE&gt; is in fact implemented in terms of &lt;CODE&gt;getdelim&lt;/CODE&gt;, just
31195 like this:
31196 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
31197 ssize_t&lt;br&gt;
31198 getline (char **lineptr, size_t *n, FILE *stream)&lt;br&gt;
31199 {&lt;br&gt;
31200 return getdelim (lineptr, n, '\n', stream);&lt;br&gt;
31201 }&lt;br&gt;
31202 &lt;/pre&gt;
31203 </synopsis>
31204 </function>
31205 </construct>
31206 <construct id="function-fgets" type="function">
31207 <function returntype="char *">
31208 <prototype>
31209 <parameter content="char *s"/>
31210 <parameter content="int count"/>
31211 <parameter content="FILE *stream"/>
31212 </prototype>
31213 <headers>
31214 <header filename = "stdio.h"/>
31215 </headers>
31216 <synopsis>
31217 The &lt;CODE&gt;fgets&lt;/CODE&gt; function reads characters from the stream &lt;VAR&gt;stream&lt;/VAR&gt;
31218 up to and including a newline character and stores them in the string
31219 &lt;VAR&gt;s&lt;/VAR&gt;, adding a null character to mark the end of the string. You
31220 must supply &lt;VAR&gt;count&lt;/VAR&gt; characters worth of space in &lt;VAR&gt;s&lt;/VAR&gt;, but the
31221 number of characters read is at most &lt;VAR&gt;count&lt;/VAR&gt; 1. The extra
31222 character space is used to hold the null character at the end of the
31223 string.
31224 &lt;br&gt;&lt;br&gt; If the system is already at end of file when you call &lt;CODE&gt;fgets&lt;/CODE&gt;, then
31225 the contents of the array &lt;VAR&gt;s&lt;/VAR&gt; are unchanged and a null pointer is
31226 returned. A null pointer is also returned if a read error occurs.
31227 Otherwise, the return value is the pointer &lt;VAR&gt;s&lt;/VAR&gt;.
31228 &lt;br&gt;&lt;br&gt; Warning: If the input data has a null character, you can't tell.
31229 So don't use &lt;CODE&gt;fgets&lt;/CODE&gt; unless you know the data cannot contain a null.
31230 Don't use it to read files edited by the user because, if the user inserts
31231 a null character, you should either handle it properly or print a clear
31232 error message. We recommend using &lt;CODE&gt;getline&lt;/CODE&gt; instead of &lt;CODE&gt;fgets&lt;/CODE&gt;.
31233 </synopsis>
31234 </function>
31235 </construct>
31236 <construct id="function-fgetws" type="function">
31237 <function returntype="wchar_t *">
31238 <prototype>
31239 <parameter content="wchar_t *ws"/>
31240 <parameter content="int count"/>
31241 <parameter content="FILE *stream"/>
31242 </prototype>
31243 <headers>
31244 <header filename = "wchar.h"/>
31245 </headers>
31246 <synopsis>
31247 The &lt;CODE&gt;fgetws&lt;/CODE&gt; function reads wide characters from the stream
31248 &lt;VAR&gt;stream&lt;/VAR&gt; up to and including a newline character and stores them in
31249 the string &lt;VAR&gt;ws&lt;/VAR&gt;, adding a null wide character to mark the end of the
31250 string. You must supply &lt;VAR&gt;count&lt;/VAR&gt; wide characters worth of space in
31251 &lt;VAR&gt;ws&lt;/VAR&gt;, but the number of characters read is at most &lt;VAR&gt;count&lt;/VAR&gt;
31252 1. The extra character space is used to hold the null wide
31253 character at the end of the string.
31254 &lt;br&gt;&lt;br&gt; If the system is already at end of file when you call &lt;CODE&gt;fgetws&lt;/CODE&gt;, then
31255 the contents of the array &lt;VAR&gt;ws&lt;/VAR&gt; are unchanged and a null pointer is
31256 returned. A null pointer is also returned if a read error occurs.
31257 Otherwise, the return value is the pointer &lt;VAR&gt;ws&lt;/VAR&gt;.
31258 &lt;br&gt;&lt;br&gt; Warning: If the input data has a null wide character (which are
31259 null bytes in the input stream), you can't tell. So don't use
31260 &lt;CODE&gt;fgetws&lt;/CODE&gt; unless you know the data cannot contain a null. Don't use
31261 it to read files edited by the user because, if the user inserts a null
31262 character, you should either handle it properly or print a clear error
31263 message.
31264 </synopsis>
31265 </function>
31266 </construct>
31267 <construct id="function-fgets_unlocked" type="function">
31268 <function returntype="char *">
31269 <prototype>
31270 <parameter content="char *s"/>
31271 <parameter content="int count"/>
31272 <parameter content="FILE *stream"/>
31273 </prototype>
31274 <headers>
31275 <header filename = "stdio.h"/>
31276 </headers>
31277 <synopsis>
31278 The &lt;CODE&gt;fgets_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;fgets&lt;/CODE&gt;
31279 function except that it does not implicitly lock the stream.
31280 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
31281 </synopsis>
31282 </function>
31283 </construct>
31284 <construct id="function-fgetws_unlocked" type="function">
31285 <function returntype="wchar_t *">
31286 <prototype>
31287 <parameter content="wchar_t *ws"/>
31288 <parameter content="int count"/>
31289 <parameter content="FILE *stream"/>
31290 </prototype>
31291 <headers>
31292 <header filename = "wchar.h"/>
31293 </headers>
31294 <synopsis>
31295 The &lt;CODE&gt;fgetws_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;fgetws&lt;/CODE&gt;
31296 function except that it does not implicitly lock the stream.
31297 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
31298 </synopsis>
31299 </function>
31300 </construct>
31301 <construct id="function-ungetc" type="function">
31302 <function returntype="int">
31303 <prototype>
31304 <parameter content="int c"/>
31305 <parameter content="FILE *stream"/>
31306 </prototype>
31307 <headers>
31308 <header filename = "stdio.h"/>
31309 </headers>
31310 <synopsis>
31311 The &lt;CODE&gt;ungetc&lt;/CODE&gt; function pushes back the character &lt;VAR&gt;c&lt;/VAR&gt; onto the
31312 input stream &lt;VAR&gt;stream&lt;/VAR&gt;. So the next input from &lt;VAR&gt;stream&lt;/VAR&gt; will
31313 read &lt;VAR&gt;c&lt;/VAR&gt; before anything else.
31314 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;c&lt;/VAR&gt; is &lt;CODE&gt;EOF&lt;/CODE&gt;, &lt;CODE&gt;ungetc&lt;/CODE&gt; does nothing and just returns
31315 &lt;CODE&gt;EOF&lt;/CODE&gt;. This lets you call &lt;CODE&gt;ungetc&lt;/CODE&gt; with the return value of
31316 &lt;CODE&gt;getc&lt;/CODE&gt; without needing to check for an error from &lt;CODE&gt;getc&lt;/CODE&gt;.
31317 &lt;br&gt;&lt;br&gt; The character that you push back doesn't have to be the same as the last
31318 character that was actually read from the stream. In fact, it isn't
31319 necessary to actually read any characters from the stream before
31320 unreading them with &lt;CODE&gt;ungetc&lt;/CODE&gt;! But that is a strange way to write a
31321 program; usually &lt;CODE&gt;ungetc&lt;/CODE&gt; is used only to unread a character that
31322 was just read from the same stream. The GNU C library supports this
31323 even on files opened in binary mode, but other systems might not.
31324 &lt;br&gt;&lt;br&gt; The GNU C library only supports one character of pushback---in other
31325 words, it does not work to call &lt;CODE&gt;ungetc&lt;/CODE&gt; twice without doing input
31326 in between. Other systems might let you push back multiple characters;
31327 then reading from the stream retrieves the characters in the reverse
31328 order that they were pushed.
31329 &lt;br&gt;&lt;br&gt; Pushing back characters doesn't alter the file; only the internal
31330 buffering for the stream is affected. If a file positioning function
31331 (such as &lt;CODE&gt;fseek&lt;/CODE&gt;, &lt;CODE&gt;fseeko&lt;/CODE&gt; or &lt;CODE&gt;rewind&lt;/CODE&gt;; ) is called, any pending pushed-back characters are
31332 discarded.
31333 &lt;br&gt;&lt;br&gt; Unreading a character on a stream that is at end of file clears the
31334 end-of-file indicator for the stream, because it makes the character of
31335 input available. After you read that character, trying to read again
31336 will encounter end of file.
31337 </synopsis>
31338 </function>
31339 </construct>
31340 <construct id="function-ungetwc" type="function">
31341 <function returntype="wint_t">
31342 <prototype>
31343 <parameter content="wint_t wc"/>
31344 <parameter content="FILE *stream"/>
31345 </prototype>
31346 <headers>
31347 <header filename = "wchar.h"/>
31348 </headers>
31349 <synopsis>
31350 The &lt;CODE&gt;ungetwc&lt;/CODE&gt; function behaves just like &lt;CODE&gt;ungetc&lt;/CODE&gt; just that it
31351 pushes back a wide character.
31352 </synopsis>
31353 </function>
31354 </construct>
31355 <construct id="function-fread" type="function">
31356 <function returntype="size_t">
31357 <prototype>
31358 <parameter content="void *data"/>
31359 <parameter content="size_t size"/>
31360 <parameter content="size_t count"/>
31361 <parameter content="FILE *stream"/>
31362 </prototype>
31363 <headers>
31364 <header filename = "stdio.h"/>
31365 </headers>
31366 <synopsis>
31367 This function reads up to &lt;VAR&gt;count&lt;/VAR&gt; objects of size &lt;VAR&gt;size&lt;/VAR&gt; into
31368 the array &lt;VAR&gt;data&lt;/VAR&gt;, from the stream &lt;VAR&gt;stream&lt;/VAR&gt;. It returns the
31369 number of objects actually read, which might be less than &lt;VAR&gt;count&lt;/VAR&gt; if
31370 a read error occurs or the end of the file is reached. This function
31371 returns a value of zero (and doesn't read anything) if either &lt;VAR&gt;size&lt;/VAR&gt;
31372 or &lt;VAR&gt;count&lt;/VAR&gt; is zero.
31373 &lt;br&gt;&lt;br&gt; If &lt;CODE&gt;fread&lt;/CODE&gt; encounters end of file in the middle of an object, it
31374 returns the number of complete objects read, and discards the partial
31375 object. Therefore, the stream remains at the actual end of the file.
31376 </synopsis>
31377 </function>
31378 </construct>
31379 <construct id="function-fread_unlocked" type="function">
31380 <function returntype="size_t">
31381 <prototype>
31382 <parameter content="void *data"/>
31383 <parameter content="size_t size"/>
31384 <parameter content="size_t count"/>
31385 <parameter content="FILE *stream"/>
31386 </prototype>
31387 <headers>
31388 <header filename = "stdio.h"/>
31389 </headers>
31390 <synopsis>
31391 The &lt;CODE&gt;fread_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;fread&lt;/CODE&gt;
31392 function except that it does not implicitly lock the stream.
31393 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
31394 </synopsis>
31395 </function>
31396 </construct>
31397 <construct id="function-fwrite" type="function">
31398 <function returntype="size_t">
31399 <prototype>
31400 <parameter content="const void *data"/>
31401 <parameter content="size_t size"/>
31402 <parameter content="size_t count"/>
31403 <parameter content="FILE *stream"/>
31404 </prototype>
31405 <headers>
31406 <header filename = "stdio.h"/>
31407 </headers>
31408 <synopsis>
31409 This function writes up to &lt;VAR&gt;count&lt;/VAR&gt; objects of size &lt;VAR&gt;size&lt;/VAR&gt; from
31410 the array &lt;VAR&gt;data&lt;/VAR&gt;, to the stream &lt;VAR&gt;stream&lt;/VAR&gt;. The return value is
31411 normally &lt;VAR&gt;count&lt;/VAR&gt;, if the call succeeds. Any other value indicates
31412 some sort of error, such as running out of space.
31413 </synopsis>
31414 </function>
31415 </construct>
31416 <construct id="function-fwrite_unlocked" type="function">
31417 <function returntype="size_t">
31418 <prototype>
31419 <parameter content="const void *data"/>
31420 <parameter content="size_t size"/>
31421 <parameter content="size_t count"/>
31422 <parameter content="FILE *stream"/>
31423 </prototype>
31424 <headers>
31425 <header filename = "stdio.h"/>
31426 </headers>
31427 <synopsis>
31428 The &lt;CODE&gt;fwrite_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;fwrite&lt;/CODE&gt;
31429 function except that it does not implicitly lock the stream.
31430 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
31431 </synopsis>
31432 </function>
31433 </construct>
31434 <construct id="function-printf" type="function">
31435 <function returntype="int">
31436 <prototype>
31437 <parameter content="const char *template"/>
31438 <parameter content="..."/>
31439 </prototype>
31440 <headers>
31441 <header filename = "stdio.h"/>
31442 </headers>
31443 <synopsis>
31444 The &lt;CODE&gt;printf&lt;/CODE&gt; function prints the optional arguments under the
31445 control of the template string &lt;VAR&gt;template&lt;/VAR&gt; to the stream
31446 &lt;CODE&gt;stdout&lt;/CODE&gt;. It returns the number of characters printed, or a
31447 negative value if there was an output error.
31448 </synopsis>
31449 </function>
31450 </construct>
31451 <construct id="function-wprintf" type="function">
31452 <function returntype="int">
31453 <prototype>
31454 <parameter content="const wchar_t *template"/>
31455 <parameter content="..."/>
31456 </prototype>
31457 <headers>
31458 <header filename = "wchar.h"/>
31459 </headers>
31460 <synopsis>
31461 The &lt;CODE&gt;wprintf&lt;/CODE&gt; function prints the optional arguments under the
31462 control of the wide template string &lt;VAR&gt;template&lt;/VAR&gt; to the stream
31463 &lt;CODE&gt;stdout&lt;/CODE&gt;. It returns the number of wide characters printed, or a
31464 negative value if there was an output error.
31465 </synopsis>
31466 </function>
31467 </construct>
31468 <construct id="function-fprintf" type="function">
31469 <function returntype="int">
31470 <prototype>
31471 <parameter content="FILE *stream"/>
31472 <parameter content="const char *template"/>
31473 <parameter content="..."/>
31474 </prototype>
31475 <headers>
31476 <header filename = "stdio.h"/>
31477 </headers>
31478 <synopsis>
31479 This function is just like &lt;CODE&gt;printf&lt;/CODE&gt;, except that the output is
31480 written to the stream &lt;VAR&gt;stream&lt;/VAR&gt; instead of &lt;CODE&gt;stdout&lt;/CODE&gt;.
31481 </synopsis>
31482 </function>
31483 </construct>
31484 <construct id="function-fwprintf" type="function">
31485 <function returntype="int">
31486 <prototype>
31487 <parameter content="FILE *stream"/>
31488 <parameter content="const wchar_t *template"/>
31489 <parameter content="..."/>
31490 </prototype>
31491 <headers>
31492 <header filename = "wchar.h"/>
31493 </headers>
31494 <synopsis>
31495 This function is just like &lt;CODE&gt;wprintf&lt;/CODE&gt;, except that the output is
31496 written to the stream &lt;VAR&gt;stream&lt;/VAR&gt; instead of &lt;CODE&gt;stdout&lt;/CODE&gt;.
31497 </synopsis>
31498 </function>
31499 </construct>
31500 <construct id="function-sprintf" type="function">
31501 <function returntype="int">
31502 <prototype>
31503 <parameter content="char *s"/>
31504 <parameter content="const char *template"/>
31505 <parameter content="..."/>
31506 </prototype>
31507 <headers>
31508 <header filename = "stdio.h"/>
31509 </headers>
31510 <synopsis>
31511 This is like &lt;CODE&gt;printf&lt;/CODE&gt;, except that the output is stored in the character
31512 array &lt;VAR&gt;s&lt;/VAR&gt; instead of written to a stream. A null character is written
31513 to mark the end of the string.
31514 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;sprintf&lt;/CODE&gt; function returns the number of characters stored in
31515 the array &lt;VAR&gt;s&lt;/VAR&gt;, not including the terminating null character.
31516 &lt;br&gt;&lt;br&gt; The behavior of this function is undefined if copying takes place
31517 between objects that overlap---for example, if &lt;VAR&gt;s&lt;/VAR&gt; is also given
31518 as an argument to be printed under control of the &lt;samp&gt;%s&lt;/samp&gt; conversion.
31519 .
31520 &lt;br&gt;&lt;br&gt; Warning: The &lt;CODE&gt;sprintf&lt;/CODE&gt; function can be &lt;h3&gt;dangerous&lt;/h3&gt;
31521 because it can potentially output more characters than can fit in the
31522 allocation size of the string &lt;VAR&gt;s&lt;/VAR&gt;. Remember that the field width
31523 given in a conversion specification is only a &lt;EM&gt;minimum&lt;/EM&gt; value.
31524 &lt;br&gt;&lt;br&gt; To avoid this problem, you can use &lt;CODE&gt;snprintf&lt;/CODE&gt; or &lt;CODE&gt;asprintf&lt;/CODE&gt;,
31525 described below.
31526 </synopsis>
31527 </function>
31528 </construct>
31529 <construct id="function-swprintf" type="function">
31530 <function returntype="int">
31531 <prototype>
31532 <parameter content="wchar_t *s"/>
31533 <parameter content="size_t size"/>
31534 <parameter content="const wchar_t *template"/>
31535 <parameter content="..."/>
31536 </prototype>
31537 <headers>
31538 <header filename = "wchar.h"/>
31539 </headers>
31540 <synopsis>
31541 This is like &lt;CODE&gt;wprintf&lt;/CODE&gt;, except that the output is stored in the
31542 wide character array &lt;VAR&gt;ws&lt;/VAR&gt; instead of written to a stream. A null
31543 wide character is written to mark the end of the string. The &lt;VAR&gt;size&lt;/VAR&gt;
31544 argument specifies the maximum number of characters to produce. The
31545 trailing null character is counted towards this limit, so you should
31546 allocate at least &lt;VAR&gt;size&lt;/VAR&gt; wide characters for the string &lt;VAR&gt;ws&lt;/VAR&gt;.
31547 &lt;br&gt;&lt;br&gt; The return value is the number of characters generated for the given
31548 input, excluding the trailing null. If not all output fits into the
31549 provided buffer a negative value is returned. You should try again with
31550 a bigger output string. &lt;EM&gt;Note:&lt;/EM&gt; this is different from how
31551 &lt;CODE&gt;snprintf&lt;/CODE&gt; handles this situation.
31552 &lt;br&gt;&lt;br&gt; Note that the corresponding narrow stream function takes fewer
31553 parameters. &lt;CODE&gt;swprintf&lt;/CODE&gt; in fact corresponds to the &lt;CODE&gt;snprintf&lt;/CODE&gt;
31554 function. Since the &lt;CODE&gt;sprintf&lt;/CODE&gt; function can be dangerous and should
31555 be avoided the ISO C committee refused to make the same mistake
31556 again and decided to not define an function exactly corresponding to
31557 &lt;CODE&gt;sprintf&lt;/CODE&gt;.
31558 </synopsis>
31559 </function>
31560 </construct>
31561 <construct id="function-snprintf" type="function">
31562 <function returntype="int">
31563 <prototype>
31564 <parameter content="char *s"/>
31565 <parameter content="size_t size"/>
31566 <parameter content="const char *template"/>
31567 <parameter content="..."/>
31568 </prototype>
31569 <headers>
31570 <header filename = "stdio.h"/>
31571 </headers>
31572 <synopsis>
31573 The &lt;CODE&gt;snprintf&lt;/CODE&gt; function is similar to &lt;CODE&gt;sprintf&lt;/CODE&gt;, except that
31574 the &lt;VAR&gt;size&lt;/VAR&gt; argument specifies the maximum number of characters to
31575 produce. The trailing null character is counted towards this limit, so
31576 you should allocate at least &lt;VAR&gt;size&lt;/VAR&gt; characters for the string &lt;VAR&gt;s&lt;/VAR&gt;.
31577 &lt;br&gt;&lt;br&gt; The return value is the number of characters which would be generated
31578 for the given input, excluding the trailing null. If this value is
31579 greater or equal to &lt;VAR&gt;size&lt;/VAR&gt;, not all characters from the result have
31580 been stored in &lt;VAR&gt;s&lt;/VAR&gt;. You should try again with a bigger output
31581 string. Here is an example of doing this:
31582 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
31583 &lt;br&gt;
31584 /* Construct a message describing the value of a variable&lt;br&gt;
31585 whose name is &lt;VAR&gt;name&lt;/VAR&gt; and whose value is &lt;VAR&gt;value&lt;/VAR&gt;. */&lt;br&gt;
31586 char *&lt;br&gt;
31587 make_message (char *name, char *value)&lt;br&gt;
31588 {&lt;br&gt;
31589 /* Guess we need no more than 100 chars of space. */&lt;br&gt;
31590 int size = 100;&lt;br&gt;
31591 char *buffer = (char *) xmalloc (size);&lt;br&gt;
31592 int nchars;&lt;br&gt;
31593 &lt;br&gt;
31594 &lt;br&gt;
31595 if (buffer == NULL)&lt;br&gt;
31596 return NULL;&lt;br&gt;
31597 &lt;br&gt;&lt;br&gt; /* Try to print in the allocated space. */&lt;br&gt;
31598 nchars = snprintf (buffer, size, "value of %s is %s",&lt;br&gt;
31599 name, value);&lt;br&gt;
31600 &lt;br&gt;
31601 &lt;br&gt;
31602 if (nchars &gt;= size)&lt;br&gt;
31603 {&lt;br&gt;
31604 /* Reallocate buffer now that we know&lt;br&gt;
31605 how much space is needed. */&lt;br&gt;
31606 size = nchars + 1;&lt;br&gt;
31607 buffer = (char *) xrealloc (buffer, size);&lt;br&gt;
31608 &lt;br&gt;&lt;br&gt; if (buffer != NULL)&lt;br&gt;
31609 /* Try again. */&lt;br&gt;
31610 snprintf (buffer, size, "value of %s is %s",&lt;br&gt;
31611 name, value);&lt;br&gt;
31612 }&lt;br&gt;
31613 /* The last call worked, return the string. */&lt;br&gt;
31614 return buffer;&lt;br&gt;
31615 }&lt;br&gt;
31616 &lt;br&gt;
31617 &lt;/pre&gt;
31618 &lt;br&gt;&lt;br&gt; In practice, it is often easier just to use &lt;CODE&gt;asprintf&lt;/CODE&gt;, below.
31619 &lt;br&gt;&lt;br&gt; Attention: In versions of the GNU C library prior to 2.1 the
31620 return value is the number of characters stored, not including the
31621 terminating null; unless there was not enough space in &lt;VAR&gt;s&lt;/VAR&gt; to
31622 store the result in which case &lt;CODE&gt;-1&lt;/CODE&gt; is returned. This was
31623 changed in order to comply with the ISO C99 standard.
31624 </synopsis>
31625 </function>
31626 </construct>
31627 <construct id="function-asprintf" type="function">
31628 <function returntype="int">
31629 <prototype>
31630 <parameter content="char **ptr"/>
31631 <parameter content="const char *template"/>
31632 <parameter content="..."/>
31633 </prototype>
31634 <headers>
31635 <header filename = "stdio.h"/>
31636 </headers>
31637 <synopsis>
31638 This function is similar to &lt;CODE&gt;sprintf&lt;/CODE&gt;, except that it dynamically
31639 allocates a string (as with &lt;CODE&gt;malloc&lt;/CODE&gt;; ) to hold the output, instead of putting the output in a
31640 buffer you allocate in advance. The &lt;VAR&gt;ptr&lt;/VAR&gt; argument should be the
31641 address of a &lt;CODE&gt;char *&lt;/CODE&gt; object, and a successful call to
31642 &lt;CODE&gt;asprintf&lt;/CODE&gt; stores a pointer to the newly allocated string at that
31643 location.
31644 &lt;br&gt;&lt;br&gt; The return value is the number of characters allocated for the buffer, or
31645 less than zero if an error occurred. Usually this means that the buffer
31646 could not be allocated.
31647 &lt;br&gt;&lt;br&gt; Here is how to use &lt;CODE&gt;asprintf&lt;/CODE&gt; to get the same result as the
31648 &lt;CODE&gt;snprintf&lt;/CODE&gt; example, but more easily:
31649 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
31650 /* Construct a message describing the value of a variable&lt;br&gt;
31651 whose name is &lt;VAR&gt;name&lt;/VAR&gt; and whose value is &lt;VAR&gt;value&lt;/VAR&gt;. */&lt;br&gt;
31652 char *&lt;br&gt;
31653 make_message (char *name, char *value)&lt;br&gt;
31654 {&lt;br&gt;
31655 char *result;&lt;br&gt;
31656 if (asprintf (&amp;result, "value of %s is %s", name, value) &lt; 0)&lt;br&gt;
31657 return NULL;&lt;br&gt;
31658 return result;&lt;br&gt;
31659 }&lt;br&gt;
31660 &lt;/pre&gt;
31661 </synopsis>
31662 </function>
31663 </construct>
31664 <construct id="function-obstack_printf" type="function">
31665 <function returntype="int">
31666 <prototype>
31667 <parameter content="struct obstack *obstack"/>
31668 <parameter content="const char *template"/>
31669 <parameter content="..."/>
31670 </prototype>
31671 <headers>
31672 <header filename = "stdio.h"/>
31673 </headers>
31674 <synopsis>
31675 This function is similar to &lt;CODE&gt;asprintf&lt;/CODE&gt;, except that it uses the
31676 obstack &lt;VAR&gt;obstack&lt;/VAR&gt; to allocate the space. .
31677 &lt;br&gt;&lt;br&gt; The characters are written onto the end of the current object.
31678 To get at them, you must finish the object with &lt;CODE&gt;obstack_finish&lt;/CODE&gt;
31679 .
31680 </synopsis>
31681 </function>
31682 </construct>
31683 <construct id="function-vprintf" type="function">
31684 <function returntype="int">
31685 <prototype>
31686 <parameter content="const char *template"/>
31687 <parameter content="va_list ap"/>
31688 </prototype>
31689 <headers>
31690 <header filename = "stdio.h"/>
31691 </headers>
31692 <synopsis>
31693 This function is similar to &lt;CODE&gt;printf&lt;/CODE&gt; except that, instead of taking
31694 a variable number of arguments directly, it takes an argument list
31695 pointer &lt;VAR&gt;ap&lt;/VAR&gt;.
31696 </synopsis>
31697 </function>
31698 </construct>
31699 <construct id="function-vwprintf" type="function">
31700 <function returntype="int">
31701 <prototype>
31702 <parameter content="const wchar_t *template"/>
31703 <parameter content="va_list ap"/>
31704 </prototype>
31705 <headers>
31706 <header filename = "wchar.h"/>
31707 </headers>
31708 <synopsis>
31709 This function is similar to &lt;CODE&gt;wprintf&lt;/CODE&gt; except that, instead of taking
31710 a variable number of arguments directly, it takes an argument list
31711 pointer &lt;VAR&gt;ap&lt;/VAR&gt;.
31712 </synopsis>
31713 </function>
31714 </construct>
31715 <construct id="function-vfprintf" type="function">
31716 <function returntype="int">
31717 <prototype>
31718 <parameter content="FILE *stream"/>
31719 <parameter content="const char *template"/>
31720 <parameter content="va_list ap"/>
31721 </prototype>
31722 <headers>
31723 <header filename = "stdio.h"/>
31724 </headers>
31725 <synopsis>
31726 This is the equivalent of &lt;CODE&gt;fprintf&lt;/CODE&gt; with the variable argument list
31727 specified directly as for &lt;CODE&gt;vprintf&lt;/CODE&gt;.
31728 </synopsis>
31729 </function>
31730 </construct>
31731 <construct id="function-vfwprintf" type="function">
31732 <function returntype="int">
31733 <prototype>
31734 <parameter content="FILE *stream"/>
31735 <parameter content="const wchar_t *template"/>
31736 <parameter content="va_list ap"/>
31737 </prototype>
31738 <headers>
31739 <header filename = "wchar.h"/>
31740 </headers>
31741 <synopsis>
31742 This is the equivalent of &lt;CODE&gt;fwprintf&lt;/CODE&gt; with the variable argument list
31743 specified directly as for &lt;CODE&gt;vwprintf&lt;/CODE&gt;.
31744 </synopsis>
31745 </function>
31746 </construct>
31747 <construct id="function-vsprintf" type="function">
31748 <function returntype="int">
31749 <prototype>
31750 <parameter content="char *s"/>
31751 <parameter content="const char *template"/>
31752 <parameter content="va_list ap"/>
31753 </prototype>
31754 <headers>
31755 <header filename = "stdio.h"/>
31756 </headers>
31757 <synopsis>
31758 This is the equivalent of &lt;CODE&gt;sprintf&lt;/CODE&gt; with the variable argument list
31759 specified directly as for &lt;CODE&gt;vprintf&lt;/CODE&gt;.
31760 </synopsis>
31761 </function>
31762 </construct>
31763 <construct id="function-vswprintf" type="function">
31764 <function returntype="int">
31765 <prototype>
31766 <parameter content="wchar_t *s"/>
31767 <parameter content="size_t size"/>
31768 <parameter content="const wchar_t *template"/>
31769 <parameter content="va_list ap"/>
31770 </prototype>
31771 <headers>
31772 <header filename = "wchar.h"/>
31773 </headers>
31774 <synopsis>
31775 This is the equivalent of &lt;CODE&gt;swprintf&lt;/CODE&gt; with the variable argument list
31776 specified directly as for &lt;CODE&gt;vwprintf&lt;/CODE&gt;.
31777 </synopsis>
31778 </function>
31779 </construct>
31780 <construct id="function-vsnprintf" type="function">
31781 <function returntype="int">
31782 <prototype>
31783 <parameter content="char *s"/>
31784 <parameter content="size_t size"/>
31785 <parameter content="const char *template"/>
31786 <parameter content="va_list ap"/>
31787 </prototype>
31788 <headers>
31789 <header filename = "stdio.h"/>
31790 </headers>
31791 <synopsis>
31792 This is the equivalent of &lt;CODE&gt;snprintf&lt;/CODE&gt; with the variable argument list
31793 specified directly as for &lt;CODE&gt;vprintf&lt;/CODE&gt;.
31794 </synopsis>
31795 </function>
31796 </construct>
31797 <construct id="function-vasprintf" type="function">
31798 <function returntype="int">
31799 <prototype>
31800 <parameter content="char **ptr"/>
31801 <parameter content="const char *template"/>
31802 <parameter content="va_list ap"/>
31803 </prototype>
31804 <headers>
31805 <header filename = "stdio.h"/>
31806 </headers>
31807 <synopsis>
31808 The &lt;CODE&gt;vasprintf&lt;/CODE&gt; function is the equivalent of &lt;CODE&gt;asprintf&lt;/CODE&gt; with the
31809 variable argument list specified directly as for &lt;CODE&gt;vprintf&lt;/CODE&gt;.
31810 </synopsis>
31811 </function>
31812 </construct>
31813 <construct id="function-obstack_vprintf" type="function">
31814 <function returntype="int">
31815 <prototype>
31816 <parameter content="struct obstack *obstack"/>
31817 <parameter content="const char *template"/>
31818 <parameter content="va_list ap"/>
31819 </prototype>
31820 <headers>
31821 <header filename = "stdio.h"/>
31822 </headers>
31823 <synopsis>
31824 The &lt;CODE&gt;obstack_vprintf&lt;/CODE&gt; function is the equivalent of
31825 &lt;CODE&gt;obstack_printf&lt;/CODE&gt; with the variable argument list specified directly
31826 as for &lt;CODE&gt;vprintf&lt;/CODE&gt;.
31827 </synopsis>
31828 </function>
31829 </construct>
31830 <construct id="function-parse_printf_format" type="function">
31831 <function returntype="size_t">
31832 <prototype>
31833 <parameter content="const char *template"/>
31834 <parameter content="size_t n"/>
31835 <parameter content="int *argtypes"/>
31836 </prototype>
31837 <headers>
31838 <header filename = "printf.h"/>
31839 </headers>
31840 <synopsis>
31841 This function returns information about the number and types of
31842 arguments expected by the &lt;CODE&gt;printf&lt;/CODE&gt; template string &lt;VAR&gt;template&lt;/VAR&gt;.
31843 The information is stored in the array &lt;VAR&gt;argtypes&lt;/VAR&gt;; each element of
31844 this array describes one argument. This information is encoded using
31845 the various &lt;samp&gt;PA_&lt;/samp&gt; macros, listed below.
31846 &lt;br&gt;&lt;br&gt; The argument &lt;VAR&gt;n&lt;/VAR&gt; specifies the number of elements in the array
31847 &lt;VAR&gt;argtypes&lt;/VAR&gt;. This is the maximum number of elements that
31848 &lt;CODE&gt;parse_printf_format&lt;/CODE&gt; will try to write.
31849 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;parse_printf_format&lt;/CODE&gt; returns the total number of arguments required
31850 by &lt;VAR&gt;template&lt;/VAR&gt;. If this number is greater than &lt;VAR&gt;n&lt;/VAR&gt;, then the
31851 information returned describes only the first &lt;VAR&gt;n&lt;/VAR&gt; arguments. If you
31852 want information about additional arguments, allocate a bigger
31853 array and call &lt;CODE&gt;parse_printf_format&lt;/CODE&gt; again.
31854 </synopsis>
31855 </function>
31856 </construct>
31857 <construct id="function-register_printf_function" type="function">
31858 <function returntype="int">
31859 <prototype>
31860 <parameter content="int spec"/>
31861 <parameter content="printf_function handler-function"/>
31862 <parameter content="printf_arginfo_function arginfo-function"/>
31863 </prototype>
31864 <headers>
31865 <header filename = "printf.h"/>
31866 </headers>
31867 <synopsis>
31868 This function defines the conversion specifier character &lt;VAR&gt;spec&lt;/VAR&gt;.
31869 Thus, if &lt;VAR&gt;spec&lt;/VAR&gt; is &lt;CODE&gt;'Y'&lt;/CODE&gt;, it defines the conversion &lt;samp&gt;%Y&lt;/samp&gt;.
31870 You can redefine the built-in conversions like &lt;samp&gt;%s&lt;/samp&gt;, but flag
31871 characters like &lt;samp&gt;#&lt;/samp&gt; and type modifiers like &lt;samp&gt;l&lt;/samp&gt; can never be
31872 used as conversions; calling &lt;CODE&gt;register_printf_function&lt;/CODE&gt; for those
31873 characters has no effect. It is advisable not to use lowercase letters,
31874 since the ISO C standard warns that additional lowercase letters may be
31875 standardized in future editions of the standard.
31876 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;handler-function&lt;/VAR&gt; is the function called by &lt;CODE&gt;printf&lt;/CODE&gt; and
31877 friends when this conversion appears in a template string.
31878 , for information about how to define
31879 a function to pass as this argument. If you specify a null pointer, any
31880 existing handler function for &lt;VAR&gt;spec&lt;/VAR&gt; is removed.
31881 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;arginfo-function&lt;/VAR&gt; is the function called by
31882 &lt;CODE&gt;parse_printf_format&lt;/CODE&gt; when this conversion appears in a
31883 template string. , for information
31884 about this.
31885 &lt;br&gt;&lt;br&gt;
31886 &lt;br&gt;&lt;br&gt; Attention: In the GNU C library versions before 2.0 the
31887 &lt;VAR&gt;arginfo-function&lt;/VAR&gt; function did not need to be installed unless
31888 the user used the &lt;CODE&gt;parse_printf_format&lt;/CODE&gt; function. This has changed.
31889 Now a call to any of the &lt;CODE&gt;printf&lt;/CODE&gt; functions will call this
31890 function when this format specifier appears in the format string.
31891 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success, and &lt;CODE&gt;-1&lt;/CODE&gt; on failure
31892 (which occurs if &lt;VAR&gt;spec&lt;/VAR&gt; is out of range).
31893 &lt;br&gt;&lt;br&gt; You can redefine the standard output conversions, but this is probably
31894 not a good idea because of the potential for confusion. Library routines
31895 written by other people could break if you do this.
31896 </synopsis>
31897 </function>
31898 </construct>
31899 <construct id="struct-printf_info" type="struct">
31900 <structure>
31901 <synopsis>
31902 This structure is used to pass information about the options appearing
31903 in an instance of a conversion specifier in a &lt;CODE&gt;printf&lt;/CODE&gt; template
31904 string to the handler and arginfo functions for that specifier. It
31905 contains the following members:
31906 &lt;br&gt;&lt;br&gt;
31907 </synopsis>
31908 <elements>
31909 <element content="int prec">
31910 <synopsis>
31911 This is the precision specified. The value is &lt;CODE&gt;-1&lt;/CODE&gt; if no precision
31912 was specified. If the precision was given as &lt;samp&gt;*&lt;/samp&gt;, the
31913 &lt;CODE&gt;printf_info&lt;/CODE&gt; structure passed to the handler function contains the
31914 actual value retrieved from the argument list. But the structure passed
31915 to the arginfo function contains a value of &lt;CODE&gt;INT_MIN&lt;/CODE&gt;, since the
31916 actual value is not known.
31917 &lt;br&gt;&lt;br&gt;
31918 </synopsis>
31919 </element>
31920 <element content="int width">
31921 <synopsis>
31922 This is the minimum field width specified. The value is &lt;CODE&gt;0&lt;/CODE&gt; if no
31923 width was specified. If the field width was given as &lt;samp&gt;*&lt;/samp&gt;, the
31924 &lt;CODE&gt;printf_info&lt;/CODE&gt; structure passed to the handler function contains the
31925 actual value retrieved from the argument list. But the structure passed
31926 to the arginfo function contains a value of &lt;CODE&gt;INT_MIN&lt;/CODE&gt;, since the
31927 actual value is not known.
31928 &lt;br&gt;&lt;br&gt;
31929 </synopsis>
31930 </element>
31931 <element content="wchar_t spec">
31932 <synopsis>
31933 This is the conversion specifier character specified. It's stored in
31934 the structure so that you can register the same handler function for
31935 multiple characters, but still have a way to tell them apart when the
31936 handler function is called.
31937 &lt;br&gt;&lt;br&gt;
31938 </synopsis>
31939 </element>
31940 <element content="unsigned int is_long_double">
31941 <synopsis>
31942 This is a boolean that is true if the &lt;samp&gt;L&lt;/samp&gt;, &lt;samp&gt;ll&lt;/samp&gt;, or &lt;samp&gt;q&lt;/samp&gt;
31943 type modifier was specified. For integer conversions, this indicates
31944 &lt;CODE&gt;long long int&lt;/CODE&gt;, as opposed to &lt;CODE&gt;long double&lt;/CODE&gt; for floating
31945 point conversions.
31946 &lt;br&gt;&lt;br&gt;
31947 </synopsis>
31948 </element>
31949 <element content="unsigned int is_char">
31950 <synopsis>
31951 This is a boolean that is true if the &lt;samp&gt;hh&lt;/samp&gt; type modifier was specified.
31952 &lt;br&gt;&lt;br&gt;
31953 </synopsis>
31954 </element>
31955 <element content="unsigned int is_short">
31956 <synopsis>
31957 This is a boolean that is true if the &lt;samp&gt;h&lt;/samp&gt; type modifier was specified.
31958 &lt;br&gt;&lt;br&gt;
31959 </synopsis>
31960 </element>
31961 <element content="unsigned int is_long">
31962 <synopsis>
31963 This is a boolean that is true if the &lt;samp&gt;l&lt;/samp&gt; type modifier was specified.
31964 &lt;br&gt;&lt;br&gt;
31965 </synopsis>
31966 </element>
31967 <element content="unsigned int alt">
31968 <synopsis>
31969 This is a boolean that is true if the &lt;samp&gt;#&lt;/samp&gt; flag was specified.
31970 &lt;br&gt;&lt;br&gt;
31971 </synopsis>
31972 </element>
31973 <element content="unsigned int space">
31974 <synopsis>
31975 This is a boolean that is true if the &lt;samp&gt; &lt;/samp&gt; flag was specified.
31976 &lt;br&gt;&lt;br&gt;
31977 </synopsis>
31978 </element>
31979 <element content="unsigned int left">
31980 <synopsis>
31981 This is a boolean that is true if the &lt;samp&gt;-&lt;/samp&gt; flag was specified.
31982 &lt;br&gt;&lt;br&gt;
31983 </synopsis>
31984 </element>
31985 <element content="unsigned int showsign">
31986 <synopsis>
31987 This is a boolean that is true if the &lt;samp&gt;+&lt;/samp&gt; flag was specified.
31988 &lt;br&gt;&lt;br&gt;
31989 </synopsis>
31990 </element>
31991 <element content="unsigned int group">
31992 <synopsis>
31993 This is a boolean that is true if the &lt;samp&gt;'&lt;/samp&gt; flag was specified.
31994 &lt;br&gt;&lt;br&gt;
31995 </synopsis>
31996 </element>
31997 <element content="unsigned int extra">
31998 <synopsis>
31999 This flag has a special meaning depending on the context. It could
32000 be used freely by the user-defined handlers but when called from
32001 the &lt;CODE&gt;printf&lt;/CODE&gt; function this variable always contains the value
32002 &lt;CODE&gt;0&lt;/CODE&gt;.
32003 &lt;br&gt;&lt;br&gt;
32004 </synopsis>
32005 </element>
32006 <element content="unsigned int wide">
32007 <synopsis>
32008 This flag is set if the stream is wide oriented.
32009 &lt;br&gt;&lt;br&gt;
32010 </synopsis>
32011 </element>
32012 </elements>
32013 </structure>
32014 </construct>
32015 <construct id="dtype-printf_function" type="dtype">
32016 <structure>
32017 </structure>
32018 </construct>
32019 <construct id="dtype-printf_arginfo_function" type="dtype">
32020 <structure>
32021 </structure>
32022 </construct>
32023 <construct id="function-printf_size" type="function">
32024 <function returntype="int">
32025 <prototype>
32026 <parameter content="FILE *fp"/>
32027 <parameter content="const struct printf_info *info"/>
32028 <parameter content="const void *const *args"/>
32029 </prototype>
32030 <headers>
32031 <header filename = "printf.h"/>
32032 </headers>
32033 <synopsis>
32034 Print a given floating point number as for the format &lt;CODE&gt;%f&lt;/CODE&gt; except
32035 that there is a postfix character indicating the divisor for the
32036 number to make this less than 1000. There are two possible divisors:
32037 powers of 1024 or powers of 1000. Which one is used depends on the
32038 format character specified while registered this handler. If the
32039 character is of lower case, 1024 is used. For upper case characters,
32040 1000 is used.
32041 &lt;br&gt;&lt;br&gt; The postfix tag corresponds to bytes, kilobytes, megabytes, gigabytes,
32042 etc. The full table is:
32043 &lt;br&gt;&lt;br&gt;
32044 &lt;DL&gt;
32045 &lt;DT&gt;&lt;pre&gt;low Multiplier From Upper Multiplier&lt;/pre&gt;
32046 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;' ' 1 ' ' 1&lt;/pre&gt;
32047 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;k 2^10 (1024) kilo K 10^3 (1000)&lt;/pre&gt;
32048 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;m 2^20 mega M 10^6&lt;/pre&gt;
32049 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;g 2^30 giga G 10^9&lt;/pre&gt;
32050 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;t 2^40 tera T 10^12&lt;/pre&gt;
32051 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;p 2^50 peta P 10^15&lt;/pre&gt;
32052 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;e 2^60 exa E 10^18&lt;/pre&gt;
32053 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;z 2^70 zetta Z 10^21&lt;/pre&gt;
32054 &lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;y 2^80 yotta Y 10^24&lt;/pre&gt;
32055 &lt;DD&gt;&lt;br&gt; &lt;/DL&gt;
32056
32057
32058 &lt;br&gt;&lt;br&gt; The default precision is 3, i.e., 1024 is printed with a lower-case
32059 format character as if it were &lt;CODE&gt;%.3fk&lt;/CODE&gt; and will yield &lt;CODE&gt;1.000k&lt;/CODE&gt;.
32060 </synopsis>
32061 </function>
32062 </construct>
32063 <construct id="function-printf_size_info" type="function">
32064 <function returntype="int">
32065 <prototype>
32066 <parameter content="const struct printf_info *info"/>
32067 <parameter content="size_t n"/>
32068 <parameter content="int *argtypes"/>
32069 </prototype>
32070 <headers>
32071 <header filename = "printf.h"/>
32072 </headers>
32073 <synopsis>
32074 This function will return in &lt;VAR&gt;argtypes&lt;/VAR&gt; the information about the
32075 used parameters in the way the &lt;CODE&gt;vfprintf&lt;/CODE&gt; implementation expects
32076 it. The format always takes one argument.
32077 </synopsis>
32078 </function>
32079 </construct>
32080 <construct id="function-scanf" type="function">
32081 <function returntype="int">
32082 <prototype>
32083 <parameter content="const char *template"/>
32084 <parameter content="..."/>
32085 </prototype>
32086 <headers>
32087 <header filename = "stdio.h"/>
32088 </headers>
32089 <synopsis>
32090 The &lt;CODE&gt;scanf&lt;/CODE&gt; function reads formatted input from the stream
32091 &lt;CODE&gt;stdin&lt;/CODE&gt; under the control of the template string &lt;VAR&gt;template&lt;/VAR&gt;.
32092 The optional arguments are pointers to the places which receive the
32093 resulting values.
32094 &lt;br&gt;&lt;br&gt; The return value is normally the number of successful assignments. If
32095 an end-of-file condition is detected before any matches are performed,
32096 including matches against whitespace and literal characters in the
32097 template, then &lt;CODE&gt;EOF&lt;/CODE&gt; is returned.
32098 </synopsis>
32099 </function>
32100 </construct>
32101 <construct id="function-wscanf" type="function">
32102 <function returntype="int">
32103 <prototype>
32104 <parameter content="const wchar_t *template"/>
32105 <parameter content="..."/>
32106 </prototype>
32107 <headers>
32108 <header filename = "wchar.h"/>
32109 </headers>
32110 <synopsis>
32111 The &lt;CODE&gt;wscanf&lt;/CODE&gt; function reads formatted input from the stream
32112 &lt;CODE&gt;stdin&lt;/CODE&gt; under the control of the template string &lt;VAR&gt;template&lt;/VAR&gt;.
32113 The optional arguments are pointers to the places which receive the
32114 resulting values.
32115 &lt;br&gt;&lt;br&gt; The return value is normally the number of successful assignments. If
32116 an end-of-file condition is detected before any matches are performed,
32117 including matches against whitespace and literal characters in the
32118 template, then &lt;CODE&gt;WEOF&lt;/CODE&gt; is returned.
32119 </synopsis>
32120 </function>
32121 </construct>
32122 <construct id="function-fscanf" type="function">
32123 <function returntype="int">
32124 <prototype>
32125 <parameter content="FILE *stream"/>
32126 <parameter content="const char *template"/>
32127 <parameter content="..."/>
32128 </prototype>
32129 <headers>
32130 <header filename = "stdio.h"/>
32131 </headers>
32132 <synopsis>
32133 This function is just like &lt;CODE&gt;scanf&lt;/CODE&gt;, except that the input is read
32134 from the stream &lt;VAR&gt;stream&lt;/VAR&gt; instead of &lt;CODE&gt;stdin&lt;/CODE&gt;.
32135 </synopsis>
32136 </function>
32137 </construct>
32138 <construct id="function-fwscanf" type="function">
32139 <function returntype="int">
32140 <prototype>
32141 <parameter content="FILE *stream"/>
32142 <parameter content="const wchar_t *template"/>
32143 <parameter content="..."/>
32144 </prototype>
32145 <headers>
32146 <header filename = "wchar.h"/>
32147 </headers>
32148 <synopsis>
32149 This function is just like &lt;CODE&gt;wscanf&lt;/CODE&gt;, except that the input is read
32150 from the stream &lt;VAR&gt;stream&lt;/VAR&gt; instead of &lt;CODE&gt;stdin&lt;/CODE&gt;.
32151 </synopsis>
32152 </function>
32153 </construct>
32154 <construct id="function-sscanf" type="function">
32155 <function returntype="int">
32156 <prototype>
32157 <parameter content="const char *s"/>
32158 <parameter content="const char *template"/>
32159 <parameter content="..."/>
32160 </prototype>
32161 <headers>
32162 <header filename = "stdio.h"/>
32163 </headers>
32164 <synopsis>
32165 This is like &lt;CODE&gt;scanf&lt;/CODE&gt;, except that the characters are taken from the
32166 null-terminated string &lt;VAR&gt;s&lt;/VAR&gt; instead of from a stream. Reaching the
32167 end of the string is treated as an end-of-file condition.
32168 &lt;br&gt;&lt;br&gt; The behavior of this function is undefined if copying takes place
32169 between objects that overlap---for example, if &lt;VAR&gt;s&lt;/VAR&gt; is also given
32170 as an argument to receive a string read under control of the &lt;samp&gt;%s&lt;/samp&gt;,
32171 &lt;samp&gt;%S&lt;/samp&gt;, or &lt;samp&gt;%[&lt;/samp&gt; conversion.
32172 </synopsis>
32173 </function>
32174 </construct>
32175 <construct id="function-swscanf" type="function">
32176 <function returntype="int">
32177 <prototype>
32178 <parameter content="const wchar_t *ws"/>
32179 <parameter content="const char *template"/>
32180 <parameter content="..."/>
32181 </prototype>
32182 <headers>
32183 <header filename = "wchar.h"/>
32184 </headers>
32185 <synopsis>
32186 This is like &lt;CODE&gt;wscanf&lt;/CODE&gt;, except that the characters are taken from the
32187 null-terminated string &lt;VAR&gt;ws&lt;/VAR&gt; instead of from a stream. Reaching the
32188 end of the string is treated as an end-of-file condition.
32189 &lt;br&gt;&lt;br&gt; The behavior of this function is undefined if copying takes place
32190 between objects that overlap---for example, if &lt;VAR&gt;ws&lt;/VAR&gt; is also given as
32191 an argument to receive a string read under control of the &lt;samp&gt;%s&lt;/samp&gt;,
32192 &lt;samp&gt;%S&lt;/samp&gt;, or &lt;samp&gt;%[&lt;/samp&gt; conversion.
32193 </synopsis>
32194 </function>
32195 </construct>
32196 <construct id="function-vscanf" type="function">
32197 <function returntype="int">
32198 <prototype>
32199 <parameter content="const char *template"/>
32200 <parameter content="va_list ap"/>
32201 </prototype>
32202 <headers>
32203 <header filename = "stdio.h"/>
32204 </headers>
32205 <synopsis>
32206 This function is similar to &lt;CODE&gt;scanf&lt;/CODE&gt;, but instead of taking
32207 a variable number of arguments directly, it takes an argument list
32208 pointer &lt;VAR&gt;ap&lt;/VAR&gt; of type &lt;CODE&gt;va_list&lt;/CODE&gt; .
32209 </synopsis>
32210 </function>
32211 </construct>
32212 <construct id="function-vwscanf" type="function">
32213 <function returntype="int">
32214 <prototype>
32215 <parameter content="const wchar_t *template"/>
32216 <parameter content="va_list ap"/>
32217 </prototype>
32218 <headers>
32219 <header filename = "wchar.h"/>
32220 </headers>
32221 <synopsis>
32222 This function is similar to &lt;CODE&gt;wscanf&lt;/CODE&gt;, but instead of taking
32223 a variable number of arguments directly, it takes an argument list
32224 pointer &lt;VAR&gt;ap&lt;/VAR&gt; of type &lt;CODE&gt;va_list&lt;/CODE&gt; .
32225 </synopsis>
32226 </function>
32227 </construct>
32228 <construct id="function-vfscanf" type="function">
32229 <function returntype="int">
32230 <prototype>
32231 <parameter content="FILE *stream"/>
32232 <parameter content="const char *template"/>
32233 <parameter content="va_list ap"/>
32234 </prototype>
32235 <headers>
32236 <header filename = "stdio.h"/>
32237 </headers>
32238 <synopsis>
32239 This is the equivalent of &lt;CODE&gt;fscanf&lt;/CODE&gt; with the variable argument list
32240 specified directly as for &lt;CODE&gt;vscanf&lt;/CODE&gt;.
32241 </synopsis>
32242 </function>
32243 </construct>
32244 <construct id="function-vfwscanf" type="function">
32245 <function returntype="int">
32246 <prototype>
32247 <parameter content="FILE *stream"/>
32248 <parameter content="const wchar_t *template"/>
32249 <parameter content="va_list ap"/>
32250 </prototype>
32251 <headers>
32252 <header filename = "wchar.h"/>
32253 </headers>
32254 <synopsis>
32255 This is the equivalent of &lt;CODE&gt;fwscanf&lt;/CODE&gt; with the variable argument list
32256 specified directly as for &lt;CODE&gt;vwscanf&lt;/CODE&gt;.
32257 </synopsis>
32258 </function>
32259 </construct>
32260 <construct id="function-vsscanf" type="function">
32261 <function returntype="int">
32262 <prototype>
32263 <parameter content="const char *s"/>
32264 <parameter content="const char *template"/>
32265 <parameter content="va_list ap"/>
32266 </prototype>
32267 <headers>
32268 <header filename = "stdio.h"/>
32269 </headers>
32270 <synopsis>
32271 This is the equivalent of &lt;CODE&gt;sscanf&lt;/CODE&gt; with the variable argument list
32272 specified directly as for &lt;CODE&gt;vscanf&lt;/CODE&gt;.
32273 </synopsis>
32274 </function>
32275 </construct>
32276 <construct id="function-vswscanf" type="function">
32277 <function returntype="int">
32278 <prototype>
32279 <parameter content="const wchar_t *s"/>
32280 <parameter content="const wchar_t *template"/>
32281 <parameter content="va_list ap"/>
32282 </prototype>
32283 <headers>
32284 <header filename = "wchar.h"/>
32285 </headers>
32286 <synopsis>
32287 This is the equivalent of &lt;CODE&gt;swscanf&lt;/CODE&gt; with the variable argument list
32288 specified directly as for &lt;CODE&gt;vwscanf&lt;/CODE&gt;.
32289 </synopsis>
32290 </function>
32291 </construct>
32292 <construct id="function-feof" type="function">
32293 <function returntype="int">
32294 <prototype>
32295 <parameter content="FILE *stream"/>
32296 </prototype>
32297 <headers>
32298 <header filename = "stdio.h"/>
32299 <header filename = "wchar.h"/>
32300 </headers>
32301 <synopsis>
32302 The &lt;CODE&gt;feof&lt;/CODE&gt; function returns nonzero if and only if the end-of-file
32303 indicator for the stream &lt;VAR&gt;stream&lt;/VAR&gt; is set.
32304 &lt;br&gt;&lt;br&gt; This symbol is declared in &lt;TT&gt;stdio.h&lt;/TT&gt;.
32305 </synopsis>
32306 </function>
32307 </construct>
32308 <construct id="function-feof_unlocked" type="function">
32309 <function returntype="int">
32310 <prototype>
32311 <parameter content="FILE *stream"/>
32312 </prototype>
32313 <headers>
32314 <header filename = "stdio.h"/>
32315 </headers>
32316 <synopsis>
32317 The &lt;CODE&gt;feof_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;feof&lt;/CODE&gt;
32318 function except that it does not implicitly lock the stream.
32319 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
32320 &lt;br&gt;&lt;br&gt; This symbol is declared in &lt;TT&gt;stdio.h&lt;/TT&gt;.
32321 </synopsis>
32322 </function>
32323 </construct>
32324 <construct id="function-ferror" type="function">
32325 <function returntype="int">
32326 <prototype>
32327 <parameter content="FILE *stream"/>
32328 </prototype>
32329 <headers>
32330 <header filename = "stdio.h"/>
32331 </headers>
32332 <synopsis>
32333 The &lt;CODE&gt;ferror&lt;/CODE&gt; function returns nonzero if and only if the error
32334 indicator for the stream &lt;VAR&gt;stream&lt;/VAR&gt; is set, indicating that an error
32335 has occurred on a previous operation on the stream.
32336 &lt;br&gt;&lt;br&gt; This symbol is declared in &lt;TT&gt;stdio.h&lt;/TT&gt;.
32337 </synopsis>
32338 </function>
32339 </construct>
32340 <construct id="function-ferror_unlocked" type="function">
32341 <function returntype="int">
32342 <prototype>
32343 <parameter content="FILE *stream"/>
32344 </prototype>
32345 <headers>
32346 <header filename = "stdio.h"/>
32347 </headers>
32348 <synopsis>
32349 The &lt;CODE&gt;ferror_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;ferror&lt;/CODE&gt;
32350 function except that it does not implicitly lock the stream.
32351 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
32352 &lt;br&gt;&lt;br&gt; This symbol is declared in &lt;TT&gt;stdio.h&lt;/TT&gt;.
32353 </synopsis>
32354 </function>
32355 </construct>
32356 <construct id="function-clearerr" type="function">
32357 <function returntype="void">
32358 <prototype>
32359 <parameter content="FILE *stream"/>
32360 </prototype>
32361 <headers>
32362 <header filename = "stdio.h"/>
32363 </headers>
32364 <synopsis>
32365 This function clears the end-of-file and error indicators for the
32366 stream &lt;VAR&gt;stream&lt;/VAR&gt;.
32367 &lt;br&gt;&lt;br&gt; The file positioning functions also clear the
32368 end-of-file indicator for the stream.
32369 </synopsis>
32370 </function>
32371 </construct>
32372 <construct id="function-clearerr_unlocked" type="function">
32373 <function returntype="void">
32374 <prototype>
32375 <parameter content="FILE *stream"/>
32376 </prototype>
32377 <headers>
32378 <header filename = "stdio.h"/>
32379 </headers>
32380 <synopsis>
32381 The &lt;CODE&gt;clearerr_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;clearerr&lt;/CODE&gt;
32382 function except that it does not implicitly lock the stream.
32383 &lt;br&gt;&lt;br&gt; This function is a GNU extension.
32384 </synopsis>
32385 </function>
32386 </construct>
32387 <construct id="function-ftell" type="function">
32388 <function returntype="long int">
32389 <prototype>
32390 <parameter content="FILE *stream"/>
32391 </prototype>
32392 <headers>
32393 <header filename = "stdio.h"/>
32394 </headers>
32395 <synopsis>
32396 This function returns the current file position of the stream
32397 &lt;VAR&gt;stream&lt;/VAR&gt;.
32398 &lt;br&gt;&lt;br&gt; This function can fail if the stream doesn't support file positioning,
32399 or if the file position can't be represented in a &lt;CODE&gt;long int&lt;/CODE&gt;, and
32400 possibly for other reasons as well. If a failure occurs, a value of
32401 &lt;CODE&gt;-1&lt;/CODE&gt; is returned.
32402 </synopsis>
32403 </function>
32404 </construct>
32405 <construct id="function-ftello" type="function">
32406 <function returntype="off_t">
32407 <prototype>
32408 <parameter content="FILE *stream"/>
32409 </prototype>
32410 <headers>
32411 <header filename = "stdio.h"/>
32412 </headers>
32413 <synopsis>
32414 The &lt;CODE&gt;ftello&lt;/CODE&gt; function is similar to &lt;CODE&gt;ftell&lt;/CODE&gt;, except that it
32415 returns a value of type &lt;CODE&gt;off_t&lt;/CODE&gt;. Systems which support this type
32416 use it to describe all file positions, unlike the POSIX specification
32417 which uses a long int. The two are not necessarily the same size.
32418 Therefore, using ftell can lead to problems if the implementation is
32419 written on top of a POSIX compliant low-level I/O implementation, and using
32420 &lt;CODE&gt;ftello&lt;/CODE&gt; is preferable whenever it is available.
32421 &lt;br&gt;&lt;br&gt; If this function fails it returns &lt;CODE&gt;(off_t) -1&lt;/CODE&gt;. This can happen due
32422 to missing support for file positioning or internal errors. Otherwise
32423 the return value is the current file position.
32424 &lt;br&gt;&lt;br&gt; The function is an extension defined in the Unix Single Specification
32425 version 2.
32426 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a
32427 32 bit system this function is in fact &lt;CODE&gt;ftello64&lt;/CODE&gt;. I.e., the
32428 LFS interface transparently replaces the old interface.
32429 </synopsis>
32430 </function>
32431 </construct>
32432 <construct id="function-ftello64" type="function">
32433 <function returntype="off64_t">
32434 <prototype>
32435 <parameter content="FILE *stream"/>
32436 </prototype>
32437 <headers>
32438 <header filename = "stdio.h"/>
32439 </headers>
32440 <synopsis>
32441 This function is similar to &lt;CODE&gt;ftello&lt;/CODE&gt; with the only difference that
32442 the return value is of type &lt;CODE&gt;off64_t&lt;/CODE&gt;. This also requires that the
32443 stream &lt;VAR&gt;stream&lt;/VAR&gt; was opened using either &lt;CODE&gt;fopen64&lt;/CODE&gt;,
32444 &lt;CODE&gt;freopen64&lt;/CODE&gt;, or &lt;CODE&gt;tmpfile64&lt;/CODE&gt; since otherwise the underlying
32445 file operations to position the file pointer beyond the 2^31
32446 bytes limit might fail.
32447 &lt;br&gt;&lt;br&gt; If the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a 32
32448 bits machine this function is available under the name &lt;CODE&gt;ftello&lt;/CODE&gt;
32449 and so transparently replaces the old interface.
32450 </synopsis>
32451 </function>
32452 </construct>
32453 <construct id="function-fseek" type="function">
32454 <function returntype="int">
32455 <prototype>
32456 <parameter content="FILE *stream"/>
32457 <parameter content="long int offset"/>
32458 <parameter content="int whence"/>
32459 </prototype>
32460 <headers>
32461 <header filename = "stdio.h"/>
32462 </headers>
32463 <synopsis>
32464 The &lt;CODE&gt;fseek&lt;/CODE&gt; function is used to change the file position of the
32465 stream &lt;VAR&gt;stream&lt;/VAR&gt;. The value of &lt;VAR&gt;whence&lt;/VAR&gt; must be one of the
32466 constants &lt;CODE&gt;SEEK_SET&lt;/CODE&gt;, &lt;CODE&gt;SEEK_CUR&lt;/CODE&gt;, or &lt;CODE&gt;SEEK_END&lt;/CODE&gt;, to
32467 indicate whether the &lt;VAR&gt;offset&lt;/VAR&gt; is relative to the beginning of the
32468 file, the current file position, or the end of the file, respectively.
32469 &lt;br&gt;&lt;br&gt; This function returns a value of zero if the operation was successful,
32470 and a nonzero value to indicate failure. A successful call also clears
32471 the end-of-file indicator of &lt;VAR&gt;stream&lt;/VAR&gt; and discards any characters
32472 that were ``pushed back'' by the use of &lt;CODE&gt;ungetc&lt;/CODE&gt;.
32473 &lt;br&gt;&lt;br&gt; &lt;CODE&gt;fseek&lt;/CODE&gt; either flushes any buffered output before setting the file
32474 position or else remembers it so it will be written later in its proper
32475 place in the file.
32476 </synopsis>
32477 </function>
32478 </construct>
32479 <construct id="function-fseeko" type="function">
32480 <function returntype="int">
32481 <prototype>
32482 <parameter content="FILE *stream"/>
32483 <parameter content="off_t offset"/>
32484 <parameter content="int whence"/>
32485 </prototype>
32486 <headers>
32487 <header filename = "stdio.h"/>
32488 </headers>
32489 <synopsis>
32490 This function is similar to &lt;CODE&gt;fseek&lt;/CODE&gt; but it corrects a problem with
32491 &lt;CODE&gt;fseek&lt;/CODE&gt; in a system with POSIX types. Using a value of type
32492 &lt;CODE&gt;long int&lt;/CODE&gt; for the offset is not compatible with POSIX.
32493 &lt;CODE&gt;fseeko&lt;/CODE&gt; uses the correct type &lt;CODE&gt;off_t&lt;/CODE&gt; for the &lt;VAR&gt;offset&lt;/VAR&gt;
32494 parameter.
32495 &lt;br&gt;&lt;br&gt; For this reason it is a good idea to prefer &lt;CODE&gt;ftello&lt;/CODE&gt; whenever it is
32496 available since its functionality is (if different at all) closer the
32497 underlying definition.
32498 &lt;br&gt;&lt;br&gt; The functionality and return value is the same as for &lt;CODE&gt;fseek&lt;/CODE&gt;.
32499 &lt;br&gt;&lt;br&gt; The function is an extension defined in the Unix Single Specification
32500 version 2.
32501 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a
32502 32 bit system this function is in fact &lt;CODE&gt;fseeko64&lt;/CODE&gt;. I.e., the
32503 LFS interface transparently replaces the old interface.
32504 </synopsis>
32505 </function>
32506 </construct>
32507 <construct id="function-fseeko64" type="function">
32508 <function returntype="int">
32509 <prototype>
32510 <parameter content="FILE *stream"/>
32511 <parameter content="off64_t offset"/>
32512 <parameter content="int whence"/>
32513 </prototype>
32514 <headers>
32515 <header filename = "stdio.h"/>
32516 </headers>
32517 <synopsis>
32518 This function is similar to &lt;CODE&gt;fseeko&lt;/CODE&gt; with the only difference that
32519 the &lt;VAR&gt;offset&lt;/VAR&gt; parameter is of type &lt;CODE&gt;off64_t&lt;/CODE&gt;. This also
32520 requires that the stream &lt;VAR&gt;stream&lt;/VAR&gt; was opened using either
32521 &lt;CODE&gt;fopen64&lt;/CODE&gt;, &lt;CODE&gt;freopen64&lt;/CODE&gt;, or &lt;CODE&gt;tmpfile64&lt;/CODE&gt; since otherwise
32522 the underlying file operations to position the file pointer beyond the
32523 2^31 bytes limit might fail.
32524 &lt;br&gt;&lt;br&gt; If the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a 32
32525 bits machine this function is available under the name &lt;CODE&gt;fseeko&lt;/CODE&gt;
32526 and so transparently replaces the old interface.
32527 </synopsis>
32528 </function>
32529 </construct>
32530 <construct id="function-rewind" type="function">
32531 <function returntype="void">
32532 <prototype>
32533 <parameter content="FILE *stream"/>
32534 </prototype>
32535 <headers>
32536 <header filename = "stdio.h"/>
32537 </headers>
32538 <synopsis>
32539 The &lt;CODE&gt;rewind&lt;/CODE&gt; function positions the stream &lt;VAR&gt;stream&lt;/VAR&gt; at the
32540 beginning of the file. It is equivalent to calling &lt;CODE&gt;fseek&lt;/CODE&gt; or
32541 &lt;CODE&gt;fseeko&lt;/CODE&gt; on the &lt;VAR&gt;stream&lt;/VAR&gt; with an &lt;VAR&gt;offset&lt;/VAR&gt; argument of
32542 &lt;CODE&gt;0L&lt;/CODE&gt; and a &lt;VAR&gt;whence&lt;/VAR&gt; argument of &lt;CODE&gt;SEEK_SET&lt;/CODE&gt;, except that
32543 the return value is discarded and the error indicator for the stream is
32544 reset.
32545 </synopsis>
32546 </function>
32547 </construct>
32548 <construct id="dtype-fpos_t" type="dtype">
32549 <structure>
32550 </structure>
32551 </construct>
32552 <construct id="dtype-fpos64_t" type="dtype">
32553 <structure>
32554 </structure>
32555 </construct>
32556 <construct id="function-fgetpos" type="function">
32557 <function returntype="int">
32558 <prototype>
32559 <parameter content="FILE *stream"/>
32560 <parameter content="fpos_t *position"/>
32561 </prototype>
32562 <headers>
32563 <header filename = "sys/file.h"/>
32564 <header filename = "stdio.h"/>
32565 </headers>
32566 <synopsis>
32567 This function stores the value of the file position indicator for the
32568 stream &lt;VAR&gt;stream&lt;/VAR&gt; in the &lt;CODE&gt;fpos_t&lt;/CODE&gt; object pointed to by
32569 &lt;VAR&gt;position&lt;/VAR&gt;. If successful, &lt;CODE&gt;fgetpos&lt;/CODE&gt; returns zero; otherwise
32570 it returns a nonzero value and stores an implementation-defined positive
32571 value in &lt;CODE&gt;errno&lt;/CODE&gt;.
32572 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a
32573 32 bit system the function is in fact &lt;CODE&gt;fgetpos64&lt;/CODE&gt;. I.e., the LFS
32574 interface transparently replaces the old interface.
32575 </synopsis>
32576 </function>
32577 </construct>
32578 <construct id="function-fgetpos64" type="function">
32579 <function returntype="int">
32580 <prototype>
32581 <parameter content="FILE *stream"/>
32582 <parameter content="fpos64_t *position"/>
32583 </prototype>
32584 <headers>
32585 <header filename = "stdio.h"/>
32586 </headers>
32587 <synopsis>
32588 This function is similar to &lt;CODE&gt;fgetpos&lt;/CODE&gt; but the file position is
32589 returned in a variable of type &lt;CODE&gt;fpos64_t&lt;/CODE&gt; to which &lt;VAR&gt;position&lt;/VAR&gt;
32590 points.
32591 &lt;br&gt;&lt;br&gt; If the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a 32
32592 bits machine this function is available under the name &lt;CODE&gt;fgetpos&lt;/CODE&gt;
32593 and so transparently replaces the old interface.
32594 </synopsis>
32595 </function>
32596 </construct>
32597 <construct id="function-fsetpos" type="function">
32598 <function returntype="int">
32599 <prototype>
32600 <parameter content="FILE *stream"/>
32601 <parameter content="const fpos_t *position"/>
32602 </prototype>
32603 <headers>
32604 <header filename = "stdio.h"/>
32605 </headers>
32606 <synopsis>
32607 This function sets the file position indicator for the stream &lt;VAR&gt;stream&lt;/VAR&gt;
32608 to the position &lt;VAR&gt;position&lt;/VAR&gt;, which must have been set by a previous
32609 call to &lt;CODE&gt;fgetpos&lt;/CODE&gt; on the same stream. If successful, &lt;CODE&gt;fsetpos&lt;/CODE&gt;
32610 clears the end-of-file indicator on the stream, discards any characters
32611 that were ``pushed back'' by the use of &lt;CODE&gt;ungetc&lt;/CODE&gt;, and returns a value
32612 of zero. Otherwise, &lt;CODE&gt;fsetpos&lt;/CODE&gt; returns a nonzero value and stores
32613 an implementation-defined positive value in &lt;CODE&gt;errno&lt;/CODE&gt;.
32614 &lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a
32615 32 bit system the function is in fact &lt;CODE&gt;fsetpos64&lt;/CODE&gt;. I.e., the LFS
32616 interface transparently replaces the old interface.
32617 </synopsis>
32618 </function>
32619 </construct>
32620 <construct id="function-fsetpos64" type="function">
32621 <function returntype="int">
32622 <prototype>
32623 <parameter content="FILE *stream"/>
32624 <parameter content="const fpos64_t *position"/>
32625 </prototype>
32626 <headers>
32627 <header filename = "stdio.h"/>
32628 </headers>
32629 <synopsis>
32630 This function is similar to &lt;CODE&gt;fsetpos&lt;/CODE&gt; but the file position used
32631 for positioning is provided in a variable of type &lt;CODE&gt;fpos64_t&lt;/CODE&gt; to
32632 which &lt;VAR&gt;position&lt;/VAR&gt; points.
32633 &lt;br&gt;&lt;br&gt; If the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a 32
32634 bits machine this function is available under the name &lt;CODE&gt;fsetpos&lt;/CODE&gt;
32635 and so transparently replaces the old interface.
32636 </synopsis>
32637 </function>
32638 </construct>
32639 <construct id="function-fflush" type="function">
32640 <function returntype="int">
32641 <prototype>
32642 <parameter content="FILE *stream"/>
32643 </prototype>
32644 <headers>
32645 <header filename = "stdio.h"/>
32646 </headers>
32647 <synopsis>
32648 This function causes any buffered output on &lt;VAR&gt;stream&lt;/VAR&gt; to be delivered
32649 to the file. If &lt;VAR&gt;stream&lt;/VAR&gt; is a null pointer, then
32650 &lt;CODE&gt;fflush&lt;/CODE&gt; causes buffered output on &lt;EM&gt;all&lt;/EM&gt; open output streams
32651 to be flushed.
32652 &lt;br&gt;&lt;br&gt; This function returns &lt;CODE&gt;EOF&lt;/CODE&gt; if a write error occurs, or zero
32653 otherwise.
32654 </synopsis>
32655 </function>
32656 </construct>
32657 <construct id="function-fflush_unlocked" type="function">
32658 <function returntype="int">
32659 <prototype>
32660 <parameter content="FILE *stream"/>
32661 </prototype>
32662 <headers>
32663 <header filename = "stdio.h"/>
32664 </headers>
32665 <synopsis>
32666 The &lt;CODE&gt;fflush_unlocked&lt;/CODE&gt; function is equivalent to the &lt;CODE&gt;fflush&lt;/CODE&gt;
32667 function except that it does not implicitly lock the stream.
32668 </synopsis>
32669 </function>
32670 </construct>
32671 <construct id="function-_flushlbf" type="function">
32672 <function returntype="void">
32673 <prototype>
32674 <parameter content="void"/>
32675 </prototype>
32676 <headers>
32677 <header filename = "stdio_ext.h"/>
32678 </headers>
32679 <synopsis>
32680 The &lt;CODE&gt;_flushlbf&lt;/CODE&gt; function flushes all line buffered streams
32681 currently opened.
32682 &lt;br&gt;&lt;br&gt; This function is declared in the &lt;TT&gt;stdio_ext.h&lt;/TT&gt; header.
32683 </synopsis>
32684 </function>
32685 </construct>
32686 <construct id="function-__fpurge" type="function">
32687 <function returntype="void">
32688 <prototype>
32689 <parameter content="FILE *stream"/>
32690 </prototype>
32691 <headers>
32692 <header filename = "stdio_ext.h"/>
32693 </headers>
32694 <synopsis>
32695 The &lt;CODE&gt;__fpurge&lt;/CODE&gt; function causes the buffer of the stream
32696 &lt;VAR&gt;stream&lt;/VAR&gt; to be emptied. If the stream is currently in read mode all
32697 input in the buffer is lost. If the stream is in output mode the
32698 buffered output is not written to the device (or whatever other
32699 underlying storage) and the buffer the cleared.
32700 &lt;br&gt;&lt;br&gt; This function is declared in &lt;TT&gt;stdio_ext.h&lt;/TT&gt;.
32701 </synopsis>
32702 </function>
32703 </construct>
32704 <construct id="function-setvbuf" type="function">
32705 <function returntype="int">
32706 <prototype>
32707 <parameter content="FILE *stream"/>
32708 <parameter content="char *buf"/>
32709 <parameter content="int mode"/>
32710 <parameter content="size_t size"/>
32711 </prototype>
32712 <headers>
32713 <header filename = "stdio.h"/>
32714 </headers>
32715 <synopsis>
32716 This function is used to specify that the stream &lt;VAR&gt;stream&lt;/VAR&gt; should
32717 have the buffering mode &lt;VAR&gt;mode&lt;/VAR&gt;, which can be either &lt;CODE&gt;_IOFBF&lt;/CODE&gt;
32718 (for full buffering), &lt;CODE&gt;_IOLBF&lt;/CODE&gt; (for line buffering), or
32719 &lt;CODE&gt;_IONBF&lt;/CODE&gt; (for unbuffered input/output).
32720 &lt;br&gt;&lt;br&gt; If you specify a null pointer as the &lt;VAR&gt;buf&lt;/VAR&gt; argument, then &lt;CODE&gt;setvbuf&lt;/CODE&gt;
32721 allocates a buffer itself using &lt;CODE&gt;malloc&lt;/CODE&gt;. This buffer will be freed
32722 when you close the stream.
32723 &lt;br&gt;&lt;br&gt; Otherwise, &lt;VAR&gt;buf&lt;/VAR&gt; should be a character array that can hold at least
32724 &lt;VAR&gt;size&lt;/VAR&gt; characters. You should not free the space for this array as
32725 long as the stream remains open and this array remains its buffer. You
32726 should usually either allocate it statically, or &lt;CODE&gt;malloc&lt;/CODE&gt;
32727 the buffer. Using an automatic array
32728 is not a good idea unless you close the file before exiting the block
32729 that declares the array.
32730 &lt;br&gt;&lt;br&gt; While the array remains a stream buffer, the stream I/O functions will
32731 use the buffer for their internal purposes. You shouldn't try to access
32732 the values in the array directly while the stream is using it for
32733 buffering.
32734 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;setvbuf&lt;/CODE&gt; function returns zero on success, or a nonzero value
32735 if the value of &lt;VAR&gt;mode&lt;/VAR&gt; is not valid or if the request could not
32736 be honored.
32737 </synopsis>
32738 </function>
32739 </construct>
32740 <construct id="function-setbuf" type="function">
32741 <function returntype="void">
32742 <prototype>
32743 <parameter content="FILE *stream"/>
32744 <parameter content="char *buf"/>
32745 </prototype>
32746 <headers>
32747 <header filename = "stdio.h"/>
32748 </headers>
32749 <synopsis>
32750 If &lt;VAR&gt;buf&lt;/VAR&gt; is a null pointer, the effect of this function is
32751 equivalent to calling &lt;CODE&gt;setvbuf&lt;/CODE&gt; with a &lt;VAR&gt;mode&lt;/VAR&gt; argument of
32752 &lt;CODE&gt;_IONBF&lt;/CODE&gt;. Otherwise, it is equivalent to calling &lt;CODE&gt;setvbuf&lt;/CODE&gt;
32753 with &lt;VAR&gt;buf&lt;/VAR&gt;, and a &lt;VAR&gt;mode&lt;/VAR&gt; of &lt;CODE&gt;_IOFBF&lt;/CODE&gt; and a &lt;VAR&gt;size&lt;/VAR&gt;
32754 argument of &lt;CODE&gt;BUFSIZ&lt;/CODE&gt;.
32755 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;setbuf&lt;/CODE&gt; function is provided for compatibility with old code;
32756 use &lt;CODE&gt;setvbuf&lt;/CODE&gt; in all new programs.
32757 </synopsis>
32758 </function>
32759 </construct>
32760 <construct id="function-setbuffer" type="function">
32761 <function returntype="void">
32762 <prototype>
32763 <parameter content="FILE *stream"/>
32764 <parameter content="char *buf"/>
32765 <parameter content="size_t size"/>
32766 </prototype>
32767 <headers>
32768 <header filename = "stdio.h"/>
32769 </headers>
32770 <synopsis>
32771 If &lt;VAR&gt;buf&lt;/VAR&gt; is a null pointer, this function makes &lt;VAR&gt;stream&lt;/VAR&gt; unbuffered.
32772 Otherwise, it makes &lt;VAR&gt;stream&lt;/VAR&gt; fully buffered using &lt;VAR&gt;buf&lt;/VAR&gt; as the
32773 buffer. The &lt;VAR&gt;size&lt;/VAR&gt; argument specifies the length of &lt;VAR&gt;buf&lt;/VAR&gt;.
32774 &lt;br&gt;&lt;br&gt; This function is provided for compatibility with old BSD code. Use
32775 &lt;CODE&gt;setvbuf&lt;/CODE&gt; instead.
32776 </synopsis>
32777 </function>
32778 </construct>
32779 <construct id="function-setlinebuf" type="function">
32780 <function returntype="void">
32781 <prototype>
32782 <parameter content="FILE *stream"/>
32783 </prototype>
32784 <headers>
32785 <header filename = "stdio.h"/>
32786 </headers>
32787 <synopsis>
32788 This function makes &lt;VAR&gt;stream&lt;/VAR&gt; be line buffered, and allocates the
32789 buffer for you.
32790 &lt;br&gt;&lt;br&gt; This function is provided for compatibility with old BSD code. Use
32791 &lt;CODE&gt;setvbuf&lt;/CODE&gt; instead.
32792 </synopsis>
32793 </function>
32794 </construct>
32795 <construct id="function-__flbf" type="function">
32796 <function returntype="int">
32797 <prototype>
32798 <parameter content="FILE *stream"/>
32799 </prototype>
32800 <headers>
32801 <header filename = "stdio_ext.h"/>
32802 </headers>
32803 <synopsis>
32804 The &lt;CODE&gt;__flbf&lt;/CODE&gt; function will return a nonzero value in case the
32805 stream &lt;VAR&gt;stream&lt;/VAR&gt; is line buffered. Otherwise the return value is
32806 zero.
32807 &lt;br&gt;&lt;br&gt; This function is declared in the &lt;TT&gt;stdio_ext.h&lt;/TT&gt; header.
32808 </synopsis>
32809 </function>
32810 </construct>
32811 <construct id="function-__fbufsize" type="function">
32812 <function returntype="size_t">
32813 <prototype>
32814 <parameter content="FILE *stream"/>
32815 </prototype>
32816 <headers>
32817 <header filename = "stdio_ext.h"/>
32818 </headers>
32819 <synopsis>
32820 The &lt;CODE&gt;__fbufsize&lt;/CODE&gt; function return the size of the buffer in the
32821 stream &lt;VAR&gt;stream&lt;/VAR&gt;. This value can be used to optimize the use of the
32822 stream.
32823 &lt;br&gt;&lt;br&gt; This function is declared in the &lt;TT&gt;stdio_ext.h&lt;/TT&gt; header.
32824 </synopsis>
32825 </function>
32826 </construct>
32827 <construct id="function-__fpending" type="function">
32828 <function returntype="size_t">
32829 <prototype>
32830 <parameter content="FILE *stream"/>
32831 </prototype>
32832 <headers>
32833 <header filename = "stdio_ext.h"/>
32834 </headers>
32835 <synopsis>
32836 function returns the number of bytes currently in the output buffer.
32837 For wide-oriented stream the measuring unit is wide characters. This
32838 function should not be used on buffers in read mode or opened read-only.
32839 &lt;br&gt;&lt;br&gt; This function is declared in the &lt;TT&gt;stdio_ext.h&lt;/TT&gt; header.
32840 </synopsis>
32841 </function>
32842 </construct>
32843 <construct id="function-fmemopen" type="function">
32844 <function returntype="FILE *">
32845 <prototype>
32846 <parameter content="void *buf"/>
32847 <parameter content="size_t size"/>
32848 <parameter content="const char *opentype"/>
32849 </prototype>
32850 <headers>
32851 <header filename = "stdio.h"/>
32852 </headers>
32853 <synopsis>
32854 This function opens a stream that allows the access specified by the
32855 &lt;VAR&gt;opentype&lt;/VAR&gt; argument, that reads from or writes to the buffer specified
32856 by the argument &lt;VAR&gt;buf&lt;/VAR&gt;. This array must be at least &lt;VAR&gt;size&lt;/VAR&gt; bytes long.
32857 &lt;br&gt;&lt;br&gt; If you specify a null pointer as the &lt;VAR&gt;buf&lt;/VAR&gt; argument, &lt;CODE&gt;fmemopen&lt;/CODE&gt;
32858 dynamically allocates an array &lt;VAR&gt;size&lt;/VAR&gt; bytes long (as with &lt;CODE&gt;malloc&lt;/CODE&gt;;
32859 ). This is really only useful
32860 if you are going to write things to the buffer and then read them back
32861 in again, because you have no way of actually getting a pointer to the
32862 buffer (for this, try &lt;CODE&gt;open_memstream&lt;/CODE&gt;, below). The buffer is
32863 freed when the stream is closed.
32864 &lt;br&gt;&lt;br&gt; The argument &lt;VAR&gt;opentype&lt;/VAR&gt; is the same as in &lt;CODE&gt;fopen&lt;/CODE&gt;
32865 . If the &lt;VAR&gt;opentype&lt;/VAR&gt; specifies
32866 append mode, then the initial file position is set to the first null
32867 character in the buffer. Otherwise the initial file position is at the
32868 beginning of the buffer.
32869 &lt;br&gt;&lt;br&gt; When a stream open for writing is flushed or closed, a null character
32870 (zero byte) is written at the end of the buffer if it fits. You
32871 should add an extra byte to the &lt;VAR&gt;size&lt;/VAR&gt; argument to account for this.
32872 Attempts to write more than &lt;VAR&gt;size&lt;/VAR&gt; bytes to the buffer result
32873 in an error.
32874 &lt;br&gt;&lt;br&gt; For a stream open for reading, null characters (zero bytes) in the
32875 buffer do not count as ``end of file''. Read operations indicate end of
32876 file only when the file position advances past &lt;VAR&gt;size&lt;/VAR&gt; bytes. So, if
32877 you want to read characters from a null-terminated string, you should
32878 supply the length of the string as the &lt;VAR&gt;size&lt;/VAR&gt; argument.
32879 </synopsis>
32880 </function>
32881 </construct>
32882 <construct id="function-open_memstream" type="function">
32883 <function returntype="FILE *">
32884 <prototype>
32885 <parameter content="char **ptr"/>
32886 <parameter content="size_t *sizeloc"/>
32887 </prototype>
32888 <headers>
32889 <header filename = "stdio.h"/>
32890 </headers>
32891 <synopsis>
32892 This function opens a stream for writing to a buffer. The buffer is
32893 allocated dynamically and grown as necessary, using &lt;CODE&gt;malloc&lt;/CODE&gt;.
32894 After you've closed the stream, this buffer is your responsibility to
32895 clean up using &lt;CODE&gt;free&lt;/CODE&gt; or &lt;CODE&gt;realloc&lt;/CODE&gt;. .
32896 &lt;br&gt;&lt;br&gt; When the stream is closed with &lt;CODE&gt;fclose&lt;/CODE&gt; or flushed with
32897 &lt;CODE&gt;fflush&lt;/CODE&gt;, the locations &lt;VAR&gt;ptr&lt;/VAR&gt; and &lt;VAR&gt;sizeloc&lt;/VAR&gt; are updated to
32898 contain the pointer to the buffer and its size. The values thus stored
32899 remain valid only as long as no further output on the stream takes
32900 place. If you do more output, you must flush the stream again to store
32901 new values before you use them again.
32902 &lt;br&gt;&lt;br&gt; A null character is written at the end of the buffer. This null character
32903 is &lt;EM&gt;not&lt;/EM&gt; included in the size value stored at &lt;VAR&gt;sizeloc&lt;/VAR&gt;.
32904 &lt;br&gt;&lt;br&gt; You can move the stream's file position with &lt;CODE&gt;fseek&lt;/CODE&gt; or
32905 &lt;CODE&gt;fseeko&lt;/CODE&gt; . Moving the file position past
32906 the end of the data already written fills the intervening space with
32907 zeroes.
32908 </synopsis>
32909 </function>
32910 </construct>
32911 <construct id="function-open_obstack_stream" type="function">
32912 <function returntype="FILE *">
32913 <prototype>
32914 <parameter content="struct obstack *obstack"/>
32915 </prototype>
32916 <headers>
32917 <header filename = "stdio.h"/>
32918 </headers>
32919 <synopsis>
32920 This function opens a stream for writing data into the obstack &lt;VAR&gt;obstack&lt;/VAR&gt;.
32921 This starts an object in the obstack and makes it grow as data is
32922 written .
32923 &lt;br&gt;&lt;br&gt; Calling &lt;CODE&gt;fflush&lt;/CODE&gt; on this stream updates the current size of the
32924 object to match the amount of data that has been written. After a call
32925 to &lt;CODE&gt;fflush&lt;/CODE&gt;, you can examine the object temporarily.
32926 &lt;br&gt;&lt;br&gt; You can move the file position of an obstack stream with &lt;CODE&gt;fseek&lt;/CODE&gt; or
32927 &lt;CODE&gt;fseeko&lt;/CODE&gt; . Moving the file position past
32928 the end of the data written fills the intervening space with zeros.
32929 &lt;br&gt;&lt;br&gt; To make the object permanent, update the obstack with &lt;CODE&gt;fflush&lt;/CODE&gt;, and
32930 then use &lt;CODE&gt;obstack_finish&lt;/CODE&gt; to finalize the object and get its address.
32931 The following write to the stream starts a new object in the obstack,
32932 and later writes add to that object until you do another &lt;CODE&gt;fflush&lt;/CODE&gt;
32933 and &lt;CODE&gt;obstack_finish&lt;/CODE&gt;.
32934 &lt;br&gt;&lt;br&gt; But how do you find out how long the object is? You can get the length
32935 in bytes by calling &lt;CODE&gt;obstack_object_size&lt;/CODE&gt; , or you can null-terminate the object like this:
32936 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
32937 obstack_1grow (&lt;VAR&gt;obstack&lt;/VAR&gt;, 0);&lt;br&gt;
32938 &lt;/pre&gt;
32939 &lt;br&gt;&lt;br&gt; Whichever one you do, you must do it &lt;EM&gt;before&lt;/EM&gt; calling
32940 &lt;CODE&gt;obstack_finish&lt;/CODE&gt;. (You can do both if you wish.)
32941 </synopsis>
32942 </function>
32943 </construct>
32944 <construct id="type-cookie_io_functions_t" type="type">
32945 <structure>
32946 <synopsis>
32947 This is a structure type that holds the functions that define the
32948 communications protocol between the stream and its cookie. It has
32949 the following members:
32950 &lt;br&gt;&lt;br&gt;
32951 </synopsis>
32952 <elements>
32953 <element content="cookie_read_function_t *read">
32954 <synopsis>
32955 This is the function that reads data from the cookie. If the value is a
32956 null pointer instead of a function, then read operations on this stream
32957 always return &lt;CODE&gt;EOF&lt;/CODE&gt;.
32958 &lt;br&gt;&lt;br&gt;
32959 </synopsis>
32960 </element>
32961 <element content="cookie_write_function_t *write">
32962 <synopsis>
32963 This is the function that writes data to the cookie. If the value is a
32964 null pointer instead of a function, then data written to the stream is
32965 discarded.
32966 &lt;br&gt;&lt;br&gt;
32967 </synopsis>
32968 </element>
32969 <element content="cookie_seek_function_t *seek">
32970 <synopsis>
32971 This is the function that performs the equivalent of file positioning on
32972 the cookie. If the value is a null pointer instead of a function, calls
32973 to &lt;CODE&gt;fseek&lt;/CODE&gt; or &lt;CODE&gt;fseeko&lt;/CODE&gt; on this stream can only seek to
32974 locations within the buffer; any attempt to seek outside the buffer will
32975 return an &lt;CODE&gt;ESPIPE&lt;/CODE&gt; error.
32976 &lt;br&gt;&lt;br&gt;
32977 </synopsis>
32978 </element>
32979 </elements>
32980 </structure>
32981 </construct>
32982 <construct id="function-fopencookie" type="function">
32983 <function returntype="FILE *">
32984 <prototype>
32985 <parameter content="void *cookie"/>
32986 <parameter content="const char *opentype"/>
32987 <parameter content="cookie_io_functions_t io-functions"/>
32988 </prototype>
32989 <headers>
32990 <header filename = "stdio.h"/>
32991 </headers>
32992 <synopsis>
32993 This function actually creates the stream for communicating with the
32994 &lt;VAR&gt;cookie&lt;/VAR&gt; using the functions in the &lt;VAR&gt;io-functions&lt;/VAR&gt; argument.
32995 The &lt;VAR&gt;opentype&lt;/VAR&gt; argument is interpreted as for &lt;CODE&gt;fopen&lt;/CODE&gt;;
32996 see Opening Streams. (But note that the ``truncate on
32997 open'' option is ignored.) The new stream is fully buffered.
32998 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;fopencookie&lt;/CODE&gt; function returns the newly created stream, or a null
32999 pointer in case of an error.
33000 </synopsis>
33001 </function>
33002 </construct>
33003 <construct id="dtype-cookie_read_function" type="dtype">
33004 <structure>
33005 </structure>
33006 </construct>
33007 <construct id="dtype-cookie_write_function" type="dtype">
33008 <structure>
33009 </structure>
33010 </construct>
33011 <construct id="dtype-cookie_seek_function" type="dtype">
33012 <structure>
33013 </structure>
33014 </construct>
33015 <construct id="dtype-cookie_close_function" type="dtype">
33016 <structure>
33017 </structure>
33018 </construct>
33019 <construct id="function-fmtmsg" type="function">
33020 <function returntype="int">
33021 <prototype>
33022 <parameter content="long int classification"/>
33023 <parameter content="const char *label"/>
33024 <parameter content="int severity"/>
33025 <parameter content="const char *text"/>
33026 <parameter content="const char *action"/>
33027 <parameter content="const char *tag"/>
33028 </prototype>
33029 <headers>
33030 <header filename = "stdio.h"/>
33031 <header filename = "fmtmsg.h"/>
33032 </headers>
33033 <synopsis>
33034 Display a message described by its parameters on the device(s) specified
33035 in the &lt;VAR&gt;classification&lt;/VAR&gt; parameter. The &lt;VAR&gt;label&lt;/VAR&gt; parameter
33036 identifies the source of the message. The string should consist of two
33037 colon separated parts where the first part has not more than 10 and the
33038 second part not more than 14 characters. The &lt;VAR&gt;text&lt;/VAR&gt; parameter
33039 describes the condition of the error, the &lt;VAR&gt;action&lt;/VAR&gt; parameter possible
33040 steps to recover from the error and the &lt;VAR&gt;tag&lt;/VAR&gt; parameter is a
33041 reference to the online documentation where more information can be
33042 found. It should contain the &lt;VAR&gt;label&lt;/VAR&gt; value and a unique
33043 identification number.
33044 &lt;br&gt;&lt;br&gt; Each of the parameters can be a special value which means this value
33045 is to be omitted. The symbolic names for these values are:
33046 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
33047
33048 &lt;DT&gt;&lt;CODE&gt;MM_NULLLBL&lt;/CODE&gt;
33049 &lt;DD&gt;
33050 Ignore &lt;VAR&gt;label&lt;/VAR&gt; parameter.
33051 &lt;DT&gt;&lt;CODE&gt;MM_NULLSEV&lt;/CODE&gt;
33052 &lt;DD&gt;
33053 Ignore &lt;VAR&gt;severity&lt;/VAR&gt; parameter.
33054 &lt;DT&gt;&lt;CODE&gt;MM_NULLMC&lt;/CODE&gt;
33055 &lt;DD&gt;
33056 Ignore &lt;VAR&gt;classification&lt;/VAR&gt; parameter. This implies that nothing is
33057 actually printed.
33058 &lt;DT&gt;&lt;CODE&gt;MM_NULLTXT&lt;/CODE&gt;
33059 &lt;DD&gt;
33060 Ignore &lt;VAR&gt;text&lt;/VAR&gt; parameter.
33061 &lt;DT&gt;&lt;CODE&gt;MM_NULLACT&lt;/CODE&gt;
33062 &lt;DD&gt;
33063 Ignore &lt;VAR&gt;action&lt;/VAR&gt; parameter.
33064 &lt;DT&gt;&lt;CODE&gt;MM_NULLTAG&lt;/CODE&gt;
33065 &lt;DD&gt;
33066 Ignore &lt;VAR&gt;tag&lt;/VAR&gt; parameter.
33067 &lt;/DL&gt;
33068 &lt;br&gt;&lt;br&gt; There is another way certain fields can be omitted from the output to
33069 standard error. This is described below in the description of
33070 environment variables influencing the behavior.
33071 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;severity&lt;/VAR&gt; parameter can have one of the values in the following
33072 table:
33073 class
33074 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
33075
33076 &lt;DT&gt;&lt;CODE&gt;MM_NOSEV&lt;/CODE&gt;
33077 &lt;DD&gt;
33078 Nothing is printed, this value is the same as &lt;CODE&gt;MM_NULLSEV&lt;/CODE&gt;.
33079 &lt;DT&gt;&lt;CODE&gt;MM_HALT&lt;/CODE&gt;
33080 &lt;DD&gt;
33081 This value is printed as &lt;CODE&gt;HALT&lt;/CODE&gt;.
33082 &lt;DT&gt;&lt;CODE&gt;MM_ERROR&lt;/CODE&gt;
33083 &lt;DD&gt;
33084 This value is printed as &lt;CODE&gt;ERROR&lt;/CODE&gt;.
33085 &lt;DT&gt;&lt;CODE&gt;MM_WARNING&lt;/CODE&gt;
33086 &lt;DD&gt;
33087 This value is printed as &lt;CODE&gt;WARNING&lt;/CODE&gt;.
33088 &lt;DT&gt;&lt;CODE&gt;MM_INFO&lt;/CODE&gt;
33089 &lt;DD&gt;
33090 This value is printed as &lt;CODE&gt;INFO&lt;/CODE&gt;.
33091 &lt;/DL&gt;
33092 &lt;br&gt;&lt;br&gt; The numeric value of these five macros are between &lt;CODE&gt;0&lt;/CODE&gt; and
33093 &lt;CODE&gt;4&lt;/CODE&gt;. Using the environment variable &lt;CODE&gt;SEV_LEVEL&lt;/CODE&gt; or using the
33094 &lt;CODE&gt;addseverity&lt;/CODE&gt; function one can add more severity levels with their
33095 corresponding string to print. This is described below
33096 .
33097 &lt;br&gt;&lt;br&gt;
33098 If no parameter is ignored the output looks like this:
33099 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
33100 &lt;VAR&gt;label&lt;/VAR&gt;: &lt;VAR&gt;severity-string&lt;/VAR&gt;: &lt;VAR&gt;text&lt;/VAR&gt;&lt;br&gt;
33101 TO FIX: &lt;VAR&gt;action&lt;/VAR&gt; &lt;VAR&gt;tag&lt;/VAR&gt;&lt;br&gt;
33102 &lt;/pre&gt;
33103 &lt;br&gt;&lt;br&gt; The colons, new line characters and the &lt;CODE&gt;TO FIX&lt;/CODE&gt; string are
33104 inserted if necessary, i.e., if the corresponding parameter is not
33105 ignored.
33106 &lt;br&gt;&lt;br&gt; This function is specified in the X/Open Portability Guide. It is also
33107 available on all systems derived from System V.
33108 &lt;br&gt;&lt;br&gt; The function returns the value &lt;CODE&gt;MM_OK&lt;/CODE&gt; if no error occurred. If
33109 only the printing to standard error failed, it returns &lt;CODE&gt;MM_NOMSG&lt;/CODE&gt;.
33110 If printing to the console fails, it returns &lt;CODE&gt;MM_NOCON&lt;/CODE&gt;. If
33111 nothing is printed &lt;CODE&gt;MM_NOTOK&lt;/CODE&gt; is returned. Among situations where
33112 all outputs fail this last value is also returned if a parameter value
33113 is incorrect.
33114 </synopsis>
33115 </function>
33116 </construct>
33117 <construct id="function-addseverity" type="function">
33118 <function returntype="int">
33119 <prototype>
33120 <parameter content="int severity"/>
33121 <parameter content="const char *string"/>
33122 </prototype>
33123 <synopsis>
33124 This function allows the introduction of new severity classes which can be
33125 addressed by the &lt;VAR&gt;severity&lt;/VAR&gt; parameter of the &lt;CODE&gt;fmtmsg&lt;/CODE&gt; function.
33126 The &lt;VAR&gt;severity&lt;/VAR&gt; parameter of &lt;CODE&gt;addseverity&lt;/CODE&gt; must match the value
33127 for the parameter with the same name of &lt;CODE&gt;fmtmsg&lt;/CODE&gt;, and &lt;VAR&gt;string&lt;/VAR&gt;
33128 is the string printed in the actual messages instead of the numeric
33129 value.
33130 &lt;br&gt;&lt;br&gt; If &lt;VAR&gt;string&lt;/VAR&gt; is &lt;CODE&gt;NULL&lt;/CODE&gt; the severity class with the numeric value
33131 according to &lt;VAR&gt;severity&lt;/VAR&gt; is removed.
33132 &lt;br&gt;&lt;br&gt; It is not possible to overwrite or remove one of the default severity
33133 classes. All calls to &lt;CODE&gt;addseverity&lt;/CODE&gt; with &lt;VAR&gt;severity&lt;/VAR&gt; set to one
33134 of the values for the default classes will fail.
33135 &lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;MM_OK&lt;/CODE&gt; if the task was successfully performed.
33136 If the return value is &lt;CODE&gt;MM_NOTOK&lt;/CODE&gt; something went wrong. This could
33137 mean that no more memory is available or a class is not available when
33138 it has to be removed.
33139 &lt;br&gt;&lt;br&gt; This function is not specified in the X/Open Portability Guide although
33140 the &lt;CODE&gt;fmtsmg&lt;/CODE&gt; function is. It is available on System V systems.
33141 </synopsis>
33142 </function>
33143 </construct>
33144 <construct id="function-lfind" type="function">
33145 <function returntype="void *">
33146 <prototype>
33147 <parameter content="const void *key"/>
33148 <parameter content="void *base"/>
33149 <parameter content="size_t *nmemb"/>
33150 <parameter content="size_t size"/>
33151 <parameter content="comparison_fn_t compar"/>
33152 </prototype>
33153 <headers>
33154 <header filename = "stdlib.h"/>
33155 <header filename = "search.h"/>
33156 </headers>
33157 <synopsis>
33158 The &lt;CODE&gt;lfind&lt;/CODE&gt; function searches in the array with &lt;CODE&gt;*&lt;VAR&gt;nmemb&lt;/VAR&gt;&lt;/CODE&gt;
33159 elements of &lt;VAR&gt;size&lt;/VAR&gt; bytes pointed to by &lt;VAR&gt;base&lt;/VAR&gt; for an element
33160 which matches the one pointed to by &lt;VAR&gt;key&lt;/VAR&gt;. The function pointed to
33161 by &lt;VAR&gt;compar&lt;/VAR&gt; is used decide whether two elements match.
33162 &lt;br&gt;&lt;br&gt; The return value is a pointer to the matching element in the array
33163 starting at &lt;VAR&gt;base&lt;/VAR&gt; if it is found. If no matching element is
33164 available &lt;CODE&gt;NULL&lt;/CODE&gt; is returned.
33165 &lt;br&gt;&lt;br&gt; The mean runtime of this function is &lt;CODE&gt;*&lt;VAR&gt;nmemb&lt;/VAR&gt;&lt;/CODE&gt;/2. This
33166 function should only be used if elements often get added to or deleted from
33167 the array in which case it might not be useful to sort the array before
33168 searching.
33169 </synopsis>
33170 </function>
33171 </construct>
33172 <construct id="function-lsearch" type="function">
33173 <function returntype="void *">
33174 <prototype>
33175 <parameter content="const void *key"/>
33176 <parameter content="void *base"/>
33177 <parameter content="size_t *nmemb"/>
33178 <parameter content="size_t size"/>
33179 <parameter content="comparison_fn_t compar"/>
33180 </prototype>
33181 <headers>
33182 <header filename = "search.h"/>
33183 </headers>
33184 <synopsis>
33185 The &lt;CODE&gt;lsearch&lt;/CODE&gt; function is similar to the &lt;CODE&gt;lfind&lt;/CODE&gt; function. It
33186 searches the given array for an element and returns it if found. The
33187 difference is that if no matching element is found the &lt;CODE&gt;lsearch&lt;/CODE&gt;
33188 function adds the object pointed to by &lt;VAR&gt;key&lt;/VAR&gt; (with a size of
33189 &lt;VAR&gt;size&lt;/VAR&gt; bytes) at the end of the array and it increments the value of
33190 &lt;CODE&gt;*&lt;VAR&gt;nmemb&lt;/VAR&gt;&lt;/CODE&gt; to reflect this addition.
33191 &lt;br&gt;&lt;br&gt; This means for the caller that if it is not sure that the array contains
33192 the element one is searching for the memory allocated for the array
33193 starting at &lt;VAR&gt;base&lt;/VAR&gt; must have room for at least &lt;VAR&gt;size&lt;/VAR&gt; more
33194 bytes. If one is sure the element is in the array it is better to use
33195 &lt;CODE&gt;lfind&lt;/CODE&gt; so having more room in the array is always necessary when
33196 calling &lt;CODE&gt;lsearch&lt;/CODE&gt;.
33197 </synopsis>
33198 </function>
33199 </construct>
33200 <construct id="function-bsearch" type="function">
33201 <function returntype="void *">
33202 <prototype>
33203 <parameter content="const void *key"/>
33204 <parameter content="const void *array"/>
33205 <parameter content="size_t count"/>
33206 <parameter content="size_t size"/>
33207 <parameter content="comparison_fn_t compare"/>
33208 </prototype>
33209 <headers>
33210 <header filename = "stdlib.h"/>
33211 </headers>
33212 <synopsis>
33213 The &lt;CODE&gt;bsearch&lt;/CODE&gt; function searches the sorted array &lt;VAR&gt;array&lt;/VAR&gt; for an object
33214 that is equivalent to &lt;VAR&gt;key&lt;/VAR&gt;. The array contains &lt;VAR&gt;count&lt;/VAR&gt; elements,
33215 each of which is of size &lt;VAR&gt;size&lt;/VAR&gt; bytes.
33216 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;compare&lt;/VAR&gt; function is used to perform the comparison. This
33217 function is called with two pointer arguments and should return an
33218 integer less than, equal to, or greater than zero corresponding to
33219 whether its first argument is considered less than, equal to, or greater
33220 than its second argument. The elements of the &lt;VAR&gt;array&lt;/VAR&gt; must already
33221 be sorted in ascending order according to this comparison function.
33222 &lt;br&gt;&lt;br&gt; The return value is a pointer to the matching array element, or a null
33223 pointer if no match is found. If the array contains more than one element
33224 that matches, the one that is returned is unspecified.
33225 &lt;br&gt;&lt;br&gt; This function derives its name from the fact that it is implemented
33226 using the binary search algorithm.
33227 </synopsis>
33228 </function>
33229 </construct>
33230 <construct id="function-qsort" type="function">
33231 <function returntype="void">
33232 <prototype>
33233 <parameter content="void *array"/>
33234 <parameter content="size_t count"/>
33235 <parameter content="size_t size"/>
33236 <parameter content="comparison_fn_t compare"/>
33237 </prototype>
33238 <headers>
33239 <header filename = "stdlib.h"/>
33240 </headers>
33241 <synopsis>
33242 The &lt;VAR&gt;qsort&lt;/VAR&gt; function sorts the array &lt;VAR&gt;array&lt;/VAR&gt;. The array contains
33243 &lt;VAR&gt;count&lt;/VAR&gt; elements, each of which is of size &lt;VAR&gt;size&lt;/VAR&gt;.
33244 &lt;br&gt;&lt;br&gt; The &lt;VAR&gt;compare&lt;/VAR&gt; function is used to perform the comparison on the
33245 array elements. This function is called with two pointer arguments and
33246 should return an integer less than, equal to, or greater than zero
33247 corresponding to whether its first argument is considered less than,
33248 equal to, or greater than its second argument.
33249 &lt;br&gt;&lt;br&gt; sorting
33250 Warning: If two objects compare as equal, their order after
33251 sorting is unpredictable. That is to say, the sorting is not stable.
33252 This can make a difference when the comparison considers only part of
33253 the elements. Two elements with the same sort key may differ in other
33254 respects.
33255 &lt;br&gt;&lt;br&gt; If you want the effect of a stable sort, you can get this result by
33256 writing the comparison function so that, lacking other reason
33257 distinguish between two elements, it compares them by their addresses.
33258 Note that doing this may make the sorting algorithm less efficient, so
33259 do it only if necessary.
33260 &lt;br&gt;&lt;br&gt; Here is a simple example of sorting an array of doubles in numerical
33261 order, using the comparison function defined above :
33262 &lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
33263 {&lt;br&gt;
33264 double *array;&lt;br&gt;
33265 int size;&lt;br&gt;
33266 &lt;small&gt;...&lt;/small&gt;&lt;br&gt;
33267 qsort (array, size, sizeof (double), compare_doubles);&lt;br&gt;
33268 }&lt;br&gt;
33269 &lt;/pre&gt;
33270 &lt;br&gt;&lt;br&gt; The &lt;CODE&gt;qsort&lt;/CODE&gt; function derives its name from the fact that it was
33271 originally implemented using the ``quick sort'' algorithm.
33272 &lt;br&gt;&lt;br&gt; The implementation of &lt;CODE&gt;qsort&lt;/CODE&gt; in this library might not be an
33273 in-place sort and might thereby use an extra amount of memory to store
33274 the array.
33275 </synopsis>
33276 </function>
33277 </construct>
33278 <construct id="function-hcreate" type="function">
33279 <function returntype="int">
33280 <prototype>
33281 <parameter content="size_t nel"/>
33282 </prototype>
33283 <headers>
33284 <header filename = "search.h"/>
33285 </headers>
33286 <synopsis>
33287 The &lt;CODE&gt;hcreate&lt;/CODE&gt; function creates a hashing table which can contain at
33288 least &lt;VAR&gt;nel&lt;/VAR&gt; elements. There is no possibility to grow this table so
33289 it is necessary to choose the value for &lt;VAR&gt;nel&lt;/VAR&gt; wisely. The method
33290 used to implement this function might make it necessary to make the
33291 number of elements in the hashing table larger than the expected maximal
33292 number of elements. Hashing tables usually work inefficiently if they are
33293 filled 80% or more. The constant access time guaranteed by hashing can
33294 only be achieved if few collisions exist. See Knuth's ``The Art of
33295 Computer Programming, Part 3: Searching and Sorting'' for more
33296 information.
33297 &lt;br&gt;&lt;br&gt; The weakest aspect of this function is that there can be at most one
33298 hashing table used through the whole program. The table is allocated
33299 in local memory out of control of the programmer. As an extension the
33300 GNU C library provides an additional set of functions with an reentrant
33301 interface which provide a similar interface but which allow to keep
33302 arbitrarily many hashing tables.
33303 &lt;br&gt;&lt;br&gt; It is possible to use more than one hashing table in the program run if
33304 the former table is first destroyed by a call to &lt;CODE&gt;hdestroy&lt;/CODE&gt;.
33305 &lt;br&gt;&lt;br&gt; The function returns a non-zero value if successful. If it return zero
33306 something went wrong. This could either mean there is already a hashing
33307 table in use or the program runs out of memory.
33308 </synopsis>
33309 </function>
33310 </construct>
33311 <construct id="function-hdestroy" type="function">
33312 <function returntype="void">
33313 <prototype>
33314 <parameter content="void"/>
33315 </prototype>
33316 <headers>
33317 <header filename = "search.h"/>
33318 </headers>
33319 <synopsis>
33320 The &lt;CODE&gt;hdestroy&lt;/CODE&gt; function can be used to free all the resources
33321 allocated in a previous call of &lt;CODE&gt;hcreate&lt;/CODE&gt;. After a call to this
33322 function it is again possible to call &lt;CODE&gt;hcreate&lt;/CODE&gt; and allocate a new
33323 table with possibly different size.
33324 &lt;br&gt;&lt;br&gt; It is important to remember that the elements contained in the hashing
33325 table at the time &lt;CODE&gt;hdestroy&lt;/CODE&gt; is called are &lt;EM&gt;not&lt;/EM&gt; freed by this
33326 function. It is the responsibility of the program code to free those
33327 strings (if necessary at all). Freeing all the element memory is not
33328 possible without extra, separately kept information since there is no
33329 function to iterate through all available elements in the hashing table.
33330 If it is really necessary to free a table and all elements the
33331 programmer has to keep a list of all table elements and before calling
33332 &lt;CODE&gt;hdestroy&lt;/CODE&gt; s/he has to free all element's data using this list.
33333 This is a very unpleasant mechanism and it also shows that this kind of
33334 hashing tables is mainly meant for tables which are created once and
33335 used until the end of the program run.
33336 </synopsis>
33337 </function>
33338 </construct>
33339 <construct id="struct-ENTRY" type="struct">
33340 <structure>
33341 <synopsis>
33342 Both elements of this structure are pointers to zero-terminated strings.
33343 This is a limiting restriction of the functionality of the
33344 &lt;CODE&gt;hsearch&lt;/CODE&gt; functions. They can only be used for data sets which use
33345 the NUL character always and solely to terminate the records. It is not
33346 possible to handle general binary data.
33347 &lt;br&gt;&lt;br&gt;
33348 </synopsis>
33349 <elements>
33350 <element content="char *key">
33351 <synopsis>
33352 Pointer to a zero-terminated string of characters describing the key for
33353 the search or the element in the hashing table.
33354 </synopsis>
33355 </element>
33356 </elements>
33357 </structure>
33358 </construct>
33359 <construct id="function-hsearch" type="function">
33360 <function returntype="ENTRY *">
33361 <prototype>
33362 <parameter content="ENTRY item"/>
33363 <parameter content="ACTION action"/>
33364 </prototype>
33365 <headers>
33366 <header filename = "search.h"/>
33367 </headers>
33368 <synopsis>
33369 To search in a hashing table created using &lt;CODE&gt;hcreate&lt;/CODE&gt; the
33370 &lt;CODE&gt;hsearch&lt;/CODE&gt; function must be used. This function can perform simple
33371 search for an element (if &lt;VAR&gt;action&lt;/VAR&gt; has the &lt;CODE&gt;FIND&lt;/CODE&gt;) or it can
33372 alternatively insert the key element into the hashing table. Entries
33373 are never replaced.
33374 &lt;br&gt;&lt;br&gt; The key is denoted by a pointer to an object of type &lt;CODE&gt;ENTRY&lt;/CODE&gt;. For
33375 locating the corresponding position in the hashing table only the
33376 &lt;CODE&gt;key&lt;/CODE&gt; element of the structure is used.
33377 &lt;br&gt;&lt;br&gt; If an entry with matching key is found the &lt;VAR&gt;action&lt;/VAR&gt; parameter is
33378 irrelevant. The found entry is returned. If no matching entry is found
33379 and the &lt;VAR&gt;action&lt;/VAR&gt; parameter has the value &lt;CODE&gt;FIND&lt;/CODE&gt; the function
33380 returns a &lt;CODE&gt;NULL&lt;/CODE&gt; pointer. If no entry is found and the
33381 &lt;VAR&gt;action&lt;/VAR&gt; parameter has the value &lt;CODE&gt;ENTER&lt;/CODE&gt; a new entry is added
33382 to the hashing table which is initialized with the parameter &lt;VAR&gt;item&lt;/VAR&gt;.
33383 A pointer to the newly added entry is returned.
33384 </synopsis>
33385 </function>
33386 </construct>
33387 <construct id="function-hcreate_r" type="function">
33388 <function returntype="int">
33389 <prototype>
33390 <parameter content="size_t nel"/>
33391 <parameter content="struct hsearch_data *htab"/>
33392 </prototype>
33393 <headers>
33394 <header filename = "search.h"/>
33395 </headers>
33396 <synopsis>
33397 The &lt;CODE&gt;hcreate_r&lt;/CODE&gt; function initializes the object pointed to by
33398 &lt;VAR&gt;htab&lt;/VAR&gt; to contain a hashing table with at least &lt;VAR&gt;nel&lt;/VAR&gt; elements.
33399 So this function is equivalent to the &lt;CODE&gt;hcreate&lt;/CODE&gt; function except
33400 that the initialized data structure is controlled by the user.
33401 &lt;br&gt;&lt;br&gt; This allows having more than one hashing table at one time. The memory
33402 necessary for the &lt;CODE&gt;struct hsearch_data&lt;/CODE&gt; object can be allocated
33403 dynamically. It must be initialized with zero before calling this
33404 function.
33405 &lt;br&gt;&lt;br&gt; The return value is non-zero if the operation was successful. If the
33406 return value is zero, something went wrong, which probably means the
33407 programs ran out of memory.
33408 </synopsis>
33409 </function>
33410 </construct>
33411 <construct id="function-hdestroy_r" type="function">
33412 <function returntype="void">
33413 <prototype>
33414 <parameter content="struct hsearch_data *htab"/>
33415 </prototype>
33416 <headers>
33417 <header filename = "search.h"/>
33418 </headers>
33419 <synopsis>
33420 The &lt;CODE&gt;hdestroy_r&lt;/CODE&gt; function frees all resources allocated by the
33421 &lt;CODE&gt;hcreate_r&lt;/CODE&gt; function for this very same object &lt;VAR&gt;htab&lt;/VAR&gt;. As for
33422 &lt;CODE&gt;hdestroy&lt;/CODE&gt; it is the programs responsibility to free the strings
33423 for the elements of the table.
33424 </synopsis>
33425 </function>
33426 </construct>
33427 <construct id="function-hsearch_r" type="function">
33428 <function returntype="int">
33429 <prototype>
33430 <parameter content="ENTRY item"/>
33431 <parameter content="ACTION action"/>
33432 <parameter content="ENTRY **retval"/>
33433 <parameter content="struct hsearch_data *htab"/>
33434 </prototype>
33435 <headers>
33436 <header filename = "search.h"/>
33437 </headers>
33438 <synopsis>
33439 The &lt;CODE&gt;hsearch_r&lt;/CODE&gt; function is equivalent to &lt;CODE&gt;hsearch&lt;/CODE&gt;. The
33440 meaning of the first two arguments is identical. But instead of
33441 operating on a single global hashing table the function works on the
33442 table described by the object pointed to by &lt;VAR&gt;htab&lt;/VAR&gt; (which is
33443 initialized by a call to &lt;CODE&gt;hcreate_r&lt;/CODE&gt;).
33444 &lt;br&gt;&lt;br&gt; Another difference to &lt;CODE&gt;hcreate&lt;/CODE&gt; is that the pointer to the found
33445 entry in the table is not the return value of the functions. It is
33446 returned by storing it in a pointer variables pointed to by the
33447 &lt;VAR&gt;retval&lt;/VAR&gt; parameter. The return value of the function is an integer
33448 value indicating success if it is non-zero and failure if it is zero.
33449 In the latter case the global variable &lt;VAR&gt;errno&lt;/VAR&gt; signals the reason for
33450 the failure.
33451 &lt;br&gt;&lt;br&gt; &lt;DL&gt;
33452
33453 &lt;DT&gt;&lt;CODE&gt;ENOMEM&lt;/CODE&gt;
33454 &lt;DD&gt;
33455 The table is filled and &lt;CODE&gt;hsearch_r&lt;/CODE&gt; was called with an so far
33456 unknown key and &lt;VAR&gt;action&lt;/VAR&gt; set to &lt;CODE&gt;ENTER&lt;/CODE&gt;.
33457 &lt;LI&gt; ESRCH
33458 The &lt;VAR&gt;action&lt;/VAR&gt; parameter is &lt;CODE&gt;FIND&lt;/CODE&gt; and no corresponding element
33459 is found in the table.
33460
33461 </synopsis>
33462 </function>
33463 </construct>
33464 <construct id="function-tsearch" type="function">
33465 <function returntype="void *">
33466 <prototype>
33467 <parameter content="const void *key"/>
33468 <parameter content="void **rootp"/>
33469 <parameter content="comparison_fn_t compar"/>
33470 </prototype>
33471 <headers>
33472 <header filename = "search.h"/>
33473 </headers>
33474 <synopsis>
33475 The &lt;CODE&gt;tsearch&lt;/CODE&gt; function searches in the tree pointed to by
33476 &lt;CODE&gt;*&lt;VAR&gt;rootp&lt;/VAR&gt;&lt;/CODE&gt; for an element matching &lt;VAR&gt;key&lt;/VAR&gt;. The function
33477 pointed to by &lt;VAR&gt;compar&lt;/VAR&gt; is used to determine whether two elements
33478 match. , for a specification of the functions
33479 which can be used for the &lt;VAR&gt;compar&lt;/VAR&gt; parameter.
33480 &lt;br&gt;&lt;br&gt; If the tree does not contain a matching entry the &lt;VAR&gt;key&lt;/VAR&gt; value will
33481 be added to the tree. &lt;CODE&gt;tsearch&lt;/CODE&gt; does not make a copy of the object
33482 pointed to by &lt;VAR&gt;key&lt;/VAR&gt; (how could it since the size is unknown).
33483 Instead it adds a reference to this object which means the object must
33484 be available as long as the tree data structure is used.
33485 &lt;br&gt;&lt;br&gt; The tree is represented by a pointer to a pointer since it is sometimes
33486 necessary to change the root node of the tree. So it must not be
33487 assumed that the variable pointed to by &lt;VAR&gt;rootp&lt;/VAR&gt; has the same value
33488 after the call. This also shows that it is not safe to call the
33489 &lt;CODE&gt;tsearch&lt;/CODE&gt; function more than once at the same time using the same
33490 tree. It is no problem to run it more than once at a time on different
33491 trees.
33492 &lt;br&gt;&lt;br&gt; The return value is a pointer to the matching element in the tree. If a
33493 new element was created the pointer points to the new data (which is in
33494 fact &lt;VAR&gt;key&lt;/VAR&gt;). If an entry had to be created and the program ran out
33495 of space &lt;CODE&gt;NULL&lt;/CODE&gt; is returned.
33496 </synopsis>
33497 </function>
33498 </construct>
33499 <construct id="function-tfind" type="function">
33500 <function returntype="void *">
33501 <prototype>
33502 <parameter content="const void *key"/>
33503 <parameter content="void *const *rootp"/>
33504 <parameter content="comparison_fn_t compar"/>
33505 </prototype>
33506 <headers>
33507 <header filename = "search.h"/>
33508 </headers>
33509 <synopsis>
33510 The &lt;CODE&gt;tfind&lt;/CODE&gt; function is similar to the &lt;CODE&gt;tsearch&lt;/CODE&gt; function. It
33511 locates an element matching the one pointed to by &lt;VAR&gt;key&lt;/VAR&gt; and returns
33512 a pointer to this element. But if no matching element is available no
33513 new element is entered (note that the &lt;VAR&gt;rootp&lt;/VAR&gt; parameter points to a
33514 constant pointer). Instead the function returns &lt;CODE&gt;NULL&lt;/CODE&gt;.
33515 </synopsis>
33516 </function>
33517 </construct>
33518 <construct id="function-tdelete" type="function">
33519 <function returntype="void *">
33520 <prototype>
33521 <parameter content="const void *key"/>
33522 <parameter content="void **rootp"/>
33523 <parameter content="comparison_fn_t compar"/>
33524 </prototype>
33525 <headers>
33526 <header filename = "search.h"/>
33527 </headers>
33528 <synopsis>
33529 To remove a specific element matching &lt;VAR&gt;key&lt;/VAR&gt; from the tree
33530 &lt;CODE&gt;tdelete&lt;/CODE&gt; can be used. It locates the matching element using the
33531 same method as &lt;CODE&gt;tfind&lt;/CODE&gt;. The corresponding element is then removed
33532 and a pointer to the parent of the deleted node is returned by the
33533 function. If there is no matching entry in the tree nothing can be
33534 deleted and the function returns &lt;CODE&gt;NULL&lt;/CODE&gt;. If the root of the tree
33535 is deleted &lt;CODE&gt;tdelete&lt;/CODE&gt; returns some unspecified value not equal to
33536 &lt;CODE&gt;NULL&lt;/CODE&gt;.
33537 </synopsis>
33538 </function>
33539 </construct>
33540 <construct id="function-tdestroy" type="function">
33541 <function returntype="void">
33542 <prototype>
33543 <parameter content="void *vroot"/>
33544 <parameter content="__free_fn_t freefct"/>
33545 </prototype>
33546 <headers>
33547 <header filename = "search.h"/>
33548 </headers>
33549 <synopsis>
33550 If the complete search tree has to be removed one can use
33551 &lt;CODE&gt;tdestroy&lt;/CODE&gt;. It frees all resources allocated by the &lt;CODE&gt;tsearch&lt;/CODE&gt;
33552 function to generate the tree pointed to by &lt;VAR&gt;vroot&lt;/VAR&gt;.
33553 &lt;br&gt;&lt;br&gt; For the data in each tree node the function &lt;VAR&gt;freefct&lt;/VAR&gt; is called.
33554 The pointer to the data is passed as the argument to the function. If
33555 no such work is necessary &lt;VAR&gt;freefct&lt;/VAR&gt; must point to a function doing
33556 nothing. It is called in any case.
33557 &lt;br&gt;&lt;br&gt; This function is a GNU extension and not covered by the System V or
33558 X/Open specifications.
33559 </synopsis>
33560 </function>
33561 </construct>
33562 <construct id="dtype-VISIT" type="dtype">
33563 <structure>
33564 <synopsis>
33565 The &lt;CODE&gt;VISIT&lt;/CODE&gt; value indicates the status of the current node in the
33566 tree and how the function is called. The status of a node is either
33567 `leaf' or `internal node'. For each leaf node the function is called
33568 exactly once, for each internal node it is called three times: before
33569 the first child is processed, after the first child is processed and
33570 after both children are processed. This makes it possible to handle all
33571 three methods of tree traversal (or even a combination of them).
33572 &lt;br&gt;&lt;br&gt;
33573 </synopsis>
33574 <elements>
33575 <element content="preorder">
33576 <synopsis>
33577 The current node is an internal node and the function is called before
33578 the first child was processed.
33579 </synopsis>
33580 </element>
33581 <element content="postorder">
33582 <synopsis>
33583 The current node is an internal node and the function is called after
33584 the first child was processed.
33585 </synopsis>
33586 </element>
33587 <element content="endorder">
33588 <synopsis>
33589 The current node is an internal node and the function is called after
33590 the second child was processed.
33591 </synopsis>
33592 </element>
33593 </elements>
33594 </structure>
33595 </construct>
33596 <construct id="function-twalk" type="function">
33597 <function returntype="void">
33598 <prototype>
33599 <parameter content="const void *root"/>
33600 <parameter content="__action_fn_t action"/>
33601 </prototype>
33602 <headers>
33603 <header filename = "search.h"/>
33604 </headers>
33605 <synopsis>
33606 For each node in the tree with a node pointed to by &lt;VAR&gt;root&lt;/VAR&gt;, the
33607 &lt;CODE&gt;twalk&lt;/CODE&gt; function calls the function provided by the parameter
33608 &lt;VAR&gt;action&lt;/VAR&gt;. For leaf nodes the function is called exactly once with
33609 &lt;VAR&gt;value&lt;/VAR&gt; set to &lt;CODE&gt;leaf&lt;/CODE&gt;. For internal nodes the function is
33610 called three times, setting the &lt;VAR&gt;value&lt;/VAR&gt; parameter or &lt;VAR&gt;action&lt;/VAR&gt; to
33611 the appropriate value. The &lt;VAR&gt;level&lt;/VAR&gt; argument for the &lt;VAR&gt;action&lt;/VAR&gt;
33612 function is computed while descending the tree with increasing the value
33613 by one for the descend to a child, starting with the value 0 for
33614 the root node.
33615 &lt;br&gt;&lt;br&gt; Since the functions used for the &lt;VAR&gt;action&lt;/VAR&gt; parameter to &lt;CODE&gt;twalk&lt;/CODE&gt;
33616 must not modify the tree data, it is safe to run &lt;CODE&gt;twalk&lt;/CODE&gt; in more
33617 than one thread at the same time, working on the same tree. It is also
33618 safe to call &lt;CODE&gt;tfind&lt;/CODE&gt; in parallel. Functions which modify the tree
33619 must not be used, otherwise the behavior is undefined.
33620 </synopsis>
33621 </function>
33622 </construct>
33623 </descriptions>
+0
-5
libhover/org.eclipse.linuxtools.cdt.libhover.library.docs/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
libhover/org.eclipse.linuxtools.cdt.libhover.newlib/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
libhover/org.eclipse.linuxtools.cdt.libhover.newlib/data/newlib-1.16.0.libhover less more
Binary diff not shown
+0
-5
libhover/org.eclipse.linuxtools.cdt.libhover.newlib-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-4
libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
+0
-2
lttng/.gitignore less more
0 /target
1 */.settings/org.sonar.ide.eclipse.core.prefs
+0
-5
lttng/org.eclipse.linuxtools.ctf/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
lttng/org.eclipse.linuxtools.ctf.core/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-6
lttng/org.eclipse.linuxtools.ctf.core.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
5 Tests/*
+0
-5
lttng/org.eclipse.linuxtools.ctf.core.tests/traces/.gitignore less more
0 *.bz2
1 /kernel
2 /trace2
3 *.ht
4
+0
-5
lttng/org.eclipse.linuxtools.ctf.parser/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-2
lttng/org.eclipse.linuxtools.ctf.parser/src/org/eclipse/linuxtools/ctf/parser/.gitignore less more
0 /CTFParser.tokens
1 /CTFLexer.tokens
+0
-3484
lttng/org.eclipse.linuxtools.ctf.parser/src/org/eclipse/linuxtools/ctf/parser/CTFLexer.java less more
0 // $ANTLR !Unknown version! CTFLexer.g 2012-10-22 14:14:33
1
2 package org.eclipse.linuxtools.ctf.parser;
3
4 import org.antlr.runtime.BaseRecognizer;
5 import org.antlr.runtime.CharStream;
6 import org.antlr.runtime.DFA;
7 import org.antlr.runtime.EarlyExitException;
8 import org.antlr.runtime.Lexer;
9 import org.antlr.runtime.MismatchedSetException;
10 import org.antlr.runtime.NoViableAltException;
11 import org.antlr.runtime.RecognitionException;
12 import org.antlr.runtime.RecognizerSharedState;
13
14 @SuppressWarnings({ "javadoc", "nls", "incomplete-switch" })
15 public class CTFLexer extends Lexer {
16 public static final int SIGN = 50;
17 public static final int TERM = 48;
18 public static final int BOOLTOK = 26;
19 public static final int LT = 40;
20 public static final int TYPEDEFTOK = 22;
21 public static final int STRING_CONTENT = 71;
22 public static final int INTEGER_TYPES_SUFFIX = 54;
23 public static final int POINTER = 49;
24 public static final int HEX_PREFIX = 58;
25 public static final int INTTOK = 13;
26 public static final int SEPARATOR = 35;
27 public static final int TYPE_ASSIGNMENT = 39;
28 public static final int ENUMTOK = 8;
29 public static final int COMPLEXTOK = 27;
30 public static final int IMAGINARYTOK = 28;
31 public static final int DOUBLEQUOTE = 70;
32 public static final int STREAMTOK = 17;
33 public static final int EOF = -1;
34 public static final int LPAREN = 44;
35 public static final int INFINITYTOK = 33;
36 public static final int STRINGPREFIX = 66;
37 public static final int UNSIGNEDTOK = 23;
38 public static final int ESCAPE_SEQUENCE = 65;
39 public static final int CHAR_CONTENT = 68;
40 public static final int RPAREN = 45;
41 public static final int UNICODE_ESCAPE = 63;
42 public static final int STRING_LITERAL = 72;
43 public static final int CALLSITETOK = 31;
44 public static final int SINGLEQUOTE = 67;
45 public static final int IDENTIFIER = 79;
46 public static final int ALIGNTOK = 4;
47 public static final int FLOATTOK = 11;
48 public static final int COMMENT_CLOSE = 75;
49 public static final int STRINGTOK = 18;
50 public static final int HEX_LITERAL = 60;
51 public static final int DIGIT = 56;
52 public static final int COMMENT = 76;
53 public static final int DOT = 52;
54 public static final int STRUCTTOK = 19;
55 public static final int ENVTOK = 29;
56 public static final int TYPEALIASTOK = 21;
57 public static final int OPENBRAC = 42;
58 public static final int FLOATINGPOINTTOK = 10;
59 public static final int EVENTTOK = 9;
60 public static final int LINE_COMMENT = 77;
61 public static final int NINFINITYTOK = 34;
62 public static final int VOIDTOK = 25;
63 public static final int DOUBLETOK = 7;
64 public static final int CHARACTER_LITERAL = 69;
65 public static final int OCTAL_LITERAL = 55;
66 public static final int COMMENT_OPEN = 74;
67 public static final int HEX_DIGIT = 59;
68 public static final int OCTAL_ESCAPE = 62;
69 public static final int NANNUMBERTOK = 32;
70 public static final int LONGTOK = 14;
71 public static final int CLOCKTOK = 30;
72 public static final int SIGNEDTOK = 16;
73 public static final int TRACETOK = 20;
74 public static final int COLON = 36;
75 public static final int HEXADECIMAL_ESCAPE = 64;
76 public static final int CHARTOK = 6;
77 public static final int LCURL = 46;
78 public static final int WS = 73;
79 public static final int INTEGERTOK = 12;
80 public static final int VARIANTTOK = 24;
81 public static final int ELIPSES = 37;
82 public static final int NONDIGIT = 78;
83 public static final int RCURL = 47;
84 public static final int ARROW = 51;
85 public static final int GT = 41;
86 public static final int ASSIGNMENT = 38;
87 public static final int SHORTTOK = 15;
88 public static final int NONZERO_DIGIT = 61;
89 public static final int DECIMAL_LITERAL = 57;
90 public static final int CONSTTOK = 5;
91 public static final int BACKSLASH = 53;
92 public static final int CLOSEBRAC = 43;
93
94 // delegates
95 // delegators
96
97 public CTFLexer() {
98 }
99
100 public CTFLexer(CharStream input) {
101 this(input, new RecognizerSharedState());
102 }
103
104 public CTFLexer(CharStream input, RecognizerSharedState state) {
105 super(input, state);
106
107 }
108
109 @Override
110 public String getGrammarFileName() {
111 return "CTFLexer.g";
112 }
113
114 // $ANTLR start "ALIGNTOK"
115 public final void mALIGNTOK() throws RecognitionException {
116 try {
117 int _type = ALIGNTOK;
118 int _channel = DEFAULT_TOKEN_CHANNEL;
119 // CTFLexer.g:18:18: ( 'align' )
120 // CTFLexer.g:18:20: 'align'
121 {
122 match("align");
123
124 }
125
126 state.type = _type;
127 state.channel = _channel;
128 } finally {
129 }
130 }
131
132 // $ANTLR end "ALIGNTOK"
133
134 // $ANTLR start "CONSTTOK"
135 public final void mCONSTTOK() throws RecognitionException {
136 try {
137 int _type = CONSTTOK;
138 int _channel = DEFAULT_TOKEN_CHANNEL;
139 // CTFLexer.g:19:18: ( 'const' )
140 // CTFLexer.g:19:20: 'const'
141 {
142 match("const");
143
144 }
145
146 state.type = _type;
147 state.channel = _channel;
148 } finally {
149 }
150 }
151
152 // $ANTLR end "CONSTTOK"
153
154 // $ANTLR start "CHARTOK"
155 public final void mCHARTOK() throws RecognitionException {
156 try {
157 int _type = CHARTOK;
158 int _channel = DEFAULT_TOKEN_CHANNEL;
159 // CTFLexer.g:20:18: ( 'char' )
160 // CTFLexer.g:20:20: 'char'
161 {
162 match("char");
163
164 }
165
166 state.type = _type;
167 state.channel = _channel;
168 } finally {
169 }
170 }
171
172 // $ANTLR end "CHARTOK"
173
174 // $ANTLR start "DOUBLETOK"
175 public final void mDOUBLETOK() throws RecognitionException {
176 try {
177 int _type = DOUBLETOK;
178 int _channel = DEFAULT_TOKEN_CHANNEL;
179 // CTFLexer.g:21:18: ( 'double' )
180 // CTFLexer.g:21:20: 'double'
181 {
182 match("double");
183
184 }
185
186 state.type = _type;
187 state.channel = _channel;
188 } finally {
189 }
190 }
191
192 // $ANTLR end "DOUBLETOK"
193
194 // $ANTLR start "ENUMTOK"
195 public final void mENUMTOK() throws RecognitionException {
196 try {
197 int _type = ENUMTOK;
198 int _channel = DEFAULT_TOKEN_CHANNEL;
199 // CTFLexer.g:22:18: ( 'enum' )
200 // CTFLexer.g:22:20: 'enum'
201 {
202 match("enum");
203
204 }
205
206 state.type = _type;
207 state.channel = _channel;
208 } finally {
209 }
210 }
211
212 // $ANTLR end "ENUMTOK"
213
214 // $ANTLR start "EVENTTOK"
215 public final void mEVENTTOK() throws RecognitionException {
216 try {
217 int _type = EVENTTOK;
218 int _channel = DEFAULT_TOKEN_CHANNEL;
219 // CTFLexer.g:23:18: ( 'event' )
220 // CTFLexer.g:23:20: 'event'
221 {
222 match("event");
223
224 }
225
226 state.type = _type;
227 state.channel = _channel;
228 } finally {
229 }
230 }
231
232 // $ANTLR end "EVENTTOK"
233
234 // $ANTLR start "FLOATINGPOINTTOK"
235 public final void mFLOATINGPOINTTOK() throws RecognitionException {
236 try {
237 int _type = FLOATINGPOINTTOK;
238 int _channel = DEFAULT_TOKEN_CHANNEL;
239 // CTFLexer.g:24:18: ( 'floating_point' )
240 // CTFLexer.g:24:20: 'floating_point'
241 {
242 match("floating_point");
243
244 }
245
246 state.type = _type;
247 state.channel = _channel;
248 } finally {
249 }
250 }
251
252 // $ANTLR end "FLOATINGPOINTTOK"
253
254 // $ANTLR start "FLOATTOK"
255 public final void mFLOATTOK() throws RecognitionException {
256 try {
257 int _type = FLOATTOK;
258 int _channel = DEFAULT_TOKEN_CHANNEL;
259 // CTFLexer.g:25:18: ( 'float' )
260 // CTFLexer.g:25:20: 'float'
261 {
262 match("float");
263
264 }
265
266 state.type = _type;
267 state.channel = _channel;
268 } finally {
269 }
270 }
271
272 // $ANTLR end "FLOATTOK"
273
274 // $ANTLR start "INTEGERTOK"
275 public final void mINTEGERTOK() throws RecognitionException {
276 try {
277 int _type = INTEGERTOK;
278 int _channel = DEFAULT_TOKEN_CHANNEL;
279 // CTFLexer.g:26:18: ( 'integer' )
280 // CTFLexer.g:26:20: 'integer'
281 {
282 match("integer");
283
284 }
285
286 state.type = _type;
287 state.channel = _channel;
288 } finally {
289 }
290 }
291
292 // $ANTLR end "INTEGERTOK"
293
294 // $ANTLR start "INTTOK"
295 public final void mINTTOK() throws RecognitionException {
296 try {
297 int _type = INTTOK;
298 int _channel = DEFAULT_TOKEN_CHANNEL;
299 // CTFLexer.g:27:18: ( 'int' )
300 // CTFLexer.g:27:20: 'int'
301 {
302 match("int");
303
304 }
305
306 state.type = _type;
307 state.channel = _channel;
308 } finally {
309 }
310 }
311
312 // $ANTLR end "INTTOK"
313
314 // $ANTLR start "LONGTOK"
315 public final void mLONGTOK() throws RecognitionException {
316 try {
317 int _type = LONGTOK;
318 int _channel = DEFAULT_TOKEN_CHANNEL;
319 // CTFLexer.g:28:18: ( 'long' )
320 // CTFLexer.g:28:20: 'long'
321 {
322 match("long");
323
324 }
325
326 state.type = _type;
327 state.channel = _channel;
328 } finally {
329 }
330 }
331
332 // $ANTLR end "LONGTOK"
333
334 // $ANTLR start "SHORTTOK"
335 public final void mSHORTTOK() throws RecognitionException {
336 try {
337 int _type = SHORTTOK;
338 int _channel = DEFAULT_TOKEN_CHANNEL;
339 // CTFLexer.g:29:18: ( 'short' )
340 // CTFLexer.g:29:20: 'short'
341 {
342 match("short");
343
344 }
345
346 state.type = _type;
347 state.channel = _channel;
348 } finally {
349 }
350 }
351
352 // $ANTLR end "SHORTTOK"
353
354 // $ANTLR start "SIGNEDTOK"
355 public final void mSIGNEDTOK() throws RecognitionException {
356 try {
357 int _type = SIGNEDTOK;
358 int _channel = DEFAULT_TOKEN_CHANNEL;
359 // CTFLexer.g:30:18: ( 'signed' )
360 // CTFLexer.g:30:20: 'signed'
361 {
362 match("signed");
363
364 }
365
366 state.type = _type;
367 state.channel = _channel;
368 } finally {
369 }
370 }
371
372 // $ANTLR end "SIGNEDTOK"
373
374 // $ANTLR start "STREAMTOK"
375 public final void mSTREAMTOK() throws RecognitionException {
376 try {
377 int _type = STREAMTOK;
378 int _channel = DEFAULT_TOKEN_CHANNEL;
379 // CTFLexer.g:31:18: ( 'stream' )
380 // CTFLexer.g:31:20: 'stream'
381 {
382 match("stream");
383
384 }
385
386 state.type = _type;
387 state.channel = _channel;
388 } finally {
389 }
390 }
391
392 // $ANTLR end "STREAMTOK"
393
394 // $ANTLR start "STRINGTOK"
395 public final void mSTRINGTOK() throws RecognitionException {
396 try {
397 int _type = STRINGTOK;
398 int _channel = DEFAULT_TOKEN_CHANNEL;
399 // CTFLexer.g:32:18: ( 'string' )
400 // CTFLexer.g:32:20: 'string'
401 {
402 match("string");
403
404 }
405
406 state.type = _type;
407 state.channel = _channel;
408 } finally {
409 }
410 }
411
412 // $ANTLR end "STRINGTOK"
413
414 // $ANTLR start "STRUCTTOK"
415 public final void mSTRUCTTOK() throws RecognitionException {
416 try {
417 int _type = STRUCTTOK;
418 int _channel = DEFAULT_TOKEN_CHANNEL;
419 // CTFLexer.g:33:18: ( 'struct' )
420 // CTFLexer.g:33:20: 'struct'
421 {
422 match("struct");
423
424 }
425
426 state.type = _type;
427 state.channel = _channel;
428 } finally {
429 }
430 }
431
432 // $ANTLR end "STRUCTTOK"
433
434 // $ANTLR start "TRACETOK"
435 public final void mTRACETOK() throws RecognitionException {
436 try {
437 int _type = TRACETOK;
438 int _channel = DEFAULT_TOKEN_CHANNEL;
439 // CTFLexer.g:34:18: ( 'trace' )
440 // CTFLexer.g:34:20: 'trace'
441 {
442 match("trace");
443
444 }
445
446 state.type = _type;
447 state.channel = _channel;
448 } finally {
449 }
450 }
451
452 // $ANTLR end "TRACETOK"
453
454 // $ANTLR start "TYPEALIASTOK"
455 public final void mTYPEALIASTOK() throws RecognitionException {
456 try {
457 int _type = TYPEALIASTOK;
458 int _channel = DEFAULT_TOKEN_CHANNEL;
459 // CTFLexer.g:35:18: ( 'typealias' )
460 // CTFLexer.g:35:20: 'typealias'
461 {
462 match("typealias");
463
464 }
465
466 state.type = _type;
467 state.channel = _channel;
468 } finally {
469 }
470 }
471
472 // $ANTLR end "TYPEALIASTOK"
473
474 // $ANTLR start "TYPEDEFTOK"
475 public final void mTYPEDEFTOK() throws RecognitionException {
476 try {
477 int _type = TYPEDEFTOK;
478 int _channel = DEFAULT_TOKEN_CHANNEL;
479 // CTFLexer.g:36:18: ( 'typedef' )
480 // CTFLexer.g:36:20: 'typedef'
481 {
482 match("typedef");
483
484 }
485
486 state.type = _type;
487 state.channel = _channel;
488 } finally {
489 }
490 }
491
492 // $ANTLR end "TYPEDEFTOK"
493
494 // $ANTLR start "UNSIGNEDTOK"
495 public final void mUNSIGNEDTOK() throws RecognitionException {
496 try {
497 int _type = UNSIGNEDTOK;
498 int _channel = DEFAULT_TOKEN_CHANNEL;
499 // CTFLexer.g:37:18: ( 'unsigned' )
500 // CTFLexer.g:37:20: 'unsigned'
501 {
502 match("unsigned");
503
504 }
505
506 state.type = _type;
507 state.channel = _channel;
508 } finally {
509 }
510 }
511
512 // $ANTLR end "UNSIGNEDTOK"
513
514 // $ANTLR start "VARIANTTOK"
515 public final void mVARIANTTOK() throws RecognitionException {
516 try {
517 int _type = VARIANTTOK;
518 int _channel = DEFAULT_TOKEN_CHANNEL;
519 // CTFLexer.g:38:18: ( 'variant' )
520 // CTFLexer.g:38:20: 'variant'
521 {
522 match("variant");
523
524 }
525
526 state.type = _type;
527 state.channel = _channel;
528 } finally {
529 }
530 }
531
532 // $ANTLR end "VARIANTTOK"
533
534 // $ANTLR start "VOIDTOK"
535 public final void mVOIDTOK() throws RecognitionException {
536 try {
537 int _type = VOIDTOK;
538 int _channel = DEFAULT_TOKEN_CHANNEL;
539 // CTFLexer.g:39:18: ( 'void' )
540 // CTFLexer.g:39:20: 'void'
541 {
542 match("void");
543
544 }
545
546 state.type = _type;
547 state.channel = _channel;
548 } finally {
549 }
550 }
551
552 // $ANTLR end "VOIDTOK"
553
554 // $ANTLR start "BOOLTOK"
555 public final void mBOOLTOK() throws RecognitionException {
556 try {
557 int _type = BOOLTOK;
558 int _channel = DEFAULT_TOKEN_CHANNEL;
559 // CTFLexer.g:40:18: ( '_Bool' )
560 // CTFLexer.g:40:20: '_Bool'
561 {
562 match("_Bool");
563
564 }
565
566 state.type = _type;
567 state.channel = _channel;
568 } finally {
569 }
570 }
571
572 // $ANTLR end "BOOLTOK"
573
574 // $ANTLR start "COMPLEXTOK"
575 public final void mCOMPLEXTOK() throws RecognitionException {
576 try {
577 int _type = COMPLEXTOK;
578 int _channel = DEFAULT_TOKEN_CHANNEL;
579 // CTFLexer.g:41:18: ( '_Complex' )
580 // CTFLexer.g:41:20: '_Complex'
581 {
582 match("_Complex");
583
584 }
585
586 state.type = _type;
587 state.channel = _channel;
588 } finally {
589 }
590 }
591
592 // $ANTLR end "COMPLEXTOK"
593
594 // $ANTLR start "IMAGINARYTOK"
595 public final void mIMAGINARYTOK() throws RecognitionException {
596 try {
597 int _type = IMAGINARYTOK;
598 int _channel = DEFAULT_TOKEN_CHANNEL;
599 // CTFLexer.g:42:18: ( '_Imaginary' )
600 // CTFLexer.g:42:20: '_Imaginary'
601 {
602 match("_Imaginary");
603
604 }
605
606 state.type = _type;
607 state.channel = _channel;
608 } finally {
609 }
610 }
611
612 // $ANTLR end "IMAGINARYTOK"
613
614 // $ANTLR start "ENVTOK"
615 public final void mENVTOK() throws RecognitionException {
616 try {
617 int _type = ENVTOK;
618 int _channel = DEFAULT_TOKEN_CHANNEL;
619 // CTFLexer.g:43:18: ( 'env' )
620 // CTFLexer.g:43:20: 'env'
621 {
622 match("env");
623
624 }
625
626 state.type = _type;
627 state.channel = _channel;
628 } finally {
629 }
630 }
631
632 // $ANTLR end "ENVTOK"
633
634 // $ANTLR start "CLOCKTOK"
635 public final void mCLOCKTOK() throws RecognitionException {
636 try {
637 int _type = CLOCKTOK;
638 int _channel = DEFAULT_TOKEN_CHANNEL;
639 // CTFLexer.g:44:18: ( 'clock' )
640 // CTFLexer.g:44:20: 'clock'
641 {
642 match("clock");
643
644 }
645
646 state.type = _type;
647 state.channel = _channel;
648 } finally {
649 }
650 }
651
652 // $ANTLR end "CLOCKTOK"
653
654 // $ANTLR start "CALLSITETOK"
655 public final void mCALLSITETOK() throws RecognitionException {
656 try {
657 int _type = CALLSITETOK;
658 int _channel = DEFAULT_TOKEN_CHANNEL;
659 // CTFLexer.g:48:18: ( 'callsite' )
660 // CTFLexer.g:48:20: 'callsite'
661 {
662 match("callsite");
663
664 }
665
666 state.type = _type;
667 state.channel = _channel;
668 } finally {
669 }
670 }
671
672 // $ANTLR end "CALLSITETOK"
673
674 // $ANTLR start "NANNUMBERTOK"
675 public final void mNANNUMBERTOK() throws RecognitionException {
676 try {
677 int _type = NANNUMBERTOK;
678 int _channel = DEFAULT_TOKEN_CHANNEL;
679 // CTFLexer.g:54:15: ( 'NaN' )
680 // CTFLexer.g:54:17: 'NaN'
681 {
682 match("NaN");
683
684 }
685
686 state.type = _type;
687 state.channel = _channel;
688 } finally {
689 }
690 }
691
692 // $ANTLR end "NANNUMBERTOK"
693
694 // $ANTLR start "INFINITYTOK"
695 public final void mINFINITYTOK() throws RecognitionException {
696 try {
697 int _type = INFINITYTOK;
698 int _channel = DEFAULT_TOKEN_CHANNEL;
699 // CTFLexer.g:55:15: ( '+inf' )
700 // CTFLexer.g:55:17: '+inf'
701 {
702 match("+inf");
703
704 }
705
706 state.type = _type;
707 state.channel = _channel;
708 } finally {
709 }
710 }
711
712 // $ANTLR end "INFINITYTOK"
713
714 // $ANTLR start "NINFINITYTOK"
715 public final void mNINFINITYTOK() throws RecognitionException {
716 try {
717 int _type = NINFINITYTOK;
718 int _channel = DEFAULT_TOKEN_CHANNEL;
719 // CTFLexer.g:56:15: ( '-inf' )
720 // CTFLexer.g:56:17: '-inf'
721 {
722 match("-inf");
723
724 }
725
726 state.type = _type;
727 state.channel = _channel;
728 } finally {
729 }
730 }
731
732 // $ANTLR end "NINFINITYTOK"
733
734 // $ANTLR start "SEPARATOR"
735 public final void mSEPARATOR() throws RecognitionException {
736 try {
737 int _type = SEPARATOR;
738 int _channel = DEFAULT_TOKEN_CHANNEL;
739 // CTFLexer.g:61:20: ( ',' )
740 // CTFLexer.g:61:22: ','
741 {
742 match(',');
743
744 }
745
746 state.type = _type;
747 state.channel = _channel;
748 } finally {
749 }
750 }
751
752 // $ANTLR end "SEPARATOR"
753
754 // $ANTLR start "COLON"
755 public final void mCOLON() throws RecognitionException {
756 try {
757 int _type = COLON;
758 int _channel = DEFAULT_TOKEN_CHANNEL;
759 // CTFLexer.g:62:20: ( ':' )
760 // CTFLexer.g:62:22: ':'
761 {
762 match(':');
763
764 }
765
766 state.type = _type;
767 state.channel = _channel;
768 } finally {
769 }
770 }
771
772 // $ANTLR end "COLON"
773
774 // $ANTLR start "ELIPSES"
775 public final void mELIPSES() throws RecognitionException {
776 try {
777 int _type = ELIPSES;
778 int _channel = DEFAULT_TOKEN_CHANNEL;
779 // CTFLexer.g:63:20: ( '...' )
780 // CTFLexer.g:63:22: '...'
781 {
782 match("...");
783
784 }
785
786 state.type = _type;
787 state.channel = _channel;
788 } finally {
789 }
790 }
791
792 // $ANTLR end "ELIPSES"
793
794 // $ANTLR start "ASSIGNMENT"
795 public final void mASSIGNMENT() throws RecognitionException {
796 try {
797 int _type = ASSIGNMENT;
798 int _channel = DEFAULT_TOKEN_CHANNEL;
799 // CTFLexer.g:64:20: ( '=' )
800 // CTFLexer.g:64:22: '='
801 {
802 match('=');
803
804 }
805
806 state.type = _type;
807 state.channel = _channel;
808 } finally {
809 }
810 }
811
812 // $ANTLR end "ASSIGNMENT"
813
814 // $ANTLR start "TYPE_ASSIGNMENT"
815 public final void mTYPE_ASSIGNMENT() throws RecognitionException {
816 try {
817 int _type = TYPE_ASSIGNMENT;
818 int _channel = DEFAULT_TOKEN_CHANNEL;
819 // CTFLexer.g:65:20: ( ':=' )
820 // CTFLexer.g:65:22: ':='
821 {
822 match(":=");
823
824 }
825
826 state.type = _type;
827 state.channel = _channel;
828 } finally {
829 }
830 }
831
832 // $ANTLR end "TYPE_ASSIGNMENT"
833
834 // $ANTLR start "LT"
835 public final void mLT() throws RecognitionException {
836 try {
837 int _type = LT;
838 int _channel = DEFAULT_TOKEN_CHANNEL;
839 // CTFLexer.g:66:20: ( '<' )
840 // CTFLexer.g:66:22: '<'
841 {
842 match('<');
843
844 }
845
846 state.type = _type;
847 state.channel = _channel;
848 } finally {
849 }
850 }
851
852 // $ANTLR end "LT"
853
854 // $ANTLR start "GT"
855 public final void mGT() throws RecognitionException {
856 try {
857 int _type = GT;
858 int _channel = DEFAULT_TOKEN_CHANNEL;
859 // CTFLexer.g:67:20: ( '>' )
860 // CTFLexer.g:67:22: '>'
861 {
862 match('>');
863
864 }
865
866 state.type = _type;
867 state.channel = _channel;
868 } finally {
869 }
870 }
871
872 // $ANTLR end "GT"
873
874 // $ANTLR start "OPENBRAC"
875 public final void mOPENBRAC() throws RecognitionException {
876 try {
877 int _type = OPENBRAC;
878 int _channel = DEFAULT_TOKEN_CHANNEL;
879 // CTFLexer.g:68:20: ( '[' )
880 // CTFLexer.g:68:22: '['
881 {
882 match('[');
883
884 }
885
886 state.type = _type;
887 state.channel = _channel;
888 } finally {
889 }
890 }
891
892 // $ANTLR end "OPENBRAC"
893
894 // $ANTLR start "CLOSEBRAC"
895 public final void mCLOSEBRAC() throws RecognitionException {
896 try {
897 int _type = CLOSEBRAC;
898 int _channel = DEFAULT_TOKEN_CHANNEL;
899 // CTFLexer.g:69:20: ( ']' )
900 // CTFLexer.g:69:22: ']'
901 {
902 match(']');
903
904 }
905
906 state.type = _type;
907 state.channel = _channel;
908 } finally {
909 }
910 }
911
912 // $ANTLR end "CLOSEBRAC"
913
914 // $ANTLR start "LPAREN"
915 public final void mLPAREN() throws RecognitionException {
916 try {
917 int _type = LPAREN;
918 int _channel = DEFAULT_TOKEN_CHANNEL;
919 // CTFLexer.g:70:20: ( '(' )
920 // CTFLexer.g:70:22: '('
921 {
922 match('(');
923
924 }
925
926 state.type = _type;
927 state.channel = _channel;
928 } finally {
929 }
930 }
931
932 // $ANTLR end "LPAREN"
933
934 // $ANTLR start "RPAREN"
935 public final void mRPAREN() throws RecognitionException {
936 try {
937 int _type = RPAREN;
938 int _channel = DEFAULT_TOKEN_CHANNEL;
939 // CTFLexer.g:71:20: ( ')' )
940 // CTFLexer.g:71:22: ')'
941 {
942 match(')');
943
944 }
945
946 state.type = _type;
947 state.channel = _channel;
948 } finally {
949 }
950 }
951
952 // $ANTLR end "RPAREN"
953
954 // $ANTLR start "LCURL"
955 public final void mLCURL() throws RecognitionException {
956 try {
957 int _type = LCURL;
958 int _channel = DEFAULT_TOKEN_CHANNEL;
959 // CTFLexer.g:72:20: ( '{' )
960 // CTFLexer.g:72:22: '{'
961 {
962 match('{');
963
964 }
965
966 state.type = _type;
967 state.channel = _channel;
968 } finally {
969 }
970 }
971
972 // $ANTLR end "LCURL"
973
974 // $ANTLR start "RCURL"
975 public final void mRCURL() throws RecognitionException {
976 try {
977 int _type = RCURL;
978 int _channel = DEFAULT_TOKEN_CHANNEL;
979 // CTFLexer.g:73:20: ( '}' )
980 // CTFLexer.g:73:22: '}'
981 {
982 match('}');
983
984 }
985
986 state.type = _type;
987 state.channel = _channel;
988 } finally {
989 }
990 }
991
992 // $ANTLR end "RCURL"
993
994 // $ANTLR start "TERM"
995 public final void mTERM() throws RecognitionException {
996 try {
997 int _type = TERM;
998 int _channel = DEFAULT_TOKEN_CHANNEL;
999 // CTFLexer.g:74:20: ( ';' )
1000 // CTFLexer.g:74:22: ';'
1001 {
1002 match(';');
1003
1004 }
1005
1006 state.type = _type;
1007 state.channel = _channel;
1008 } finally {
1009 }
1010 }
1011
1012 // $ANTLR end "TERM"
1013
1014 // $ANTLR start "POINTER"
1015 public final void mPOINTER() throws RecognitionException {
1016 try {
1017 int _type = POINTER;
1018 int _channel = DEFAULT_TOKEN_CHANNEL;
1019 // CTFLexer.g:75:20: ( '*' )
1020 // CTFLexer.g:75:22: '*'
1021 {
1022 match('*');
1023
1024 }
1025
1026 state.type = _type;
1027 state.channel = _channel;
1028 } finally {
1029 }
1030 }
1031
1032 // $ANTLR end "POINTER"
1033
1034 // $ANTLR start "SIGN"
1035 public final void mSIGN() throws RecognitionException {
1036 try {
1037 int _type = SIGN;
1038 int _channel = DEFAULT_TOKEN_CHANNEL;
1039 // CTFLexer.g:76:20: ( '+' | '-' )
1040 // CTFLexer.g:
1041 {
1042 if (input.LA(1) == '+' || input.LA(1) == '-') {
1043 input.consume();
1044
1045 } else {
1046 MismatchedSetException mse = new MismatchedSetException(
1047 null, input);
1048 recover(mse);
1049 throw mse;
1050 }
1051
1052 }
1053
1054 state.type = _type;
1055 state.channel = _channel;
1056 } finally {
1057 }
1058 }
1059
1060 // $ANTLR end "SIGN"
1061
1062 // $ANTLR start "ARROW"
1063 public final void mARROW() throws RecognitionException {
1064 try {
1065 int _type = ARROW;
1066 int _channel = DEFAULT_TOKEN_CHANNEL;
1067 // CTFLexer.g:77:20: ( '->' )
1068 // CTFLexer.g:77:22: '->'
1069 {
1070 match("->");
1071
1072 }
1073
1074 state.type = _type;
1075 state.channel = _channel;
1076 } finally {
1077 }
1078 }
1079
1080 // $ANTLR end "ARROW"
1081
1082 // $ANTLR start "DOT"
1083 public final void mDOT() throws RecognitionException {
1084 try {
1085 int _type = DOT;
1086 int _channel = DEFAULT_TOKEN_CHANNEL;
1087 // CTFLexer.g:78:20: ( '.' )
1088 // CTFLexer.g:78:22: '.'
1089 {
1090 match('.');
1091
1092 }
1093
1094 state.type = _type;
1095 state.channel = _channel;
1096 } finally {
1097 }
1098 }
1099
1100 // $ANTLR end "DOT"
1101
1102 // $ANTLR start "BACKSLASH"
1103 public final void mBACKSLASH() throws RecognitionException {
1104 try {
1105 // CTFLexer.g:79:20: ( '\\\\' )
1106 // CTFLexer.g:79:22: '\\\\'
1107 {
1108 match('\\');
1109
1110 }
1111
1112 } finally {
1113 }
1114 }
1115
1116 // $ANTLR end "BACKSLASH"
1117
1118 // $ANTLR start "OCTAL_LITERAL"
1119 public final void mOCTAL_LITERAL() throws RecognitionException {
1120 try {
1121 int _type = OCTAL_LITERAL;
1122 int _channel = DEFAULT_TOKEN_CHANNEL;
1123 // CTFLexer.g:94:15: ( '0' ( '0' .. '7' )+ ( INTEGER_TYPES_SUFFIX )?
1124 // )
1125 // CTFLexer.g:94:17: '0' ( '0' .. '7' )+ ( INTEGER_TYPES_SUFFIX )?
1126 {
1127 match('0');
1128 // CTFLexer.g:94:21: ( '0' .. '7' )+
1129 int cnt1 = 0;
1130 loop1: do {
1131 int alt1 = 2;
1132 int LA1_0 = input.LA(1);
1133
1134 if (((LA1_0 >= '0' && LA1_0 <= '7'))) {
1135 alt1 = 1;
1136 }
1137
1138 switch (alt1) {
1139 case 1:
1140 // CTFLexer.g:94:22: '0' .. '7'
1141 {
1142 matchRange('0', '7');
1143
1144 }
1145 break;
1146
1147 default:
1148 if (cnt1 >= 1) {
1149 break loop1;
1150 }
1151 EarlyExitException eee = new EarlyExitException(1,
1152 input);
1153 throw eee;
1154 }
1155 cnt1++;
1156 } while (true);
1157
1158 // CTFLexer.g:94:33: ( INTEGER_TYPES_SUFFIX )?
1159 int alt2 = 2;
1160 int LA2_0 = input.LA(1);
1161
1162 if ((LA2_0 == 'L' || LA2_0 == 'U' || LA2_0 == 'l' || LA2_0 == 'u')) {
1163 alt2 = 1;
1164 }
1165 switch (alt2) {
1166 case 1:
1167 // CTFLexer.g:94:33: INTEGER_TYPES_SUFFIX
1168 {
1169 mINTEGER_TYPES_SUFFIX();
1170
1171 }
1172 break;
1173
1174 }
1175
1176 }
1177
1178 state.type = _type;
1179 state.channel = _channel;
1180 } finally {
1181 }
1182 }
1183
1184 // $ANTLR end "OCTAL_LITERAL"
1185
1186 // $ANTLR start "DECIMAL_LITERAL"
1187 public final void mDECIMAL_LITERAL() throws RecognitionException {
1188 try {
1189 int _type = DECIMAL_LITERAL;
1190 int _channel = DEFAULT_TOKEN_CHANNEL;
1191 // CTFLexer.g:96:17: ( ( DIGIT )+ ( INTEGER_TYPES_SUFFIX )? )
1192 // CTFLexer.g:96:19: ( DIGIT )+ ( INTEGER_TYPES_SUFFIX )?
1193 {
1194 // CTFLexer.g:96:19: ( DIGIT )+
1195 int cnt3 = 0;
1196 loop3: do {
1197 int alt3 = 2;
1198 int LA3_0 = input.LA(1);
1199
1200 if (((LA3_0 >= '0' && LA3_0 <= '9'))) {
1201 alt3 = 1;
1202 }
1203
1204 switch (alt3) {
1205 case 1:
1206 // CTFLexer.g:96:19: DIGIT
1207 {
1208 mDIGIT();
1209
1210 }
1211 break;
1212
1213 default:
1214 if (cnt3 >= 1) {
1215 break loop3;
1216 }
1217 EarlyExitException eee = new EarlyExitException(3,
1218 input);
1219 throw eee;
1220 }
1221 cnt3++;
1222 } while (true);
1223
1224 // CTFLexer.g:96:26: ( INTEGER_TYPES_SUFFIX )?
1225 int alt4 = 2;
1226 int LA4_0 = input.LA(1);
1227
1228 if ((LA4_0 == 'L' || LA4_0 == 'U' || LA4_0 == 'l' || LA4_0 == 'u')) {
1229 alt4 = 1;
1230 }
1231 switch (alt4) {
1232 case 1:
1233 // CTFLexer.g:96:26: INTEGER_TYPES_SUFFIX
1234 {
1235 mINTEGER_TYPES_SUFFIX();
1236
1237 }
1238 break;
1239
1240 }
1241
1242 }
1243
1244 state.type = _type;
1245 state.channel = _channel;
1246 } finally {
1247 }
1248 }
1249
1250 // $ANTLR end "DECIMAL_LITERAL"
1251
1252 // $ANTLR start "HEX_LITERAL"
1253 public final void mHEX_LITERAL() throws RecognitionException {
1254 try {
1255 int _type = HEX_LITERAL;
1256 int _channel = DEFAULT_TOKEN_CHANNEL;
1257 // CTFLexer.g:98:13: ( HEX_PREFIX ( HEX_DIGIT )+ (
1258 // INTEGER_TYPES_SUFFIX )? )
1259 // CTFLexer.g:98:15: HEX_PREFIX ( HEX_DIGIT )+ (
1260 // INTEGER_TYPES_SUFFIX )?
1261 {
1262 mHEX_PREFIX();
1263 // CTFLexer.g:98:26: ( HEX_DIGIT )+
1264 int cnt5 = 0;
1265 loop5: do {
1266 int alt5 = 2;
1267 int LA5_0 = input.LA(1);
1268
1269 if (((LA5_0 >= '0' && LA5_0 <= '9')
1270 || (LA5_0 >= 'A' && LA5_0 <= 'F') || (LA5_0 >= 'a' && LA5_0 <= 'f'))) {
1271 alt5 = 1;
1272 }
1273
1274 switch (alt5) {
1275 case 1:
1276 // CTFLexer.g:98:26: HEX_DIGIT
1277 {
1278 mHEX_DIGIT();
1279
1280 }
1281 break;
1282
1283 default:
1284 if (cnt5 >= 1) {
1285 break loop5;
1286 }
1287 EarlyExitException eee = new EarlyExitException(5,
1288 input);
1289 throw eee;
1290 }
1291 cnt5++;
1292 } while (true);
1293
1294 // CTFLexer.g:98:37: ( INTEGER_TYPES_SUFFIX )?
1295 int alt6 = 2;
1296 int LA6_0 = input.LA(1);
1297
1298 if ((LA6_0 == 'L' || LA6_0 == 'U' || LA6_0 == 'l' || LA6_0 == 'u')) {
1299 alt6 = 1;
1300 }
1301 switch (alt6) {
1302 case 1:
1303 // CTFLexer.g:98:37: INTEGER_TYPES_SUFFIX
1304 {
1305 mINTEGER_TYPES_SUFFIX();
1306
1307 }
1308 break;
1309
1310 }
1311
1312 }
1313
1314 state.type = _type;
1315 state.channel = _channel;
1316 } finally {
1317 }
1318 }
1319
1320 // $ANTLR end "HEX_LITERAL"
1321
1322 // $ANTLR start "HEX_DIGIT"
1323 public final void mHEX_DIGIT() throws RecognitionException {
1324 try {
1325 // CTFLexer.g:99:20: ( DIGIT | ( 'a' .. 'f' ) | ( 'A' .. 'F' ) )
1326 int alt7 = 3;
1327 switch (input.LA(1)) {
1328 case '0':
1329 case '1':
1330 case '2':
1331 case '3':
1332 case '4':
1333 case '5':
1334 case '6':
1335 case '7':
1336 case '8':
1337 case '9': {
1338 alt7 = 1;
1339 }
1340 break;
1341 case 'a':
1342 case 'b':
1343 case 'c':
1344 case 'd':
1345 case 'e':
1346 case 'f': {
1347 alt7 = 2;
1348 }
1349 break;
1350 case 'A':
1351 case 'B':
1352 case 'C':
1353 case 'D':
1354 case 'E':
1355 case 'F': {
1356 alt7 = 3;
1357 }
1358 break;
1359 default:
1360 NoViableAltException nvae = new NoViableAltException("", 7, 0,
1361 input);
1362
1363 throw nvae;
1364 }
1365
1366 switch (alt7) {
1367 case 1:
1368 // CTFLexer.g:99:22: DIGIT
1369 {
1370 mDIGIT();
1371
1372 }
1373 break;
1374 case 2:
1375 // CTFLexer.g:99:30: ( 'a' .. 'f' )
1376 {
1377 // CTFLexer.g:99:30: ( 'a' .. 'f' )
1378 // CTFLexer.g:99:31: 'a' .. 'f'
1379 {
1380 matchRange('a', 'f');
1381
1382 }
1383
1384 }
1385 break;
1386 case 3:
1387 // CTFLexer.g:99:43: ( 'A' .. 'F' )
1388 {
1389 // CTFLexer.g:99:43: ( 'A' .. 'F' )
1390 // CTFLexer.g:99:44: 'A' .. 'F'
1391 {
1392 matchRange('A', 'F');
1393
1394 }
1395
1396 }
1397 break;
1398
1399 }
1400 } finally {
1401 }
1402 }
1403
1404 // $ANTLR end "HEX_DIGIT"
1405
1406 // $ANTLR start "HEX_PREFIX"
1407 public final void mHEX_PREFIX() throws RecognitionException {
1408 try {
1409 // CTFLexer.g:100:21: ( '0' ( 'x' | 'X' ) )
1410 // CTFLexer.g:100:23: '0' ( 'x' | 'X' )
1411 {
1412 match('0');
1413 if (input.LA(1) == 'X' || input.LA(1) == 'x') {
1414 input.consume();
1415
1416 } else {
1417 MismatchedSetException mse = new MismatchedSetException(
1418 null, input);
1419 recover(mse);
1420 throw mse;
1421 }
1422
1423 }
1424
1425 } finally {
1426 }
1427 }
1428
1429 // $ANTLR end "HEX_PREFIX"
1430
1431 // $ANTLR start "DIGIT"
1432 public final void mDIGIT() throws RecognitionException {
1433 try {
1434 // CTFLexer.g:103:16: ( '0' .. '9' )
1435 // CTFLexer.g:103:18: '0' .. '9'
1436 {
1437 matchRange('0', '9');
1438
1439 }
1440
1441 } finally {
1442 }
1443 }
1444
1445 // $ANTLR end "DIGIT"
1446
1447 // $ANTLR start "NONZERO_DIGIT"
1448 public final void mNONZERO_DIGIT() throws RecognitionException {
1449 try {
1450 // CTFLexer.g:104:24: ( '1' .. '9' )
1451 // CTFLexer.g:104:26: '1' .. '9'
1452 {
1453 matchRange('1', '9');
1454
1455 }
1456
1457 } finally {
1458 }
1459 }
1460
1461 // $ANTLR end "NONZERO_DIGIT"
1462
1463 // $ANTLR start "INTEGER_TYPES_SUFFIX"
1464 public final void mINTEGER_TYPES_SUFFIX() throws RecognitionException {
1465 try {
1466 // CTFLexer.g:112:31: ( ( 'l' ( 'l' )? | 'L' ( 'L' )? ) | ( 'u' |
1467 // 'U' ) | ( 'u' | 'U' ) ( 'l' ( 'l' )? | 'L' ( 'L' )? ) | ( 'l' (
1468 // 'l' )? | 'L' ( 'L' )? ) ( 'u' | 'U' ) )
1469 int alt17 = 4;
1470 alt17 = dfa17.predict(input);
1471 switch (alt17) {
1472 case 1:
1473 // CTFLexer.g:113:4: ( 'l' ( 'l' )? | 'L' ( 'L' )? )
1474 {
1475 // CTFLexer.g:113:4: ( 'l' ( 'l' )? | 'L' ( 'L' )? )
1476 int alt10 = 2;
1477 int LA10_0 = input.LA(1);
1478
1479 if ((LA10_0 == 'l')) {
1480 alt10 = 1;
1481 } else if ((LA10_0 == 'L')) {
1482 alt10 = 2;
1483 } else {
1484 NoViableAltException nvae = new NoViableAltException("",
1485 10, 0, input);
1486
1487 throw nvae;
1488 }
1489 switch (alt10) {
1490 case 1:
1491 // CTFLexer.g:113:5: 'l' ( 'l' )?
1492 {
1493 match('l');
1494 // CTFLexer.g:113:9: ( 'l' )?
1495 int alt8 = 2;
1496 int LA8_0 = input.LA(1);
1497
1498 if ((LA8_0 == 'l')) {
1499 alt8 = 1;
1500 }
1501 switch (alt8) {
1502 case 1:
1503 // CTFLexer.g:113:10: 'l'
1504 {
1505 match('l');
1506
1507 }
1508 break;
1509
1510 }
1511
1512 }
1513 break;
1514 case 2:
1515 // CTFLexer.g:113:18: 'L' ( 'L' )?
1516 {
1517 match('L');
1518 // CTFLexer.g:113:22: ( 'L' )?
1519 int alt9 = 2;
1520 int LA9_0 = input.LA(1);
1521
1522 if ((LA9_0 == 'L')) {
1523 alt9 = 1;
1524 }
1525 switch (alt9) {
1526 case 1:
1527 // CTFLexer.g:113:23: 'L'
1528 {
1529 match('L');
1530
1531 }
1532 break;
1533
1534 }
1535
1536 }
1537 break;
1538
1539 }
1540
1541 }
1542 break;
1543 case 2:
1544 // CTFLexer.g:114:4: ( 'u' | 'U' )
1545 {
1546 if (input.LA(1) == 'U' || input.LA(1) == 'u') {
1547 input.consume();
1548
1549 } else {
1550 MismatchedSetException mse = new MismatchedSetException(
1551 null, input);
1552 recover(mse);
1553 throw mse;
1554 }
1555
1556 }
1557 break;
1558 case 3:
1559 // CTFLexer.g:115:4: ( 'u' | 'U' ) ( 'l' ( 'l' )? | 'L' ( 'L' )? )
1560 {
1561 if (input.LA(1) == 'U' || input.LA(1) == 'u') {
1562 input.consume();
1563
1564 } else {
1565 MismatchedSetException mse = new MismatchedSetException(
1566 null, input);
1567 recover(mse);
1568 throw mse;
1569 }
1570
1571 // CTFLexer.g:115:16: ( 'l' ( 'l' )? | 'L' ( 'L' )? )
1572 int alt13 = 2;
1573 int LA13_0 = input.LA(1);
1574
1575 if ((LA13_0 == 'l')) {
1576 alt13 = 1;
1577 } else if ((LA13_0 == 'L')) {
1578 alt13 = 2;
1579 } else {
1580 NoViableAltException nvae = new NoViableAltException("",
1581 13, 0, input);
1582
1583 throw nvae;
1584 }
1585 switch (alt13) {
1586 case 1:
1587 // CTFLexer.g:115:17: 'l' ( 'l' )?
1588 {
1589 match('l');
1590 // CTFLexer.g:115:21: ( 'l' )?
1591 int alt11 = 2;
1592 int LA11_0 = input.LA(1);
1593
1594 if ((LA11_0 == 'l')) {
1595 alt11 = 1;
1596 }
1597 switch (alt11) {
1598 case 1:
1599 // CTFLexer.g:115:22: 'l'
1600 {
1601 match('l');
1602
1603 }
1604 break;
1605
1606 }
1607
1608 }
1609 break;
1610 case 2:
1611 // CTFLexer.g:115:30: 'L' ( 'L' )?
1612 {
1613 match('L');
1614 // CTFLexer.g:115:34: ( 'L' )?
1615 int alt12 = 2;
1616 int LA12_0 = input.LA(1);
1617
1618 if ((LA12_0 == 'L')) {
1619 alt12 = 1;
1620 }
1621 switch (alt12) {
1622 case 1:
1623 // CTFLexer.g:115:35: 'L'
1624 {
1625 match('L');
1626
1627 }
1628 break;
1629
1630 }
1631
1632 }
1633 break;
1634
1635 }
1636
1637 }
1638 break;
1639 case 4:
1640 // CTFLexer.g:116:4: ( 'l' ( 'l' )? | 'L' ( 'L' )? ) ( 'u' | 'U' )
1641 {
1642 // CTFLexer.g:116:4: ( 'l' ( 'l' )? | 'L' ( 'L' )? )
1643 int alt16 = 2;
1644 int LA16_0 = input.LA(1);
1645
1646 if ((LA16_0 == 'l')) {
1647 alt16 = 1;
1648 } else if ((LA16_0 == 'L')) {
1649 alt16 = 2;
1650 } else {
1651 NoViableAltException nvae = new NoViableAltException("",
1652 16, 0, input);
1653
1654 throw nvae;
1655 }
1656 switch (alt16) {
1657 case 1:
1658 // CTFLexer.g:116:5: 'l' ( 'l' )?
1659 {
1660 match('l');
1661 // CTFLexer.g:116:9: ( 'l' )?
1662 int alt14 = 2;
1663 int LA14_0 = input.LA(1);
1664
1665 if ((LA14_0 == 'l')) {
1666 alt14 = 1;
1667 }
1668 switch (alt14) {
1669 case 1:
1670 // CTFLexer.g:116:10: 'l'
1671 {
1672 match('l');
1673
1674 }
1675 break;
1676
1677 }
1678
1679 }
1680 break;
1681 case 2:
1682 // CTFLexer.g:116:18: 'L' ( 'L' )?
1683 {
1684 match('L');
1685 // CTFLexer.g:116:22: ( 'L' )?
1686 int alt15 = 2;
1687 int LA15_0 = input.LA(1);
1688
1689 if ((LA15_0 == 'L')) {
1690 alt15 = 1;
1691 }
1692 switch (alt15) {
1693 case 1:
1694 // CTFLexer.g:116:23: 'L'
1695 {
1696 match('L');
1697
1698 }
1699 break;
1700
1701 }
1702
1703 }
1704 break;
1705
1706 }
1707
1708 if (input.LA(1) == 'U' || input.LA(1) == 'u') {
1709 input.consume();
1710
1711 } else {
1712 MismatchedSetException mse = new MismatchedSetException(
1713 null, input);
1714 recover(mse);
1715 throw mse;
1716 }
1717
1718 }
1719 break;
1720
1721 }
1722 } finally {
1723 }
1724 }
1725
1726 // $ANTLR end "INTEGER_TYPES_SUFFIX"
1727
1728 // $ANTLR start "ESCAPE_SEQUENCE"
1729 public final void mESCAPE_SEQUENCE() throws RecognitionException {
1730 try {
1731 // CTFLexer.g:122:26: ( BACKSLASH ( '\\'' | '\"' | '?' | BACKSLASH |
1732 // 'a' | 'b' | 'f' | 'n' | 'r' | 't' | 'v' ) | OCTAL_ESCAPE |
1733 // UNICODE_ESCAPE | HEXADECIMAL_ESCAPE )
1734 int alt18 = 4;
1735 int LA18_0 = input.LA(1);
1736
1737 if ((LA18_0 == '\\')) {
1738 switch (input.LA(2)) {
1739 case 'x': {
1740 alt18 = 4;
1741 }
1742 break;
1743 case '0':
1744 case '1':
1745 case '2':
1746 case '3':
1747 case '4':
1748 case '5':
1749 case '6':
1750 case '7': {
1751 alt18 = 2;
1752 }
1753 break;
1754 case '\"':
1755 case '\'':
1756 case '?':
1757 case '\\':
1758 case 'a':
1759 case 'b':
1760 case 'f':
1761 case 'n':
1762 case 'r':
1763 case 't':
1764 case 'v': {
1765 alt18 = 1;
1766 }
1767 break;
1768 case 'U':
1769 case 'u': {
1770 alt18 = 3;
1771 }
1772 break;
1773 default:
1774 NoViableAltException nvae = new NoViableAltException("",
1775 18, 1, input);
1776
1777 throw nvae;
1778 }
1779
1780 } else {
1781 NoViableAltException nvae = new NoViableAltException("", 18, 0,
1782 input);
1783
1784 throw nvae;
1785 }
1786 switch (alt18) {
1787 case 1:
1788 // CTFLexer.g:123:4: BACKSLASH ( '\\'' | '\"' | '?' | BACKSLASH |
1789 // 'a' | 'b' | 'f' | 'n' | 'r' | 't' | 'v' )
1790 {
1791 mBACKSLASH();
1792 if (input.LA(1) == '\"' || input.LA(1) == '\''
1793 || input.LA(1) == '?' || input.LA(1) == '\\'
1794 || (input.LA(1) >= 'a' && input.LA(1) <= 'b')
1795 || input.LA(1) == 'f' || input.LA(1) == 'n'
1796 || input.LA(1) == 'r' || input.LA(1) == 't'
1797 || input.LA(1) == 'v') {
1798 input.consume();
1799
1800 } else {
1801 MismatchedSetException mse = new MismatchedSetException(
1802 null, input);
1803 recover(mse);
1804 throw mse;
1805 }
1806
1807 }
1808 break;
1809 case 2:
1810 // CTFLexer.g:124:4: OCTAL_ESCAPE
1811 {
1812 mOCTAL_ESCAPE();
1813
1814 }
1815 break;
1816 case 3:
1817 // CTFLexer.g:125:4: UNICODE_ESCAPE
1818 {
1819 mUNICODE_ESCAPE();
1820
1821 }
1822 break;
1823 case 4:
1824 // CTFLexer.g:126:4: HEXADECIMAL_ESCAPE
1825 {
1826 mHEXADECIMAL_ESCAPE();
1827
1828 }
1829 break;
1830
1831 }
1832 } finally {
1833 }
1834 }
1835
1836 // $ANTLR end "ESCAPE_SEQUENCE"
1837
1838 // $ANTLR start "OCTAL_ESCAPE"
1839 public final void mOCTAL_ESCAPE() throws RecognitionException {
1840 try {
1841 // CTFLexer.g:132:23: ( BACKSLASH ( '0' .. '3' ) ( '0' .. '7' ) (
1842 // '0' .. '7' ) | BACKSLASH ( '0' .. '7' ) ( '0' .. '7' ) |
1843 // BACKSLASH ( '0' .. '7' ) )
1844 int alt19 = 3;
1845 int LA19_0 = input.LA(1);
1846
1847 if ((LA19_0 == '\\')) {
1848 int LA19_1 = input.LA(2);
1849
1850 if (((LA19_1 >= '0' && LA19_1 <= '3'))) {
1851 int LA19_2 = input.LA(3);
1852
1853 if (((LA19_2 >= '0' && LA19_2 <= '7'))) {
1854 int LA19_4 = input.LA(4);
1855
1856 if (((LA19_4 >= '0' && LA19_4 <= '7'))) {
1857 alt19 = 1;
1858 } else {
1859 alt19 = 2;
1860 }
1861 } else {
1862 alt19 = 3;
1863 }
1864 } else if (((LA19_1 >= '4' && LA19_1 <= '7'))) {
1865 int LA19_3 = input.LA(3);
1866
1867 if (((LA19_3 >= '0' && LA19_3 <= '7'))) {
1868 alt19 = 2;
1869 } else {
1870 alt19 = 3;
1871 }
1872 } else {
1873 NoViableAltException nvae = new NoViableAltException("",
1874 19, 1, input);
1875
1876 throw nvae;
1877 }
1878 } else {
1879 NoViableAltException nvae = new NoViableAltException("", 19, 0,
1880 input);
1881
1882 throw nvae;
1883 }
1884 switch (alt19) {
1885 case 1:
1886 // CTFLexer.g:133:5: BACKSLASH ( '0' .. '3' ) ( '0' .. '7' ) ( '0'
1887 // .. '7' )
1888 {
1889 mBACKSLASH();
1890 // CTFLexer.g:133:15: ( '0' .. '3' )
1891 // CTFLexer.g:133:16: '0' .. '3'
1892 {
1893 matchRange('0', '3');
1894
1895 }
1896
1897 // CTFLexer.g:133:26: ( '0' .. '7' )
1898 // CTFLexer.g:133:27: '0' .. '7'
1899 {
1900 matchRange('0', '7');
1901
1902 }
1903
1904 // CTFLexer.g:133:37: ( '0' .. '7' )
1905 // CTFLexer.g:133:38: '0' .. '7'
1906 {
1907 matchRange('0', '7');
1908
1909 }
1910
1911 }
1912 break;
1913 case 2:
1914 // CTFLexer.g:134:5: BACKSLASH ( '0' .. '7' ) ( '0' .. '7' )
1915 {
1916 mBACKSLASH();
1917 // CTFLexer.g:134:15: ( '0' .. '7' )
1918 // CTFLexer.g:134:16: '0' .. '7'
1919 {
1920 matchRange('0', '7');
1921
1922 }
1923
1924 // CTFLexer.g:134:26: ( '0' .. '7' )
1925 // CTFLexer.g:134:27: '0' .. '7'
1926 {
1927 matchRange('0', '7');
1928
1929 }
1930
1931 }
1932 break;
1933 case 3:
1934 // CTFLexer.g:135:5: BACKSLASH ( '0' .. '7' )
1935 {
1936 mBACKSLASH();
1937 // CTFLexer.g:135:15: ( '0' .. '7' )
1938 // CTFLexer.g:135:16: '0' .. '7'
1939 {
1940 matchRange('0', '7');
1941
1942 }
1943
1944 }
1945 break;
1946
1947 }
1948 } finally {
1949 }
1950 }
1951
1952 // $ANTLR end "OCTAL_ESCAPE"
1953
1954 // $ANTLR start "HEXADECIMAL_ESCAPE"
1955 public final void mHEXADECIMAL_ESCAPE() throws RecognitionException {
1956 try {
1957 // CTFLexer.g:141:29: ( BACKSLASH 'x' ( HEX_DIGIT )+ )
1958 // CTFLexer.g:141:31: BACKSLASH 'x' ( HEX_DIGIT )+
1959 {
1960 mBACKSLASH();
1961 match('x');
1962 // CTFLexer.g:141:45: ( HEX_DIGIT )+
1963 int cnt20 = 0;
1964 loop20: do {
1965 int alt20 = 2;
1966 int LA20_0 = input.LA(1);
1967
1968 if (((LA20_0 >= '0' && LA20_0 <= '9')
1969 || (LA20_0 >= 'A' && LA20_0 <= 'F') || (LA20_0 >= 'a' && LA20_0 <= 'f'))) {
1970 alt20 = 1;
1971 }
1972
1973 switch (alt20) {
1974 case 1:
1975 // CTFLexer.g:141:45: HEX_DIGIT
1976 {
1977 mHEX_DIGIT();
1978
1979 }
1980 break;
1981
1982 default:
1983 if (cnt20 >= 1) {
1984 break loop20;
1985 }
1986 EarlyExitException eee = new EarlyExitException(20,
1987 input);
1988 throw eee;
1989 }
1990 cnt20++;
1991 } while (true);
1992
1993 }
1994
1995 } finally {
1996 }
1997 }
1998
1999 // $ANTLR end "HEXADECIMAL_ESCAPE"
2000
2001 // $ANTLR start "UNICODE_ESCAPE"
2002 public final void mUNICODE_ESCAPE() throws RecognitionException {
2003 try {
2004 // CTFLexer.g:146:25: ( BACKSLASH 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT
2005 // HEX_DIGIT | BACKSLASH 'U' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT
2006 // HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT )
2007 int alt21 = 2;
2008 int LA21_0 = input.LA(1);
2009
2010 if ((LA21_0 == '\\')) {
2011 int LA21_1 = input.LA(2);
2012
2013 if ((LA21_1 == 'U')) {
2014 alt21 = 2;
2015 } else if ((LA21_1 == 'u')) {
2016 alt21 = 1;
2017 } else {
2018 NoViableAltException nvae = new NoViableAltException("",
2019 21, 1, input);
2020
2021 throw nvae;
2022 }
2023 } else {
2024 NoViableAltException nvae = new NoViableAltException("", 21, 0,
2025 input);
2026
2027 throw nvae;
2028 }
2029 switch (alt21) {
2030 case 1:
2031 // CTFLexer.g:147:5: BACKSLASH 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT
2032 // HEX_DIGIT
2033 {
2034 mBACKSLASH();
2035 match('u');
2036 mHEX_DIGIT();
2037 mHEX_DIGIT();
2038 mHEX_DIGIT();
2039 mHEX_DIGIT();
2040
2041 }
2042 break;
2043 case 2:
2044 // CTFLexer.g:148:5: BACKSLASH 'U' HEX_DIGIT HEX_DIGIT HEX_DIGIT
2045 // HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT
2046 {
2047 mBACKSLASH();
2048 match('U');
2049 mHEX_DIGIT();
2050 mHEX_DIGIT();
2051 mHEX_DIGIT();
2052 mHEX_DIGIT();
2053 mHEX_DIGIT();
2054 mHEX_DIGIT();
2055 mHEX_DIGIT();
2056 mHEX_DIGIT();
2057
2058 }
2059 break;
2060
2061 }
2062 } finally {
2063 }
2064 }
2065
2066 // $ANTLR end "UNICODE_ESCAPE"
2067
2068 // $ANTLR start "STRINGPREFIX"
2069 public final void mSTRINGPREFIX() throws RecognitionException {
2070 try {
2071 // CTFLexer.g:153:23: ( 'L' )
2072 // CTFLexer.g:153:25: 'L'
2073 {
2074 match('L');
2075
2076 }
2077
2078 } finally {
2079 }
2080 }
2081
2082 // $ANTLR end "STRINGPREFIX"
2083
2084 // $ANTLR start "CHARACTER_LITERAL"
2085 public final void mCHARACTER_LITERAL() throws RecognitionException {
2086 try {
2087 int _type = CHARACTER_LITERAL;
2088 int _channel = DEFAULT_TOKEN_CHANNEL;
2089 // CTFLexer.g:158:19: ( ( STRINGPREFIX )? SINGLEQUOTE ( CHAR_CONTENT
2090 // )+ SINGLEQUOTE )
2091 // CTFLexer.g:158:21: ( STRINGPREFIX )? SINGLEQUOTE ( CHAR_CONTENT
2092 // )+ SINGLEQUOTE
2093 {
2094 // CTFLexer.g:158:21: ( STRINGPREFIX )?
2095 int alt22 = 2;
2096 int LA22_0 = input.LA(1);
2097
2098 if ((LA22_0 == 'L')) {
2099 alt22 = 1;
2100 }
2101 switch (alt22) {
2102 case 1:
2103 // CTFLexer.g:158:21: STRINGPREFIX
2104 {
2105 mSTRINGPREFIX();
2106
2107 }
2108 break;
2109
2110 }
2111
2112 mSINGLEQUOTE();
2113 // CTFLexer.g:158:47: ( CHAR_CONTENT )+
2114 int cnt23 = 0;
2115 loop23: do {
2116 int alt23 = 2;
2117 int LA23_0 = input.LA(1);
2118
2119 if (((LA23_0 >= '\u0000' && LA23_0 <= '&') || (LA23_0 >= '(' && LA23_0 <= '\uFFFF'))) {
2120 alt23 = 1;
2121 }
2122
2123 switch (alt23) {
2124 case 1:
2125 // CTFLexer.g:158:47: CHAR_CONTENT
2126 {
2127 mCHAR_CONTENT();
2128
2129 }
2130 break;
2131
2132 default:
2133 if (cnt23 >= 1) {
2134 break loop23;
2135 }
2136 EarlyExitException eee = new EarlyExitException(23,
2137 input);
2138 throw eee;
2139 }
2140 cnt23++;
2141 } while (true);
2142
2143 mSINGLEQUOTE();
2144
2145 }
2146
2147 state.type = _type;
2148 state.channel = _channel;
2149 } finally {
2150 }
2151 }
2152
2153 // $ANTLR end "CHARACTER_LITERAL"
2154
2155 // $ANTLR start "CHAR_CONTENT"
2156 public final void mCHAR_CONTENT() throws RecognitionException {
2157 try {
2158 // CTFLexer.g:159:23: ( ( ESCAPE_SEQUENCE | ~ ( BACKSLASH |
2159 // SINGLEQUOTE ) ) )
2160 // CTFLexer.g:159:25: ( ESCAPE_SEQUENCE | ~ ( BACKSLASH |
2161 // SINGLEQUOTE ) )
2162 {
2163 // CTFLexer.g:159:25: ( ESCAPE_SEQUENCE | ~ ( BACKSLASH |
2164 // SINGLEQUOTE ) )
2165 int alt24 = 2;
2166 int LA24_0 = input.LA(1);
2167
2168 if ((LA24_0 == '\\')) {
2169 alt24 = 1;
2170 } else if (((LA24_0 >= '\u0000' && LA24_0 <= '&')
2171 || (LA24_0 >= '(' && LA24_0 <= '[') || (LA24_0 >= ']' && LA24_0 <= '\uFFFF'))) {
2172 alt24 = 2;
2173 } else {
2174 NoViableAltException nvae = new NoViableAltException("",
2175 24, 0, input);
2176
2177 throw nvae;
2178 }
2179 switch (alt24) {
2180 case 1:
2181 // CTFLexer.g:159:26: ESCAPE_SEQUENCE
2182 {
2183 mESCAPE_SEQUENCE();
2184
2185 }
2186 break;
2187 case 2:
2188 // CTFLexer.g:159:44: ~ ( BACKSLASH | SINGLEQUOTE )
2189 {
2190 if ((input.LA(1) >= '\u0000' && input.LA(1) <= '&')
2191 || (input.LA(1) >= '(' && input.LA(1) <= '[')
2192 || (input.LA(1) >= ']' && input.LA(1) <= '\uFFFF')) {
2193 input.consume();
2194
2195 } else {
2196 MismatchedSetException mse = new MismatchedSetException(
2197 null, input);
2198 recover(mse);
2199 throw mse;
2200 }
2201
2202 }
2203 break;
2204
2205 }
2206
2207 }
2208
2209 } finally {
2210 }
2211 }
2212
2213 // $ANTLR end "CHAR_CONTENT"
2214
2215 // $ANTLR start "SINGLEQUOTE"
2216 public final void mSINGLEQUOTE() throws RecognitionException {
2217 try {
2218 // CTFLexer.g:160:22: ( '\\'' )
2219 // CTFLexer.g:160:24: '\\''
2220 {
2221 match('\'');
2222
2223 }
2224
2225 } finally {
2226 }
2227 }
2228
2229 // $ANTLR end "SINGLEQUOTE"
2230
2231 // $ANTLR start "STRING_LITERAL"
2232 public final void mSTRING_LITERAL() throws RecognitionException {
2233 try {
2234 int _type = STRING_LITERAL;
2235 int _channel = DEFAULT_TOKEN_CHANNEL;
2236 // CTFLexer.g:165:16: ( ( STRINGPREFIX )? DOUBLEQUOTE (
2237 // STRING_CONTENT )* DOUBLEQUOTE )
2238 // CTFLexer.g:165:18: ( STRINGPREFIX )? DOUBLEQUOTE ( STRING_CONTENT
2239 // )* DOUBLEQUOTE
2240 {
2241 // CTFLexer.g:165:18: ( STRINGPREFIX )?
2242 int alt25 = 2;
2243 int LA25_0 = input.LA(1);
2244
2245 if ((LA25_0 == 'L')) {
2246 alt25 = 1;
2247 }
2248 switch (alt25) {
2249 case 1:
2250 // CTFLexer.g:165:18: STRINGPREFIX
2251 {
2252 mSTRINGPREFIX();
2253
2254 }
2255 break;
2256
2257 }
2258
2259 mDOUBLEQUOTE();
2260 // CTFLexer.g:165:44: ( STRING_CONTENT )*
2261 loop26: do {
2262 int alt26 = 2;
2263 int LA26_0 = input.LA(1);
2264
2265 if (((LA26_0 >= '\u0000' && LA26_0 <= '!') || (LA26_0 >= '#' && LA26_0 <= '\uFFFF'))) {
2266 alt26 = 1;
2267 }
2268
2269 switch (alt26) {
2270 case 1:
2271 // CTFLexer.g:165:44: STRING_CONTENT
2272 {
2273 mSTRING_CONTENT();
2274
2275 }
2276 break;
2277
2278 default:
2279 break loop26;
2280 }
2281 } while (true);
2282
2283 mDOUBLEQUOTE();
2284
2285 }
2286
2287 state.type = _type;
2288 state.channel = _channel;
2289 } finally {
2290 }
2291 }
2292
2293 // $ANTLR end "STRING_LITERAL"
2294
2295 // $ANTLR start "STRING_CONTENT"
2296 public final void mSTRING_CONTENT() throws RecognitionException {
2297 try {
2298 // CTFLexer.g:166:25: ( ( ESCAPE_SEQUENCE | ~ ( BACKSLASH |
2299 // DOUBLEQUOTE ) ) )
2300 // CTFLexer.g:166:27: ( ESCAPE_SEQUENCE | ~ ( BACKSLASH |
2301 // DOUBLEQUOTE ) )
2302 {
2303 // CTFLexer.g:166:27: ( ESCAPE_SEQUENCE | ~ ( BACKSLASH |
2304 // DOUBLEQUOTE ) )
2305 int alt27 = 2;
2306 int LA27_0 = input.LA(1);
2307
2308 if ((LA27_0 == '\\')) {
2309 alt27 = 1;
2310 } else if (((LA27_0 >= '\u0000' && LA27_0 <= '!')
2311 || (LA27_0 >= '#' && LA27_0 <= '[') || (LA27_0 >= ']' && LA27_0 <= '\uFFFF'))) {
2312 alt27 = 2;
2313 } else {
2314 NoViableAltException nvae = new NoViableAltException("",
2315 27, 0, input);
2316
2317 throw nvae;
2318 }
2319 switch (alt27) {
2320 case 1:
2321 // CTFLexer.g:166:28: ESCAPE_SEQUENCE
2322 {
2323 mESCAPE_SEQUENCE();
2324
2325 }
2326 break;
2327 case 2:
2328 // CTFLexer.g:166:46: ~ ( BACKSLASH | DOUBLEQUOTE )
2329 {
2330 if ((input.LA(1) >= '\u0000' && input.LA(1) <= '!')
2331 || (input.LA(1) >= '#' && input.LA(1) <= '[')
2332 || (input.LA(1) >= ']' && input.LA(1) <= '\uFFFF')) {
2333 input.consume();
2334
2335 } else {
2336 MismatchedSetException mse = new MismatchedSetException(
2337 null, input);
2338 recover(mse);
2339 throw mse;
2340 }
2341
2342 }
2343 break;
2344
2345 }
2346
2347 }
2348
2349 } finally {
2350 }
2351 }
2352
2353 // $ANTLR end "STRING_CONTENT"
2354
2355 // $ANTLR start "DOUBLEQUOTE"
2356 public final void mDOUBLEQUOTE() throws RecognitionException {
2357 try {
2358 // CTFLexer.g:167:22: ( '\"' )
2359 // CTFLexer.g:167:24: '\"'
2360 {
2361 match('\"');
2362
2363 }
2364
2365 } finally {
2366 }
2367 }
2368
2369 // $ANTLR end "DOUBLEQUOTE"
2370
2371 // $ANTLR start "WS"
2372 public final void mWS() throws RecognitionException {
2373 try {
2374 int _type = WS;
2375 int _channel = DEFAULT_TOKEN_CHANNEL;
2376 // CTFLexer.g:172:4: ( ( ' ' | '\\r' | '\\t' | '\ ' | '\\n' ) )
2377 // CTFLexer.g:172:6: ( ' ' | '\\r' | '\\t' | '\ ' | '\\n' )
2378 {
2379 if ((input.LA(1) >= '\t' && input.LA(1) <= '\n')
2380 || (input.LA(1) >= '\f' && input.LA(1) <= '\r')
2381 || input.LA(1) == ' ') {
2382 input.consume();
2383
2384 } else {
2385 MismatchedSetException mse = new MismatchedSetException(
2386 null, input);
2387 recover(mse);
2388 throw mse;
2389 }
2390
2391 _channel = HIDDEN;
2392
2393 }
2394
2395 state.type = _type;
2396 state.channel = _channel;
2397 } finally {
2398 }
2399 }
2400
2401 // $ANTLR end "WS"
2402
2403 // $ANTLR start "COMMENT"
2404 public final void mCOMMENT() throws RecognitionException {
2405 try {
2406 int _type = COMMENT;
2407 int _channel = DEFAULT_TOKEN_CHANNEL;
2408 // CTFLexer.g:179:9: ( COMMENT_OPEN ( . )* COMMENT_CLOSE )
2409 // CTFLexer.g:179:11: COMMENT_OPEN ( . )* COMMENT_CLOSE
2410 {
2411 mCOMMENT_OPEN();
2412 // CTFLexer.g:179:24: ( . )*
2413 loop28: do {
2414 int alt28 = 2;
2415 int LA28_0 = input.LA(1);
2416
2417 if ((LA28_0 == '*')) {
2418 int LA28_1 = input.LA(2);
2419
2420 if ((LA28_1 == '/')) {
2421 alt28 = 2;
2422 } else if (((LA28_1 >= '\u0000' && LA28_1 <= '.') || (LA28_1 >= '0' && LA28_1 <= '\uFFFF'))) {
2423 alt28 = 1;
2424 }
2425
2426 } else if (((LA28_0 >= '\u0000' && LA28_0 <= ')') || (LA28_0 >= '+' && LA28_0 <= '\uFFFF'))) {
2427 alt28 = 1;
2428 }
2429
2430 switch (alt28) {
2431 case 1:
2432 // CTFLexer.g:179:24: .
2433 {
2434 matchAny();
2435
2436 }
2437 break;
2438
2439 default:
2440 break loop28;
2441 }
2442 } while (true);
2443
2444 mCOMMENT_CLOSE();
2445 _channel = HIDDEN;
2446
2447 }
2448
2449 state.type = _type;
2450 state.channel = _channel;
2451 } finally {
2452 }
2453 }
2454
2455 // $ANTLR end "COMMENT"
2456
2457 // $ANTLR start "COMMENT_OPEN"
2458 public final void mCOMMENT_OPEN() throws RecognitionException {
2459 try {
2460 // CTFLexer.g:180:23: ( '/*' )
2461 // CTFLexer.g:180:25: '/*'
2462 {
2463 match("/*");
2464
2465 }
2466
2467 } finally {
2468 }
2469 }
2470
2471 // $ANTLR end "COMMENT_OPEN"
2472
2473 // $ANTLR start "COMMENT_CLOSE"
2474 public final void mCOMMENT_CLOSE() throws RecognitionException {
2475 try {
2476 // CTFLexer.g:181:24: ( '*/' )
2477 // CTFLexer.g:181:26: '*/'
2478 {
2479 match("*/");
2480
2481 }
2482
2483 } finally {
2484 }
2485 }
2486
2487 // $ANTLR end "COMMENT_CLOSE"
2488
2489 // $ANTLR start "LINE_COMMENT"
2490 public final void mLINE_COMMENT() throws RecognitionException {
2491 try {
2492 int _type = LINE_COMMENT;
2493 int _channel = DEFAULT_TOKEN_CHANNEL;
2494 // CTFLexer.g:186:14: ( '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )?
2495 // '\\n' )
2496 // CTFLexer.g:186:16: '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n'
2497 {
2498 match("//");
2499
2500 // CTFLexer.g:186:21: (~ ( '\\n' | '\\r' ) )*
2501 loop29: do {
2502 int alt29 = 2;
2503 int LA29_0 = input.LA(1);
2504
2505 if (((LA29_0 >= '\u0000' && LA29_0 <= '\t')
2506 || (LA29_0 >= '\u000B' && LA29_0 <= '\f') || (LA29_0 >= '\u000E' && LA29_0 <= '\uFFFF'))) {
2507 alt29 = 1;
2508 }
2509
2510 switch (alt29) {
2511 case 1:
2512 // CTFLexer.g:186:21: ~ ( '\\n' | '\\r' )
2513 {
2514 if ((input.LA(1) >= '\u0000' && input.LA(1) <= '\t')
2515 || (input.LA(1) >= '\u000B' && input.LA(1) <= '\f')
2516 || (input.LA(1) >= '\u000E' && input.LA(1) <= '\uFFFF')) {
2517 input.consume();
2518
2519 } else {
2520 MismatchedSetException mse = new MismatchedSetException(
2521 null, input);
2522 recover(mse);
2523 throw mse;
2524 }
2525
2526 }
2527 break;
2528
2529 default:
2530 break loop29;
2531 }
2532 } while (true);
2533
2534 // CTFLexer.g:186:35: ( '\\r' )?
2535 int alt30 = 2;
2536 int LA30_0 = input.LA(1);
2537
2538 if ((LA30_0 == '\r')) {
2539 alt30 = 1;
2540 }
2541 switch (alt30) {
2542 case 1:
2543 // CTFLexer.g:186:35: '\\r'
2544 {
2545 match('\r');
2546
2547 }
2548 break;
2549
2550 }
2551
2552 match('\n');
2553 _channel = HIDDEN;
2554
2555 }
2556
2557 state.type = _type;
2558 state.channel = _channel;
2559 } finally {
2560 }
2561 }
2562
2563 // $ANTLR end "LINE_COMMENT"
2564
2565 // $ANTLR start "IDENTIFIER"
2566 public final void mIDENTIFIER() throws RecognitionException {
2567 try {
2568 int _type = IDENTIFIER;
2569 int _channel = DEFAULT_TOKEN_CHANNEL;
2570 // CTFLexer.g:191:12: ( NONDIGIT ( NONDIGIT | DIGIT )* )
2571 // CTFLexer.g:191:14: NONDIGIT ( NONDIGIT | DIGIT )*
2572 {
2573 mNONDIGIT();
2574 // CTFLexer.g:191:23: ( NONDIGIT | DIGIT )*
2575 loop31: do {
2576 int alt31 = 3;
2577 int LA31_0 = input.LA(1);
2578
2579 if (((LA31_0 >= 'A' && LA31_0 <= 'Z') || LA31_0 == '_' || (LA31_0 >= 'a' && LA31_0 <= 'z'))) {
2580 alt31 = 1;
2581 } else if (((LA31_0 >= '0' && LA31_0 <= '9'))) {
2582 alt31 = 2;
2583 }
2584
2585 switch (alt31) {
2586 case 1:
2587 // CTFLexer.g:191:24: NONDIGIT
2588 {
2589 mNONDIGIT();
2590
2591 }
2592 break;
2593 case 2:
2594 // CTFLexer.g:191:35: DIGIT
2595 {
2596 mDIGIT();
2597
2598 }
2599 break;
2600
2601 default:
2602 break loop31;
2603 }
2604 } while (true);
2605
2606 }
2607
2608 state.type = _type;
2609 state.channel = _channel;
2610 } finally {
2611 }
2612 }
2613
2614 // $ANTLR end "IDENTIFIER"
2615
2616 // $ANTLR start "NONDIGIT"
2617 public final void mNONDIGIT() throws RecognitionException {
2618 try {
2619 // CTFLexer.g:192:19: ( ( '_' ) | ( 'A' .. 'Z' ) | ( 'a' .. 'z' ) )
2620 int alt32 = 3;
2621 switch (input.LA(1)) {
2622 case '_': {
2623 alt32 = 1;
2624 }
2625 break;
2626 case 'A':
2627 case 'B':
2628 case 'C':
2629 case 'D':
2630 case 'E':
2631 case 'F':
2632 case 'G':
2633 case 'H':
2634 case 'I':
2635 case 'J':
2636 case 'K':
2637 case 'L':
2638 case 'M':
2639 case 'N':
2640 case 'O':
2641 case 'P':
2642 case 'Q':
2643 case 'R':
2644 case 'S':
2645 case 'T':
2646 case 'U':
2647 case 'V':
2648 case 'W':
2649 case 'X':
2650 case 'Y':
2651 case 'Z': {
2652 alt32 = 2;
2653 }
2654 break;
2655 case 'a':
2656 case 'b':
2657 case 'c':
2658 case 'd':
2659 case 'e':
2660 case 'f':
2661 case 'g':
2662 case 'h':
2663 case 'i':
2664 case 'j':
2665 case 'k':
2666 case 'l':
2667 case 'm':
2668 case 'n':
2669 case 'o':
2670 case 'p':
2671 case 'q':
2672 case 'r':
2673 case 's':
2674 case 't':
2675 case 'u':
2676 case 'v':
2677 case 'w':
2678 case 'x':
2679 case 'y':
2680 case 'z': {
2681 alt32 = 3;
2682 }
2683 break;
2684 default:
2685 NoViableAltException nvae = new NoViableAltException("", 32, 0,
2686 input);
2687
2688 throw nvae;
2689 }
2690
2691 switch (alt32) {
2692 case 1:
2693 // CTFLexer.g:192:21: ( '_' )
2694 {
2695 // CTFLexer.g:192:21: ( '_' )
2696 // CTFLexer.g:192:22: '_'
2697 {
2698 match('_');
2699
2700 }
2701
2702 }
2703 break;
2704 case 2:
2705 // CTFLexer.g:192:29: ( 'A' .. 'Z' )
2706 {
2707 // CTFLexer.g:192:29: ( 'A' .. 'Z' )
2708 // CTFLexer.g:192:30: 'A' .. 'Z'
2709 {
2710 matchRange('A', 'Z');
2711
2712 }
2713
2714 }
2715 break;
2716 case 3:
2717 // CTFLexer.g:192:42: ( 'a' .. 'z' )
2718 {
2719 // CTFLexer.g:192:42: ( 'a' .. 'z' )
2720 // CTFLexer.g:192:43: 'a' .. 'z'
2721 {
2722 matchRange('a', 'z');
2723
2724 }
2725
2726 }
2727 break;
2728
2729 }
2730 } finally {
2731 }
2732 }
2733
2734 // $ANTLR end "NONDIGIT"
2735
2736 @Override
2737 public void mTokens() throws RecognitionException {
2738 // CTFLexer.g:1:8: ( ALIGNTOK | CONSTTOK | CHARTOK | DOUBLETOK | ENUMTOK
2739 // | EVENTTOK | FLOATINGPOINTTOK | FLOATTOK | INTEGERTOK | INTTOK |
2740 // LONGTOK | SHORTTOK | SIGNEDTOK | STREAMTOK | STRINGTOK | STRUCTTOK |
2741 // TRACETOK | TYPEALIASTOK | TYPEDEFTOK | UNSIGNEDTOK | VARIANTTOK |
2742 // VOIDTOK | BOOLTOK | COMPLEXTOK | IMAGINARYTOK | ENVTOK | CLOCKTOK |
2743 // CALLSITETOK | NANNUMBERTOK | INFINITYTOK | NINFINITYTOK | SEPARATOR |
2744 // COLON | ELIPSES | ASSIGNMENT | TYPE_ASSIGNMENT | LT | GT | OPENBRAC |
2745 // CLOSEBRAC | LPAREN | RPAREN | LCURL | RCURL | TERM | POINTER | SIGN |
2746 // ARROW | DOT | OCTAL_LITERAL | DECIMAL_LITERAL | HEX_LITERAL |
2747 // CHARACTER_LITERAL | STRING_LITERAL | WS | COMMENT | LINE_COMMENT |
2748 // IDENTIFIER )
2749 int alt33 = 58;
2750 alt33 = dfa33.predict(input);
2751 switch (alt33) {
2752 case 1:
2753 // CTFLexer.g:1:10: ALIGNTOK
2754 {
2755 mALIGNTOK();
2756
2757 }
2758 break;
2759 case 2:
2760 // CTFLexer.g:1:19: CONSTTOK
2761 {
2762 mCONSTTOK();
2763
2764 }
2765 break;
2766 case 3:
2767 // CTFLexer.g:1:28: CHARTOK
2768 {
2769 mCHARTOK();
2770
2771 }
2772 break;
2773 case 4:
2774 // CTFLexer.g:1:36: DOUBLETOK
2775 {
2776 mDOUBLETOK();
2777
2778 }
2779 break;
2780 case 5:
2781 // CTFLexer.g:1:46: ENUMTOK
2782 {
2783 mENUMTOK();
2784
2785 }
2786 break;
2787 case 6:
2788 // CTFLexer.g:1:54: EVENTTOK
2789 {
2790 mEVENTTOK();
2791
2792 }
2793 break;
2794 case 7:
2795 // CTFLexer.g:1:63: FLOATINGPOINTTOK
2796 {
2797 mFLOATINGPOINTTOK();
2798
2799 }
2800 break;
2801 case 8:
2802 // CTFLexer.g:1:80: FLOATTOK
2803 {
2804 mFLOATTOK();
2805
2806 }
2807 break;
2808 case 9:
2809 // CTFLexer.g:1:89: INTEGERTOK
2810 {
2811 mINTEGERTOK();
2812
2813 }
2814 break;
2815 case 10:
2816 // CTFLexer.g:1:100: INTTOK
2817 {
2818 mINTTOK();
2819
2820 }
2821 break;
2822 case 11:
2823 // CTFLexer.g:1:107: LONGTOK
2824 {
2825 mLONGTOK();
2826
2827 }
2828 break;
2829 case 12:
2830 // CTFLexer.g:1:115: SHORTTOK
2831 {
2832 mSHORTTOK();
2833
2834 }
2835 break;
2836 case 13:
2837 // CTFLexer.g:1:124: SIGNEDTOK
2838 {
2839 mSIGNEDTOK();
2840
2841 }
2842 break;
2843 case 14:
2844 // CTFLexer.g:1:134: STREAMTOK
2845 {
2846 mSTREAMTOK();
2847
2848 }
2849 break;
2850 case 15:
2851 // CTFLexer.g:1:144: STRINGTOK
2852 {
2853 mSTRINGTOK();
2854
2855 }
2856 break;
2857 case 16:
2858 // CTFLexer.g:1:154: STRUCTTOK
2859 {
2860 mSTRUCTTOK();
2861
2862 }
2863 break;
2864 case 17:
2865 // CTFLexer.g:1:164: TRACETOK
2866 {
2867 mTRACETOK();
2868
2869 }
2870 break;
2871 case 18:
2872 // CTFLexer.g:1:173: TYPEALIASTOK
2873 {
2874 mTYPEALIASTOK();
2875
2876 }
2877 break;
2878 case 19:
2879 // CTFLexer.g:1:186: TYPEDEFTOK
2880 {
2881 mTYPEDEFTOK();
2882
2883 }
2884 break;
2885 case 20:
2886 // CTFLexer.g:1:197: UNSIGNEDTOK
2887 {
2888 mUNSIGNEDTOK();
2889
2890 }
2891 break;
2892 case 21:
2893 // CTFLexer.g:1:209: VARIANTTOK
2894 {
2895 mVARIANTTOK();
2896
2897 }
2898 break;
2899 case 22:
2900 // CTFLexer.g:1:220: VOIDTOK
2901 {
2902 mVOIDTOK();
2903
2904 }
2905 break;
2906 case 23:
2907 // CTFLexer.g:1:228: BOOLTOK
2908 {
2909 mBOOLTOK();
2910
2911 }
2912 break;
2913 case 24:
2914 // CTFLexer.g:1:236: COMPLEXTOK
2915 {
2916 mCOMPLEXTOK();
2917
2918 }
2919 break;
2920 case 25:
2921 // CTFLexer.g:1:247: IMAGINARYTOK
2922 {
2923 mIMAGINARYTOK();
2924
2925 }
2926 break;
2927 case 26:
2928 // CTFLexer.g:1:260: ENVTOK
2929 {
2930 mENVTOK();
2931
2932 }
2933 break;
2934 case 27:
2935 // CTFLexer.g:1:267: CLOCKTOK
2936 {
2937 mCLOCKTOK();
2938
2939 }
2940 break;
2941 case 28:
2942 // CTFLexer.g:1:276: CALLSITETOK
2943 {
2944 mCALLSITETOK();
2945
2946 }
2947 break;
2948 case 29:
2949 // CTFLexer.g:1:288: NANNUMBERTOK
2950 {
2951 mNANNUMBERTOK();
2952
2953 }
2954 break;
2955 case 30:
2956 // CTFLexer.g:1:301: INFINITYTOK
2957 {
2958 mINFINITYTOK();
2959
2960 }
2961 break;
2962 case 31:
2963 // CTFLexer.g:1:313: NINFINITYTOK
2964 {
2965 mNINFINITYTOK();
2966
2967 }
2968 break;
2969 case 32:
2970 // CTFLexer.g:1:326: SEPARATOR
2971 {
2972 mSEPARATOR();
2973
2974 }
2975 break;
2976 case 33:
2977 // CTFLexer.g:1:336: COLON
2978 {
2979 mCOLON();
2980
2981 }
2982 break;
2983 case 34:
2984 // CTFLexer.g:1:342: ELIPSES
2985 {
2986 mELIPSES();
2987
2988 }
2989 break;
2990 case 35:
2991 // CTFLexer.g:1:350: ASSIGNMENT
2992 {
2993 mASSIGNMENT();
2994
2995 }
2996 break;
2997 case 36:
2998 // CTFLexer.g:1:361: TYPE_ASSIGNMENT
2999 {
3000 mTYPE_ASSIGNMENT();
3001
3002 }
3003 break;
3004 case 37:
3005 // CTFLexer.g:1:377: LT
3006 {
3007 mLT();
3008
3009 }
3010 break;
3011 case 38:
3012 // CTFLexer.g:1:380: GT
3013 {
3014 mGT();
3015
3016 }
3017 break;
3018 case 39:
3019 // CTFLexer.g:1:383: OPENBRAC
3020 {
3021 mOPENBRAC();
3022
3023 }
3024 break;
3025 case 40:
3026 // CTFLexer.g:1:392: CLOSEBRAC
3027 {
3028 mCLOSEBRAC();
3029
3030 }
3031 break;
3032 case 41:
3033 // CTFLexer.g:1:402: LPAREN
3034 {
3035 mLPAREN();
3036
3037 }
3038 break;
3039 case 42:
3040 // CTFLexer.g:1:409: RPAREN
3041 {
3042 mRPAREN();
3043
3044 }
3045 break;
3046 case 43:
3047 // CTFLexer.g:1:416: LCURL
3048 {
3049 mLCURL();
3050
3051 }
3052 break;
3053 case 44:
3054 // CTFLexer.g:1:422: RCURL
3055 {
3056 mRCURL();
3057
3058 }
3059 break;
3060 case 45:
3061 // CTFLexer.g:1:428: TERM
3062 {
3063 mTERM();
3064
3065 }
3066 break;
3067 case 46:
3068 // CTFLexer.g:1:433: POINTER
3069 {
3070 mPOINTER();
3071
3072 }
3073 break;
3074 case 47:
3075 // CTFLexer.g:1:441: SIGN
3076 {
3077 mSIGN();
3078
3079 }
3080 break;
3081 case 48:
3082 // CTFLexer.g:1:446: ARROW
3083 {
3084 mARROW();
3085
3086 }
3087 break;
3088 case 49:
3089 // CTFLexer.g:1:452: DOT
3090 {
3091 mDOT();
3092
3093 }
3094 break;
3095 case 50:
3096 // CTFLexer.g:1:456: OCTAL_LITERAL
3097 {
3098 mOCTAL_LITERAL();
3099
3100 }
3101 break;
3102 case 51:
3103 // CTFLexer.g:1:470: DECIMAL_LITERAL
3104 {
3105 mDECIMAL_LITERAL();
3106
3107 }
3108 break;
3109 case 52:
3110 // CTFLexer.g:1:486: HEX_LITERAL
3111 {
3112 mHEX_LITERAL();
3113
3114 }
3115 break;
3116 case 53:
3117 // CTFLexer.g:1:498: CHARACTER_LITERAL
3118 {
3119 mCHARACTER_LITERAL();
3120
3121 }
3122 break;
3123 case 54:
3124 // CTFLexer.g:1:516: STRING_LITERAL
3125 {
3126 mSTRING_LITERAL();
3127
3128 }
3129 break;
3130 case 55:
3131 // CTFLexer.g:1:531: WS
3132 {
3133 mWS();
3134
3135 }
3136 break;
3137 case 56:
3138 // CTFLexer.g:1:534: COMMENT
3139 {
3140 mCOMMENT();
3141
3142 }
3143 break;
3144 case 57:
3145 // CTFLexer.g:1:542: LINE_COMMENT
3146 {
3147 mLINE_COMMENT();
3148
3149 }
3150 break;
3151 case 58:
3152 // CTFLexer.g:1:555: IDENTIFIER
3153 {
3154 mIDENTIFIER();
3155
3156 }
3157 break;
3158
3159 }
3160
3161 }
3162
3163 protected DFA17 dfa17 = new DFA17(this);
3164 protected DFA33 dfa33 = new DFA33(this);
3165 static final String DFA17_eotS = "\1\uffff\2\6\1\11\1\6\2\uffff\1\6\2\uffff";
3166 static final String DFA17_eofS = "\12\uffff";
3167 static final String DFA17_minS = "\1\114\1\125\2\114\1\125\2\uffff\1\125\2\uffff";
3168 static final String DFA17_maxS = "\3\165\1\154\1\165\2\uffff\1\165\2\uffff";
3169 static final String DFA17_acceptS = "\5\uffff\1\4\1\1\1\uffff\1\3\1\2";
3170 static final String DFA17_specialS = "\12\uffff}>";
3171 static final String[] DFA17_transitionS = {
3172 "\1\2\10\uffff\1\3\26\uffff\1\1\10\uffff\1\3",
3173 "\1\5\26\uffff\1\4\10\uffff\1\5", "\1\7\10\uffff\1\5\37\uffff\1\5",
3174 "\1\10\37\uffff\1\10", "\1\5\37\uffff\1\5", "", "",
3175 "\1\5\37\uffff\1\5", "", "" };
3176
3177 static final short[] DFA17_eot = DFA.unpackEncodedString(DFA17_eotS);
3178 static final short[] DFA17_eof = DFA.unpackEncodedString(DFA17_eofS);
3179 static final char[] DFA17_min = DFA.unpackEncodedStringToUnsignedChars(DFA17_minS);
3180 static final char[] DFA17_max = DFA.unpackEncodedStringToUnsignedChars(DFA17_maxS);
3181 static final short[] DFA17_accept = DFA.unpackEncodedString(DFA17_acceptS);
3182 static final short[] DFA17_special = DFA.unpackEncodedString(DFA17_specialS);
3183 static final short[][] DFA17_transition;
3184
3185 static {
3186 int numStates = DFA17_transitionS.length;
3187 DFA17_transition = new short[numStates][];
3188 for (int i = 0; i < numStates; i++) {
3189 DFA17_transition[i] = DFA.unpackEncodedString(DFA17_transitionS[i]);
3190 }
3191 }
3192
3193 class DFA17 extends DFA {
3194
3195 public DFA17(BaseRecognizer recognizer) {
3196 this.recognizer = recognizer;
3197 this.decisionNumber = 17;
3198 this.eot = DFA17_eot;
3199 this.eof = DFA17_eof;
3200 this.min = DFA17_min;
3201 this.max = DFA17_max;
3202 this.accept = DFA17_accept;
3203 this.special = DFA17_special;
3204 this.transition = DFA17_transition;
3205 }
3206
3207 @Override
3208 public String getDescription() {
3209 return "107:10: fragment INTEGER_TYPES_SUFFIX : ( ( 'l' ( 'l' )? | 'L' ( 'L' )? ) | ( 'u' | 'U' ) | ( 'u' | 'U' ) ( 'l' ( 'l' )? | 'L' ( 'L' )? ) | ( 'l' ( 'l' )? | 'L' ( 'L' )? ) ( 'u' | 'U' ) );";
3210 }
3211 }
3212
3213 static final String DFA33_eotS = "\1\uffff\15\45\2\76\1\uffff\1\102\1\104\13\uffff\1\37\1\uffff\1"
3214 + "\45\5\uffff\27\45\11\uffff\1\144\2\uffff\7\45\1\154\2\45\1\160\14"
3215 + "\45\1\177\3\144\1\uffff\2\45\1\u0087\3\45\1\u008b\1\uffff\3\45\1"
3216 + "\uffff\1\u008f\11\45\1\u009a\3\45\1\uffff\1\144\1\uffff\3\144\1"
3217 + "\u00a0\1\u00a1\1\uffff\1\u00a2\2\45\1\uffff\1\u00a5\1\u00a7\1\45"
3218 + "\1\uffff\1\u00a9\4\45\1\u00ae\4\45\1\uffff\1\u00b3\2\45\5\uffff"
3219 + "\1\45\1\u00b7\1\uffff\1\45\1\uffff\1\45\1\uffff\1\u00ba\1\u00bb"
3220 + "\1\u00bc\1\u00bd\1\uffff\4\45\1\uffff\3\45\1\uffff\1\45\1\u00c6"
3221 + "\4\uffff\1\45\1\u00c8\1\45\1\u00ca\2\45\1\u00cd\1\45\1\uffff\1\45"
3222 + "\1\uffff\1\u00d0\1\uffff\1\u00d1\1\45\1\uffff\1\45\1\u00d4\2\uffff"
3223 + "\2\45\1\uffff\1\u00d7\1\45\1\uffff\2\45\1\u00db\1\uffff";
3224 static final String DFA33_eofS = "\u00dc\uffff";
3225 static final String DFA33_minS = "\1\11\1\154\1\141\1\157\1\156\1\154\1\156\1\157\1\150\1\162\1\156"
3226 + "\1\141\1\102\1\141\1\151\1\76\1\uffff\1\75\1\56\13\uffff\1\60\1"
3227 + "\uffff\1\42\3\uffff\1\52\1\uffff\1\151\1\156\1\141\1\157\1\154\2"
3228 + "\165\1\145\1\157\1\164\1\156\1\157\1\147\1\162\1\141\1\160\1\163"
3229 + "\1\162\1\151\2\157\1\155\1\116\11\uffff\1\60\2\uffff\1\147\1\163"
3230 + "\1\162\1\143\1\154\1\142\1\155\1\60\1\156\1\141\1\60\1\147\1\162"
3231 + "\1\156\1\145\1\143\1\145\2\151\1\144\1\157\1\155\1\141\1\60\1\125"
3232 + "\2\114\1\uffff\1\156\1\164\1\60\1\153\1\163\1\154\1\60\1\uffff\2"
3233 + "\164\1\147\1\uffff\1\60\1\164\1\145\1\141\1\156\1\143\1\145\1\141"
3234 + "\1\147\1\141\1\60\1\154\1\160\1\147\1\uffff\1\125\1\uffff\1\125"
3235 + "\1\154\1\114\2\60\1\uffff\1\60\1\151\1\145\1\uffff\2\60\1\145\1"
3236 + "\uffff\1\60\1\144\1\155\1\147\1\164\1\60\1\154\1\145\2\156\1\uffff"
3237 + "\1\60\1\154\1\151\5\uffff\1\164\1\60\1\uffff\1\156\1\uffff\1\162"
3238 + "\1\uffff\4\60\1\uffff\1\151\1\146\1\145\1\164\1\uffff\1\145\1\156"
3239 + "\1\145\1\uffff\1\147\1\60\4\uffff\1\141\1\60\1\144\1\60\1\170\1"
3240 + "\141\1\60\1\137\1\uffff\1\163\1\uffff\1\60\1\uffff\1\60\1\162\1"
3241 + "\uffff\1\160\1\60\2\uffff\1\171\1\157\1\uffff\1\60\1\151\1\uffff"
3242 + "\1\156\1\164\1\60\1\uffff";
3243 static final String DFA33_maxS = "\1\175\1\154\2\157\1\166\1\154\1\156\1\157\1\164\1\171\1\156\1\157"
3244 + "\1\111\1\141\2\151\1\uffff\1\75\1\56\13\uffff\1\170\1\uffff\1\47"
3245 + "\3\uffff\1\57\1\uffff\1\151\1\156\1\141\1\157\1\154\1\165\1\166"
3246 + "\1\145\1\157\1\164\1\156\1\157\1\147\1\162\1\141\1\160\1\163\1\162"
3247 + "\1\151\2\157\1\155\1\116\11\uffff\1\165\2\uffff\1\147\1\163\1\162"
3248 + "\1\143\1\154\1\142\1\155\1\172\1\156\1\141\1\172\1\147\1\162\1\156"
3249 + "\1\165\1\143\1\145\2\151\1\144\1\157\1\155\1\141\1\172\2\165\1\154"
3250 + "\1\uffff\1\156\1\164\1\172\1\153\1\163\1\154\1\172\1\uffff\2\164"
3251 + "\1\147\1\uffff\1\172\1\164\1\145\1\141\1\156\1\143\1\145\1\144\1"
3252 + "\147\1\141\1\172\1\154\1\160\1\147\1\uffff\1\165\1\uffff\1\165\1"
3253 + "\154\1\114\2\172\1\uffff\1\172\1\151\1\145\1\uffff\2\172\1\145\1"
3254 + "\uffff\1\172\1\144\1\155\1\147\1\164\1\172\1\154\1\145\2\156\1\uffff"
3255 + "\1\172\1\154\1\151\5\uffff\1\164\1\172\1\uffff\1\156\1\uffff\1\162"
3256 + "\1\uffff\4\172\1\uffff\1\151\1\146\1\145\1\164\1\uffff\1\145\1\156"
3257 + "\1\145\1\uffff\1\147\1\172\4\uffff\1\141\1\172\1\144\1\172\1\170"
3258 + "\1\141\1\172\1\137\1\uffff\1\163\1\uffff\1\172\1\uffff\1\172\1\162"
3259 + "\1\uffff\1\160\1\172\2\uffff\1\171\1\157\1\uffff\1\172\1\151\1\uffff"
3260 + "\1\156\1\164\1\172\1\uffff";
3261 static final String DFA33_acceptS = "\20\uffff\1\40\2\uffff\1\43\1\45\1\46\1\47\1\50\1\51\1\52\1\53\1"
3262 + "\54\1\55\1\56\1\uffff\1\63\1\uffff\1\65\1\66\1\67\1\uffff\1\72\27"
3263 + "\uffff\1\36\1\57\1\37\1\60\1\44\1\41\1\42\1\61\1\64\1\uffff\1\70"
3264 + "\1\71\33\uffff\1\62\7\uffff\1\32\3\uffff\1\12\16\uffff\1\35\1\uffff"
3265 + "\1\62\5\uffff\1\3\3\uffff\1\5\3\uffff\1\13\12\uffff\1\26\3\uffff"
3266 + "\2\62\1\1\1\2\1\33\2\uffff\1\6\1\uffff\1\10\1\uffff\1\14\4\uffff"
3267 + "\1\21\4\uffff\1\27\3\uffff\1\4\2\uffff\1\15\1\16\1\17\1\20\10\uffff"
3268 + "\1\11\1\uffff\1\23\1\uffff\1\25\2\uffff\1\34\2\uffff\1\24\1\30\2"
3269 + "\uffff\1\22\2\uffff\1\31\3\uffff\1\7";
3270 static final String DFA33_specialS = "\u00dc\uffff}>";
3271 static final String[] DFA33_transitionS = {
3272 "\2\43\1\uffff\2\43\22\uffff\1\43\1\uffff\1\42\4\uffff\1\41\1"
3273 + "\30\1\31\1\35\1\16\1\20\1\17\1\22\1\44\1\36\11\37\1\21\1\34"
3274 + "\1\24\1\23\1\25\2\uffff\13\45\1\40\1\45\1\15\14\45\1\26\1\uffff"
3275 + "\1\27\1\uffff\1\14\1\uffff\1\1\1\45\1\2\1\3\1\4\1\5\2\45\1\6"
3276 + "\2\45\1\7\6\45\1\10\1\11\1\12\1\13\4\45\1\32\1\uffff\1\33",
3277 "\1\46",
3278 "\1\52\6\uffff\1\50\3\uffff\1\51\2\uffff\1\47",
3279 "\1\53",
3280 "\1\54\7\uffff\1\55",
3281 "\1\56",
3282 "\1\57",
3283 "\1\60",
3284 "\1\61\1\62\12\uffff\1\63",
3285 "\1\64\6\uffff\1\65",
3286 "\1\66",
3287 "\1\67\15\uffff\1\70",
3288 "\1\71\1\72\5\uffff\1\73",
3289 "\1\74",
3290 "\1\75",
3291 "\1\100\52\uffff\1\77",
3292 "",
3293 "\1\101",
3294 "\1\103",
3295 "",
3296 "",
3297 "",
3298 "",
3299 "",
3300 "",
3301 "",
3302 "",
3303 "",
3304 "",
3305 "",
3306 "\10\106\40\uffff\1\105\37\uffff\1\105",
3307 "",
3308 "\1\42\4\uffff\1\41",
3309 "",
3310 "",
3311 "",
3312 "\1\107\4\uffff\1\110",
3313 "",
3314 "\1\111",
3315 "\1\112",
3316 "\1\113",
3317 "\1\114",
3318 "\1\115",
3319 "\1\116",
3320 "\1\117\1\120",
3321 "\1\121",
3322 "\1\122",
3323 "\1\123",
3324 "\1\124",
3325 "\1\125",
3326 "\1\126",
3327 "\1\127",
3328 "\1\130",
3329 "\1\131",
3330 "\1\132",
3331 "\1\133",
3332 "\1\134",
3333 "\1\135",
3334 "\1\136",
3335 "\1\137",
3336 "\1\140",
3337 "",
3338 "",
3339 "",
3340 "",
3341 "",
3342 "",
3343 "",
3344 "",
3345 "",
3346 "\10\106\2\37\22\uffff\1\142\10\uffff\1\143\26\uffff\1\141\10"
3347 + "\uffff\1\143",
3348 "",
3349 "",
3350 "\1\145",
3351 "\1\146",
3352 "\1\147",
3353 "\1\150",
3354 "\1\151",
3355 "\1\152",
3356 "\1\153",
3357 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45",
3358 "\1\155",
3359 "\1\156",
3360 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\4\45\1\157\25\45",
3361 "\1\161",
3362 "\1\162",
3363 "\1\163",
3364 "\1\164\3\uffff\1\165\13\uffff\1\166",
3365 "\1\167",
3366 "\1\170",
3367 "\1\171",
3368 "\1\172",
3369 "\1\173",
3370 "\1\174",
3371 "\1\175",
3372 "\1\176",
3373 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45",
3374 "\1\u0081\26\uffff\1\u0080\10\uffff\1\u0081",
3375 "\1\u0082\10\uffff\1\u0081\37\uffff\1\u0081",
3376 "\1\u0084\37\uffff\1\u0083",
3377 "",
3378 "\1\u0085",
3379 "\1\u0086",
3380 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45",
3381 "\1\u0088",
3382 "\1\u0089",
3383 "\1\u008a",
3384 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45",
3385 "",
3386 "\1\u008c",
3387 "\1\u008d",
3388 "\1\u008e",
3389 "",
3390 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45",
3391 "\1\u0090",
3392 "\1\u0091",
3393 "\1\u0092",
3394 "\1\u0093",
3395 "\1\u0094",
3396 "\1\u0095",
3397 "\1\u0096\2\uffff\1\u0097",
3398 "\1\u0098",
3399 "\1\u0099",
3400 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45",
3401 "\1\u009b",
3402 "\1\u009c",
3403 "\1\u009d",
3404 "",
3405 "\1\u0081\37\uffff\1\u0081",
3406 "",
3407 "\1\u0081\37\uffff\1\u0081",
3408 "\1\u009e",
3409 "\1\u009f",
3410 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45",
3411 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45",
3412 "",
3413 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45",
3414 "\1\u00a3",
3415 "\1\u00a4",
3416 "",
3417 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45",
3418 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\10\45\1\u00a6\21"
3419 + "\45", "\1\u00a8", "",
3420 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", "\1\u00aa",
3421 "\1\u00ab", "\1\u00ac", "\1\u00ad",
3422 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", "\1\u00af",
3423 "\1\u00b0", "\1\u00b1", "\1\u00b2", "",
3424 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", "\1\u00b4",
3425 "\1\u00b5", "", "", "", "", "", "\1\u00b6",
3426 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", "", "\1\u00b8",
3427 "", "\1\u00b9", "",
3428 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45",
3429 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45",
3430 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45",
3431 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", "", "\1\u00be",
3432 "\1\u00bf", "\1\u00c0", "\1\u00c1", "", "\1\u00c2", "\1\u00c3",
3433 "\1\u00c4", "", "\1\u00c5",
3434 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", "", "", "", "",
3435 "\1\u00c7", "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45",
3436 "\1\u00c9", "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45",
3437 "\1\u00cb", "\1\u00cc",
3438 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", "\1\u00ce", "",
3439 "\1\u00cf", "", "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45",
3440 "", "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", "\1\u00d2",
3441 "", "\1\u00d3", "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45",
3442 "", "", "\1\u00d5", "\1\u00d6", "",
3443 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", "\1\u00d8", "",
3444 "\1\u00d9", "\1\u00da",
3445 "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", "" };
3446
3447 static final short[] DFA33_eot = DFA.unpackEncodedString(DFA33_eotS);
3448 static final short[] DFA33_eof = DFA.unpackEncodedString(DFA33_eofS);
3449 static final char[] DFA33_min = DFA.unpackEncodedStringToUnsignedChars(DFA33_minS);
3450 static final char[] DFA33_max = DFA.unpackEncodedStringToUnsignedChars(DFA33_maxS);
3451 static final short[] DFA33_accept = DFA.unpackEncodedString(DFA33_acceptS);
3452 static final short[] DFA33_special = DFA.unpackEncodedString(DFA33_specialS);
3453 static final short[][] DFA33_transition;
3454
3455 static {
3456 int numStates = DFA33_transitionS.length;
3457 DFA33_transition = new short[numStates][];
3458 for (int i = 0; i < numStates; i++) {
3459 DFA33_transition[i] = DFA.unpackEncodedString(DFA33_transitionS[i]);
3460 }
3461 }
3462
3463 class DFA33 extends DFA {
3464
3465 public DFA33(BaseRecognizer recognizer) {
3466 this.recognizer = recognizer;
3467 this.decisionNumber = 33;
3468 this.eot = DFA33_eot;
3469 this.eof = DFA33_eof;
3470 this.min = DFA33_min;
3471 this.max = DFA33_max;
3472 this.accept = DFA33_accept;
3473 this.special = DFA33_special;
3474 this.transition = DFA33_transition;
3475 }
3476
3477 @Override
3478 public String getDescription() {
3479 return "1:1: Tokens : ( ALIGNTOK | CONSTTOK | CHARTOK | DOUBLETOK | ENUMTOK | EVENTTOK | FLOATINGPOINTTOK | FLOATTOK | INTEGERTOK | INTTOK | LONGTOK | SHORTTOK | SIGNEDTOK | STREAMTOK | STRINGTOK | STRUCTTOK | TRACETOK | TYPEALIASTOK | TYPEDEFTOK | UNSIGNEDTOK | VARIANTTOK | VOIDTOK | BOOLTOK | COMPLEXTOK | IMAGINARYTOK | ENVTOK | CLOCKTOK | CALLSITETOK | NANNUMBERTOK | INFINITYTOK | NINFINITYTOK | SEPARATOR | COLON | ELIPSES | ASSIGNMENT | TYPE_ASSIGNMENT | LT | GT | OPENBRAC | CLOSEBRAC | LPAREN | RPAREN | LCURL | RCURL | TERM | POINTER | SIGN | ARROW | DOT | OCTAL_LITERAL | DECIMAL_LITERAL | HEX_LITERAL | CHARACTER_LITERAL | STRING_LITERAL | WS | COMMENT | LINE_COMMENT | IDENTIFIER );";
3480 }
3481 }
3482
3483 }
+0
-10234
lttng/org.eclipse.linuxtools.ctf.parser/src/org/eclipse/linuxtools/ctf/parser/CTFParser.java less more
0 // $ANTLR !Unknown version! CTFParser.g 2012-10-22 14:14:35
1
2 package org.eclipse.linuxtools.ctf.parser;
3 import java.util.HashSet;
4 import java.util.Set;
5 import java.util.Stack;
6
7 import org.antlr.runtime.BaseRecognizer;
8 import org.antlr.runtime.BitSet;
9 import org.antlr.runtime.DFA;
10 import org.antlr.runtime.EarlyExitException;
11 import org.antlr.runtime.FailedPredicateException;
12 import org.antlr.runtime.IntStream;
13 import org.antlr.runtime.MismatchedSetException;
14 import org.antlr.runtime.MismatchedTokenException;
15 import org.antlr.runtime.NoViableAltException;
16 import org.antlr.runtime.Parser;
17 import org.antlr.runtime.ParserRuleReturnScope;
18 import org.antlr.runtime.RecognitionException;
19 import org.antlr.runtime.RecognizerSharedState;
20 import org.antlr.runtime.Token;
21 import org.antlr.runtime.TokenStream;
22 import org.antlr.runtime.tree.CommonTree;
23 import org.antlr.runtime.tree.CommonTreeAdaptor;
24 import org.antlr.runtime.tree.RewriteEarlyExitException;
25 import org.antlr.runtime.tree.RewriteRuleSubtreeStream;
26 import org.antlr.runtime.tree.RewriteRuleTokenStream;
27 import org.antlr.runtime.tree.TreeAdaptor;
28
29 @SuppressWarnings("all")
30 public class CTFParser extends Parser {
31 public static final String[] tokenNames = new String[] {
32 "<invalid>", "<EOR>", "<DOWN>", "<UP>", "ALIGNTOK", "CONSTTOK", "CHARTOK", "DOUBLETOK", "ENUMTOK", "EVENTTOK", "FLOATINGPOINTTOK", "FLOATTOK", "INTEGERTOK", "INTTOK", "LONGTOK", "SHORTTOK", "SIGNEDTOK", "STREAMTOK", "STRINGTOK", "STRUCTTOK", "TRACETOK", "TYPEALIASTOK", "TYPEDEFTOK", "UNSIGNEDTOK", "VARIANTTOK", "VOIDTOK", "BOOLTOK", "COMPLEXTOK", "IMAGINARYTOK", "ENVTOK", "CLOCKTOK", "CALLSITETOK", "NANNUMBERTOK", "INFINITYTOK", "NINFINITYTOK", "SEPARATOR", "COLON", "ELIPSES", "ASSIGNMENT", "TYPE_ASSIGNMENT", "LT", "GT", "OPENBRAC", "CLOSEBRAC", "LPAREN", "RPAREN", "LCURL", "RCURL", "TERM", "POINTER", "SIGN", "ARROW", "DOT", "BACKSLASH", "INTEGER_TYPES_SUFFIX", "OCTAL_LITERAL", "DIGIT", "DECIMAL_LITERAL", "HEX_PREFIX", "HEX_DIGIT", "HEX_LITERAL", "NONZERO_DIGIT", "OCTAL_ESCAPE", "UNICODE_ESCAPE", "HEXADECIMAL_ESCAPE", "ESCAPE_SEQUENCE", "STRINGPREFIX", "SINGLEQUOTE", "CHAR_CONTENT", "CHARACTER_LITERAL", "DOUBLEQUOTE", "STRING_CONTENT", "STRING_LITERAL", "WS", "COMMENT_OPEN", "COMMENT_CLOSE", "COMMENT", "LINE_COMMENT", "NONDIGIT", "IDENTIFIER", "ROOT", "EVENT", "STREAM", "TRACE", "ENV", "CLOCK", "CALLSITE", "DECLARATION", "SV_DECLARATION", "TYPE_SPECIFIER_LIST", "TYPE_DECLARATOR_LIST", "TYPE_DECLARATOR", "STRUCT", "STRUCT_NAME", "STRUCT_BODY", "ALIGN", "CTF_EXPRESSION_TYPE", "CTF_EXPRESSION_VAL", "CTF_LEFT", "CTF_RIGHT", "UNARY_EXPRESSION_STRING", "UNARY_EXPRESSION_STRING_QUOTES", "UNARY_EXPRESSION_DEC", "UNARY_EXPRESSION_HEX", "UNARY_EXPRESSION_OCT", "LENGTH", "TYPEDEF", "TYPEALIAS", "TYPEALIAS_TARGET", "TYPEALIAS_ALIAS", "INTEGER", "STRING", "FLOATING_POINT", "ENUM", "ENUM_CONTAINER_TYPE", "ENUM_ENUMERATOR", "ENUM_NAME", "ENUM_VALUE", "ENUM_VALUE_RANGE", "ENUM_BODY", "VARIANT", "VARIANT_NAME", "VARIANT_TAG", "VARIANT_BODY", "DECLARATOR"
33 };
34 public static final int SIGN=50;
35 public static final int LT=40;
36 public static final int TYPEDEFTOK=22;
37 public static final int VARIANT_NAME=121;
38 public static final int ENV=84;
39 public static final int INTEGER_TYPES_SUFFIX=54;
40 public static final int POINTER=49;
41 public static final int TRACE=83;
42 public static final int HEX_PREFIX=58;
43 public static final int INTTOK=13;
44 public static final int SEPARATOR=35;
45 public static final int ENUMTOK=8;
46 public static final int COMPLEXTOK=27;
47 public static final int IMAGINARYTOK=28;
48 public static final int STREAMTOK=17;
49 public static final int EOF=-1;
50 public static final int UNARY_EXPRESSION_OCT=104;
51 public static final int ENUM_VALUE=117;
52 public static final int UNSIGNEDTOK=23;
53 public static final int ENUM_NAME=116;
54 public static final int RPAREN=45;
55 public static final int CHAR_CONTENT=68;
56 public static final int STRING_LITERAL=72;
57 public static final int UNARY_EXPRESSION_STRING_QUOTES=101;
58 public static final int ALIGNTOK=4;
59 public static final int FLOATTOK=11;
60 public static final int STRUCT_BODY=94;
61 public static final int ENUM_BODY=119;
62 public static final int COMMENT_CLOSE=75;
63 public static final int STRINGTOK=18;
64 public static final int COMMENT=76;
65 public static final int STREAM=82;
66 public static final int UNARY_EXPRESSION_HEX=103;
67 public static final int UNARY_EXPRESSION_DEC=102;
68 public static final int FLOATINGPOINTTOK=10;
69 public static final int LINE_COMMENT=77;
70 public static final int CTF_EXPRESSION_TYPE=96;
71 public static final int DOUBLETOK=7;
72 public static final int TYPE_DECLARATOR=91;
73 public static final int CHARACTER_LITERAL=69;
74 public static final int STRUCT_NAME=93;
75 public static final int OCTAL_ESCAPE=62;
76 public static final int VARIANT=120;
77 public static final int NANNUMBERTOK=32;
78 public static final int ENUM_ENUMERATOR=115;
79 public static final int FLOATING_POINT=112;
80 public static final int DECLARATOR=124;
81 public static final int SIGNEDTOK=16;
82 public static final int CHARTOK=6;
83 public static final int WS=73;
84 public static final int INTEGERTOK=12;
85 public static final int VARIANT_BODY=123;
86 public static final int NONDIGIT=78;
87 public static final int GT=41;
88 public static final int TYPEALIAS_TARGET=108;
89 public static final int DECIMAL_LITERAL=57;
90 public static final int BACKSLASH=53;
91 public static final int CLOSEBRAC=43;
92 public static final int TERM=48;
93 public static final int BOOLTOK=26;
94 public static final int CTF_RIGHT=99;
95 public static final int TYPE_DECLARATOR_LIST=90;
96 public static final int STRING_CONTENT=71;
97 public static final int TYPE_ASSIGNMENT=39;
98 public static final int ENUM_CONTAINER_TYPE=114;
99 public static final int DOUBLEQUOTE=70;
100 public static final int ENUM_VALUE_RANGE=118;
101 public static final int DECLARATION=87;
102 public static final int LENGTH=105;
103 public static final int INFINITYTOK=33;
104 public static final int LPAREN=44;
105 public static final int STRINGPREFIX=66;
106 public static final int CTF_EXPRESSION_VAL=97;
107 public static final int ESCAPE_SEQUENCE=65;
108 public static final int UNICODE_ESCAPE=63;
109 public static final int CALLSITETOK=31;
110 public static final int SINGLEQUOTE=67;
111 public static final int IDENTIFIER=79;
112 public static final int HEX_LITERAL=60;
113 public static final int ALIGN=95;
114 public static final int DIGIT=56;
115 public static final int DOT=52;
116 public static final int ENVTOK=29;
117 public static final int STRUCTTOK=19;
118 public static final int TYPEALIASTOK=21;
119 public static final int OPENBRAC=42;
120 public static final int CLOCK=85;
121 public static final int INTEGER=110;
122 public static final int TYPEALIAS=107;
123 public static final int CALLSITE=86;
124 public static final int EVENTTOK=9;
125 public static final int NINFINITYTOK=34;
126 public static final int TYPEDEF=106;
127 public static final int VOIDTOK=25;
128 public static final int TYPE_SPECIFIER_LIST=89;
129 public static final int OCTAL_LITERAL=55;
130 public static final int COMMENT_OPEN=74;
131 public static final int HEX_DIGIT=59;
132 public static final int STRUCT=92;
133 public static final int EVENT=81;
134 public static final int LONGTOK=14;
135 public static final int ROOT=80;
136 public static final int CTF_LEFT=98;
137 public static final int CLOCKTOK=30;
138 public static final int TRACETOK=20;
139 public static final int COLON=36;
140 public static final int HEXADECIMAL_ESCAPE=64;
141 public static final int LCURL=46;
142 public static final int VARIANTTOK=24;
143 public static final int VARIANT_TAG=122;
144 public static final int ENUM=113;
145 public static final int ELIPSES=37;
146 public static final int RCURL=47;
147 public static final int TYPEALIAS_ALIAS=109;
148 public static final int UNARY_EXPRESSION_STRING=100;
149 public static final int ARROW=51;
150 public static final int ASSIGNMENT=38;
151 public static final int SHORTTOK=15;
152 public static final int SV_DECLARATION=88;
153 public static final int NONZERO_DIGIT=61;
154 public static final int CONSTTOK=5;
155 public static final int STRING=111;
156
157 // delegates
158 // delegators
159
160 protected static class Symbols_scope {
161 Set<String> types;
162 }
163 protected Stack Symbols_stack = new Stack();
164
165
166 public CTFParser(TokenStream input) {
167 this(input, new RecognizerSharedState());
168 }
169 public CTFParser(TokenStream input, RecognizerSharedState state) {
170 super(input, state);
171
172 }
173
174 protected TreeAdaptor adaptor = new CommonTreeAdaptor();
175
176 public void setTreeAdaptor(TreeAdaptor adaptor) {
177 this.adaptor = adaptor;
178 }
179 public TreeAdaptor getTreeAdaptor() {
180 return adaptor;
181 }
182
183 public String[] getTokenNames() { return CTFParser.tokenNames; }
184 public String getGrammarFileName() { return "CTFParser.g"; }
185
186
187 public CTFParser(TokenStream input, boolean verbose) {
188 this(input);
189 this.verbose = verbose;
190 }
191
192 /* To disable automatic error recovery. When we have a mismatched token, simply throw an exception. */
193 @Override
194 protected Object recoverFromMismatchedToken(IntStream input, int ttype, BitSet follow) throws RecognitionException
195 {
196 throw new MismatchedTokenException(ttype, input);
197 }
198
199 /**
200 * Checks if a given name has been defined has a type.
201 * From: http://www.antlr.org/grammar/1153358328744/C.g
202 *
203 * @param name The name to check.
204 * @return True if is is a type, false otherwise.
205 */
206 boolean isTypeName(String name) {
207 for (int i = Symbols_stack.size() - 1; i >= 0; i--) {
208 Symbols_scope scope = (Symbols_scope)Symbols_stack.get(i);
209 if (scope.types.contains(name)) {
210 return true;
211 }
212 }
213 return false;
214 }
215
216 void addTypeName(String name) {
217 ((Symbols_scope)Symbols_stack.peek()).types.add(name);
218 if (verbose) {
219 debug_print("New type: " + name);
220 }
221 }
222
223 boolean _inTypedef = false;
224
225 void typedefOn() {
226 debug_print("typedefOn");
227 _inTypedef = true;
228 }
229
230 void typedefOff() {
231 debug_print("typedefOff");
232 _inTypedef = false;
233 }
234
235 boolean inTypedef() {
236 return _inTypedef;
237 }
238
239 boolean _inTypealiasAlias = false;
240
241 void typealiasAliasOn() {
242 debug_print("typealiasAliasOn");
243 _inTypealiasAlias = true;
244 }
245
246 void typealiasAliasOff() {
247 debug_print("typealiasAliasOff");
248 _inTypealiasAlias = false;
249 }
250
251 boolean inTypealiasAlias() {
252 return _inTypealiasAlias;
253 }
254
255 void print_tabs(int n) {
256 for (int i = 0; i < n; i++) {
257 System.out.print(" ");
258 }
259 }
260
261 void enter(String name) {
262 if (verbose) {
263 if (state.backtracking == 0) {
264 print_tabs(depth);
265 debug_print("+ " + name);
266 depth++;
267 }
268 }
269 }
270
271 void exit(String name) {
272 if (verbose) {
273 depth--;
274 print_tabs(depth);
275 debug_print("- " + name);
276 }
277 }
278
279 void debug_print(String str) {
280 if (verbose) {
281 System.out.println(str);
282 }
283 }
284
285 int depth = 0;
286
287 /* Prints rule entry and exit while parsing */
288 boolean verbose = false;
289
290
291 public static class parse_return extends ParserRuleReturnScope {
292 CommonTree tree;
293 public Object getTree() { return tree; }
294 };
295
296 // $ANTLR start "parse"
297 // CTFParser.g:199:1: parse : ( declaration )+ EOF -> ^( ROOT ( declaration )+ ) ;
298 public final CTFParser.parse_return parse() throws RecognitionException {
299 Symbols_stack.push(new Symbols_scope());
300
301 CTFParser.parse_return retval = new CTFParser.parse_return();
302 retval.start = input.LT(1);
303
304 CommonTree root_0 = null;
305
306 Token EOF2=null;
307 CTFParser.declaration_return declaration1 = null;
308
309
310 CommonTree EOF2_tree=null;
311 RewriteRuleTokenStream stream_EOF=new RewriteRuleTokenStream(adaptor,"token EOF");
312 RewriteRuleSubtreeStream stream_declaration=new RewriteRuleSubtreeStream(adaptor,"rule declaration");
313
314 enter("parse");
315 debug_print("Scope push " + Symbols_stack.size());
316 ((Symbols_scope)Symbols_stack.peek()).types = new HashSet<String>();
317
318 try {
319 // CTFParser.g:212:1: ( ( declaration )+ EOF -> ^( ROOT ( declaration )+ ) )
320 // CTFParser.g:213:3: ( declaration )+ EOF
321 {
322 // CTFParser.g:213:3: ( declaration )+
323 int cnt1=0;
324 loop1:
325 do {
326 int alt1=2;
327 int LA1_0 = input.LA(1);
328
329 if ( ((LA1_0>=CONSTTOK && LA1_0<=ENUMTOK)||(LA1_0>=FLOATINGPOINTTOK && LA1_0<=SIGNEDTOK)||(LA1_0>=STRINGTOK && LA1_0<=STRUCTTOK)||(LA1_0>=TYPEDEFTOK && LA1_0<=IMAGINARYTOK)) ) {
330 alt1=1;
331 }
332 else if ( (LA1_0==IDENTIFIER) && ((inTypealiasAlias() || isTypeName(input.LT(1).getText())))) {
333 alt1=1;
334 }
335 else if ( (LA1_0==EVENTTOK||LA1_0==STREAMTOK||(LA1_0>=TRACETOK && LA1_0<=TYPEALIASTOK)||(LA1_0>=ENVTOK && LA1_0<=CALLSITETOK)) ) {
336 alt1=1;
337 }
338
339
340 switch (alt1) {
341 case 1 :
342 // CTFParser.g:213:3: declaration
343 {
344 pushFollow(FOLLOW_declaration_in_parse325);
345 declaration1=declaration();
346
347 state._fsp--;
348 if (state.failed) {
349 return retval;
350 }
351 if ( state.backtracking==0 ) {
352 stream_declaration.add(declaration1.getTree());
353 }
354
355 }
356 break;
357
358 default :
359 if ( cnt1 >= 1 ) {
360 break loop1;
361 }
362 if (state.backtracking>0) {state.failed=true; return retval;}
363 EarlyExitException eee =
364 new EarlyExitException(1, input);
365 throw eee;
366 }
367 cnt1++;
368 } while (true);
369
370 EOF2=(Token)match(input,EOF,FOLLOW_EOF_in_parse328); if (state.failed) {
371 return retval;
372 }
373 if ( state.backtracking==0 ) {
374 stream_EOF.add(EOF2);
375 }
376
377
378
379 // AST REWRITE
380 // elements: declaration
381 // token labels:
382 // rule labels: retval
383 // token list labels:
384 // rule list labels:
385 // wildcard labels:
386 if ( state.backtracking==0 ) {
387 retval.tree = root_0;
388 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
389
390 root_0 = (CommonTree)adaptor.nil();
391 // 213:20: -> ^( ROOT ( declaration )+ )
392 {
393 // CTFParser.g:213:23: ^( ROOT ( declaration )+ )
394 {
395 CommonTree root_1 = (CommonTree)adaptor.nil();
396 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ROOT, "ROOT"), root_1);
397
398 if ( !(stream_declaration.hasNext()) ) {
399 throw new RewriteEarlyExitException();
400 }
401 while ( stream_declaration.hasNext() ) {
402 adaptor.addChild(root_1, stream_declaration.nextTree());
403
404 }
405 stream_declaration.reset();
406
407 adaptor.addChild(root_0, root_1);
408 }
409
410 }
411
412 retval.tree = root_0;}
413 }
414
415 retval.stop = input.LT(-1);
416
417 if ( state.backtracking==0 ) {
418
419 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
420 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
421 }
422 if ( state.backtracking==0 ) {
423
424 debug_print("Scope pop " + Symbols_stack.size());
425 exit("parse");
426
427 debug_print("Final depth, should be 0: " + depth);
428
429 }
430 }
431
432 catch (RecognitionException e)
433 {
434 throw e;
435 }
436 finally {
437 Symbols_stack.pop();
438
439 }
440 return retval;
441 }
442 // $ANTLR end "parse"
443
444 public static class numberLiteral_return extends ParserRuleReturnScope {
445 CommonTree tree;
446 public Object getTree() { return tree; }
447 };
448
449 // $ANTLR start "numberLiteral"
450 // CTFParser.g:216:1: numberLiteral : ( SIGN )* ( HEX_LITERAL -> ^( UNARY_EXPRESSION_HEX HEX_LITERAL ( SIGN )* ) | DECIMAL_LITERAL -> ^( UNARY_EXPRESSION_DEC DECIMAL_LITERAL ( SIGN )* ) | OCTAL_LITERAL -> ^( UNARY_EXPRESSION_OCT OCTAL_LITERAL ( SIGN )* ) ) ;
451 public final CTFParser.numberLiteral_return numberLiteral() throws RecognitionException {
452 CTFParser.numberLiteral_return retval = new CTFParser.numberLiteral_return();
453 retval.start = input.LT(1);
454
455 CommonTree root_0 = null;
456
457 Token SIGN3=null;
458 Token HEX_LITERAL4=null;
459 Token DECIMAL_LITERAL5=null;
460 Token OCTAL_LITERAL6=null;
461
462 CommonTree SIGN3_tree=null;
463 CommonTree HEX_LITERAL4_tree=null;
464 CommonTree DECIMAL_LITERAL5_tree=null;
465 CommonTree OCTAL_LITERAL6_tree=null;
466 RewriteRuleTokenStream stream_SIGN=new RewriteRuleTokenStream(adaptor,"token SIGN");
467 RewriteRuleTokenStream stream_OCTAL_LITERAL=new RewriteRuleTokenStream(adaptor,"token OCTAL_LITERAL");
468 RewriteRuleTokenStream stream_HEX_LITERAL=new RewriteRuleTokenStream(adaptor,"token HEX_LITERAL");
469 RewriteRuleTokenStream stream_DECIMAL_LITERAL=new RewriteRuleTokenStream(adaptor,"token DECIMAL_LITERAL");
470
471
472 enter("numberLiteral");
473
474 try {
475 // CTFParser.g:224:1: ( ( SIGN )* ( HEX_LITERAL -> ^( UNARY_EXPRESSION_HEX HEX_LITERAL ( SIGN )* ) | DECIMAL_LITERAL -> ^( UNARY_EXPRESSION_DEC DECIMAL_LITERAL ( SIGN )* ) | OCTAL_LITERAL -> ^( UNARY_EXPRESSION_OCT OCTAL_LITERAL ( SIGN )* ) ) )
476 // CTFParser.g:225:3: ( SIGN )* ( HEX_LITERAL -> ^( UNARY_EXPRESSION_HEX HEX_LITERAL ( SIGN )* ) | DECIMAL_LITERAL -> ^( UNARY_EXPRESSION_DEC DECIMAL_LITERAL ( SIGN )* ) | OCTAL_LITERAL -> ^( UNARY_EXPRESSION_OCT OCTAL_LITERAL ( SIGN )* ) )
477 {
478 // CTFParser.g:225:3: ( SIGN )*
479 loop2:
480 do {
481 int alt2=2;
482 int LA2_0 = input.LA(1);
483
484 if ( (LA2_0==SIGN) ) {
485 alt2=1;
486 }
487
488
489 switch (alt2) {
490 case 1 :
491 // CTFParser.g:225:3: SIGN
492 {
493 SIGN3=(Token)match(input,SIGN,FOLLOW_SIGN_in_numberLiteral361); if (state.failed) {
494 return retval;
495 }
496 if ( state.backtracking==0 ) {
497 stream_SIGN.add(SIGN3);
498 }
499
500
501 }
502 break;
503
504 default :
505 break loop2;
506 }
507 } while (true);
508
509 // CTFParser.g:225:10: ( HEX_LITERAL -> ^( UNARY_EXPRESSION_HEX HEX_LITERAL ( SIGN )* ) | DECIMAL_LITERAL -> ^( UNARY_EXPRESSION_DEC DECIMAL_LITERAL ( SIGN )* ) | OCTAL_LITERAL -> ^( UNARY_EXPRESSION_OCT OCTAL_LITERAL ( SIGN )* ) )
510 int alt3=3;
511 switch ( input.LA(1) ) {
512 case HEX_LITERAL:
513 {
514 alt3=1;
515 }
516 break;
517 case DECIMAL_LITERAL:
518 {
519 alt3=2;
520 }
521 break;
522 case OCTAL_LITERAL:
523 {
524 alt3=3;
525 }
526 break;
527 default:
528 if (state.backtracking>0) {state.failed=true; return retval;}
529 NoViableAltException nvae =
530 new NoViableAltException("", 3, 0, input);
531
532 throw nvae;
533 }
534
535 switch (alt3) {
536 case 1 :
537 // CTFParser.g:225:11: HEX_LITERAL
538 {
539 HEX_LITERAL4=(Token)match(input,HEX_LITERAL,FOLLOW_HEX_LITERAL_in_numberLiteral366); if (state.failed) {
540 return retval;
541 }
542 if ( state.backtracking==0 ) {
543 stream_HEX_LITERAL.add(HEX_LITERAL4);
544 }
545
546
547
548 // AST REWRITE
549 // elements: SIGN, HEX_LITERAL
550 // token labels:
551 // rule labels: retval
552 // token list labels:
553 // rule list labels:
554 // wildcard labels:
555 if ( state.backtracking==0 ) {
556 retval.tree = root_0;
557 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
558
559 root_0 = (CommonTree)adaptor.nil();
560 // 225:23: -> ^( UNARY_EXPRESSION_HEX HEX_LITERAL ( SIGN )* )
561 {
562 // CTFParser.g:225:26: ^( UNARY_EXPRESSION_HEX HEX_LITERAL ( SIGN )* )
563 {
564 CommonTree root_1 = (CommonTree)adaptor.nil();
565 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(UNARY_EXPRESSION_HEX, "UNARY_EXPRESSION_HEX"), root_1);
566
567 adaptor.addChild(root_1, stream_HEX_LITERAL.nextNode());
568 // CTFParser.g:225:61: ( SIGN )*
569 while ( stream_SIGN.hasNext() ) {
570 adaptor.addChild(root_1, stream_SIGN.nextNode());
571
572 }
573 stream_SIGN.reset();
574
575 adaptor.addChild(root_0, root_1);
576 }
577
578 }
579
580 retval.tree = root_0;}
581 }
582 break;
583 case 2 :
584 // CTFParser.g:226:5: DECIMAL_LITERAL
585 {
586 DECIMAL_LITERAL5=(Token)match(input,DECIMAL_LITERAL,FOLLOW_DECIMAL_LITERAL_in_numberLiteral383); if (state.failed) {
587 return retval;
588 }
589 if ( state.backtracking==0 ) {
590 stream_DECIMAL_LITERAL.add(DECIMAL_LITERAL5);
591 }
592
593
594
595 // AST REWRITE
596 // elements: DECIMAL_LITERAL, SIGN
597 // token labels:
598 // rule labels: retval
599 // token list labels:
600 // rule list labels:
601 // wildcard labels:
602 if ( state.backtracking==0 ) {
603 retval.tree = root_0;
604 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
605
606 root_0 = (CommonTree)adaptor.nil();
607 // 226:21: -> ^( UNARY_EXPRESSION_DEC DECIMAL_LITERAL ( SIGN )* )
608 {
609 // CTFParser.g:226:24: ^( UNARY_EXPRESSION_DEC DECIMAL_LITERAL ( SIGN )* )
610 {
611 CommonTree root_1 = (CommonTree)adaptor.nil();
612 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(UNARY_EXPRESSION_DEC, "UNARY_EXPRESSION_DEC"), root_1);
613
614 adaptor.addChild(root_1, stream_DECIMAL_LITERAL.nextNode());
615 // CTFParser.g:226:63: ( SIGN )*
616 while ( stream_SIGN.hasNext() ) {
617 adaptor.addChild(root_1, stream_SIGN.nextNode());
618
619 }
620 stream_SIGN.reset();
621
622 adaptor.addChild(root_0, root_1);
623 }
624
625 }
626
627 retval.tree = root_0;}
628 }
629 break;
630 case 3 :
631 // CTFParser.g:227:5: OCTAL_LITERAL
632 {
633 OCTAL_LITERAL6=(Token)match(input,OCTAL_LITERAL,FOLLOW_OCTAL_LITERAL_in_numberLiteral400); if (state.failed) {
634 return retval;
635 }
636 if ( state.backtracking==0 ) {
637 stream_OCTAL_LITERAL.add(OCTAL_LITERAL6);
638 }
639
640
641
642 // AST REWRITE
643 // elements: OCTAL_LITERAL, SIGN
644 // token labels:
645 // rule labels: retval
646 // token list labels:
647 // rule list labels:
648 // wildcard labels:
649 if ( state.backtracking==0 ) {
650 retval.tree = root_0;
651 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
652
653 root_0 = (CommonTree)adaptor.nil();
654 // 227:19: -> ^( UNARY_EXPRESSION_OCT OCTAL_LITERAL ( SIGN )* )
655 {
656 // CTFParser.g:227:22: ^( UNARY_EXPRESSION_OCT OCTAL_LITERAL ( SIGN )* )
657 {
658 CommonTree root_1 = (CommonTree)adaptor.nil();
659 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(UNARY_EXPRESSION_OCT, "UNARY_EXPRESSION_OCT"), root_1);
660
661 adaptor.addChild(root_1, stream_OCTAL_LITERAL.nextNode());
662 // CTFParser.g:227:59: ( SIGN )*
663 while ( stream_SIGN.hasNext() ) {
664 adaptor.addChild(root_1, stream_SIGN.nextNode());
665
666 }
667 stream_SIGN.reset();
668
669 adaptor.addChild(root_0, root_1);
670 }
671
672 }
673
674 retval.tree = root_0;}
675 }
676 break;
677
678 }
679
680
681 }
682
683 retval.stop = input.LT(-1);
684
685 if ( state.backtracking==0 ) {
686
687 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
688 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
689 }
690 if ( state.backtracking==0 ) {
691
692 debug_print(input.toString(retval.start,input.LT(-1)));
693 exit("numberLiteral");
694
695 }
696 }
697
698 catch (RecognitionException e)
699 {
700 throw e;
701 }
702 finally {
703 }
704 return retval;
705 }
706 // $ANTLR end "numberLiteral"
707
708 public static class constant_return extends ParserRuleReturnScope {
709 CommonTree tree;
710 public Object getTree() { return tree; }
711 };
712
713 // $ANTLR start "constant"
714 // CTFParser.g:230:1: constant : ( numberLiteral | enumConstant | CHARACTER_LITERAL );
715 public final CTFParser.constant_return constant() throws RecognitionException {
716 CTFParser.constant_return retval = new CTFParser.constant_return();
717 retval.start = input.LT(1);
718
719 CommonTree root_0 = null;
720
721 Token CHARACTER_LITERAL9=null;
722 CTFParser.numberLiteral_return numberLiteral7 = null;
723
724 CTFParser.enumConstant_return enumConstant8 = null;
725
726
727 CommonTree CHARACTER_LITERAL9_tree=null;
728
729
730 enter("constant");
731
732 try {
733 // CTFParser.g:237:1: ( numberLiteral | enumConstant | CHARACTER_LITERAL )
734 int alt4=3;
735 switch ( input.LA(1) ) {
736 case SIGN:
737 case OCTAL_LITERAL:
738 case DECIMAL_LITERAL:
739 case HEX_LITERAL:
740 {
741 alt4=1;
742 }
743 break;
744 case ALIGNTOK:
745 case EVENTTOK:
746 case SIGNEDTOK:
747 case STRINGTOK:
748 case STRING_LITERAL:
749 case IDENTIFIER:
750 {
751 alt4=2;
752 }
753 break;
754 case CHARACTER_LITERAL:
755 {
756 alt4=3;
757 }
758 break;
759 default:
760 if (state.backtracking>0) {state.failed=true; return retval;}
761 NoViableAltException nvae =
762 new NoViableAltException("", 4, 0, input);
763
764 throw nvae;
765 }
766
767 switch (alt4) {
768 case 1 :
769 // CTFParser.g:238:4: numberLiteral
770 {
771 root_0 = (CommonTree)adaptor.nil();
772
773 pushFollow(FOLLOW_numberLiteral_in_constant436);
774 numberLiteral7=numberLiteral();
775
776 state._fsp--;
777 if (state.failed) {
778 return retval;
779 }
780 if ( state.backtracking==0 ) {
781 adaptor.addChild(root_0, numberLiteral7.getTree());
782 }
783
784 }
785 break;
786 case 2 :
787 // CTFParser.g:239:5: enumConstant
788 {
789 root_0 = (CommonTree)adaptor.nil();
790
791 pushFollow(FOLLOW_enumConstant_in_constant442);
792 enumConstant8=enumConstant();
793
794 state._fsp--;
795 if (state.failed) {
796 return retval;
797 }
798 if ( state.backtracking==0 ) {
799 adaptor.addChild(root_0, enumConstant8.getTree());
800 }
801
802 }
803 break;
804 case 3 :
805 // CTFParser.g:240:5: CHARACTER_LITERAL
806 {
807 root_0 = (CommonTree)adaptor.nil();
808
809 CHARACTER_LITERAL9=(Token)match(input,CHARACTER_LITERAL,FOLLOW_CHARACTER_LITERAL_in_constant448); if (state.failed) {
810 return retval;
811 }
812 if ( state.backtracking==0 ) {
813 CHARACTER_LITERAL9_tree = (CommonTree)adaptor.create(CHARACTER_LITERAL9);
814 adaptor.addChild(root_0, CHARACTER_LITERAL9_tree);
815 }
816
817 }
818 break;
819
820 }
821 retval.stop = input.LT(-1);
822
823 if ( state.backtracking==0 ) {
824
825 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
826 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
827 }
828 if ( state.backtracking==0 ) {
829
830 exit("constant");
831
832 }
833 }
834
835 catch (RecognitionException e)
836 {
837 throw e;
838 }
839 finally {
840 }
841 return retval;
842 }
843 // $ANTLR end "constant"
844
845 public static class primaryExpression_return extends ParserRuleReturnScope {
846 CommonTree tree;
847 public Object getTree() { return tree; }
848 };
849
850 // $ANTLR start "primaryExpression"
851 // CTFParser.g:243:1: primaryExpression : ( ( IDENTIFIER )=> IDENTIFIER -> ^( UNARY_EXPRESSION_STRING IDENTIFIER ) | ( ctfKeyword )=> ctfKeyword -> ^( UNARY_EXPRESSION_STRING ctfKeyword ) | ( STRING_LITERAL )=> STRING_LITERAL -> ^( UNARY_EXPRESSION_STRING_QUOTES STRING_LITERAL ) | constant );
852 public final CTFParser.primaryExpression_return primaryExpression() throws RecognitionException {
853 CTFParser.primaryExpression_return retval = new CTFParser.primaryExpression_return();
854 retval.start = input.LT(1);
855
856 CommonTree root_0 = null;
857
858 Token IDENTIFIER10=null;
859 Token STRING_LITERAL12=null;
860 CTFParser.ctfKeyword_return ctfKeyword11 = null;
861
862 CTFParser.constant_return constant13 = null;
863
864
865 CommonTree IDENTIFIER10_tree=null;
866 CommonTree STRING_LITERAL12_tree=null;
867 RewriteRuleTokenStream stream_STRING_LITERAL=new RewriteRuleTokenStream(adaptor,"token STRING_LITERAL");
868 RewriteRuleTokenStream stream_IDENTIFIER=new RewriteRuleTokenStream(adaptor,"token IDENTIFIER");
869 RewriteRuleSubtreeStream stream_ctfKeyword=new RewriteRuleSubtreeStream(adaptor,"rule ctfKeyword");
870
871 enter("primaryExpression");
872
873 try {
874 // CTFParser.g:250:1: ( ( IDENTIFIER )=> IDENTIFIER -> ^( UNARY_EXPRESSION_STRING IDENTIFIER ) | ( ctfKeyword )=> ctfKeyword -> ^( UNARY_EXPRESSION_STRING ctfKeyword ) | ( STRING_LITERAL )=> STRING_LITERAL -> ^( UNARY_EXPRESSION_STRING_QUOTES STRING_LITERAL ) | constant )
875 int alt5=4;
876 switch ( input.LA(1) ) {
877 case IDENTIFIER:
878 {
879 int LA5_1 = input.LA(2);
880
881 if ( (synpred1_CTFParser()) ) {
882 alt5=1;
883 }
884 else if ( (true) ) {
885 alt5=4;
886 }
887 else {
888 if (state.backtracking>0) {state.failed=true; return retval;}
889 NoViableAltException nvae =
890 new NoViableAltException("", 5, 1, input);
891
892 throw nvae;
893 }
894 }
895 break;
896 case ALIGNTOK:
897 case EVENTTOK:
898 case SIGNEDTOK:
899 case STRINGTOK:
900 {
901 int LA5_2 = input.LA(2);
902
903 if ( (synpred2_CTFParser()) ) {
904 alt5=2;
905 }
906 else if ( (true) ) {
907 alt5=4;
908 }
909 else {
910 if (state.backtracking>0) {state.failed=true; return retval;}
911 NoViableAltException nvae =
912 new NoViableAltException("", 5, 2, input);
913
914 throw nvae;
915 }
916 }
917 break;
918 case STRING_LITERAL:
919 {
920 int LA5_3 = input.LA(2);
921
922 if ( (synpred3_CTFParser()) ) {
923 alt5=3;
924 }
925 else if ( (true) ) {
926 alt5=4;
927 }
928 else {
929 if (state.backtracking>0) {state.failed=true; return retval;}
930 NoViableAltException nvae =
931 new NoViableAltException("", 5, 3, input);
932
933 throw nvae;
934 }
935 }
936 break;
937 case SIGN:
938 case OCTAL_LITERAL:
939 case DECIMAL_LITERAL:
940 case HEX_LITERAL:
941 case CHARACTER_LITERAL:
942 {
943 alt5=4;
944 }
945 break;
946 default:
947 if (state.backtracking>0) {state.failed=true; return retval;}
948 NoViableAltException nvae =
949 new NoViableAltException("", 5, 0, input);
950
951 throw nvae;
952 }
953
954 switch (alt5) {
955 case 1 :
956 // CTFParser.g:251:5: ( IDENTIFIER )=> IDENTIFIER
957 {
958 IDENTIFIER10=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_primaryExpression479); if (state.failed) {
959 return retval;
960 }
961 if ( state.backtracking==0 ) {
962 stream_IDENTIFIER.add(IDENTIFIER10);
963 }
964
965 if ( state.backtracking==0 ) {
966 debug_print("IDENTIFIER: " + (IDENTIFIER10!=null?IDENTIFIER10.getText():null));
967 }
968
969
970 // AST REWRITE
971 // elements: IDENTIFIER
972 // token labels:
973 // rule labels: retval
974 // token list labels:
975 // rule list labels:
976 // wildcard labels:
977 if ( state.backtracking==0 ) {
978 retval.tree = root_0;
979 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
980
981 root_0 = (CommonTree)adaptor.nil();
982 // 251:83: -> ^( UNARY_EXPRESSION_STRING IDENTIFIER )
983 {
984 // CTFParser.g:251:86: ^( UNARY_EXPRESSION_STRING IDENTIFIER )
985 {
986 CommonTree root_1 = (CommonTree)adaptor.nil();
987 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(UNARY_EXPRESSION_STRING, "UNARY_EXPRESSION_STRING"), root_1);
988
989 adaptor.addChild(root_1, stream_IDENTIFIER.nextNode());
990
991 adaptor.addChild(root_0, root_1);
992 }
993
994 }
995
996 retval.tree = root_0;}
997 }
998 break;
999 case 2 :
1000 // CTFParser.g:252:5: ( ctfKeyword )=> ctfKeyword
1001 {
1002 pushFollow(FOLLOW_ctfKeyword_in_primaryExpression501);
1003 ctfKeyword11=ctfKeyword();
1004
1005 state._fsp--;
1006 if (state.failed) {
1007 return retval;
1008 }
1009 if ( state.backtracking==0 ) {
1010 stream_ctfKeyword.add(ctfKeyword11.getTree());
1011 }
1012
1013
1014 // AST REWRITE
1015 // elements: ctfKeyword
1016 // token labels:
1017 // rule labels: retval
1018 // token list labels:
1019 // rule list labels:
1020 // wildcard labels:
1021 if ( state.backtracking==0 ) {
1022 retval.tree = root_0;
1023 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1024
1025 root_0 = (CommonTree)adaptor.nil();
1026 // 252:32: -> ^( UNARY_EXPRESSION_STRING ctfKeyword )
1027 {
1028 // CTFParser.g:252:35: ^( UNARY_EXPRESSION_STRING ctfKeyword )
1029 {
1030 CommonTree root_1 = (CommonTree)adaptor.nil();
1031 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(UNARY_EXPRESSION_STRING, "UNARY_EXPRESSION_STRING"), root_1);
1032
1033 adaptor.addChild(root_1, stream_ctfKeyword.nextTree());
1034
1035 adaptor.addChild(root_0, root_1);
1036 }
1037
1038 }
1039
1040 retval.tree = root_0;}
1041 }
1042 break;
1043 case 3 :
1044 // CTFParser.g:253:5: ( STRING_LITERAL )=> STRING_LITERAL
1045 {
1046 STRING_LITERAL12=(Token)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_primaryExpression521); if (state.failed) {
1047 return retval;
1048 }
1049 if ( state.backtracking==0 ) {
1050 stream_STRING_LITERAL.add(STRING_LITERAL12);
1051 }
1052
1053 if ( state.backtracking==0 ) {
1054 debug_print("STRING_LITERAL: " + (STRING_LITERAL12!=null?STRING_LITERAL12.getText():null));
1055 }
1056
1057
1058 // AST REWRITE
1059 // elements: STRING_LITERAL
1060 // token labels:
1061 // rule labels: retval
1062 // token list labels:
1063 // rule list labels:
1064 // wildcard labels:
1065 if ( state.backtracking==0 ) {
1066 retval.tree = root_0;
1067 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1068
1069 root_0 = (CommonTree)adaptor.nil();
1070 // 253:99: -> ^( UNARY_EXPRESSION_STRING_QUOTES STRING_LITERAL )
1071 {
1072 // CTFParser.g:253:102: ^( UNARY_EXPRESSION_STRING_QUOTES STRING_LITERAL )
1073 {
1074 CommonTree root_1 = (CommonTree)adaptor.nil();
1075 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(UNARY_EXPRESSION_STRING_QUOTES, "UNARY_EXPRESSION_STRING_QUOTES"), root_1);
1076
1077 adaptor.addChild(root_1, stream_STRING_LITERAL.nextNode());
1078
1079 adaptor.addChild(root_0, root_1);
1080 }
1081
1082 }
1083
1084 retval.tree = root_0;}
1085 }
1086 break;
1087 case 4 :
1088 // CTFParser.g:255:5: constant
1089 {
1090 root_0 = (CommonTree)adaptor.nil();
1091
1092 pushFollow(FOLLOW_constant_in_primaryExpression542);
1093 constant13=constant();
1094
1095 state._fsp--;
1096 if (state.failed) {
1097 return retval;
1098 }
1099 if ( state.backtracking==0 ) {
1100 adaptor.addChild(root_0, constant13.getTree());
1101 }
1102
1103 }
1104 break;
1105
1106 }
1107 retval.stop = input.LT(-1);
1108
1109 if ( state.backtracking==0 ) {
1110
1111 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
1112 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
1113 }
1114 if ( state.backtracking==0 ) {
1115
1116 exit("primaryExpression");
1117
1118 }
1119 }
1120
1121 catch (RecognitionException e)
1122 {
1123 throw e;
1124 }
1125 finally {
1126 }
1127 return retval;
1128 }
1129 // $ANTLR end "primaryExpression"
1130
1131 public static class reference_return extends ParserRuleReturnScope {
1132 CommonTree tree;
1133 public Object getTree() { return tree; }
1134 };
1135
1136 // $ANTLR start "reference"
1137 // CTFParser.g:258:1: reference : (ref= DOT | ref= ARROW ) IDENTIFIER -> ^( $ref ^( UNARY_EXPRESSION_STRING IDENTIFIER ) ) ;
1138 public final CTFParser.reference_return reference() throws RecognitionException {
1139 CTFParser.reference_return retval = new CTFParser.reference_return();
1140 retval.start = input.LT(1);
1141
1142 CommonTree root_0 = null;
1143
1144 Token ref=null;
1145 Token IDENTIFIER14=null;
1146
1147 CommonTree ref_tree=null;
1148 CommonTree IDENTIFIER14_tree=null;
1149 RewriteRuleTokenStream stream_ARROW=new RewriteRuleTokenStream(adaptor,"token ARROW");
1150 RewriteRuleTokenStream stream_DOT=new RewriteRuleTokenStream(adaptor,"token DOT");
1151 RewriteRuleTokenStream stream_IDENTIFIER=new RewriteRuleTokenStream(adaptor,"token IDENTIFIER");
1152
1153
1154 enter("reference");
1155
1156 try {
1157 // CTFParser.g:266:1: ( (ref= DOT | ref= ARROW ) IDENTIFIER -> ^( $ref ^( UNARY_EXPRESSION_STRING IDENTIFIER ) ) )
1158 // CTFParser.g:267:3: (ref= DOT | ref= ARROW ) IDENTIFIER
1159 {
1160 // CTFParser.g:267:3: (ref= DOT | ref= ARROW )
1161 int alt6=2;
1162 int LA6_0 = input.LA(1);
1163
1164 if ( (LA6_0==DOT) ) {
1165 alt6=1;
1166 }
1167 else if ( (LA6_0==ARROW) ) {
1168 alt6=2;
1169 }
1170 else {
1171 if (state.backtracking>0) {state.failed=true; return retval;}
1172 NoViableAltException nvae =
1173 new NoViableAltException("", 6, 0, input);
1174
1175 throw nvae;
1176 }
1177 switch (alt6) {
1178 case 1 :
1179 // CTFParser.g:267:4: ref= DOT
1180 {
1181 ref=(Token)match(input,DOT,FOLLOW_DOT_in_reference568); if (state.failed) {
1182 return retval;
1183 }
1184 if ( state.backtracking==0 ) {
1185 stream_DOT.add(ref);
1186 }
1187
1188
1189 }
1190 break;
1191 case 2 :
1192 // CTFParser.g:267:14: ref= ARROW
1193 {
1194 ref=(Token)match(input,ARROW,FOLLOW_ARROW_in_reference574); if (state.failed) {
1195 return retval;
1196 }
1197 if ( state.backtracking==0 ) {
1198 stream_ARROW.add(ref);
1199 }
1200
1201
1202 }
1203 break;
1204
1205 }
1206
1207 IDENTIFIER14=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_reference577); if (state.failed) {
1208 return retval;
1209 }
1210 if ( state.backtracking==0 ) {
1211 stream_IDENTIFIER.add(IDENTIFIER14);
1212 }
1213
1214
1215
1216 // AST REWRITE
1217 // elements: IDENTIFIER, ref
1218 // token labels: ref
1219 // rule labels: retval
1220 // token list labels:
1221 // rule list labels:
1222 // wildcard labels:
1223 if ( state.backtracking==0 ) {
1224 retval.tree = root_0;
1225 RewriteRuleTokenStream stream_ref=new RewriteRuleTokenStream(adaptor,"token ref",ref);
1226 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1227
1228 root_0 = (CommonTree)adaptor.nil();
1229 // 267:36: -> ^( $ref ^( UNARY_EXPRESSION_STRING IDENTIFIER ) )
1230 {
1231 // CTFParser.g:267:39: ^( $ref ^( UNARY_EXPRESSION_STRING IDENTIFIER ) )
1232 {
1233 CommonTree root_1 = (CommonTree)adaptor.nil();
1234 root_1 = (CommonTree)adaptor.becomeRoot(stream_ref.nextNode(), root_1);
1235
1236 // CTFParser.g:267:46: ^( UNARY_EXPRESSION_STRING IDENTIFIER )
1237 {
1238 CommonTree root_2 = (CommonTree)adaptor.nil();
1239 root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(UNARY_EXPRESSION_STRING, "UNARY_EXPRESSION_STRING"), root_2);
1240
1241 adaptor.addChild(root_2, stream_IDENTIFIER.nextNode());
1242
1243 adaptor.addChild(root_1, root_2);
1244 }
1245
1246 adaptor.addChild(root_0, root_1);
1247 }
1248
1249 }
1250
1251 retval.tree = root_0;}
1252 }
1253
1254 retval.stop = input.LT(-1);
1255
1256 if ( state.backtracking==0 ) {
1257
1258 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
1259 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
1260 }
1261 if ( state.backtracking==0 ) {
1262
1263 debug_print(input.toString(retval.start,input.LT(-1)));
1264 exit("reference");
1265
1266 }
1267 }
1268
1269 catch (RecognitionException e)
1270 {
1271 throw e;
1272 }
1273 finally {
1274 }
1275 return retval;
1276 }
1277 // $ANTLR end "reference"
1278
1279 public static class postfixExpressionSuffix_return extends ParserRuleReturnScope {
1280 CommonTree tree;
1281 public Object getTree() { return tree; }
1282 };
1283
1284 // $ANTLR start "postfixExpressionSuffix"
1285 // CTFParser.g:270:1: postfixExpressionSuffix : ( ( OPENBRAC unaryExpression CLOSEBRAC ) | reference );
1286 public final CTFParser.postfixExpressionSuffix_return postfixExpressionSuffix() throws RecognitionException {
1287 CTFParser.postfixExpressionSuffix_return retval = new CTFParser.postfixExpressionSuffix_return();
1288 retval.start = input.LT(1);
1289
1290 CommonTree root_0 = null;
1291
1292 Token OPENBRAC15=null;
1293 Token CLOSEBRAC17=null;
1294 CTFParser.unaryExpression_return unaryExpression16 = null;
1295
1296 CTFParser.reference_return reference18 = null;
1297
1298
1299 CommonTree OPENBRAC15_tree=null;
1300 CommonTree CLOSEBRAC17_tree=null;
1301
1302
1303 enter("postfixExpressionSuffix");
1304
1305 try {
1306 // CTFParser.g:277:1: ( ( OPENBRAC unaryExpression CLOSEBRAC ) | reference )
1307 int alt7=2;
1308 int LA7_0 = input.LA(1);
1309
1310 if ( (LA7_0==OPENBRAC) ) {
1311 alt7=1;
1312 }
1313 else if ( ((LA7_0>=ARROW && LA7_0<=DOT)) ) {
1314 alt7=2;
1315 }
1316 else {
1317 if (state.backtracking>0) {state.failed=true; return retval;}
1318 NoViableAltException nvae =
1319 new NoViableAltException("", 7, 0, input);
1320
1321 throw nvae;
1322 }
1323 switch (alt7) {
1324 case 1 :
1325 // CTFParser.g:278:5: ( OPENBRAC unaryExpression CLOSEBRAC )
1326 {
1327 root_0 = (CommonTree)adaptor.nil();
1328
1329 // CTFParser.g:278:5: ( OPENBRAC unaryExpression CLOSEBRAC )
1330 // CTFParser.g:278:6: OPENBRAC unaryExpression CLOSEBRAC
1331 {
1332 OPENBRAC15=(Token)match(input,OPENBRAC,FOLLOW_OPENBRAC_in_postfixExpressionSuffix616); if (state.failed) {
1333 return retval;
1334 }
1335 if ( state.backtracking==0 ) {
1336 OPENBRAC15_tree = (CommonTree)adaptor.create(OPENBRAC15);
1337 adaptor.addChild(root_0, OPENBRAC15_tree);
1338 }
1339 pushFollow(FOLLOW_unaryExpression_in_postfixExpressionSuffix618);
1340 unaryExpression16=unaryExpression();
1341
1342 state._fsp--;
1343 if (state.failed) {
1344 return retval;
1345 }
1346 if ( state.backtracking==0 ) {
1347 adaptor.addChild(root_0, unaryExpression16.getTree());
1348 }
1349 CLOSEBRAC17=(Token)match(input,CLOSEBRAC,FOLLOW_CLOSEBRAC_in_postfixExpressionSuffix620); if (state.failed) {
1350 return retval;
1351 }
1352
1353 }
1354
1355
1356 }
1357 break;
1358 case 2 :
1359 // CTFParser.g:279:5: reference
1360 {
1361 root_0 = (CommonTree)adaptor.nil();
1362
1363 pushFollow(FOLLOW_reference_in_postfixExpressionSuffix628);
1364 reference18=reference();
1365
1366 state._fsp--;
1367 if (state.failed) {
1368 return retval;
1369 }
1370 if ( state.backtracking==0 ) {
1371 adaptor.addChild(root_0, reference18.getTree());
1372 }
1373
1374 }
1375 break;
1376
1377 }
1378 retval.stop = input.LT(-1);
1379
1380 if ( state.backtracking==0 ) {
1381
1382 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
1383 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
1384 }
1385 if ( state.backtracking==0 ) {
1386
1387 exit("postfixExpressionSuffix");
1388
1389 }
1390 }
1391
1392 catch (RecognitionException e)
1393 {
1394 throw e;
1395 }
1396 finally {
1397 }
1398 return retval;
1399 }
1400 // $ANTLR end "postfixExpressionSuffix"
1401
1402 public static class postfixExpression_return extends ParserRuleReturnScope {
1403 CommonTree tree;
1404 public Object getTree() { return tree; }
1405 };
1406
1407 // $ANTLR start "postfixExpression"
1408 // CTFParser.g:282:1: postfixExpression : ( ( primaryExpression ) ( postfixExpressionSuffix )* | ( ( ctfSpecifierHead ) ( postfixExpressionSuffix )+ ) );
1409 public final CTFParser.postfixExpression_return postfixExpression() throws RecognitionException {
1410 CTFParser.postfixExpression_return retval = new CTFParser.postfixExpression_return();
1411 retval.start = input.LT(1);
1412
1413 CommonTree root_0 = null;
1414
1415 CTFParser.primaryExpression_return primaryExpression19 = null;
1416
1417 CTFParser.postfixExpressionSuffix_return postfixExpressionSuffix20 = null;
1418
1419 CTFParser.ctfSpecifierHead_return ctfSpecifierHead21 = null;
1420
1421 CTFParser.postfixExpressionSuffix_return postfixExpressionSuffix22 = null;
1422
1423
1424
1425
1426 enter("postfixExpression");
1427
1428 try {
1429 // CTFParser.g:289:1: ( ( primaryExpression ) ( postfixExpressionSuffix )* | ( ( ctfSpecifierHead ) ( postfixExpressionSuffix )+ ) )
1430 int alt10=2;
1431 alt10 = dfa10.predict(input);
1432 switch (alt10) {
1433 case 1 :
1434 // CTFParser.g:290:3: ( primaryExpression ) ( postfixExpressionSuffix )*
1435 {
1436 root_0 = (CommonTree)adaptor.nil();
1437
1438 // CTFParser.g:290:3: ( primaryExpression )
1439 // CTFParser.g:290:4: primaryExpression
1440 {
1441 pushFollow(FOLLOW_primaryExpression_in_postfixExpression652);
1442 primaryExpression19=primaryExpression();
1443
1444 state._fsp--;
1445 if (state.failed) {
1446 return retval;
1447 }
1448 if ( state.backtracking==0 ) {
1449 adaptor.addChild(root_0, primaryExpression19.getTree());
1450 }
1451
1452 }
1453
1454 // CTFParser.g:290:23: ( postfixExpressionSuffix )*
1455 loop8:
1456 do {
1457 int alt8=2;
1458 int LA8_0 = input.LA(1);
1459
1460 if ( (LA8_0==OPENBRAC||(LA8_0>=ARROW && LA8_0<=DOT)) ) {
1461 alt8=1;
1462 }
1463
1464
1465 switch (alt8) {
1466 case 1 :
1467 // CTFParser.g:290:24: postfixExpressionSuffix
1468 {
1469 pushFollow(FOLLOW_postfixExpressionSuffix_in_postfixExpression656);
1470 postfixExpressionSuffix20=postfixExpressionSuffix();
1471
1472 state._fsp--;
1473 if (state.failed) {
1474 return retval;
1475 }
1476 if ( state.backtracking==0 ) {
1477 adaptor.addChild(root_0, postfixExpressionSuffix20.getTree());
1478 }
1479
1480 }
1481 break;
1482
1483 default :
1484 break loop8;
1485 }
1486 } while (true);
1487
1488
1489 }
1490 break;
1491 case 2 :
1492 // CTFParser.g:291:3: ( ( ctfSpecifierHead ) ( postfixExpressionSuffix )+ )
1493 {
1494 root_0 = (CommonTree)adaptor.nil();
1495
1496 // CTFParser.g:291:3: ( ( ctfSpecifierHead ) ( postfixExpressionSuffix )+ )
1497 // CTFParser.g:291:4: ( ctfSpecifierHead ) ( postfixExpressionSuffix )+
1498 {
1499 // CTFParser.g:291:4: ( ctfSpecifierHead )
1500 // CTFParser.g:291:5: ctfSpecifierHead
1501 {
1502 pushFollow(FOLLOW_ctfSpecifierHead_in_postfixExpression665);
1503 ctfSpecifierHead21=ctfSpecifierHead();
1504
1505 state._fsp--;
1506 if (state.failed) {
1507 return retval;
1508 }
1509 if ( state.backtracking==0 ) {
1510 adaptor.addChild(root_0, ctfSpecifierHead21.getTree());
1511 }
1512
1513 }
1514
1515 // CTFParser.g:291:24: ( postfixExpressionSuffix )+
1516 int cnt9=0;
1517 loop9:
1518 do {
1519 int alt9=2;
1520 int LA9_0 = input.LA(1);
1521
1522 if ( (LA9_0==OPENBRAC||(LA9_0>=ARROW && LA9_0<=DOT)) ) {
1523 alt9=1;
1524 }
1525
1526
1527 switch (alt9) {
1528 case 1 :
1529 // CTFParser.g:291:25: postfixExpressionSuffix
1530 {
1531 pushFollow(FOLLOW_postfixExpressionSuffix_in_postfixExpression670);
1532 postfixExpressionSuffix22=postfixExpressionSuffix();
1533
1534 state._fsp--;
1535 if (state.failed) {
1536 return retval;
1537 }
1538 if ( state.backtracking==0 ) {
1539 adaptor.addChild(root_0, postfixExpressionSuffix22.getTree());
1540 }
1541
1542 }
1543 break;
1544
1545 default :
1546 if ( cnt9 >= 1 ) {
1547 break loop9;
1548 }
1549 if (state.backtracking>0) {state.failed=true; return retval;}
1550 EarlyExitException eee =
1551 new EarlyExitException(9, input);
1552 throw eee;
1553 }
1554 cnt9++;
1555 } while (true);
1556
1557
1558 }
1559
1560
1561 }
1562 break;
1563
1564 }
1565 retval.stop = input.LT(-1);
1566
1567 if ( state.backtracking==0 ) {
1568
1569 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
1570 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
1571 }
1572 if ( state.backtracking==0 ) {
1573
1574 exit("postfixExpression");
1575
1576 }
1577 }
1578
1579 catch (RecognitionException e)
1580 {
1581 throw e;
1582 }
1583 finally {
1584 }
1585 return retval;
1586 }
1587 // $ANTLR end "postfixExpression"
1588
1589 public static class unaryExpression_return extends ParserRuleReturnScope {
1590 CommonTree tree;
1591 public Object getTree() { return tree; }
1592 };
1593
1594 // $ANTLR start "unaryExpression"
1595 // CTFParser.g:294:1: unaryExpression : postfixExpression ;
1596 public final CTFParser.unaryExpression_return unaryExpression() throws RecognitionException {
1597 CTFParser.unaryExpression_return retval = new CTFParser.unaryExpression_return();
1598 retval.start = input.LT(1);
1599
1600 CommonTree root_0 = null;
1601
1602 CTFParser.postfixExpression_return postfixExpression23 = null;
1603
1604
1605
1606
1607 enter("unaryExpression");
1608
1609 try {
1610 // CTFParser.g:301:1: ( postfixExpression )
1611 // CTFParser.g:304:5: postfixExpression
1612 {
1613 root_0 = (CommonTree)adaptor.nil();
1614
1615 pushFollow(FOLLOW_postfixExpression_in_unaryExpression704);
1616 postfixExpression23=postfixExpression();
1617
1618 state._fsp--;
1619 if (state.failed) {
1620 return retval;
1621 }
1622 if ( state.backtracking==0 ) {
1623 adaptor.addChild(root_0, postfixExpression23.getTree());
1624 }
1625
1626 }
1627
1628 retval.stop = input.LT(-1);
1629
1630 if ( state.backtracking==0 ) {
1631
1632 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
1633 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
1634 }
1635 if ( state.backtracking==0 ) {
1636
1637 exit("unaryExpression");
1638
1639 }
1640 }
1641
1642 catch (RecognitionException e)
1643 {
1644 throw e;
1645 }
1646 finally {
1647 }
1648 return retval;
1649 }
1650 // $ANTLR end "unaryExpression"
1651
1652 public static class enumConstant_return extends ParserRuleReturnScope {
1653 CommonTree tree;
1654 public Object getTree() { return tree; }
1655 };
1656
1657 // $ANTLR start "enumConstant"
1658 // CTFParser.g:307:1: enumConstant : ( STRING_LITERAL -> ^( UNARY_EXPRESSION_STRING_QUOTES STRING_LITERAL ) | IDENTIFIER -> ^( UNARY_EXPRESSION_STRING IDENTIFIER ) | ctfKeyword -> ^( UNARY_EXPRESSION_STRING ctfKeyword ) );
1659 public final CTFParser.enumConstant_return enumConstant() throws RecognitionException {
1660 CTFParser.enumConstant_return retval = new CTFParser.enumConstant_return();
1661 retval.start = input.LT(1);
1662
1663 CommonTree root_0 = null;
1664
1665 Token STRING_LITERAL24=null;
1666 Token IDENTIFIER25=null;
1667 CTFParser.ctfKeyword_return ctfKeyword26 = null;
1668
1669
1670 CommonTree STRING_LITERAL24_tree=null;
1671 CommonTree IDENTIFIER25_tree=null;
1672 RewriteRuleTokenStream stream_STRING_LITERAL=new RewriteRuleTokenStream(adaptor,"token STRING_LITERAL");
1673 RewriteRuleTokenStream stream_IDENTIFIER=new RewriteRuleTokenStream(adaptor,"token IDENTIFIER");
1674 RewriteRuleSubtreeStream stream_ctfKeyword=new RewriteRuleSubtreeStream(adaptor,"rule ctfKeyword");
1675
1676 enter("enumConstant");
1677
1678 try {
1679 // CTFParser.g:315:1: ( STRING_LITERAL -> ^( UNARY_EXPRESSION_STRING_QUOTES STRING_LITERAL ) | IDENTIFIER -> ^( UNARY_EXPRESSION_STRING IDENTIFIER ) | ctfKeyword -> ^( UNARY_EXPRESSION_STRING ctfKeyword ) )
1680 int alt11=3;
1681 switch ( input.LA(1) ) {
1682 case STRING_LITERAL:
1683 {
1684 alt11=1;
1685 }
1686 break;
1687 case IDENTIFIER:
1688 {
1689 alt11=2;
1690 }
1691 break;
1692 case ALIGNTOK:
1693 case EVENTTOK:
1694 case SIGNEDTOK:
1695 case STRINGTOK:
1696 {
1697 alt11=3;
1698 }
1699 break;
1700 default:
1701 if (state.backtracking>0) {state.failed=true; return retval;}
1702 NoViableAltException nvae =
1703 new NoViableAltException("", 11, 0, input);
1704
1705 throw nvae;
1706 }
1707
1708 switch (alt11) {
1709 case 1 :
1710 // CTFParser.g:316:5: STRING_LITERAL
1711 {
1712 STRING_LITERAL24=(Token)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_enumConstant729); if (state.failed) {
1713 return retval;
1714 }
1715 if ( state.backtracking==0 ) {
1716 stream_STRING_LITERAL.add(STRING_LITERAL24);
1717 }
1718
1719
1720
1721 // AST REWRITE
1722 // elements: STRING_LITERAL
1723 // token labels:
1724 // rule labels: retval
1725 // token list labels:
1726 // rule list labels:
1727 // wildcard labels:
1728 if ( state.backtracking==0 ) {
1729 retval.tree = root_0;
1730 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1731
1732 root_0 = (CommonTree)adaptor.nil();
1733 // 316:20: -> ^( UNARY_EXPRESSION_STRING_QUOTES STRING_LITERAL )
1734 {
1735 // CTFParser.g:316:23: ^( UNARY_EXPRESSION_STRING_QUOTES STRING_LITERAL )
1736 {
1737 CommonTree root_1 = (CommonTree)adaptor.nil();
1738 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(UNARY_EXPRESSION_STRING_QUOTES, "UNARY_EXPRESSION_STRING_QUOTES"), root_1);
1739
1740 adaptor.addChild(root_1, stream_STRING_LITERAL.nextNode());
1741
1742 adaptor.addChild(root_0, root_1);
1743 }
1744
1745 }
1746
1747 retval.tree = root_0;}
1748 }
1749 break;
1750 case 2 :
1751 // CTFParser.g:317:7: IDENTIFIER
1752 {
1753 IDENTIFIER25=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_enumConstant745); if (state.failed) {
1754 return retval;
1755 }
1756 if ( state.backtracking==0 ) {
1757 stream_IDENTIFIER.add(IDENTIFIER25);
1758 }
1759
1760
1761
1762 // AST REWRITE
1763 // elements: IDENTIFIER
1764 // token labels:
1765 // rule labels: retval
1766 // token list labels:
1767 // rule list labels:
1768 // wildcard labels:
1769 if ( state.backtracking==0 ) {
1770 retval.tree = root_0;
1771 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1772
1773 root_0 = (CommonTree)adaptor.nil();
1774 // 317:18: -> ^( UNARY_EXPRESSION_STRING IDENTIFIER )
1775 {
1776 // CTFParser.g:317:21: ^( UNARY_EXPRESSION_STRING IDENTIFIER )
1777 {
1778 CommonTree root_1 = (CommonTree)adaptor.nil();
1779 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(UNARY_EXPRESSION_STRING, "UNARY_EXPRESSION_STRING"), root_1);
1780
1781 adaptor.addChild(root_1, stream_IDENTIFIER.nextNode());
1782
1783 adaptor.addChild(root_0, root_1);
1784 }
1785
1786 }
1787
1788 retval.tree = root_0;}
1789 }
1790 break;
1791 case 3 :
1792 // CTFParser.g:318:7: ctfKeyword
1793 {
1794 pushFollow(FOLLOW_ctfKeyword_in_enumConstant761);
1795 ctfKeyword26=ctfKeyword();
1796
1797 state._fsp--;
1798 if (state.failed) {
1799 return retval;
1800 }
1801 if ( state.backtracking==0 ) {
1802 stream_ctfKeyword.add(ctfKeyword26.getTree());
1803 }
1804
1805
1806 // AST REWRITE
1807 // elements: ctfKeyword
1808 // token labels:
1809 // rule labels: retval
1810 // token list labels:
1811 // rule list labels:
1812 // wildcard labels:
1813 if ( state.backtracking==0 ) {
1814 retval.tree = root_0;
1815 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1816
1817 root_0 = (CommonTree)adaptor.nil();
1818 // 318:18: -> ^( UNARY_EXPRESSION_STRING ctfKeyword )
1819 {
1820 // CTFParser.g:318:21: ^( UNARY_EXPRESSION_STRING ctfKeyword )
1821 {
1822 CommonTree root_1 = (CommonTree)adaptor.nil();
1823 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(UNARY_EXPRESSION_STRING, "UNARY_EXPRESSION_STRING"), root_1);
1824
1825 adaptor.addChild(root_1, stream_ctfKeyword.nextTree());
1826
1827 adaptor.addChild(root_0, root_1);
1828 }
1829
1830 }
1831
1832 retval.tree = root_0;}
1833 }
1834 break;
1835
1836 }
1837 retval.stop = input.LT(-1);
1838
1839 if ( state.backtracking==0 ) {
1840
1841 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
1842 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
1843 }
1844 if ( state.backtracking==0 ) {
1845
1846 debug_print(input.toString(retval.start,input.LT(-1)));
1847 exit("enumConstant");
1848
1849 }
1850 }
1851
1852 catch (RecognitionException e)
1853 {
1854 throw e;
1855 }
1856 finally {
1857 }
1858 return retval;
1859 }
1860 // $ANTLR end "enumConstant"
1861
1862 public static class declaration_return extends ParserRuleReturnScope {
1863 CommonTree tree;
1864 public Object getTree() { return tree; }
1865 };
1866
1867 // $ANTLR start "declaration"
1868 // CTFParser.g:322:1: declaration : ( ( declarationSpecifiers ( declaratorList )? TERM ) -> {inTypedef()}? ^( DECLARATION ^( TYPEDEF declaratorList declarationSpecifiers ) ) -> ^( DECLARATION declarationSpecifiers ( declaratorList )? ) | ( ctfSpecifier TERM ) );
1869 public final CTFParser.declaration_return declaration() throws RecognitionException {
1870 CTFParser.declaration_return retval = new CTFParser.declaration_return();
1871 retval.start = input.LT(1);
1872
1873 CommonTree root_0 = null;
1874
1875 Token TERM29=null;
1876 Token TERM31=null;
1877 CTFParser.declarationSpecifiers_return declarationSpecifiers27 = null;
1878
1879 CTFParser.declaratorList_return declaratorList28 = null;
1880
1881 CTFParser.ctfSpecifier_return ctfSpecifier30 = null;
1882
1883
1884 CommonTree TERM29_tree=null;
1885 CommonTree TERM31_tree=null;
1886 RewriteRuleTokenStream stream_TERM=new RewriteRuleTokenStream(adaptor,"token TERM");
1887 RewriteRuleSubtreeStream stream_declaratorList=new RewriteRuleSubtreeStream(adaptor,"rule declaratorList");
1888 RewriteRuleSubtreeStream stream_declarationSpecifiers=new RewriteRuleSubtreeStream(adaptor,"rule declarationSpecifiers");
1889
1890 enter("declaration");
1891
1892 try {
1893 // CTFParser.g:331:1: ( ( declarationSpecifiers ( declaratorList )? TERM ) -> {inTypedef()}? ^( DECLARATION ^( TYPEDEF declaratorList declarationSpecifiers ) ) -> ^( DECLARATION declarationSpecifiers ( declaratorList )? ) | ( ctfSpecifier TERM ) )
1894 int alt13=2;
1895 int LA13_0 = input.LA(1);
1896
1897 if ( ((LA13_0>=CONSTTOK && LA13_0<=ENUMTOK)||(LA13_0>=FLOATINGPOINTTOK && LA13_0<=SIGNEDTOK)||(LA13_0>=STRINGTOK && LA13_0<=STRUCTTOK)||(LA13_0>=TYPEDEFTOK && LA13_0<=IMAGINARYTOK)) ) {
1898 alt13=1;
1899 }
1900 else if ( (LA13_0==IDENTIFIER) && ((inTypealiasAlias() || isTypeName(input.LT(1).getText())))) {
1901 alt13=1;
1902 }
1903 else if ( (LA13_0==EVENTTOK||LA13_0==STREAMTOK||(LA13_0>=TRACETOK && LA13_0<=TYPEALIASTOK)||(LA13_0>=ENVTOK && LA13_0<=CALLSITETOK)) ) {
1904 alt13=2;
1905 }
1906 else {
1907 if (state.backtracking>0) {state.failed=true; return retval;}
1908 NoViableAltException nvae =
1909 new NoViableAltException("", 13, 0, input);
1910
1911 throw nvae;
1912 }
1913 switch (alt13) {
1914 case 1 :
1915 // CTFParser.g:332:3: ( declarationSpecifiers ( declaratorList )? TERM )
1916 {
1917 // CTFParser.g:332:3: ( declarationSpecifiers ( declaratorList )? TERM )
1918 // CTFParser.g:332:4: declarationSpecifiers ( declaratorList )? TERM
1919 {
1920 pushFollow(FOLLOW_declarationSpecifiers_in_declaration794);
1921 declarationSpecifiers27=declarationSpecifiers();
1922
1923 state._fsp--;
1924 if (state.failed) {
1925 return retval;
1926 }
1927 if ( state.backtracking==0 ) {
1928 stream_declarationSpecifiers.add(declarationSpecifiers27.getTree());
1929 }
1930 // CTFParser.g:332:26: ( declaratorList )?
1931 int alt12=2;
1932 int LA12_0 = input.LA(1);
1933
1934 if ( (LA12_0==POINTER||LA12_0==IDENTIFIER) ) {
1935 alt12=1;
1936 }
1937 switch (alt12) {
1938 case 1 :
1939 // CTFParser.g:332:26: declaratorList
1940 {
1941 pushFollow(FOLLOW_declaratorList_in_declaration796);
1942 declaratorList28=declaratorList();
1943
1944 state._fsp--;
1945 if (state.failed) {
1946 return retval;
1947 }
1948 if ( state.backtracking==0 ) {
1949 stream_declaratorList.add(declaratorList28.getTree());
1950 }
1951
1952 }
1953 break;
1954
1955 }
1956
1957 TERM29=(Token)match(input,TERM,FOLLOW_TERM_in_declaration799); if (state.failed) {
1958 return retval;
1959 }
1960 if ( state.backtracking==0 ) {
1961 stream_TERM.add(TERM29);
1962 }
1963
1964
1965 }
1966
1967
1968
1969 // AST REWRITE
1970 // elements: declaratorList, declarationSpecifiers, declaratorList, declarationSpecifiers
1971 // token labels:
1972 // rule labels: retval
1973 // token list labels:
1974 // rule list labels:
1975 // wildcard labels:
1976 if ( state.backtracking==0 ) {
1977 retval.tree = root_0;
1978 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
1979
1980 root_0 = (CommonTree)adaptor.nil();
1981 // 335:3: -> {inTypedef()}? ^( DECLARATION ^( TYPEDEF declaratorList declarationSpecifiers ) )
1982 if (inTypedef()) {
1983 // CTFParser.g:335:21: ^( DECLARATION ^( TYPEDEF declaratorList declarationSpecifiers ) )
1984 {
1985 CommonTree root_1 = (CommonTree)adaptor.nil();
1986 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(DECLARATION, "DECLARATION"), root_1);
1987
1988 // CTFParser.g:335:35: ^( TYPEDEF declaratorList declarationSpecifiers )
1989 {
1990 CommonTree root_2 = (CommonTree)adaptor.nil();
1991 root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPEDEF, "TYPEDEF"), root_2);
1992
1993 adaptor.addChild(root_2, stream_declaratorList.nextTree());
1994 adaptor.addChild(root_2, stream_declarationSpecifiers.nextTree());
1995
1996 adaptor.addChild(root_1, root_2);
1997 }
1998
1999 adaptor.addChild(root_0, root_1);
2000 }
2001
2002 }
2003 else // 336:3: -> ^( DECLARATION declarationSpecifiers ( declaratorList )? )
2004 {
2005 // CTFParser.g:336:6: ^( DECLARATION declarationSpecifiers ( declaratorList )? )
2006 {
2007 CommonTree root_1 = (CommonTree)adaptor.nil();
2008 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(DECLARATION, "DECLARATION"), root_1);
2009
2010 adaptor.addChild(root_1, stream_declarationSpecifiers.nextTree());
2011 // CTFParser.g:336:42: ( declaratorList )?
2012 if ( stream_declaratorList.hasNext() ) {
2013 adaptor.addChild(root_1, stream_declaratorList.nextTree());
2014
2015 }
2016 stream_declaratorList.reset();
2017
2018 adaptor.addChild(root_0, root_1);
2019 }
2020
2021 }
2022
2023 retval.tree = root_0;}
2024 }
2025 break;
2026 case 2 :
2027 // CTFParser.g:338:5: ( ctfSpecifier TERM )
2028 {
2029 root_0 = (CommonTree)adaptor.nil();
2030
2031 // CTFParser.g:338:5: ( ctfSpecifier TERM )
2032 // CTFParser.g:338:6: ctfSpecifier TERM
2033 {
2034 pushFollow(FOLLOW_ctfSpecifier_in_declaration848);
2035 ctfSpecifier30=ctfSpecifier();
2036
2037 state._fsp--;
2038 if (state.failed) {
2039 return retval;
2040 }
2041 if ( state.backtracking==0 ) {
2042 adaptor.addChild(root_0, ctfSpecifier30.getTree());
2043 }
2044 TERM31=(Token)match(input,TERM,FOLLOW_TERM_in_declaration850); if (state.failed) {
2045 return retval;
2046 }
2047
2048 }
2049
2050
2051 }
2052 break;
2053
2054 }
2055 retval.stop = input.LT(-1);
2056
2057 if ( state.backtracking==0 ) {
2058
2059 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
2060 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
2061 }
2062 if ( state.backtracking==0 ) {
2063
2064 exit("declaration");
2065 if (inTypedef()) {
2066 typedefOff();
2067 }
2068
2069 }
2070 }
2071
2072 catch (RecognitionException e)
2073 {
2074 throw e;
2075 }
2076 finally {
2077 }
2078 return retval;
2079 }
2080 // $ANTLR end "declaration"
2081
2082 public static class declarationSpecifiers_return extends ParserRuleReturnScope {
2083 CommonTree tree;
2084 public Object getTree() { return tree; }
2085 };
2086
2087 // $ANTLR start "declarationSpecifiers"
2088 // CTFParser.g:341:1: declarationSpecifiers : ( storageClassSpecifier | typeQualifier | typeSpecifier )+ -> ^( TYPE_SPECIFIER_LIST ( typeQualifier )* ( typeSpecifier )* ) ;
2089 public final CTFParser.declarationSpecifiers_return declarationSpecifiers() throws RecognitionException {
2090 CTFParser.declarationSpecifiers_return retval = new CTFParser.declarationSpecifiers_return();
2091 retval.start = input.LT(1);
2092
2093 CommonTree root_0 = null;
2094
2095 CTFParser.storageClassSpecifier_return storageClassSpecifier32 = null;
2096
2097 CTFParser.typeQualifier_return typeQualifier33 = null;
2098
2099 CTFParser.typeSpecifier_return typeSpecifier34 = null;
2100
2101
2102 RewriteRuleSubtreeStream stream_typeSpecifier=new RewriteRuleSubtreeStream(adaptor,"rule typeSpecifier");
2103 RewriteRuleSubtreeStream stream_typeQualifier=new RewriteRuleSubtreeStream(adaptor,"rule typeQualifier");
2104 RewriteRuleSubtreeStream stream_storageClassSpecifier=new RewriteRuleSubtreeStream(adaptor,"rule storageClassSpecifier");
2105
2106 enter("declarationSpecifiers");
2107
2108 try {
2109 // CTFParser.g:349:1: ( ( storageClassSpecifier | typeQualifier | typeSpecifier )+ -> ^( TYPE_SPECIFIER_LIST ( typeQualifier )* ( typeSpecifier )* ) )
2110 // CTFParser.g:350:3: ( storageClassSpecifier | typeQualifier | typeSpecifier )+
2111 {
2112 // CTFParser.g:350:3: ( storageClassSpecifier | typeQualifier | typeSpecifier )+
2113 int cnt14=0;
2114 loop14:
2115 do {
2116 int alt14=4;
2117 switch ( input.LA(1) ) {
2118 case IDENTIFIER:
2119 {
2120 int LA14_2 = input.LA(2);
2121
2122 if ( ((inTypealiasAlias() || isTypeName(input.LT(1).getText()))) ) {
2123 alt14=3;
2124 }
2125
2126
2127 }
2128 break;
2129 case TYPEDEFTOK:
2130 {
2131 alt14=1;
2132 }
2133 break;
2134 case CONSTTOK:
2135 {
2136 alt14=2;
2137 }
2138 break;
2139 case CHARTOK:
2140 case DOUBLETOK:
2141 case ENUMTOK:
2142 case FLOATINGPOINTTOK:
2143 case FLOATTOK:
2144 case INTEGERTOK:
2145 case INTTOK:
2146 case LONGTOK:
2147 case SHORTTOK:
2148 case SIGNEDTOK:
2149 case STRINGTOK:
2150 case STRUCTTOK:
2151 case UNSIGNEDTOK:
2152 case VARIANTTOK:
2153 case VOIDTOK:
2154 case BOOLTOK:
2155 case COMPLEXTOK:
2156 case IMAGINARYTOK:
2157 {
2158 alt14=3;
2159 }
2160 break;
2161
2162 }
2163
2164 switch (alt14) {
2165 case 1 :
2166 // CTFParser.g:353:6: storageClassSpecifier
2167 {
2168 pushFollow(FOLLOW_storageClassSpecifier_in_declarationSpecifiers895);
2169 storageClassSpecifier32=storageClassSpecifier();
2170
2171 state._fsp--;
2172 if (state.failed) {
2173 return retval;
2174 }
2175 if ( state.backtracking==0 ) {
2176 stream_storageClassSpecifier.add(storageClassSpecifier32.getTree());
2177 }
2178
2179 }
2180 break;
2181 case 2 :
2182 // CTFParser.g:354:6: typeQualifier
2183 {
2184 pushFollow(FOLLOW_typeQualifier_in_declarationSpecifiers902);
2185 typeQualifier33=typeQualifier();
2186
2187 state._fsp--;
2188 if (state.failed) {
2189 return retval;
2190 }
2191 if ( state.backtracking==0 ) {
2192 stream_typeQualifier.add(typeQualifier33.getTree());
2193 }
2194
2195 }
2196 break;
2197 case 3 :
2198 // CTFParser.g:355:6: typeSpecifier
2199 {
2200 pushFollow(FOLLOW_typeSpecifier_in_declarationSpecifiers909);
2201 typeSpecifier34=typeSpecifier();
2202
2203 state._fsp--;
2204 if (state.failed) {
2205 return retval;
2206 }
2207 if ( state.backtracking==0 ) {
2208 stream_typeSpecifier.add(typeSpecifier34.getTree());
2209 }
2210
2211 }
2212 break;
2213
2214 default :
2215 if ( cnt14 >= 1 ) {
2216 break loop14;
2217 }
2218 if (state.backtracking>0) {state.failed=true; return retval;}
2219 EarlyExitException eee =
2220 new EarlyExitException(14, input);
2221 throw eee;
2222 }
2223 cnt14++;
2224 } while (true);
2225
2226
2227
2228 // AST REWRITE
2229 // elements: typeSpecifier, typeQualifier
2230 // token labels:
2231 // rule labels: retval
2232 // token list labels:
2233 // rule list labels:
2234 // wildcard labels:
2235 if ( state.backtracking==0 ) {
2236 retval.tree = root_0;
2237 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
2238
2239 root_0 = (CommonTree)adaptor.nil();
2240 // 356:6: -> ^( TYPE_SPECIFIER_LIST ( typeQualifier )* ( typeSpecifier )* )
2241 {
2242 // CTFParser.g:356:9: ^( TYPE_SPECIFIER_LIST ( typeQualifier )* ( typeSpecifier )* )
2243 {
2244 CommonTree root_1 = (CommonTree)adaptor.nil();
2245 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPE_SPECIFIER_LIST, "TYPE_SPECIFIER_LIST"), root_1);
2246
2247 // CTFParser.g:356:31: ( typeQualifier )*
2248 while ( stream_typeQualifier.hasNext() ) {
2249 adaptor.addChild(root_1, stream_typeQualifier.nextTree());
2250
2251 }
2252 stream_typeQualifier.reset();
2253 // CTFParser.g:356:46: ( typeSpecifier )*
2254 while ( stream_typeSpecifier.hasNext() ) {
2255 adaptor.addChild(root_1, stream_typeSpecifier.nextTree());
2256
2257 }
2258 stream_typeSpecifier.reset();
2259
2260 adaptor.addChild(root_0, root_1);
2261 }
2262
2263 }
2264
2265 retval.tree = root_0;}
2266 }
2267
2268 retval.stop = input.LT(-1);
2269
2270 if ( state.backtracking==0 ) {
2271
2272 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
2273 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
2274 }
2275 if ( state.backtracking==0 ) {
2276
2277 debug_print(input.toString(retval.start,input.LT(-1)));
2278 exit("declarationSpecifiers");
2279
2280 }
2281 }
2282
2283 catch (RecognitionException e)
2284 {
2285 throw e;
2286 }
2287 finally {
2288 }
2289 return retval;
2290 }
2291 // $ANTLR end "declarationSpecifiers"
2292
2293 public static class declaratorList_return extends ParserRuleReturnScope {
2294 CommonTree tree;
2295 public Object getTree() { return tree; }
2296 };
2297
2298 // $ANTLR start "declaratorList"
2299 // CTFParser.g:359:1: declaratorList : declarator ( SEPARATOR declarator )* -> ^( TYPE_DECLARATOR_LIST ( declarator )+ ) ;
2300 public final CTFParser.declaratorList_return declaratorList() throws RecognitionException {
2301 CTFParser.declaratorList_return retval = new CTFParser.declaratorList_return();
2302 retval.start = input.LT(1);
2303
2304 CommonTree root_0 = null;
2305
2306 Token SEPARATOR36=null;
2307 CTFParser.declarator_return declarator35 = null;
2308
2309 CTFParser.declarator_return declarator37 = null;
2310
2311
2312 CommonTree SEPARATOR36_tree=null;
2313 RewriteRuleTokenStream stream_SEPARATOR=new RewriteRuleTokenStream(adaptor,"token SEPARATOR");
2314 RewriteRuleSubtreeStream stream_declarator=new RewriteRuleSubtreeStream(adaptor,"rule declarator");
2315
2316 enter("declaratorList");
2317
2318 try {
2319 // CTFParser.g:366:1: ( declarator ( SEPARATOR declarator )* -> ^( TYPE_DECLARATOR_LIST ( declarator )+ ) )
2320 // CTFParser.g:367:3: declarator ( SEPARATOR declarator )*
2321 {
2322 pushFollow(FOLLOW_declarator_in_declaratorList950);
2323 declarator35=declarator();
2324
2325 state._fsp--;
2326 if (state.failed) {
2327 return retval;
2328 }
2329 if ( state.backtracking==0 ) {
2330 stream_declarator.add(declarator35.getTree());
2331 }
2332 // CTFParser.g:367:14: ( SEPARATOR declarator )*
2333 loop15:
2334 do {
2335 int alt15=2;
2336 int LA15_0 = input.LA(1);
2337
2338 if ( (LA15_0==SEPARATOR) ) {
2339 alt15=1;
2340 }
2341
2342
2343 switch (alt15) {
2344 case 1 :
2345 // CTFParser.g:367:15: SEPARATOR declarator
2346 {
2347 SEPARATOR36=(Token)match(input,SEPARATOR,FOLLOW_SEPARATOR_in_declaratorList953); if (state.failed) {
2348 return retval;
2349 }
2350 if ( state.backtracking==0 ) {
2351 stream_SEPARATOR.add(SEPARATOR36);
2352 }
2353
2354 pushFollow(FOLLOW_declarator_in_declaratorList955);
2355 declarator37=declarator();
2356
2357 state._fsp--;
2358 if (state.failed) {
2359 return retval;
2360 }
2361 if ( state.backtracking==0 ) {
2362 stream_declarator.add(declarator37.getTree());
2363 }
2364
2365 }
2366 break;
2367
2368 default :
2369 break loop15;
2370 }
2371 } while (true);
2372
2373
2374
2375 // AST REWRITE
2376 // elements: declarator
2377 // token labels:
2378 // rule labels: retval
2379 // token list labels:
2380 // rule list labels:
2381 // wildcard labels:
2382 if ( state.backtracking==0 ) {
2383 retval.tree = root_0;
2384 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
2385
2386 root_0 = (CommonTree)adaptor.nil();
2387 // 367:38: -> ^( TYPE_DECLARATOR_LIST ( declarator )+ )
2388 {
2389 // CTFParser.g:367:41: ^( TYPE_DECLARATOR_LIST ( declarator )+ )
2390 {
2391 CommonTree root_1 = (CommonTree)adaptor.nil();
2392 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPE_DECLARATOR_LIST, "TYPE_DECLARATOR_LIST"), root_1);
2393
2394 if ( !(stream_declarator.hasNext()) ) {
2395 throw new RewriteEarlyExitException();
2396 }
2397 while ( stream_declarator.hasNext() ) {
2398 adaptor.addChild(root_1, stream_declarator.nextTree());
2399
2400 }
2401 stream_declarator.reset();
2402
2403 adaptor.addChild(root_0, root_1);
2404 }
2405
2406 }
2407
2408 retval.tree = root_0;}
2409 }
2410
2411 retval.stop = input.LT(-1);
2412
2413 if ( state.backtracking==0 ) {
2414
2415 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
2416 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
2417 }
2418 if ( state.backtracking==0 ) {
2419
2420 exit("declaratorList");
2421
2422 }
2423 }
2424
2425 catch (RecognitionException e)
2426 {
2427 throw e;
2428 }
2429 finally {
2430 }
2431 return retval;
2432 }
2433 // $ANTLR end "declaratorList"
2434
2435 public static class abstractDeclaratorList_return extends ParserRuleReturnScope {
2436 CommonTree tree;
2437 public Object getTree() { return tree; }
2438 };
2439
2440 // $ANTLR start "abstractDeclaratorList"
2441 // CTFParser.g:370:1: abstractDeclaratorList : abstractDeclarator ( SEPARATOR abstractDeclarator )* -> ^( TYPE_DECLARATOR_LIST ( abstractDeclarator )+ ) ;
2442 public final CTFParser.abstractDeclaratorList_return abstractDeclaratorList() throws RecognitionException {
2443 CTFParser.abstractDeclaratorList_return retval = new CTFParser.abstractDeclaratorList_return();
2444 retval.start = input.LT(1);
2445
2446 CommonTree root_0 = null;
2447
2448 Token SEPARATOR39=null;
2449 CTFParser.abstractDeclarator_return abstractDeclarator38 = null;
2450
2451 CTFParser.abstractDeclarator_return abstractDeclarator40 = null;
2452
2453
2454 CommonTree SEPARATOR39_tree=null;
2455 RewriteRuleTokenStream stream_SEPARATOR=new RewriteRuleTokenStream(adaptor,"token SEPARATOR");
2456 RewriteRuleSubtreeStream stream_abstractDeclarator=new RewriteRuleSubtreeStream(adaptor,"rule abstractDeclarator");
2457
2458 enter("abstractDeclaratorList");
2459
2460 try {
2461 // CTFParser.g:377:1: ( abstractDeclarator ( SEPARATOR abstractDeclarator )* -> ^( TYPE_DECLARATOR_LIST ( abstractDeclarator )+ ) )
2462 // CTFParser.g:378:3: abstractDeclarator ( SEPARATOR abstractDeclarator )*
2463 {
2464 pushFollow(FOLLOW_abstractDeclarator_in_abstractDeclaratorList989);
2465 abstractDeclarator38=abstractDeclarator();
2466
2467 state._fsp--;
2468 if (state.failed) {
2469 return retval;
2470 }
2471 if ( state.backtracking==0 ) {
2472 stream_abstractDeclarator.add(abstractDeclarator38.getTree());
2473 }
2474 // CTFParser.g:378:22: ( SEPARATOR abstractDeclarator )*
2475 loop16:
2476 do {
2477 int alt16=2;
2478 int LA16_0 = input.LA(1);
2479
2480 if ( (LA16_0==SEPARATOR) ) {
2481 alt16=1;
2482 }
2483
2484
2485 switch (alt16) {
2486 case 1 :
2487 // CTFParser.g:378:23: SEPARATOR abstractDeclarator
2488 {
2489 SEPARATOR39=(Token)match(input,SEPARATOR,FOLLOW_SEPARATOR_in_abstractDeclaratorList992); if (state.failed) {
2490 return retval;
2491 }
2492 if ( state.backtracking==0 ) {
2493 stream_SEPARATOR.add(SEPARATOR39);
2494 }
2495
2496 pushFollow(FOLLOW_abstractDeclarator_in_abstractDeclaratorList994);
2497 abstractDeclarator40=abstractDeclarator();
2498
2499 state._fsp--;
2500 if (state.failed) {
2501 return retval;
2502 }
2503 if ( state.backtracking==0 ) {
2504 stream_abstractDeclarator.add(abstractDeclarator40.getTree());
2505 }
2506
2507 }
2508 break;
2509
2510 default :
2511 break loop16;
2512 }
2513 } while (true);
2514
2515
2516
2517 // AST REWRITE
2518 // elements: abstractDeclarator
2519 // token labels:
2520 // rule labels: retval
2521 // token list labels:
2522 // rule list labels:
2523 // wildcard labels:
2524 if ( state.backtracking==0 ) {
2525 retval.tree = root_0;
2526 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
2527
2528 root_0 = (CommonTree)adaptor.nil();
2529 // 378:54: -> ^( TYPE_DECLARATOR_LIST ( abstractDeclarator )+ )
2530 {
2531 // CTFParser.g:378:57: ^( TYPE_DECLARATOR_LIST ( abstractDeclarator )+ )
2532 {
2533 CommonTree root_1 = (CommonTree)adaptor.nil();
2534 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPE_DECLARATOR_LIST, "TYPE_DECLARATOR_LIST"), root_1);
2535
2536 if ( !(stream_abstractDeclarator.hasNext()) ) {
2537 throw new RewriteEarlyExitException();
2538 }
2539 while ( stream_abstractDeclarator.hasNext() ) {
2540 adaptor.addChild(root_1, stream_abstractDeclarator.nextTree());
2541
2542 }
2543 stream_abstractDeclarator.reset();
2544
2545 adaptor.addChild(root_0, root_1);
2546 }
2547
2548 }
2549
2550 retval.tree = root_0;}
2551 }
2552
2553 retval.stop = input.LT(-1);
2554
2555 if ( state.backtracking==0 ) {
2556
2557 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
2558 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
2559 }
2560 if ( state.backtracking==0 ) {
2561
2562 exit("abstractDeclaratorList");
2563
2564 }
2565 }
2566
2567 catch (RecognitionException e)
2568 {
2569 throw e;
2570 }
2571 finally {
2572 }
2573 return retval;
2574 }
2575 // $ANTLR end "abstractDeclaratorList"
2576
2577 public static class storageClassSpecifier_return extends ParserRuleReturnScope {
2578 CommonTree tree;
2579 public Object getTree() { return tree; }
2580 };
2581
2582 // $ANTLR start "storageClassSpecifier"
2583 // CTFParser.g:381:1: storageClassSpecifier : TYPEDEFTOK ;
2584 public final CTFParser.storageClassSpecifier_return storageClassSpecifier() throws RecognitionException {
2585 CTFParser.storageClassSpecifier_return retval = new CTFParser.storageClassSpecifier_return();
2586 retval.start = input.LT(1);
2587
2588 CommonTree root_0 = null;
2589
2590 Token TYPEDEFTOK41=null;
2591
2592 CommonTree TYPEDEFTOK41_tree=null;
2593
2594 try {
2595 // CTFParser.g:381:23: ( TYPEDEFTOK )
2596 // CTFParser.g:382:3: TYPEDEFTOK
2597 {
2598 root_0 = (CommonTree)adaptor.nil();
2599
2600 TYPEDEFTOK41=(Token)match(input,TYPEDEFTOK,FOLLOW_TYPEDEFTOK_in_storageClassSpecifier1018); if (state.failed) {
2601 return retval;
2602 }
2603 if ( state.backtracking==0 ) {
2604 TYPEDEFTOK41_tree = (CommonTree)adaptor.create(TYPEDEFTOK41);
2605 adaptor.addChild(root_0, TYPEDEFTOK41_tree);
2606 }
2607 if ( state.backtracking==0 ) {
2608 typedefOn();
2609 }
2610
2611 }
2612
2613 retval.stop = input.LT(-1);
2614
2615 if ( state.backtracking==0 ) {
2616
2617 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
2618 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
2619 }
2620 }
2621
2622 catch (RecognitionException e)
2623 {
2624 throw e;
2625 }
2626 finally {
2627 }
2628 return retval;
2629 }
2630 // $ANTLR end "storageClassSpecifier"
2631
2632 public static class typeSpecifier_return extends ParserRuleReturnScope {
2633 CommonTree tree;
2634 public Object getTree() { return tree; }
2635 };
2636
2637 // $ANTLR start "typeSpecifier"
2638 // CTFParser.g:385:1: typeSpecifier : ( FLOATTOK | INTTOK | LONGTOK | SHORTTOK | SIGNEDTOK | UNSIGNEDTOK | CHARTOK | DOUBLETOK | VOIDTOK | BOOLTOK | COMPLEXTOK | IMAGINARYTOK | structSpecifier | variantSpecifier | enumSpecifier | ctfTypeSpecifier | {...}? => typedefName );
2639 public final CTFParser.typeSpecifier_return typeSpecifier() throws RecognitionException {
2640 CTFParser.typeSpecifier_return retval = new CTFParser.typeSpecifier_return();
2641 retval.start = input.LT(1);
2642
2643 CommonTree root_0 = null;
2644
2645 Token FLOATTOK42=null;
2646 Token INTTOK43=null;
2647 Token LONGTOK44=null;
2648 Token SHORTTOK45=null;
2649 Token SIGNEDTOK46=null;
2650 Token UNSIGNEDTOK47=null;
2651 Token CHARTOK48=null;
2652 Token DOUBLETOK49=null;
2653 Token VOIDTOK50=null;
2654 Token BOOLTOK51=null;
2655 Token COMPLEXTOK52=null;
2656 Token IMAGINARYTOK53=null;
2657 CTFParser.structSpecifier_return structSpecifier54 = null;
2658
2659 CTFParser.variantSpecifier_return variantSpecifier55 = null;
2660
2661 CTFParser.enumSpecifier_return enumSpecifier56 = null;
2662
2663 CTFParser.ctfTypeSpecifier_return ctfTypeSpecifier57 = null;
2664
2665 CTFParser.typedefName_return typedefName58 = null;
2666
2667
2668 CommonTree FLOATTOK42_tree=null;
2669 CommonTree INTTOK43_tree=null;
2670 CommonTree LONGTOK44_tree=null;
2671 CommonTree SHORTTOK45_tree=null;
2672 CommonTree SIGNEDTOK46_tree=null;
2673 CommonTree UNSIGNEDTOK47_tree=null;
2674 CommonTree CHARTOK48_tree=null;
2675 CommonTree DOUBLETOK49_tree=null;
2676 CommonTree VOIDTOK50_tree=null;
2677 CommonTree BOOLTOK51_tree=null;
2678 CommonTree COMPLEXTOK52_tree=null;
2679 CommonTree IMAGINARYTOK53_tree=null;
2680
2681
2682 enter("typeSpecifier");
2683
2684 try {
2685 // CTFParser.g:393:1: ( FLOATTOK | INTTOK | LONGTOK | SHORTTOK | SIGNEDTOK | UNSIGNEDTOK | CHARTOK | DOUBLETOK | VOIDTOK | BOOLTOK | COMPLEXTOK | IMAGINARYTOK | structSpecifier | variantSpecifier | enumSpecifier | ctfTypeSpecifier | {...}? => typedefName )
2686 int alt17=17;
2687 alt17 = dfa17.predict(input);
2688 switch (alt17) {
2689 case 1 :
2690 // CTFParser.g:394:3: FLOATTOK
2691 {
2692 root_0 = (CommonTree)adaptor.nil();
2693
2694 FLOATTOK42=(Token)match(input,FLOATTOK,FOLLOW_FLOATTOK_in_typeSpecifier1044); if (state.failed) {
2695 return retval;
2696 }
2697 if ( state.backtracking==0 ) {
2698 FLOATTOK42_tree = (CommonTree)adaptor.create(FLOATTOK42);
2699 adaptor.addChild(root_0, FLOATTOK42_tree);
2700 }
2701
2702 }
2703 break;
2704 case 2 :
2705 // CTFParser.g:395:5: INTTOK
2706 {
2707 root_0 = (CommonTree)adaptor.nil();
2708
2709 INTTOK43=(Token)match(input,INTTOK,FOLLOW_INTTOK_in_typeSpecifier1050); if (state.failed) {
2710 return retval;
2711 }
2712 if ( state.backtracking==0 ) {
2713 INTTOK43_tree = (CommonTree)adaptor.create(INTTOK43);
2714 adaptor.addChild(root_0, INTTOK43_tree);
2715 }
2716
2717 }
2718 break;
2719 case 3 :
2720 // CTFParser.g:396:5: LONGTOK
2721 {
2722 root_0 = (CommonTree)adaptor.nil();
2723
2724 LONGTOK44=(Token)match(input,LONGTOK,FOLLOW_LONGTOK_in_typeSpecifier1056); if (state.failed) {
2725 return retval;
2726 }
2727 if ( state.backtracking==0 ) {
2728 LONGTOK44_tree = (CommonTree)adaptor.create(LONGTOK44);
2729 adaptor.addChild(root_0, LONGTOK44_tree);
2730 }
2731
2732 }
2733 break;
2734 case 4 :
2735 // CTFParser.g:397:5: SHORTTOK
2736 {
2737 root_0 = (CommonTree)adaptor.nil();
2738
2739 SHORTTOK45=(Token)match(input,SHORTTOK,FOLLOW_SHORTTOK_in_typeSpecifier1062); if (state.failed) {
2740 return retval;
2741 }
2742 if ( state.backtracking==0 ) {
2743 SHORTTOK45_tree = (CommonTree)adaptor.create(SHORTTOK45);
2744 adaptor.addChild(root_0, SHORTTOK45_tree);
2745 }
2746
2747 }
2748 break;
2749 case 5 :
2750 // CTFParser.g:398:5: SIGNEDTOK
2751 {
2752 root_0 = (CommonTree)adaptor.nil();
2753
2754 SIGNEDTOK46=(Token)match(input,SIGNEDTOK,FOLLOW_SIGNEDTOK_in_typeSpecifier1068); if (state.failed) {
2755 return retval;
2756 }
2757 if ( state.backtracking==0 ) {
2758 SIGNEDTOK46_tree = (CommonTree)adaptor.create(SIGNEDTOK46);
2759 adaptor.addChild(root_0, SIGNEDTOK46_tree);
2760 }
2761
2762 }
2763 break;
2764 case 6 :
2765 // CTFParser.g:399:5: UNSIGNEDTOK
2766 {
2767 root_0 = (CommonTree)adaptor.nil();
2768
2769 UNSIGNEDTOK47=(Token)match(input,UNSIGNEDTOK,FOLLOW_UNSIGNEDTOK_in_typeSpecifier1074); if (state.failed) {
2770 return retval;
2771 }
2772 if ( state.backtracking==0 ) {
2773 UNSIGNEDTOK47_tree = (CommonTree)adaptor.create(UNSIGNEDTOK47);
2774 adaptor.addChild(root_0, UNSIGNEDTOK47_tree);
2775 }
2776
2777 }
2778 break;
2779 case 7 :
2780 // CTFParser.g:400:5: CHARTOK
2781 {
2782 root_0 = (CommonTree)adaptor.nil();
2783
2784 CHARTOK48=(Token)match(input,CHARTOK,FOLLOW_CHARTOK_in_typeSpecifier1080); if (state.failed) {
2785 return retval;
2786 }
2787 if ( state.backtracking==0 ) {
2788 CHARTOK48_tree = (CommonTree)adaptor.create(CHARTOK48);
2789 adaptor.addChild(root_0, CHARTOK48_tree);
2790 }
2791
2792 }
2793 break;
2794 case 8 :
2795 // CTFParser.g:401:5: DOUBLETOK
2796 {
2797 root_0 = (CommonTree)adaptor.nil();
2798
2799 DOUBLETOK49=(Token)match(input,DOUBLETOK,FOLLOW_DOUBLETOK_in_typeSpecifier1086); if (state.failed) {
2800 return retval;
2801 }
2802 if ( state.backtracking==0 ) {
2803 DOUBLETOK49_tree = (CommonTree)adaptor.create(DOUBLETOK49);
2804 adaptor.addChild(root_0, DOUBLETOK49_tree);
2805 }
2806
2807 }
2808 break;
2809 case 9 :
2810 // CTFParser.g:402:5: VOIDTOK
2811 {
2812 root_0 = (CommonTree)adaptor.nil();
2813
2814 VOIDTOK50=(Token)match(input,VOIDTOK,FOLLOW_VOIDTOK_in_typeSpecifier1092); if (state.failed) {
2815 return retval;
2816 }
2817 if ( state.backtracking==0 ) {
2818 VOIDTOK50_tree = (CommonTree)adaptor.create(VOIDTOK50);
2819 adaptor.addChild(root_0, VOIDTOK50_tree);
2820 }
2821
2822 }
2823 break;
2824 case 10 :
2825 // CTFParser.g:403:5: BOOLTOK
2826 {
2827 root_0 = (CommonTree)adaptor.nil();
2828
2829 BOOLTOK51=(Token)match(input,BOOLTOK,FOLLOW_BOOLTOK_in_typeSpecifier1098); if (state.failed) {
2830 return retval;
2831 }
2832 if ( state.backtracking==0 ) {
2833 BOOLTOK51_tree = (CommonTree)adaptor.create(BOOLTOK51);
2834 adaptor.addChild(root_0, BOOLTOK51_tree);
2835 }
2836
2837 }
2838 break;
2839 case 11 :
2840 // CTFParser.g:404:5: COMPLEXTOK
2841 {
2842 root_0 = (CommonTree)adaptor.nil();
2843
2844 COMPLEXTOK52=(Token)match(input,COMPLEXTOK,FOLLOW_COMPLEXTOK_in_typeSpecifier1104); if (state.failed) {
2845 return retval;
2846 }
2847 if ( state.backtracking==0 ) {
2848 COMPLEXTOK52_tree = (CommonTree)adaptor.create(COMPLEXTOK52);
2849 adaptor.addChild(root_0, COMPLEXTOK52_tree);
2850 }
2851
2852 }
2853 break;
2854 case 12 :
2855 // CTFParser.g:405:5: IMAGINARYTOK
2856 {
2857 root_0 = (CommonTree)adaptor.nil();
2858
2859 IMAGINARYTOK53=(Token)match(input,IMAGINARYTOK,FOLLOW_IMAGINARYTOK_in_typeSpecifier1110); if (state.failed) {
2860 return retval;
2861 }
2862 if ( state.backtracking==0 ) {
2863 IMAGINARYTOK53_tree = (CommonTree)adaptor.create(IMAGINARYTOK53);
2864 adaptor.addChild(root_0, IMAGINARYTOK53_tree);
2865 }
2866
2867 }
2868 break;
2869 case 13 :
2870 // CTFParser.g:406:5: structSpecifier
2871 {
2872 root_0 = (CommonTree)adaptor.nil();
2873
2874 pushFollow(FOLLOW_structSpecifier_in_typeSpecifier1116);
2875 structSpecifier54=structSpecifier();
2876
2877 state._fsp--;
2878 if (state.failed) {
2879 return retval;
2880 }
2881 if ( state.backtracking==0 ) {
2882 adaptor.addChild(root_0, structSpecifier54.getTree());
2883 }
2884
2885 }
2886 break;
2887 case 14 :
2888 // CTFParser.g:407:5: variantSpecifier
2889 {
2890 root_0 = (CommonTree)adaptor.nil();
2891
2892 pushFollow(FOLLOW_variantSpecifier_in_typeSpecifier1122);
2893 variantSpecifier55=variantSpecifier();
2894
2895 state._fsp--;
2896 if (state.failed) {
2897 return retval;
2898 }
2899 if ( state.backtracking==0 ) {
2900 adaptor.addChild(root_0, variantSpecifier55.getTree());
2901 }
2902
2903 }
2904 break;
2905 case 15 :
2906 // CTFParser.g:408:5: enumSpecifier
2907 {
2908 root_0 = (CommonTree)adaptor.nil();
2909
2910 pushFollow(FOLLOW_enumSpecifier_in_typeSpecifier1128);
2911 enumSpecifier56=enumSpecifier();
2912
2913 state._fsp--;
2914 if (state.failed) {
2915 return retval;
2916 }
2917 if ( state.backtracking==0 ) {
2918 adaptor.addChild(root_0, enumSpecifier56.getTree());
2919 }
2920
2921 }
2922 break;
2923 case 16 :
2924 // CTFParser.g:409:5: ctfTypeSpecifier
2925 {
2926 root_0 = (CommonTree)adaptor.nil();
2927
2928 pushFollow(FOLLOW_ctfTypeSpecifier_in_typeSpecifier1134);
2929 ctfTypeSpecifier57=ctfTypeSpecifier();
2930
2931 state._fsp--;
2932 if (state.failed) {
2933 return retval;
2934 }
2935 if ( state.backtracking==0 ) {
2936 adaptor.addChild(root_0, ctfTypeSpecifier57.getTree());
2937 }
2938
2939 }
2940 break;
2941 case 17 :
2942 // CTFParser.g:410:5: {...}? => typedefName
2943 {
2944 root_0 = (CommonTree)adaptor.nil();
2945
2946 if ( !((inTypealiasAlias() || isTypeName(input.LT(1).getText()))) ) {
2947 if (state.backtracking>0) {state.failed=true; return retval;}
2948 throw new FailedPredicateException(input, "typeSpecifier", "inTypealiasAlias() || isTypeName(input.LT(1).getText())");
2949 }
2950 pushFollow(FOLLOW_typedefName_in_typeSpecifier1144);
2951 typedefName58=typedefName();
2952
2953 state._fsp--;
2954 if (state.failed) {
2955 return retval;
2956 }
2957 if ( state.backtracking==0 ) {
2958 adaptor.addChild(root_0, typedefName58.getTree());
2959 }
2960
2961 }
2962 break;
2963
2964 }
2965 retval.stop = input.LT(-1);
2966
2967 if ( state.backtracking==0 ) {
2968
2969 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
2970 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
2971 }
2972 if ( state.backtracking==0 ) {
2973
2974 debug_print(input.toString(retval.start,input.LT(-1)));
2975 exit("typeSpecifier");
2976
2977 }
2978 }
2979
2980 catch (RecognitionException e)
2981 {
2982 throw e;
2983 }
2984 finally {
2985 }
2986 return retval;
2987 }
2988 // $ANTLR end "typeSpecifier"
2989
2990 public static class typeQualifier_return extends ParserRuleReturnScope {
2991 CommonTree tree;
2992 public Object getTree() { return tree; }
2993 };
2994
2995 // $ANTLR start "typeQualifier"
2996 // CTFParser.g:413:1: typeQualifier : CONSTTOK ;
2997 public final CTFParser.typeQualifier_return typeQualifier() throws RecognitionException {
2998 CTFParser.typeQualifier_return retval = new CTFParser.typeQualifier_return();
2999 retval.start = input.LT(1);
3000
3001 CommonTree root_0 = null;
3002
3003 Token CONSTTOK59=null;
3004
3005 CommonTree CONSTTOK59_tree=null;
3006
3007
3008 enter("typeQualifier");
3009
3010 try {
3011 // CTFParser.g:421:1: ( CONSTTOK )
3012 // CTFParser.g:422:3: CONSTTOK
3013 {
3014 root_0 = (CommonTree)adaptor.nil();
3015
3016 CONSTTOK59=(Token)match(input,CONSTTOK,FOLLOW_CONSTTOK_in_typeQualifier1167); if (state.failed) {
3017 return retval;
3018 }
3019 if ( state.backtracking==0 ) {
3020 CONSTTOK59_tree = (CommonTree)adaptor.create(CONSTTOK59);
3021 adaptor.addChild(root_0, CONSTTOK59_tree);
3022 }
3023
3024 }
3025
3026 retval.stop = input.LT(-1);
3027
3028 if ( state.backtracking==0 ) {
3029
3030 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
3031 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
3032 }
3033 if ( state.backtracking==0 ) {
3034
3035 debug_print(input.toString(retval.start,input.LT(-1)));
3036 exit("typeQualifier");
3037
3038 }
3039 }
3040
3041 catch (RecognitionException e)
3042 {
3043 throw e;
3044 }
3045 finally {
3046 }
3047 return retval;
3048 }
3049 // $ANTLR end "typeQualifier"
3050
3051 public static class alignAttribute_return extends ParserRuleReturnScope {
3052 CommonTree tree;
3053 public Object getTree() { return tree; }
3054 };
3055
3056 // $ANTLR start "alignAttribute"
3057 // CTFParser.g:425:1: alignAttribute : ALIGNTOK LPAREN unaryExpression RPAREN -> ^( ALIGN unaryExpression ) ;
3058 public final CTFParser.alignAttribute_return alignAttribute() throws RecognitionException {
3059 CTFParser.alignAttribute_return retval = new CTFParser.alignAttribute_return();
3060 retval.start = input.LT(1);
3061
3062 CommonTree root_0 = null;
3063
3064 Token ALIGNTOK60=null;
3065 Token LPAREN61=null;
3066 Token RPAREN63=null;
3067 CTFParser.unaryExpression_return unaryExpression62 = null;
3068
3069
3070 CommonTree ALIGNTOK60_tree=null;
3071 CommonTree LPAREN61_tree=null;
3072 CommonTree RPAREN63_tree=null;
3073 RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
3074 RewriteRuleTokenStream stream_ALIGNTOK=new RewriteRuleTokenStream(adaptor,"token ALIGNTOK");
3075 RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
3076 RewriteRuleSubtreeStream stream_unaryExpression=new RewriteRuleSubtreeStream(adaptor,"rule unaryExpression");
3077 try {
3078 // CTFParser.g:425:16: ( ALIGNTOK LPAREN unaryExpression RPAREN -> ^( ALIGN unaryExpression ) )
3079 // CTFParser.g:426:3: ALIGNTOK LPAREN unaryExpression RPAREN
3080 {
3081 ALIGNTOK60=(Token)match(input,ALIGNTOK,FOLLOW_ALIGNTOK_in_alignAttribute1180); if (state.failed) {
3082 return retval;
3083 }
3084 if ( state.backtracking==0 ) {
3085 stream_ALIGNTOK.add(ALIGNTOK60);
3086 }
3087
3088 LPAREN61=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_alignAttribute1182); if (state.failed) {
3089 return retval;
3090 }
3091 if ( state.backtracking==0 ) {
3092 stream_LPAREN.add(LPAREN61);
3093 }
3094
3095 pushFollow(FOLLOW_unaryExpression_in_alignAttribute1184);
3096 unaryExpression62=unaryExpression();
3097
3098 state._fsp--;
3099 if (state.failed) {
3100 return retval;
3101 }
3102 if ( state.backtracking==0 ) {
3103 stream_unaryExpression.add(unaryExpression62.getTree());
3104 }
3105 RPAREN63=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_alignAttribute1186); if (state.failed) {
3106 return retval;
3107 }
3108 if ( state.backtracking==0 ) {
3109 stream_RPAREN.add(RPAREN63);
3110 }
3111
3112
3113
3114 // AST REWRITE
3115 // elements: unaryExpression
3116 // token labels:
3117 // rule labels: retval
3118 // token list labels:
3119 // rule list labels:
3120 // wildcard labels:
3121 if ( state.backtracking==0 ) {
3122 retval.tree = root_0;
3123 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
3124
3125 root_0 = (CommonTree)adaptor.nil();
3126 // 426:42: -> ^( ALIGN unaryExpression )
3127 {
3128 // CTFParser.g:426:45: ^( ALIGN unaryExpression )
3129 {
3130 CommonTree root_1 = (CommonTree)adaptor.nil();
3131 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ALIGN, "ALIGN"), root_1);
3132
3133 adaptor.addChild(root_1, stream_unaryExpression.nextTree());
3134
3135 adaptor.addChild(root_0, root_1);
3136 }
3137
3138 }
3139
3140 retval.tree = root_0;}
3141 }
3142
3143 retval.stop = input.LT(-1);
3144
3145 if ( state.backtracking==0 ) {
3146
3147 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
3148 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
3149 }
3150 }
3151
3152 catch (RecognitionException e)
3153 {
3154 throw e;
3155 }
3156 finally {
3157 }
3158 return retval;
3159 }
3160 // $ANTLR end "alignAttribute"
3161
3162 public static class structBody_return extends ParserRuleReturnScope {
3163 CommonTree tree;
3164 public Object getTree() { return tree; }
3165 };
3166
3167 // $ANTLR start "structBody"
3168 // CTFParser.g:430:1: structBody : LCURL ( structOrVariantDeclarationList )? RCURL -> ^( STRUCT_BODY ( structOrVariantDeclarationList )? ) ;
3169 public final CTFParser.structBody_return structBody() throws RecognitionException {
3170 Symbols_stack.push(new Symbols_scope());
3171
3172 CTFParser.structBody_return retval = new CTFParser.structBody_return();
3173 retval.start = input.LT(1);
3174
3175 CommonTree root_0 = null;
3176
3177 Token LCURL64=null;
3178 Token RCURL66=null;
3179 CTFParser.structOrVariantDeclarationList_return structOrVariantDeclarationList65 = null;
3180
3181
3182 CommonTree LCURL64_tree=null;
3183 CommonTree RCURL66_tree=null;
3184 RewriteRuleTokenStream stream_LCURL=new RewriteRuleTokenStream(adaptor,"token LCURL");
3185 RewriteRuleTokenStream stream_RCURL=new RewriteRuleTokenStream(adaptor,"token RCURL");
3186 RewriteRuleSubtreeStream stream_structOrVariantDeclarationList=new RewriteRuleSubtreeStream(adaptor,"rule structOrVariantDeclarationList");
3187
3188 enter("structBody");
3189 debug_print("Scope push " + Symbols_stack.size());
3190 ((Symbols_scope)Symbols_stack.peek()).types = new HashSet<String>();
3191
3192 try {
3193 // CTFParser.g:441:1: ( LCURL ( structOrVariantDeclarationList )? RCURL -> ^( STRUCT_BODY ( structOrVariantDeclarationList )? ) )
3194 // CTFParser.g:442:3: LCURL ( structOrVariantDeclarationList )? RCURL
3195 {
3196 LCURL64=(Token)match(input,LCURL,FOLLOW_LCURL_in_structBody1227); if (state.failed) {
3197 return retval;
3198 }
3199 if ( state.backtracking==0 ) {
3200 stream_LCURL.add(LCURL64);
3201 }
3202
3203 // CTFParser.g:442:9: ( structOrVariantDeclarationList )?
3204 int alt18=2;
3205 int LA18_0 = input.LA(1);
3206
3207 if ( ((LA18_0>=CONSTTOK && LA18_0<=ENUMTOK)||(LA18_0>=FLOATINGPOINTTOK && LA18_0<=SIGNEDTOK)||(LA18_0>=STRINGTOK && LA18_0<=STRUCTTOK)||(LA18_0>=TYPEDEFTOK && LA18_0<=IMAGINARYTOK)) ) {
3208 alt18=1;
3209 }
3210 else if ( (LA18_0==IDENTIFIER) && ((inTypealiasAlias() || isTypeName(input.LT(1).getText())))) {
3211 alt18=1;
3212 }
3213 else if ( (LA18_0==TYPEALIASTOK) ) {
3214 alt18=1;
3215 }
3216 switch (alt18) {
3217 case 1 :
3218 // CTFParser.g:442:9: structOrVariantDeclarationList
3219 {
3220 pushFollow(FOLLOW_structOrVariantDeclarationList_in_structBody1229);
3221 structOrVariantDeclarationList65=structOrVariantDeclarationList();
3222
3223 state._fsp--;
3224 if (state.failed) {
3225 return retval;
3226 }
3227 if ( state.backtracking==0 ) {
3228 stream_structOrVariantDeclarationList.add(structOrVariantDeclarationList65.getTree());
3229 }
3230
3231 }
3232 break;
3233
3234 }
3235
3236 RCURL66=(Token)match(input,RCURL,FOLLOW_RCURL_in_structBody1232); if (state.failed) {
3237 return retval;
3238 }
3239 if ( state.backtracking==0 ) {
3240 stream_RCURL.add(RCURL66);
3241 }
3242
3243
3244
3245 // AST REWRITE
3246 // elements: structOrVariantDeclarationList
3247 // token labels:
3248 // rule labels: retval
3249 // token list labels:
3250 // rule list labels:
3251 // wildcard labels:
3252 if ( state.backtracking==0 ) {
3253 retval.tree = root_0;
3254 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
3255
3256 root_0 = (CommonTree)adaptor.nil();
3257 // 442:47: -> ^( STRUCT_BODY ( structOrVariantDeclarationList )? )
3258 {
3259 // CTFParser.g:442:50: ^( STRUCT_BODY ( structOrVariantDeclarationList )? )
3260 {
3261 CommonTree root_1 = (CommonTree)adaptor.nil();
3262 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(STRUCT_BODY, "STRUCT_BODY"), root_1);
3263
3264 // CTFParser.g:442:64: ( structOrVariantDeclarationList )?
3265 if ( stream_structOrVariantDeclarationList.hasNext() ) {
3266 adaptor.addChild(root_1, stream_structOrVariantDeclarationList.nextTree());
3267
3268 }
3269 stream_structOrVariantDeclarationList.reset();
3270
3271 adaptor.addChild(root_0, root_1);
3272 }
3273
3274 }
3275
3276 retval.tree = root_0;}
3277 }
3278
3279 retval.stop = input.LT(-1);
3280
3281 if ( state.backtracking==0 ) {
3282
3283 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
3284 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
3285 }
3286 if ( state.backtracking==0 ) {
3287
3288 debug_print("Scope pop " + Symbols_stack.size());
3289 exit("structBody");
3290
3291 }
3292 }
3293
3294 catch (RecognitionException e)
3295 {
3296 throw e;
3297 }
3298 finally {
3299 Symbols_stack.pop();
3300
3301 }
3302 return retval;
3303 }
3304 // $ANTLR end "structBody"
3305
3306 public static class structSpecifier_return extends ParserRuleReturnScope {
3307 CommonTree tree;
3308 public Object getTree() { return tree; }
3309 };
3310
3311 // $ANTLR start "structSpecifier"
3312 // CTFParser.g:447:1: structSpecifier : STRUCTTOK ( ( structName ( alignAttribute | ( structBody ( alignAttribute | ) ) | ) ) | ( structBody ( alignAttribute | ) ) ) -> ^( STRUCT ( structName )? ( structBody )? ( alignAttribute )? ) ;
3313 public final CTFParser.structSpecifier_return structSpecifier() throws RecognitionException {
3314 CTFParser.structSpecifier_return retval = new CTFParser.structSpecifier_return();
3315 retval.start = input.LT(1);
3316
3317 CommonTree root_0 = null;
3318
3319 Token STRUCTTOK67=null;
3320 CTFParser.structName_return structName68 = null;
3321
3322 CTFParser.alignAttribute_return alignAttribute69 = null;
3323
3324 CTFParser.structBody_return structBody70 = null;
3325
3326 CTFParser.alignAttribute_return alignAttribute71 = null;
3327
3328 CTFParser.structBody_return structBody72 = null;
3329
3330 CTFParser.alignAttribute_return alignAttribute73 = null;
3331
3332
3333 CommonTree STRUCTTOK67_tree=null;
3334 RewriteRuleTokenStream stream_STRUCTTOK=new RewriteRuleTokenStream(adaptor,"token STRUCTTOK");
3335 RewriteRuleSubtreeStream stream_structName=new RewriteRuleSubtreeStream(adaptor,"rule structName");
3336 RewriteRuleSubtreeStream stream_structBody=new RewriteRuleSubtreeStream(adaptor,"rule structBody");
3337 RewriteRuleSubtreeStream stream_alignAttribute=new RewriteRuleSubtreeStream(adaptor,"rule alignAttribute");
3338
3339 enter("structSpecifier");
3340
3341 try {
3342 // CTFParser.g:454:1: ( STRUCTTOK ( ( structName ( alignAttribute | ( structBody ( alignAttribute | ) ) | ) ) | ( structBody ( alignAttribute | ) ) ) -> ^( STRUCT ( structName )? ( structBody )? ( alignAttribute )? ) )
3343 // CTFParser.g:455:3: STRUCTTOK ( ( structName ( alignAttribute | ( structBody ( alignAttribute | ) ) | ) ) | ( structBody ( alignAttribute | ) ) )
3344 {
3345 STRUCTTOK67=(Token)match(input,STRUCTTOK,FOLLOW_STRUCTTOK_in_structSpecifier1270); if (state.failed) {
3346 return retval;
3347 }
3348 if ( state.backtracking==0 ) {
3349 stream_STRUCTTOK.add(STRUCTTOK67);
3350 }
3351
3352 // CTFParser.g:456:3: ( ( structName ( alignAttribute | ( structBody ( alignAttribute | ) ) | ) ) | ( structBody ( alignAttribute | ) ) )
3353 int alt22=2;
3354 int LA22_0 = input.LA(1);
3355
3356 if ( (LA22_0==IDENTIFIER) ) {
3357 alt22=1;
3358 }
3359 else if ( (LA22_0==LCURL) ) {
3360 alt22=2;
3361 }
3362 else {
3363 if (state.backtracking>0) {state.failed=true; return retval;}
3364 NoViableAltException nvae =
3365 new NoViableAltException("", 22, 0, input);
3366
3367 throw nvae;
3368 }
3369 switch (alt22) {
3370 case 1 :
3371 // CTFParser.g:458:5: ( structName ( alignAttribute | ( structBody ( alignAttribute | ) ) | ) )
3372 {
3373 // CTFParser.g:458:5: ( structName ( alignAttribute | ( structBody ( alignAttribute | ) ) | ) )
3374 // CTFParser.g:459:6: structName ( alignAttribute | ( structBody ( alignAttribute | ) ) | )
3375 {
3376 pushFollow(FOLLOW_structName_in_structSpecifier1292);
3377 structName68=structName();
3378
3379 state._fsp--;
3380 if (state.failed) {
3381 return retval;
3382 }
3383 if ( state.backtracking==0 ) {
3384 stream_structName.add(structName68.getTree());
3385 }
3386 // CTFParser.g:460:6: ( alignAttribute | ( structBody ( alignAttribute | ) ) | )
3387 int alt20=3;
3388 switch ( input.LA(1) ) {
3389 case ALIGNTOK:
3390 {
3391 alt20=1;
3392 }
3393 break;
3394 case LCURL:
3395 {
3396 switch ( input.LA(2) ) {
3397 case CONSTTOK:
3398 case CHARTOK:
3399 case DOUBLETOK:
3400 case ENUMTOK:
3401 case FLOATINGPOINTTOK:
3402 case FLOATTOK:
3403 case INTEGERTOK:
3404 case INTTOK:
3405 case LONGTOK:
3406 case SHORTTOK:
3407 case STRUCTTOK:
3408 case TYPEALIASTOK:
3409 case TYPEDEFTOK:
3410 case UNSIGNEDTOK:
3411 case VARIANTTOK:
3412 case VOIDTOK:
3413 case BOOLTOK:
3414 case COMPLEXTOK:
3415 case IMAGINARYTOK:
3416 case RCURL:
3417 {
3418 alt20=2;
3419 }
3420 break;
3421 case SIGNEDTOK:
3422 {
3423 int LA20_5 = input.LA(3);
3424
3425 if ( ((LA20_5>=CONSTTOK && LA20_5<=ENUMTOK)||(LA20_5>=FLOATINGPOINTTOK && LA20_5<=SIGNEDTOK)||(LA20_5>=STRINGTOK && LA20_5<=STRUCTTOK)||(LA20_5>=TYPEDEFTOK && LA20_5<=IMAGINARYTOK)||LA20_5==POINTER||LA20_5==IDENTIFIER) ) {
3426 alt20=2;
3427 }
3428 else if ( (LA20_5==SEPARATOR||LA20_5==ASSIGNMENT||LA20_5==RCURL) ) {
3429 alt20=3;
3430 }
3431 else {
3432 if (state.backtracking>0) {state.failed=true; return retval;}
3433 NoViableAltException nvae =
3434 new NoViableAltException("", 20, 5, input);
3435
3436 throw nvae;
3437 }
3438 }
3439 break;
3440 case STRINGTOK:
3441 {
3442 int LA20_6 = input.LA(3);
3443
3444 if ( (LA20_6==SEPARATOR||LA20_6==ASSIGNMENT||LA20_6==RCURL) ) {
3445 alt20=3;
3446 }
3447 else if ( ((LA20_6>=CONSTTOK && LA20_6<=ENUMTOK)||(LA20_6>=FLOATINGPOINTTOK && LA20_6<=SIGNEDTOK)||(LA20_6>=STRINGTOK && LA20_6<=STRUCTTOK)||(LA20_6>=TYPEDEFTOK && LA20_6<=IMAGINARYTOK)||LA20_6==LCURL||LA20_6==POINTER||LA20_6==IDENTIFIER) ) {
3448 alt20=2;
3449 }
3450 else {
3451 if (state.backtracking>0) {state.failed=true; return retval;}
3452 NoViableAltException nvae =
3453 new NoViableAltException("", 20, 6, input);
3454
3455 throw nvae;
3456 }
3457 }
3458 break;
3459 case IDENTIFIER:
3460 {
3461 int LA20_7 = input.LA(3);
3462
3463 if ( (LA20_7==SEPARATOR||LA20_7==ASSIGNMENT||LA20_7==RCURL) ) {
3464 alt20=3;
3465 }
3466 else if ( ((LA20_7>=CONSTTOK && LA20_7<=ENUMTOK)||(LA20_7>=FLOATINGPOINTTOK && LA20_7<=SIGNEDTOK)||(LA20_7>=STRINGTOK && LA20_7<=STRUCTTOK)||(LA20_7>=TYPEDEFTOK && LA20_7<=IMAGINARYTOK)||LA20_7==POINTER||LA20_7==IDENTIFIER) ) {
3467 alt20=2;
3468 }
3469 else {
3470 if (state.backtracking>0) {state.failed=true; return retval;}
3471 NoViableAltException nvae =
3472 new NoViableAltException("", 20, 7, input);
3473
3474 throw nvae;
3475 }
3476 }
3477 break;
3478 case ALIGNTOK:
3479 case EVENTTOK:
3480 case STRING_LITERAL:
3481 {
3482 alt20=3;
3483 }
3484 break;
3485 default:
3486 if (state.backtracking>0) {state.failed=true; return retval;}
3487 NoViableAltException nvae =
3488 new NoViableAltException("", 20, 2, input);
3489
3490 throw nvae;
3491 }
3492
3493 }
3494 break;
3495 case EOF:
3496 case CONSTTOK:
3497 case CHARTOK:
3498 case DOUBLETOK:
3499 case ENUMTOK:
3500 case FLOATINGPOINTTOK:
3501 case FLOATTOK:
3502 case INTEGERTOK:
3503 case INTTOK:
3504 case LONGTOK:
3505 case SHORTTOK:
3506 case SIGNEDTOK:
3507 case STRINGTOK:
3508 case STRUCTTOK:
3509 case TYPEDEFTOK:
3510 case UNSIGNEDTOK:
3511 case VARIANTTOK:
3512 case VOIDTOK:
3513 case BOOLTOK:
3514 case COMPLEXTOK:
3515 case IMAGINARYTOK:
3516 case TYPE_ASSIGNMENT:
3517 case LPAREN:
3518 case TERM:
3519 case POINTER:
3520 case IDENTIFIER:
3521 {
3522 alt20=3;
3523 }
3524 break;
3525 default:
3526 if (state.backtracking>0) {state.failed=true; return retval;}
3527 NoViableAltException nvae =
3528 new NoViableAltException("", 20, 0, input);
3529
3530 throw nvae;
3531 }
3532
3533 switch (alt20) {
3534 case 1 :
3535 // CTFParser.g:461:8: alignAttribute
3536 {
3537 pushFollow(FOLLOW_alignAttribute_in_structSpecifier1308);
3538 alignAttribute69=alignAttribute();
3539
3540 state._fsp--;
3541 if (state.failed) {
3542 return retval;
3543 }
3544 if ( state.backtracking==0 ) {
3545 stream_alignAttribute.add(alignAttribute69.getTree());
3546 }
3547
3548 }
3549 break;
3550 case 2 :
3551 // CTFParser.g:463:8: ( structBody ( alignAttribute | ) )
3552 {
3553 // CTFParser.g:463:8: ( structBody ( alignAttribute | ) )
3554 // CTFParser.g:464:10: structBody ( alignAttribute | )
3555 {
3556 pushFollow(FOLLOW_structBody_in_structSpecifier1337);
3557 structBody70=structBody();
3558
3559 state._fsp--;
3560 if (state.failed) {
3561 return retval;
3562 }
3563 if ( state.backtracking==0 ) {
3564 stream_structBody.add(structBody70.getTree());
3565 }
3566 // CTFParser.g:465:10: ( alignAttribute | )
3567 int alt19=2;
3568 int LA19_0 = input.LA(1);
3569
3570 if ( (LA19_0==ALIGNTOK) ) {
3571 alt19=1;
3572 }
3573 else if ( (LA19_0==EOF||(LA19_0>=CONSTTOK && LA19_0<=ENUMTOK)||(LA19_0>=FLOATINGPOINTTOK && LA19_0<=SIGNEDTOK)||(LA19_0>=STRINGTOK && LA19_0<=STRUCTTOK)||(LA19_0>=TYPEDEFTOK && LA19_0<=IMAGINARYTOK)||LA19_0==TYPE_ASSIGNMENT||LA19_0==LPAREN||LA19_0==LCURL||(LA19_0>=TERM && LA19_0<=POINTER)||LA19_0==IDENTIFIER) ) {
3574 alt19=2;
3575 }
3576 else {
3577 if (state.backtracking>0) {state.failed=true; return retval;}
3578 NoViableAltException nvae =
3579 new NoViableAltException("", 19, 0, input);
3580
3581 throw nvae;
3582 }
3583 switch (alt19) {
3584 case 1 :
3585 // CTFParser.g:466:11: alignAttribute
3586 {
3587 pushFollow(FOLLOW_alignAttribute_in_structSpecifier1362);
3588 alignAttribute71=alignAttribute();
3589
3590 state._fsp--;
3591 if (state.failed) {
3592 return retval;
3593 }
3594 if ( state.backtracking==0 ) {
3595 stream_alignAttribute.add(alignAttribute71.getTree());
3596 }
3597
3598 }
3599 break;
3600 case 2 :
3601 // CTFParser.g:469:10:
3602 {
3603 }
3604 break;
3605
3606 }
3607
3608
3609 }
3610
3611
3612 }
3613 break;
3614 case 3 :
3615 // CTFParser.g:473:6:
3616 {
3617 }
3618 break;
3619
3620 }
3621
3622
3623 }
3624
3625
3626 }
3627 break;
3628 case 2 :
3629 // CTFParser.g:477:5: ( structBody ( alignAttribute | ) )
3630 {
3631 // CTFParser.g:477:5: ( structBody ( alignAttribute | ) )
3632 // CTFParser.g:478:7: structBody ( alignAttribute | )
3633 {
3634 pushFollow(FOLLOW_structBody_in_structSpecifier1460);
3635 structBody72=structBody();
3636
3637 state._fsp--;
3638 if (state.failed) {
3639 return retval;
3640 }
3641 if ( state.backtracking==0 ) {
3642 stream_structBody.add(structBody72.getTree());
3643 }
3644 // CTFParser.g:479:7: ( alignAttribute | )
3645 int alt21=2;
3646 int LA21_0 = input.LA(1);
3647
3648 if ( (LA21_0==ALIGNTOK) ) {
3649 alt21=1;
3650 }
3651 else if ( (LA21_0==EOF||(LA21_0>=CONSTTOK && LA21_0<=ENUMTOK)||(LA21_0>=FLOATINGPOINTTOK && LA21_0<=SIGNEDTOK)||(LA21_0>=STRINGTOK && LA21_0<=STRUCTTOK)||(LA21_0>=TYPEDEFTOK && LA21_0<=IMAGINARYTOK)||LA21_0==TYPE_ASSIGNMENT||LA21_0==LPAREN||LA21_0==LCURL||(LA21_0>=TERM && LA21_0<=POINTER)||LA21_0==IDENTIFIER) ) {
3652 alt21=2;
3653 }
3654 else {
3655 if (state.backtracking>0) {state.failed=true; return retval;}
3656 NoViableAltException nvae =
3657 new NoViableAltException("", 21, 0, input);
3658
3659 throw nvae;
3660 }
3661 switch (alt21) {
3662 case 1 :
3663 // CTFParser.g:480:9: alignAttribute
3664 {
3665 pushFollow(FOLLOW_alignAttribute_in_structSpecifier1478);
3666 alignAttribute73=alignAttribute();
3667
3668 state._fsp--;
3669 if (state.failed) {
3670 return retval;
3671 }
3672 if ( state.backtracking==0 ) {
3673 stream_alignAttribute.add(alignAttribute73.getTree());
3674 }
3675
3676 }
3677 break;
3678 case 2 :
3679 // CTFParser.g:483:7:
3680 {
3681 }
3682 break;
3683
3684 }
3685
3686
3687 }
3688
3689
3690 }
3691 break;
3692
3693 }
3694
3695
3696
3697 // AST REWRITE
3698 // elements: alignAttribute, structBody, structName
3699 // token labels:
3700 // rule labels: retval
3701 // token list labels:
3702 // rule list labels:
3703 // wildcard labels:
3704 if ( state.backtracking==0 ) {
3705 retval.tree = root_0;
3706 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
3707
3708 root_0 = (CommonTree)adaptor.nil();
3709 // 485:5: -> ^( STRUCT ( structName )? ( structBody )? ( alignAttribute )? )
3710 {
3711 // CTFParser.g:485:8: ^( STRUCT ( structName )? ( structBody )? ( alignAttribute )? )
3712 {
3713 CommonTree root_1 = (CommonTree)adaptor.nil();
3714 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(STRUCT, "STRUCT"), root_1);
3715
3716 // CTFParser.g:485:17: ( structName )?
3717 if ( stream_structName.hasNext() ) {
3718 adaptor.addChild(root_1, stream_structName.nextTree());
3719
3720 }
3721 stream_structName.reset();
3722 // CTFParser.g:485:29: ( structBody )?
3723 if ( stream_structBody.hasNext() ) {
3724 adaptor.addChild(root_1, stream_structBody.nextTree());
3725
3726 }
3727 stream_structBody.reset();
3728 // CTFParser.g:485:41: ( alignAttribute )?
3729 if ( stream_alignAttribute.hasNext() ) {
3730 adaptor.addChild(root_1, stream_alignAttribute.nextTree());
3731
3732 }
3733 stream_alignAttribute.reset();
3734
3735 adaptor.addChild(root_0, root_1);
3736 }
3737
3738 }
3739
3740 retval.tree = root_0;}
3741 }
3742
3743 retval.stop = input.LT(-1);
3744
3745 if ( state.backtracking==0 ) {
3746
3747 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
3748 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
3749 }
3750 if ( state.backtracking==0 ) {
3751
3752 exit("structSpecifier");
3753
3754 }
3755 }
3756
3757 catch (RecognitionException e)
3758 {
3759 throw e;
3760 }
3761 finally {
3762 }
3763 return retval;
3764 }
3765 // $ANTLR end "structSpecifier"
3766
3767 public static class structName_return extends ParserRuleReturnScope {
3768 CommonTree tree;
3769 public Object getTree() { return tree; }
3770 };
3771
3772 // $ANTLR start "structName"
3773 // CTFParser.g:488:1: structName : IDENTIFIER -> ^( STRUCT_NAME IDENTIFIER ) ;
3774 public final CTFParser.structName_return structName() throws RecognitionException {
3775 CTFParser.structName_return retval = new CTFParser.structName_return();
3776 retval.start = input.LT(1);
3777
3778 CommonTree root_0 = null;
3779
3780 Token IDENTIFIER74=null;
3781
3782 CommonTree IDENTIFIER74_tree=null;
3783 RewriteRuleTokenStream stream_IDENTIFIER=new RewriteRuleTokenStream(adaptor,"token IDENTIFIER");
3784
3785
3786 enter("structName");
3787
3788 try {
3789 // CTFParser.g:496:1: ( IDENTIFIER -> ^( STRUCT_NAME IDENTIFIER ) )
3790 // CTFParser.g:497:3: IDENTIFIER
3791 {
3792 IDENTIFIER74=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_structName1554); if (state.failed) {
3793 return retval;
3794 }
3795 if ( state.backtracking==0 ) {
3796 stream_IDENTIFIER.add(IDENTIFIER74);
3797 }
3798
3799
3800
3801 // AST REWRITE
3802 // elements: IDENTIFIER
3803 // token labels:
3804 // rule labels: retval
3805 // token list labels:
3806 // rule list labels:
3807 // wildcard labels:
3808 if ( state.backtracking==0 ) {
3809 retval.tree = root_0;
3810 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
3811
3812 root_0 = (CommonTree)adaptor.nil();
3813 // 497:14: -> ^( STRUCT_NAME IDENTIFIER )
3814 {
3815 // CTFParser.g:497:17: ^( STRUCT_NAME IDENTIFIER )
3816 {
3817 CommonTree root_1 = (CommonTree)adaptor.nil();
3818 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(STRUCT_NAME, "STRUCT_NAME"), root_1);
3819
3820 adaptor.addChild(root_1, stream_IDENTIFIER.nextNode());
3821
3822 adaptor.addChild(root_0, root_1);
3823 }
3824
3825 }
3826
3827 retval.tree = root_0;}
3828 }
3829
3830 retval.stop = input.LT(-1);
3831
3832 if ( state.backtracking==0 ) {
3833
3834 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
3835 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
3836 }
3837 if ( state.backtracking==0 ) {
3838
3839 debug_print(input.toString(retval.start,input.LT(-1)));
3840 exit("structName");
3841
3842 }
3843 }
3844
3845 catch (RecognitionException e)
3846 {
3847 throw e;
3848 }
3849 finally {
3850 }
3851 return retval;
3852 }
3853 // $ANTLR end "structName"
3854
3855 public static class structOrVariantDeclarationList_return extends ParserRuleReturnScope {
3856 CommonTree tree;
3857 public Object getTree() { return tree; }
3858 };
3859
3860 // $ANTLR start "structOrVariantDeclarationList"
3861 // CTFParser.g:500:1: structOrVariantDeclarationList : ( structOrVariantDeclaration )+ ;
3862 public final CTFParser.structOrVariantDeclarationList_return structOrVariantDeclarationList() throws RecognitionException {
3863 CTFParser.structOrVariantDeclarationList_return retval = new CTFParser.structOrVariantDeclarationList_return();
3864 retval.start = input.LT(1);
3865
3866 CommonTree root_0 = null;
3867
3868 CTFParser.structOrVariantDeclaration_return structOrVariantDeclaration75 = null;
3869
3870
3871
3872
3873 enter("structOrVariantDeclarationList");
3874
3875 try {
3876 // CTFParser.g:507:1: ( ( structOrVariantDeclaration )+ )
3877 // CTFParser.g:508:3: ( structOrVariantDeclaration )+
3878 {
3879 root_0 = (CommonTree)adaptor.nil();
3880
3881 // CTFParser.g:508:3: ( structOrVariantDeclaration )+
3882 int cnt23=0;
3883 loop23:
3884 do {
3885 int alt23=2;
3886 int LA23_0 = input.LA(1);
3887
3888 if ( ((LA23_0>=CONSTTOK && LA23_0<=ENUMTOK)||(LA23_0>=FLOATINGPOINTTOK && LA23_0<=SIGNEDTOK)||(LA23_0>=STRINGTOK && LA23_0<=STRUCTTOK)||(LA23_0>=TYPEDEFTOK && LA23_0<=IMAGINARYTOK)) ) {
3889 alt23=1;
3890 }
3891 else if ( (LA23_0==IDENTIFIER) && ((inTypealiasAlias() || isTypeName(input.LT(1).getText())))) {
3892 alt23=1;
3893 }
3894 else if ( (LA23_0==TYPEALIASTOK) ) {
3895 alt23=1;
3896 }
3897
3898
3899 switch (alt23) {
3900 case 1 :
3901 // CTFParser.g:508:3: structOrVariantDeclaration
3902 {
3903 pushFollow(FOLLOW_structOrVariantDeclaration_in_structOrVariantDeclarationList1585);
3904 structOrVariantDeclaration75=structOrVariantDeclaration();
3905
3906 state._fsp--;
3907 if (state.failed) {
3908 return retval;
3909 }
3910 if ( state.backtracking==0 ) {
3911 adaptor.addChild(root_0, structOrVariantDeclaration75.getTree());
3912 }
3913
3914 }
3915 break;
3916
3917 default :
3918 if ( cnt23 >= 1 ) {
3919 break loop23;
3920 }
3921 if (state.backtracking>0) {state.failed=true; return retval;}
3922 EarlyExitException eee =
3923 new EarlyExitException(23, input);
3924 throw eee;
3925 }
3926 cnt23++;
3927 } while (true);
3928
3929
3930 }
3931
3932 retval.stop = input.LT(-1);
3933
3934 if ( state.backtracking==0 ) {
3935
3936 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
3937 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
3938 }
3939 if ( state.backtracking==0 ) {
3940
3941 exit("structOrVariantDeclarationList");
3942
3943 }
3944 }
3945
3946 catch (RecognitionException e)
3947 {
3948 throw e;
3949 }
3950 finally {
3951 }
3952 return retval;
3953 }
3954 // $ANTLR end "structOrVariantDeclarationList"
3955
3956 public static class structOrVariantDeclaration_return extends ParserRuleReturnScope {
3957 CommonTree tree;
3958 public Object getTree() { return tree; }
3959 };
3960
3961 // $ANTLR start "structOrVariantDeclaration"
3962 // CTFParser.g:511:1: structOrVariantDeclaration : ( ( declarationSpecifiers ({...}? => declaratorList -> ^( TYPEDEF declaratorList declarationSpecifiers ) | structOrVariantDeclaratorList -> ^( SV_DECLARATION declarationSpecifiers structOrVariantDeclaratorList ) ) ) | typealiasDecl -> typealiasDecl ) TERM ;
3963 public final CTFParser.structOrVariantDeclaration_return structOrVariantDeclaration() throws RecognitionException {
3964 CTFParser.structOrVariantDeclaration_return retval = new CTFParser.structOrVariantDeclaration_return();
3965 retval.start = input.LT(1);
3966
3967 CommonTree root_0 = null;
3968
3969 Token TERM80=null;
3970 CTFParser.declarationSpecifiers_return declarationSpecifiers76 = null;
3971
3972 CTFParser.declaratorList_return declaratorList77 = null;
3973
3974 CTFParser.structOrVariantDeclaratorList_return structOrVariantDeclaratorList78 = null;
3975
3976 CTFParser.typealiasDecl_return typealiasDecl79 = null;
3977
3978
3979 CommonTree TERM80_tree=null;
3980 RewriteRuleTokenStream stream_TERM=new RewriteRuleTokenStream(adaptor,"token TERM");
3981 RewriteRuleSubtreeStream stream_declaratorList=new RewriteRuleSubtreeStream(adaptor,"rule declaratorList");
3982 RewriteRuleSubtreeStream stream_typealiasDecl=new RewriteRuleSubtreeStream(adaptor,"rule typealiasDecl");
3983 RewriteRuleSubtreeStream stream_declarationSpecifiers=new RewriteRuleSubtreeStream(adaptor,"rule declarationSpecifiers");
3984 RewriteRuleSubtreeStream stream_structOrVariantDeclaratorList=new RewriteRuleSubtreeStream(adaptor,"rule structOrVariantDeclaratorList");
3985
3986 enter("structOrVariantDeclaration");
3987
3988 try {
3989 // CTFParser.g:518:1: ( ( ( declarationSpecifiers ({...}? => declaratorList -> ^( TYPEDEF declaratorList declarationSpecifiers ) | structOrVariantDeclaratorList -> ^( SV_DECLARATION declarationSpecifiers structOrVariantDeclaratorList ) ) ) | typealiasDecl -> typealiasDecl ) TERM )
3990 // CTFParser.g:519:3: ( ( declarationSpecifiers ({...}? => declaratorList -> ^( TYPEDEF declaratorList declarationSpecifiers ) | structOrVariantDeclaratorList -> ^( SV_DECLARATION declarationSpecifiers structOrVariantDeclaratorList ) ) ) | typealiasDecl -> typealiasDecl ) TERM
3991 {
3992 // CTFParser.g:519:3: ( ( declarationSpecifiers ({...}? => declaratorList -> ^( TYPEDEF declaratorList declarationSpecifiers ) | structOrVariantDeclaratorList -> ^( SV_DECLARATION declarationSpecifiers structOrVariantDeclaratorList ) ) ) | typealiasDecl -> typealiasDecl )
3993 int alt25=2;
3994 int LA25_0 = input.LA(1);
3995
3996 if ( ((LA25_0>=CONSTTOK && LA25_0<=ENUMTOK)||(LA25_0>=FLOATINGPOINTTOK && LA25_0<=SIGNEDTOK)||(LA25_0>=STRINGTOK && LA25_0<=STRUCTTOK)||(LA25_0>=TYPEDEFTOK && LA25_0<=IMAGINARYTOK)) ) {
3997 alt25=1;
3998 }
3999 else if ( (LA25_0==IDENTIFIER) && ((inTypealiasAlias() || isTypeName(input.LT(1).getText())))) {
4000 alt25=1;
4001 }
4002 else if ( (LA25_0==TYPEALIASTOK) ) {
4003 alt25=2;
4004 }
4005 else {
4006 if (state.backtracking>0) {state.failed=true; return retval;}
4007 NoViableAltException nvae =
4008 new NoViableAltException("", 25, 0, input);
4009
4010 throw nvae;
4011 }
4012 switch (alt25) {
4013 case 1 :
4014 // CTFParser.g:520:4: ( declarationSpecifiers ({...}? => declaratorList -> ^( TYPEDEF declaratorList declarationSpecifiers ) | structOrVariantDeclaratorList -> ^( SV_DECLARATION declarationSpecifiers structOrVariantDeclaratorList ) ) )
4015 {
4016 // CTFParser.g:520:4: ( declarationSpecifiers ({...}? => declaratorList -> ^( TYPEDEF declaratorList declarationSpecifiers ) | structOrVariantDeclaratorList -> ^( SV_DECLARATION declarationSpecifiers structOrVariantDeclaratorList ) ) )
4017 // CTFParser.g:521:5: declarationSpecifiers ({...}? => declaratorList -> ^( TYPEDEF declaratorList declarationSpecifiers ) | structOrVariantDeclaratorList -> ^( SV_DECLARATION declarationSpecifiers structOrVariantDeclaratorList ) )
4018 {
4019 pushFollow(FOLLOW_declarationSpecifiers_in_structOrVariantDeclaration1623);
4020 declarationSpecifiers76=declarationSpecifiers();
4021
4022 state._fsp--;
4023 if (state.failed) {
4024 return retval;
4025 }
4026 if ( state.backtracking==0 ) {
4027 stream_declarationSpecifiers.add(declarationSpecifiers76.getTree());
4028 }
4029 // CTFParser.g:522:7: ({...}? => declaratorList -> ^( TYPEDEF declaratorList declarationSpecifiers ) | structOrVariantDeclaratorList -> ^( SV_DECLARATION declarationSpecifiers structOrVariantDeclaratorList ) )
4030 int alt24=2;
4031 alt24 = dfa24.predict(input);
4032 switch (alt24) {
4033 case 1 :
4034 // CTFParser.g:524:9: {...}? => declaratorList
4035 {
4036 if ( !((inTypedef())) ) {
4037 if (state.backtracking>0) {state.failed=true; return retval;}
4038 throw new FailedPredicateException(input, "structOrVariantDeclaration", "inTypedef()");
4039 }
4040 pushFollow(FOLLOW_declaratorList_in_structOrVariantDeclaration1655);
4041 declaratorList77=declaratorList();
4042
4043 state._fsp--;
4044 if (state.failed) {
4045 return retval;
4046 }
4047 if ( state.backtracking==0 ) {
4048 stream_declaratorList.add(declaratorList77.getTree());
4049 }
4050 if ( state.backtracking==0 ) {
4051 typedefOff();
4052 }
4053
4054
4055 // AST REWRITE
4056 // elements: declaratorList, declarationSpecifiers
4057 // token labels:
4058 // rule labels: retval
4059 // token list labels:
4060 // rule list labels:
4061 // wildcard labels:
4062 if ( state.backtracking==0 ) {
4063 retval.tree = root_0;
4064 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
4065
4066 root_0 = (CommonTree)adaptor.nil();
4067 // 525:11: -> ^( TYPEDEF declaratorList declarationSpecifiers )
4068 {
4069 // CTFParser.g:525:14: ^( TYPEDEF declaratorList declarationSpecifiers )
4070 {
4071 CommonTree root_1 = (CommonTree)adaptor.nil();
4072 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPEDEF, "TYPEDEF"), root_1);
4073
4074 adaptor.addChild(root_1, stream_declaratorList.nextTree());
4075 adaptor.addChild(root_1, stream_declarationSpecifiers.nextTree());
4076
4077 adaptor.addChild(root_0, root_1);
4078 }
4079
4080 }
4081
4082 retval.tree = root_0;}
4083 }
4084 break;
4085 case 2 :
4086 // CTFParser.g:526:11: structOrVariantDeclaratorList
4087 {
4088 pushFollow(FOLLOW_structOrVariantDeclaratorList_in_structOrVariantDeclaration1689);
4089 structOrVariantDeclaratorList78=structOrVariantDeclaratorList();
4090
4091 state._fsp--;
4092 if (state.failed) {
4093 return retval;
4094 }
4095 if ( state.backtracking==0 ) {
4096 stream_structOrVariantDeclaratorList.add(structOrVariantDeclaratorList78.getTree());
4097 }
4098
4099
4100 // AST REWRITE
4101 // elements: declarationSpecifiers, structOrVariantDeclaratorList
4102 // token labels:
4103 // rule labels: retval
4104 // token list labels:
4105 // rule list labels:
4106 // wildcard labels:
4107 if ( state.backtracking==0 ) {
4108 retval.tree = root_0;
4109 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
4110
4111 root_0 = (CommonTree)adaptor.nil();
4112 // 527:11: -> ^( SV_DECLARATION declarationSpecifiers structOrVariantDeclaratorList )
4113 {
4114 // CTFParser.g:527:14: ^( SV_DECLARATION declarationSpecifiers structOrVariantDeclaratorList )
4115 {
4116 CommonTree root_1 = (CommonTree)adaptor.nil();
4117 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(SV_DECLARATION, "SV_DECLARATION"), root_1);
4118
4119 adaptor.addChild(root_1, stream_declarationSpecifiers.nextTree());
4120 adaptor.addChild(root_1, stream_structOrVariantDeclaratorList.nextTree());
4121
4122 adaptor.addChild(root_0, root_1);
4123 }
4124
4125 }
4126
4127 retval.tree = root_0;}
4128 }
4129 break;
4130
4131 }
4132
4133
4134 }
4135
4136
4137 }
4138 break;
4139 case 2 :
4140 // CTFParser.g:532:5: typealiasDecl
4141 {
4142 pushFollow(FOLLOW_typealiasDecl_in_structOrVariantDeclaration1739);
4143 typealiasDecl79=typealiasDecl();
4144
4145 state._fsp--;
4146 if (state.failed) {
4147 return retval;
4148 }
4149 if ( state.backtracking==0 ) {
4150 stream_typealiasDecl.add(typealiasDecl79.getTree());
4151 }
4152
4153
4154 // AST REWRITE
4155 // elements: typealiasDecl
4156 // token labels:
4157 // rule labels: retval
4158 // token list labels:
4159 // rule list labels:
4160 // wildcard labels:
4161 if ( state.backtracking==0 ) {
4162 retval.tree = root_0;
4163 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
4164
4165 root_0 = (CommonTree)adaptor.nil();
4166 // 532:19: -> typealiasDecl
4167 {
4168 adaptor.addChild(root_0, stream_typealiasDecl.nextTree());
4169
4170 }
4171
4172 retval.tree = root_0;}
4173 }
4174 break;
4175
4176 }
4177
4178 TERM80=(Token)match(input,TERM,FOLLOW_TERM_in_structOrVariantDeclaration1751); if (state.failed) {
4179 return retval;
4180 }
4181 if ( state.backtracking==0 ) {
4182 stream_TERM.add(TERM80);
4183 }
4184
4185
4186 }
4187
4188 retval.stop = input.LT(-1);
4189
4190 if ( state.backtracking==0 ) {
4191
4192 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
4193 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
4194 }
4195 if ( state.backtracking==0 ) {
4196
4197 exit("structOrVariantDeclaration");
4198
4199 }
4200 }
4201
4202 catch (RecognitionException e)
4203 {
4204 throw e;
4205 }
4206 finally {
4207 }
4208 return retval;
4209 }
4210 // $ANTLR end "structOrVariantDeclaration"
4211
4212 public static class specifierQualifierList_return extends ParserRuleReturnScope {
4213 CommonTree tree;
4214 public Object getTree() { return tree; }
4215 };
4216
4217 // $ANTLR start "specifierQualifierList"
4218 // CTFParser.g:537:1: specifierQualifierList : ( typeQualifier | typeSpecifier )+ -> ^( TYPE_SPECIFIER_LIST ( typeQualifier )* ( typeSpecifier )* ) ;
4219 public final CTFParser.specifierQualifierList_return specifierQualifierList() throws RecognitionException {
4220 CTFParser.specifierQualifierList_return retval = new CTFParser.specifierQualifierList_return();
4221 retval.start = input.LT(1);
4222
4223 CommonTree root_0 = null;
4224
4225 CTFParser.typeQualifier_return typeQualifier81 = null;
4226
4227 CTFParser.typeSpecifier_return typeSpecifier82 = null;
4228
4229
4230 RewriteRuleSubtreeStream stream_typeSpecifier=new RewriteRuleSubtreeStream(adaptor,"rule typeSpecifier");
4231 RewriteRuleSubtreeStream stream_typeQualifier=new RewriteRuleSubtreeStream(adaptor,"rule typeQualifier");
4232
4233 enter("specifierQualifierList");
4234
4235 try {
4236 // CTFParser.g:544:1: ( ( typeQualifier | typeSpecifier )+ -> ^( TYPE_SPECIFIER_LIST ( typeQualifier )* ( typeSpecifier )* ) )
4237 // CTFParser.g:545:3: ( typeQualifier | typeSpecifier )+
4238 {
4239 // CTFParser.g:545:3: ( typeQualifier | typeSpecifier )+
4240 int cnt26=0;
4241 loop26:
4242 do {
4243 int alt26=3;
4244 int LA26_0 = input.LA(1);
4245
4246 if ( (LA26_0==CONSTTOK) ) {
4247 alt26=1;
4248 }
4249 else if ( ((LA26_0>=CHARTOK && LA26_0<=ENUMTOK)||(LA26_0>=FLOATINGPOINTTOK && LA26_0<=SIGNEDTOK)||(LA26_0>=STRINGTOK && LA26_0<=STRUCTTOK)||(LA26_0>=UNSIGNEDTOK && LA26_0<=IMAGINARYTOK)) ) {
4250 alt26=2;
4251 }
4252 else if ( (LA26_0==IDENTIFIER) && ((inTypealiasAlias() || isTypeName(input.LT(1).getText())))) {
4253 alt26=2;
4254 }
4255
4256
4257 switch (alt26) {
4258 case 1 :
4259 // CTFParser.g:545:4: typeQualifier
4260 {
4261 pushFollow(FOLLOW_typeQualifier_in_specifierQualifierList1775);
4262 typeQualifier81=typeQualifier();
4263
4264 state._fsp--;
4265 if (state.failed) {
4266 return retval;
4267 }
4268 if ( state.backtracking==0 ) {
4269 stream_typeQualifier.add(typeQualifier81.getTree());
4270 }
4271
4272 }
4273 break;
4274 case 2 :
4275 // CTFParser.g:545:20: typeSpecifier
4276 {
4277 pushFollow(FOLLOW_typeSpecifier_in_specifierQualifierList1779);
4278 typeSpecifier82=typeSpecifier();
4279
4280 state._fsp--;
4281 if (state.failed) {
4282 return retval;
4283 }
4284 if ( state.backtracking==0 ) {
4285 stream_typeSpecifier.add(typeSpecifier82.getTree());
4286 }
4287
4288 }
4289 break;
4290
4291 default :
4292 if ( cnt26 >= 1 ) {
4293 break loop26;
4294 }
4295 if (state.backtracking>0) {state.failed=true; return retval;}
4296 EarlyExitException eee =
4297 new EarlyExitException(26, input);
4298 throw eee;
4299 }
4300 cnt26++;
4301 } while (true);
4302
4303
4304
4305 // AST REWRITE
4306 // elements: typeQualifier, typeSpecifier
4307 // token labels:
4308 // rule labels: retval
4309 // token list labels:
4310 // rule list labels:
4311 // wildcard labels:
4312 if ( state.backtracking==0 ) {
4313 retval.tree = root_0;
4314 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
4315
4316 root_0 = (CommonTree)adaptor.nil();
4317 // 545:36: -> ^( TYPE_SPECIFIER_LIST ( typeQualifier )* ( typeSpecifier )* )
4318 {
4319 // CTFParser.g:545:39: ^( TYPE_SPECIFIER_LIST ( typeQualifier )* ( typeSpecifier )* )
4320 {
4321 CommonTree root_1 = (CommonTree)adaptor.nil();
4322 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPE_SPECIFIER_LIST, "TYPE_SPECIFIER_LIST"), root_1);
4323
4324 // CTFParser.g:545:61: ( typeQualifier )*
4325 while ( stream_typeQualifier.hasNext() ) {
4326 adaptor.addChild(root_1, stream_typeQualifier.nextTree());
4327
4328 }
4329 stream_typeQualifier.reset();
4330 // CTFParser.g:545:76: ( typeSpecifier )*
4331 while ( stream_typeSpecifier.hasNext() ) {
4332 adaptor.addChild(root_1, stream_typeSpecifier.nextTree());
4333
4334 }
4335 stream_typeSpecifier.reset();
4336
4337 adaptor.addChild(root_0, root_1);
4338 }
4339
4340 }
4341
4342 retval.tree = root_0;}
4343 }
4344
4345 retval.stop = input.LT(-1);
4346
4347 if ( state.backtracking==0 ) {
4348
4349 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
4350 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
4351 }
4352 if ( state.backtracking==0 ) {
4353
4354 exit("specifierQualifierList");
4355
4356 }
4357 }
4358
4359 catch (RecognitionException e)
4360 {
4361 throw e;
4362 }
4363 finally {
4364 }
4365 return retval;
4366 }
4367 // $ANTLR end "specifierQualifierList"
4368
4369 public static class structOrVariantDeclaratorList_return extends ParserRuleReturnScope {
4370 CommonTree tree;
4371 public Object getTree() { return tree; }
4372 };
4373
4374 // $ANTLR start "structOrVariantDeclaratorList"
4375 // CTFParser.g:548:1: structOrVariantDeclaratorList : structOrVariantDeclarator ( SEPARATOR structOrVariantDeclarator )* -> ^( TYPE_DECLARATOR_LIST ( structOrVariantDeclarator )+ ) ;
4376 public final CTFParser.structOrVariantDeclaratorList_return structOrVariantDeclaratorList() throws RecognitionException {
4377 CTFParser.structOrVariantDeclaratorList_return retval = new CTFParser.structOrVariantDeclaratorList_return();
4378 retval.start = input.LT(1);
4379
4380 CommonTree root_0 = null;
4381
4382 Token SEPARATOR84=null;
4383 CTFParser.structOrVariantDeclarator_return structOrVariantDeclarator83 = null;
4384
4385 CTFParser.structOrVariantDeclarator_return structOrVariantDeclarator85 = null;
4386
4387
4388 CommonTree SEPARATOR84_tree=null;
4389 RewriteRuleTokenStream stream_SEPARATOR=new RewriteRuleTokenStream(adaptor,"token SEPARATOR");
4390 RewriteRuleSubtreeStream stream_structOrVariantDeclarator=new RewriteRuleSubtreeStream(adaptor,"rule structOrVariantDeclarator");
4391
4392 enter("structOrVariantDeclaratorList");
4393
4394 try {
4395 // CTFParser.g:555:1: ( structOrVariantDeclarator ( SEPARATOR structOrVariantDeclarator )* -> ^( TYPE_DECLARATOR_LIST ( structOrVariantDeclarator )+ ) )
4396 // CTFParser.g:556:3: structOrVariantDeclarator ( SEPARATOR structOrVariantDeclarator )*
4397 {
4398 pushFollow(FOLLOW_structOrVariantDeclarator_in_structOrVariantDeclaratorList1816);
4399 structOrVariantDeclarator83=structOrVariantDeclarator();
4400
4401 state._fsp--;
4402 if (state.failed) {
4403 return retval;
4404 }
4405 if ( state.backtracking==0 ) {
4406 stream_structOrVariantDeclarator.add(structOrVariantDeclarator83.getTree());
4407 }
4408 // CTFParser.g:556:29: ( SEPARATOR structOrVariantDeclarator )*
4409 loop27:
4410 do {
4411 int alt27=2;
4412 int LA27_0 = input.LA(1);
4413
4414 if ( (LA27_0==SEPARATOR) ) {
4415 alt27=1;
4416 }
4417
4418
4419 switch (alt27) {
4420 case 1 :
4421 // CTFParser.g:556:30: SEPARATOR structOrVariantDeclarator
4422 {
4423 SEPARATOR84=(Token)match(input,SEPARATOR,FOLLOW_SEPARATOR_in_structOrVariantDeclaratorList1819); if (state.failed) {
4424 return retval;
4425 }
4426 if ( state.backtracking==0 ) {
4427 stream_SEPARATOR.add(SEPARATOR84);
4428 }
4429
4430 pushFollow(FOLLOW_structOrVariantDeclarator_in_structOrVariantDeclaratorList1821);
4431 structOrVariantDeclarator85=structOrVariantDeclarator();
4432
4433 state._fsp--;
4434 if (state.failed) {
4435 return retval;
4436 }
4437 if ( state.backtracking==0 ) {
4438 stream_structOrVariantDeclarator.add(structOrVariantDeclarator85.getTree());
4439 }
4440
4441 }
4442 break;
4443
4444 default :
4445 break loop27;
4446 }
4447 } while (true);
4448
4449
4450
4451 // AST REWRITE
4452 // elements: structOrVariantDeclarator
4453 // token labels:
4454 // rule labels: retval
4455 // token list labels:
4456 // rule list labels:
4457 // wildcard labels:
4458 if ( state.backtracking==0 ) {
4459 retval.tree = root_0;
4460 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
4461
4462 root_0 = (CommonTree)adaptor.nil();
4463 // 556:68: -> ^( TYPE_DECLARATOR_LIST ( structOrVariantDeclarator )+ )
4464 {
4465 // CTFParser.g:556:71: ^( TYPE_DECLARATOR_LIST ( structOrVariantDeclarator )+ )
4466 {
4467 CommonTree root_1 = (CommonTree)adaptor.nil();
4468 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPE_DECLARATOR_LIST, "TYPE_DECLARATOR_LIST"), root_1);
4469
4470 if ( !(stream_structOrVariantDeclarator.hasNext()) ) {
4471 throw new RewriteEarlyExitException();
4472 }
4473 while ( stream_structOrVariantDeclarator.hasNext() ) {
4474 adaptor.addChild(root_1, stream_structOrVariantDeclarator.nextTree());
4475
4476 }
4477 stream_structOrVariantDeclarator.reset();
4478
4479 adaptor.addChild(root_0, root_1);
4480 }
4481
4482 }
4483
4484 retval.tree = root_0;}
4485 }
4486
4487 retval.stop = input.LT(-1);
4488
4489 if ( state.backtracking==0 ) {
4490
4491 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
4492 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
4493 }
4494 if ( state.backtracking==0 ) {
4495
4496 exit("structOrVariantDeclaratorList");
4497
4498 }
4499 }
4500
4501 catch (RecognitionException e)
4502 {
4503 throw e;
4504 }
4505 finally {
4506 }
4507 return retval;
4508 }
4509 // $ANTLR end "structOrVariantDeclaratorList"
4510
4511 public static class structOrVariantDeclarator_return extends ParserRuleReturnScope {
4512 CommonTree tree;
4513 public Object getTree() { return tree; }
4514 };
4515
4516 // $ANTLR start "structOrVariantDeclarator"
4517 // CTFParser.g:559:1: structOrVariantDeclarator : ( declarator ( COLON numberLiteral )? ) -> declarator ;
4518 public final CTFParser.structOrVariantDeclarator_return structOrVariantDeclarator() throws RecognitionException {
4519 CTFParser.structOrVariantDeclarator_return retval = new CTFParser.structOrVariantDeclarator_return();
4520 retval.start = input.LT(1);
4521
4522 CommonTree root_0 = null;
4523
4524 Token COLON87=null;
4525 CTFParser.declarator_return declarator86 = null;
4526
4527 CTFParser.numberLiteral_return numberLiteral88 = null;
4528
4529
4530 CommonTree COLON87_tree=null;
4531 RewriteRuleTokenStream stream_COLON=new RewriteRuleTokenStream(adaptor,"token COLON");
4532 RewriteRuleSubtreeStream stream_declarator=new RewriteRuleSubtreeStream(adaptor,"rule declarator");
4533 RewriteRuleSubtreeStream stream_numberLiteral=new RewriteRuleSubtreeStream(adaptor,"rule numberLiteral");
4534
4535 enter("structOrVariantDeclarator");
4536
4537 try {
4538 // CTFParser.g:566:1: ( ( declarator ( COLON numberLiteral )? ) -> declarator )
4539 // CTFParser.g:568:5: ( declarator ( COLON numberLiteral )? )
4540 {
4541 // CTFParser.g:568:5: ( declarator ( COLON numberLiteral )? )
4542 // CTFParser.g:568:6: declarator ( COLON numberLiteral )?
4543 {
4544 pushFollow(FOLLOW_declarator_in_structOrVariantDeclarator1862);
4545 declarator86=declarator();
4546
4547 state._fsp--;
4548 if (state.failed) {
4549 return retval;
4550 }
4551 if ( state.backtracking==0 ) {
4552 stream_declarator.add(declarator86.getTree());
4553 }
4554 // CTFParser.g:568:17: ( COLON numberLiteral )?
4555 int alt28=2;
4556 int LA28_0 = input.LA(1);
4557
4558 if ( (LA28_0==COLON) ) {
4559 alt28=1;
4560 }
4561 switch (alt28) {
4562 case 1 :
4563 // CTFParser.g:568:18: COLON numberLiteral
4564 {
4565 COLON87=(Token)match(input,COLON,FOLLOW_COLON_in_structOrVariantDeclarator1865); if (state.failed) {
4566 return retval;
4567 }
4568 if ( state.backtracking==0 ) {
4569 stream_COLON.add(COLON87);
4570 }
4571
4572 pushFollow(FOLLOW_numberLiteral_in_structOrVariantDeclarator1867);
4573 numberLiteral88=numberLiteral();
4574
4575 state._fsp--;
4576 if (state.failed) {
4577 return retval;
4578 }
4579 if ( state.backtracking==0 ) {
4580 stream_numberLiteral.add(numberLiteral88.getTree());
4581 }
4582
4583 }
4584 break;
4585
4586 }
4587
4588
4589 }
4590
4591
4592
4593 // AST REWRITE
4594 // elements: declarator
4595 // token labels:
4596 // rule labels: retval
4597 // token list labels:
4598 // rule list labels:
4599 // wildcard labels:
4600 if ( state.backtracking==0 ) {
4601 retval.tree = root_0;
4602 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
4603
4604 root_0 = (CommonTree)adaptor.nil();
4605 // 568:41: -> declarator
4606 {
4607 adaptor.addChild(root_0, stream_declarator.nextTree());
4608
4609 }
4610
4611 retval.tree = root_0;}
4612 }
4613
4614 retval.stop = input.LT(-1);
4615
4616 if ( state.backtracking==0 ) {
4617
4618 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
4619 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
4620 }
4621 if ( state.backtracking==0 ) {
4622
4623 exit("structOrVariantDeclarator");
4624
4625 }
4626 }
4627
4628 catch (RecognitionException e)
4629 {
4630 throw e;
4631 }
4632 finally {
4633 }
4634 return retval;
4635 }
4636 // $ANTLR end "structOrVariantDeclarator"
4637
4638 public static class variantSpecifier_return extends ParserRuleReturnScope {
4639 CommonTree tree;
4640 public Object getTree() { return tree; }
4641 };
4642
4643 // $ANTLR start "variantSpecifier"
4644 // CTFParser.g:572:1: variantSpecifier : VARIANTTOK ( ( variantName ( ( variantTag ( variantBody | ) ) | variantBody ) ) | ( variantTag variantBody ) | variantBody ) -> ^( VARIANT ( variantName )? ( variantTag )? ( variantBody )? ) ;
4645 public final CTFParser.variantSpecifier_return variantSpecifier() throws RecognitionException {
4646 CTFParser.variantSpecifier_return retval = new CTFParser.variantSpecifier_return();
4647 retval.start = input.LT(1);
4648
4649 CommonTree root_0 = null;
4650
4651 Token VARIANTTOK89=null;
4652 CTFParser.variantName_return variantName90 = null;
4653
4654 CTFParser.variantTag_return variantTag91 = null;
4655
4656 CTFParser.variantBody_return variantBody92 = null;
4657
4658 CTFParser.variantBody_return variantBody93 = null;
4659
4660 CTFParser.variantTag_return variantTag94 = null;
4661
4662 CTFParser.variantBody_return variantBody95 = null;
4663
4664 CTFParser.variantBody_return variantBody96 = null;
4665
4666
4667 CommonTree VARIANTTOK89_tree=null;
4668 RewriteRuleTokenStream stream_VARIANTTOK=new RewriteRuleTokenStream(adaptor,"token VARIANTTOK");
4669 RewriteRuleSubtreeStream stream_variantName=new RewriteRuleSubtreeStream(adaptor,"rule variantName");
4670 RewriteRuleSubtreeStream stream_variantTag=new RewriteRuleSubtreeStream(adaptor,"rule variantTag");
4671 RewriteRuleSubtreeStream stream_variantBody=new RewriteRuleSubtreeStream(adaptor,"rule variantBody");
4672
4673 enter("variantSpecifier");
4674
4675 try {
4676 // CTFParser.g:579:1: ( VARIANTTOK ( ( variantName ( ( variantTag ( variantBody | ) ) | variantBody ) ) | ( variantTag variantBody ) | variantBody ) -> ^( VARIANT ( variantName )? ( variantTag )? ( variantBody )? ) )
4677 // CTFParser.g:580:3: VARIANTTOK ( ( variantName ( ( variantTag ( variantBody | ) ) | variantBody ) ) | ( variantTag variantBody ) | variantBody )
4678 {
4679 VARIANTTOK89=(Token)match(input,VARIANTTOK,FOLLOW_VARIANTTOK_in_variantSpecifier1901); if (state.failed) {
4680 return retval;
4681 }
4682 if ( state.backtracking==0 ) {
4683 stream_VARIANTTOK.add(VARIANTTOK89);
4684 }
4685
4686 // CTFParser.g:581:3: ( ( variantName ( ( variantTag ( variantBody | ) ) | variantBody ) ) | ( variantTag variantBody ) | variantBody )
4687 int alt31=3;
4688 switch ( input.LA(1) ) {
4689 case IDENTIFIER:
4690 {
4691 alt31=1;
4692 }
4693 break;
4694 case LT:
4695 {
4696 alt31=2;
4697 }
4698 break;
4699 case LCURL:
4700 {
4701 alt31=3;
4702 }
4703 break;
4704 default:
4705 if (state.backtracking>0) {state.failed=true; return retval;}
4706 NoViableAltException nvae =
4707 new NoViableAltException("", 31, 0, input);
4708
4709 throw nvae;
4710 }
4711
4712 switch (alt31) {
4713 case 1 :
4714 // CTFParser.g:582:5: ( variantName ( ( variantTag ( variantBody | ) ) | variantBody ) )
4715 {
4716 // CTFParser.g:582:5: ( variantName ( ( variantTag ( variantBody | ) ) | variantBody ) )
4717 // CTFParser.g:583:7: variantName ( ( variantTag ( variantBody | ) ) | variantBody )
4718 {
4719 pushFollow(FOLLOW_variantName_in_variantSpecifier1919);
4720 variantName90=variantName();
4721
4722 state._fsp--;
4723 if (state.failed) {
4724 return retval;
4725 }
4726 if ( state.backtracking==0 ) {
4727 stream_variantName.add(variantName90.getTree());
4728 }
4729 // CTFParser.g:584:7: ( ( variantTag ( variantBody | ) ) | variantBody )
4730 int alt30=2;
4731 int LA30_0 = input.LA(1);
4732
4733 if ( (LA30_0==LT) ) {
4734 alt30=1;
4735 }
4736 else if ( (LA30_0==LCURL) ) {
4737 alt30=2;
4738 }
4739 else {
4740 if (state.backtracking>0) {state.failed=true; return retval;}
4741 NoViableAltException nvae =
4742 new NoViableAltException("", 30, 0, input);
4743
4744 throw nvae;
4745 }
4746 switch (alt30) {
4747 case 1 :
4748 // CTFParser.g:585:9: ( variantTag ( variantBody | ) )
4749 {
4750 // CTFParser.g:585:9: ( variantTag ( variantBody | ) )
4751 // CTFParser.g:586:11: variantTag ( variantBody | )
4752 {
4753 pushFollow(FOLLOW_variantTag_in_variantSpecifier1950);
4754 variantTag91=variantTag();
4755
4756 state._fsp--;
4757 if (state.failed) {
4758 return retval;
4759 }
4760 if ( state.backtracking==0 ) {
4761 stream_variantTag.add(variantTag91.getTree());
4762 }
4763 // CTFParser.g:587:11: ( variantBody | )
4764 int alt29=2;
4765 int LA29_0 = input.LA(1);
4766
4767 if ( (LA29_0==LCURL) ) {
4768 switch ( input.LA(2) ) {
4769 case CONSTTOK:
4770 case CHARTOK:
4771 case DOUBLETOK:
4772 case ENUMTOK:
4773 case FLOATINGPOINTTOK:
4774 case FLOATTOK:
4775 case INTEGERTOK:
4776 case INTTOK:
4777 case LONGTOK:
4778 case SHORTTOK:
4779 case STRUCTTOK:
4780 case TYPEALIASTOK:
4781 case TYPEDEFTOK:
4782 case UNSIGNEDTOK:
4783 case VARIANTTOK:
4784 case VOIDTOK:
4785 case BOOLTOK:
4786 case COMPLEXTOK:
4787 case IMAGINARYTOK:
4788 {
4789 alt29=1;
4790 }
4791 break;
4792 case SIGNEDTOK:
4793 {
4794 int LA29_4 = input.LA(3);
4795
4796 if ( ((LA29_4>=CONSTTOK && LA29_4<=ENUMTOK)||(LA29_4>=FLOATINGPOINTTOK && LA29_4<=SIGNEDTOK)||(LA29_4>=STRINGTOK && LA29_4<=STRUCTTOK)||(LA29_4>=TYPEDEFTOK && LA29_4<=IMAGINARYTOK)||LA29_4==POINTER||LA29_4==IDENTIFIER) ) {
4797 alt29=1;
4798 }
4799 else if ( (LA29_4==SEPARATOR||LA29_4==ASSIGNMENT||LA29_4==RCURL) ) {
4800 alt29=2;
4801 }
4802 else {
4803 if (state.backtracking>0) {state.failed=true; return retval;}
4804 NoViableAltException nvae =
4805 new NoViableAltException("", 29, 4, input);
4806
4807 throw nvae;
4808 }
4809 }
4810 break;
4811 case STRINGTOK:
4812 {
4813 int LA29_5 = input.LA(3);
4814
4815 if ( ((LA29_5>=CONSTTOK && LA29_5<=ENUMTOK)||(LA29_5>=FLOATINGPOINTTOK && LA29_5<=SIGNEDTOK)||(LA29_5>=STRINGTOK && LA29_5<=STRUCTTOK)||(LA29_5>=TYPEDEFTOK && LA29_5<=IMAGINARYTOK)||LA29_5==LCURL||LA29_5==POINTER||LA29_5==IDENTIFIER) ) {
4816 alt29=1;
4817 }
4818 else if ( (LA29_5==SEPARATOR||LA29_5==ASSIGNMENT||LA29_5==RCURL) ) {
4819 alt29=2;
4820 }
4821 else {
4822 if (state.backtracking>0) {state.failed=true; return retval;}
4823 NoViableAltException nvae =
4824 new NoViableAltException("", 29, 5, input);
4825
4826 throw nvae;
4827 }
4828 }
4829 break;
4830 case IDENTIFIER:
4831 {
4832 int LA29_6 = input.LA(3);
4833
4834 if ( (LA29_6==SEPARATOR||LA29_6==ASSIGNMENT||LA29_6==RCURL) ) {
4835 alt29=2;
4836 }
4837 else if ( ((LA29_6>=CONSTTOK && LA29_6<=ENUMTOK)||(LA29_6>=FLOATINGPOINTTOK && LA29_6<=SIGNEDTOK)||(LA29_6>=STRINGTOK && LA29_6<=STRUCTTOK)||(LA29_6>=TYPEDEFTOK && LA29_6<=IMAGINARYTOK)||LA29_6==POINTER||LA29_6==IDENTIFIER) ) {
4838 alt29=1;
4839 }
4840 else {
4841 if (state.backtracking>0) {state.failed=true; return retval;}
4842 NoViableAltException nvae =
4843 new NoViableAltException("", 29, 6, input);
4844
4845 throw nvae;
4846 }
4847 }
4848 break;
4849 case ALIGNTOK:
4850 case EVENTTOK:
4851 case STRING_LITERAL:
4852 {
4853 alt29=2;
4854 }
4855 break;
4856 default:
4857 if (state.backtracking>0) {state.failed=true; return retval;}
4858 NoViableAltException nvae =
4859 new NoViableAltException("", 29, 1, input);
4860
4861 throw nvae;
4862 }
4863
4864 }
4865 else if ( (LA29_0==EOF||(LA29_0>=CONSTTOK && LA29_0<=ENUMTOK)||(LA29_0>=FLOATINGPOINTTOK && LA29_0<=SIGNEDTOK)||(LA29_0>=STRINGTOK && LA29_0<=STRUCTTOK)||(LA29_0>=TYPEDEFTOK && LA29_0<=IMAGINARYTOK)||LA29_0==TYPE_ASSIGNMENT||LA29_0==LPAREN||(LA29_0>=TERM && LA29_0<=POINTER)||LA29_0==IDENTIFIER) ) {
4866 alt29=2;
4867 }
4868 else {
4869 if (state.backtracking>0) {state.failed=true; return retval;}
4870 NoViableAltException nvae =
4871 new NoViableAltException("", 29, 0, input);
4872
4873 throw nvae;
4874 }
4875 switch (alt29) {
4876 case 1 :
4877 // CTFParser.g:588:13: variantBody
4878 {
4879 pushFollow(FOLLOW_variantBody_in_variantSpecifier1976);
4880 variantBody92=variantBody();
4881
4882 state._fsp--;
4883 if (state.failed) {
4884 return retval;
4885 }
4886 if ( state.backtracking==0 ) {
4887 stream_variantBody.add(variantBody92.getTree());
4888 }
4889
4890 }
4891 break;
4892 case 2 :
4893 // CTFParser.g:591:11:
4894 {
4895 }
4896 break;
4897
4898 }
4899
4900
4901 }
4902
4903
4904 }
4905 break;
4906 case 2 :
4907 // CTFParser.g:594:9: variantBody
4908 {
4909 pushFollow(FOLLOW_variantBody_in_variantSpecifier2044);
4910 variantBody93=variantBody();
4911
4912 state._fsp--;
4913 if (state.failed) {
4914 return retval;
4915 }
4916 if ( state.backtracking==0 ) {
4917 stream_variantBody.add(variantBody93.getTree());
4918 }
4919
4920 }
4921 break;
4922
4923 }
4924
4925
4926 }
4927
4928
4929 }
4930 break;
4931 case 2 :
4932 // CTFParser.g:598:5: ( variantTag variantBody )
4933 {
4934 // CTFParser.g:598:5: ( variantTag variantBody )
4935 // CTFParser.g:598:6: variantTag variantBody
4936 {
4937 pushFollow(FOLLOW_variantTag_in_variantSpecifier2069);
4938 variantTag94=variantTag();
4939
4940 state._fsp--;
4941 if (state.failed) {
4942 return retval;
4943 }
4944 if ( state.backtracking==0 ) {
4945 stream_variantTag.add(variantTag94.getTree());
4946 }
4947 pushFollow(FOLLOW_variantBody_in_variantSpecifier2071);
4948 variantBody95=variantBody();
4949
4950 state._fsp--;
4951 if (state.failed) {
4952 return retval;
4953 }
4954 if ( state.backtracking==0 ) {
4955 stream_variantBody.add(variantBody95.getTree());
4956 }
4957
4958 }
4959
4960
4961 }
4962 break;
4963 case 3 :
4964 // CTFParser.g:600:5: variantBody
4965 {
4966 pushFollow(FOLLOW_variantBody_in_variantSpecifier2082);
4967 variantBody96=variantBody();
4968
4969 state._fsp--;
4970 if (state.failed) {
4971 return retval;
4972 }
4973 if ( state.backtracking==0 ) {
4974 stream_variantBody.add(variantBody96.getTree());
4975 }
4976
4977 }
4978 break;
4979
4980 }
4981
4982
4983
4984 // AST REWRITE
4985 // elements: variantTag, variantName, variantBody
4986 // token labels:
4987 // rule labels: retval
4988 // token list labels:
4989 // rule list labels:
4990 // wildcard labels:
4991 if ( state.backtracking==0 ) {
4992 retval.tree = root_0;
4993 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
4994
4995 root_0 = (CommonTree)adaptor.nil();
4996 // 601:5: -> ^( VARIANT ( variantName )? ( variantTag )? ( variantBody )? )
4997 {
4998 // CTFParser.g:601:8: ^( VARIANT ( variantName )? ( variantTag )? ( variantBody )? )
4999 {
5000 CommonTree root_1 = (CommonTree)adaptor.nil();
5001 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(VARIANT, "VARIANT"), root_1);
5002
5003 // CTFParser.g:601:18: ( variantName )?
5004 if ( stream_variantName.hasNext() ) {
5005 adaptor.addChild(root_1, stream_variantName.nextTree());
5006
5007 }
5008 stream_variantName.reset();
5009 // CTFParser.g:601:31: ( variantTag )?
5010 if ( stream_variantTag.hasNext() ) {
5011 adaptor.addChild(root_1, stream_variantTag.nextTree());
5012
5013 }
5014 stream_variantTag.reset();
5015 // CTFParser.g:601:43: ( variantBody )?
5016 if ( stream_variantBody.hasNext() ) {
5017 adaptor.addChild(root_1, stream_variantBody.nextTree());
5018
5019 }
5020 stream_variantBody.reset();
5021
5022 adaptor.addChild(root_0, root_1);
5023 }
5024
5025 }
5026
5027 retval.tree = root_0;}
5028 }
5029
5030 retval.stop = input.LT(-1);
5031
5032 if ( state.backtracking==0 ) {
5033
5034 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
5035 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
5036 }
5037 if ( state.backtracking==0 ) {
5038
5039 exit("variantSpecifier");
5040
5041 }
5042 }
5043
5044 catch (RecognitionException e)
5045 {
5046 throw e;
5047 }
5048 finally {
5049 }
5050 return retval;
5051 }
5052 // $ANTLR end "variantSpecifier"
5053
5054 public static class variantName_return extends ParserRuleReturnScope {
5055 CommonTree tree;
5056 public Object getTree() { return tree; }
5057 };
5058
5059 // $ANTLR start "variantName"
5060 // CTFParser.g:604:1: variantName : IDENTIFIER -> ^( VARIANT_NAME IDENTIFIER ) ;
5061 public final CTFParser.variantName_return variantName() throws RecognitionException {
5062 CTFParser.variantName_return retval = new CTFParser.variantName_return();
5063 retval.start = input.LT(1);
5064
5065 CommonTree root_0 = null;
5066
5067 Token IDENTIFIER97=null;
5068
5069 CommonTree IDENTIFIER97_tree=null;
5070 RewriteRuleTokenStream stream_IDENTIFIER=new RewriteRuleTokenStream(adaptor,"token IDENTIFIER");
5071
5072
5073 enter("variantName");
5074
5075 try {
5076 // CTFParser.g:612:1: ( IDENTIFIER -> ^( VARIANT_NAME IDENTIFIER ) )
5077 // CTFParser.g:613:3: IDENTIFIER
5078 {
5079 IDENTIFIER97=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_variantName2124); if (state.failed) {
5080 return retval;
5081 }
5082 if ( state.backtracking==0 ) {
5083 stream_IDENTIFIER.add(IDENTIFIER97);
5084 }
5085
5086
5087
5088 // AST REWRITE
5089 // elements: IDENTIFIER
5090 // token labels:
5091 // rule labels: retval
5092 // token list labels:
5093 // rule list labels:
5094 // wildcard labels:
5095 if ( state.backtracking==0 ) {
5096 retval.tree = root_0;
5097 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
5098
5099 root_0 = (CommonTree)adaptor.nil();
5100 // 613:14: -> ^( VARIANT_NAME IDENTIFIER )
5101 {
5102 // CTFParser.g:613:17: ^( VARIANT_NAME IDENTIFIER )
5103 {
5104 CommonTree root_1 = (CommonTree)adaptor.nil();
5105 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(VARIANT_NAME, "VARIANT_NAME"), root_1);
5106
5107 adaptor.addChild(root_1, stream_IDENTIFIER.nextNode());
5108
5109 adaptor.addChild(root_0, root_1);
5110 }
5111
5112 }
5113
5114 retval.tree = root_0;}
5115 }
5116
5117 retval.stop = input.LT(-1);
5118
5119 if ( state.backtracking==0 ) {
5120
5121 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
5122 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
5123 }
5124 if ( state.backtracking==0 ) {
5125
5126 debug_print(input.toString(retval.start,input.LT(-1)));
5127 exit("variantName");
5128
5129 }
5130 }
5131
5132 catch (RecognitionException e)
5133 {
5134 throw e;
5135 }
5136 finally {
5137 }
5138 return retval;
5139 }
5140 // $ANTLR end "variantName"
5141
5142 public static class variantBody_return extends ParserRuleReturnScope {
5143 CommonTree tree;
5144 public Object getTree() { return tree; }
5145 };
5146
5147 // $ANTLR start "variantBody"
5148 // CTFParser.g:616:1: variantBody : LCURL structOrVariantDeclarationList RCURL -> ^( VARIANT_BODY structOrVariantDeclarationList ) ;
5149 public final CTFParser.variantBody_return variantBody() throws RecognitionException {
5150 Symbols_stack.push(new Symbols_scope());
5151
5152 CTFParser.variantBody_return retval = new CTFParser.variantBody_return();
5153 retval.start = input.LT(1);
5154
5155 CommonTree root_0 = null;
5156
5157 Token LCURL98=null;
5158 Token RCURL100=null;
5159 CTFParser.structOrVariantDeclarationList_return structOrVariantDeclarationList99 = null;
5160
5161
5162 CommonTree LCURL98_tree=null;
5163 CommonTree RCURL100_tree=null;
5164 RewriteRuleTokenStream stream_LCURL=new RewriteRuleTokenStream(adaptor,"token LCURL");
5165 RewriteRuleTokenStream stream_RCURL=new RewriteRuleTokenStream(adaptor,"token RCURL");
5166 RewriteRuleSubtreeStream stream_structOrVariantDeclarationList=new RewriteRuleSubtreeStream(adaptor,"rule structOrVariantDeclarationList");
5167
5168 enter("variantBody");
5169 debug_print("Scope push " + Symbols_stack.size());
5170 ((Symbols_scope)Symbols_stack.peek()).types = new HashSet<String>();
5171
5172 try {
5173 // CTFParser.g:627:1: ( LCURL structOrVariantDeclarationList RCURL -> ^( VARIANT_BODY structOrVariantDeclarationList ) )
5174 // CTFParser.g:628:3: LCURL structOrVariantDeclarationList RCURL
5175 {
5176 LCURL98=(Token)match(input,LCURL,FOLLOW_LCURL_in_variantBody2160); if (state.failed) {
5177 return retval;
5178 }
5179 if ( state.backtracking==0 ) {
5180 stream_LCURL.add(LCURL98);
5181 }
5182
5183 pushFollow(FOLLOW_structOrVariantDeclarationList_in_variantBody2162);
5184 structOrVariantDeclarationList99=structOrVariantDeclarationList();
5185
5186 state._fsp--;
5187 if (state.failed) {
5188 return retval;
5189 }
5190 if ( state.backtracking==0 ) {
5191 stream_structOrVariantDeclarationList.add(structOrVariantDeclarationList99.getTree());
5192 }
5193 RCURL100=(Token)match(input,RCURL,FOLLOW_RCURL_in_variantBody2164); if (state.failed) {
5194 return retval;
5195 }
5196 if ( state.backtracking==0 ) {
5197 stream_RCURL.add(RCURL100);
5198 }
5199
5200
5201
5202 // AST REWRITE
5203 // elements: structOrVariantDeclarationList
5204 // token labels:
5205 // rule labels: retval
5206 // token list labels:
5207 // rule list labels:
5208 // wildcard labels:
5209 if ( state.backtracking==0 ) {
5210 retval.tree = root_0;
5211 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
5212
5213 root_0 = (CommonTree)adaptor.nil();
5214 // 628:46: -> ^( VARIANT_BODY structOrVariantDeclarationList )
5215 {
5216 // CTFParser.g:628:49: ^( VARIANT_BODY structOrVariantDeclarationList )
5217 {
5218 CommonTree root_1 = (CommonTree)adaptor.nil();
5219 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(VARIANT_BODY, "VARIANT_BODY"), root_1);
5220
5221 adaptor.addChild(root_1, stream_structOrVariantDeclarationList.nextTree());
5222
5223 adaptor.addChild(root_0, root_1);
5224 }
5225
5226 }
5227
5228 retval.tree = root_0;}
5229 }
5230
5231 retval.stop = input.LT(-1);
5232
5233 if ( state.backtracking==0 ) {
5234
5235 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
5236 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
5237 }
5238 if ( state.backtracking==0 ) {
5239
5240 debug_print("Scope pop " + Symbols_stack.size());
5241 exit("variantBody");
5242
5243 }
5244 }
5245
5246 catch (RecognitionException e)
5247 {
5248 throw e;
5249 }
5250 finally {
5251 Symbols_stack.pop();
5252
5253 }
5254 return retval;
5255 }
5256 // $ANTLR end "variantBody"
5257
5258 public static class variantTag_return extends ParserRuleReturnScope {
5259 CommonTree tree;
5260 public Object getTree() { return tree; }
5261 };
5262
5263 // $ANTLR start "variantTag"
5264 // CTFParser.g:631:1: variantTag : LT IDENTIFIER GT -> ^( VARIANT_TAG IDENTIFIER ) ;
5265 public final CTFParser.variantTag_return variantTag() throws RecognitionException {
5266 CTFParser.variantTag_return retval = new CTFParser.variantTag_return();
5267 retval.start = input.LT(1);
5268
5269 CommonTree root_0 = null;
5270
5271 Token LT101=null;
5272 Token IDENTIFIER102=null;
5273 Token GT103=null;
5274
5275 CommonTree LT101_tree=null;
5276 CommonTree IDENTIFIER102_tree=null;
5277 CommonTree GT103_tree=null;
5278 RewriteRuleTokenStream stream_GT=new RewriteRuleTokenStream(adaptor,"token GT");
5279 RewriteRuleTokenStream stream_LT=new RewriteRuleTokenStream(adaptor,"token LT");
5280 RewriteRuleTokenStream stream_IDENTIFIER=new RewriteRuleTokenStream(adaptor,"token IDENTIFIER");
5281
5282
5283 enter("variantTag");
5284
5285 try {
5286 // CTFParser.g:639:1: ( LT IDENTIFIER GT -> ^( VARIANT_TAG IDENTIFIER ) )
5287 // CTFParser.g:640:3: LT IDENTIFIER GT
5288 {
5289 LT101=(Token)match(input,LT,FOLLOW_LT_in_variantTag2195); if (state.failed) {
5290 return retval;
5291 }
5292 if ( state.backtracking==0 ) {
5293 stream_LT.add(LT101);
5294 }
5295
5296 IDENTIFIER102=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_variantTag2197); if (state.failed) {
5297 return retval;
5298 }
5299 if ( state.backtracking==0 ) {
5300 stream_IDENTIFIER.add(IDENTIFIER102);
5301 }
5302
5303 GT103=(Token)match(input,GT,FOLLOW_GT_in_variantTag2199); if (state.failed) {
5304 return retval;
5305 }
5306 if ( state.backtracking==0 ) {
5307 stream_GT.add(GT103);
5308 }
5309
5310
5311
5312 // AST REWRITE
5313 // elements: IDENTIFIER
5314 // token labels:
5315 // rule labels: retval
5316 // token list labels:
5317 // rule list labels:
5318 // wildcard labels:
5319 if ( state.backtracking==0 ) {
5320 retval.tree = root_0;
5321 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
5322
5323 root_0 = (CommonTree)adaptor.nil();
5324 // 640:20: -> ^( VARIANT_TAG IDENTIFIER )
5325 {
5326 // CTFParser.g:640:23: ^( VARIANT_TAG IDENTIFIER )
5327 {
5328 CommonTree root_1 = (CommonTree)adaptor.nil();
5329 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(VARIANT_TAG, "VARIANT_TAG"), root_1);
5330
5331 adaptor.addChild(root_1, stream_IDENTIFIER.nextNode());
5332
5333 adaptor.addChild(root_0, root_1);
5334 }
5335
5336 }
5337
5338 retval.tree = root_0;}
5339 }
5340
5341 retval.stop = input.LT(-1);
5342
5343 if ( state.backtracking==0 ) {
5344
5345 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
5346 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
5347 }
5348 if ( state.backtracking==0 ) {
5349
5350 debug_print(input.toString(retval.start,input.LT(-1)));
5351 exit("variantTag");
5352
5353 }
5354 }
5355
5356 catch (RecognitionException e)
5357 {
5358 throw e;
5359 }
5360 finally {
5361 }
5362 return retval;
5363 }
5364 // $ANTLR end "variantTag"
5365
5366 public static class enumSpecifier_return extends ParserRuleReturnScope {
5367 CommonTree tree;
5368 public Object getTree() { return tree; }
5369 };
5370
5371 // $ANTLR start "enumSpecifier"
5372 // CTFParser.g:643:1: enumSpecifier : ENUMTOK ( ( enumName ( enumContainerType enumBody | enumBody | ) ) | ( enumContainerType enumBody | enumBody ) ) -> ^( ENUM ( enumName )? ( enumContainerType )? ( enumBody )? ) ;
5373 public final CTFParser.enumSpecifier_return enumSpecifier() throws RecognitionException {
5374 CTFParser.enumSpecifier_return retval = new CTFParser.enumSpecifier_return();
5375 retval.start = input.LT(1);
5376
5377 CommonTree root_0 = null;
5378
5379 Token ENUMTOK104=null;
5380 CTFParser.enumName_return enumName105 = null;
5381
5382 CTFParser.enumContainerType_return enumContainerType106 = null;
5383
5384 CTFParser.enumBody_return enumBody107 = null;
5385
5386 CTFParser.enumBody_return enumBody108 = null;
5387
5388 CTFParser.enumContainerType_return enumContainerType109 = null;
5389
5390 CTFParser.enumBody_return enumBody110 = null;
5391
5392 CTFParser.enumBody_return enumBody111 = null;
5393
5394
5395 CommonTree ENUMTOK104_tree=null;
5396 RewriteRuleTokenStream stream_ENUMTOK=new RewriteRuleTokenStream(adaptor,"token ENUMTOK");
5397 RewriteRuleSubtreeStream stream_enumName=new RewriteRuleSubtreeStream(adaptor,"rule enumName");
5398 RewriteRuleSubtreeStream stream_enumContainerType=new RewriteRuleSubtreeStream(adaptor,"rule enumContainerType");
5399 RewriteRuleSubtreeStream stream_enumBody=new RewriteRuleSubtreeStream(adaptor,"rule enumBody");
5400
5401 enter("enumSpecifier");
5402
5403 try {
5404 // CTFParser.g:650:1: ( ENUMTOK ( ( enumName ( enumContainerType enumBody | enumBody | ) ) | ( enumContainerType enumBody | enumBody ) ) -> ^( ENUM ( enumName )? ( enumContainerType )? ( enumBody )? ) )
5405 // CTFParser.g:651:2: ENUMTOK ( ( enumName ( enumContainerType enumBody | enumBody | ) ) | ( enumContainerType enumBody | enumBody ) )
5406 {
5407 ENUMTOK104=(Token)match(input,ENUMTOK,FOLLOW_ENUMTOK_in_enumSpecifier2229); if (state.failed) {
5408 return retval;
5409 }
5410 if ( state.backtracking==0 ) {
5411 stream_ENUMTOK.add(ENUMTOK104);
5412 }
5413
5414 // CTFParser.g:652:2: ( ( enumName ( enumContainerType enumBody | enumBody | ) ) | ( enumContainerType enumBody | enumBody ) )
5415 int alt34=2;
5416 int LA34_0 = input.LA(1);
5417
5418 if ( (LA34_0==IDENTIFIER) ) {
5419 alt34=1;
5420 }
5421 else if ( (LA34_0==COLON||LA34_0==LCURL) ) {
5422 alt34=2;
5423 }
5424 else {
5425 if (state.backtracking>0) {state.failed=true; return retval;}
5426 NoViableAltException nvae =
5427 new NoViableAltException("", 34, 0, input);
5428
5429 throw nvae;
5430 }
5431 switch (alt34) {
5432 case 1 :
5433 // CTFParser.g:654:3: ( enumName ( enumContainerType enumBody | enumBody | ) )
5434 {
5435 // CTFParser.g:654:3: ( enumName ( enumContainerType enumBody | enumBody | ) )
5436 // CTFParser.g:655:4: enumName ( enumContainerType enumBody | enumBody | )
5437 {
5438 pushFollow(FOLLOW_enumName_in_enumSpecifier2244);
5439 enumName105=enumName();
5440
5441 state._fsp--;
5442 if (state.failed) {
5443 return retval;
5444 }
5445 if ( state.backtracking==0 ) {
5446 stream_enumName.add(enumName105.getTree());
5447 }
5448 // CTFParser.g:656:4: ( enumContainerType enumBody | enumBody | )
5449 int alt32=3;
5450 alt32 = dfa32.predict(input);
5451 switch (alt32) {
5452 case 1 :
5453 // CTFParser.g:657:5: enumContainerType enumBody
5454 {
5455 pushFollow(FOLLOW_enumContainerType_in_enumSpecifier2255);
5456 enumContainerType106=enumContainerType();
5457
5458 state._fsp--;
5459 if (state.failed) {
5460 return retval;
5461 }
5462 if ( state.backtracking==0 ) {
5463 stream_enumContainerType.add(enumContainerType106.getTree());
5464 }
5465 pushFollow(FOLLOW_enumBody_in_enumSpecifier2257);
5466 enumBody107=enumBody();
5467
5468 state._fsp--;
5469 if (state.failed) {
5470 return retval;
5471 }
5472 if ( state.backtracking==0 ) {
5473 stream_enumBody.add(enumBody107.getTree());
5474 }
5475
5476 }
5477 break;
5478 case 2 :
5479 // CTFParser.g:659:5: enumBody
5480 {
5481 pushFollow(FOLLOW_enumBody_in_enumSpecifier2269);
5482 enumBody108=enumBody();
5483
5484 state._fsp--;
5485 if (state.failed) {
5486 return retval;
5487 }
5488 if ( state.backtracking==0 ) {
5489 stream_enumBody.add(enumBody108.getTree());
5490 }
5491
5492 }
5493 break;
5494 case 3 :
5495 // CTFParser.g:662:4:
5496 {
5497 }
5498 break;
5499
5500 }
5501
5502
5503 }
5504
5505
5506 }
5507 break;
5508 case 2 :
5509 // CTFParser.g:666:3: ( enumContainerType enumBody | enumBody )
5510 {
5511 // CTFParser.g:666:3: ( enumContainerType enumBody | enumBody )
5512 int alt33=2;
5513 int LA33_0 = input.LA(1);
5514
5515 if ( (LA33_0==COLON) ) {
5516 alt33=1;
5517 }
5518 else if ( (LA33_0==LCURL) ) {
5519 alt33=2;
5520 }
5521 else {
5522 if (state.backtracking>0) {state.failed=true; return retval;}
5523 NoViableAltException nvae =
5524 new NoViableAltException("", 33, 0, input);
5525
5526 throw nvae;
5527 }
5528 switch (alt33) {
5529 case 1 :
5530 // CTFParser.g:667:4: enumContainerType enumBody
5531 {
5532 pushFollow(FOLLOW_enumContainerType_in_enumSpecifier2304);
5533 enumContainerType109=enumContainerType();
5534
5535 state._fsp--;
5536 if (state.failed) {
5537 return retval;
5538 }
5539 if ( state.backtracking==0 ) {
5540 stream_enumContainerType.add(enumContainerType109.getTree());
5541 }
5542 pushFollow(FOLLOW_enumBody_in_enumSpecifier2306);
5543 enumBody110=enumBody();
5544
5545 state._fsp--;
5546 if (state.failed) {
5547 return retval;
5548 }
5549 if ( state.backtracking==0 ) {
5550 stream_enumBody.add(enumBody110.getTree());
5551 }
5552
5553 }
5554 break;
5555 case 2 :
5556 // CTFParser.g:669:4: enumBody
5557 {
5558 pushFollow(FOLLOW_enumBody_in_enumSpecifier2315);
5559 enumBody111=enumBody();
5560
5561 state._fsp--;
5562 if (state.failed) {
5563 return retval;
5564 }
5565 if ( state.backtracking==0 ) {
5566 stream_enumBody.add(enumBody111.getTree());
5567 }
5568
5569 }
5570 break;
5571
5572 }
5573
5574
5575 }
5576 break;
5577
5578 }
5579
5580
5581
5582 // AST REWRITE
5583 // elements: enumBody, enumContainerType, enumName
5584 // token labels:
5585 // rule labels: retval
5586 // token list labels:
5587 // rule list labels:
5588 // wildcard labels:
5589 if ( state.backtracking==0 ) {
5590 retval.tree = root_0;
5591 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
5592
5593 root_0 = (CommonTree)adaptor.nil();
5594 // 671:4: -> ^( ENUM ( enumName )? ( enumContainerType )? ( enumBody )? )
5595 {
5596 // CTFParser.g:671:7: ^( ENUM ( enumName )? ( enumContainerType )? ( enumBody )? )
5597 {
5598 CommonTree root_1 = (CommonTree)adaptor.nil();
5599 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ENUM, "ENUM"), root_1);
5600
5601 // CTFParser.g:671:14: ( enumName )?
5602 if ( stream_enumName.hasNext() ) {
5603 adaptor.addChild(root_1, stream_enumName.nextTree());
5604
5605 }
5606 stream_enumName.reset();
5607 // CTFParser.g:671:24: ( enumContainerType )?
5608 if ( stream_enumContainerType.hasNext() ) {
5609 adaptor.addChild(root_1, stream_enumContainerType.nextTree());
5610
5611 }
5612 stream_enumContainerType.reset();
5613 // CTFParser.g:671:43: ( enumBody )?
5614 if ( stream_enumBody.hasNext() ) {
5615 adaptor.addChild(root_1, stream_enumBody.nextTree());
5616
5617 }
5618 stream_enumBody.reset();
5619
5620 adaptor.addChild(root_0, root_1);
5621 }
5622
5623 }
5624
5625 retval.tree = root_0;}
5626 }
5627
5628 retval.stop = input.LT(-1);
5629
5630 if ( state.backtracking==0 ) {
5631
5632 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
5633 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
5634 }
5635 if ( state.backtracking==0 ) {
5636
5637 exit("enumSpecifier");
5638
5639 }
5640 }
5641
5642 catch (RecognitionException e)
5643 {
5644 throw e;
5645 }
5646 finally {
5647 }
5648 return retval;
5649 }
5650 // $ANTLR end "enumSpecifier"
5651
5652 public static class enumName_return extends ParserRuleReturnScope {
5653 CommonTree tree;
5654 public Object getTree() { return tree; }
5655 };
5656
5657 // $ANTLR start "enumName"
5658 // CTFParser.g:674:1: enumName : IDENTIFIER -> ^( ENUM_NAME IDENTIFIER ) ;
5659 public final CTFParser.enumName_return enumName() throws RecognitionException {
5660 CTFParser.enumName_return retval = new CTFParser.enumName_return();
5661 retval.start = input.LT(1);
5662
5663 CommonTree root_0 = null;
5664
5665 Token IDENTIFIER112=null;
5666
5667 CommonTree IDENTIFIER112_tree=null;
5668 RewriteRuleTokenStream stream_IDENTIFIER=new RewriteRuleTokenStream(adaptor,"token IDENTIFIER");
5669
5670
5671 enter("enumName");
5672
5673 try {
5674 // CTFParser.g:682:1: ( IDENTIFIER -> ^( ENUM_NAME IDENTIFIER ) )
5675 // CTFParser.g:683:3: IDENTIFIER
5676 {
5677 IDENTIFIER112=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_enumName2360); if (state.failed) {
5678 return retval;
5679 }
5680 if ( state.backtracking==0 ) {
5681 stream_IDENTIFIER.add(IDENTIFIER112);
5682 }
5683
5684
5685
5686 // AST REWRITE
5687 // elements: IDENTIFIER
5688 // token labels:
5689 // rule labels: retval
5690 // token list labels:
5691 // rule list labels:
5692 // wildcard labels:
5693 if ( state.backtracking==0 ) {
5694 retval.tree = root_0;
5695 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
5696
5697 root_0 = (CommonTree)adaptor.nil();
5698 // 683:14: -> ^( ENUM_NAME IDENTIFIER )
5699 {
5700 // CTFParser.g:683:17: ^( ENUM_NAME IDENTIFIER )
5701 {
5702 CommonTree root_1 = (CommonTree)adaptor.nil();
5703 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ENUM_NAME, "ENUM_NAME"), root_1);
5704
5705 adaptor.addChild(root_1, stream_IDENTIFIER.nextNode());
5706
5707 adaptor.addChild(root_0, root_1);
5708 }
5709
5710 }
5711
5712 retval.tree = root_0;}
5713 }
5714
5715 retval.stop = input.LT(-1);
5716
5717 if ( state.backtracking==0 ) {
5718
5719 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
5720 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
5721 }
5722 if ( state.backtracking==0 ) {
5723
5724 debug_print(input.toString(retval.start,input.LT(-1)));
5725 exit("enumName");
5726
5727 }
5728 }
5729
5730 catch (RecognitionException e)
5731 {
5732 throw e;
5733 }
5734 finally {
5735 }
5736 return retval;
5737 }
5738 // $ANTLR end "enumName"
5739
5740 public static class enumBody_return extends ParserRuleReturnScope {
5741 CommonTree tree;
5742 public Object getTree() { return tree; }
5743 };
5744
5745 // $ANTLR start "enumBody"
5746 // CTFParser.g:686:1: enumBody : LCURL enumeratorList ( SEPARATOR RCURL | RCURL ) -> ^( ENUM_BODY enumeratorList ) ;
5747 public final CTFParser.enumBody_return enumBody() throws RecognitionException {
5748 CTFParser.enumBody_return retval = new CTFParser.enumBody_return();
5749 retval.start = input.LT(1);
5750
5751 CommonTree root_0 = null;
5752
5753 Token LCURL113=null;
5754 Token SEPARATOR115=null;
5755 Token RCURL116=null;
5756 Token RCURL117=null;
5757 CTFParser.enumeratorList_return enumeratorList114 = null;
5758
5759
5760 CommonTree LCURL113_tree=null;
5761 CommonTree SEPARATOR115_tree=null;
5762 CommonTree RCURL116_tree=null;
5763 CommonTree RCURL117_tree=null;
5764 RewriteRuleTokenStream stream_LCURL=new RewriteRuleTokenStream(adaptor,"token LCURL");
5765 RewriteRuleTokenStream stream_SEPARATOR=new RewriteRuleTokenStream(adaptor,"token SEPARATOR");
5766 RewriteRuleTokenStream stream_RCURL=new RewriteRuleTokenStream(adaptor,"token RCURL");
5767 RewriteRuleSubtreeStream stream_enumeratorList=new RewriteRuleSubtreeStream(adaptor,"rule enumeratorList");
5768
5769 enter("enumBody");
5770
5771 try {
5772 // CTFParser.g:693:1: ( LCURL enumeratorList ( SEPARATOR RCURL | RCURL ) -> ^( ENUM_BODY enumeratorList ) )
5773 // CTFParser.g:694:3: LCURL enumeratorList ( SEPARATOR RCURL | RCURL )
5774 {
5775 LCURL113=(Token)match(input,LCURL,FOLLOW_LCURL_in_enumBody2393); if (state.failed) {
5776 return retval;
5777 }
5778 if ( state.backtracking==0 ) {
5779 stream_LCURL.add(LCURL113);
5780 }
5781
5782 pushFollow(FOLLOW_enumeratorList_in_enumBody2395);
5783 enumeratorList114=enumeratorList();
5784
5785 state._fsp--;
5786 if (state.failed) {
5787 return retval;
5788 }
5789 if ( state.backtracking==0 ) {
5790 stream_enumeratorList.add(enumeratorList114.getTree());
5791 }
5792 // CTFParser.g:694:24: ( SEPARATOR RCURL | RCURL )
5793 int alt35=2;
5794 int LA35_0 = input.LA(1);
5795
5796 if ( (LA35_0==SEPARATOR) ) {
5797 alt35=1;
5798 }
5799 else if ( (LA35_0==RCURL) ) {
5800 alt35=2;
5801 }
5802 else {
5803 if (state.backtracking>0) {state.failed=true; return retval;}
5804 NoViableAltException nvae =
5805 new NoViableAltException("", 35, 0, input);
5806
5807 throw nvae;
5808 }
5809 switch (alt35) {
5810 case 1 :
5811 // CTFParser.g:694:25: SEPARATOR RCURL
5812 {
5813 SEPARATOR115=(Token)match(input,SEPARATOR,FOLLOW_SEPARATOR_in_enumBody2398); if (state.failed) {
5814 return retval;
5815 }
5816 if ( state.backtracking==0 ) {
5817 stream_SEPARATOR.add(SEPARATOR115);
5818 }
5819
5820 RCURL116=(Token)match(input,RCURL,FOLLOW_RCURL_in_enumBody2400); if (state.failed) {
5821 return retval;
5822 }
5823 if ( state.backtracking==0 ) {
5824 stream_RCURL.add(RCURL116);
5825 }
5826
5827
5828 }
5829 break;
5830 case 2 :
5831 // CTFParser.g:694:43: RCURL
5832 {
5833 RCURL117=(Token)match(input,RCURL,FOLLOW_RCURL_in_enumBody2404); if (state.failed) {
5834 return retval;
5835 }
5836 if ( state.backtracking==0 ) {
5837 stream_RCURL.add(RCURL117);
5838 }
5839
5840
5841 }
5842 break;
5843
5844 }
5845
5846
5847
5848 // AST REWRITE
5849 // elements: enumeratorList
5850 // token labels:
5851 // rule labels: retval
5852 // token list labels:
5853 // rule list labels:
5854 // wildcard labels:
5855 if ( state.backtracking==0 ) {
5856 retval.tree = root_0;
5857 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
5858
5859 root_0 = (CommonTree)adaptor.nil();
5860 // 694:50: -> ^( ENUM_BODY enumeratorList )
5861 {
5862 // CTFParser.g:694:53: ^( ENUM_BODY enumeratorList )
5863 {
5864 CommonTree root_1 = (CommonTree)adaptor.nil();
5865 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ENUM_BODY, "ENUM_BODY"), root_1);
5866
5867 adaptor.addChild(root_1, stream_enumeratorList.nextTree());
5868
5869 adaptor.addChild(root_0, root_1);
5870 }
5871
5872 }
5873
5874 retval.tree = root_0;}
5875 }
5876
5877 retval.stop = input.LT(-1);
5878
5879 if ( state.backtracking==0 ) {
5880
5881 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
5882 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
5883 }
5884 if ( state.backtracking==0 ) {
5885
5886 exit("enumBody");
5887
5888 }
5889 }
5890
5891 catch (RecognitionException e)
5892 {
5893 throw e;
5894 }
5895 finally {
5896 }
5897 return retval;
5898 }
5899 // $ANTLR end "enumBody"
5900
5901 public static class enumContainerType_return extends ParserRuleReturnScope {
5902 CommonTree tree;
5903 public Object getTree() { return tree; }
5904 };
5905
5906 // $ANTLR start "enumContainerType"
5907 // CTFParser.g:697:1: enumContainerType : COLON declarationSpecifiers -> ^( ENUM_CONTAINER_TYPE declarationSpecifiers ) ;
5908 public final CTFParser.enumContainerType_return enumContainerType() throws RecognitionException {
5909 CTFParser.enumContainerType_return retval = new CTFParser.enumContainerType_return();
5910 retval.start = input.LT(1);
5911
5912 CommonTree root_0 = null;
5913
5914 Token COLON118=null;
5915 CTFParser.declarationSpecifiers_return declarationSpecifiers119 = null;
5916
5917
5918 CommonTree COLON118_tree=null;
5919 RewriteRuleTokenStream stream_COLON=new RewriteRuleTokenStream(adaptor,"token COLON");
5920 RewriteRuleSubtreeStream stream_declarationSpecifiers=new RewriteRuleSubtreeStream(adaptor,"rule declarationSpecifiers");
5921
5922 enter("enumContainerType");
5923
5924 try {
5925 // CTFParser.g:704:1: ( COLON declarationSpecifiers -> ^( ENUM_CONTAINER_TYPE declarationSpecifiers ) )
5926 // CTFParser.g:705:3: COLON declarationSpecifiers
5927 {
5928 COLON118=(Token)match(input,COLON,FOLLOW_COLON_in_enumContainerType2436); if (state.failed) {
5929 return retval;
5930 }
5931 if ( state.backtracking==0 ) {
5932 stream_COLON.add(COLON118);
5933 }
5934
5935 pushFollow(FOLLOW_declarationSpecifiers_in_enumContainerType2438);
5936 declarationSpecifiers119=declarationSpecifiers();
5937
5938 state._fsp--;
5939 if (state.failed) {
5940 return retval;
5941 }
5942 if ( state.backtracking==0 ) {
5943 stream_declarationSpecifiers.add(declarationSpecifiers119.getTree());
5944 }
5945
5946
5947 // AST REWRITE
5948 // elements: declarationSpecifiers
5949 // token labels:
5950 // rule labels: retval
5951 // token list labels:
5952 // rule list labels:
5953 // wildcard labels:
5954 if ( state.backtracking==0 ) {
5955 retval.tree = root_0;
5956 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
5957
5958 root_0 = (CommonTree)adaptor.nil();
5959 // 705:31: -> ^( ENUM_CONTAINER_TYPE declarationSpecifiers )
5960 {
5961 // CTFParser.g:705:34: ^( ENUM_CONTAINER_TYPE declarationSpecifiers )
5962 {
5963 CommonTree root_1 = (CommonTree)adaptor.nil();
5964 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ENUM_CONTAINER_TYPE, "ENUM_CONTAINER_TYPE"), root_1);
5965
5966 adaptor.addChild(root_1, stream_declarationSpecifiers.nextTree());
5967
5968 adaptor.addChild(root_0, root_1);
5969 }
5970
5971 }
5972
5973 retval.tree = root_0;}
5974 }
5975
5976 retval.stop = input.LT(-1);
5977
5978 if ( state.backtracking==0 ) {
5979
5980 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
5981 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
5982 }
5983 if ( state.backtracking==0 ) {
5984
5985 exit("enumContainerType");
5986
5987 }
5988 }
5989
5990 catch (RecognitionException e)
5991 {
5992 throw e;
5993 }
5994 finally {
5995 }
5996 return retval;
5997 }
5998 // $ANTLR end "enumContainerType"
5999
6000 public static class enumeratorList_return extends ParserRuleReturnScope {
6001 CommonTree tree;
6002 public Object getTree() { return tree; }
6003 };
6004
6005 // $ANTLR start "enumeratorList"
6006 // CTFParser.g:708:1: enumeratorList : enumerator ( SEPARATOR enumerator )* -> ( ^( ENUM_ENUMERATOR enumerator ) )+ ;
6007 public final CTFParser.enumeratorList_return enumeratorList() throws RecognitionException {
6008 CTFParser.enumeratorList_return retval = new CTFParser.enumeratorList_return();
6009 retval.start = input.LT(1);
6010
6011 CommonTree root_0 = null;
6012
6013 Token SEPARATOR121=null;
6014 CTFParser.enumerator_return enumerator120 = null;
6015
6016 CTFParser.enumerator_return enumerator122 = null;
6017
6018
6019 CommonTree SEPARATOR121_tree=null;
6020 RewriteRuleTokenStream stream_SEPARATOR=new RewriteRuleTokenStream(adaptor,"token SEPARATOR");
6021 RewriteRuleSubtreeStream stream_enumerator=new RewriteRuleSubtreeStream(adaptor,"rule enumerator");
6022
6023 enter("enumeratorList");
6024
6025 try {
6026 // CTFParser.g:715:1: ( enumerator ( SEPARATOR enumerator )* -> ( ^( ENUM_ENUMERATOR enumerator ) )+ )
6027 // CTFParser.g:716:3: enumerator ( SEPARATOR enumerator )*
6028 {
6029 pushFollow(FOLLOW_enumerator_in_enumeratorList2469);
6030 enumerator120=enumerator();
6031
6032 state._fsp--;
6033 if (state.failed) {
6034 return retval;
6035 }
6036 if ( state.backtracking==0 ) {
6037 stream_enumerator.add(enumerator120.getTree());
6038 }
6039 // CTFParser.g:716:14: ( SEPARATOR enumerator )*
6040 loop36:
6041 do {
6042 int alt36=2;
6043 int LA36_0 = input.LA(1);
6044
6045 if ( (LA36_0==SEPARATOR) ) {
6046 int LA36_1 = input.LA(2);
6047
6048 if ( (LA36_1==ALIGNTOK||LA36_1==EVENTTOK||LA36_1==SIGNEDTOK||LA36_1==STRINGTOK||LA36_1==STRING_LITERAL||LA36_1==IDENTIFIER) ) {
6049 alt36=1;
6050 }
6051
6052
6053 }
6054
6055
6056 switch (alt36) {
6057 case 1 :
6058 // CTFParser.g:716:15: SEPARATOR enumerator
6059 {
6060 SEPARATOR121=(Token)match(input,SEPARATOR,FOLLOW_SEPARATOR_in_enumeratorList2472); if (state.failed) {
6061 return retval;
6062 }
6063 if ( state.backtracking==0 ) {
6064 stream_SEPARATOR.add(SEPARATOR121);
6065 }
6066
6067 pushFollow(FOLLOW_enumerator_in_enumeratorList2474);
6068 enumerator122=enumerator();
6069
6070 state._fsp--;
6071 if (state.failed) {
6072 return retval;
6073 }
6074 if ( state.backtracking==0 ) {
6075 stream_enumerator.add(enumerator122.getTree());
6076 }
6077
6078 }
6079 break;
6080
6081 default :
6082 break loop36;
6083 }
6084 } while (true);
6085
6086
6087
6088 // AST REWRITE
6089 // elements: enumerator
6090 // token labels:
6091 // rule labels: retval
6092 // token list labels:
6093 // rule list labels:
6094 // wildcard labels:
6095 if ( state.backtracking==0 ) {
6096 retval.tree = root_0;
6097 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
6098
6099 root_0 = (CommonTree)adaptor.nil();
6100 // 716:38: -> ( ^( ENUM_ENUMERATOR enumerator ) )+
6101 {
6102 if ( !(stream_enumerator.hasNext()) ) {
6103 throw new RewriteEarlyExitException();
6104 }
6105 while ( stream_enumerator.hasNext() ) {
6106 // CTFParser.g:716:42: ^( ENUM_ENUMERATOR enumerator )
6107 {
6108 CommonTree root_1 = (CommonTree)adaptor.nil();
6109 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ENUM_ENUMERATOR, "ENUM_ENUMERATOR"), root_1);
6110
6111 adaptor.addChild(root_1, stream_enumerator.nextTree());
6112
6113 adaptor.addChild(root_0, root_1);
6114 }
6115
6116 }
6117 stream_enumerator.reset();
6118
6119 }
6120
6121 retval.tree = root_0;}
6122 }
6123
6124 retval.stop = input.LT(-1);
6125
6126 if ( state.backtracking==0 ) {
6127
6128 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
6129 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
6130 }
6131 if ( state.backtracking==0 ) {
6132
6133 exit("enumeratorList");
6134
6135 }
6136 }
6137
6138 catch (RecognitionException e)
6139 {
6140 throw e;
6141 }
6142 finally {
6143 }
6144 return retval;
6145 }
6146 // $ANTLR end "enumeratorList"
6147
6148 public static class enumerator_return extends ParserRuleReturnScope {
6149 CommonTree tree;
6150 public Object getTree() { return tree; }
6151 };
6152
6153 // $ANTLR start "enumerator"
6154 // CTFParser.g:719:1: enumerator : enumConstant ( enumeratorValue )? ;
6155 public final CTFParser.enumerator_return enumerator() throws RecognitionException {
6156 CTFParser.enumerator_return retval = new CTFParser.enumerator_return();
6157 retval.start = input.LT(1);
6158
6159 CommonTree root_0 = null;
6160
6161 CTFParser.enumConstant_return enumConstant123 = null;
6162
6163 CTFParser.enumeratorValue_return enumeratorValue124 = null;
6164
6165
6166
6167
6168 enter("enumerator");
6169
6170 try {
6171 // CTFParser.g:726:1: ( enumConstant ( enumeratorValue )? )
6172 // CTFParser.g:727:3: enumConstant ( enumeratorValue )?
6173 {
6174 root_0 = (CommonTree)adaptor.nil();
6175
6176 pushFollow(FOLLOW_enumConstant_in_enumerator2510);
6177 enumConstant123=enumConstant();
6178
6179 state._fsp--;
6180 if (state.failed) {
6181 return retval;
6182 }
6183 if ( state.backtracking==0 ) {
6184 adaptor.addChild(root_0, enumConstant123.getTree());
6185 }
6186 // CTFParser.g:727:16: ( enumeratorValue )?
6187 int alt37=2;
6188 int LA37_0 = input.LA(1);
6189
6190 if ( (LA37_0==ASSIGNMENT) ) {
6191 alt37=1;
6192 }
6193 switch (alt37) {
6194 case 1 :
6195 // CTFParser.g:727:16: enumeratorValue
6196 {
6197 pushFollow(FOLLOW_enumeratorValue_in_enumerator2512);
6198 enumeratorValue124=enumeratorValue();
6199
6200 state._fsp--;
6201 if (state.failed) {
6202 return retval;
6203 }
6204 if ( state.backtracking==0 ) {
6205 adaptor.addChild(root_0, enumeratorValue124.getTree());
6206 }
6207
6208 }
6209 break;
6210
6211 }
6212
6213
6214 }
6215
6216 retval.stop = input.LT(-1);
6217
6218 if ( state.backtracking==0 ) {
6219
6220 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
6221 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
6222 }
6223 if ( state.backtracking==0 ) {
6224
6225 exit("enumerator");
6226
6227 }
6228 }
6229
6230 catch (RecognitionException e)
6231 {
6232 throw e;
6233 }
6234 finally {
6235 }
6236 return retval;
6237 }
6238 // $ANTLR end "enumerator"
6239
6240 public static class enumeratorValue_return extends ParserRuleReturnScope {
6241 CommonTree tree;
6242 public Object getTree() { return tree; }
6243 };
6244
6245 // $ANTLR start "enumeratorValue"
6246 // CTFParser.g:730:1: enumeratorValue : ASSIGNMENT e1= unaryExpression ( -> ^( ENUM_VALUE $e1) | ELIPSES e2= unaryExpression -> ^( ENUM_VALUE_RANGE $e1 $e2) ) ;
6247 public final CTFParser.enumeratorValue_return enumeratorValue() throws RecognitionException {
6248 CTFParser.enumeratorValue_return retval = new CTFParser.enumeratorValue_return();
6249 retval.start = input.LT(1);
6250
6251 CommonTree root_0 = null;
6252
6253 Token ASSIGNMENT125=null;
6254 Token ELIPSES126=null;
6255 CTFParser.unaryExpression_return e1 = null;
6256
6257 CTFParser.unaryExpression_return e2 = null;
6258
6259
6260 CommonTree ASSIGNMENT125_tree=null;
6261 CommonTree ELIPSES126_tree=null;
6262 RewriteRuleTokenStream stream_ASSIGNMENT=new RewriteRuleTokenStream(adaptor,"token ASSIGNMENT");
6263 RewriteRuleTokenStream stream_ELIPSES=new RewriteRuleTokenStream(adaptor,"token ELIPSES");
6264 RewriteRuleSubtreeStream stream_unaryExpression=new RewriteRuleSubtreeStream(adaptor,"rule unaryExpression");
6265
6266 enter("enumeratorValue");
6267
6268 try {
6269 // CTFParser.g:737:1: ( ASSIGNMENT e1= unaryExpression ( -> ^( ENUM_VALUE $e1) | ELIPSES e2= unaryExpression -> ^( ENUM_VALUE_RANGE $e1 $e2) ) )
6270 // CTFParser.g:738:3: ASSIGNMENT e1= unaryExpression ( -> ^( ENUM_VALUE $e1) | ELIPSES e2= unaryExpression -> ^( ENUM_VALUE_RANGE $e1 $e2) )
6271 {
6272 ASSIGNMENT125=(Token)match(input,ASSIGNMENT,FOLLOW_ASSIGNMENT_in_enumeratorValue2536); if (state.failed) {
6273 return retval;
6274 }
6275 if ( state.backtracking==0 ) {
6276 stream_ASSIGNMENT.add(ASSIGNMENT125);
6277 }
6278
6279 pushFollow(FOLLOW_unaryExpression_in_enumeratorValue2540);
6280 e1=unaryExpression();
6281
6282 state._fsp--;
6283 if (state.failed) {
6284 return retval;
6285 }
6286 if ( state.backtracking==0 ) {
6287 stream_unaryExpression.add(e1.getTree());
6288 }
6289 // CTFParser.g:739:3: ( -> ^( ENUM_VALUE $e1) | ELIPSES e2= unaryExpression -> ^( ENUM_VALUE_RANGE $e1 $e2) )
6290 int alt38=2;
6291 int LA38_0 = input.LA(1);
6292
6293 if ( (LA38_0==SEPARATOR||LA38_0==RCURL) ) {
6294 alt38=1;
6295 }
6296 else if ( (LA38_0==ELIPSES) ) {
6297 alt38=2;
6298 }
6299 else {
6300 if (state.backtracking>0) {state.failed=true; return retval;}
6301 NoViableAltException nvae =
6302 new NoViableAltException("", 38, 0, input);
6303
6304 throw nvae;
6305 }
6306 switch (alt38) {
6307 case 1 :
6308 // CTFParser.g:740:5:
6309 {
6310
6311 // AST REWRITE
6312 // elements: e1
6313 // token labels:
6314 // rule labels: retval, e1
6315 // token list labels:
6316 // rule list labels:
6317 // wildcard labels:
6318 if ( state.backtracking==0 ) {
6319 retval.tree = root_0;
6320 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
6321 RewriteRuleSubtreeStream stream_e1=new RewriteRuleSubtreeStream(adaptor,"rule e1",e1!=null?e1.tree:null);
6322
6323 root_0 = (CommonTree)adaptor.nil();
6324 // 740:5: -> ^( ENUM_VALUE $e1)
6325 {
6326 // CTFParser.g:740:8: ^( ENUM_VALUE $e1)
6327 {
6328 CommonTree root_1 = (CommonTree)adaptor.nil();
6329 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ENUM_VALUE, "ENUM_VALUE"), root_1);
6330
6331 adaptor.addChild(root_1, stream_e1.nextTree());
6332
6333 adaptor.addChild(root_0, root_1);
6334 }
6335
6336 }
6337
6338 retval.tree = root_0;}
6339 }
6340 break;
6341 case 2 :
6342 // CTFParser.g:741:7: ELIPSES e2= unaryExpression
6343 {
6344 ELIPSES126=(Token)match(input,ELIPSES,FOLLOW_ELIPSES_in_enumeratorValue2566); if (state.failed) {
6345 return retval;
6346 }
6347 if ( state.backtracking==0 ) {
6348 stream_ELIPSES.add(ELIPSES126);
6349 }
6350
6351 pushFollow(FOLLOW_unaryExpression_in_enumeratorValue2570);
6352 e2=unaryExpression();
6353
6354 state._fsp--;
6355 if (state.failed) {
6356 return retval;
6357 }
6358 if ( state.backtracking==0 ) {
6359 stream_unaryExpression.add(e2.getTree());
6360 }
6361
6362
6363 // AST REWRITE
6364 // elements: e1, e2
6365 // token labels:
6366 // rule labels: retval, e1, e2
6367 // token list labels:
6368 // rule list labels:
6369 // wildcard labels:
6370 if ( state.backtracking==0 ) {
6371 retval.tree = root_0;
6372 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
6373 RewriteRuleSubtreeStream stream_e1=new RewriteRuleSubtreeStream(adaptor,"rule e1",e1!=null?e1.tree:null);
6374 RewriteRuleSubtreeStream stream_e2=new RewriteRuleSubtreeStream(adaptor,"rule e2",e2!=null?e2.tree:null);
6375
6376 root_0 = (CommonTree)adaptor.nil();
6377 // 741:34: -> ^( ENUM_VALUE_RANGE $e1 $e2)
6378 {
6379 // CTFParser.g:741:37: ^( ENUM_VALUE_RANGE $e1 $e2)
6380 {
6381 CommonTree root_1 = (CommonTree)adaptor.nil();
6382 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ENUM_VALUE_RANGE, "ENUM_VALUE_RANGE"), root_1);
6383
6384 adaptor.addChild(root_1, stream_e1.nextTree());
6385 adaptor.addChild(root_1, stream_e2.nextTree());
6386
6387 adaptor.addChild(root_0, root_1);
6388 }
6389
6390 }
6391
6392 retval.tree = root_0;}
6393 }
6394 break;
6395
6396 }
6397
6398
6399 }
6400
6401 retval.stop = input.LT(-1);
6402
6403 if ( state.backtracking==0 ) {
6404
6405 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
6406 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
6407 }
6408 if ( state.backtracking==0 ) {
6409
6410 exit("enumeratorValue");
6411
6412 }
6413 }
6414
6415 catch (RecognitionException e)
6416 {
6417 throw e;
6418 }
6419 finally {
6420 }
6421 return retval;
6422 }
6423 // $ANTLR end "enumeratorValue"
6424
6425 public static class declarator_return extends ParserRuleReturnScope {
6426 CommonTree tree;
6427 public Object getTree() { return tree; }
6428 };
6429
6430 // $ANTLR start "declarator"
6431 // CTFParser.g:746:1: declarator : ( pointer )* directDeclarator -> ^( TYPE_DECLARATOR ( pointer )* directDeclarator ) ;
6432 public final CTFParser.declarator_return declarator() throws RecognitionException {
6433 CTFParser.declarator_return retval = new CTFParser.declarator_return();
6434 retval.start = input.LT(1);
6435
6436 CommonTree root_0 = null;
6437
6438 CTFParser.pointer_return pointer127 = null;
6439
6440 CTFParser.directDeclarator_return directDeclarator128 = null;
6441
6442
6443 RewriteRuleSubtreeStream stream_directDeclarator=new RewriteRuleSubtreeStream(adaptor,"rule directDeclarator");
6444 RewriteRuleSubtreeStream stream_pointer=new RewriteRuleSubtreeStream(adaptor,"rule pointer");
6445
6446 enter("declarator");
6447
6448 try {
6449 // CTFParser.g:753:1: ( ( pointer )* directDeclarator -> ^( TYPE_DECLARATOR ( pointer )* directDeclarator ) )
6450 // CTFParser.g:754:3: ( pointer )* directDeclarator
6451 {
6452 // CTFParser.g:754:3: ( pointer )*
6453 loop39:
6454 do {
6455 int alt39=2;
6456 int LA39_0 = input.LA(1);
6457
6458 if ( (LA39_0==POINTER) ) {
6459 alt39=1;
6460 }
6461
6462
6463 switch (alt39) {
6464 case 1 :
6465 // CTFParser.g:754:3: pointer
6466 {
6467 pushFollow(FOLLOW_pointer_in_declarator2612);
6468 pointer127=pointer();
6469
6470 state._fsp--;
6471 if (state.failed) {
6472 return retval;
6473 }
6474 if ( state.backtracking==0 ) {
6475 stream_pointer.add(pointer127.getTree());
6476 }
6477
6478 }
6479 break;
6480
6481 default :
6482 break loop39;
6483 }
6484 } while (true);
6485
6486 pushFollow(FOLLOW_directDeclarator_in_declarator2615);
6487 directDeclarator128=directDeclarator();
6488
6489 state._fsp--;
6490 if (state.failed) {
6491 return retval;
6492 }
6493 if ( state.backtracking==0 ) {
6494 stream_directDeclarator.add(directDeclarator128.getTree());
6495 }
6496
6497
6498 // AST REWRITE
6499 // elements: directDeclarator, pointer
6500 // token labels:
6501 // rule labels: retval
6502 // token list labels:
6503 // rule list labels:
6504 // wildcard labels:
6505 if ( state.backtracking==0 ) {
6506 retval.tree = root_0;
6507 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
6508
6509 root_0 = (CommonTree)adaptor.nil();
6510 // 754:29: -> ^( TYPE_DECLARATOR ( pointer )* directDeclarator )
6511 {
6512 // CTFParser.g:754:32: ^( TYPE_DECLARATOR ( pointer )* directDeclarator )
6513 {
6514 CommonTree root_1 = (CommonTree)adaptor.nil();
6515 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPE_DECLARATOR, "TYPE_DECLARATOR"), root_1);
6516
6517 // CTFParser.g:754:50: ( pointer )*
6518 while ( stream_pointer.hasNext() ) {
6519 adaptor.addChild(root_1, stream_pointer.nextTree());
6520
6521 }
6522 stream_pointer.reset();
6523 adaptor.addChild(root_1, stream_directDeclarator.nextTree());
6524
6525 adaptor.addChild(root_0, root_1);
6526 }
6527
6528 }
6529
6530 retval.tree = root_0;}
6531 }
6532
6533 retval.stop = input.LT(-1);
6534
6535 if ( state.backtracking==0 ) {
6536
6537 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
6538 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
6539 }
6540 if ( state.backtracking==0 ) {
6541
6542 exit("declarator");
6543
6544 }
6545 }
6546
6547 catch (RecognitionException e)
6548 {
6549 throw e;
6550 }
6551 finally {
6552 }
6553 return retval;
6554 }
6555 // $ANTLR end "declarator"
6556
6557 public static class directDeclarator_return extends ParserRuleReturnScope {
6558 CommonTree tree;
6559 public Object getTree() { return tree; }
6560 };
6561
6562 // $ANTLR start "directDeclarator"
6563 // CTFParser.g:757:1: directDeclarator : ( IDENTIFIER ) ( directDeclaratorSuffix )* ;
6564 public final CTFParser.directDeclarator_return directDeclarator() throws RecognitionException {
6565 CTFParser.directDeclarator_return retval = new CTFParser.directDeclarator_return();
6566 retval.start = input.LT(1);
6567
6568 CommonTree root_0 = null;
6569
6570 Token IDENTIFIER129=null;
6571 CTFParser.directDeclaratorSuffix_return directDeclaratorSuffix130 = null;
6572
6573
6574 CommonTree IDENTIFIER129_tree=null;
6575
6576
6577 enter("directDeclarator");
6578
6579 try {
6580 // CTFParser.g:764:1: ( ( IDENTIFIER ) ( directDeclaratorSuffix )* )
6581 // CTFParser.g:765:3: ( IDENTIFIER ) ( directDeclaratorSuffix )*
6582 {
6583 root_0 = (CommonTree)adaptor.nil();
6584
6585 // CTFParser.g:765:3: ( IDENTIFIER )
6586 // CTFParser.g:766:6: IDENTIFIER
6587 {
6588 IDENTIFIER129=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_directDeclarator2659); if (state.failed) {
6589 return retval;
6590 }
6591 if ( state.backtracking==0 ) {
6592 IDENTIFIER129_tree = (CommonTree)adaptor.create(IDENTIFIER129);
6593 adaptor.addChild(root_0, IDENTIFIER129_tree);
6594 }
6595 if ( state.backtracking==0 ) {
6596 if (inTypedef()) {
6597 addTypeName((IDENTIFIER129!=null?IDENTIFIER129.getText():null));
6598 }
6599 }
6600 if ( state.backtracking==0 ) {
6601 debug_print((IDENTIFIER129!=null?IDENTIFIER129.getText():null));
6602 }
6603
6604 }
6605
6606 // CTFParser.g:769:2: ( directDeclaratorSuffix )*
6607 loop40:
6608 do {
6609 int alt40=2;
6610 int LA40_0 = input.LA(1);
6611
6612 if ( (LA40_0==OPENBRAC) ) {
6613 alt40=1;
6614 }
6615
6616
6617 switch (alt40) {
6618 case 1 :
6619 // CTFParser.g:769:2: directDeclaratorSuffix
6620 {
6621 pushFollow(FOLLOW_directDeclaratorSuffix_in_directDeclarator2677);
6622 directDeclaratorSuffix130=directDeclaratorSuffix();
6623
6624 state._fsp--;
6625 if (state.failed) {
6626 return retval;
6627 }
6628 if ( state.backtracking==0 ) {
6629 adaptor.addChild(root_0, directDeclaratorSuffix130.getTree());
6630 }
6631
6632 }
6633 break;
6634
6635 default :
6636 break loop40;
6637 }
6638 } while (true);
6639
6640
6641 }
6642
6643 retval.stop = input.LT(-1);
6644
6645 if ( state.backtracking==0 ) {
6646
6647 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
6648 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
6649 }
6650 if ( state.backtracking==0 ) {
6651
6652 exit("directDeclarator");
6653
6654 }
6655 }
6656
6657 catch (RecognitionException e)
6658 {
6659 throw e;
6660 }
6661 finally {
6662 }
6663 return retval;
6664 }
6665 // $ANTLR end "directDeclarator"
6666
6667 public static class directDeclaratorSuffix_return extends ParserRuleReturnScope {
6668 CommonTree tree;
6669 public Object getTree() { return tree; }
6670 };
6671
6672 // $ANTLR start "directDeclaratorSuffix"
6673 // CTFParser.g:772:1: directDeclaratorSuffix : OPENBRAC directDeclaratorLength CLOSEBRAC -> ^( LENGTH directDeclaratorLength ) ;
6674 public final CTFParser.directDeclaratorSuffix_return directDeclaratorSuffix() throws RecognitionException {
6675 CTFParser.directDeclaratorSuffix_return retval = new CTFParser.directDeclaratorSuffix_return();
6676 retval.start = input.LT(1);
6677
6678 CommonTree root_0 = null;
6679
6680 Token OPENBRAC131=null;
6681 Token CLOSEBRAC133=null;
6682 CTFParser.directDeclaratorLength_return directDeclaratorLength132 = null;
6683
6684
6685 CommonTree OPENBRAC131_tree=null;
6686 CommonTree CLOSEBRAC133_tree=null;
6687 RewriteRuleTokenStream stream_OPENBRAC=new RewriteRuleTokenStream(adaptor,"token OPENBRAC");
6688 RewriteRuleTokenStream stream_CLOSEBRAC=new RewriteRuleTokenStream(adaptor,"token CLOSEBRAC");
6689 RewriteRuleSubtreeStream stream_directDeclaratorLength=new RewriteRuleSubtreeStream(adaptor,"rule directDeclaratorLength");
6690 try {
6691 // CTFParser.g:772:23: ( OPENBRAC directDeclaratorLength CLOSEBRAC -> ^( LENGTH directDeclaratorLength ) )
6692 // CTFParser.g:773:3: OPENBRAC directDeclaratorLength CLOSEBRAC
6693 {
6694 OPENBRAC131=(Token)match(input,OPENBRAC,FOLLOW_OPENBRAC_in_directDeclaratorSuffix2690); if (state.failed) {
6695 return retval;
6696 }
6697 if ( state.backtracking==0 ) {
6698 stream_OPENBRAC.add(OPENBRAC131);
6699 }
6700
6701 pushFollow(FOLLOW_directDeclaratorLength_in_directDeclaratorSuffix2692);
6702 directDeclaratorLength132=directDeclaratorLength();
6703
6704 state._fsp--;
6705 if (state.failed) {
6706 return retval;
6707 }
6708 if ( state.backtracking==0 ) {
6709 stream_directDeclaratorLength.add(directDeclaratorLength132.getTree());
6710 }
6711 CLOSEBRAC133=(Token)match(input,CLOSEBRAC,FOLLOW_CLOSEBRAC_in_directDeclaratorSuffix2694); if (state.failed) {
6712 return retval;
6713 }
6714 if ( state.backtracking==0 ) {
6715 stream_CLOSEBRAC.add(CLOSEBRAC133);
6716 }
6717
6718
6719
6720 // AST REWRITE
6721 // elements: directDeclaratorLength
6722 // token labels:
6723 // rule labels: retval
6724 // token list labels:
6725 // rule list labels:
6726 // wildcard labels:
6727 if ( state.backtracking==0 ) {
6728 retval.tree = root_0;
6729 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
6730
6731 root_0 = (CommonTree)adaptor.nil();
6732 // 773:45: -> ^( LENGTH directDeclaratorLength )
6733 {
6734 // CTFParser.g:773:48: ^( LENGTH directDeclaratorLength )
6735 {
6736 CommonTree root_1 = (CommonTree)adaptor.nil();
6737 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(LENGTH, "LENGTH"), root_1);
6738
6739 adaptor.addChild(root_1, stream_directDeclaratorLength.nextTree());
6740
6741 adaptor.addChild(root_0, root_1);
6742 }
6743
6744 }
6745
6746 retval.tree = root_0;}
6747 }
6748
6749 retval.stop = input.LT(-1);
6750
6751 if ( state.backtracking==0 ) {
6752
6753 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
6754 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
6755 }
6756 }
6757
6758 catch (RecognitionException e)
6759 {
6760 throw e;
6761 }
6762 finally {
6763 }
6764 return retval;
6765 }
6766 // $ANTLR end "directDeclaratorSuffix"
6767
6768 public static class directDeclaratorLength_return extends ParserRuleReturnScope {
6769 CommonTree tree;
6770 public Object getTree() { return tree; }
6771 };
6772
6773 // $ANTLR start "directDeclaratorLength"
6774 // CTFParser.g:776:1: directDeclaratorLength : unaryExpression ;
6775 public final CTFParser.directDeclaratorLength_return directDeclaratorLength() throws RecognitionException {
6776 CTFParser.directDeclaratorLength_return retval = new CTFParser.directDeclaratorLength_return();
6777 retval.start = input.LT(1);
6778
6779 CommonTree root_0 = null;
6780
6781 CTFParser.unaryExpression_return unaryExpression134 = null;
6782
6783
6784
6785 try {
6786 // CTFParser.g:776:24: ( unaryExpression )
6787 // CTFParser.g:777:3: unaryExpression
6788 {
6789 root_0 = (CommonTree)adaptor.nil();
6790
6791 pushFollow(FOLLOW_unaryExpression_in_directDeclaratorLength2715);
6792 unaryExpression134=unaryExpression();
6793
6794 state._fsp--;
6795 if (state.failed) {
6796 return retval;
6797 }
6798 if ( state.backtracking==0 ) {
6799 adaptor.addChild(root_0, unaryExpression134.getTree());
6800 }
6801
6802 }
6803
6804 retval.stop = input.LT(-1);
6805
6806 if ( state.backtracking==0 ) {
6807
6808 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
6809 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
6810 }
6811 }
6812
6813 catch (RecognitionException e)
6814 {
6815 throw e;
6816 }
6817 finally {
6818 }
6819 return retval;
6820 }
6821 // $ANTLR end "directDeclaratorLength"
6822
6823 public static class abstractDeclarator_return extends ParserRuleReturnScope {
6824 CommonTree tree;
6825 public Object getTree() { return tree; }
6826 };
6827
6828 // $ANTLR start "abstractDeclarator"
6829 // CTFParser.g:781:1: abstractDeclarator : ( ( ( pointer )+ ( directAbstractDeclarator )? ) -> ^( TYPE_DECLARATOR ( pointer )+ ( directAbstractDeclarator )? ) | directAbstractDeclarator -> ^( TYPE_DECLARATOR directAbstractDeclarator ) );
6830 public final CTFParser.abstractDeclarator_return abstractDeclarator() throws RecognitionException {
6831 CTFParser.abstractDeclarator_return retval = new CTFParser.abstractDeclarator_return();
6832 retval.start = input.LT(1);
6833
6834 CommonTree root_0 = null;
6835
6836 CTFParser.pointer_return pointer135 = null;
6837
6838 CTFParser.directAbstractDeclarator_return directAbstractDeclarator136 = null;
6839
6840 CTFParser.directAbstractDeclarator_return directAbstractDeclarator137 = null;
6841
6842
6843 RewriteRuleSubtreeStream stream_pointer=new RewriteRuleSubtreeStream(adaptor,"rule pointer");
6844 RewriteRuleSubtreeStream stream_directAbstractDeclarator=new RewriteRuleSubtreeStream(adaptor,"rule directAbstractDeclarator");
6845
6846 enter("abstractDeclarator");
6847
6848 try {
6849 // CTFParser.g:788:1: ( ( ( pointer )+ ( directAbstractDeclarator )? ) -> ^( TYPE_DECLARATOR ( pointer )+ ( directAbstractDeclarator )? ) | directAbstractDeclarator -> ^( TYPE_DECLARATOR directAbstractDeclarator ) )
6850 int alt43=2;
6851 int LA43_0 = input.LA(1);
6852
6853 if ( (LA43_0==POINTER) ) {
6854 alt43=1;
6855 }
6856 else if ( (LA43_0==LPAREN||LA43_0==IDENTIFIER) ) {
6857 alt43=2;
6858 }
6859 else {
6860 if (state.backtracking>0) {state.failed=true; return retval;}
6861 NoViableAltException nvae =
6862 new NoViableAltException("", 43, 0, input);
6863
6864 throw nvae;
6865 }
6866 switch (alt43) {
6867 case 1 :
6868 // CTFParser.g:789:5: ( ( pointer )+ ( directAbstractDeclarator )? )
6869 {
6870 // CTFParser.g:789:5: ( ( pointer )+ ( directAbstractDeclarator )? )
6871 // CTFParser.g:789:6: ( pointer )+ ( directAbstractDeclarator )?
6872 {
6873 // CTFParser.g:789:6: ( pointer )+
6874 int cnt41=0;
6875 loop41:
6876 do {
6877 int alt41=2;
6878 int LA41_0 = input.LA(1);
6879
6880 if ( (LA41_0==POINTER) ) {
6881 alt41=1;
6882 }
6883
6884
6885 switch (alt41) {
6886 case 1 :
6887 // CTFParser.g:789:6: pointer
6888 {
6889 pushFollow(FOLLOW_pointer_in_abstractDeclarator2746);
6890 pointer135=pointer();
6891
6892 state._fsp--;
6893 if (state.failed) {
6894 return retval;
6895 }
6896 if ( state.backtracking==0 ) {
6897 stream_pointer.add(pointer135.getTree());
6898 }
6899
6900 }
6901 break;
6902
6903 default :
6904 if ( cnt41 >= 1 ) {
6905 break loop41;
6906 }
6907 if (state.backtracking>0) {state.failed=true; return retval;}
6908 EarlyExitException eee =
6909 new EarlyExitException(41, input);
6910 throw eee;
6911 }
6912 cnt41++;
6913 } while (true);
6914
6915 // CTFParser.g:789:15: ( directAbstractDeclarator )?
6916 int alt42=2;
6917 int LA42_0 = input.LA(1);
6918
6919 if ( (LA42_0==LPAREN||LA42_0==IDENTIFIER) ) {
6920 alt42=1;
6921 }
6922 switch (alt42) {
6923 case 1 :
6924 // CTFParser.g:789:15: directAbstractDeclarator
6925 {
6926 pushFollow(FOLLOW_directAbstractDeclarator_in_abstractDeclarator2749);
6927 directAbstractDeclarator136=directAbstractDeclarator();
6928
6929 state._fsp--;
6930 if (state.failed) {
6931 return retval;
6932 }
6933 if ( state.backtracking==0 ) {
6934 stream_directAbstractDeclarator.add(directAbstractDeclarator136.getTree());
6935 }
6936
6937 }
6938 break;
6939
6940 }
6941
6942
6943 }
6944
6945
6946
6947 // AST REWRITE
6948 // elements: pointer, directAbstractDeclarator
6949 // token labels:
6950 // rule labels: retval
6951 // token list labels:
6952 // rule list labels:
6953 // wildcard labels:
6954 if ( state.backtracking==0 ) {
6955 retval.tree = root_0;
6956 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
6957
6958 root_0 = (CommonTree)adaptor.nil();
6959 // 789:42: -> ^( TYPE_DECLARATOR ( pointer )+ ( directAbstractDeclarator )? )
6960 {
6961 // CTFParser.g:789:45: ^( TYPE_DECLARATOR ( pointer )+ ( directAbstractDeclarator )? )
6962 {
6963 CommonTree root_1 = (CommonTree)adaptor.nil();
6964 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPE_DECLARATOR, "TYPE_DECLARATOR"), root_1);
6965
6966 if ( !(stream_pointer.hasNext()) ) {
6967 throw new RewriteEarlyExitException();
6968 }
6969 while ( stream_pointer.hasNext() ) {
6970 adaptor.addChild(root_1, stream_pointer.nextTree());
6971
6972 }
6973 stream_pointer.reset();
6974 // CTFParser.g:789:72: ( directAbstractDeclarator )?
6975 if ( stream_directAbstractDeclarator.hasNext() ) {
6976 adaptor.addChild(root_1, stream_directAbstractDeclarator.nextTree());
6977
6978 }
6979 stream_directAbstractDeclarator.reset();
6980
6981 adaptor.addChild(root_0, root_1);
6982 }
6983
6984 }
6985
6986 retval.tree = root_0;}
6987 }
6988 break;
6989 case 2 :
6990 // CTFParser.g:790:5: directAbstractDeclarator
6991 {
6992 pushFollow(FOLLOW_directAbstractDeclarator_in_abstractDeclarator2769);
6993 directAbstractDeclarator137=directAbstractDeclarator();
6994
6995 state._fsp--;
6996 if (state.failed) {
6997 return retval;
6998 }
6999 if ( state.backtracking==0 ) {
7000 stream_directAbstractDeclarator.add(directAbstractDeclarator137.getTree());
7001 }
7002
7003
7004 // AST REWRITE
7005 // elements: directAbstractDeclarator
7006 // token labels:
7007 // rule labels: retval
7008 // token list labels:
7009 // rule list labels:
7010 // wildcard labels:
7011 if ( state.backtracking==0 ) {
7012 retval.tree = root_0;
7013 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
7014
7015 root_0 = (CommonTree)adaptor.nil();
7016 // 790:30: -> ^( TYPE_DECLARATOR directAbstractDeclarator )
7017 {
7018 // CTFParser.g:790:33: ^( TYPE_DECLARATOR directAbstractDeclarator )
7019 {
7020 CommonTree root_1 = (CommonTree)adaptor.nil();
7021 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPE_DECLARATOR, "TYPE_DECLARATOR"), root_1);
7022
7023 adaptor.addChild(root_1, stream_directAbstractDeclarator.nextTree());
7024
7025 adaptor.addChild(root_0, root_1);
7026 }
7027
7028 }
7029
7030 retval.tree = root_0;}
7031 }
7032 break;
7033
7034 }
7035 retval.stop = input.LT(-1);
7036
7037 if ( state.backtracking==0 ) {
7038
7039 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
7040 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
7041 }
7042 if ( state.backtracking==0 ) {
7043
7044 exit("abstractDeclarator");
7045
7046 }
7047 }
7048
7049 catch (RecognitionException e)
7050 {
7051 throw e;
7052 }
7053 finally {
7054 }
7055 return retval;
7056 }
7057 // $ANTLR end "abstractDeclarator"
7058
7059 public static class directAbstractDeclarator_return extends ParserRuleReturnScope {
7060 CommonTree tree;
7061 public Object getTree() { return tree; }
7062 };
7063
7064 // $ANTLR start "directAbstractDeclarator"
7065 // CTFParser.g:797:1: directAbstractDeclarator : ( IDENTIFIER | ( LPAREN abstractDeclarator RPAREN ) ) ( OPENBRAC ( unaryExpression )? CLOSEBRAC )? ;
7066 public final CTFParser.directAbstractDeclarator_return directAbstractDeclarator() throws RecognitionException {
7067 CTFParser.directAbstractDeclarator_return retval = new CTFParser.directAbstractDeclarator_return();
7068 retval.start = input.LT(1);
7069
7070 CommonTree root_0 = null;
7071
7072 Token IDENTIFIER138=null;
7073 Token LPAREN139=null;
7074 Token RPAREN141=null;
7075 Token OPENBRAC142=null;
7076 Token CLOSEBRAC144=null;
7077 CTFParser.abstractDeclarator_return abstractDeclarator140 = null;
7078
7079 CTFParser.unaryExpression_return unaryExpression143 = null;
7080
7081
7082 CommonTree IDENTIFIER138_tree=null;
7083 CommonTree LPAREN139_tree=null;
7084 CommonTree RPAREN141_tree=null;
7085 CommonTree OPENBRAC142_tree=null;
7086 CommonTree CLOSEBRAC144_tree=null;
7087
7088
7089 enter("directAbstractDeclarator");
7090
7091 try {
7092 // CTFParser.g:805:1: ( ( IDENTIFIER | ( LPAREN abstractDeclarator RPAREN ) ) ( OPENBRAC ( unaryExpression )? CLOSEBRAC )? )
7093 // CTFParser.g:806:3: ( IDENTIFIER | ( LPAREN abstractDeclarator RPAREN ) ) ( OPENBRAC ( unaryExpression )? CLOSEBRAC )?
7094 {
7095 root_0 = (CommonTree)adaptor.nil();
7096
7097 // CTFParser.g:806:3: ( IDENTIFIER | ( LPAREN abstractDeclarator RPAREN ) )
7098 int alt44=2;
7099 int LA44_0 = input.LA(1);
7100
7101 if ( (LA44_0==IDENTIFIER) ) {
7102 alt44=1;
7103 }
7104 else if ( (LA44_0==LPAREN) ) {
7105 alt44=2;
7106 }
7107 else {
7108 if (state.backtracking>0) {state.failed=true; return retval;}
7109 NoViableAltException nvae =
7110 new NoViableAltException("", 44, 0, input);
7111
7112 throw nvae;
7113 }
7114 switch (alt44) {
7115 case 1 :
7116 // CTFParser.g:807:6: IDENTIFIER
7117 {
7118 IDENTIFIER138=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_directAbstractDeclarator2809); if (state.failed) {
7119 return retval;
7120 }
7121 if ( state.backtracking==0 ) {
7122 IDENTIFIER138_tree = (CommonTree)adaptor.create(IDENTIFIER138);
7123 adaptor.addChild(root_0, IDENTIFIER138_tree);
7124 }
7125
7126 }
7127 break;
7128 case 2 :
7129 // CTFParser.g:808:7: ( LPAREN abstractDeclarator RPAREN )
7130 {
7131 // CTFParser.g:808:7: ( LPAREN abstractDeclarator RPAREN )
7132 // CTFParser.g:808:8: LPAREN abstractDeclarator RPAREN
7133 {
7134 LPAREN139=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_directAbstractDeclarator2818); if (state.failed) {
7135 return retval;
7136 }
7137 if ( state.backtracking==0 ) {
7138 LPAREN139_tree = (CommonTree)adaptor.create(LPAREN139);
7139 adaptor.addChild(root_0, LPAREN139_tree);
7140 }
7141 pushFollow(FOLLOW_abstractDeclarator_in_directAbstractDeclarator2820);
7142 abstractDeclarator140=abstractDeclarator();
7143
7144 state._fsp--;
7145 if (state.failed) {
7146 return retval;
7147 }
7148 if ( state.backtracking==0 ) {
7149 adaptor.addChild(root_0, abstractDeclarator140.getTree());
7150 }
7151 RPAREN141=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_directAbstractDeclarator2822); if (state.failed) {
7152 return retval;
7153 }
7154 if ( state.backtracking==0 ) {
7155 RPAREN141_tree = (CommonTree)adaptor.create(RPAREN141);
7156 adaptor.addChild(root_0, RPAREN141_tree);
7157 }
7158
7159 }
7160
7161
7162 }
7163 break;
7164
7165 }
7166
7167 // CTFParser.g:810:3: ( OPENBRAC ( unaryExpression )? CLOSEBRAC )?
7168 int alt46=2;
7169 int LA46_0 = input.LA(1);
7170
7171 if ( (LA46_0==OPENBRAC) ) {
7172 alt46=1;
7173 }
7174 switch (alt46) {
7175 case 1 :
7176 // CTFParser.g:811:5: OPENBRAC ( unaryExpression )? CLOSEBRAC
7177 {
7178 OPENBRAC142=(Token)match(input,OPENBRAC,FOLLOW_OPENBRAC_in_directAbstractDeclarator2837); if (state.failed) {
7179 return retval;
7180 }
7181 if ( state.backtracking==0 ) {
7182 OPENBRAC142_tree = (CommonTree)adaptor.create(OPENBRAC142);
7183 adaptor.addChild(root_0, OPENBRAC142_tree);
7184 }
7185 // CTFParser.g:811:14: ( unaryExpression )?
7186 int alt45=2;
7187 int LA45_0 = input.LA(1);
7188
7189 if ( (LA45_0==ALIGNTOK||LA45_0==EVENTTOK||(LA45_0>=SIGNEDTOK && LA45_0<=STRINGTOK)||LA45_0==TRACETOK||(LA45_0>=ENVTOK && LA45_0<=CALLSITETOK)||LA45_0==SIGN||LA45_0==OCTAL_LITERAL||LA45_0==DECIMAL_LITERAL||LA45_0==HEX_LITERAL||LA45_0==CHARACTER_LITERAL||LA45_0==STRING_LITERAL||LA45_0==IDENTIFIER) ) {
7190 alt45=1;
7191 }
7192 switch (alt45) {
7193 case 1 :
7194 // CTFParser.g:811:14: unaryExpression
7195 {
7196 pushFollow(FOLLOW_unaryExpression_in_directAbstractDeclarator2839);
7197 unaryExpression143=unaryExpression();
7198
7199 state._fsp--;
7200 if (state.failed) {
7201 return retval;
7202 }
7203 if ( state.backtracking==0 ) {
7204 adaptor.addChild(root_0, unaryExpression143.getTree());
7205 }
7206
7207 }
7208 break;
7209
7210 }
7211
7212 CLOSEBRAC144=(Token)match(input,CLOSEBRAC,FOLLOW_CLOSEBRAC_in_directAbstractDeclarator2842); if (state.failed) {
7213 return retval;
7214 }
7215 if ( state.backtracking==0 ) {
7216 CLOSEBRAC144_tree = (CommonTree)adaptor.create(CLOSEBRAC144);
7217 adaptor.addChild(root_0, CLOSEBRAC144_tree);
7218 }
7219
7220 }
7221 break;
7222
7223 }
7224
7225
7226 }
7227
7228 retval.stop = input.LT(-1);
7229
7230 if ( state.backtracking==0 ) {
7231
7232 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
7233 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
7234 }
7235 if ( state.backtracking==0 ) {
7236
7237 debug_print(input.toString(retval.start,input.LT(-1)));
7238 exit("directAbstractDeclarator");
7239
7240 }
7241 }
7242
7243 catch (RecognitionException e)
7244 {
7245 throw e;
7246 }
7247 finally {
7248 }
7249 return retval;
7250 }
7251 // $ANTLR end "directAbstractDeclarator"
7252
7253 public static class pointer_return extends ParserRuleReturnScope {
7254 CommonTree tree;
7255 public Object getTree() { return tree; }
7256 };
7257
7258 // $ANTLR start "pointer"
7259 // CTFParser.g:815:1: pointer : POINTER ( typeQualifierList )? -> ^( POINTER ( typeQualifierList )? ) ;
7260 public final CTFParser.pointer_return pointer() throws RecognitionException {
7261 CTFParser.pointer_return retval = new CTFParser.pointer_return();
7262 retval.start = input.LT(1);
7263
7264 CommonTree root_0 = null;
7265
7266 Token POINTER145=null;
7267 CTFParser.typeQualifierList_return typeQualifierList146 = null;
7268
7269
7270 CommonTree POINTER145_tree=null;
7271 RewriteRuleTokenStream stream_POINTER=new RewriteRuleTokenStream(adaptor,"token POINTER");
7272 RewriteRuleSubtreeStream stream_typeQualifierList=new RewriteRuleSubtreeStream(adaptor,"rule typeQualifierList");
7273
7274 enter("pointer");
7275
7276 try {
7277 // CTFParser.g:823:1: ( POINTER ( typeQualifierList )? -> ^( POINTER ( typeQualifierList )? ) )
7278 // CTFParser.g:824:3: POINTER ( typeQualifierList )?
7279 {
7280 POINTER145=(Token)match(input,POINTER,FOLLOW_POINTER_in_pointer2870); if (state.failed) {
7281 return retval;
7282 }
7283 if ( state.backtracking==0 ) {
7284 stream_POINTER.add(POINTER145);
7285 }
7286
7287 // CTFParser.g:824:11: ( typeQualifierList )?
7288 int alt47=2;
7289 int LA47_0 = input.LA(1);
7290
7291 if ( (LA47_0==CONSTTOK) ) {
7292 alt47=1;
7293 }
7294 switch (alt47) {
7295 case 1 :
7296 // CTFParser.g:824:11: typeQualifierList
7297 {
7298 pushFollow(FOLLOW_typeQualifierList_in_pointer2872);
7299 typeQualifierList146=typeQualifierList();
7300
7301 state._fsp--;
7302 if (state.failed) {
7303 return retval;
7304 }
7305 if ( state.backtracking==0 ) {
7306 stream_typeQualifierList.add(typeQualifierList146.getTree());
7307 }
7308
7309 }
7310 break;
7311
7312 }
7313
7314
7315
7316 // AST REWRITE
7317 // elements: POINTER, typeQualifierList
7318 // token labels:
7319 // rule labels: retval
7320 // token list labels:
7321 // rule list labels:
7322 // wildcard labels:
7323 if ( state.backtracking==0 ) {
7324 retval.tree = root_0;
7325 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
7326
7327 root_0 = (CommonTree)adaptor.nil();
7328 // 824:30: -> ^( POINTER ( typeQualifierList )? )
7329 {
7330 // CTFParser.g:824:33: ^( POINTER ( typeQualifierList )? )
7331 {
7332 CommonTree root_1 = (CommonTree)adaptor.nil();
7333 root_1 = (CommonTree)adaptor.becomeRoot(stream_POINTER.nextNode(), root_1);
7334
7335 // CTFParser.g:824:43: ( typeQualifierList )?
7336 if ( stream_typeQualifierList.hasNext() ) {
7337 adaptor.addChild(root_1, stream_typeQualifierList.nextTree());
7338
7339 }
7340 stream_typeQualifierList.reset();
7341
7342 adaptor.addChild(root_0, root_1);
7343 }
7344
7345 }
7346
7347 retval.tree = root_0;}
7348 }
7349
7350 retval.stop = input.LT(-1);
7351
7352 if ( state.backtracking==0 ) {
7353
7354 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
7355 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
7356 }
7357 if ( state.backtracking==0 ) {
7358
7359 debug_print(input.toString(retval.start,input.LT(-1)));
7360 exit("pointer");
7361
7362 }
7363 }
7364
7365 catch (RecognitionException e)
7366 {
7367 throw e;
7368 }
7369 finally {
7370 }
7371 return retval;
7372 }
7373 // $ANTLR end "pointer"
7374
7375 public static class typeQualifierList_return extends ParserRuleReturnScope {
7376 CommonTree tree;
7377 public Object getTree() { return tree; }
7378 };
7379
7380 // $ANTLR start "typeQualifierList"
7381 // CTFParser.g:827:1: typeQualifierList : ( typeQualifier )+ ;
7382 public final CTFParser.typeQualifierList_return typeQualifierList() throws RecognitionException {
7383 CTFParser.typeQualifierList_return retval = new CTFParser.typeQualifierList_return();
7384 retval.start = input.LT(1);
7385
7386 CommonTree root_0 = null;
7387
7388 CTFParser.typeQualifier_return typeQualifier147 = null;
7389
7390
7391
7392 try {
7393 // CTFParser.g:827:19: ( ( typeQualifier )+ )
7394 // CTFParser.g:828:3: ( typeQualifier )+
7395 {
7396 root_0 = (CommonTree)adaptor.nil();
7397
7398 // CTFParser.g:828:3: ( typeQualifier )+
7399 int cnt48=0;
7400 loop48:
7401 do {
7402 int alt48=2;
7403 int LA48_0 = input.LA(1);
7404
7405 if ( (LA48_0==CONSTTOK) ) {
7406 alt48=1;
7407 }
7408
7409
7410 switch (alt48) {
7411 case 1 :
7412 // CTFParser.g:828:3: typeQualifier
7413 {
7414 pushFollow(FOLLOW_typeQualifier_in_typeQualifierList2895);
7415 typeQualifier147=typeQualifier();
7416
7417 state._fsp--;
7418 if (state.failed) {
7419 return retval;
7420 }
7421 if ( state.backtracking==0 ) {
7422 adaptor.addChild(root_0, typeQualifier147.getTree());
7423 }
7424
7425 }
7426 break;
7427
7428 default :
7429 if ( cnt48 >= 1 ) {
7430 break loop48;
7431 }
7432 if (state.backtracking>0) {state.failed=true; return retval;}
7433 EarlyExitException eee =
7434 new EarlyExitException(48, input);
7435 throw eee;
7436 }
7437 cnt48++;
7438 } while (true);
7439
7440
7441 }
7442
7443 retval.stop = input.LT(-1);
7444
7445 if ( state.backtracking==0 ) {
7446
7447 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
7448 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
7449 }
7450 }
7451
7452 catch (RecognitionException e)
7453 {
7454 throw e;
7455 }
7456 finally {
7457 }
7458 return retval;
7459 }
7460 // $ANTLR end "typeQualifierList"
7461
7462 public static class typedefName_return extends ParserRuleReturnScope {
7463 CommonTree tree;
7464 public Object getTree() { return tree; }
7465 };
7466
7467 // $ANTLR start "typedefName"
7468 // CTFParser.g:831:1: typedefName : {...}? IDENTIFIER ;
7469 public final CTFParser.typedefName_return typedefName() throws RecognitionException {
7470 CTFParser.typedefName_return retval = new CTFParser.typedefName_return();
7471 retval.start = input.LT(1);
7472
7473 CommonTree root_0 = null;
7474
7475 Token IDENTIFIER148=null;
7476
7477 CommonTree IDENTIFIER148_tree=null;
7478
7479
7480 enter("typedefName");
7481
7482 try {
7483 // CTFParser.g:839:1: ({...}? IDENTIFIER )
7484 // CTFParser.g:840:3: {...}? IDENTIFIER
7485 {
7486 root_0 = (CommonTree)adaptor.nil();
7487
7488 if ( !((inTypealiasAlias() || isTypeName(input.LT(1).getText()))) ) {
7489 if (state.backtracking>0) {state.failed=true; return retval;}
7490 throw new FailedPredicateException(input, "typedefName", "inTypealiasAlias() || isTypeName(input.LT(1).getText())");
7491 }
7492 IDENTIFIER148=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_typedefName2921); if (state.failed) {
7493 return retval;
7494 }
7495 if ( state.backtracking==0 ) {
7496 IDENTIFIER148_tree = (CommonTree)adaptor.create(IDENTIFIER148);
7497 adaptor.addChild(root_0, IDENTIFIER148_tree);
7498 }
7499 if ( state.backtracking==0 ) {
7500 if ((inTypedef() || inTypealiasAlias()) && !isTypeName((IDENTIFIER148!=null?IDENTIFIER148.getText():null))) { addTypeName((IDENTIFIER148!=null?IDENTIFIER148.getText():null)); }
7501 }
7502
7503 }
7504
7505 retval.stop = input.LT(-1);
7506
7507 if ( state.backtracking==0 ) {
7508
7509 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
7510 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
7511 }
7512 if ( state.backtracking==0 ) {
7513
7514 debug_print("typedefName: " + input.toString(retval.start,input.LT(-1)));
7515 exit("typedefName");
7516
7517 }
7518 }
7519
7520 catch (RecognitionException e)
7521 {
7522 throw e;
7523 }
7524 finally {
7525 }
7526 return retval;
7527 }
7528 // $ANTLR end "typedefName"
7529
7530 public static class typealiasTarget_return extends ParserRuleReturnScope {
7531 CommonTree tree;
7532 public Object getTree() { return tree; }
7533 };
7534
7535 // $ANTLR start "typealiasTarget"
7536 // CTFParser.g:843:1: typealiasTarget : declarationSpecifiers ( abstractDeclaratorList )? ;
7537 public final CTFParser.typealiasTarget_return typealiasTarget() throws RecognitionException {
7538 CTFParser.typealiasTarget_return retval = new CTFParser.typealiasTarget_return();
7539 retval.start = input.LT(1);
7540
7541 CommonTree root_0 = null;
7542
7543 CTFParser.declarationSpecifiers_return declarationSpecifiers149 = null;
7544
7545 CTFParser.abstractDeclaratorList_return abstractDeclaratorList150 = null;
7546
7547
7548
7549
7550 enter("typealiasTarget");
7551
7552 try {
7553 // CTFParser.g:856:1: ( declarationSpecifiers ( abstractDeclaratorList )? )
7554 // CTFParser.g:857:3: declarationSpecifiers ( abstractDeclaratorList )?
7555 {
7556 root_0 = (CommonTree)adaptor.nil();
7557
7558 pushFollow(FOLLOW_declarationSpecifiers_in_typealiasTarget2949);
7559 declarationSpecifiers149=declarationSpecifiers();
7560
7561 state._fsp--;
7562 if (state.failed) {
7563 return retval;
7564 }
7565 if ( state.backtracking==0 ) {
7566 adaptor.addChild(root_0, declarationSpecifiers149.getTree());
7567 }
7568 // CTFParser.g:857:25: ( abstractDeclaratorList )?
7569 int alt49=2;
7570 int LA49_0 = input.LA(1);
7571
7572 if ( (LA49_0==LPAREN||LA49_0==POINTER||LA49_0==IDENTIFIER) ) {
7573 alt49=1;
7574 }
7575 switch (alt49) {
7576 case 1 :
7577 // CTFParser.g:857:25: abstractDeclaratorList
7578 {
7579 pushFollow(FOLLOW_abstractDeclaratorList_in_typealiasTarget2951);
7580 abstractDeclaratorList150=abstractDeclaratorList();
7581
7582 state._fsp--;
7583 if (state.failed) {
7584 return retval;
7585 }
7586 if ( state.backtracking==0 ) {
7587 adaptor.addChild(root_0, abstractDeclaratorList150.getTree());
7588 }
7589
7590 }
7591 break;
7592
7593 }
7594
7595
7596 }
7597
7598 retval.stop = input.LT(-1);
7599
7600 if ( state.backtracking==0 ) {
7601
7602 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
7603 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
7604 }
7605 if ( state.backtracking==0 ) {
7606
7607 exit("typealiasTarget");
7608
7609 }
7610 }
7611
7612 catch (RecognitionException e)
7613 {
7614 throw e;
7615 }
7616 finally {
7617 }
7618 return retval;
7619 }
7620 // $ANTLR end "typealiasTarget"
7621
7622 public static class typealiasAlias_return extends ParserRuleReturnScope {
7623 CommonTree tree;
7624 public Object getTree() { return tree; }
7625 };
7626
7627 // $ANTLR start "typealiasAlias"
7628 // CTFParser.g:860:1: typealiasAlias : ( abstractDeclaratorList | ( declarationSpecifiers ( abstractDeclaratorList )? ) ) ;
7629 public final CTFParser.typealiasAlias_return typealiasAlias() throws RecognitionException {
7630 CTFParser.typealiasAlias_return retval = new CTFParser.typealiasAlias_return();
7631 retval.start = input.LT(1);
7632
7633 CommonTree root_0 = null;
7634
7635 CTFParser.abstractDeclaratorList_return abstractDeclaratorList151 = null;
7636
7637 CTFParser.declarationSpecifiers_return declarationSpecifiers152 = null;
7638
7639 CTFParser.abstractDeclaratorList_return abstractDeclaratorList153 = null;
7640
7641
7642
7643
7644 enter("typealiasAlias");
7645 typealiasAliasOn();
7646
7647 try {
7648 // CTFParser.g:875:1: ( ( abstractDeclaratorList | ( declarationSpecifiers ( abstractDeclaratorList )? ) ) )
7649 // CTFParser.g:876:3: ( abstractDeclaratorList | ( declarationSpecifiers ( abstractDeclaratorList )? ) )
7650 {
7651 root_0 = (CommonTree)adaptor.nil();
7652
7653 // CTFParser.g:876:3: ( abstractDeclaratorList | ( declarationSpecifiers ( abstractDeclaratorList )? ) )
7654 int alt51=2;
7655 switch ( input.LA(1) ) {
7656 case LPAREN:
7657 case POINTER:
7658 {
7659 alt51=1;
7660 }
7661 break;
7662 case IDENTIFIER:
7663 {
7664 int LA51_2 = input.LA(2);
7665
7666 if ( (!(((inTypealiasAlias() || isTypeName(input.LT(1).getText()))))) ) {
7667 alt51=1;
7668 }
7669 else if ( ((inTypealiasAlias() || isTypeName(input.LT(1).getText()))) ) {
7670 alt51=2;
7671 }
7672 else {
7673 if (state.backtracking>0) {state.failed=true; return retval;}
7674 NoViableAltException nvae =
7675 new NoViableAltException("", 51, 2, input);
7676
7677 throw nvae;
7678 }
7679 }
7680 break;
7681 case CONSTTOK:
7682 case CHARTOK:
7683 case DOUBLETOK:
7684 case ENUMTOK:
7685 case FLOATINGPOINTTOK:
7686 case FLOATTOK:
7687 case INTEGERTOK:
7688 case INTTOK:
7689 case LONGTOK:
7690 case SHORTTOK:
7691 case SIGNEDTOK:
7692 case STRINGTOK:
7693 case STRUCTTOK:
7694 case TYPEDEFTOK:
7695 case UNSIGNEDTOK:
7696 case VARIANTTOK:
7697 case VOIDTOK:
7698 case BOOLTOK:
7699 case COMPLEXTOK:
7700 case IMAGINARYTOK:
7701 {
7702 alt51=2;
7703 }
7704 break;
7705 default:
7706 if (state.backtracking>0) {state.failed=true; return retval;}
7707 NoViableAltException nvae =
7708 new NoViableAltException("", 51, 0, input);
7709
7710 throw nvae;
7711 }
7712
7713 switch (alt51) {
7714 case 1 :
7715 // CTFParser.g:877:3: abstractDeclaratorList
7716 {
7717 pushFollow(FOLLOW_abstractDeclaratorList_in_typealiasAlias2984);
7718 abstractDeclaratorList151=abstractDeclaratorList();
7719
7720 state._fsp--;
7721 if (state.failed) {
7722 return retval;
7723 }
7724 if ( state.backtracking==0 ) {
7725 adaptor.addChild(root_0, abstractDeclaratorList151.getTree());
7726 }
7727
7728 }
7729 break;
7730 case 2 :
7731 // CTFParser.g:879:3: ( declarationSpecifiers ( abstractDeclaratorList )? )
7732 {
7733 // CTFParser.g:879:3: ( declarationSpecifiers ( abstractDeclaratorList )? )
7734 // CTFParser.g:879:4: declarationSpecifiers ( abstractDeclaratorList )?
7735 {
7736 pushFollow(FOLLOW_declarationSpecifiers_in_typealiasAlias2993);
7737 declarationSpecifiers152=declarationSpecifiers();
7738
7739 state._fsp--;
7740 if (state.failed) {
7741 return retval;
7742 }
7743 if ( state.backtracking==0 ) {
7744 adaptor.addChild(root_0, declarationSpecifiers152.getTree());
7745 }
7746 // CTFParser.g:879:26: ( abstractDeclaratorList )?
7747 int alt50=2;
7748 int LA50_0 = input.LA(1);
7749
7750 if ( (LA50_0==LPAREN||LA50_0==POINTER||LA50_0==IDENTIFIER) ) {
7751 alt50=1;
7752 }
7753 switch (alt50) {
7754 case 1 :
7755 // CTFParser.g:879:26: abstractDeclaratorList
7756 {
7757 pushFollow(FOLLOW_abstractDeclaratorList_in_typealiasAlias2995);
7758 abstractDeclaratorList153=abstractDeclaratorList();
7759
7760 state._fsp--;
7761 if (state.failed) {
7762 return retval;
7763 }
7764 if ( state.backtracking==0 ) {
7765 adaptor.addChild(root_0, abstractDeclaratorList153.getTree());
7766 }
7767
7768 }
7769 break;
7770
7771 }
7772
7773
7774 }
7775
7776
7777 }
7778 break;
7779
7780 }
7781
7782
7783 }
7784
7785 retval.stop = input.LT(-1);
7786
7787 if ( state.backtracking==0 ) {
7788
7789 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
7790 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
7791 }
7792 if ( state.backtracking==0 ) {
7793
7794 exit("typealiasAlias");
7795 typealiasAliasOff();
7796
7797 }
7798 }
7799
7800 catch (RecognitionException e)
7801 {
7802 throw e;
7803 }
7804 finally {
7805 }
7806 return retval;
7807 }
7808 // $ANTLR end "typealiasAlias"
7809
7810 public static class typealiasDecl_return extends ParserRuleReturnScope {
7811 CommonTree tree;
7812 public Object getTree() { return tree; }
7813 };
7814
7815 // $ANTLR start "typealiasDecl"
7816 // CTFParser.g:883:1: typealiasDecl : TYPEALIASTOK typealiasTarget TYPE_ASSIGNMENT typealiasAlias -> ^( TYPEALIAS ^( TYPEALIAS_TARGET typealiasTarget ) ^( TYPEALIAS_ALIAS typealiasAlias ) ) ;
7817 public final CTFParser.typealiasDecl_return typealiasDecl() throws RecognitionException {
7818 CTFParser.typealiasDecl_return retval = new CTFParser.typealiasDecl_return();
7819 retval.start = input.LT(1);
7820
7821 CommonTree root_0 = null;
7822
7823 Token TYPEALIASTOK154=null;
7824 Token TYPE_ASSIGNMENT156=null;
7825 CTFParser.typealiasTarget_return typealiasTarget155 = null;
7826
7827 CTFParser.typealiasAlias_return typealiasAlias157 = null;
7828
7829
7830 CommonTree TYPEALIASTOK154_tree=null;
7831 CommonTree TYPE_ASSIGNMENT156_tree=null;
7832 RewriteRuleTokenStream stream_TYPE_ASSIGNMENT=new RewriteRuleTokenStream(adaptor,"token TYPE_ASSIGNMENT");
7833 RewriteRuleTokenStream stream_TYPEALIASTOK=new RewriteRuleTokenStream(adaptor,"token TYPEALIASTOK");
7834 RewriteRuleSubtreeStream stream_typealiasAlias=new RewriteRuleSubtreeStream(adaptor,"rule typealiasAlias");
7835 RewriteRuleSubtreeStream stream_typealiasTarget=new RewriteRuleSubtreeStream(adaptor,"rule typealiasTarget");
7836
7837 enter("typealiasDecl");
7838
7839 try {
7840 // CTFParser.g:890:1: ( TYPEALIASTOK typealiasTarget TYPE_ASSIGNMENT typealiasAlias -> ^( TYPEALIAS ^( TYPEALIAS_TARGET typealiasTarget ) ^( TYPEALIAS_ALIAS typealiasAlias ) ) )
7841 // CTFParser.g:891:3: TYPEALIASTOK typealiasTarget TYPE_ASSIGNMENT typealiasAlias
7842 {
7843 TYPEALIASTOK154=(Token)match(input,TYPEALIASTOK,FOLLOW_TYPEALIASTOK_in_typealiasDecl3027); if (state.failed) {
7844 return retval;
7845 }
7846 if ( state.backtracking==0 ) {
7847 stream_TYPEALIASTOK.add(TYPEALIASTOK154);
7848 }
7849
7850 pushFollow(FOLLOW_typealiasTarget_in_typealiasDecl3029);
7851 typealiasTarget155=typealiasTarget();
7852
7853 state._fsp--;
7854 if (state.failed) {
7855 return retval;
7856 }
7857 if ( state.backtracking==0 ) {
7858 stream_typealiasTarget.add(typealiasTarget155.getTree());
7859 }
7860 TYPE_ASSIGNMENT156=(Token)match(input,TYPE_ASSIGNMENT,FOLLOW_TYPE_ASSIGNMENT_in_typealiasDecl3031); if (state.failed) {
7861 return retval;
7862 }
7863 if ( state.backtracking==0 ) {
7864 stream_TYPE_ASSIGNMENT.add(TYPE_ASSIGNMENT156);
7865 }
7866
7867 pushFollow(FOLLOW_typealiasAlias_in_typealiasDecl3033);
7868 typealiasAlias157=typealiasAlias();
7869
7870 state._fsp--;
7871 if (state.failed) {
7872 return retval;
7873 }
7874 if ( state.backtracking==0 ) {
7875 stream_typealiasAlias.add(typealiasAlias157.getTree());
7876 }
7877
7878
7879 // AST REWRITE
7880 // elements: typealiasAlias, typealiasTarget
7881 // token labels:
7882 // rule labels: retval
7883 // token list labels:
7884 // rule list labels:
7885 // wildcard labels:
7886 if ( state.backtracking==0 ) {
7887 retval.tree = root_0;
7888 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
7889
7890 root_0 = (CommonTree)adaptor.nil();
7891 // 892:3: -> ^( TYPEALIAS ^( TYPEALIAS_TARGET typealiasTarget ) ^( TYPEALIAS_ALIAS typealiasAlias ) )
7892 {
7893 // CTFParser.g:892:6: ^( TYPEALIAS ^( TYPEALIAS_TARGET typealiasTarget ) ^( TYPEALIAS_ALIAS typealiasAlias ) )
7894 {
7895 CommonTree root_1 = (CommonTree)adaptor.nil();
7896 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPEALIAS, "TYPEALIAS"), root_1);
7897
7898 // CTFParser.g:892:18: ^( TYPEALIAS_TARGET typealiasTarget )
7899 {
7900 CommonTree root_2 = (CommonTree)adaptor.nil();
7901 root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPEALIAS_TARGET, "TYPEALIAS_TARGET"), root_2);
7902
7903 adaptor.addChild(root_2, stream_typealiasTarget.nextTree());
7904
7905 adaptor.addChild(root_1, root_2);
7906 }
7907 // CTFParser.g:892:54: ^( TYPEALIAS_ALIAS typealiasAlias )
7908 {
7909 CommonTree root_2 = (CommonTree)adaptor.nil();
7910 root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPEALIAS_ALIAS, "TYPEALIAS_ALIAS"), root_2);
7911
7912 adaptor.addChild(root_2, stream_typealiasAlias.nextTree());
7913
7914 adaptor.addChild(root_1, root_2);
7915 }
7916
7917 adaptor.addChild(root_0, root_1);
7918 }
7919
7920 }
7921
7922 retval.tree = root_0;}
7923 }
7924
7925 retval.stop = input.LT(-1);
7926
7927 if ( state.backtracking==0 ) {
7928
7929 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
7930 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
7931 }
7932 if ( state.backtracking==0 ) {
7933
7934 exit("typealiasDecl");
7935
7936 }
7937 }
7938
7939 catch (RecognitionException e)
7940 {
7941 throw e;
7942 }
7943 finally {
7944 }
7945 return retval;
7946 }
7947 // $ANTLR end "typealiasDecl"
7948
7949 public static class ctfKeyword_return extends ParserRuleReturnScope {
7950 CommonTree tree;
7951 public Object getTree() { return tree; }
7952 };
7953
7954 // $ANTLR start "ctfKeyword"
7955 // CTFParser.g:898:1: ctfKeyword : ( ALIGNTOK | EVENTTOK | SIGNEDTOK | STRINGTOK );
7956 public final CTFParser.ctfKeyword_return ctfKeyword() throws RecognitionException {
7957 CTFParser.ctfKeyword_return retval = new CTFParser.ctfKeyword_return();
7958 retval.start = input.LT(1);
7959
7960 CommonTree root_0 = null;
7961
7962 Token set158=null;
7963
7964 CommonTree set158_tree=null;
7965
7966
7967 enter("ctfKeyword");
7968
7969 try {
7970 // CTFParser.g:906:1: ( ALIGNTOK | EVENTTOK | SIGNEDTOK | STRINGTOK )
7971 // CTFParser.g:
7972 {
7973 root_0 = (CommonTree)adaptor.nil();
7974
7975 set158=(Token)input.LT(1);
7976 if ( input.LA(1)==ALIGNTOK||input.LA(1)==EVENTTOK||input.LA(1)==SIGNEDTOK||input.LA(1)==STRINGTOK ) {
7977 input.consume();
7978 if ( state.backtracking==0 ) {
7979 adaptor.addChild(root_0, (CommonTree)adaptor.create(set158));
7980 }
7981 state.errorRecovery=false;state.failed=false;
7982 }
7983 else {
7984 if (state.backtracking>0) {state.failed=true; return retval;}
7985 MismatchedSetException mse = new MismatchedSetException(null,input);
7986 throw mse;
7987 }
7988
7989
7990 }
7991
7992 retval.stop = input.LT(-1);
7993
7994 if ( state.backtracking==0 ) {
7995
7996 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
7997 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
7998 }
7999 if ( state.backtracking==0 ) {
8000
8001 debug_print(input.toString(retval.start,input.LT(-1)));
8002 exit("ctfKeyword");
8003
8004 }
8005 }
8006
8007 catch (RecognitionException e)
8008 {
8009 throw e;
8010 }
8011 finally {
8012 }
8013 return retval;
8014 }
8015 // $ANTLR end "ctfKeyword"
8016
8017 public static class ctfSpecifier_return extends ParserRuleReturnScope {
8018 CommonTree tree;
8019 public Object getTree() { return tree; }
8020 };
8021
8022 // $ANTLR start "ctfSpecifier"
8023 // CTFParser.g:913:1: ctfSpecifier : ( ctfSpecifierHead ctfBody -> ^( ctfSpecifierHead ctfBody ) | typealiasDecl -> ^( DECLARATION typealiasDecl ) );
8024 public final CTFParser.ctfSpecifier_return ctfSpecifier() throws RecognitionException {
8025 CTFParser.ctfSpecifier_return retval = new CTFParser.ctfSpecifier_return();
8026 retval.start = input.LT(1);
8027
8028 CommonTree root_0 = null;
8029
8030 CTFParser.ctfSpecifierHead_return ctfSpecifierHead159 = null;
8031
8032 CTFParser.ctfBody_return ctfBody160 = null;
8033
8034 CTFParser.typealiasDecl_return typealiasDecl161 = null;
8035
8036
8037 RewriteRuleSubtreeStream stream_ctfSpecifierHead=new RewriteRuleSubtreeStream(adaptor,"rule ctfSpecifierHead");
8038 RewriteRuleSubtreeStream stream_typealiasDecl=new RewriteRuleSubtreeStream(adaptor,"rule typealiasDecl");
8039 RewriteRuleSubtreeStream stream_ctfBody=new RewriteRuleSubtreeStream(adaptor,"rule ctfBody");
8040
8041 enter("ctfSpecifier");
8042
8043 try {
8044 // CTFParser.g:920:3: ( ctfSpecifierHead ctfBody -> ^( ctfSpecifierHead ctfBody ) | typealiasDecl -> ^( DECLARATION typealiasDecl ) )
8045 int alt52=2;
8046 int LA52_0 = input.LA(1);
8047
8048 if ( (LA52_0==EVENTTOK||LA52_0==STREAMTOK||LA52_0==TRACETOK||(LA52_0>=ENVTOK && LA52_0<=CALLSITETOK)) ) {
8049 alt52=1;
8050 }
8051 else if ( (LA52_0==TYPEALIASTOK) ) {
8052 alt52=2;
8053 }
8054 else {
8055 if (state.backtracking>0) {state.failed=true; return retval;}
8056 NoViableAltException nvae =
8057 new NoViableAltException("", 52, 0, input);
8058
8059 throw nvae;
8060 }
8061 switch (alt52) {
8062 case 1 :
8063 // CTFParser.g:922:3: ctfSpecifierHead ctfBody
8064 {
8065 pushFollow(FOLLOW_ctfSpecifierHead_in_ctfSpecifier3127);
8066 ctfSpecifierHead159=ctfSpecifierHead();
8067
8068 state._fsp--;
8069 if (state.failed) {
8070 return retval;
8071 }
8072 if ( state.backtracking==0 ) {
8073 stream_ctfSpecifierHead.add(ctfSpecifierHead159.getTree());
8074 }
8075 pushFollow(FOLLOW_ctfBody_in_ctfSpecifier3129);
8076 ctfBody160=ctfBody();
8077
8078 state._fsp--;
8079 if (state.failed) {
8080 return retval;
8081 }
8082 if ( state.backtracking==0 ) {
8083 stream_ctfBody.add(ctfBody160.getTree());
8084 }
8085
8086
8087 // AST REWRITE
8088 // elements: ctfSpecifierHead, ctfBody
8089 // token labels:
8090 // rule labels: retval
8091 // token list labels:
8092 // rule list labels:
8093 // wildcard labels:
8094 if ( state.backtracking==0 ) {
8095 retval.tree = root_0;
8096 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
8097
8098 root_0 = (CommonTree)adaptor.nil();
8099 // 922:28: -> ^( ctfSpecifierHead ctfBody )
8100 {
8101 // CTFParser.g:922:31: ^( ctfSpecifierHead ctfBody )
8102 {
8103 CommonTree root_1 = (CommonTree)adaptor.nil();
8104 root_1 = (CommonTree)adaptor.becomeRoot(stream_ctfSpecifierHead.nextNode(), root_1);
8105
8106 adaptor.addChild(root_1, stream_ctfBody.nextTree());
8107
8108 adaptor.addChild(root_0, root_1);
8109 }
8110
8111 }
8112
8113 retval.tree = root_0;}
8114 }
8115 break;
8116 case 2 :
8117 // CTFParser.g:925:3: typealiasDecl
8118 {
8119 pushFollow(FOLLOW_typealiasDecl_in_ctfSpecifier3148);
8120 typealiasDecl161=typealiasDecl();
8121
8122 state._fsp--;
8123 if (state.failed) {
8124 return retval;
8125 }
8126 if ( state.backtracking==0 ) {
8127 stream_typealiasDecl.add(typealiasDecl161.getTree());
8128 }
8129
8130
8131 // AST REWRITE
8132 // elements: typealiasDecl
8133 // token labels:
8134 // rule labels: retval
8135 // token list labels:
8136 // rule list labels:
8137 // wildcard labels:
8138 if ( state.backtracking==0 ) {
8139 retval.tree = root_0;
8140 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
8141
8142 root_0 = (CommonTree)adaptor.nil();
8143 // 925:17: -> ^( DECLARATION typealiasDecl )
8144 {
8145 // CTFParser.g:925:20: ^( DECLARATION typealiasDecl )
8146 {
8147 CommonTree root_1 = (CommonTree)adaptor.nil();
8148 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(DECLARATION, "DECLARATION"), root_1);
8149
8150 adaptor.addChild(root_1, stream_typealiasDecl.nextTree());
8151
8152 adaptor.addChild(root_0, root_1);
8153 }
8154
8155 }
8156
8157 retval.tree = root_0;}
8158 }
8159 break;
8160
8161 }
8162 retval.stop = input.LT(-1);
8163
8164 if ( state.backtracking==0 ) {
8165
8166 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
8167 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
8168 }
8169 if ( state.backtracking==0 ) {
8170
8171 exit("ctfSpecifier");
8172
8173 }
8174 }
8175
8176 catch (RecognitionException e)
8177 {
8178 throw e;
8179 }
8180 finally {
8181 }
8182 return retval;
8183 }
8184 // $ANTLR end "ctfSpecifier"
8185
8186 public static class ctfSpecifierHead_return extends ParserRuleReturnScope {
8187 CommonTree tree;
8188 public Object getTree() { return tree; }
8189 };
8190
8191 // $ANTLR start "ctfSpecifierHead"
8192 // CTFParser.g:928:1: ctfSpecifierHead : ( EVENTTOK -> EVENT | STREAMTOK -> STREAM | TRACETOK -> TRACE | ENVTOK -> ENV | CLOCKTOK -> CLOCK | CALLSITETOK -> CALLSITE );
8193 public final CTFParser.ctfSpecifierHead_return ctfSpecifierHead() throws RecognitionException {
8194 CTFParser.ctfSpecifierHead_return retval = new CTFParser.ctfSpecifierHead_return();
8195 retval.start = input.LT(1);
8196
8197 CommonTree root_0 = null;
8198
8199 Token EVENTTOK162=null;
8200 Token STREAMTOK163=null;
8201 Token TRACETOK164=null;
8202 Token ENVTOK165=null;
8203 Token CLOCKTOK166=null;
8204 Token CALLSITETOK167=null;
8205
8206 CommonTree EVENTTOK162_tree=null;
8207 CommonTree STREAMTOK163_tree=null;
8208 CommonTree TRACETOK164_tree=null;
8209 CommonTree ENVTOK165_tree=null;
8210 CommonTree CLOCKTOK166_tree=null;
8211 CommonTree CALLSITETOK167_tree=null;
8212 RewriteRuleTokenStream stream_EVENTTOK=new RewriteRuleTokenStream(adaptor,"token EVENTTOK");
8213 RewriteRuleTokenStream stream_CALLSITETOK=new RewriteRuleTokenStream(adaptor,"token CALLSITETOK");
8214 RewriteRuleTokenStream stream_STREAMTOK=new RewriteRuleTokenStream(adaptor,"token STREAMTOK");
8215 RewriteRuleTokenStream stream_ENVTOK=new RewriteRuleTokenStream(adaptor,"token ENVTOK");
8216 RewriteRuleTokenStream stream_CLOCKTOK=new RewriteRuleTokenStream(adaptor,"token CLOCKTOK");
8217 RewriteRuleTokenStream stream_TRACETOK=new RewriteRuleTokenStream(adaptor,"token TRACETOK");
8218
8219
8220 enter("ctfSpecifierHead");
8221
8222 try {
8223 // CTFParser.g:936:1: ( EVENTTOK -> EVENT | STREAMTOK -> STREAM | TRACETOK -> TRACE | ENVTOK -> ENV | CLOCKTOK -> CLOCK | CALLSITETOK -> CALLSITE )
8224 int alt53=6;
8225 switch ( input.LA(1) ) {
8226 case EVENTTOK:
8227 {
8228 alt53=1;
8229 }
8230 break;
8231 case STREAMTOK:
8232 {
8233 alt53=2;
8234 }
8235 break;
8236 case TRACETOK:
8237 {
8238 alt53=3;
8239 }
8240 break;
8241 case ENVTOK:
8242 {
8243 alt53=4;
8244 }
8245 break;
8246 case CLOCKTOK:
8247 {
8248 alt53=5;
8249 }
8250 break;
8251 case CALLSITETOK:
8252 {
8253 alt53=6;
8254 }
8255 break;
8256 default:
8257 if (state.backtracking>0) {state.failed=true; return retval;}
8258 NoViableAltException nvae =
8259 new NoViableAltException("", 53, 0, input);
8260
8261 throw nvae;
8262 }
8263
8264 switch (alt53) {
8265 case 1 :
8266 // CTFParser.g:937:4: EVENTTOK
8267 {
8268 EVENTTOK162=(Token)match(input,EVENTTOK,FOLLOW_EVENTTOK_in_ctfSpecifierHead3180); if (state.failed) {
8269 return retval;
8270 }
8271 if ( state.backtracking==0 ) {
8272 stream_EVENTTOK.add(EVENTTOK162);
8273 }
8274
8275
8276
8277 // AST REWRITE
8278 // elements:
8279 // token labels:
8280 // rule labels: retval
8281 // token list labels:
8282 // rule list labels:
8283 // wildcard labels:
8284 if ( state.backtracking==0 ) {
8285 retval.tree = root_0;
8286 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
8287
8288 root_0 = (CommonTree)adaptor.nil();
8289 // 937:13: -> EVENT
8290 {
8291 adaptor.addChild(root_0, (CommonTree)adaptor.create(EVENT, "EVENT"));
8292
8293 }
8294
8295 retval.tree = root_0;}
8296 }
8297 break;
8298 case 2 :
8299 // CTFParser.g:938:4: STREAMTOK
8300 {
8301 STREAMTOK163=(Token)match(input,STREAMTOK,FOLLOW_STREAMTOK_in_ctfSpecifierHead3189); if (state.failed) {
8302 return retval;
8303 }
8304 if ( state.backtracking==0 ) {
8305 stream_STREAMTOK.add(STREAMTOK163);
8306 }
8307
8308
8309
8310 // AST REWRITE
8311 // elements:
8312 // token labels:
8313 // rule labels: retval
8314 // token list labels:
8315 // rule list labels:
8316 // wildcard labels:
8317 if ( state.backtracking==0 ) {
8318 retval.tree = root_0;
8319 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
8320
8321 root_0 = (CommonTree)adaptor.nil();
8322 // 938:14: -> STREAM
8323 {
8324 adaptor.addChild(root_0, (CommonTree)adaptor.create(STREAM, "STREAM"));
8325
8326 }
8327
8328 retval.tree = root_0;}
8329 }
8330 break;
8331 case 3 :
8332 // CTFParser.g:939:4: TRACETOK
8333 {
8334 TRACETOK164=(Token)match(input,TRACETOK,FOLLOW_TRACETOK_in_ctfSpecifierHead3198); if (state.failed) {
8335 return retval;
8336 }
8337 if ( state.backtracking==0 ) {
8338 stream_TRACETOK.add(TRACETOK164);
8339 }
8340
8341
8342
8343 // AST REWRITE
8344 // elements:
8345 // token labels:
8346 // rule labels: retval
8347 // token list labels:
8348 // rule list labels:
8349 // wildcard labels:
8350 if ( state.backtracking==0 ) {
8351 retval.tree = root_0;
8352 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
8353
8354 root_0 = (CommonTree)adaptor.nil();
8355 // 939:13: -> TRACE
8356 {
8357 adaptor.addChild(root_0, (CommonTree)adaptor.create(TRACE, "TRACE"));
8358
8359 }
8360
8361 retval.tree = root_0;}
8362 }
8363 break;
8364 case 4 :
8365 // CTFParser.g:940:4: ENVTOK
8366 {
8367 ENVTOK165=(Token)match(input,ENVTOK,FOLLOW_ENVTOK_in_ctfSpecifierHead3207); if (state.failed) {
8368 return retval;
8369 }
8370 if ( state.backtracking==0 ) {
8371 stream_ENVTOK.add(ENVTOK165);
8372 }
8373
8374
8375
8376 // AST REWRITE
8377 // elements:
8378 // token labels:
8379 // rule labels: retval
8380 // token list labels:
8381 // rule list labels:
8382 // wildcard labels:
8383 if ( state.backtracking==0 ) {
8384 retval.tree = root_0;
8385 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
8386
8387 root_0 = (CommonTree)adaptor.nil();
8388 // 940:11: -> ENV
8389 {
8390 adaptor.addChild(root_0, (CommonTree)adaptor.create(ENV, "ENV"));
8391
8392 }
8393
8394 retval.tree = root_0;}
8395 }
8396 break;
8397 case 5 :
8398 // CTFParser.g:941:4: CLOCKTOK
8399 {
8400 CLOCKTOK166=(Token)match(input,CLOCKTOK,FOLLOW_CLOCKTOK_in_ctfSpecifierHead3216); if (state.failed) {
8401 return retval;
8402 }
8403 if ( state.backtracking==0 ) {
8404 stream_CLOCKTOK.add(CLOCKTOK166);
8405 }
8406
8407
8408
8409 // AST REWRITE
8410 // elements:
8411 // token labels:
8412 // rule labels: retval
8413 // token list labels:
8414 // rule list labels:
8415 // wildcard labels:
8416 if ( state.backtracking==0 ) {
8417 retval.tree = root_0;
8418 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
8419
8420 root_0 = (CommonTree)adaptor.nil();
8421 // 941:13: -> CLOCK
8422 {
8423 adaptor.addChild(root_0, (CommonTree)adaptor.create(CLOCK, "CLOCK"));
8424
8425 }
8426
8427 retval.tree = root_0;}
8428 }
8429 break;
8430 case 6 :
8431 // CTFParser.g:942:4: CALLSITETOK
8432 {
8433 CALLSITETOK167=(Token)match(input,CALLSITETOK,FOLLOW_CALLSITETOK_in_ctfSpecifierHead3225); if (state.failed) {
8434 return retval;
8435 }
8436 if ( state.backtracking==0 ) {
8437 stream_CALLSITETOK.add(CALLSITETOK167);
8438 }
8439
8440
8441
8442 // AST REWRITE
8443 // elements:
8444 // token labels:
8445 // rule labels: retval
8446 // token list labels:
8447 // rule list labels:
8448 // wildcard labels:
8449 if ( state.backtracking==0 ) {
8450 retval.tree = root_0;
8451 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
8452
8453 root_0 = (CommonTree)adaptor.nil();
8454 // 942:16: -> CALLSITE
8455 {
8456 adaptor.addChild(root_0, (CommonTree)adaptor.create(CALLSITE, "CALLSITE"));
8457
8458 }
8459
8460 retval.tree = root_0;}
8461 }
8462 break;
8463
8464 }
8465 retval.stop = input.LT(-1);
8466
8467 if ( state.backtracking==0 ) {
8468
8469 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
8470 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
8471 }
8472 if ( state.backtracking==0 ) {
8473
8474 debug_print(input.toString(retval.start,input.LT(-1)));
8475 exit("ctfSpecifierHead");
8476
8477 }
8478 }
8479
8480 catch (RecognitionException e)
8481 {
8482 throw e;
8483 }
8484 finally {
8485 }
8486 return retval;
8487 }
8488 // $ANTLR end "ctfSpecifierHead"
8489
8490 public static class ctfTypeSpecifier_return extends ParserRuleReturnScope {
8491 CommonTree tree;
8492 public Object getTree() { return tree; }
8493 };
8494
8495 // $ANTLR start "ctfTypeSpecifier"
8496 // CTFParser.g:945:1: ctfTypeSpecifier : ( FLOATINGPOINTTOK ctfBody -> ^( FLOATING_POINT ( ctfBody )? ) | INTEGERTOK ctfBody -> ^( INTEGER ( ctfBody )? ) | STRINGTOK ( ctfBody )? -> ^( STRING ( ctfBody )? ) );
8497 public final CTFParser.ctfTypeSpecifier_return ctfTypeSpecifier() throws RecognitionException {
8498 CTFParser.ctfTypeSpecifier_return retval = new CTFParser.ctfTypeSpecifier_return();
8499 retval.start = input.LT(1);
8500
8501 CommonTree root_0 = null;
8502
8503 Token FLOATINGPOINTTOK168=null;
8504 Token INTEGERTOK170=null;
8505 Token STRINGTOK172=null;
8506 CTFParser.ctfBody_return ctfBody169 = null;
8507
8508 CTFParser.ctfBody_return ctfBody171 = null;
8509
8510 CTFParser.ctfBody_return ctfBody173 = null;
8511
8512
8513 CommonTree FLOATINGPOINTTOK168_tree=null;
8514 CommonTree INTEGERTOK170_tree=null;
8515 CommonTree STRINGTOK172_tree=null;
8516 RewriteRuleTokenStream stream_FLOATINGPOINTTOK=new RewriteRuleTokenStream(adaptor,"token FLOATINGPOINTTOK");
8517 RewriteRuleTokenStream stream_STRINGTOK=new RewriteRuleTokenStream(adaptor,"token STRINGTOK");
8518 RewriteRuleTokenStream stream_INTEGERTOK=new RewriteRuleTokenStream(adaptor,"token INTEGERTOK");
8519 RewriteRuleSubtreeStream stream_ctfBody=new RewriteRuleSubtreeStream(adaptor,"rule ctfBody");
8520
8521 enter("ctfTypeSpecifier");
8522
8523 try {
8524 // CTFParser.g:952:1: ( FLOATINGPOINTTOK ctfBody -> ^( FLOATING_POINT ( ctfBody )? ) | INTEGERTOK ctfBody -> ^( INTEGER ( ctfBody )? ) | STRINGTOK ( ctfBody )? -> ^( STRING ( ctfBody )? ) )
8525 int alt55=3;
8526 switch ( input.LA(1) ) {
8527 case FLOATINGPOINTTOK:
8528 {
8529 alt55=1;
8530 }
8531 break;
8532 case INTEGERTOK:
8533 {
8534 alt55=2;
8535 }
8536 break;
8537 case STRINGTOK:
8538 {
8539 alt55=3;
8540 }
8541 break;
8542 default:
8543 if (state.backtracking>0) {state.failed=true; return retval;}
8544 NoViableAltException nvae =
8545 new NoViableAltException("", 55, 0, input);
8546
8547 throw nvae;
8548 }
8549
8550 switch (alt55) {
8551 case 1 :
8552 // CTFParser.g:954:5: FLOATINGPOINTTOK ctfBody
8553 {
8554 FLOATINGPOINTTOK168=(Token)match(input,FLOATINGPOINTTOK,FOLLOW_FLOATINGPOINTTOK_in_ctfTypeSpecifier3259); if (state.failed) {
8555 return retval;
8556 }
8557 if ( state.backtracking==0 ) {
8558 stream_FLOATINGPOINTTOK.add(FLOATINGPOINTTOK168);
8559 }
8560
8561 pushFollow(FOLLOW_ctfBody_in_ctfTypeSpecifier3261);
8562 ctfBody169=ctfBody();
8563
8564 state._fsp--;
8565 if (state.failed) {
8566 return retval;
8567 }
8568 if ( state.backtracking==0 ) {
8569 stream_ctfBody.add(ctfBody169.getTree());
8570 }
8571
8572
8573 // AST REWRITE
8574 // elements: ctfBody
8575 // token labels:
8576 // rule labels: retval
8577 // token list labels:
8578 // rule list labels:
8579 // wildcard labels:
8580 if ( state.backtracking==0 ) {
8581 retval.tree = root_0;
8582 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
8583
8584 root_0 = (CommonTree)adaptor.nil();
8585 // 954:30: -> ^( FLOATING_POINT ( ctfBody )? )
8586 {
8587 // CTFParser.g:954:33: ^( FLOATING_POINT ( ctfBody )? )
8588 {
8589 CommonTree root_1 = (CommonTree)adaptor.nil();
8590 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(FLOATING_POINT, "FLOATING_POINT"), root_1);
8591
8592 // CTFParser.g:954:50: ( ctfBody )?
8593 if ( stream_ctfBody.hasNext() ) {
8594 adaptor.addChild(root_1, stream_ctfBody.nextTree());
8595
8596 }
8597 stream_ctfBody.reset();
8598
8599 adaptor.addChild(root_0, root_1);
8600 }
8601
8602 }
8603
8604 retval.tree = root_0;}
8605 }
8606 break;
8607 case 2 :
8608 // CTFParser.g:955:5: INTEGERTOK ctfBody
8609 {
8610 INTEGERTOK170=(Token)match(input,INTEGERTOK,FOLLOW_INTEGERTOK_in_ctfTypeSpecifier3276); if (state.failed) {
8611 return retval;
8612 }
8613 if ( state.backtracking==0 ) {
8614 stream_INTEGERTOK.add(INTEGERTOK170);
8615 }
8616
8617 pushFollow(FOLLOW_ctfBody_in_ctfTypeSpecifier3278);
8618 ctfBody171=ctfBody();
8619
8620 state._fsp--;
8621 if (state.failed) {
8622 return retval;
8623 }
8624 if ( state.backtracking==0 ) {
8625 stream_ctfBody.add(ctfBody171.getTree());
8626 }
8627
8628
8629 // AST REWRITE
8630 // elements: ctfBody
8631 // token labels:
8632 // rule labels: retval
8633 // token list labels:
8634 // rule list labels:
8635 // wildcard labels:
8636 if ( state.backtracking==0 ) {
8637 retval.tree = root_0;
8638 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
8639
8640 root_0 = (CommonTree)adaptor.nil();
8641 // 955:24: -> ^( INTEGER ( ctfBody )? )
8642 {
8643 // CTFParser.g:955:27: ^( INTEGER ( ctfBody )? )
8644 {
8645 CommonTree root_1 = (CommonTree)adaptor.nil();
8646 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(INTEGER, "INTEGER"), root_1);
8647
8648 // CTFParser.g:955:37: ( ctfBody )?
8649 if ( stream_ctfBody.hasNext() ) {
8650 adaptor.addChild(root_1, stream_ctfBody.nextTree());
8651
8652 }
8653 stream_ctfBody.reset();
8654
8655 adaptor.addChild(root_0, root_1);
8656 }
8657
8658 }
8659
8660 retval.tree = root_0;}
8661 }
8662 break;
8663 case 3 :
8664 // CTFParser.g:956:5: STRINGTOK ( ctfBody )?
8665 {
8666 STRINGTOK172=(Token)match(input,STRINGTOK,FOLLOW_STRINGTOK_in_ctfTypeSpecifier3293); if (state.failed) {
8667 return retval;
8668 }
8669 if ( state.backtracking==0 ) {
8670 stream_STRINGTOK.add(STRINGTOK172);
8671 }
8672
8673 // CTFParser.g:956:15: ( ctfBody )?
8674 int alt54=2;
8675 alt54 = dfa54.predict(input);
8676 switch (alt54) {
8677 case 1 :
8678 // CTFParser.g:956:15: ctfBody
8679 {
8680 pushFollow(FOLLOW_ctfBody_in_ctfTypeSpecifier3295);
8681 ctfBody173=ctfBody();
8682
8683 state._fsp--;
8684 if (state.failed) {
8685 return retval;
8686 }
8687 if ( state.backtracking==0 ) {
8688 stream_ctfBody.add(ctfBody173.getTree());
8689 }
8690
8691 }
8692 break;
8693
8694 }
8695
8696
8697
8698 // AST REWRITE
8699 // elements: ctfBody
8700 // token labels:
8701 // rule labels: retval
8702 // token list labels:
8703 // rule list labels:
8704 // wildcard labels:
8705 if ( state.backtracking==0 ) {
8706 retval.tree = root_0;
8707 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
8708
8709 root_0 = (CommonTree)adaptor.nil();
8710 // 956:24: -> ^( STRING ( ctfBody )? )
8711 {
8712 // CTFParser.g:956:27: ^( STRING ( ctfBody )? )
8713 {
8714 CommonTree root_1 = (CommonTree)adaptor.nil();
8715 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(STRING, "STRING"), root_1);
8716
8717 // CTFParser.g:956:36: ( ctfBody )?
8718 if ( stream_ctfBody.hasNext() ) {
8719 adaptor.addChild(root_1, stream_ctfBody.nextTree());
8720
8721 }
8722 stream_ctfBody.reset();
8723
8724 adaptor.addChild(root_0, root_1);
8725 }
8726
8727 }
8728
8729 retval.tree = root_0;}
8730 }
8731 break;
8732
8733 }
8734 retval.stop = input.LT(-1);
8735
8736 if ( state.backtracking==0 ) {
8737
8738 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
8739 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
8740 }
8741 if ( state.backtracking==0 ) {
8742
8743 exit("ctfTypeSpecifier");
8744
8745 }
8746 }
8747
8748 catch (RecognitionException e)
8749 {
8750 throw e;
8751 }
8752 finally {
8753 }
8754 return retval;
8755 }
8756 // $ANTLR end "ctfTypeSpecifier"
8757
8758 public static class ctfBody_return extends ParserRuleReturnScope {
8759 CommonTree tree;
8760 public Object getTree() { return tree; }
8761 };
8762
8763 // $ANTLR start "ctfBody"
8764 // CTFParser.g:959:1: ctfBody : LCURL ( ctfAssignmentExpressionList )? RCURL -> ( ctfAssignmentExpressionList )? ;
8765 public final CTFParser.ctfBody_return ctfBody() throws RecognitionException {
8766 Symbols_stack.push(new Symbols_scope());
8767
8768 CTFParser.ctfBody_return retval = new CTFParser.ctfBody_return();
8769 retval.start = input.LT(1);
8770
8771 CommonTree root_0 = null;
8772
8773 Token LCURL174=null;
8774 Token RCURL176=null;
8775 CTFParser.ctfAssignmentExpressionList_return ctfAssignmentExpressionList175 = null;
8776
8777
8778 CommonTree LCURL174_tree=null;
8779 CommonTree RCURL176_tree=null;
8780 RewriteRuleTokenStream stream_LCURL=new RewriteRuleTokenStream(adaptor,"token LCURL");
8781 RewriteRuleTokenStream stream_RCURL=new RewriteRuleTokenStream(adaptor,"token RCURL");
8782 RewriteRuleSubtreeStream stream_ctfAssignmentExpressionList=new RewriteRuleSubtreeStream(adaptor,"rule ctfAssignmentExpressionList");
8783
8784 enter("ctfBody");
8785 debug_print("Scope push " + + Symbols_stack.size());
8786 ((Symbols_scope)Symbols_stack.peek()).types = new HashSet<String>();
8787
8788 try {
8789 // CTFParser.g:970:1: ( LCURL ( ctfAssignmentExpressionList )? RCURL -> ( ctfAssignmentExpressionList )? )
8790 // CTFParser.g:971:3: LCURL ( ctfAssignmentExpressionList )? RCURL
8791 {
8792 LCURL174=(Token)match(input,LCURL,FOLLOW_LCURL_in_ctfBody3333); if (state.failed) {
8793 return retval;
8794 }
8795 if ( state.backtracking==0 ) {
8796 stream_LCURL.add(LCURL174);
8797 }
8798
8799 // CTFParser.g:971:9: ( ctfAssignmentExpressionList )?
8800 int alt56=2;
8801 int LA56_0 = input.LA(1);
8802
8803 if ( ((LA56_0>=ALIGNTOK && LA56_0<=CALLSITETOK)||LA56_0==SIGN||LA56_0==OCTAL_LITERAL||LA56_0==DECIMAL_LITERAL||LA56_0==HEX_LITERAL||LA56_0==CHARACTER_LITERAL||LA56_0==STRING_LITERAL||LA56_0==IDENTIFIER) ) {
8804 alt56=1;
8805 }
8806 switch (alt56) {
8807 case 1 :
8808 // CTFParser.g:971:9: ctfAssignmentExpressionList
8809 {
8810 pushFollow(FOLLOW_ctfAssignmentExpressionList_in_ctfBody3335);
8811 ctfAssignmentExpressionList175=ctfAssignmentExpressionList();
8812
8813 state._fsp--;
8814 if (state.failed) {
8815 return retval;
8816 }
8817 if ( state.backtracking==0 ) {
8818 stream_ctfAssignmentExpressionList.add(ctfAssignmentExpressionList175.getTree());
8819 }
8820
8821 }
8822 break;
8823
8824 }
8825
8826 RCURL176=(Token)match(input,RCURL,FOLLOW_RCURL_in_ctfBody3338); if (state.failed) {
8827 return retval;
8828 }
8829 if ( state.backtracking==0 ) {
8830 stream_RCURL.add(RCURL176);
8831 }
8832
8833
8834
8835 // AST REWRITE
8836 // elements: ctfAssignmentExpressionList
8837 // token labels:
8838 // rule labels: retval
8839 // token list labels:
8840 // rule list labels:
8841 // wildcard labels:
8842 if ( state.backtracking==0 ) {
8843 retval.tree = root_0;
8844 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
8845
8846 root_0 = (CommonTree)adaptor.nil();
8847 // 971:44: -> ( ctfAssignmentExpressionList )?
8848 {
8849 // CTFParser.g:971:47: ( ctfAssignmentExpressionList )?
8850 if ( stream_ctfAssignmentExpressionList.hasNext() ) {
8851 adaptor.addChild(root_0, stream_ctfAssignmentExpressionList.nextTree());
8852
8853 }
8854 stream_ctfAssignmentExpressionList.reset();
8855
8856 }
8857
8858 retval.tree = root_0;}
8859 }
8860
8861 retval.stop = input.LT(-1);
8862
8863 if ( state.backtracking==0 ) {
8864
8865 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
8866 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
8867 }
8868 if ( state.backtracking==0 ) {
8869
8870 debug_print("Scope pop " + + Symbols_stack.size());
8871 exit("ctfBody");
8872
8873 }
8874 }
8875
8876 catch (RecognitionException e)
8877 {
8878 throw e;
8879 }
8880 finally {
8881 Symbols_stack.pop();
8882
8883 }
8884 return retval;
8885 }
8886 // $ANTLR end "ctfBody"
8887
8888 public static class ctfAssignmentExpressionList_return extends ParserRuleReturnScope {
8889 CommonTree tree;
8890 public Object getTree() { return tree; }
8891 };
8892
8893 // $ANTLR start "ctfAssignmentExpressionList"
8894 // CTFParser.g:974:1: ctfAssignmentExpressionList : ( ctfAssignmentExpression TERM )+ ;
8895 public final CTFParser.ctfAssignmentExpressionList_return ctfAssignmentExpressionList() throws RecognitionException {
8896 CTFParser.ctfAssignmentExpressionList_return retval = new CTFParser.ctfAssignmentExpressionList_return();
8897 retval.start = input.LT(1);
8898
8899 CommonTree root_0 = null;
8900
8901 Token TERM178=null;
8902 CTFParser.ctfAssignmentExpression_return ctfAssignmentExpression177 = null;
8903
8904
8905 CommonTree TERM178_tree=null;
8906
8907 try {
8908 // CTFParser.g:974:29: ( ( ctfAssignmentExpression TERM )+ )
8909 // CTFParser.g:975:3: ( ctfAssignmentExpression TERM )+
8910 {
8911 root_0 = (CommonTree)adaptor.nil();
8912
8913 // CTFParser.g:975:3: ( ctfAssignmentExpression TERM )+
8914 int cnt57=0;
8915 loop57:
8916 do {
8917 int alt57=2;
8918 int LA57_0 = input.LA(1);
8919
8920 if ( ((LA57_0>=ALIGNTOK && LA57_0<=CALLSITETOK)||LA57_0==SIGN||LA57_0==OCTAL_LITERAL||LA57_0==DECIMAL_LITERAL||LA57_0==HEX_LITERAL||LA57_0==CHARACTER_LITERAL||LA57_0==STRING_LITERAL||LA57_0==IDENTIFIER) ) {
8921 alt57=1;
8922 }
8923
8924
8925 switch (alt57) {
8926 case 1 :
8927 // CTFParser.g:975:4: ctfAssignmentExpression TERM
8928 {
8929 pushFollow(FOLLOW_ctfAssignmentExpression_in_ctfAssignmentExpressionList3357);
8930 ctfAssignmentExpression177=ctfAssignmentExpression();
8931
8932 state._fsp--;
8933 if (state.failed) {
8934 return retval;
8935 }
8936 if ( state.backtracking==0 ) {
8937 adaptor.addChild(root_0, ctfAssignmentExpression177.getTree());
8938 }
8939 TERM178=(Token)match(input,TERM,FOLLOW_TERM_in_ctfAssignmentExpressionList3359); if (state.failed) {
8940 return retval;
8941 }
8942
8943 }
8944 break;
8945
8946 default :
8947 if ( cnt57 >= 1 ) {
8948 break loop57;
8949 }
8950 if (state.backtracking>0) {state.failed=true; return retval;}
8951 EarlyExitException eee =
8952 new EarlyExitException(57, input);
8953 throw eee;
8954 }
8955 cnt57++;
8956 } while (true);
8957
8958
8959 }
8960
8961 retval.stop = input.LT(-1);
8962
8963 if ( state.backtracking==0 ) {
8964
8965 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
8966 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
8967 }
8968 }
8969
8970 catch (RecognitionException e)
8971 {
8972 throw e;
8973 }
8974 finally {
8975 }
8976 return retval;
8977 }
8978 // $ANTLR end "ctfAssignmentExpressionList"
8979
8980 public static class ctfAssignmentExpression_return extends ParserRuleReturnScope {
8981 CommonTree tree;
8982 public Object getTree() { return tree; }
8983 };
8984
8985 // $ANTLR start "ctfAssignmentExpression"
8986 // CTFParser.g:979:1: ctfAssignmentExpression : ( (left= unaryExpression ( (assignment= ASSIGNMENT right1= unaryExpression ) -> ^( CTF_EXPRESSION_VAL ^( CTF_LEFT $left) ^( CTF_RIGHT $right1) ) | (type_assignment= TYPE_ASSIGNMENT right2= typeSpecifier ) -> ^( CTF_EXPRESSION_TYPE ^( CTF_LEFT $left) ^( CTF_RIGHT ^( TYPE_SPECIFIER_LIST $right2) ) ) ) ) | ( declarationSpecifiers {...}? declaratorList ) -> ^( TYPEDEF declaratorList declarationSpecifiers ) | typealiasDecl );
8987 public final CTFParser.ctfAssignmentExpression_return ctfAssignmentExpression() throws RecognitionException {
8988 CTFParser.ctfAssignmentExpression_return retval = new CTFParser.ctfAssignmentExpression_return();
8989 retval.start = input.LT(1);
8990
8991 CommonTree root_0 = null;
8992
8993 Token assignment=null;
8994 Token type_assignment=null;
8995 CTFParser.unaryExpression_return left = null;
8996
8997 CTFParser.unaryExpression_return right1 = null;
8998
8999 CTFParser.typeSpecifier_return right2 = null;
9000
9001 CTFParser.declarationSpecifiers_return declarationSpecifiers179 = null;
9002
9003 CTFParser.declaratorList_return declaratorList180 = null;
9004
9005 CTFParser.typealiasDecl_return typealiasDecl181 = null;
9006
9007
9008 CommonTree assignment_tree=null;
9009 CommonTree type_assignment_tree=null;
9010 RewriteRuleTokenStream stream_ASSIGNMENT=new RewriteRuleTokenStream(adaptor,"token ASSIGNMENT");
9011 RewriteRuleTokenStream stream_TYPE_ASSIGNMENT=new RewriteRuleTokenStream(adaptor,"token TYPE_ASSIGNMENT");
9012 RewriteRuleSubtreeStream stream_declaratorList=new RewriteRuleSubtreeStream(adaptor,"rule declaratorList");
9013 RewriteRuleSubtreeStream stream_unaryExpression=new RewriteRuleSubtreeStream(adaptor,"rule unaryExpression");
9014 RewriteRuleSubtreeStream stream_declarationSpecifiers=new RewriteRuleSubtreeStream(adaptor,"rule declarationSpecifiers");
9015 RewriteRuleSubtreeStream stream_typeSpecifier=new RewriteRuleSubtreeStream(adaptor,"rule typeSpecifier");
9016
9017 enter("ctfAssignmentExpression");
9018
9019 try {
9020 // CTFParser.g:989:1: ( (left= unaryExpression ( (assignment= ASSIGNMENT right1= unaryExpression ) -> ^( CTF_EXPRESSION_VAL ^( CTF_LEFT $left) ^( CTF_RIGHT $right1) ) | (type_assignment= TYPE_ASSIGNMENT right2= typeSpecifier ) -> ^( CTF_EXPRESSION_TYPE ^( CTF_LEFT $left) ^( CTF_RIGHT ^( TYPE_SPECIFIER_LIST $right2) ) ) ) ) | ( declarationSpecifiers {...}? declaratorList ) -> ^( TYPEDEF declaratorList declarationSpecifiers ) | typealiasDecl )
9021 int alt59=3;
9022 switch ( input.LA(1) ) {
9023 case IDENTIFIER:
9024 {
9025 int LA59_1 = input.LA(2);
9026
9027 if ( ((LA59_1>=ASSIGNMENT && LA59_1<=TYPE_ASSIGNMENT)||LA59_1==OPENBRAC||(LA59_1>=ARROW && LA59_1<=DOT)) ) {
9028 alt59=1;
9029 }
9030 else if ( ((LA59_1>=CONSTTOK && LA59_1<=ENUMTOK)||(LA59_1>=FLOATINGPOINTTOK && LA59_1<=SIGNEDTOK)||(LA59_1>=STRINGTOK && LA59_1<=STRUCTTOK)||(LA59_1>=TYPEDEFTOK && LA59_1<=IMAGINARYTOK)||LA59_1==POINTER||LA59_1==IDENTIFIER) && ((inTypealiasAlias() || isTypeName(input.LT(1).getText())))) {
9031 alt59=2;
9032 }
9033 else {
9034 if (state.backtracking>0) {state.failed=true; return retval;}
9035 NoViableAltException nvae =
9036 new NoViableAltException("", 59, 1, input);
9037
9038 throw nvae;
9039 }
9040 }
9041 break;
9042 case ALIGNTOK:
9043 case EVENTTOK:
9044 case STREAMTOK:
9045 case TRACETOK:
9046 case ENVTOK:
9047 case CLOCKTOK:
9048 case CALLSITETOK:
9049 case SIGN:
9050 case OCTAL_LITERAL:
9051 case DECIMAL_LITERAL:
9052 case HEX_LITERAL:
9053 case CHARACTER_LITERAL:
9054 case STRING_LITERAL:
9055 {
9056 alt59=1;
9057 }
9058 break;
9059 case SIGNEDTOK:
9060 {
9061 switch ( input.LA(2) ) {
9062 case ASSIGNMENT:
9063 case TYPE_ASSIGNMENT:
9064 case OPENBRAC:
9065 case ARROW:
9066 case DOT:
9067 {
9068 alt59=1;
9069 }
9070 break;
9071 case CONSTTOK:
9072 case CHARTOK:
9073 case DOUBLETOK:
9074 case ENUMTOK:
9075 case FLOATINGPOINTTOK:
9076 case FLOATTOK:
9077 case INTEGERTOK:
9078 case INTTOK:
9079 case LONGTOK:
9080 case SHORTTOK:
9081 case SIGNEDTOK:
9082 case STRINGTOK:
9083 case STRUCTTOK:
9084 case UNSIGNEDTOK:
9085 case VARIANTTOK:
9086 case VOIDTOK:
9087 case BOOLTOK:
9088 case COMPLEXTOK:
9089 case IMAGINARYTOK:
9090 case POINTER:
9091 case IDENTIFIER:
9092 {
9093 alt59=2;
9094 }
9095 break;
9096 case TYPEDEFTOK:
9097 {
9098 alt59=2;
9099 }
9100 break;
9101 default:
9102 if (state.backtracking>0) {state.failed=true; return retval;}
9103 NoViableAltException nvae =
9104 new NoViableAltException("", 59, 3, input);
9105
9106 throw nvae;
9107 }
9108
9109 }
9110 break;
9111 case CONSTTOK:
9112 case CHARTOK:
9113 case DOUBLETOK:
9114 case ENUMTOK:
9115 case FLOATINGPOINTTOK:
9116 case FLOATTOK:
9117 case INTEGERTOK:
9118 case INTTOK:
9119 case LONGTOK:
9120 case SHORTTOK:
9121 case STRUCTTOK:
9122 case TYPEDEFTOK:
9123 case UNSIGNEDTOK:
9124 case VARIANTTOK:
9125 case VOIDTOK:
9126 case BOOLTOK:
9127 case COMPLEXTOK:
9128 case IMAGINARYTOK:
9129 {
9130 alt59=2;
9131 }
9132 break;
9133 case STRINGTOK:
9134 {
9135 switch ( input.LA(2) ) {
9136 case CONSTTOK:
9137 case CHARTOK:
9138 case DOUBLETOK:
9139 case ENUMTOK:
9140 case FLOATINGPOINTTOK:
9141 case FLOATTOK:
9142 case INTEGERTOK:
9143 case INTTOK:
9144 case LONGTOK:
9145 case SHORTTOK:
9146 case SIGNEDTOK:
9147 case STRINGTOK:
9148 case STRUCTTOK:
9149 case UNSIGNEDTOK:
9150 case VARIANTTOK:
9151 case VOIDTOK:
9152 case BOOLTOK:
9153 case COMPLEXTOK:
9154 case IMAGINARYTOK:
9155 case LCURL:
9156 case POINTER:
9157 case IDENTIFIER:
9158 {
9159 alt59=2;
9160 }
9161 break;
9162 case TYPEDEFTOK:
9163 {
9164 alt59=2;
9165 }
9166 break;
9167 case ASSIGNMENT:
9168 case TYPE_ASSIGNMENT:
9169 case OPENBRAC:
9170 case ARROW:
9171 case DOT:
9172 {
9173 alt59=1;
9174 }
9175 break;
9176 default:
9177 if (state.backtracking>0) {state.failed=true; return retval;}
9178 NoViableAltException nvae =
9179 new NoViableAltException("", 59, 5, input);
9180
9181 throw nvae;
9182 }
9183
9184 }
9185 break;
9186 case TYPEALIASTOK:
9187 {
9188 alt59=3;
9189 }
9190 break;
9191 default:
9192 if (state.backtracking>0) {state.failed=true; return retval;}
9193 NoViableAltException nvae =
9194 new NoViableAltException("", 59, 0, input);
9195
9196 throw nvae;
9197 }
9198
9199 switch (alt59) {
9200 case 1 :
9201 // CTFParser.g:990:3: (left= unaryExpression ( (assignment= ASSIGNMENT right1= unaryExpression ) -> ^( CTF_EXPRESSION_VAL ^( CTF_LEFT $left) ^( CTF_RIGHT $right1) ) | (type_assignment= TYPE_ASSIGNMENT right2= typeSpecifier ) -> ^( CTF_EXPRESSION_TYPE ^( CTF_LEFT $left) ^( CTF_RIGHT ^( TYPE_SPECIFIER_LIST $right2) ) ) ) )
9202 {
9203 // CTFParser.g:990:3: (left= unaryExpression ( (assignment= ASSIGNMENT right1= unaryExpression ) -> ^( CTF_EXPRESSION_VAL ^( CTF_LEFT $left) ^( CTF_RIGHT $right1) ) | (type_assignment= TYPE_ASSIGNMENT right2= typeSpecifier ) -> ^( CTF_EXPRESSION_TYPE ^( CTF_LEFT $left) ^( CTF_RIGHT ^( TYPE_SPECIFIER_LIST $right2) ) ) ) )
9204 // CTFParser.g:991:5: left= unaryExpression ( (assignment= ASSIGNMENT right1= unaryExpression ) -> ^( CTF_EXPRESSION_VAL ^( CTF_LEFT $left) ^( CTF_RIGHT $right1) ) | (type_assignment= TYPE_ASSIGNMENT right2= typeSpecifier ) -> ^( CTF_EXPRESSION_TYPE ^( CTF_LEFT $left) ^( CTF_RIGHT ^( TYPE_SPECIFIER_LIST $right2) ) ) )
9205 {
9206 pushFollow(FOLLOW_unaryExpression_in_ctfAssignmentExpression3394);
9207 left=unaryExpression();
9208
9209 state._fsp--;
9210 if (state.failed) {
9211 return retval;
9212 }
9213 if ( state.backtracking==0 ) {
9214 stream_unaryExpression.add(left.getTree());
9215 }
9216 // CTFParser.g:992:5: ( (assignment= ASSIGNMENT right1= unaryExpression ) -> ^( CTF_EXPRESSION_VAL ^( CTF_LEFT $left) ^( CTF_RIGHT $right1) ) | (type_assignment= TYPE_ASSIGNMENT right2= typeSpecifier ) -> ^( CTF_EXPRESSION_TYPE ^( CTF_LEFT $left) ^( CTF_RIGHT ^( TYPE_SPECIFIER_LIST $right2) ) ) )
9217 int alt58=2;
9218 int LA58_0 = input.LA(1);
9219
9220 if ( (LA58_0==ASSIGNMENT) ) {
9221 alt58=1;
9222 }
9223 else if ( (LA58_0==TYPE_ASSIGNMENT) ) {
9224 alt58=2;
9225 }
9226 else {
9227 if (state.backtracking>0) {state.failed=true; return retval;}
9228 NoViableAltException nvae =
9229 new NoViableAltException("", 58, 0, input);
9230
9231 throw nvae;
9232 }
9233 switch (alt58) {
9234 case 1 :
9235 // CTFParser.g:993:9: (assignment= ASSIGNMENT right1= unaryExpression )
9236 {
9237 // CTFParser.g:993:9: (assignment= ASSIGNMENT right1= unaryExpression )
9238 // CTFParser.g:993:10: assignment= ASSIGNMENT right1= unaryExpression
9239 {
9240 assignment=(Token)match(input,ASSIGNMENT,FOLLOW_ASSIGNMENT_in_ctfAssignmentExpression3413); if (state.failed) {
9241 return retval;
9242 }
9243 if ( state.backtracking==0 ) {
9244 stream_ASSIGNMENT.add(assignment);
9245 }
9246
9247 pushFollow(FOLLOW_unaryExpression_in_ctfAssignmentExpression3417);
9248 right1=unaryExpression();
9249
9250 state._fsp--;
9251 if (state.failed) {
9252 return retval;
9253 }
9254 if ( state.backtracking==0 ) {
9255 stream_unaryExpression.add(right1.getTree());
9256 }
9257
9258 }
9259
9260
9261
9262 // AST REWRITE
9263 // elements: right1, left
9264 // token labels:
9265 // rule labels: retval, left, right1
9266 // token list labels:
9267 // rule list labels:
9268 // wildcard labels:
9269 if ( state.backtracking==0 ) {
9270 retval.tree = root_0;
9271 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
9272 RewriteRuleSubtreeStream stream_left=new RewriteRuleSubtreeStream(adaptor,"rule left",left!=null?left.tree:null);
9273 RewriteRuleSubtreeStream stream_right1=new RewriteRuleSubtreeStream(adaptor,"rule right1",right1!=null?right1.tree:null);
9274
9275 root_0 = (CommonTree)adaptor.nil();
9276 // 993:56: -> ^( CTF_EXPRESSION_VAL ^( CTF_LEFT $left) ^( CTF_RIGHT $right1) )
9277 {
9278 // CTFParser.g:993:59: ^( CTF_EXPRESSION_VAL ^( CTF_LEFT $left) ^( CTF_RIGHT $right1) )
9279 {
9280 CommonTree root_1 = (CommonTree)adaptor.nil();
9281 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(CTF_EXPRESSION_VAL, "CTF_EXPRESSION_VAL"), root_1);
9282
9283 // CTFParser.g:993:80: ^( CTF_LEFT $left)
9284 {
9285 CommonTree root_2 = (CommonTree)adaptor.nil();
9286 root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(CTF_LEFT, "CTF_LEFT"), root_2);
9287
9288 adaptor.addChild(root_2, stream_left.nextTree());
9289
9290 adaptor.addChild(root_1, root_2);
9291 }
9292 // CTFParser.g:993:98: ^( CTF_RIGHT $right1)
9293 {
9294 CommonTree root_2 = (CommonTree)adaptor.nil();
9295 root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(CTF_RIGHT, "CTF_RIGHT"), root_2);
9296
9297 adaptor.addChild(root_2, stream_right1.nextTree());
9298
9299 adaptor.addChild(root_1, root_2);
9300 }
9301
9302 adaptor.addChild(root_0, root_1);
9303 }
9304
9305 }
9306
9307 retval.tree = root_0;}
9308 }
9309 break;
9310 case 2 :
9311 // CTFParser.g:994:9: (type_assignment= TYPE_ASSIGNMENT right2= typeSpecifier )
9312 {
9313 // CTFParser.g:994:9: (type_assignment= TYPE_ASSIGNMENT right2= typeSpecifier )
9314 // CTFParser.g:994:10: type_assignment= TYPE_ASSIGNMENT right2= typeSpecifier
9315 {
9316 type_assignment=(Token)match(input,TYPE_ASSIGNMENT,FOLLOW_TYPE_ASSIGNMENT_in_ctfAssignmentExpression3451); if (state.failed) {
9317 return retval;
9318 }
9319 if ( state.backtracking==0 ) {
9320 stream_TYPE_ASSIGNMENT.add(type_assignment);
9321 }
9322
9323 pushFollow(FOLLOW_typeSpecifier_in_ctfAssignmentExpression3456);
9324 right2=typeSpecifier();
9325
9326 state._fsp--;
9327 if (state.failed) {
9328 return retval;
9329 }
9330 if ( state.backtracking==0 ) {
9331 stream_typeSpecifier.add(right2.getTree());
9332 }
9333
9334 }
9335
9336
9337
9338 // AST REWRITE
9339 // elements: right2, left
9340 // token labels:
9341 // rule labels: retval, left, right2
9342 // token list labels:
9343 // rule list labels:
9344 // wildcard labels:
9345 if ( state.backtracking==0 ) {
9346 retval.tree = root_0;
9347 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
9348 RewriteRuleSubtreeStream stream_left=new RewriteRuleSubtreeStream(adaptor,"rule left",left!=null?left.tree:null);
9349 RewriteRuleSubtreeStream stream_right2=new RewriteRuleSubtreeStream(adaptor,"rule right2",right2!=null?right2.tree:null);
9350
9351 root_0 = (CommonTree)adaptor.nil();
9352 // 994:65: -> ^( CTF_EXPRESSION_TYPE ^( CTF_LEFT $left) ^( CTF_RIGHT ^( TYPE_SPECIFIER_LIST $right2) ) )
9353 {
9354 // CTFParser.g:994:68: ^( CTF_EXPRESSION_TYPE ^( CTF_LEFT $left) ^( CTF_RIGHT ^( TYPE_SPECIFIER_LIST $right2) ) )
9355 {
9356 CommonTree root_1 = (CommonTree)adaptor.nil();
9357 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(CTF_EXPRESSION_TYPE, "CTF_EXPRESSION_TYPE"), root_1);
9358
9359 // CTFParser.g:994:90: ^( CTF_LEFT $left)
9360 {
9361 CommonTree root_2 = (CommonTree)adaptor.nil();
9362 root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(CTF_LEFT, "CTF_LEFT"), root_2);
9363
9364 adaptor.addChild(root_2, stream_left.nextTree());
9365
9366 adaptor.addChild(root_1, root_2);
9367 }
9368 // CTFParser.g:994:108: ^( CTF_RIGHT ^( TYPE_SPECIFIER_LIST $right2) )
9369 {
9370 CommonTree root_2 = (CommonTree)adaptor.nil();
9371 root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(CTF_RIGHT, "CTF_RIGHT"), root_2);
9372
9373 // CTFParser.g:994:120: ^( TYPE_SPECIFIER_LIST $right2)
9374 {
9375 CommonTree root_3 = (CommonTree)adaptor.nil();
9376 root_3 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPE_SPECIFIER_LIST, "TYPE_SPECIFIER_LIST"), root_3);
9377
9378 adaptor.addChild(root_3, stream_right2.nextTree());
9379
9380 adaptor.addChild(root_2, root_3);
9381 }
9382
9383 adaptor.addChild(root_1, root_2);
9384 }
9385
9386 adaptor.addChild(root_0, root_1);
9387 }
9388
9389 }
9390
9391 retval.tree = root_0;}
9392 }
9393 break;
9394
9395 }
9396
9397
9398 }
9399
9400
9401 }
9402 break;
9403 case 2 :
9404 // CTFParser.g:1000:5: ( declarationSpecifiers {...}? declaratorList )
9405 {
9406 // CTFParser.g:1000:5: ( declarationSpecifiers {...}? declaratorList )
9407 // CTFParser.g:1000:6: declarationSpecifiers {...}? declaratorList
9408 {
9409 pushFollow(FOLLOW_declarationSpecifiers_in_ctfAssignmentExpression3506);
9410 declarationSpecifiers179=declarationSpecifiers();
9411
9412 state._fsp--;
9413 if (state.failed) {
9414 return retval;
9415 }
9416 if ( state.backtracking==0 ) {
9417 stream_declarationSpecifiers.add(declarationSpecifiers179.getTree());
9418 }
9419 if ( !((inTypedef())) ) {
9420 if (state.backtracking>0) {state.failed=true; return retval;}
9421 throw new FailedPredicateException(input, "ctfAssignmentExpression", "inTypedef()");
9422 }
9423 pushFollow(FOLLOW_declaratorList_in_ctfAssignmentExpression3510);
9424 declaratorList180=declaratorList();
9425
9426 state._fsp--;
9427 if (state.failed) {
9428 return retval;
9429 }
9430 if ( state.backtracking==0 ) {
9431 stream_declaratorList.add(declaratorList180.getTree());
9432 }
9433
9434 }
9435
9436
9437
9438 // AST REWRITE
9439 // elements: declarationSpecifiers, declaratorList
9440 // token labels:
9441 // rule labels: retval
9442 // token list labels:
9443 // rule list labels:
9444 // wildcard labels:
9445 if ( state.backtracking==0 ) {
9446 retval.tree = root_0;
9447 RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
9448
9449 root_0 = (CommonTree)adaptor.nil();
9450 // 1001:5: -> ^( TYPEDEF declaratorList declarationSpecifiers )
9451 {
9452 // CTFParser.g:1001:8: ^( TYPEDEF declaratorList declarationSpecifiers )
9453 {
9454 CommonTree root_1 = (CommonTree)adaptor.nil();
9455 root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPEDEF, "TYPEDEF"), root_1);
9456
9457 adaptor.addChild(root_1, stream_declaratorList.nextTree());
9458 adaptor.addChild(root_1, stream_declarationSpecifiers.nextTree());
9459
9460 adaptor.addChild(root_0, root_1);
9461 }
9462
9463 }
9464
9465 retval.tree = root_0;}
9466 }
9467 break;
9468 case 3 :
9469 // CTFParser.g:1004:5: typealiasDecl
9470 {
9471 root_0 = (CommonTree)adaptor.nil();
9472
9473 pushFollow(FOLLOW_typealiasDecl_in_ctfAssignmentExpression3538);
9474 typealiasDecl181=typealiasDecl();
9475
9476 state._fsp--;
9477 if (state.failed) {
9478 return retval;
9479 }
9480 if ( state.backtracking==0 ) {
9481 adaptor.addChild(root_0, typealiasDecl181.getTree());
9482 }
9483
9484 }
9485 break;
9486
9487 }
9488 retval.stop = input.LT(-1);
9489
9490 if ( state.backtracking==0 ) {
9491
9492 retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
9493 adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
9494 }
9495 if ( state.backtracking==0 ) {
9496
9497 if (inTypedef()) {
9498 typedefOff();
9499 }
9500 exit("ctfAssignmentExpression");
9501
9502 }
9503 }
9504
9505 catch (RecognitionException e)
9506 {
9507 throw e;
9508 }
9509 finally {
9510 }
9511 return retval;
9512 }
9513 // $ANTLR end "ctfAssignmentExpression"
9514
9515 // $ANTLR start synpred1_CTFParser
9516 public final void synpred1_CTFParser_fragment() throws RecognitionException {
9517 // CTFParser.g:251:5: ( IDENTIFIER )
9518 // CTFParser.g:251:6: IDENTIFIER
9519 {
9520 match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_synpred1_CTFParser474); if (state.failed) {
9521 return ;
9522 }
9523
9524 }
9525 }
9526 // $ANTLR end synpred1_CTFParser
9527
9528 // $ANTLR start synpred2_CTFParser
9529 public final void synpred2_CTFParser_fragment() throws RecognitionException {
9530 // CTFParser.g:252:5: ( ctfKeyword )
9531 // CTFParser.g:252:6: ctfKeyword
9532 {
9533 pushFollow(FOLLOW_ctfKeyword_in_synpred2_CTFParser496);
9534 ctfKeyword();
9535
9536 state._fsp--;
9537 if (state.failed) {
9538 return ;
9539 }
9540
9541 }
9542 }
9543 // $ANTLR end synpred2_CTFParser
9544
9545 // $ANTLR start synpred3_CTFParser
9546 public final void synpred3_CTFParser_fragment() throws RecognitionException {
9547 // CTFParser.g:253:5: ( STRING_LITERAL )
9548 // CTFParser.g:253:6: STRING_LITERAL
9549 {
9550 match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_synpred3_CTFParser516); if (state.failed) {
9551 return ;
9552 }
9553
9554 }
9555 }
9556 // $ANTLR end synpred3_CTFParser
9557
9558 // Delegated rules
9559
9560 public final boolean synpred2_CTFParser() {
9561 state.backtracking++;
9562 int start = input.mark();
9563 try {
9564 synpred2_CTFParser_fragment(); // can never throw exception
9565 } catch (RecognitionException re) {
9566 System.err.println("impossible: "+re);
9567 }
9568 boolean success = !state.failed;
9569 input.rewind(start);
9570 state.backtracking--;
9571 state.failed=false;
9572 return success;
9573 }
9574 public final boolean synpred1_CTFParser() {
9575 state.backtracking++;
9576 int start = input.mark();
9577 try {
9578 synpred1_CTFParser_fragment(); // can never throw exception
9579 } catch (RecognitionException re) {
9580 System.err.println("impossible: "+re);
9581 }
9582 boolean success = !state.failed;
9583 input.rewind(start);
9584 state.backtracking--;
9585 state.failed=false;
9586 return success;
9587 }
9588 public final boolean synpred3_CTFParser() {
9589 state.backtracking++;
9590 int start = input.mark();
9591 try {
9592 synpred3_CTFParser_fragment(); // can never throw exception
9593 } catch (RecognitionException re) {
9594 System.err.println("impossible: "+re);
9595 }
9596 boolean success = !state.failed;
9597 input.rewind(start);
9598 state.backtracking--;
9599 state.failed=false;
9600 return success;
9601 }
9602
9603
9604 protected DFA10 dfa10 = new DFA10(this);
9605 protected DFA17 dfa17 = new DFA17(this);
9606 protected DFA24 dfa24 = new DFA24(this);
9607 protected DFA32 dfa32 = new DFA32(this);
9608 protected DFA54 dfa54 = new DFA54(this);
9609 static final String DFA10_eotS =
9610 "\17\uffff";
9611 static final String DFA10_eofS =
9612 "\17\uffff";
9613 static final String DFA10_minS =
9614 "\1\4\16\uffff";
9615 static final String DFA10_maxS =
9616 "\1\117\16\uffff";
9617 static final String DFA10_acceptS =
9618 "\1\uffff\2\1\7\uffff\1\2\4\uffff";
9619 static final String DFA10_specialS =
9620 "\17\uffff}>";
9621 static final String[] DFA10_transitionS = {
9622 "\1\1\4\uffff\1\2\6\uffff\1\1\1\12\1\1\1\uffff\1\12\10\uffff"+
9623 "\3\12\22\uffff\1\1\4\uffff\1\1\1\uffff\1\1\2\uffff\1\1\10\uffff"+
9624 "\1\1\2\uffff\1\1\6\uffff\1\1",
9625 "",
9626 "",
9627 "",
9628 "",
9629 "",
9630 "",
9631 "",
9632 "",
9633 "",
9634 "",
9635 "",
9636 "",
9637 "",
9638 ""
9639 };
9640
9641 static final short[] DFA10_eot = DFA.unpackEncodedString(DFA10_eotS);
9642 static final short[] DFA10_eof = DFA.unpackEncodedString(DFA10_eofS);
9643 static final char[] DFA10_min = DFA.unpackEncodedStringToUnsignedChars(DFA10_minS);
9644 static final char[] DFA10_max = DFA.unpackEncodedStringToUnsignedChars(DFA10_maxS);
9645 static final short[] DFA10_accept = DFA.unpackEncodedString(DFA10_acceptS);
9646 static final short[] DFA10_special = DFA.unpackEncodedString(DFA10_specialS);
9647 static final short[][] DFA10_transition;
9648
9649 static {
9650 int numStates = DFA10_transitionS.length;
9651 DFA10_transition = new short[numStates][];
9652 for (int i=0; i<numStates; i++) {
9653 DFA10_transition[i] = DFA.unpackEncodedString(DFA10_transitionS[i]);
9654 }
9655 }
9656
9657 class DFA10 extends DFA {
9658
9659 public DFA10(BaseRecognizer recognizer) {
9660 this.recognizer = recognizer;
9661 this.decisionNumber = 10;
9662 this.eot = DFA10_eot;
9663 this.eof = DFA10_eof;
9664 this.min = DFA10_min;
9665 this.max = DFA10_max;
9666 this.accept = DFA10_accept;
9667 this.special = DFA10_special;
9668 this.transition = DFA10_transition;
9669 }
9670 public String getDescription() {
9671 return "282:1: postfixExpression : ( ( primaryExpression ) ( postfixExpressionSuffix )* | ( ( ctfSpecifierHead ) ( postfixExpressionSuffix )+ ) );";
9672 }
9673 }
9674 static final String DFA17_eotS =
9675 "\22\uffff";
9676 static final String DFA17_eofS =
9677 "\22\uffff";
9678 static final String DFA17_minS =
9679 "\1\6\21\uffff";
9680 static final String DFA17_maxS =
9681 "\1\117\21\uffff";
9682 static final String DFA17_acceptS =
9683 "\1\uffff\1\1\1\2\1\3\1\4\1\5\1\6\1\7\1\10\1\11\1\12\1\13\1\14\1"+
9684 "\15\1\16\1\17\1\20\1\21";
9685 static final String DFA17_specialS =
9686 "\1\0\21\uffff}>";
9687 static final String[] DFA17_transitionS = {
9688 "\1\7\1\10\1\17\1\uffff\1\20\1\1\1\20\1\2\1\3\1\4\1\5\1\uffff"+
9689 "\1\20\1\15\3\uffff\1\6\1\16\1\11\1\12\1\13\1\14\62\uffff\1\21",
9690 "",
9691 "",
9692 "",
9693 "",
9694 "",
9695 "",
9696 "",
9697 "",
9698 "",
9699 "",
9700 "",
9701 "",
9702 "",
9703 "",
9704 "",
9705 "",
9706 ""
9707 };
9708
9709 static final short[] DFA17_eot = DFA.unpackEncodedString(DFA17_eotS);
9710 static final short[] DFA17_eof = DFA.unpackEncodedString(DFA17_eofS);
9711 static final char[] DFA17_min = DFA.unpackEncodedStringToUnsignedChars(DFA17_minS);
9712 static final char[] DFA17_max = DFA.unpackEncodedStringToUnsignedChars(DFA17_maxS);
9713 static final short[] DFA17_accept = DFA.unpackEncodedString(DFA17_acceptS);
9714 static final short[] DFA17_special = DFA.unpackEncodedString(DFA17_specialS);
9715 static final short[][] DFA17_transition;
9716
9717 static {
9718 int numStates = DFA17_transitionS.length;
9719 DFA17_transition = new short[numStates][];
9720 for (int i=0; i<numStates; i++) {
9721 DFA17_transition[i] = DFA.unpackEncodedString(DFA17_transitionS[i]);
9722 }
9723 }
9724
9725 class DFA17 extends DFA {
9726
9727 public DFA17(BaseRecognizer recognizer) {
9728 this.recognizer = recognizer;
9729 this.decisionNumber = 17;
9730 this.eot = DFA17_eot;
9731 this.eof = DFA17_eof;
9732 this.min = DFA17_min;
9733 this.max = DFA17_max;
9734 this.accept = DFA17_accept;
9735 this.special = DFA17_special;
9736 this.transition = DFA17_transition;
9737 }
9738 public String getDescription() {
9739 return "385:1: typeSpecifier : ( FLOATTOK | INTTOK | LONGTOK | SHORTTOK | SIGNEDTOK | UNSIGNEDTOK | CHARTOK | DOUBLETOK | VOIDTOK | BOOLTOK | COMPLEXTOK | IMAGINARYTOK | structSpecifier | variantSpecifier | enumSpecifier | ctfTypeSpecifier | {...}? => typedefName );";
9740 }
9741 public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
9742 TokenStream input = (TokenStream)_input;
9743 int _s = s;
9744 switch ( s ) {
9745 case 0 :
9746 int LA17_0 = input.LA(1);
9747
9748
9749 int index17_0 = input.index();
9750 input.rewind();
9751 s = -1;
9752 if ( (LA17_0==FLOATTOK) ) {s = 1;}
9753
9754 else if ( (LA17_0==INTTOK) ) {s = 2;}
9755
9756 else if ( (LA17_0==LONGTOK) ) {s = 3;}
9757
9758 else if ( (LA17_0==SHORTTOK) ) {s = 4;}
9759
9760 else if ( (LA17_0==SIGNEDTOK) ) {s = 5;}
9761
9762 else if ( (LA17_0==UNSIGNEDTOK) ) {s = 6;}
9763
9764 else if ( (LA17_0==CHARTOK) ) {s = 7;}
9765
9766 else if ( (LA17_0==DOUBLETOK) ) {s = 8;}
9767
9768 else if ( (LA17_0==VOIDTOK) ) {s = 9;}
9769
9770 else if ( (LA17_0==BOOLTOK) ) {s = 10;}
9771
9772 else if ( (LA17_0==COMPLEXTOK) ) {s = 11;}
9773
9774 else if ( (LA17_0==IMAGINARYTOK) ) {s = 12;}
9775
9776 else if ( (LA17_0==STRUCTTOK) ) {s = 13;}
9777
9778 else if ( (LA17_0==VARIANTTOK) ) {s = 14;}
9779
9780 else if ( (LA17_0==ENUMTOK) ) {s = 15;}
9781
9782 else if ( (LA17_0==FLOATINGPOINTTOK||LA17_0==INTEGERTOK||LA17_0==STRINGTOK) ) {s = 16;}
9783
9784 else if ( (LA17_0==IDENTIFIER) && ((inTypealiasAlias() || isTypeName(input.LT(1).getText())))) {s = 17;}
9785
9786
9787 input.seek(index17_0);
9788 if ( s>=0 ) {
9789 return s;
9790 }
9791 break;
9792 }
9793 if (state.backtracking>0) {state.failed=true; return -1;}
9794 NoViableAltException nvae =
9795 new NoViableAltException(getDescription(), 17, _s, input);
9796 error(nvae);
9797 throw nvae;
9798 }
9799 }
9800 static final String DFA24_eotS =
9801 "\6\uffff";
9802 static final String DFA24_eofS =
9803 "\6\uffff";
9804 static final String DFA24_minS =
9805 "\1\61\1\5\1\0\1\5\2\uffff";
9806 static final String DFA24_maxS =
9807 "\2\117\1\0\1\117\2\uffff";
9808 static final String DFA24_acceptS =
9809 "\4\uffff\1\1\1\2";
9810 static final String DFA24_specialS =
9811 "\2\uffff\1\0\3\uffff}>";
9812 static final String[] DFA24_transitionS = {
9813 "\1\1\35\uffff\1\2",
9814 "\1\3\53\uffff\1\1\35\uffff\1\2",
9815 "\1\uffff",
9816 "\1\3\53\uffff\1\1\35\uffff\1\2",
9817 "",
9818 ""
9819 };
9820
9821 static final short[] DFA24_eot = DFA.unpackEncodedString(DFA24_eotS);
9822 static final short[] DFA24_eof = DFA.unpackEncodedString(DFA24_eofS);
9823 static final char[] DFA24_min = DFA.unpackEncodedStringToUnsignedChars(DFA24_minS);
9824 static final char[] DFA24_max = DFA.unpackEncodedStringToUnsignedChars(DFA24_maxS);
9825 static final short[] DFA24_accept = DFA.unpackEncodedString(DFA24_acceptS);
9826 static final short[] DFA24_special = DFA.unpackEncodedString(DFA24_specialS);
9827 static final short[][] DFA24_transition;
9828
9829 static {
9830 int numStates = DFA24_transitionS.length;
9831 DFA24_transition = new short[numStates][];
9832 for (int i=0; i<numStates; i++) {
9833 DFA24_transition[i] = DFA.unpackEncodedString(DFA24_transitionS[i]);
9834 }
9835 }
9836
9837 class DFA24 extends DFA {
9838
9839 public DFA24(BaseRecognizer recognizer) {
9840 this.recognizer = recognizer;
9841 this.decisionNumber = 24;
9842 this.eot = DFA24_eot;
9843 this.eof = DFA24_eof;
9844 this.min = DFA24_min;
9845 this.max = DFA24_max;
9846 this.accept = DFA24_accept;
9847 this.special = DFA24_special;
9848 this.transition = DFA24_transition;
9849 }
9850 public String getDescription() {
9851 return "522:7: ({...}? => declaratorList -> ^( TYPEDEF declaratorList declarationSpecifiers ) | structOrVariantDeclaratorList -> ^( SV_DECLARATION declarationSpecifiers structOrVariantDeclaratorList ) )";
9852 }
9853 public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
9854 TokenStream input = (TokenStream)_input;
9855 int _s = s;
9856 switch ( s ) {
9857 case 0 :
9858 int LA24_2 = input.LA(1);
9859
9860
9861 int index24_2 = input.index();
9862 input.rewind();
9863 s = -1;
9864 if ( ((inTypedef())) ) {s = 4;}
9865
9866 else if ( (true) ) {s = 5;}
9867
9868
9869 input.seek(index24_2);
9870 if ( s>=0 ) {
9871 return s;
9872 }
9873 break;
9874 }
9875 if (state.backtracking>0) {state.failed=true; return -1;}
9876 NoViableAltException nvae =
9877 new NoViableAltException(getDescription(), 24, _s, input);
9878 error(nvae);
9879 throw nvae;
9880 }
9881 }
9882 static final String DFA32_eotS =
9883 "\35\uffff";
9884 static final String DFA32_eofS =
9885 "\1\3\34\uffff";
9886 static final String DFA32_minS =
9887 "\1\5\34\uffff";
9888 static final String DFA32_maxS =
9889 "\1\117\34\uffff";
9890 static final String DFA32_acceptS =
9891 "\1\uffff\1\1\1\2\1\3\31\uffff";
9892 static final String DFA32_specialS =
9893 "\35\uffff}>";
9894 static final String[] DFA32_transitionS = {
9895 "\4\3\1\uffff\7\3\1\uffff\2\3\2\uffff\7\3\7\uffff\1\1\2\uffff"+
9896 "\1\3\4\uffff\1\3\1\uffff\1\2\1\uffff\2\3\35\uffff\1\3",
9897 "",
9898 "",
9899 "",
9900 "",
9901 "",
9902 "",
9903 "",
9904 "",
9905 "",
9906 "",
9907 "",
9908 "",
9909 "",
9910 "",
9911 "",
9912 "",
9913 "",
9914 "",
9915 "",
9916 "",
9917 "",
9918 "",
9919 "",
9920 "",
9921 "",
9922 "",
9923 "",
9924 ""
9925 };
9926
9927 static final short[] DFA32_eot = DFA.unpackEncodedString(DFA32_eotS);
9928 static final short[] DFA32_eof = DFA.unpackEncodedString(DFA32_eofS);
9929 static final char[] DFA32_min = DFA.unpackEncodedStringToUnsignedChars(DFA32_minS);
9930 static final char[] DFA32_max = DFA.unpackEncodedStringToUnsignedChars(DFA32_maxS);
9931 static final short[] DFA32_accept = DFA.unpackEncodedString(DFA32_acceptS);
9932 static final short[] DFA32_special = DFA.unpackEncodedString(DFA32_specialS);
9933 static final short[][] DFA32_transition;
9934
9935 static {
9936 int numStates = DFA32_transitionS.length;
9937 DFA32_transition = new short[numStates][];
9938 for (int i=0; i<numStates; i++) {
9939 DFA32_transition[i] = DFA.unpackEncodedString(DFA32_transitionS[i]);
9940 }
9941 }
9942
9943 class DFA32 extends DFA {
9944
9945 public DFA32(BaseRecognizer recognizer) {
9946 this.recognizer = recognizer;
9947 this.decisionNumber = 32;
9948 this.eot = DFA32_eot;
9949 this.eof = DFA32_eof;
9950 this.min = DFA32_min;
9951 this.max = DFA32_max;
9952 this.accept = DFA32_accept;
9953 this.special = DFA32_special;
9954 this.transition = DFA32_transition;
9955 }
9956 public String getDescription() {
9957 return "656:4: ( enumContainerType enumBody | enumBody | )";
9958 }
9959 }
9960 static final String DFA54_eotS =
9961 "\34\uffff";
9962 static final String DFA54_eofS =
9963 "\1\2\33\uffff";
9964 static final String DFA54_minS =
9965 "\1\5\33\uffff";
9966 static final String DFA54_maxS =
9967 "\1\117\33\uffff";
9968 static final String DFA54_acceptS =
9969 "\1\uffff\1\1\1\2\31\uffff";
9970 static final String DFA54_specialS =
9971 "\34\uffff}>";
9972 static final String[] DFA54_transitionS = {
9973 "\4\2\1\uffff\7\2\1\uffff\2\2\2\uffff\7\2\12\uffff\1\2\4\uffff"+
9974 "\1\2\1\uffff\1\1\1\uffff\2\2\35\uffff\1\2",
9975 "",
9976 "",
9977 "",
9978 "",
9979 "",
9980 "",
9981 "",
9982 "",
9983 "",
9984 "",
9985 "",
9986 "",
9987 "",
9988 "",
9989 "",
9990 "",
9991 "",
9992 "",
9993 "",
9994 "",
9995 "",
9996 "",
9997 "",
9998 "",
9999 "",
10000 "",
10001 ""
10002 };
10003
10004 static final short[] DFA54_eot = DFA.unpackEncodedString(DFA54_eotS);
10005 static final short[] DFA54_eof = DFA.unpackEncodedString(DFA54_eofS);
10006 static final char[] DFA54_min = DFA.unpackEncodedStringToUnsignedChars(DFA54_minS);
10007 static final char[] DFA54_max = DFA.unpackEncodedStringToUnsignedChars(DFA54_maxS);
10008 static final short[] DFA54_accept = DFA.unpackEncodedString(DFA54_acceptS);
10009 static final short[] DFA54_special = DFA.unpackEncodedString(DFA54_specialS);
10010 static final short[][] DFA54_transition;
10011
10012 static {
10013 int numStates = DFA54_transitionS.length;
10014 DFA54_transition = new short[numStates][];
10015 for (int i=0; i<numStates; i++) {
10016 DFA54_transition[i] = DFA.unpackEncodedString(DFA54_transitionS[i]);
10017 }
10018 }
10019
10020 class DFA54 extends DFA {
10021
10022 public DFA54(BaseRecognizer recognizer) {
10023 this.recognizer = recognizer;
10024 this.decisionNumber = 54;
10025 this.eot = DFA54_eot;
10026 this.eof = DFA54_eof;
10027 this.min = DFA54_min;
10028 this.max = DFA54_max;
10029 this.accept = DFA54_accept;
10030 this.special = DFA54_special;
10031 this.transition = DFA54_transition;
10032 }
10033 public String getDescription() {
10034 return "956:15: ( ctfBody )?";
10035 }
10036 }
10037
10038
10039 public static final BitSet FOLLOW_declaration_in_parse325 = new BitSet(new long[]{0x00000000FFFFFFE0L,0x0000000000008000L});
10040 public static final BitSet FOLLOW_EOF_in_parse328 = new BitSet(new long[]{0x0000000000000002L});
10041 public static final BitSet FOLLOW_SIGN_in_numberLiteral361 = new BitSet(new long[]{0x1284000000000000L});
10042 public static final BitSet FOLLOW_HEX_LITERAL_in_numberLiteral366 = new BitSet(new long[]{0x0000000000000002L});
10043 public static final BitSet FOLLOW_DECIMAL_LITERAL_in_numberLiteral383 = new BitSet(new long[]{0x0000000000000002L});
10044 public static final BitSet FOLLOW_OCTAL_LITERAL_in_numberLiteral400 = new BitSet(new long[]{0x0000000000000002L});
10045 public static final BitSet FOLLOW_numberLiteral_in_constant436 = new BitSet(new long[]{0x0000000000000002L});
10046 public static final BitSet FOLLOW_enumConstant_in_constant442 = new BitSet(new long[]{0x0000000000000002L});
10047 public static final BitSet FOLLOW_CHARACTER_LITERAL_in_constant448 = new BitSet(new long[]{0x0000000000000002L});
10048 public static final BitSet FOLLOW_IDENTIFIER_in_primaryExpression479 = new BitSet(new long[]{0x0000000000000002L});
10049 public static final BitSet FOLLOW_ctfKeyword_in_primaryExpression501 = new BitSet(new long[]{0x0000000000000002L});
10050 public static final BitSet FOLLOW_STRING_LITERAL_in_primaryExpression521 = new BitSet(new long[]{0x0000000000000002L});
10051 public static final BitSet FOLLOW_constant_in_primaryExpression542 = new BitSet(new long[]{0x0000000000000002L});
10052 public static final BitSet FOLLOW_DOT_in_reference568 = new BitSet(new long[]{0x0000000000000000L,0x0000000000008000L});
10053 public static final BitSet FOLLOW_ARROW_in_reference574 = new BitSet(new long[]{0x0000000000000000L,0x0000000000008000L});
10054 public static final BitSet FOLLOW_IDENTIFIER_in_reference577 = new BitSet(new long[]{0x0000000000000002L});
10055 public static final BitSet FOLLOW_OPENBRAC_in_postfixExpressionSuffix616 = new BitSet(new long[]{0x12840000E0170210L,0x0000000000008120L});
10056 public static final BitSet FOLLOW_unaryExpression_in_postfixExpressionSuffix618 = new BitSet(new long[]{0x0000080000000000L});
10057 public static final BitSet FOLLOW_CLOSEBRAC_in_postfixExpressionSuffix620 = new BitSet(new long[]{0x0000000000000002L});
10058 public static final BitSet FOLLOW_reference_in_postfixExpressionSuffix628 = new BitSet(new long[]{0x0000000000000002L});
10059 public static final BitSet FOLLOW_primaryExpression_in_postfixExpression652 = new BitSet(new long[]{0x0018040000000002L});
10060 public static final BitSet FOLLOW_postfixExpressionSuffix_in_postfixExpression656 = new BitSet(new long[]{0x0018040000000002L});
10061 public static final BitSet FOLLOW_ctfSpecifierHead_in_postfixExpression665 = new BitSet(new long[]{0x0018040000000000L});
10062 public static final BitSet FOLLOW_postfixExpressionSuffix_in_postfixExpression670 = new BitSet(new long[]{0x0018040000000002L});
10063 public static final BitSet FOLLOW_postfixExpression_in_unaryExpression704 = new BitSet(new long[]{0x0000000000000002L});
10064 public static final BitSet FOLLOW_STRING_LITERAL_in_enumConstant729 = new BitSet(new long[]{0x0000000000000002L});
10065 public static final BitSet FOLLOW_IDENTIFIER_in_enumConstant745 = new BitSet(new long[]{0x0000000000000002L});
10066 public static final BitSet FOLLOW_ctfKeyword_in_enumConstant761 = new BitSet(new long[]{0x0000000000000002L});
10067 public static final BitSet FOLLOW_declarationSpecifiers_in_declaration794 = new BitSet(new long[]{0x0003000000000000L,0x0000000000008000L});
10068 public static final BitSet FOLLOW_declaratorList_in_declaration796 = new BitSet(new long[]{0x0001000000000000L});
10069 public static final BitSet FOLLOW_TERM_in_declaration799 = new BitSet(new long[]{0x0000000000000002L});
10070 public static final BitSet FOLLOW_ctfSpecifier_in_declaration848 = new BitSet(new long[]{0x0001000000000000L});
10071 public static final BitSet FOLLOW_TERM_in_declaration850 = new BitSet(new long[]{0x0000000000000002L});
10072 public static final BitSet FOLLOW_storageClassSpecifier_in_declarationSpecifiers895 = new BitSet(new long[]{0x000000001FCDFDE2L,0x0000000000008000L});
10073 public static final BitSet FOLLOW_typeQualifier_in_declarationSpecifiers902 = new BitSet(new long[]{0x000000001FCDFDE2L,0x0000000000008000L});
10074 public static final BitSet FOLLOW_typeSpecifier_in_declarationSpecifiers909 = new BitSet(new long[]{0x000000001FCDFDE2L,0x0000000000008000L});
10075 public static final BitSet FOLLOW_declarator_in_declaratorList950 = new BitSet(new long[]{0x0000000800000002L});
10076 public static final BitSet FOLLOW_SEPARATOR_in_declaratorList953 = new BitSet(new long[]{0x0002000000000000L,0x0000000000008000L});
10077 public static final BitSet FOLLOW_declarator_in_declaratorList955 = new BitSet(new long[]{0x0000000800000002L});
10078 public static final BitSet FOLLOW_abstractDeclarator_in_abstractDeclaratorList989 = new BitSet(new long[]{0x0000000800000002L});
10079 public static final BitSet FOLLOW_SEPARATOR_in_abstractDeclaratorList992 = new BitSet(new long[]{0x0002100000000000L,0x0000000000008000L});
10080 public static final BitSet FOLLOW_abstractDeclarator_in_abstractDeclaratorList994 = new BitSet(new long[]{0x0000000800000002L});
10081 public static final BitSet FOLLOW_TYPEDEFTOK_in_storageClassSpecifier1018 = new BitSet(new long[]{0x0000000000000002L});
10082 public static final BitSet FOLLOW_FLOATTOK_in_typeSpecifier1044 = new BitSet(new long[]{0x0000000000000002L});
10083 public static final BitSet FOLLOW_INTTOK_in_typeSpecifier1050 = new BitSet(new long[]{0x0000000000000002L});
10084 public static final BitSet FOLLOW_LONGTOK_in_typeSpecifier1056 = new BitSet(new long[]{0x0000000000000002L});
10085 public static final BitSet FOLLOW_SHORTTOK_in_typeSpecifier1062 = new BitSet(new long[]{0x0000000000000002L});
10086 public static final BitSet FOLLOW_SIGNEDTOK_in_typeSpecifier1068 = new BitSet(new long[]{0x0000000000000002L});
10087 public static final BitSet FOLLOW_UNSIGNEDTOK_in_typeSpecifier1074 = new BitSet(new long[]{0x0000000000000002L});
10088 public static final BitSet FOLLOW_CHARTOK_in_typeSpecifier1080 = new BitSet(new long[]{0x0000000000000002L});
10089 public static final BitSet FOLLOW_DOUBLETOK_in_typeSpecifier1086 = new BitSet(new long[]{0x0000000000000002L});
10090 public static final BitSet FOLLOW_VOIDTOK_in_typeSpecifier1092 = new BitSet(new long[]{0x0000000000000002L});
10091 public static final BitSet FOLLOW_BOOLTOK_in_typeSpecifier1098 = new BitSet(new long[]{0x0000000000000002L});
10092 public static final BitSet FOLLOW_COMPLEXTOK_in_typeSpecifier1104 = new BitSet(new long[]{0x0000000000000002L});
10093 public static final BitSet FOLLOW_IMAGINARYTOK_in_typeSpecifier1110 = new BitSet(new long[]{0x0000000000000002L});
10094 public static final BitSet FOLLOW_structSpecifier_in_typeSpecifier1116 = new BitSet(new long[]{0x0000000000000002L});
10095 public static final BitSet FOLLOW_variantSpecifier_in_typeSpecifier1122 = new BitSet(new long[]{0x0000000000000002L});
10096 public static final BitSet FOLLOW_enumSpecifier_in_typeSpecifier1128 = new BitSet(new long[]{0x0000000000000002L});
10097 public static final BitSet FOLLOW_ctfTypeSpecifier_in_typeSpecifier1134 = new BitSet(new long[]{0x0000000000000002L});
10098 public static final BitSet FOLLOW_typedefName_in_typeSpecifier1144 = new BitSet(new long[]{0x0000000000000002L});
10099 public static final BitSet FOLLOW_CONSTTOK_in_typeQualifier1167 = new BitSet(new long[]{0x0000000000000002L});
10100 public static final BitSet FOLLOW_ALIGNTOK_in_alignAttribute1180 = new BitSet(new long[]{0x0000100000000000L});
10101 public static final BitSet FOLLOW_LPAREN_in_alignAttribute1182 = new BitSet(new long[]{0x12840000E0170210L,0x0000000000008120L});
10102 public static final BitSet FOLLOW_unaryExpression_in_alignAttribute1184 = new BitSet(new long[]{0x0000200000000000L});
10103 public static final BitSet FOLLOW_RPAREN_in_alignAttribute1186 = new BitSet(new long[]{0x0000000000000002L});
10104 public static final BitSet FOLLOW_LCURL_in_structBody1227 = new BitSet(new long[]{0x00008000FFFFFFE0L,0x0000000000008000L});
10105 public static final BitSet FOLLOW_structOrVariantDeclarationList_in_structBody1229 = new BitSet(new long[]{0x0000800000000000L});
10106 public static final BitSet FOLLOW_RCURL_in_structBody1232 = new BitSet(new long[]{0x0000000000000002L});
10107 public static final BitSet FOLLOW_STRUCTTOK_in_structSpecifier1270 = new BitSet(new long[]{0x0000400000000000L,0x0000000000008000L});
10108 public static final BitSet FOLLOW_structName_in_structSpecifier1292 = new BitSet(new long[]{0x0000400000000012L,0x0000000000008000L});
10109 public static final BitSet FOLLOW_alignAttribute_in_structSpecifier1308 = new BitSet(new long[]{0x0000000000000002L});
10110 public static final BitSet FOLLOW_structBody_in_structSpecifier1337 = new BitSet(new long[]{0x0000000000000012L});
10111 public static final BitSet FOLLOW_alignAttribute_in_structSpecifier1362 = new BitSet(new long[]{0x0000000000000002L});
10112 public static final BitSet FOLLOW_structBody_in_structSpecifier1460 = new BitSet(new long[]{0x0000000000000012L});
10113 public static final BitSet FOLLOW_alignAttribute_in_structSpecifier1478 = new BitSet(new long[]{0x0000000000000002L});
10114 public static final BitSet FOLLOW_IDENTIFIER_in_structName1554 = new BitSet(new long[]{0x0000000000000002L});
10115 public static final BitSet FOLLOW_structOrVariantDeclaration_in_structOrVariantDeclarationList1585 = new BitSet(new long[]{0x00000000FFFFFFE2L,0x0000000000008000L});
10116 public static final BitSet FOLLOW_declarationSpecifiers_in_structOrVariantDeclaration1623 = new BitSet(new long[]{0x0002000000000000L,0x0000000000008000L});
10117 public static final BitSet FOLLOW_declaratorList_in_structOrVariantDeclaration1655 = new BitSet(new long[]{0x0001000000000000L});
10118 public static final BitSet FOLLOW_structOrVariantDeclaratorList_in_structOrVariantDeclaration1689 = new BitSet(new long[]{0x0001000000000000L});
10119 public static final BitSet FOLLOW_typealiasDecl_in_structOrVariantDeclaration1739 = new BitSet(new long[]{0x0001000000000000L});
10120 public static final BitSet FOLLOW_TERM_in_structOrVariantDeclaration1751 = new BitSet(new long[]{0x0000000000000002L});
10121 public static final BitSet FOLLOW_typeQualifier_in_specifierQualifierList1775 = new BitSet(new long[]{0x000000001FCDFDE2L,0x0000000000008000L});
10122 public static final BitSet FOLLOW_typeSpecifier_in_specifierQualifierList1779 = new BitSet(new long[]{0x000000001FCDFDE2L,0x0000000000008000L});
10123 public static final BitSet FOLLOW_structOrVariantDeclarator_in_structOrVariantDeclaratorList1816 = new BitSet(new long[]{0x0000000800000002L});
10124 public static final BitSet FOLLOW_SEPARATOR_in_structOrVariantDeclaratorList1819 = new BitSet(new long[]{0x0002000000000000L,0x0000000000008000L});
10125 public static final BitSet FOLLOW_structOrVariantDeclarator_in_structOrVariantDeclaratorList1821 = new BitSet(new long[]{0x0000000800000002L});
10126 public static final BitSet FOLLOW_declarator_in_structOrVariantDeclarator1862 = new BitSet(new long[]{0x0000001000000002L});
10127 public static final BitSet FOLLOW_COLON_in_structOrVariantDeclarator1865 = new BitSet(new long[]{0x1284000000000000L});
10128 public static final BitSet FOLLOW_numberLiteral_in_structOrVariantDeclarator1867 = new BitSet(new long[]{0x0000000000000002L});
10129 public static final BitSet FOLLOW_VARIANTTOK_in_variantSpecifier1901 = new BitSet(new long[]{0x0000410000000000L,0x0000000000008000L});
10130 public static final BitSet FOLLOW_variantName_in_variantSpecifier1919 = new BitSet(new long[]{0x0000410000000000L,0x0000000000008000L});
10131 public static final BitSet FOLLOW_variantTag_in_variantSpecifier1950 = new BitSet(new long[]{0x0000410000000002L,0x0000000000008000L});
10132 public static final BitSet FOLLOW_variantBody_in_variantSpecifier1976 = new BitSet(new long[]{0x0000000000000002L});
10133 public static final BitSet FOLLOW_variantBody_in_variantSpecifier2044 = new BitSet(new long[]{0x0000000000000002L});
10134 public static final BitSet FOLLOW_variantTag_in_variantSpecifier2069 = new BitSet(new long[]{0x0000410000000000L,0x0000000000008000L});
10135 public static final BitSet FOLLOW_variantBody_in_variantSpecifier2071 = new BitSet(new long[]{0x0000000000000002L});
10136 public static final BitSet FOLLOW_variantBody_in_variantSpecifier2082 = new BitSet(new long[]{0x0000000000000002L});
10137 public static final BitSet FOLLOW_IDENTIFIER_in_variantName2124 = new BitSet(new long[]{0x0000000000000002L});
10138 public static final BitSet FOLLOW_LCURL_in_variantBody2160 = new BitSet(new long[]{0x00000000FFFFFFE0L,0x0000000000008000L});
10139 public static final BitSet FOLLOW_structOrVariantDeclarationList_in_variantBody2162 = new BitSet(new long[]{0x0000800000000000L});
10140 public static final BitSet FOLLOW_RCURL_in_variantBody2164 = new BitSet(new long[]{0x0000000000000002L});
10141 public static final BitSet FOLLOW_LT_in_variantTag2195 = new BitSet(new long[]{0x0000000000000000L,0x0000000000008000L});
10142 public static final BitSet FOLLOW_IDENTIFIER_in_variantTag2197 = new BitSet(new long[]{0x0000020000000000L});
10143 public static final BitSet FOLLOW_GT_in_variantTag2199 = new BitSet(new long[]{0x0000000000000002L});
10144 public static final BitSet FOLLOW_ENUMTOK_in_enumSpecifier2229 = new BitSet(new long[]{0x0000401000000000L,0x0000000000008000L});
10145 public static final BitSet FOLLOW_enumName_in_enumSpecifier2244 = new BitSet(new long[]{0x0000401000000002L,0x0000000000008000L});
10146 public static final BitSet FOLLOW_enumContainerType_in_enumSpecifier2255 = new BitSet(new long[]{0x0000401000000000L,0x0000000000008000L});
10147 public static final BitSet FOLLOW_enumBody_in_enumSpecifier2257 = new BitSet(new long[]{0x0000000000000002L});
10148 public static final BitSet FOLLOW_enumBody_in_enumSpecifier2269 = new BitSet(new long[]{0x0000000000000002L});
10149 public static final BitSet FOLLOW_enumContainerType_in_enumSpecifier2304 = new BitSet(new long[]{0x0000401000000000L,0x0000000000008000L});
10150 public static final BitSet FOLLOW_enumBody_in_enumSpecifier2306 = new BitSet(new long[]{0x0000000000000002L});
10151 public static final BitSet FOLLOW_enumBody_in_enumSpecifier2315 = new BitSet(new long[]{0x0000000000000002L});
10152 public static final BitSet FOLLOW_IDENTIFIER_in_enumName2360 = new BitSet(new long[]{0x0000000000000002L});
10153 public static final BitSet FOLLOW_LCURL_in_enumBody2393 = new BitSet(new long[]{0x0000000000050210L,0x0000000000008100L});
10154 public static final BitSet FOLLOW_enumeratorList_in_enumBody2395 = new BitSet(new long[]{0x0000800800000000L});
10155 public static final BitSet FOLLOW_SEPARATOR_in_enumBody2398 = new BitSet(new long[]{0x0000800000000000L});
10156 public static final BitSet FOLLOW_RCURL_in_enumBody2400 = new BitSet(new long[]{0x0000000000000002L});
10157 public static final BitSet FOLLOW_RCURL_in_enumBody2404 = new BitSet(new long[]{0x0000000000000002L});
10158 public static final BitSet FOLLOW_COLON_in_enumContainerType2436 = new BitSet(new long[]{0x000000001FCDFDE0L,0x0000000000008000L});
10159 public static final BitSet FOLLOW_declarationSpecifiers_in_enumContainerType2438 = new BitSet(new long[]{0x0000000000000002L});
10160 public static final BitSet FOLLOW_enumerator_in_enumeratorList2469 = new BitSet(new long[]{0x0000000800000002L});
10161 public static final BitSet FOLLOW_SEPARATOR_in_enumeratorList2472 = new BitSet(new long[]{0x0000000000050210L,0x0000000000008100L});
10162 public static final BitSet FOLLOW_enumerator_in_enumeratorList2474 = new BitSet(new long[]{0x0000000800000002L});
10163 public static final BitSet FOLLOW_enumConstant_in_enumerator2510 = new BitSet(new long[]{0x0000004000000002L});
10164 public static final BitSet FOLLOW_enumeratorValue_in_enumerator2512 = new BitSet(new long[]{0x0000000000000002L});
10165 public static final BitSet FOLLOW_ASSIGNMENT_in_enumeratorValue2536 = new BitSet(new long[]{0x12840000E0170210L,0x0000000000008120L});
10166 public static final BitSet FOLLOW_unaryExpression_in_enumeratorValue2540 = new BitSet(new long[]{0x0000002000000002L});
10167 public static final BitSet FOLLOW_ELIPSES_in_enumeratorValue2566 = new BitSet(new long[]{0x12840000E0170210L,0x0000000000008120L});
10168 public static final BitSet FOLLOW_unaryExpression_in_enumeratorValue2570 = new BitSet(new long[]{0x0000000000000002L});
10169 public static final BitSet FOLLOW_pointer_in_declarator2612 = new BitSet(new long[]{0x0002000000000000L,0x0000000000008000L});
10170 public static final BitSet FOLLOW_directDeclarator_in_declarator2615 = new BitSet(new long[]{0x0000000000000002L});
10171 public static final BitSet FOLLOW_IDENTIFIER_in_directDeclarator2659 = new BitSet(new long[]{0x0000040000000002L});
10172 public static final BitSet FOLLOW_directDeclaratorSuffix_in_directDeclarator2677 = new BitSet(new long[]{0x0000040000000002L});
10173 public static final BitSet FOLLOW_OPENBRAC_in_directDeclaratorSuffix2690 = new BitSet(new long[]{0x12840000E0170210L,0x0000000000008120L});
10174 public static final BitSet FOLLOW_directDeclaratorLength_in_directDeclaratorSuffix2692 = new BitSet(new long[]{0x0000080000000000L});
10175 public static final BitSet FOLLOW_CLOSEBRAC_in_directDeclaratorSuffix2694 = new BitSet(new long[]{0x0000000000000002L});
10176 public static final BitSet FOLLOW_unaryExpression_in_directDeclaratorLength2715 = new BitSet(new long[]{0x0000000000000002L});
10177 public static final BitSet FOLLOW_pointer_in_abstractDeclarator2746 = new BitSet(new long[]{0x0002100000000002L,0x0000000000008000L});
10178 public static final BitSet FOLLOW_directAbstractDeclarator_in_abstractDeclarator2749 = new BitSet(new long[]{0x0000000000000002L});
10179 public static final BitSet FOLLOW_directAbstractDeclarator_in_abstractDeclarator2769 = new BitSet(new long[]{0x0000000000000002L});
10180 public static final BitSet FOLLOW_IDENTIFIER_in_directAbstractDeclarator2809 = new BitSet(new long[]{0x0000040000000002L});
10181 public static final BitSet FOLLOW_LPAREN_in_directAbstractDeclarator2818 = new BitSet(new long[]{0x0002100000000000L,0x0000000000008000L});
10182 public static final BitSet FOLLOW_abstractDeclarator_in_directAbstractDeclarator2820 = new BitSet(new long[]{0x0000200000000000L});
10183 public static final BitSet FOLLOW_RPAREN_in_directAbstractDeclarator2822 = new BitSet(new long[]{0x0000040000000002L});
10184 public static final BitSet FOLLOW_OPENBRAC_in_directAbstractDeclarator2837 = new BitSet(new long[]{0x12840800E0170210L,0x0000000000008120L});
10185 public static final BitSet FOLLOW_unaryExpression_in_directAbstractDeclarator2839 = new BitSet(new long[]{0x0000080000000000L});
10186 public static final BitSet FOLLOW_CLOSEBRAC_in_directAbstractDeclarator2842 = new BitSet(new long[]{0x0000000000000002L});
10187 public static final BitSet FOLLOW_POINTER_in_pointer2870 = new BitSet(new long[]{0x0000000000000022L});
10188 public static final BitSet FOLLOW_typeQualifierList_in_pointer2872 = new BitSet(new long[]{0x0000000000000002L});
10189 public static final BitSet FOLLOW_typeQualifier_in_typeQualifierList2895 = new BitSet(new long[]{0x0000000000000022L});
10190 public static final BitSet FOLLOW_IDENTIFIER_in_typedefName2921 = new BitSet(new long[]{0x0000000000000002L});
10191 public static final BitSet FOLLOW_declarationSpecifiers_in_typealiasTarget2949 = new BitSet(new long[]{0x0002100000000002L,0x0000000000008000L});
10192 public static final BitSet FOLLOW_abstractDeclaratorList_in_typealiasTarget2951 = new BitSet(new long[]{0x0000000000000002L});
10193 public static final BitSet FOLLOW_abstractDeclaratorList_in_typealiasAlias2984 = new BitSet(new long[]{0x0000000000000002L});
10194 public static final BitSet FOLLOW_declarationSpecifiers_in_typealiasAlias2993 = new BitSet(new long[]{0x0002100000000002L,0x0000000000008000L});
10195 public static final BitSet FOLLOW_abstractDeclaratorList_in_typealiasAlias2995 = new BitSet(new long[]{0x0000000000000002L});
10196 public static final BitSet FOLLOW_TYPEALIASTOK_in_typealiasDecl3027 = new BitSet(new long[]{0x000000001FCDFDE0L,0x0000000000008000L});
10197 public static final BitSet FOLLOW_typealiasTarget_in_typealiasDecl3029 = new BitSet(new long[]{0x0000008000000000L});
10198 public static final BitSet FOLLOW_TYPE_ASSIGNMENT_in_typealiasDecl3031 = new BitSet(new long[]{0x000210001FCDFDE0L,0x0000000000008000L});
10199 public static final BitSet FOLLOW_typealiasAlias_in_typealiasDecl3033 = new BitSet(new long[]{0x0000000000000002L});
10200 public static final BitSet FOLLOW_set_in_ctfKeyword0 = new BitSet(new long[]{0x0000000000000002L});
10201 public static final BitSet FOLLOW_ctfSpecifierHead_in_ctfSpecifier3127 = new BitSet(new long[]{0x0000400000000000L});
10202 public static final BitSet FOLLOW_ctfBody_in_ctfSpecifier3129 = new BitSet(new long[]{0x0000000000000002L});
10203 public static final BitSet FOLLOW_typealiasDecl_in_ctfSpecifier3148 = new BitSet(new long[]{0x0000000000000002L});
10204 public static final BitSet FOLLOW_EVENTTOK_in_ctfSpecifierHead3180 = new BitSet(new long[]{0x0000000000000002L});
10205 public static final BitSet FOLLOW_STREAMTOK_in_ctfSpecifierHead3189 = new BitSet(new long[]{0x0000000000000002L});
10206 public static final BitSet FOLLOW_TRACETOK_in_ctfSpecifierHead3198 = new BitSet(new long[]{0x0000000000000002L});
10207 public static final BitSet FOLLOW_ENVTOK_in_ctfSpecifierHead3207 = new BitSet(new long[]{0x0000000000000002L});
10208 public static final BitSet FOLLOW_CLOCKTOK_in_ctfSpecifierHead3216 = new BitSet(new long[]{0x0000000000000002L});
10209 public static final BitSet FOLLOW_CALLSITETOK_in_ctfSpecifierHead3225 = new BitSet(new long[]{0x0000000000000002L});
10210 public static final BitSet FOLLOW_FLOATINGPOINTTOK_in_ctfTypeSpecifier3259 = new BitSet(new long[]{0x0000400000000000L});
10211 public static final BitSet FOLLOW_ctfBody_in_ctfTypeSpecifier3261 = new BitSet(new long[]{0x0000000000000002L});
10212 public static final BitSet FOLLOW_INTEGERTOK_in_ctfTypeSpecifier3276 = new BitSet(new long[]{0x0000400000000000L});
10213 public static final BitSet FOLLOW_ctfBody_in_ctfTypeSpecifier3278 = new BitSet(new long[]{0x0000000000000002L});
10214 public static final BitSet FOLLOW_STRINGTOK_in_ctfTypeSpecifier3293 = new BitSet(new long[]{0x0000400000000002L});
10215 public static final BitSet FOLLOW_ctfBody_in_ctfTypeSpecifier3295 = new BitSet(new long[]{0x0000000000000002L});
10216 public static final BitSet FOLLOW_LCURL_in_ctfBody3333 = new BitSet(new long[]{0x12848000FFFFFFF0L,0x0000000000008120L});
10217 public static final BitSet FOLLOW_ctfAssignmentExpressionList_in_ctfBody3335 = new BitSet(new long[]{0x0000800000000000L});
10218 public static final BitSet FOLLOW_RCURL_in_ctfBody3338 = new BitSet(new long[]{0x0000000000000002L});
10219 public static final BitSet FOLLOW_ctfAssignmentExpression_in_ctfAssignmentExpressionList3357 = new BitSet(new long[]{0x0001000000000000L});
10220 public static final BitSet FOLLOW_TERM_in_ctfAssignmentExpressionList3359 = new BitSet(new long[]{0x12840000FFFFFFF2L,0x0000000000008120L});
10221 public static final BitSet FOLLOW_unaryExpression_in_ctfAssignmentExpression3394 = new BitSet(new long[]{0x000000C000000000L});
10222 public static final BitSet FOLLOW_ASSIGNMENT_in_ctfAssignmentExpression3413 = new BitSet(new long[]{0x12840000E0170210L,0x0000000000008120L});
10223 public static final BitSet FOLLOW_unaryExpression_in_ctfAssignmentExpression3417 = new BitSet(new long[]{0x0000000000000002L});
10224 public static final BitSet FOLLOW_TYPE_ASSIGNMENT_in_ctfAssignmentExpression3451 = new BitSet(new long[]{0x000000001FCDFDE0L,0x0000000000008000L});
10225 public static final BitSet FOLLOW_typeSpecifier_in_ctfAssignmentExpression3456 = new BitSet(new long[]{0x0000000000000002L});
10226 public static final BitSet FOLLOW_declarationSpecifiers_in_ctfAssignmentExpression3506 = new BitSet(new long[]{0x0002000000000000L,0x0000000000008000L});
10227 public static final BitSet FOLLOW_declaratorList_in_ctfAssignmentExpression3510 = new BitSet(new long[]{0x0000000000000002L});
10228 public static final BitSet FOLLOW_typealiasDecl_in_ctfAssignmentExpression3538 = new BitSet(new long[]{0x0000000000000002L});
10229 public static final BitSet FOLLOW_IDENTIFIER_in_synpred1_CTFParser474 = new BitSet(new long[]{0x0000000000000002L});
10230 public static final BitSet FOLLOW_ctfKeyword_in_synpred2_CTFParser496 = new BitSet(new long[]{0x0000000000000002L});
10231 public static final BitSet FOLLOW_STRING_LITERAL_in_synpred3_CTFParser516 = new BitSet(new long[]{0x0000000000000002L});
10232
10233 }
+0
-5
lttng/org.eclipse.linuxtools.lttng/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
lttng/org.eclipse.linuxtools.lttng.core/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
lttng/org.eclipse.linuxtools.lttng.core.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-2
lttng/org.eclipse.linuxtools.lttng.core.tests/traceset/.gitignore less more
0 /*
1 *.tar
+0
-6
lttng/org.eclipse.linuxtools.lttng.help/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
5 build-helper-ericsson.xml
+0
-5
lttng/org.eclipse.linuxtools.lttng.jni/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
lttng/org.eclipse.linuxtools.lttng.releng-site/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
lttng/org.eclipse.linuxtools.lttng.ui/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
lttng/org.eclipse.linuxtools.lttng.ui.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
lttng/org.eclipse.linuxtools.lttng2/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
lttng/org.eclipse.linuxtools.lttng2.core/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
lttng/org.eclipse.linuxtools.lttng2.core.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
lttng/org.eclipse.linuxtools.lttng2.kernel/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
lttng/org.eclipse.linuxtools.lttng2.kernel.core/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
lttng/org.eclipse.linuxtools.lttng2.kernel.core.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
lttng/org.eclipse.linuxtools.lttng2.kernel.ui/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
lttng/org.eclipse.linuxtools.lttng2.kernel.ui.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
lttng/org.eclipse.linuxtools.lttng2.ui/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
lttng/org.eclipse.linuxtools.lttng2.ui.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
lttng/org.eclipse.linuxtools.tmf/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
lttng/org.eclipse.linuxtools.tmf.core/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-6
lttng/org.eclipse.linuxtools.tmf.core.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
5 testfiles/
+0
-5
lttng/org.eclipse.linuxtools.tmf.ui/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
lttng/org.eclipse.linuxtools.tmf.ui.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-2
man/.gitignore less more
0 org.eclipse.linuxtools.man.source-feature
1 /target
+0
-5
man/org.eclipse.linuxtools.man-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
man/org.eclipse.linuxtools.man.core/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-1
oprofile/.gitignore less more
0 /target
+0
-5
oprofile/org.eclipse.linuxtools.oprofile-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-7
oprofile/org.eclipse.linuxtools.oprofile.core/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 oprofile-core.jar
5 target
6 natives/linux/scripts/opcontrol
+0
-5
oprofile/org.eclipse.linuxtools.oprofile.core.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
oprofile/org.eclipse.linuxtools.oprofile.doc/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
oprofile/org.eclipse.linuxtools.oprofile.launch/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
oprofile/org.eclipse.linuxtools.oprofile.launch.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
oprofile/org.eclipse.linuxtools.oprofile.remote-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
oprofile/org.eclipse.linuxtools.oprofile.remote.launch/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
oprofile/org.eclipse.linuxtools.oprofile.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
oprofile/org.eclipse.linuxtools.oprofile.ui/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
oprofile/org.eclipse.linuxtools.oprofile.ui.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-1
perf/.gitignore less more
0 /target
+0
-5
perf/org.eclipse.linuxtools.perf/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-4
perf/org.eclipse.linuxtools.perf-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
+0
-5
perf/org.eclipse.linuxtools.perf.doc/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-4
perf/org.eclipse.linuxtools.perf.remote-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
+0
-5
perf/org.eclipse.linuxtools.perf.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-4
proctools/org.eclipse.linuxtools.sequoyah.device/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
+0
-4
proctools/org.eclipse.linuxtools.sequoyah.device-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
+0
-4
proctools/org.eclipse.linuxtools.sequoyah.device.base/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
+0
-1
profiling/.gitignore less more
0 /target
+0
-5
profiling/org.eclipse.linuxtools.binutils/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
profiling/org.eclipse.linuxtools.dataviewers/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
profiling/org.eclipse.linuxtools.dataviewers-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
profiling/org.eclipse.linuxtools.dataviewers.annotatedsourceeditor/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
profiling/org.eclipse.linuxtools.dataviewers.charts/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-2
profiling/org.eclipse.linuxtools.dataviewers.piechart/.gitignore less more
0 /target
1 /bin
+0
-5
profiling/org.eclipse.linuxtools.profiling-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
profiling/org.eclipse.linuxtools.profiling.launch/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-4
profiling/org.eclipse.linuxtools.profiling.launch.remote/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
+0
-4
profiling/org.eclipse.linuxtools.profiling.remote-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
+0
-5
profiling/org.eclipse.linuxtools.profiling.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
profiling/org.eclipse.linuxtools.profiling.ui/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
profiling/org.eclipse.linuxtools.profiling.ui.capability/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
profiling/org.eclipse.linuxtools.tools.launch.core/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
profiling/org.eclipse.linuxtools.tools.launch.ui/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-1
releng/.gitignore less more
0 org.eclipse.linuxtools.releng-site/target
+0
-5
releng/org.eclipse.linuxtools.releng-site/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-1
rpm/.gitignore less more
0 /target
+0
-5
rpm/org.eclipse.linuxtools.rpm-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-6
rpm/org.eclipse.linuxtools.rpm.core/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
5 /target
+0
-5
rpm/org.eclipse.linuxtools.rpm.core.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
rpm/org.eclipse.linuxtools.rpm.rpmlint/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
rpm/org.eclipse.linuxtools.rpm.speceditor.rcp/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
rpm/org.eclipse.linuxtools.rpm.ui/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-6
rpm/org.eclipse.linuxtools.rpm.ui.editor/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
5 /target
+0
-6
rpm/org.eclipse.linuxtools.rpm.ui.editor.doc/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
5 /target
+0
-5
rpm/org.eclipse.linuxtools.rpm.ui.editor.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-3
rpmstubby/.gitignore less more
0 org.eclipse.linuxtools.rpmstubby-site
1 org.eclipse.linuxtools.rpmstubby.source-feature
2 /target
+0
-7
rpmstubby/org.eclipse.linuxtools.rpmstubby/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
5 /target
6 /target
+0
-5
rpmstubby/org.eclipse.linuxtools.rpmstubby-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-1
systemtap/.gitignore less more
0 /target
+0
-5
systemtap/org.eclipse.linuxtools.callgraph/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.callgraph-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.callgraph.core/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.callgraph.docs/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-4
systemtap/org.eclipse.linuxtools.callgraph.genericzestdemo/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
+0
-5
systemtap/org.eclipse.linuxtools.callgraph.launch/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.callgraph.launch.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.callgraph.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.systemtap-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-4
systemtap/org.eclipse.linuxtools.systemtap.backup-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
+0
-4
systemtap/org.eclipse.linuxtools.systemtap.backup.ui.editor/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
+0
-5
systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.systemtap.ui.dashboard/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.systemtap.ui.doc/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.systemtap.ui.editor/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.systemtap.ui.graphicalrun/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.systemtap.ui.logging/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.systemtap.ui.structures/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.systemtap.ui.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.threadprofiler/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
systemtap/org.eclipse.linuxtools.threadprofiler.feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-1
valgrind/.gitignore less more
0 /target
+0
-5
valgrind/org.eclipse.linuxtools.valgrind-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
valgrind/org.eclipse.linuxtools.valgrind.cachegrind/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-6
valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
5 valgrindFiles
+0
-5
valgrind/org.eclipse.linuxtools.valgrind.core/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
valgrind/org.eclipse.linuxtools.valgrind.doc/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-1
valgrind/org.eclipse.linuxtools.valgrind.helgrind/.gitignore less more
0 bin
+0
-5
valgrind/org.eclipse.linuxtools.valgrind.helgrind.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
valgrind/org.eclipse.linuxtools.valgrind.launch/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
valgrind/org.eclipse.linuxtools.valgrind.launch.remote/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
valgrind/org.eclipse.linuxtools.valgrind.massif/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-6
valgrind/org.eclipse.linuxtools.valgrind.massif.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
5 valgrindFiles
+0
-5
valgrind/org.eclipse.linuxtools.valgrind.memcheck/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-6
valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
5 valgrindFiles
+0
-4
valgrind/org.eclipse.linuxtools.valgrind.remote-feature/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
+0
-5
valgrind/org.eclipse.linuxtools.valgrind.tests/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
valgrind/org.eclipse.linuxtools.valgrind.ui/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target
+0
-5
valgrind/org.eclipse.linuxtools.valgrind.ui.editor/.gitignore less more
0 bin
1 @dot
2 javaCompiler...args
3 build.xml
4 target