You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4157 lines
232KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <title>GNU libiberty</title>
  7. <meta name="description" content="GNU libiberty">
  8. <meta name="keywords" content="GNU libiberty">
  9. <meta name="resource-type" content="document">
  10. <meta name="distribution" content="global">
  11. <meta name="Generator" content="makeinfo">
  12. <link href="#Top" rel="start" title="Top">
  13. <link href="#Index" rel="index" title="Index">
  14. <link href="#SEC_Contents" rel="contents" title="Table of Contents">
  15. <style type="text/css">
  16. <!--
  17. a.summary-letter {text-decoration: none}
  18. blockquote.indentedblock {margin-right: 0em}
  19. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  20. blockquote.smallquotation {font-size: smaller}
  21. div.display {margin-left: 3.2em}
  22. div.example {margin-left: 3.2em}
  23. div.lisp {margin-left: 3.2em}
  24. div.smalldisplay {margin-left: 3.2em}
  25. div.smallexample {margin-left: 3.2em}
  26. div.smalllisp {margin-left: 3.2em}
  27. kbd {font-style: oblique}
  28. pre.display {font-family: inherit}
  29. pre.format {font-family: inherit}
  30. pre.menu-comment {font-family: serif}
  31. pre.menu-preformatted {font-family: serif}
  32. pre.smalldisplay {font-family: inherit; font-size: smaller}
  33. pre.smallexample {font-size: smaller}
  34. pre.smallformat {font-family: inherit; font-size: smaller}
  35. pre.smalllisp {font-size: smaller}
  36. span.nolinebreak {white-space: nowrap}
  37. span.roman {font-family: initial; font-weight: normal}
  38. span.sansserif {font-family: sans-serif; font-weight: normal}
  39. ul.no-bullet {list-style: none}
  40. -->
  41. </style>
  42. </head>
  43. <body lang="en">
  44. <h1 class="settitle" align="center"><small>GNU</small> libiberty</h1>
  45. <a name="SEC_Contents"></a>
  46. <h2 class="contents-heading">Table of Contents</h2>
  47. <div class="contents">
  48. <ul class="no-bullet">
  49. <li><a name="toc-Using-1" href="#Using">1 Using</a></li>
  50. <li><a name="toc-Overview-1" href="#Overview">2 Overview</a>
  51. <ul class="no-bullet">
  52. <li><a name="toc-Supplemental-Functions-1" href="#Supplemental-Functions">2.1 Supplemental Functions</a></li>
  53. <li><a name="toc-Replacement-Functions-1" href="#Replacement-Functions">2.2 Replacement Functions</a>
  54. <ul class="no-bullet">
  55. <li><a name="toc-Memory-Allocation-1" href="#Memory-Allocation">2.2.1 Memory Allocation</a></li>
  56. <li><a name="toc-Exit-Handlers-1" href="#Exit-Handlers">2.2.2 Exit Handlers</a></li>
  57. <li><a name="toc-Error-Reporting-1" href="#Error-Reporting">2.2.3 Error Reporting</a></li>
  58. </ul></li>
  59. <li><a name="toc-Extensions-1" href="#Extensions">2.3 Extensions</a>
  60. <ul class="no-bullet">
  61. <li><a name="toc-Obstacks-1" href="#Obstacks">2.3.1 Obstacks</a>
  62. <ul class="no-bullet">
  63. <li><a name="toc-Creating-Obstacks-1" href="#Creating-Obstacks">2.3.1.1 Creating Obstacks</a></li>
  64. <li><a name="toc-Preparing-for-Using-Obstacks" href="#Preparing-for-Obstacks">2.3.1.2 Preparing for Using Obstacks</a></li>
  65. <li><a name="toc-Allocation-in-an-Obstack-1" href="#Allocation-in-an-Obstack">2.3.1.3 Allocation in an Obstack</a></li>
  66. <li><a name="toc-Freeing-Objects-in-an-Obstack" href="#Freeing-Obstack-Objects">2.3.1.4 Freeing Objects in an Obstack</a></li>
  67. <li><a name="toc-Obstack-Functions-and-Macros" href="#Obstack-Functions">2.3.1.5 Obstack Functions and Macros</a></li>
  68. <li><a name="toc-Growing-Objects-1" href="#Growing-Objects">2.3.1.6 Growing Objects</a></li>
  69. <li><a name="toc-Extra-Fast-Growing-Objects" href="#Extra-Fast-Growing">2.3.1.7 Extra Fast Growing Objects</a></li>
  70. <li><a name="toc-Status-of-an-Obstack-1" href="#Status-of-an-Obstack">2.3.1.8 Status of an Obstack</a></li>
  71. <li><a name="toc-Alignment-of-Data-in-Obstacks" href="#Obstacks-Data-Alignment">2.3.1.9 Alignment of Data in Obstacks</a></li>
  72. <li><a name="toc-Obstack-Chunks-1" href="#Obstack-Chunks">2.3.1.10 Obstack Chunks</a></li>
  73. <li><a name="toc-Summary-of-Obstack-Macros" href="#Summary-of-Obstacks">2.3.1.11 Summary of Obstack Macros</a></li>
  74. </ul></li>
  75. </ul></li>
  76. </ul></li>
  77. <li><a name="toc-Function_002c-Variable_002c-and-Macro-Listing_002e" href="#Functions">3 Function, Variable, and Macro Listing.</a></li>
  78. <li><a name="toc-Licenses-1" href="#Licenses">Appendix A Licenses</a>
  79. <ul class="no-bullet">
  80. <li><a name="toc-GNU-LESSER-GENERAL-PUBLIC-LICENSE" href="#Library-Copying">A.1 GNU LESSER GENERAL PUBLIC LICENSE</a>
  81. <ul class="no-bullet">
  82. <li><a name="toc-Preamble" href="#Preamble">A.1.1 Preamble</a></li>
  83. <li><a name="toc-How-to-Apply-These-Terms-to-Your-New-Libraries" href="#How-to-Apply-These-Terms-to-Your-New-Libraries">A.1.2 How to Apply These Terms to Your New Libraries</a></li>
  84. </ul></li>
  85. <li><a name="toc-BSD-1" href="#BSD">A.2 BSD</a></li>
  86. </ul></li>
  87. <li><a name="toc-Index-1" href="#Index">Index</a></li>
  88. </ul>
  89. </div>
  90. <a name="Top"></a>
  91. <div class="header">
  92. <p>
  93. Next: <a href="#Using" accesskey="n" rel="next">Using</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  94. </div>
  95. <a name="Introduction"></a>
  96. <h1 class="top">Introduction</h1>
  97. <p>The <code>libiberty</code> library is a collection of subroutines used by various
  98. GNU programs. It is available under the Library General Public
  99. License; for more information, see <a href="#Library-Copying">Library Copying</a>.
  100. </p>
  101. <table class="menu" border="0" cellspacing="0">
  102. <tr><td align="left" valign="top">&bull; <a href="#Using" accesskey="1">Using</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">How to use libiberty in your code.
  103. </td></tr>
  104. <tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
  105. </pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Overview" accesskey="2">Overview</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Overview of available function groups.
  106. </td></tr>
  107. <tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
  108. </pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Functions" accesskey="3">Functions</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Available functions, macros, and global variables.
  109. </td></tr>
  110. <tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
  111. </pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Licenses" accesskey="4">Licenses</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">The various licenses under which libiberty sources are
  112. distributed.
  113. </td></tr>
  114. <tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
  115. </pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Index" accesskey="5">Index</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Index of functions and categories.
  116. </td></tr>
  117. </table>
  118. <hr>
  119. <a name="Using"></a>
  120. <div class="header">
  121. <p>
  122. Next: <a href="#Overview" accesskey="n" rel="next">Overview</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  123. </div>
  124. <a name="Using-1"></a>
  125. <h2 class="chapter">1 Using</h2>
  126. <a name="index-using-libiberty"></a>
  127. <a name="index-libiberty-usage"></a>
  128. <a name="index-how-to-use"></a>
  129. <p>To date, <code>libiberty</code> is generally not installed on its own. It has evolved
  130. over years but does not have its own version number nor release schedule.
  131. </p>
  132. <p>Possibly the easiest way to use <code>libiberty</code> in your projects is to drop the
  133. <code>libiberty</code> code into your project&rsquo;s sources, and to build the library along
  134. with your own sources; the library would then be linked in at the end. This
  135. prevents any possible version mismatches with other copies of libiberty
  136. elsewhere on the system.
  137. </p>
  138. <p>Passing <samp>--enable-install-libiberty</samp> to the <code>configure</code>
  139. script when building <code>libiberty</code> causes the header files and archive library
  140. to be installed when <kbd>make install</kbd> is run. This option also takes
  141. an (optional) argument to specify the installation location, in the same
  142. manner as <samp>--prefix</samp>.
  143. </p>
  144. <p>For your own projects, an approach which offers stability and flexibility
  145. is to include <code>libiberty</code> with your code, but allow the end user to optionally
  146. choose to use a previously-installed version instead. In this way the
  147. user may choose (for example) to install <code>libiberty</code> as part of GCC, and use
  148. that version for all software built with that compiler. (This approach
  149. has proven useful with software using the GNU <code>readline</code> library.)
  150. </p>
  151. <p>Making use of <code>libiberty</code> code usually requires that you include one or more
  152. header files from the <code>libiberty</code> distribution. (They will be named as
  153. necessary in the function descriptions.) At link time, you will need to
  154. add <samp>-liberty</samp> to your link command invocation.
  155. </p>
  156. <hr>
  157. <a name="Overview"></a>
  158. <div class="header">
  159. <p>
  160. Next: <a href="#Functions" accesskey="n" rel="next">Functions</a>, Previous: <a href="#Using" accesskey="p" rel="prev">Using</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  161. </div>
  162. <a name="Overview-1"></a>
  163. <h2 class="chapter">2 Overview</h2>
  164. <p>Functions contained in <code>libiberty</code> can be divided into three general categories.
  165. </p>
  166. <table class="menu" border="0" cellspacing="0">
  167. <tr><td align="left" valign="top">&bull; <a href="#Supplemental-Functions" accesskey="1">Supplemental Functions</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Providing functions which don&rsquo;t exist
  168. on older operating systems.
  169. </td></tr>
  170. <tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
  171. </pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Replacement-Functions" accesskey="2">Replacement Functions</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">These functions are sometimes buggy or
  172. unpredictable on some operating systems.
  173. </td></tr>
  174. <tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
  175. </pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Extensions" accesskey="3">Extensions</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Functions which provide useful extensions
  176. or safety wrappers around existing code.
  177. </td></tr>
  178. </table>
  179. <hr>
  180. <a name="Supplemental-Functions"></a>
  181. <div class="header">
  182. <p>
  183. Next: <a href="#Replacement-Functions" accesskey="n" rel="next">Replacement Functions</a>, Up: <a href="#Overview" accesskey="u" rel="up">Overview</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  184. </div>
  185. <a name="Supplemental-Functions-1"></a>
  186. <h3 class="section">2.1 Supplemental Functions</h3>
  187. <a name="index-supplemental-functions"></a>
  188. <a name="index-functions_002c-supplemental"></a>
  189. <a name="index-functions_002c-missing"></a>
  190. <p>Certain operating systems do not provide functions which have since
  191. become standardized, or at least common. For example, the Single
  192. Unix Specification Version 2 requires that the <code>basename</code>
  193. function be provided, but an OS which predates that specification
  194. might not have this function. This should not prevent well-written
  195. code from running on such a system.
  196. </p>
  197. <p>Similarly, some functions exist only among a particular &ldquo;flavor&rdquo;
  198. or &ldquo;family&rdquo; of operating systems. As an example, the <code>bzero</code>
  199. function is often not present on systems outside the BSD-derived
  200. family of systems.
  201. </p>
  202. <p>Many such functions are provided in <code>libiberty</code>. They are quickly
  203. listed here with little description, as systems which lack them
  204. become less and less common. Each function <var>foo</var> is implemented
  205. in <samp><var>foo</var>.c</samp> but not declared in any <code>libiberty</code> header file; more
  206. comments and caveats for each function&rsquo;s implementation are often
  207. available in the source file. Generally, the function can simply
  208. be declared as <code>extern</code>.
  209. </p>
  210. <hr>
  211. <a name="Replacement-Functions"></a>
  212. <div class="header">
  213. <p>
  214. Next: <a href="#Extensions" accesskey="n" rel="next">Extensions</a>, Previous: <a href="#Supplemental-Functions" accesskey="p" rel="prev">Supplemental Functions</a>, Up: <a href="#Overview" accesskey="u" rel="up">Overview</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  215. </div>
  216. <a name="Replacement-Functions-1"></a>
  217. <h3 class="section">2.2 Replacement Functions</h3>
  218. <a name="index-replacement-functions"></a>
  219. <a name="index-functions_002c-replacement"></a>
  220. <p>Some functions have extremely limited implementations on different
  221. platforms. Other functions are tedious to use correctly; for example,
  222. proper use of <code>malloc</code> calls for the return value to be checked and
  223. appropriate action taken if memory has been exhausted. A group of
  224. &ldquo;replacement functions&rdquo; is available in <code>libiberty</code> to address these issues
  225. for some of the most commonly used subroutines.
  226. </p>
  227. <p>All of these functions are declared in the <samp>libiberty.h</samp> header
  228. file. Many of the implementations will use preprocessor macros set by
  229. GNU Autoconf, if you decide to make use of that program. Some of these
  230. functions may call one another.
  231. </p>
  232. <table class="menu" border="0" cellspacing="0">
  233. <tr><td align="left" valign="top">&bull; <a href="#Memory-Allocation" accesskey="1">Memory Allocation</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Testing and handling failed memory
  234. requests automatically.
  235. </td></tr>
  236. <tr><td align="left" valign="top">&bull; <a href="#Exit-Handlers" accesskey="2">Exit Handlers</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Calling routines on program exit.
  237. </td></tr>
  238. <tr><td align="left" valign="top">&bull; <a href="#Error-Reporting" accesskey="3">Error Reporting</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Mapping errno and signal numbers to
  239. more useful string formats.
  240. </td></tr>
  241. </table>
  242. <hr>
  243. <a name="Memory-Allocation"></a>
  244. <div class="header">
  245. <p>
  246. Next: <a href="#Exit-Handlers" accesskey="n" rel="next">Exit Handlers</a>, Up: <a href="#Replacement-Functions" accesskey="u" rel="up">Replacement Functions</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  247. </div>
  248. <a name="Memory-Allocation-1"></a>
  249. <h4 class="subsection">2.2.1 Memory Allocation</h4>
  250. <a name="index-memory-allocation"></a>
  251. <p>The functions beginning with the letter &lsquo;<samp>x</samp>&rsquo; are wrappers around
  252. standard functions; the functions provided by the system environment
  253. are called and their results checked before the results are passed back
  254. to client code. If the standard functions fail, these wrappers will
  255. terminate the program. Thus, these versions can be used with impunity.
  256. </p>
  257. <hr>
  258. <a name="Exit-Handlers"></a>
  259. <div class="header">
  260. <p>
  261. Next: <a href="#Error-Reporting" accesskey="n" rel="next">Error Reporting</a>, Previous: <a href="#Memory-Allocation" accesskey="p" rel="prev">Memory Allocation</a>, Up: <a href="#Replacement-Functions" accesskey="u" rel="up">Replacement Functions</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  262. </div>
  263. <a name="Exit-Handlers-1"></a>
  264. <h4 class="subsection">2.2.2 Exit Handlers</h4>
  265. <a name="index-exit-handlers"></a>
  266. <p>The existence and implementation of the <code>atexit</code> routine varies
  267. amongst the flavors of Unix. <code>libiberty</code> provides an unvarying dependable
  268. implementation via <code>xatexit</code> and <code>xexit</code>.
  269. </p>
  270. <hr>
  271. <a name="Error-Reporting"></a>
  272. <div class="header">
  273. <p>
  274. Previous: <a href="#Exit-Handlers" accesskey="p" rel="prev">Exit Handlers</a>, Up: <a href="#Replacement-Functions" accesskey="u" rel="up">Replacement Functions</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  275. </div>
  276. <a name="Error-Reporting-1"></a>
  277. <h4 class="subsection">2.2.3 Error Reporting</h4>
  278. <a name="index-error-reporting"></a>
  279. <p>These are a set of routines to facilitate programming with the system
  280. <code>errno</code> interface. The <code>libiberty</code> source file <samp>strerror.c</samp>
  281. contains a good deal of documentation for these functions.
  282. </p>
  283. <hr>
  284. <a name="Extensions"></a>
  285. <div class="header">
  286. <p>
  287. Previous: <a href="#Replacement-Functions" accesskey="p" rel="prev">Replacement Functions</a>, Up: <a href="#Overview" accesskey="u" rel="up">Overview</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  288. </div>
  289. <a name="Extensions-1"></a>
  290. <h3 class="section">2.3 Extensions</h3>
  291. <a name="index-extensions"></a>
  292. <a name="index-functions_002c-extension"></a>
  293. <p><code>libiberty</code> includes additional functionality above and beyond standard
  294. functions, which has proven generically useful in GNU programs, such as
  295. obstacks and regex. These functions are often copied from other
  296. projects as they gain popularity, and are included here to provide a
  297. central location from which to use, maintain, and distribute them.
  298. </p>
  299. <table class="menu" border="0" cellspacing="0">
  300. <tr><td align="left" valign="top">&bull; <a href="#Obstacks" accesskey="1">Obstacks</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Stacks of arbitrary objects.
  301. </td></tr>
  302. </table>
  303. <hr>
  304. <a name="Obstacks"></a>
  305. <div class="header">
  306. <p>
  307. Up: <a href="#Extensions" accesskey="u" rel="up">Extensions</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  308. </div>
  309. <a name="Obstacks-1"></a>
  310. <h4 class="subsection">2.3.1 Obstacks</h4>
  311. <a name="index-obstacks"></a>
  312. <p>An <em>obstack</em> is a pool of memory containing a stack of objects. You
  313. can create any number of separate obstacks, and then allocate objects in
  314. specified obstacks. Within each obstack, the last object allocated must
  315. always be the first one freed, but distinct obstacks are independent of
  316. each other.
  317. </p>
  318. <p>Aside from this one constraint of order of freeing, obstacks are totally
  319. general: an obstack can contain any number of objects of any size. They
  320. are implemented with macros, so allocation is usually very fast as long as
  321. the objects are usually small. And the only space overhead per object is
  322. the padding needed to start each object on a suitable boundary.
  323. </p>
  324. <table class="menu" border="0" cellspacing="0">
  325. <tr><td align="left" valign="top">&bull; <a href="#Creating-Obstacks" accesskey="1">Creating Obstacks</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">How to declare an obstack in your program.
  326. </td></tr>
  327. <tr><td align="left" valign="top">&bull; <a href="#Preparing-for-Obstacks" accesskey="2">Preparing for Obstacks</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Preparations needed before you can
  328. use obstacks.
  329. </td></tr>
  330. <tr><td align="left" valign="top">&bull; <a href="#Allocation-in-an-Obstack" accesskey="3">Allocation in an Obstack</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Allocating objects in an obstack.
  331. </td></tr>
  332. <tr><td align="left" valign="top">&bull; <a href="#Freeing-Obstack-Objects" accesskey="4">Freeing Obstack Objects</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Freeing objects in an obstack.
  333. </td></tr>
  334. <tr><td align="left" valign="top">&bull; <a href="#Obstack-Functions" accesskey="5">Obstack Functions</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">The obstack functions are really macros.
  335. </td></tr>
  336. <tr><td align="left" valign="top">&bull; <a href="#Growing-Objects" accesskey="6">Growing Objects</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Making an object bigger by stages.
  337. </td></tr>
  338. <tr><td align="left" valign="top">&bull; <a href="#Extra-Fast-Growing" accesskey="7">Extra Fast Growing</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Extra-high-efficiency (though more
  339. complicated) growing objects.
  340. </td></tr>
  341. <tr><td align="left" valign="top">&bull; <a href="#Status-of-an-Obstack" accesskey="8">Status of an Obstack</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Inquiries about the status of an obstack.
  342. </td></tr>
  343. <tr><td align="left" valign="top">&bull; <a href="#Obstacks-Data-Alignment" accesskey="9">Obstacks Data Alignment</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Controlling alignment of objects in obstacks.
  344. </td></tr>
  345. <tr><td align="left" valign="top">&bull; <a href="#Obstack-Chunks">Obstack Chunks</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">How obstacks obtain and release chunks;
  346. efficiency considerations.
  347. </td></tr>
  348. <tr><td align="left" valign="top">&bull; <a href="#Summary-of-Obstacks">Summary of Obstacks</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
  349. </td></tr>
  350. </table>
  351. <hr>
  352. <a name="Creating-Obstacks"></a>
  353. <div class="header">
  354. <p>
  355. Next: <a href="#Preparing-for-Obstacks" accesskey="n" rel="next">Preparing for Obstacks</a>, Up: <a href="#Obstacks" accesskey="u" rel="up">Obstacks</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  356. </div>
  357. <a name="Creating-Obstacks-1"></a>
  358. <h4 class="subsubsection">2.3.1.1 Creating Obstacks</h4>
  359. <p>The utilities for manipulating obstacks are declared in the header
  360. file <samp>obstack.h</samp>.
  361. <a name="index-obstack_002eh"></a>
  362. </p>
  363. <dl>
  364. <dt><a name="index-struct-obstack"></a>Data Type: <strong>struct obstack</strong></dt>
  365. <dd><p>An obstack is represented by a data structure of type <code>struct
  366. obstack</code>. This structure has a small fixed size; it records the status
  367. of the obstack and how to find the space in which objects are allocated.
  368. It does not contain any of the objects themselves. You should not try
  369. to access the contents of the structure directly; use only the macros
  370. described in this chapter.
  371. </p></dd></dl>
  372. <p>You can declare variables of type <code>struct obstack</code> and use them as
  373. obstacks, or you can allocate obstacks dynamically like any other kind
  374. of object. Dynamic allocation of obstacks allows your program to have a
  375. variable number of different stacks. (You can even allocate an
  376. obstack structure in another obstack, but this is rarely useful.)
  377. </p>
  378. <p>All the macros that work with obstacks require you to specify which
  379. obstack to use. You do this with a pointer of type <code>struct obstack
  380. *</code>. In the following, we often say &ldquo;an obstack&rdquo; when strictly
  381. speaking the object at hand is such a pointer.
  382. </p>
  383. <p>The objects in the obstack are packed into large blocks called
  384. <em>chunks</em>. The <code>struct obstack</code> structure points to a chain of
  385. the chunks currently in use.
  386. </p>
  387. <p>The obstack library obtains a new chunk whenever you allocate an object
  388. that won&rsquo;t fit in the previous chunk. Since the obstack library manages
  389. chunks automatically, you don&rsquo;t need to pay much attention to them, but
  390. you do need to supply a function which the obstack library should use to
  391. get a chunk. Usually you supply a function which uses <code>malloc</code>
  392. directly or indirectly. You must also supply a function to free a chunk.
  393. These matters are described in the following section.
  394. </p>
  395. <hr>
  396. <a name="Preparing-for-Obstacks"></a>
  397. <div class="header">
  398. <p>
  399. Next: <a href="#Allocation-in-an-Obstack" accesskey="n" rel="next">Allocation in an Obstack</a>, Previous: <a href="#Creating-Obstacks" accesskey="p" rel="prev">Creating Obstacks</a>, Up: <a href="#Obstacks" accesskey="u" rel="up">Obstacks</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  400. </div>
  401. <a name="Preparing-for-Using-Obstacks"></a>
  402. <h4 class="subsubsection">2.3.1.2 Preparing for Using Obstacks</h4>
  403. <p>Each source file in which you plan to use obstacks
  404. must include the header file <samp>obstack.h</samp>, like this:
  405. </p>
  406. <div class="smallexample">
  407. <pre class="smallexample">#include &lt;obstack.h&gt;
  408. </pre></div>
  409. <a name="index-obstack_005fchunk_005falloc"></a>
  410. <a name="index-obstack_005fchunk_005ffree"></a>
  411. <p>Also, if the source file uses the macro <code>obstack_init</code>, it must
  412. declare or define two macros that will be called by the
  413. obstack library. One, <code>obstack_chunk_alloc</code>, is used to allocate
  414. the chunks of memory into which objects are packed. The other,
  415. <code>obstack_chunk_free</code>, is used to return chunks when the objects in
  416. them are freed. These macros should appear before any use of obstacks
  417. in the source file.
  418. </p>
  419. <p>Usually these are defined to use <code>malloc</code> via the intermediary
  420. <code>xmalloc</code> (see <a href="http://www.gnu.org/software/libc/manual/html_mono/libc.html#Unconstrained-Allocation">Unconstrained Allocation</a> in <cite>The GNU C Library Reference Manual</cite>). This is done with
  421. the following pair of macro definitions:
  422. </p>
  423. <div class="smallexample">
  424. <pre class="smallexample">#define obstack_chunk_alloc xmalloc
  425. #define obstack_chunk_free free
  426. </pre></div>
  427. <p>Though the memory you get using obstacks really comes from <code>malloc</code>,
  428. using obstacks is faster because <code>malloc</code> is called less often, for
  429. larger blocks of memory. See <a href="#Obstack-Chunks">Obstack Chunks</a>, for full details.
  430. </p>
  431. <p>At run time, before the program can use a <code>struct obstack</code> object
  432. as an obstack, it must initialize the obstack by calling
  433. <code>obstack_init</code> or one of its variants, <code>obstack_begin</code>,
  434. <code>obstack_specify_allocation</code>, or
  435. <code>obstack_specify_allocation_with_arg</code>.
  436. </p>
  437. <dl>
  438. <dt><a name="index-obstack_005finit"></a>Function: <em>int</em> <strong>obstack_init</strong> <em>(struct obstack *<var>obstack-ptr</var>)</em></dt>
  439. <dd><p>Initialize obstack <var>obstack-ptr</var> for allocation of objects. This
  440. macro calls the obstack&rsquo;s <code>obstack_chunk_alloc</code> function. If
  441. allocation of memory fails, the function pointed to by
  442. <code>obstack_alloc_failed_handler</code> is called. The <code>obstack_init</code>
  443. macro always returns 1 (Compatibility notice: Former versions of
  444. obstack returned 0 if allocation failed).
  445. </p></dd></dl>
  446. <p>Here are two examples of how to allocate the space for an obstack and
  447. initialize it. First, an obstack that is a static variable:
  448. </p>
  449. <div class="smallexample">
  450. <pre class="smallexample">static struct obstack myobstack;
  451. &hellip;
  452. obstack_init (&amp;myobstack);
  453. </pre></div>
  454. <p>Second, an obstack that is itself dynamically allocated:
  455. </p>
  456. <div class="smallexample">
  457. <pre class="smallexample">struct obstack *myobstack_ptr
  458. = (struct obstack *) xmalloc (sizeof (struct obstack));
  459. obstack_init (myobstack_ptr);
  460. </pre></div>
  461. <dl>
  462. <dt><a name="index-obstack_005fbegin"></a>Function: <em>int</em> <strong>obstack_begin</strong> <em>(struct obstack *<var>obstack-ptr</var>, size_t chunk_size)</em></dt>
  463. <dd><p>Like <code>obstack_init</code>, but specify chunks to be at least
  464. <var>chunk_size</var> bytes in size.
  465. </p></dd></dl>
  466. <dl>
  467. <dt><a name="index-obstack_005fspecify_005fallocation"></a>Function: <em>int</em> <strong>obstack_specify_allocation</strong> <em>(struct obstack *<var>obstack-ptr</var>, size_t chunk_size, size_t alignment, void *(*chunkfun) (size_t), void (*freefun) (void *))</em></dt>
  468. <dd><p>Like <code>obstack_init</code>, specifying chunk size, chunk
  469. alignment, and memory allocation functions. A <var>chunk_size</var> or
  470. <var>alignment</var> of zero results in the default size or alignment
  471. respectively being used.
  472. </p></dd></dl>
  473. <dl>
  474. <dt><a name="index-obstack_005fspecify_005fallocation_005fwith_005farg"></a>Function: <em>int</em> <strong>obstack_specify_allocation_with_arg</strong> <em>(struct obstack *<var>obstack-ptr</var>, size_t chunk_size, size_t alignment, void *(*chunkfun) (void *, size_t), void (*freefun) (void *, void *), void *arg)</em></dt>
  475. <dd><p>Like <code>obstack_specify_allocation</code>, but specifying memory
  476. allocation functions that take an extra first argument, <var>arg</var>.
  477. </p></dd></dl>
  478. <dl>
  479. <dt><a name="index-obstack_005falloc_005ffailed_005fhandler"></a>Variable: <strong>obstack_alloc_failed_handler</strong></dt>
  480. <dd><p>The value of this variable is a pointer to a function that
  481. <code>obstack</code> uses when <code>obstack_chunk_alloc</code> fails to allocate
  482. memory. The default action is to print a message and abort.
  483. You should supply a function that either calls <code>exit</code>
  484. (see <a href="http://www.gnu.org/software/libc/manual/html_mono/libc.html#Program-Termination">Program Termination</a> in <cite>The GNU C Library Reference Manual</cite>) or <code>longjmp</code> (see <a href="http://www.gnu.org/software/libc/manual/html_mono/libc.html#Non_002dLocal-Exits">Non-Local
  485. Exits</a> in <cite>The GNU C Library Reference Manual</cite>) and doesn&rsquo;t return.
  486. </p>
  487. <div class="smallexample">
  488. <pre class="smallexample">void my_obstack_alloc_failed (void)
  489. &hellip;
  490. obstack_alloc_failed_handler = &amp;my_obstack_alloc_failed;
  491. </pre></div>
  492. </dd></dl>
  493. <hr>
  494. <a name="Allocation-in-an-Obstack"></a>
  495. <div class="header">
  496. <p>
  497. Next: <a href="#Freeing-Obstack-Objects" accesskey="n" rel="next">Freeing Obstack Objects</a>, Previous: <a href="#Preparing-for-Obstacks" accesskey="p" rel="prev">Preparing for Obstacks</a>, Up: <a href="#Obstacks" accesskey="u" rel="up">Obstacks</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  498. </div>
  499. <a name="Allocation-in-an-Obstack-1"></a>
  500. <h4 class="subsubsection">2.3.1.3 Allocation in an Obstack</h4>
  501. <a name="index-allocation-_0028obstacks_0029"></a>
  502. <p>The most direct way to allocate an object in an obstack is with
  503. <code>obstack_alloc</code>, which is invoked almost like <code>malloc</code>.
  504. </p>
  505. <dl>
  506. <dt><a name="index-obstack_005falloc"></a>Function: <em>void *</em> <strong>obstack_alloc</strong> <em>(struct obstack *<var>obstack-ptr</var>, size_t <var>size</var>)</em></dt>
  507. <dd><p>This allocates an uninitialized block of <var>size</var> bytes in an obstack
  508. and returns its address. Here <var>obstack-ptr</var> specifies which obstack
  509. to allocate the block in; it is the address of the <code>struct obstack</code>
  510. object which represents the obstack. Each obstack macro
  511. requires you to specify an <var>obstack-ptr</var> as the first argument.
  512. </p>
  513. <p>This macro calls the obstack&rsquo;s <code>obstack_chunk_alloc</code> function if
  514. it needs to allocate a new chunk of memory; it calls
  515. <code>obstack_alloc_failed_handler</code> if allocation of memory by
  516. <code>obstack_chunk_alloc</code> failed.
  517. </p></dd></dl>
  518. <p>For example, here is a function that allocates a copy of a string <var>str</var>
  519. in a specific obstack, which is in the variable <code>string_obstack</code>:
  520. </p>
  521. <div class="smallexample">
  522. <pre class="smallexample">struct obstack string_obstack;
  523. char *
  524. copystring (char *string)
  525. {
  526. size_t len = strlen (string) + 1;
  527. char *s = (char *) obstack_alloc (&amp;string_obstack, len);
  528. memcpy (s, string, len);
  529. return s;
  530. }
  531. </pre></div>
  532. <p>To allocate a block with specified contents, use the macro <code>obstack_copy</code>.
  533. </p>
  534. <dl>
  535. <dt><a name="index-obstack_005fcopy"></a>Function: <em>void *</em> <strong>obstack_copy</strong> <em>(struct obstack *<var>obstack-ptr</var>, void *<var>address</var>, size_t <var>size</var>)</em></dt>
  536. <dd><p>This allocates a block and initializes it by copying <var>size</var>
  537. bytes of data starting at <var>address</var>. It calls
  538. <code>obstack_alloc_failed_handler</code> if allocation of memory by
  539. <code>obstack_chunk_alloc</code> failed.
  540. </p></dd></dl>
  541. <dl>
  542. <dt><a name="index-obstack_005fcopy0"></a>Function: <em>void *</em> <strong>obstack_copy0</strong> <em>(struct obstack *<var>obstack-ptr</var>, void *<var>address</var>, size_t <var>size</var>)</em></dt>
  543. <dd><p>Like <code>obstack_copy</code>, but appends an extra byte containing a null
  544. character. This extra byte is not counted in the argument <var>size</var>.
  545. </p></dd></dl>
  546. <p>The <code>obstack_copy0</code> macro is convenient for copying a sequence
  547. of characters into an obstack as a null-terminated string. Here is an
  548. example of its use:
  549. </p>
  550. <div class="smallexample">
  551. <pre class="smallexample">char *
  552. obstack_savestring (char *addr, size_t size)
  553. {
  554. return obstack_copy0 (&amp;myobstack, addr, size);
  555. }
  556. </pre></div>
  557. <p>Contrast this with the previous example of <code>savestring</code> using
  558. <code>malloc</code> (see <a href="http://www.gnu.org/software/libc/manual/html_mono/libc.html#Basic-Allocation">Basic Allocation</a> in <cite>The GNU C Library Reference Manual</cite>).
  559. </p>
  560. <hr>
  561. <a name="Freeing-Obstack-Objects"></a>
  562. <div class="header">
  563. <p>
  564. Next: <a href="#Obstack-Functions" accesskey="n" rel="next">Obstack Functions</a>, Previous: <a href="#Allocation-in-an-Obstack" accesskey="p" rel="prev">Allocation in an Obstack</a>, Up: <a href="#Obstacks" accesskey="u" rel="up">Obstacks</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  565. </div>
  566. <a name="Freeing-Objects-in-an-Obstack"></a>
  567. <h4 class="subsubsection">2.3.1.4 Freeing Objects in an Obstack</h4>
  568. <a name="index-freeing-_0028obstacks_0029"></a>
  569. <p>To free an object allocated in an obstack, use the macro
  570. <code>obstack_free</code>. Since the obstack is a stack of objects, freeing
  571. one object automatically frees all other objects allocated more recently
  572. in the same obstack.
  573. </p>
  574. <dl>
  575. <dt><a name="index-obstack_005ffree"></a>Function: <em>void</em> <strong>obstack_free</strong> <em>(struct obstack *<var>obstack-ptr</var>, void *<var>object</var>)</em></dt>
  576. <dd><p>If <var>object</var> is a null pointer, everything allocated in the obstack
  577. is freed. Otherwise, <var>object</var> must be the address of an object
  578. allocated in the obstack. Then <var>object</var> is freed, along with
  579. everything allocated in <var>obstack</var> since <var>object</var>.
  580. </p></dd></dl>
  581. <p>Note that if <var>object</var> is a null pointer, the result is an
  582. uninitialized obstack. To free all memory in an obstack but leave it
  583. valid for further allocation, call <code>obstack_free</code> with the address
  584. of the first object allocated on the obstack:
  585. </p>
  586. <div class="smallexample">
  587. <pre class="smallexample">obstack_free (obstack_ptr, first_object_allocated_ptr);
  588. </pre></div>
  589. <p>Recall that the objects in an obstack are grouped into chunks. When all
  590. the objects in a chunk become free, the obstack library automatically
  591. frees the chunk (see <a href="#Preparing-for-Obstacks">Preparing for Obstacks</a>). Then other
  592. obstacks, or non-obstack allocation, can reuse the space of the chunk.
  593. </p>
  594. <hr>
  595. <a name="Obstack-Functions"></a>
  596. <div class="header">
  597. <p>
  598. Next: <a href="#Growing-Objects" accesskey="n" rel="next">Growing Objects</a>, Previous: <a href="#Freeing-Obstack-Objects" accesskey="p" rel="prev">Freeing Obstack Objects</a>, Up: <a href="#Obstacks" accesskey="u" rel="up">Obstacks</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  599. </div>
  600. <a name="Obstack-Functions-and-Macros"></a>
  601. <h4 class="subsubsection">2.3.1.5 Obstack Functions and Macros</h4>
  602. <a name="index-macros"></a>
  603. <p>The interfaces for using obstacks are shown here as functions to
  604. specify the return type and argument types, but they are really
  605. defined as macros. This means that the arguments don&rsquo;t actually have
  606. types, but they generally behave as if they have the types shown.
  607. You can call these macros like functions, but you cannot use them in
  608. any other way (for example, you cannot take their address).
  609. </p>
  610. <p>Calling the macros requires a special precaution: namely, the first
  611. operand (the obstack pointer) may not contain any side effects, because
  612. it may be computed more than once. For example, if you write this:
  613. </p>
  614. <div class="smallexample">
  615. <pre class="smallexample">obstack_alloc (get_obstack (), 4);
  616. </pre></div>
  617. <p>you will find that <code>get_obstack</code> may be called several times.
  618. If you use <code>*obstack_list_ptr++</code> as the obstack pointer argument,
  619. you will get very strange results since the incrementation may occur
  620. several times.
  621. </p>
  622. <p>If you use the GNU C compiler, this precaution is not necessary, because
  623. various language extensions in GNU C permit defining the macros so as to
  624. compute each argument only once.
  625. </p>
  626. <p>Note that arguments other than the first will only be evaluated once,
  627. even when not using GNU C.
  628. </p>
  629. <p><code>obstack.h</code> does declare a number of functions,
  630. <code>_obstack_begin</code>, <code>_obstack_begin_1</code>,
  631. <code>_obstack_newchunk</code>, <code>_obstack_free</code>, and
  632. <code>_obstack_memory_used</code>. You should not call these directly.
  633. </p>
  634. <hr>
  635. <a name="Growing-Objects"></a>
  636. <div class="header">
  637. <p>
  638. Next: <a href="#Extra-Fast-Growing" accesskey="n" rel="next">Extra Fast Growing</a>, Previous: <a href="#Obstack-Functions" accesskey="p" rel="prev">Obstack Functions</a>, Up: <a href="#Obstacks" accesskey="u" rel="up">Obstacks</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  639. </div>
  640. <a name="Growing-Objects-1"></a>
  641. <h4 class="subsubsection">2.3.1.6 Growing Objects</h4>
  642. <a name="index-growing-objects-_0028in-obstacks_0029"></a>
  643. <a name="index-changing-the-size-of-a-block-_0028obstacks_0029"></a>
  644. <p>Because memory in obstack chunks is used sequentially, it is possible to
  645. build up an object step by step, adding one or more bytes at a time to the
  646. end of the object. With this technique, you do not need to know how much
  647. data you will put in the object until you come to the end of it. We call
  648. this the technique of <em>growing objects</em>. The special macros
  649. for adding data to the growing object are described in this section.
  650. </p>
  651. <p>You don&rsquo;t need to do anything special when you start to grow an object.
  652. Using one of the macros to add data to the object automatically
  653. starts it. However, it is necessary to say explicitly when the object is
  654. finished. This is done with <code>obstack_finish</code>.
  655. </p>
  656. <p>The actual address of the object thus built up is not known until the
  657. object is finished. Until then, it always remains possible that you will
  658. add so much data that the object must be copied into a new chunk.
  659. </p>
  660. <p>While the obstack is in use for a growing object, you cannot use it for
  661. ordinary allocation of another object. If you try to do so, the space
  662. already added to the growing object will become part of the other object.
  663. </p>
  664. <dl>
  665. <dt><a name="index-obstack_005fblank"></a>Function: <em>void</em> <strong>obstack_blank</strong> <em>(struct obstack *<var>obstack-ptr</var>, size_t <var>size</var>)</em></dt>
  666. <dd><p>The most basic macro for adding to a growing object is
  667. <code>obstack_blank</code>, which adds space without initializing it.
  668. </p></dd></dl>
  669. <dl>
  670. <dt><a name="index-obstack_005fgrow"></a>Function: <em>void</em> <strong>obstack_grow</strong> <em>(struct obstack *<var>obstack-ptr</var>, void *<var>data</var>, size_t <var>size</var>)</em></dt>
  671. <dd><p>To add a block of initialized space, use <code>obstack_grow</code>, which is
  672. the growing-object analogue of <code>obstack_copy</code>. It adds <var>size</var>
  673. bytes of data to the growing object, copying the contents from
  674. <var>data</var>.
  675. </p></dd></dl>
  676. <dl>
  677. <dt><a name="index-obstack_005fgrow0"></a>Function: <em>void</em> <strong>obstack_grow0</strong> <em>(struct obstack *<var>obstack-ptr</var>, void *<var>data</var>, size_t <var>size</var>)</em></dt>
  678. <dd><p>This is the growing-object analogue of <code>obstack_copy0</code>. It adds
  679. <var>size</var> bytes copied from <var>data</var>, followed by an additional null
  680. character.
  681. </p></dd></dl>
  682. <dl>
  683. <dt><a name="index-obstack_005f1grow"></a>Function: <em>void</em> <strong>obstack_1grow</strong> <em>(struct obstack *<var>obstack-ptr</var>, char <var>c</var>)</em></dt>
  684. <dd><p>To add one character at a time, use <code>obstack_1grow</code>.
  685. It adds a single byte containing <var>c</var> to the growing object.
  686. </p></dd></dl>
  687. <dl>
  688. <dt><a name="index-obstack_005fptr_005fgrow"></a>Function: <em>void</em> <strong>obstack_ptr_grow</strong> <em>(struct obstack *<var>obstack-ptr</var>, void *<var>data</var>)</em></dt>
  689. <dd><p>Adding the value of a pointer one can use
  690. <code>obstack_ptr_grow</code>. It adds <code>sizeof (void *)</code> bytes
  691. containing the value of <var>data</var>.
  692. </p></dd></dl>
  693. <dl>
  694. <dt><a name="index-obstack_005fint_005fgrow"></a>Function: <em>void</em> <strong>obstack_int_grow</strong> <em>(struct obstack *<var>obstack-ptr</var>, int <var>data</var>)</em></dt>
  695. <dd><p>A single value of type <code>int</code> can be added by using
  696. <code>obstack_int_grow</code>. It adds <code>sizeof (int)</code> bytes to
  697. the growing object and initializes them with the value of <var>data</var>.
  698. </p></dd></dl>
  699. <dl>
  700. <dt><a name="index-obstack_005ffinish"></a>Function: <em>void *</em> <strong>obstack_finish</strong> <em>(struct obstack *<var>obstack-ptr</var>)</em></dt>
  701. <dd><p>When you are finished growing the object, use
  702. <code>obstack_finish</code> to close it off and return its final address.
  703. </p>
  704. <p>Once you have finished the object, the obstack is available for ordinary
  705. allocation or for growing another object.
  706. </p></dd></dl>
  707. <p>When you build an object by growing it, you will probably need to know
  708. afterward how long it became. You need not keep track of this as you grow
  709. the object, because you can find out the length from the obstack
  710. with <code>obstack_object_size</code>, before finishing the object.
  711. </p>
  712. <dl>
  713. <dt><a name="index-obstack_005fobject_005fsize"></a>Function: <em>size_t</em> <strong>obstack_object_size</strong> <em>(struct obstack *<var>obstack-ptr</var>)</em></dt>
  714. <dd><p>This macro returns the current size of the growing object, in bytes.
  715. Remember to call <code>obstack_object_size</code> <em>before</em> finishing the object.
  716. After it is finished, <code>obstack_object_size</code> will return zero.
  717. </p></dd></dl>
  718. <p>If you have started growing an object and wish to cancel it, you should
  719. finish it and then free it, like this:
  720. </p>
  721. <div class="smallexample">
  722. <pre class="smallexample">obstack_free (obstack_ptr, obstack_finish (obstack_ptr));
  723. </pre></div>
  724. <p>This has no effect if no object was growing.
  725. </p>
  726. <hr>
  727. <a name="Extra-Fast-Growing"></a>
  728. <div class="header">
  729. <p>
  730. Next: <a href="#Status-of-an-Obstack" accesskey="n" rel="next">Status of an Obstack</a>, Previous: <a href="#Growing-Objects" accesskey="p" rel="prev">Growing Objects</a>, Up: <a href="#Obstacks" accesskey="u" rel="up">Obstacks</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  731. </div>
  732. <a name="Extra-Fast-Growing-Objects"></a>
  733. <h4 class="subsubsection">2.3.1.7 Extra Fast Growing Objects</h4>
  734. <a name="index-efficiency-and-obstacks"></a>
  735. <p>The usual macros for growing objects incur overhead for checking
  736. whether there is room for the new growth in the current chunk. If you
  737. are frequently constructing objects in small steps of growth, this
  738. overhead can be significant.
  739. </p>
  740. <p>You can reduce the overhead by using special &ldquo;fast growth&rdquo;
  741. macros that grow the object without checking. In order to have a
  742. robust program, you must do the checking yourself. If you do this checking
  743. in the simplest way each time you are about to add data to the object, you
  744. have not saved anything, because that is what the ordinary growth
  745. macros do. But if you can arrange to check less often, or check
  746. more efficiently, then you make the program faster.
  747. </p>
  748. <p><code>obstack_room</code> returns the amount of room available
  749. in the current chunk.
  750. </p>
  751. <dl>
  752. <dt><a name="index-obstack_005froom"></a>Function: <em>size_t</em> <strong>obstack_room</strong> <em>(struct obstack *<var>obstack-ptr</var>)</em></dt>
  753. <dd><p>This returns the number of bytes that can be added safely to the current
  754. growing object (or to an object about to be started) in obstack
  755. <var>obstack</var> using the fast growth macros.
  756. </p></dd></dl>
  757. <p>While you know there is room, you can use these fast growth macros
  758. for adding data to a growing object:
  759. </p>
  760. <dl>
  761. <dt><a name="index-obstack_005f1grow_005ffast"></a>Function: <em>void</em> <strong>obstack_1grow_fast</strong> <em>(struct obstack *<var>obstack-ptr</var>, char <var>c</var>)</em></dt>
  762. <dd><p><code>obstack_1grow_fast</code> adds one byte containing the
  763. character <var>c</var> to the growing object in obstack <var>obstack-ptr</var>.
  764. </p></dd></dl>
  765. <dl>
  766. <dt><a name="index-obstack_005fptr_005fgrow_005ffast"></a>Function: <em>void</em> <strong>obstack_ptr_grow_fast</strong> <em>(struct obstack *<var>obstack-ptr</var>, void *<var>data</var>)</em></dt>
  767. <dd><p><code>obstack_ptr_grow_fast</code> adds <code>sizeof (void *)</code>
  768. bytes containing the value of <var>data</var> to the growing object in
  769. obstack <var>obstack-ptr</var>.
  770. </p></dd></dl>
  771. <dl>
  772. <dt><a name="index-obstack_005fint_005fgrow_005ffast"></a>Function: <em>void</em> <strong>obstack_int_grow_fast</strong> <em>(struct obstack *<var>obstack-ptr</var>, int <var>data</var>)</em></dt>
  773. <dd><p><code>obstack_int_grow_fast</code> adds <code>sizeof (int)</code> bytes
  774. containing the value of <var>data</var> to the growing object in obstack
  775. <var>obstack-ptr</var>.
  776. </p></dd></dl>
  777. <dl>
  778. <dt><a name="index-obstack_005fblank_005ffast"></a>Function: <em>void</em> <strong>obstack_blank_fast</strong> <em>(struct obstack *<var>obstack-ptr</var>, size_t <var>size</var>)</em></dt>
  779. <dd><p><code>obstack_blank_fast</code> adds <var>size</var> bytes to the
  780. growing object in obstack <var>obstack-ptr</var> without initializing them.
  781. </p></dd></dl>
  782. <p>When you check for space using <code>obstack_room</code> and there is not
  783. enough room for what you want to add, the fast growth macros
  784. are not safe. In this case, simply use the corresponding ordinary
  785. growth macro instead. Very soon this will copy the object to a
  786. new chunk; then there will be lots of room available again.
  787. </p>
  788. <p>So, each time you use an ordinary growth macro, check afterward for
  789. sufficient space using <code>obstack_room</code>. Once the object is copied
  790. to a new chunk, there will be plenty of space again, so the program will
  791. start using the fast growth macros again.
  792. </p>
  793. <p>Here is an example:
  794. </p>
  795. <div class="smallexample">
  796. <pre class="smallexample">void
  797. add_string (struct obstack *obstack, const char *ptr, size_t len)
  798. {
  799. while (len &gt; 0)
  800. {
  801. size_t room = obstack_room (obstack);
  802. if (room == 0)
  803. {
  804. /* <span class="roman">Not enough room. Add one character slowly,</span>
  805. <span class="roman">which may copy to a new chunk and make room.</span> */
  806. obstack_1grow (obstack, *ptr++);
  807. len--;
  808. }
  809. else
  810. {
  811. if (room &gt; len)
  812. room = len;
  813. /* <span class="roman">Add fast as much as we have room for.</span> */
  814. len -= room;
  815. while (room-- &gt; 0)
  816. obstack_1grow_fast (obstack, *ptr++);
  817. }
  818. }
  819. }
  820. </pre></div>
  821. <a name="index-shrinking-objects"></a>
  822. <p>You can use <code>obstack_blank_fast</code> with a &ldquo;negative&rdquo; size
  823. argument to make the current object smaller. Just don&rsquo;t try to shrink
  824. it beyond zero length&mdash;there&rsquo;s no telling what will happen if you do
  825. that. Earlier versions of obstacks allowed you to use
  826. <code>obstack_blank</code> to shrink objects. This will no longer work.
  827. </p>
  828. <hr>
  829. <a name="Status-of-an-Obstack"></a>
  830. <div class="header">
  831. <p>
  832. Next: <a href="#Obstacks-Data-Alignment" accesskey="n" rel="next">Obstacks Data Alignment</a>, Previous: <a href="#Extra-Fast-Growing" accesskey="p" rel="prev">Extra Fast Growing</a>, Up: <a href="#Obstacks" accesskey="u" rel="up">Obstacks</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  833. </div>
  834. <a name="Status-of-an-Obstack-1"></a>
  835. <h4 class="subsubsection">2.3.1.8 Status of an Obstack</h4>
  836. <a name="index-obstack-status"></a>
  837. <a name="index-status-of-obstack"></a>
  838. <p>Here are macros that provide information on the current status of
  839. allocation in an obstack. You can use them to learn about an object while
  840. still growing it.
  841. </p>
  842. <dl>
  843. <dt><a name="index-obstack_005fbase"></a>Function: <em>void *</em> <strong>obstack_base</strong> <em>(struct obstack *<var>obstack-ptr</var>)</em></dt>
  844. <dd><p>This macro returns the tentative address of the beginning of the
  845. currently growing object in <var>obstack-ptr</var>. If you finish the object
  846. immediately, it will have that address. If you make it larger first, it
  847. may outgrow the current chunk&mdash;then its address will change!
  848. </p>
  849. <p>If no object is growing, this value says where the next object you
  850. allocate will start (once again assuming it fits in the current
  851. chunk).
  852. </p></dd></dl>
  853. <dl>
  854. <dt><a name="index-obstack_005fnext_005ffree"></a>Function: <em>void *</em> <strong>obstack_next_free</strong> <em>(struct obstack *<var>obstack-ptr</var>)</em></dt>
  855. <dd><p>This macro returns the address of the first free byte in the current
  856. chunk of obstack <var>obstack-ptr</var>. This is the end of the currently
  857. growing object. If no object is growing, <code>obstack_next_free</code>
  858. returns the same value as <code>obstack_base</code>.
  859. </p></dd></dl>
  860. <dl>
  861. <dt><a name="index-obstack_005fobject_005fsize-1"></a>Function: <em>size_t</em> <strong>obstack_object_size</strong> <em>(struct obstack *<var>obstack-ptr</var>)</em></dt>
  862. <dd><p>This macro returns the size in bytes of the currently growing object.
  863. This is equivalent to
  864. </p>
  865. <div class="smallexample">
  866. <pre class="smallexample">((size_t) (obstack_next_free (<var>obstack-ptr</var>) - obstack_base (<var>obstack-ptr</var>)))
  867. </pre></div>
  868. </dd></dl>
  869. <hr>
  870. <a name="Obstacks-Data-Alignment"></a>
  871. <div class="header">
  872. <p>
  873. Next: <a href="#Obstack-Chunks" accesskey="n" rel="next">Obstack Chunks</a>, Previous: <a href="#Status-of-an-Obstack" accesskey="p" rel="prev">Status of an Obstack</a>, Up: <a href="#Obstacks" accesskey="u" rel="up">Obstacks</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  874. </div>
  875. <a name="Alignment-of-Data-in-Obstacks"></a>
  876. <h4 class="subsubsection">2.3.1.9 Alignment of Data in Obstacks</h4>
  877. <a name="index-alignment-_0028in-obstacks_0029"></a>
  878. <p>Each obstack has an <em>alignment boundary</em>; each object allocated in
  879. the obstack automatically starts on an address that is a multiple of the
  880. specified boundary. By default, this boundary is aligned so that
  881. the object can hold any type of data.
  882. </p>
  883. <p>To access an obstack&rsquo;s alignment boundary, use the macro
  884. <code>obstack_alignment_mask</code>.
  885. </p>
  886. <dl>
  887. <dt><a name="index-obstack_005falignment_005fmask"></a>Macro: <em>size_t</em> <strong>obstack_alignment_mask</strong> <em>(struct obstack *<var>obstack-ptr</var>)</em></dt>
  888. <dd><p>The value is a bit mask; a bit that is 1 indicates that the corresponding
  889. bit in the address of an object should be 0. The mask value should be one
  890. less than a power of 2; the effect is that all object addresses are
  891. multiples of that power of 2. The default value of the mask is a value
  892. that allows aligned objects to hold any type of data: for example, if
  893. its value is 3, any type of data can be stored at locations whose
  894. addresses are multiples of 4. A mask value of 0 means an object can start
  895. on any multiple of 1 (that is, no alignment is required).
  896. </p>
  897. <p>The expansion of the macro <code>obstack_alignment_mask</code> is an lvalue,
  898. so you can alter the mask by assignment. For example, this statement:
  899. </p>
  900. <div class="smallexample">
  901. <pre class="smallexample">obstack_alignment_mask (obstack_ptr) = 0;
  902. </pre></div>
  903. <p>has the effect of turning off alignment processing in the specified obstack.
  904. </p></dd></dl>
  905. <p>Note that a change in alignment mask does not take effect until
  906. <em>after</em> the next time an object is allocated or finished in the
  907. obstack. If you are not growing an object, you can make the new
  908. alignment mask take effect immediately by calling <code>obstack_finish</code>.
  909. This will finish a zero-length object and then do proper alignment for
  910. the next object.
  911. </p>
  912. <hr>
  913. <a name="Obstack-Chunks"></a>
  914. <div class="header">
  915. <p>
  916. Next: <a href="#Summary-of-Obstacks" accesskey="n" rel="next">Summary of Obstacks</a>, Previous: <a href="#Obstacks-Data-Alignment" accesskey="p" rel="prev">Obstacks Data Alignment</a>, Up: <a href="#Obstacks" accesskey="u" rel="up">Obstacks</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  917. </div>
  918. <a name="Obstack-Chunks-1"></a>
  919. <h4 class="subsubsection">2.3.1.10 Obstack Chunks</h4>
  920. <a name="index-efficiency-of-chunks"></a>
  921. <a name="index-chunks"></a>
  922. <p>Obstacks work by allocating space for themselves in large chunks, and
  923. then parceling out space in the chunks to satisfy your requests. Chunks
  924. are normally 4096 bytes long unless you specify a different chunk size.
  925. The chunk size includes 8 bytes of overhead that are not actually used
  926. for storing objects. Regardless of the specified size, longer chunks
  927. will be allocated when necessary for long objects.
  928. </p>
  929. <p>The obstack library allocates chunks by calling the function
  930. <code>obstack_chunk_alloc</code>, which you must define. When a chunk is no
  931. longer needed because you have freed all the objects in it, the obstack
  932. library frees the chunk by calling <code>obstack_chunk_free</code>, which you
  933. must also define.
  934. </p>
  935. <p>These two must be defined (as macros) or declared (as functions) in each
  936. source file that uses <code>obstack_init</code> (see <a href="#Creating-Obstacks">Creating Obstacks</a>).
  937. Most often they are defined as macros like this:
  938. </p>
  939. <div class="smallexample">
  940. <pre class="smallexample">#define obstack_chunk_alloc malloc
  941. #define obstack_chunk_free free
  942. </pre></div>
  943. <p>Note that these are simple macros (no arguments). Macro definitions with
  944. arguments will not work! It is necessary that <code>obstack_chunk_alloc</code>
  945. or <code>obstack_chunk_free</code>, alone, expand into a function name if it is
  946. not itself a function name.
  947. </p>
  948. <p>If you allocate chunks with <code>malloc</code>, the chunk size should be a
  949. power of 2. The default chunk size, 4096, was chosen because it is long
  950. enough to satisfy many typical requests on the obstack yet short enough
  951. not to waste too much memory in the portion of the last chunk not yet used.
  952. </p>
  953. <dl>
  954. <dt><a name="index-obstack_005fchunk_005fsize"></a>Macro: <em>size_t</em> <strong>obstack_chunk_size</strong> <em>(struct obstack *<var>obstack-ptr</var>)</em></dt>
  955. <dd><p>This returns the chunk size of the given obstack.
  956. </p></dd></dl>
  957. <p>Since this macro expands to an lvalue, you can specify a new chunk size by
  958. assigning it a new value. Doing so does not affect the chunks already
  959. allocated, but will change the size of chunks allocated for that particular
  960. obstack in the future. It is unlikely to be useful to make the chunk size
  961. smaller, but making it larger might improve efficiency if you are
  962. allocating many objects whose size is comparable to the chunk size. Here
  963. is how to do so cleanly:
  964. </p>
  965. <div class="smallexample">
  966. <pre class="smallexample">if (obstack_chunk_size (obstack_ptr) &lt; <var>new-chunk-size</var>)
  967. obstack_chunk_size (obstack_ptr) = <var>new-chunk-size</var>;
  968. </pre></div>
  969. <hr>
  970. <a name="Summary-of-Obstacks"></a>
  971. <div class="header">
  972. <p>
  973. Previous: <a href="#Obstack-Chunks" accesskey="p" rel="prev">Obstack Chunks</a>, Up: <a href="#Obstacks" accesskey="u" rel="up">Obstacks</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  974. </div>
  975. <a name="Summary-of-Obstack-Macros"></a>
  976. <h4 class="subsubsection">2.3.1.11 Summary of Obstack Macros</h4>
  977. <p>Here is a summary of all the macros associated with obstacks. Each
  978. takes the address of an obstack (<code>struct obstack *</code>) as its first
  979. argument.
  980. </p>
  981. <dl compact="compact">
  982. <dt><code>int obstack_init (struct obstack *<var>obstack-ptr</var>)</code></dt>
  983. <dd><p>Initialize use of an obstack. See <a href="#Creating-Obstacks">Creating Obstacks</a>.
  984. </p>
  985. </dd>
  986. <dt><code>int obstack_begin (struct obstack *<var>obstack-ptr</var>, size_t chunk_size)</code></dt>
  987. <dd><p>Initialize use of an obstack, with an initial chunk of
  988. <var>chunk_size</var> bytes.
  989. </p>
  990. </dd>
  991. <dt><code>int obstack_specify_allocation (struct obstack *<var>obstack-ptr</var>, size_t chunk_size, size_t alignment, void *(*chunkfun) (size_t), void (*freefun) (void *))</code></dt>
  992. <dd><p>Initialize use of an obstack, specifying intial chunk size, chunk
  993. alignment, and memory allocation functions.
  994. </p>
  995. </dd>
  996. <dt><code>int obstack_specify_allocation_with_arg (struct obstack *<var>obstack-ptr</var>, size_t chunk_size, size_t alignment, void *(*chunkfun) (void *, size_t), void (*freefun) (void *, void *), void *arg)</code></dt>
  997. <dd><p>Like <code>obstack_specify_allocation</code>, but specifying memory
  998. allocation functions that take an extra first argument, <var>arg</var>.
  999. </p>
  1000. </dd>
  1001. <dt><code>void *obstack_alloc (struct obstack *<var>obstack-ptr</var>, size_t <var>size</var>)</code></dt>
  1002. <dd><p>Allocate an object of <var>size</var> uninitialized bytes.
  1003. See <a href="#Allocation-in-an-Obstack">Allocation in an Obstack</a>.
  1004. </p>
  1005. </dd>
  1006. <dt><code>void *obstack_copy (struct obstack *<var>obstack-ptr</var>, void *<var>address</var>, size_t <var>size</var>)</code></dt>
  1007. <dd><p>Allocate an object of <var>size</var> bytes, with contents copied from
  1008. <var>address</var>. See <a href="#Allocation-in-an-Obstack">Allocation in an Obstack</a>.
  1009. </p>
  1010. </dd>
  1011. <dt><code>void *obstack_copy0 (struct obstack *<var>obstack-ptr</var>, void *<var>address</var>, size_t <var>size</var>)</code></dt>
  1012. <dd><p>Allocate an object of <var>size</var>+1 bytes, with <var>size</var> of them copied
  1013. from <var>address</var>, followed by a null character at the end.
  1014. See <a href="#Allocation-in-an-Obstack">Allocation in an Obstack</a>.
  1015. </p>
  1016. </dd>
  1017. <dt><code>void obstack_free (struct obstack *<var>obstack-ptr</var>, void *<var>object</var>)</code></dt>
  1018. <dd><p>Free <var>object</var> (and everything allocated in the specified obstack
  1019. more recently than <var>object</var>). See <a href="#Freeing-Obstack-Objects">Freeing Obstack Objects</a>.
  1020. </p>
  1021. </dd>
  1022. <dt><code>void obstack_blank (struct obstack *<var>obstack-ptr</var>, size_t <var>size</var>)</code></dt>
  1023. <dd><p>Add <var>size</var> uninitialized bytes to a growing object.
  1024. See <a href="#Growing-Objects">Growing Objects</a>.
  1025. </p>
  1026. </dd>
  1027. <dt><code>void obstack_grow (struct obstack *<var>obstack-ptr</var>, void *<var>address</var>, size_t <var>size</var>)</code></dt>
  1028. <dd><p>Add <var>size</var> bytes, copied from <var>address</var>, to a growing object.
  1029. See <a href="#Growing-Objects">Growing Objects</a>.
  1030. </p>
  1031. </dd>
  1032. <dt><code>void obstack_grow0 (struct obstack *<var>obstack-ptr</var>, void *<var>address</var>, size_t <var>size</var>)</code></dt>
  1033. <dd><p>Add <var>size</var> bytes, copied from <var>address</var>, to a growing object,
  1034. and then add another byte containing a null character. See <a href="#Growing-Objects">Growing Objects</a>.
  1035. </p>
  1036. </dd>
  1037. <dt><code>void obstack_1grow (struct obstack *<var>obstack-ptr</var>, char <var>data-char</var>)</code></dt>
  1038. <dd><p>Add one byte containing <var>data-char</var> to a growing object.
  1039. See <a href="#Growing-Objects">Growing Objects</a>.
  1040. </p>
  1041. </dd>
  1042. <dt><code>void *obstack_finish (struct obstack *<var>obstack-ptr</var>)</code></dt>
  1043. <dd><p>Finalize the object that is growing and return its permanent address.
  1044. See <a href="#Growing-Objects">Growing Objects</a>.
  1045. </p>
  1046. </dd>
  1047. <dt><code>size_t obstack_object_size (struct obstack *<var>obstack-ptr</var>)</code></dt>
  1048. <dd><p>Get the current size of the currently growing object. See <a href="#Growing-Objects">Growing Objects</a>.
  1049. </p>
  1050. </dd>
  1051. <dt><code>void obstack_blank_fast (struct obstack *<var>obstack-ptr</var>, size_t <var>size</var>)</code></dt>
  1052. <dd><p>Add <var>size</var> uninitialized bytes to a growing object without checking
  1053. that there is enough room. See <a href="#Extra-Fast-Growing">Extra Fast Growing</a>.
  1054. </p>
  1055. </dd>
  1056. <dt><code>void obstack_1grow_fast (struct obstack *<var>obstack-ptr</var>, char <var>data-char</var>)</code></dt>
  1057. <dd><p>Add one byte containing <var>data-char</var> to a growing object without
  1058. checking that there is enough room. See <a href="#Extra-Fast-Growing">Extra Fast Growing</a>.
  1059. </p>
  1060. </dd>
  1061. <dt><code>size_t obstack_room (struct obstack *<var>obstack-ptr</var>)</code></dt>
  1062. <dd><p>Get the amount of room now available for growing the current object.
  1063. See <a href="#Extra-Fast-Growing">Extra Fast Growing</a>.
  1064. </p>
  1065. </dd>
  1066. <dt><code>size_t obstack_alignment_mask (struct obstack *<var>obstack-ptr</var>)</code></dt>
  1067. <dd><p>The mask used for aligning the beginning of an object. This is an
  1068. lvalue. See <a href="#Obstacks-Data-Alignment">Obstacks Data Alignment</a>.
  1069. </p>
  1070. </dd>
  1071. <dt><code>size_t obstack_chunk_size (struct obstack *<var>obstack-ptr</var>)</code></dt>
  1072. <dd><p>The size for allocating chunks. This is an lvalue. See <a href="#Obstack-Chunks">Obstack Chunks</a>.
  1073. </p>
  1074. </dd>
  1075. <dt><code>void *obstack_base (struct obstack *<var>obstack-ptr</var>)</code></dt>
  1076. <dd><p>Tentative starting address of the currently growing object.
  1077. See <a href="#Status-of-an-Obstack">Status of an Obstack</a>.
  1078. </p>
  1079. </dd>
  1080. <dt><code>void *obstack_next_free (struct obstack *<var>obstack-ptr</var>)</code></dt>
  1081. <dd><p>Address just after the end of the currently growing object.
  1082. See <a href="#Status-of-an-Obstack">Status of an Obstack</a>.
  1083. </p></dd>
  1084. </dl>
  1085. <hr>
  1086. <a name="Functions"></a>
  1087. <div class="header">
  1088. <p>
  1089. Next: <a href="#Licenses" accesskey="n" rel="next">Licenses</a>, Previous: <a href="#Overview" accesskey="p" rel="prev">Overview</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  1090. </div>
  1091. <a name="Function_002c-Variable_002c-and-Macro-Listing_002e"></a>
  1092. <h2 class="chapter">3 Function, Variable, and Macro Listing.</h2>
  1093. <dl>
  1094. <dt><a name="index-alloca"></a>Replacement: <em>void*</em> <strong>alloca</strong> <em>(size_t <var>size</var>)</em></dt>
  1095. <dd>
  1096. <p>This function allocates memory which will be automatically reclaimed
  1097. after the procedure exits. The <code>libiberty</code> implementation does not free
  1098. the memory immediately but will do so eventually during subsequent
  1099. calls to this function. Memory is allocated using <code>xmalloc</code> under
  1100. normal circumstances.
  1101. </p>
  1102. <p>The header file <samp>alloca-conf.h</samp> can be used in conjunction with the
  1103. GNU Autoconf test <code>AC_FUNC_ALLOCA</code> to test for and properly make
  1104. available this function. The <code>AC_FUNC_ALLOCA</code> test requires that
  1105. client code use a block of preprocessor code to be safe (see the Autoconf
  1106. manual for more); this header incorporates that logic and more, including
  1107. the possibility of a GCC built-in function.
  1108. </p>
  1109. </dd></dl>
  1110. <dl>
  1111. <dt><a name="index-asprintf"></a>Extension: <em>int</em> <strong>asprintf</strong> <em>(char **<var>resptr</var>, const char *<var>format</var>, ...)</em></dt>
  1112. <dd>
  1113. <p>Like <code>sprintf</code>, but instead of passing a pointer to a buffer, you
  1114. pass a pointer to a pointer. This function will compute the size of
  1115. the buffer needed, allocate memory with <code>malloc</code>, and store a
  1116. pointer to the allocated memory in <code>*<var>resptr</var></code>. The value
  1117. returned is the same as <code>sprintf</code> would return. If memory could
  1118. not be allocated, minus one is returned and <code>NULL</code> is stored in
  1119. <code>*<var>resptr</var></code>.
  1120. </p>
  1121. </dd></dl>
  1122. <dl>
  1123. <dt><a name="index-atexit"></a>Supplemental: <em>int</em> <strong>atexit</strong> <em>(void (*<var>f</var>)())</em></dt>
  1124. <dd>
  1125. <p>Causes function <var>f</var> to be called at exit. Returns 0.
  1126. </p>
  1127. </dd></dl>
  1128. <dl>
  1129. <dt><a name="index-basename"></a>Supplemental: <em>char*</em> <strong>basename</strong> <em>(const char *<var>name</var>)</em></dt>
  1130. <dd>
  1131. <p>Returns a pointer to the last component of pathname <var>name</var>.
  1132. Behavior is undefined if the pathname ends in a directory separator.
  1133. </p>
  1134. </dd></dl>
  1135. <dl>
  1136. <dt><a name="index-bcmp"></a>Supplemental: <em>int</em> <strong>bcmp</strong> <em>(char *<var>x</var>, char *<var>y</var>, int <var>count</var>)</em></dt>
  1137. <dd>
  1138. <p>Compares the first <var>count</var> bytes of two areas of memory. Returns
  1139. zero if they are the same, nonzero otherwise. Returns zero if
  1140. <var>count</var> is zero. A nonzero result only indicates a difference,
  1141. it does not indicate any sorting order (say, by having a positive
  1142. result mean <var>x</var> sorts before <var>y</var>).
  1143. </p>
  1144. </dd></dl>
  1145. <dl>
  1146. <dt><a name="index-bcopy"></a>Supplemental: <em>void</em> <strong>bcopy</strong> <em>(char *<var>in</var>, char *<var>out</var>, int <var>length</var>)</em></dt>
  1147. <dd>
  1148. <p>Copies <var>length</var> bytes from memory region <var>in</var> to region
  1149. <var>out</var>. The use of <code>bcopy</code> is deprecated in new programs.
  1150. </p>
  1151. </dd></dl>
  1152. <dl>
  1153. <dt><a name="index-bsearch"></a>Supplemental: <em>void*</em> <strong>bsearch</strong> <em>(const void *<var>key</var>, const void *<var>base</var>, size_t <var>nmemb</var>, size_t <var>size</var>, int (*<var>compar</var>)(const void *, const void *))</em></dt>
  1154. <dd>
  1155. <p>Performs a search over an array of <var>nmemb</var> elements pointed to by
  1156. <var>base</var> for a member that matches the object pointed to by <var>key</var>.
  1157. The size of each member is specified by <var>size</var>. The array contents
  1158. should be sorted in ascending order according to the <var>compar</var>
  1159. comparison function. This routine should take two arguments pointing to
  1160. the <var>key</var> and to an array member, in that order, and should return an
  1161. integer less than, equal to, or greater than zero if the <var>key</var> object
  1162. is respectively less than, matching, or greater than the array member.
  1163. </p>
  1164. </dd></dl>
  1165. <dl>
  1166. <dt><a name="index-bsearch_005fr"></a>Supplemental: <em>void*</em> <strong>bsearch_r</strong> <em>(const void *<var>key</var>, const void *<var>base</var>, size_t <var>nmemb</var>, size_t <var>size</var>, int (*<var>compar</var>)(const void *, const void *, void *), void *<var>arg</var>)</em></dt>
  1167. <dd>
  1168. <p>Performs a search over an array of <var>nmemb</var> elements pointed to by
  1169. <var>base</var> for a member that matches the object pointed to by <var>key</var>.
  1170. The size of each member is specified by <var>size</var>. The array contents
  1171. should be sorted in ascending order according to the <var>compar</var>
  1172. comparison function. This routine should take three arguments: the first
  1173. two point to the <var>key</var> and to an array member, and the last is passed
  1174. down unchanged from <code>bsearch_r</code>&rsquo;s last argument. It should return an
  1175. integer less than, equal to, or greater than zero if the <var>key</var> object
  1176. is respectively less than, matching, or greater than the array member.
  1177. </p>
  1178. </dd></dl>
  1179. <dl>
  1180. <dt><a name="index-buildargv"></a>Extension: <em>char**</em> <strong>buildargv</strong> <em>(char *<var>sp</var>)</em></dt>
  1181. <dd>
  1182. <p>Given a pointer to a string, parse the string extracting fields
  1183. separated by whitespace and optionally enclosed within either single
  1184. or double quotes (which are stripped off), and build a vector of
  1185. pointers to copies of the string for each field. The input string
  1186. remains unchanged. The last element of the vector is followed by a
  1187. <code>NULL</code> element.
  1188. </p>
  1189. <p>All of the memory for the pointer array and copies of the string
  1190. is obtained from <code>xmalloc</code>. All of the memory can be returned to the
  1191. system with the single function call <code>freeargv</code>, which takes the
  1192. returned result of <code>buildargv</code>, as it&rsquo;s argument.
  1193. </p>
  1194. <p>Returns a pointer to the argument vector if successful. Returns
  1195. <code>NULL</code> if <var>sp</var> is <code>NULL</code> or if there is insufficient
  1196. memory to complete building the argument vector.
  1197. </p>
  1198. <p>If the input is a null string (as opposed to a <code>NULL</code> pointer),
  1199. then buildarg returns an argument vector that has one arg, a null
  1200. string.
  1201. </p>
  1202. </dd></dl>
  1203. <dl>
  1204. <dt><a name="index-bzero"></a>Supplemental: <em>void</em> <strong>bzero</strong> <em>(char *<var>mem</var>, int <var>count</var>)</em></dt>
  1205. <dd>
  1206. <p>Zeros <var>count</var> bytes starting at <var>mem</var>. Use of this function
  1207. is deprecated in favor of <code>memset</code>.
  1208. </p>
  1209. </dd></dl>
  1210. <dl>
  1211. <dt><a name="index-calloc"></a>Supplemental: <em>void*</em> <strong>calloc</strong> <em>(size_t <var>nelem</var>, size_t <var>elsize</var>)</em></dt>
  1212. <dd>
  1213. <p>Uses <code>malloc</code> to allocate storage for <var>nelem</var> objects of
  1214. <var>elsize</var> bytes each, then zeros the memory.
  1215. </p>
  1216. </dd></dl>
  1217. <dl>
  1218. <dt><a name="index-canonical_005ffilename_005feq"></a>Extension: <em>int</em> <strong>canonical_filename_eq</strong> <em>(const char *<var>a</var>, const char *<var>b</var>)</em></dt>
  1219. <dd>
  1220. <p>Return non-zero if file names <var>a</var> and <var>b</var> are equivalent.
  1221. This function compares the canonical versions of the filenames as returned by
  1222. <code>lrealpath()</code>, so that so that different file names pointing to the same
  1223. underlying file are treated as being identical.
  1224. </p>
  1225. </dd></dl>
  1226. <dl>
  1227. <dt><a name="index-choose_005ftemp_005fbase"></a>Extension: <em>char*</em> <strong>choose_temp_base</strong> <em>(void)</em></dt>
  1228. <dd>
  1229. <p>Return a prefix for temporary file names or <code>NULL</code> if unable to
  1230. find one. The current directory is chosen if all else fails so the
  1231. program is exited if a temporary directory can&rsquo;t be found (<code>mktemp</code>
  1232. fails). The buffer for the result is obtained with <code>xmalloc</code>.
  1233. </p>
  1234. <p>This function is provided for backwards compatibility only. Its use is
  1235. not recommended.
  1236. </p>
  1237. </dd></dl>
  1238. <dl>
  1239. <dt><a name="index-char_002a"></a>Replacement: <em>const</em> <strong>char*</strong> <em>choose_tmpdir ()</em></dt>
  1240. <dd>
  1241. <p>Returns a pointer to a directory path suitable for creating temporary
  1242. files in.
  1243. </p>
  1244. </dd></dl>
  1245. <dl>
  1246. <dt><a name="index-clock"></a>Supplemental: <em>long</em> <strong>clock</strong> <em>(void)</em></dt>
  1247. <dd>
  1248. <p>Returns an approximation of the CPU time used by the process as a
  1249. <code>clock_t</code>; divide this number by &lsquo;<samp>CLOCKS_PER_SEC</samp>&rsquo; to get the
  1250. number of seconds used.
  1251. </p>
  1252. </dd></dl>
  1253. <dl>
  1254. <dt><a name="index-concat"></a>Extension: <em>char*</em> <strong>concat</strong> <em>(const char *<var>s1</var>, const char *<var>s2</var>, &hellip;, <code>NULL</code>)</em></dt>
  1255. <dd>
  1256. <p>Concatenate zero or more of strings and return the result in freshly
  1257. <code>xmalloc</code>ed memory. The argument list is terminated by the first
  1258. <code>NULL</code> pointer encountered. Pointers to empty strings are ignored.
  1259. </p>
  1260. </dd></dl>
  1261. <dl>
  1262. <dt><a name="index-countargv"></a>Extension: <em>int</em> <strong>countargv</strong> <em>(char * const *<var>argv</var>)</em></dt>
  1263. <dd>
  1264. <p>Return the number of elements in <var>argv</var>.
  1265. Returns zero if <var>argv</var> is NULL.
  1266. </p>
  1267. </dd></dl>
  1268. <dl>
  1269. <dt><a name="index-crc32"></a>Extension: <em>unsigned int</em> <strong>crc32</strong> <em>(const unsigned char *<var>buf</var>, int <var>len</var>, unsigned int <var>init</var>)</em></dt>
  1270. <dd>
  1271. <p>Compute the 32-bit CRC of <var>buf</var> which has length <var>len</var>. The
  1272. starting value is <var>init</var>; this may be used to compute the CRC of
  1273. data split across multiple buffers by passing the return value of each
  1274. call as the <var>init</var> parameter of the next.
  1275. </p>
  1276. <p>This is used by the <code>gdb</code> remote protocol for the &lsquo;<samp>qCRC</samp>&rsquo;
  1277. command. In order to get the same results as gdb for a block of data,
  1278. you must pass the first CRC parameter as <code>0xffffffff</code>.
  1279. </p>
  1280. <p>This CRC can be specified as:
  1281. </p>
  1282. <p>Width : 32
  1283. Poly : 0x04c11db7
  1284. Init : parameter, typically 0xffffffff
  1285. RefIn : false
  1286. RefOut : false
  1287. XorOut : 0
  1288. </p>
  1289. <p>This differs from the &quot;standard&quot; CRC-32 algorithm in that the values
  1290. are not reflected, and there is no final XOR value. These differences
  1291. make it easy to compose the values of multiple blocks.
  1292. </p>
  1293. </dd></dl>
  1294. <dl>
  1295. <dt><a name="index-dupargv"></a>Extension: <em>char**</em> <strong>dupargv</strong> <em>(char * const *<var>vector</var>)</em></dt>
  1296. <dd>
  1297. <p>Duplicate an argument vector. Simply scans through <var>vector</var>,
  1298. duplicating each argument until the terminating <code>NULL</code> is found.
  1299. Returns a pointer to the argument vector if successful. Returns
  1300. <code>NULL</code> if there is insufficient memory to complete building the
  1301. argument vector.
  1302. </p>
  1303. </dd></dl>
  1304. <dl>
  1305. <dt><a name="index-errno_005fmax"></a>Extension: <em>int</em> <strong>errno_max</strong> <em>(void)</em></dt>
  1306. <dd>
  1307. <p>Returns the maximum <code>errno</code> value for which a corresponding
  1308. symbolic name or message is available. Note that in the case where we
  1309. use the <code>sys_errlist</code> supplied by the system, it is possible for
  1310. there to be more symbolic names than messages, or vice versa. In
  1311. fact, the manual page for <code>perror(3C)</code> explicitly warns that one
  1312. should check the size of the table (<code>sys_nerr</code>) before indexing
  1313. it, since new error codes may be added to the system before they are
  1314. added to the table. Thus <code>sys_nerr</code> might be smaller than value
  1315. implied by the largest <code>errno</code> value defined in <code>&lt;errno.h&gt;</code>.
  1316. </p>
  1317. <p>We return the maximum value that can be used to obtain a meaningful
  1318. symbolic name or message.
  1319. </p>
  1320. </dd></dl>
  1321. <dl>
  1322. <dt><a name="index-expandargv"></a>Extension: <em>void</em> <strong>expandargv</strong> <em>(int *<var>argcp</var>, char ***<var>argvp</var>)</em></dt>
  1323. <dd>
  1324. <p>The <var>argcp</var> and <code>argvp</code> arguments are pointers to the usual
  1325. <code>argc</code> and <code>argv</code> arguments to <code>main</code>. This function
  1326. looks for arguments that begin with the character &lsquo;<samp>@</samp>&rsquo;. Any such
  1327. arguments are interpreted as &ldquo;response files&rdquo;. The contents of the
  1328. response file are interpreted as additional command line options. In
  1329. particular, the file is separated into whitespace-separated strings;
  1330. each such string is taken as a command-line option. The new options
  1331. are inserted in place of the option naming the response file, and
  1332. <code>*argcp</code> and <code>*argvp</code> will be updated. If the value of
  1333. <code>*argvp</code> is modified by this function, then the new value has
  1334. been dynamically allocated and can be deallocated by the caller with
  1335. <code>freeargv</code>. However, most callers will simply call
  1336. <code>expandargv</code> near the beginning of <code>main</code> and allow the
  1337. operating system to free the memory when the program exits.
  1338. </p>
  1339. </dd></dl>
  1340. <dl>
  1341. <dt><a name="index-fdmatch"></a>Extension: <em>int</em> <strong>fdmatch</strong> <em>(int <var>fd1</var>, int <var>fd2</var>)</em></dt>
  1342. <dd>
  1343. <p>Check to see if two open file descriptors refer to the same file.
  1344. This is useful, for example, when we have an open file descriptor for
  1345. an unnamed file, and the name of a file that we believe to correspond
  1346. to that fd. This can happen when we are exec&rsquo;d with an already open
  1347. file (<code>stdout</code> for example) or from the SVR4 <samp>/proc</samp> calls
  1348. that return open file descriptors for mapped address spaces. All we
  1349. have to do is open the file by name and check the two file descriptors
  1350. for a match, which is done by comparing major and minor device numbers
  1351. and inode numbers.
  1352. </p>
  1353. </dd></dl>
  1354. <dl>
  1355. <dt><a name="index-fdopen_005funlocked"></a>Extension: <em>FILE *</em> <strong>fdopen_unlocked</strong> <em>(int <var>fildes</var>, const char * <var>mode</var>)</em></dt>
  1356. <dd>
  1357. <p>Opens and returns a <code>FILE</code> pointer via <code>fdopen</code>. If the
  1358. operating system supports it, ensure that the stream is setup to avoid
  1359. any multi-threaded locking. Otherwise return the <code>FILE</code> pointer
  1360. unchanged.
  1361. </p>
  1362. </dd></dl>
  1363. <dl>
  1364. <dt><a name="index-ffs"></a>Supplemental: <em>int</em> <strong>ffs</strong> <em>(int <var>valu</var>)</em></dt>
  1365. <dd>
  1366. <p>Find the first (least significant) bit set in <var>valu</var>. Bits are
  1367. numbered from right to left, starting with bit 1 (corresponding to the
  1368. value 1). If <var>valu</var> is zero, zero is returned.
  1369. </p>
  1370. </dd></dl>
  1371. <dl>
  1372. <dt><a name="index-filename_005fcmp"></a>Extension: <em>int</em> <strong>filename_cmp</strong> <em>(const char *<var>s1</var>, const char *<var>s2</var>)</em></dt>
  1373. <dd>
  1374. <p>Return zero if the two file names <var>s1</var> and <var>s2</var> are equivalent.
  1375. If not equivalent, the returned value is similar to what <code>strcmp</code>
  1376. would return. In other words, it returns a negative value if <var>s1</var>
  1377. is less than <var>s2</var>, or a positive value if <var>s2</var> is greater than
  1378. <var>s2</var>.
  1379. </p>
  1380. <p>This function does not normalize file names. As a result, this function
  1381. will treat filenames that are spelled differently as different even in
  1382. the case when the two filenames point to the same underlying file.
  1383. However, it does handle the fact that on DOS-like file systems, forward
  1384. and backward slashes are equal.
  1385. </p>
  1386. </dd></dl>
  1387. <dl>
  1388. <dt><a name="index-filename_005feq"></a>Extension: <em>int</em> <strong>filename_eq</strong> <em>(const void *<var>s1</var>, const void *<var>s2</var>)</em></dt>
  1389. <dd>
  1390. <p>Return non-zero if file names <var>s1</var> and <var>s2</var> are equivalent.
  1391. This function is for use with hashtab.c hash tables.
  1392. </p>
  1393. </dd></dl>
  1394. <dl>
  1395. <dt><a name="index-filename_005fhash"></a>Extension: <em>hashval_t</em> <strong>filename_hash</strong> <em>(const void *<var>s</var>)</em></dt>
  1396. <dd>
  1397. <p>Return the hash value for file name <var>s</var> that will be compared
  1398. using filename_cmp.
  1399. This function is for use with hashtab.c hash tables.
  1400. </p>
  1401. </dd></dl>
  1402. <dl>
  1403. <dt><a name="index-filename_005fncmp"></a>Extension: <em>int</em> <strong>filename_ncmp</strong> <em>(const char *<var>s1</var>, const char *<var>s2</var>, size_t <var>n</var>)</em></dt>
  1404. <dd>
  1405. <p>Return zero if the two file names <var>s1</var> and <var>s2</var> are equivalent
  1406. in range <var>n</var>.
  1407. If not equivalent, the returned value is similar to what <code>strncmp</code>
  1408. would return. In other words, it returns a negative value if <var>s1</var>
  1409. is less than <var>s2</var>, or a positive value if <var>s2</var> is greater than
  1410. <var>s2</var>.
  1411. </p>
  1412. <p>This function does not normalize file names. As a result, this function
  1413. will treat filenames that are spelled differently as different even in
  1414. the case when the two filenames point to the same underlying file.
  1415. However, it does handle the fact that on DOS-like file systems, forward
  1416. and backward slashes are equal.
  1417. </p>
  1418. </dd></dl>
  1419. <dl>
  1420. <dt><a name="index-fnmatch"></a>Replacement: <em>int</em> <strong>fnmatch</strong> <em>(const char *<var>pattern</var>, const char *<var>string</var>, int <var>flags</var>)</em></dt>
  1421. <dd>
  1422. <p>Matches <var>string</var> against <var>pattern</var>, returning zero if it
  1423. matches, <code>FNM_NOMATCH</code> if not. <var>pattern</var> may contain the
  1424. wildcards <code>?</code> to match any one character, <code>*</code> to match any
  1425. zero or more characters, or a set of alternate characters in square
  1426. brackets, like &lsquo;<samp>[a-gt8]</samp>&rsquo;, which match one character (<code>a</code>
  1427. through <code>g</code>, or <code>t</code>, or <code>8</code>, in this example) if that one
  1428. character is in the set. A set may be inverted (i.e., match anything
  1429. except what&rsquo;s in the set) by giving <code>^</code> or <code>!</code> as the first
  1430. character in the set. To include those characters in the set, list them
  1431. as anything other than the first character of the set. To include a
  1432. dash in the set, list it last in the set. A backslash character makes
  1433. the following character not special, so for example you could match
  1434. against a literal asterisk with &lsquo;<samp>\*</samp>&rsquo;. To match a literal
  1435. backslash, use &lsquo;<samp>\\</samp>&rsquo;.
  1436. </p>
  1437. <p><code>flags</code> controls various aspects of the matching process, and is a
  1438. boolean OR of zero or more of the following values (defined in
  1439. <code>&lt;fnmatch.h&gt;</code>):
  1440. </p>
  1441. <dl compact="compact">
  1442. <dt><code>FNM_PATHNAME</code></dt>
  1443. <dt><code>FNM_FILE_NAME</code></dt>
  1444. <dd><p><var>string</var> is assumed to be a path name. No wildcard will ever match
  1445. <code>/</code>.
  1446. </p>
  1447. </dd>
  1448. <dt><code>FNM_NOESCAPE</code></dt>
  1449. <dd><p>Do not interpret backslashes as quoting the following special character.
  1450. </p>
  1451. </dd>
  1452. <dt><code>FNM_PERIOD</code></dt>
  1453. <dd><p>A leading period (at the beginning of <var>string</var>, or if
  1454. <code>FNM_PATHNAME</code> after a slash) is not matched by <code>*</code> or
  1455. <code>?</code> but must be matched explicitly.
  1456. </p>
  1457. </dd>
  1458. <dt><code>FNM_LEADING_DIR</code></dt>
  1459. <dd><p>Means that <var>string</var> also matches <var>pattern</var> if some initial part
  1460. of <var>string</var> matches, and is followed by <code>/</code> and zero or more
  1461. characters. For example, &lsquo;<samp>foo*</samp>&rsquo; would match either &lsquo;<samp>foobar</samp>&rsquo;
  1462. or &lsquo;<samp>foobar/grill</samp>&rsquo;.
  1463. </p>
  1464. </dd>
  1465. <dt><code>FNM_CASEFOLD</code></dt>
  1466. <dd><p>Ignores case when performing the comparison.
  1467. </p>
  1468. </dd>
  1469. </dl>
  1470. </dd></dl>
  1471. <dl>
  1472. <dt><a name="index-fopen_005funlocked"></a>Extension: <em>FILE *</em> <strong>fopen_unlocked</strong> <em>(const char *<var>path</var>, const char * <var>mode</var>)</em></dt>
  1473. <dd>
  1474. <p>Opens and returns a <code>FILE</code> pointer via <code>fopen</code>. If the
  1475. operating system supports it, ensure that the stream is setup to avoid
  1476. any multi-threaded locking. Otherwise return the <code>FILE</code> pointer
  1477. unchanged.
  1478. </p>
  1479. </dd></dl>
  1480. <dl>
  1481. <dt><a name="index-freeargv"></a>Extension: <em>void</em> <strong>freeargv</strong> <em>(char **<var>vector</var>)</em></dt>
  1482. <dd>
  1483. <p>Free an argument vector that was built using <code>buildargv</code>. Simply
  1484. scans through <var>vector</var>, freeing the memory for each argument until
  1485. the terminating <code>NULL</code> is found, and then frees <var>vector</var>
  1486. itself.
  1487. </p>
  1488. </dd></dl>
  1489. <dl>
  1490. <dt><a name="index-freopen_005funlocked"></a>Extension: <em>FILE *</em> <strong>freopen_unlocked</strong> <em>(const char * <var>path</var>, const char * <var>mode</var>, FILE * <var>stream</var>)</em></dt>
  1491. <dd>
  1492. <p>Opens and returns a <code>FILE</code> pointer via <code>freopen</code>. If the
  1493. operating system supports it, ensure that the stream is setup to avoid
  1494. any multi-threaded locking. Otherwise return the <code>FILE</code> pointer
  1495. unchanged.
  1496. </p>
  1497. </dd></dl>
  1498. <dl>
  1499. <dt><a name="index-get_005frun_005ftime"></a>Replacement: <em>long</em> <strong>get_run_time</strong> <em>(void)</em></dt>
  1500. <dd>
  1501. <p>Returns the time used so far, in microseconds. If possible, this is
  1502. the time used by this process, else it is the elapsed time since the
  1503. process started.
  1504. </p>
  1505. </dd></dl>
  1506. <dl>
  1507. <dt><a name="index-getcwd"></a>Supplemental: <em>char*</em> <strong>getcwd</strong> <em>(char *<var>pathname</var>, int <var>len</var>)</em></dt>
  1508. <dd>
  1509. <p>Copy the absolute pathname for the current working directory into
  1510. <var>pathname</var>, which is assumed to point to a buffer of at least
  1511. <var>len</var> bytes, and return a pointer to the buffer. If the current
  1512. directory&rsquo;s path doesn&rsquo;t fit in <var>len</var> characters, the result is
  1513. <code>NULL</code> and <code>errno</code> is set. If <var>pathname</var> is a null pointer,
  1514. <code>getcwd</code> will obtain <var>len</var> bytes of space using
  1515. <code>malloc</code>.
  1516. </p>
  1517. </dd></dl>
  1518. <dl>
  1519. <dt><a name="index-getpagesize"></a>Supplemental: <em>int</em> <strong>getpagesize</strong> <em>(void)</em></dt>
  1520. <dd>
  1521. <p>Returns the number of bytes in a page of memory. This is the
  1522. granularity of many of the system memory management routines. No
  1523. guarantee is made as to whether or not it is the same as the basic
  1524. memory management hardware page size.
  1525. </p>
  1526. </dd></dl>
  1527. <dl>
  1528. <dt><a name="index-getpwd"></a>Supplemental: <em>char*</em> <strong>getpwd</strong> <em>(void)</em></dt>
  1529. <dd>
  1530. <p>Returns the current working directory. This implementation caches the
  1531. result on the assumption that the process will not call <code>chdir</code>
  1532. between calls to <code>getpwd</code>.
  1533. </p>
  1534. </dd></dl>
  1535. <dl>
  1536. <dt><a name="index-gettimeofday"></a>Supplemental: <em>int</em> <strong>gettimeofday</strong> <em>(struct timeval *<var>tp</var>, void *<var>tz</var>)</em></dt>
  1537. <dd>
  1538. <p>Writes the current time to <var>tp</var>. This implementation requires
  1539. that <var>tz</var> be NULL. Returns 0 on success, -1 on failure.
  1540. </p>
  1541. </dd></dl>
  1542. <dl>
  1543. <dt><a name="index-hex_005finit"></a>Extension: <em>void</em> <strong>hex_init</strong> <em>(void)</em></dt>
  1544. <dd>
  1545. <p>Initializes the array mapping the current character set to
  1546. corresponding hex values. This function must be called before any
  1547. call to <code>hex_p</code> or <code>hex_value</code>. If you fail to call it, a
  1548. default ASCII-based table will normally be used on ASCII systems.
  1549. </p>
  1550. </dd></dl>
  1551. <dl>
  1552. <dt><a name="index-hex_005fp"></a>Extension: <em>int</em> <strong>hex_p</strong> <em>(int <var>c</var>)</em></dt>
  1553. <dd>
  1554. <p>Evaluates to non-zero if the given character is a valid hex character,
  1555. or zero if it is not. Note that the value you pass will be cast to
  1556. <code>unsigned char</code> within the macro.
  1557. </p>
  1558. </dd></dl>
  1559. <dl>
  1560. <dt><a name="index-hex_005fvalue"></a>Extension: <em>unsigned int</em> <strong>hex_value</strong> <em>(int <var>c</var>)</em></dt>
  1561. <dd>
  1562. <p>Returns the numeric equivalent of the given character when interpreted
  1563. as a hexadecimal digit. The result is undefined if you pass an
  1564. invalid hex digit. Note that the value you pass will be cast to
  1565. <code>unsigned char</code> within the macro.
  1566. </p>
  1567. <p>The <code>hex_value</code> macro returns <code>unsigned int</code>, rather than
  1568. signed <code>int</code>, to make it easier to use in parsing addresses from
  1569. hex dump files: a signed <code>int</code> would be sign-extended when
  1570. converted to a wider unsigned type &mdash; like <code>bfd_vma</code>, on some
  1571. systems.
  1572. </p>
  1573. </dd></dl>
  1574. <dl>
  1575. <dt><a name="index-HOST_005fCHARSET"></a>Extension: <strong>HOST_CHARSET</strong></dt>
  1576. <dd><p>This macro indicates the basic character set and encoding used by the
  1577. host: more precisely, the encoding used for character constants in
  1578. preprocessor &lsquo;<samp>#if</samp>&rsquo; statements (the C &quot;execution character set&quot;).
  1579. It is defined by <samp>safe-ctype.h</samp>, and will be an integer constant
  1580. with one of the following values:
  1581. </p>
  1582. <dl compact="compact">
  1583. <dt><code>HOST_CHARSET_UNKNOWN</code>
  1584. <a name="index-HOST_005fCHARSET_005fUNKNOWN"></a>
  1585. </dt>
  1586. <dd><p>The host character set is unknown - that is, not one of the next two
  1587. possibilities.
  1588. </p>
  1589. </dd>
  1590. <dt><code>HOST_CHARSET_ASCII</code>
  1591. <a name="index-HOST_005fCHARSET_005fASCII"></a>
  1592. </dt>
  1593. <dd><p>The host character set is ASCII.
  1594. </p>
  1595. </dd>
  1596. <dt><code>HOST_CHARSET_EBCDIC</code>
  1597. <a name="index-HOST_005fCHARSET_005fEBCDIC"></a>
  1598. </dt>
  1599. <dd><p>The host character set is some variant of EBCDIC. (Only one of the
  1600. nineteen EBCDIC varying characters is tested; exercise caution.)
  1601. </p></dd>
  1602. </dl>
  1603. </dd></dl>
  1604. <dl>
  1605. <dt><a name="index-htab_005fcreate_005ftyped_005falloc"></a>Supplemental: <em>htab_t</em> <strong>htab_create_typed_alloc</strong> <em>(size_t <var>size</var>, htab_hash <var>hash_f</var>, htab_eq <var>eq_f</var>, htab_del <var>del_f</var>, htab_alloc <var>alloc_tab_f</var>, htab_alloc <var>alloc_f</var>, htab_free <var>free_f</var>)</em></dt>
  1606. <dd>
  1607. <p>This function creates a hash table that uses two different allocators
  1608. <var>alloc_tab_f</var> and <var>alloc_f</var> to use for allocating the table itself
  1609. and its entries respectively. This is useful when variables of different
  1610. types need to be allocated with different allocators.
  1611. </p>
  1612. <p>The created hash table is slightly larger than <var>size</var> and it is
  1613. initially empty (all the hash table entries are <code>HTAB_EMPTY_ENTRY</code>).
  1614. The function returns the created hash table, or <code>NULL</code> if memory
  1615. allocation fails.
  1616. </p>
  1617. </dd></dl>
  1618. <dl>
  1619. <dt><a name="index-index"></a>Supplemental: <em>char*</em> <strong>index</strong> <em>(char *<var>s</var>, int <var>c</var>)</em></dt>
  1620. <dd>
  1621. <p>Returns a pointer to the first occurrence of the character <var>c</var> in
  1622. the string <var>s</var>, or <code>NULL</code> if not found. The use of <code>index</code> is
  1623. deprecated in new programs in favor of <code>strchr</code>.
  1624. </p>
  1625. </dd></dl>
  1626. <dl>
  1627. <dt><a name="index-insque"></a>Supplemental: <em>void</em> <strong>insque</strong> <em>(struct qelem *<var>elem</var>, struct qelem *<var>pred</var>)</em></dt>
  1628. <dt><a name="index-remque"></a>Supplemental: <em>void</em> <strong>remque</strong> <em>(struct qelem *<var>elem</var>)</em></dt>
  1629. <dd>
  1630. <p>Routines to manipulate queues built from doubly linked lists. The
  1631. <code>insque</code> routine inserts <var>elem</var> in the queue immediately
  1632. after <var>pred</var>. The <code>remque</code> routine removes <var>elem</var> from
  1633. its containing queue. These routines expect to be passed pointers to
  1634. structures which have as their first members a forward pointer and a
  1635. back pointer, like this prototype (although no prototype is provided):
  1636. </p>
  1637. <div class="example">
  1638. <pre class="example">struct qelem {
  1639. struct qelem *q_forw;
  1640. struct qelem *q_back;
  1641. char q_data[];
  1642. };
  1643. </pre></div>
  1644. </dd></dl>
  1645. <dl>
  1646. <dt><a name="index-ISALPHA"></a>Extension: <strong>ISALPHA</strong> <em>(<var>c</var>)</em></dt>
  1647. <dt><a name="index-ISALNUM"></a>Extension: <strong>ISALNUM</strong> <em>(<var>c</var>)</em></dt>
  1648. <dt><a name="index-ISBLANK"></a>Extension: <strong>ISBLANK</strong> <em>(<var>c</var>)</em></dt>
  1649. <dt><a name="index-ISCNTRL"></a>Extension: <strong>ISCNTRL</strong> <em>(<var>c</var>)</em></dt>
  1650. <dt><a name="index-ISDIGIT"></a>Extension: <strong>ISDIGIT</strong> <em>(<var>c</var>)</em></dt>
  1651. <dt><a name="index-ISGRAPH"></a>Extension: <strong>ISGRAPH</strong> <em>(<var>c</var>)</em></dt>
  1652. <dt><a name="index-ISLOWER"></a>Extension: <strong>ISLOWER</strong> <em>(<var>c</var>)</em></dt>
  1653. <dt><a name="index-ISPRINT"></a>Extension: <strong>ISPRINT</strong> <em>(<var>c</var>)</em></dt>
  1654. <dt><a name="index-ISPUNCT"></a>Extension: <strong>ISPUNCT</strong> <em>(<var>c</var>)</em></dt>
  1655. <dt><a name="index-ISSPACE"></a>Extension: <strong>ISSPACE</strong> <em>(<var>c</var>)</em></dt>
  1656. <dt><a name="index-ISUPPER"></a>Extension: <strong>ISUPPER</strong> <em>(<var>c</var>)</em></dt>
  1657. <dt><a name="index-ISXDIGIT"></a>Extension: <strong>ISXDIGIT</strong> <em>(<var>c</var>)</em></dt>
  1658. <dd>
  1659. <p>These twelve macros are defined by <samp>safe-ctype.h</samp>. Each has the
  1660. same meaning as the corresponding macro (with name in lowercase)
  1661. defined by the standard header <samp>ctype.h</samp>. For example,
  1662. <code>ISALPHA</code> returns true for alphabetic characters and false for
  1663. others. However, there are two differences between these macros and
  1664. those provided by <samp>ctype.h</samp>:
  1665. </p>
  1666. <ul>
  1667. <li> These macros are guaranteed to have well-defined behavior for all
  1668. values representable by <code>signed char</code> and <code>unsigned char</code>, and
  1669. for <code>EOF</code>.
  1670. </li><li> These macros ignore the current locale; they are true for these
  1671. fixed sets of characters:
  1672. <table>
  1673. <tr><td><code>ALPHA</code></td><td><kbd>A-Za-z</kbd></td></tr>
  1674. <tr><td><code>ALNUM</code></td><td><kbd>A-Za-z0-9</kbd></td></tr>
  1675. <tr><td><code>BLANK</code></td><td><kbd>space tab</kbd></td></tr>
  1676. <tr><td><code>CNTRL</code></td><td><code>!PRINT</code></td></tr>
  1677. <tr><td><code>DIGIT</code></td><td><kbd>0-9</kbd></td></tr>
  1678. <tr><td><code>GRAPH</code></td><td><code>ALNUM || PUNCT</code></td></tr>
  1679. <tr><td><code>LOWER</code></td><td><kbd>a-z</kbd></td></tr>
  1680. <tr><td><code>PRINT</code></td><td><code>GRAPH ||</code> <kbd>space</kbd></td></tr>
  1681. <tr><td><code>PUNCT</code></td><td><kbd>`~!@#$%^&amp;*()_-=+[{]}\|;:'&quot;,&lt;.&gt;/?</kbd></td></tr>
  1682. <tr><td><code>SPACE</code></td><td><kbd>space tab \n \r \f \v</kbd></td></tr>
  1683. <tr><td><code>UPPER</code></td><td><kbd>A-Z</kbd></td></tr>
  1684. <tr><td><code>XDIGIT</code></td><td><kbd>0-9A-Fa-f</kbd></td></tr>
  1685. </table>
  1686. <p>Note that, if the host character set is ASCII or a superset thereof,
  1687. all these macros will return false for all values of <code>char</code> outside
  1688. the range of 7-bit ASCII. In particular, both ISPRINT and ISCNTRL return
  1689. false for characters with numeric values from 128 to 255.
  1690. </p></li></ul>
  1691. </dd></dl>
  1692. <dl>
  1693. <dt><a name="index-ISIDNUM"></a>Extension: <strong>ISIDNUM</strong> <em>(<var>c</var>)</em></dt>
  1694. <dt><a name="index-ISIDST"></a>Extension: <strong>ISIDST</strong> <em>(<var>c</var>)</em></dt>
  1695. <dt><a name="index-IS_005fVSPACE"></a>Extension: <strong>IS_VSPACE</strong> <em>(<var>c</var>)</em></dt>
  1696. <dt><a name="index-IS_005fNVSPACE"></a>Extension: <strong>IS_NVSPACE</strong> <em>(<var>c</var>)</em></dt>
  1697. <dt><a name="index-IS_005fSPACE_005fOR_005fNUL"></a>Extension: <strong>IS_SPACE_OR_NUL</strong> <em>(<var>c</var>)</em></dt>
  1698. <dt><a name="index-IS_005fISOBASIC"></a>Extension: <strong>IS_ISOBASIC</strong> <em>(<var>c</var>)</em></dt>
  1699. <dd><p>These six macros are defined by <samp>safe-ctype.h</samp> and provide
  1700. additional character classes which are useful when doing lexical
  1701. analysis of C or similar languages. They are true for the following
  1702. sets of characters:
  1703. </p>
  1704. <table>
  1705. <tr><td><code>IDNUM</code></td><td><kbd>A-Za-z0-9_</kbd></td></tr>
  1706. <tr><td><code>IDST</code></td><td><kbd>A-Za-z_</kbd></td></tr>
  1707. <tr><td><code>VSPACE</code></td><td><kbd>\r \n</kbd></td></tr>
  1708. <tr><td><code>NVSPACE</code></td><td><kbd>space tab \f \v \0</kbd></td></tr>
  1709. <tr><td><code>SPACE_OR_NUL</code></td><td><code>VSPACE || NVSPACE</code></td></tr>
  1710. <tr><td><code>ISOBASIC</code></td><td><code>VSPACE || NVSPACE || PRINT</code></td></tr>
  1711. </table>
  1712. </dd></dl>
  1713. <dl>
  1714. <dt><a name="index-lbasename"></a>Replacement: <em>const char*</em> <strong>lbasename</strong> <em>(const char *<var>name</var>)</em></dt>
  1715. <dd>
  1716. <p>Given a pointer to a string containing a typical pathname
  1717. (&lsquo;<samp>/usr/src/cmd/ls/ls.c</samp>&rsquo; for example), returns a pointer to the
  1718. last component of the pathname (&lsquo;<samp>ls.c</samp>&rsquo; in this case). The
  1719. returned pointer is guaranteed to lie within the original
  1720. string. This latter fact is not true of many vendor C
  1721. libraries, which return special strings or modify the passed
  1722. strings for particular input.
  1723. </p>
  1724. <p>In particular, the empty string returns the same empty string,
  1725. and a path ending in <code>/</code> returns the empty string after it.
  1726. </p>
  1727. </dd></dl>
  1728. <dl>
  1729. <dt><a name="index-lrealpath"></a>Replacement: <em>const char*</em> <strong>lrealpath</strong> <em>(const char *<var>name</var>)</em></dt>
  1730. <dd>
  1731. <p>Given a pointer to a string containing a pathname, returns a canonical
  1732. version of the filename. Symlinks will be resolved, and &ldquo;.&rdquo; and &ldquo;..&rdquo;
  1733. components will be simplified. The returned value will be allocated using
  1734. <code>malloc</code>, or <code>NULL</code> will be returned on a memory allocation error.
  1735. </p>
  1736. </dd></dl>
  1737. <dl>
  1738. <dt><a name="index-make_005frelative_005fprefix"></a>Extension: <em>const char*</em> <strong>make_relative_prefix</strong> <em>(const char *<var>progname</var>, const char *<var>bin_prefix</var>, const char *<var>prefix</var>)</em></dt>
  1739. <dd>
  1740. <p>Given three paths <var>progname</var>, <var>bin_prefix</var>, <var>prefix</var>,
  1741. return the path that is in the same position relative to
  1742. <var>progname</var>&rsquo;s directory as <var>prefix</var> is relative to
  1743. <var>bin_prefix</var>. That is, a string starting with the directory
  1744. portion of <var>progname</var>, followed by a relative pathname of the
  1745. difference between <var>bin_prefix</var> and <var>prefix</var>.
  1746. </p>
  1747. <p>If <var>progname</var> does not contain any directory separators,
  1748. <code>make_relative_prefix</code> will search <code>PATH</code> to find a program
  1749. named <var>progname</var>. Also, if <var>progname</var> is a symbolic link,
  1750. the symbolic link will be resolved.
  1751. </p>
  1752. <p>For example, if <var>bin_prefix</var> is <code>/alpha/beta/gamma/gcc/delta</code>,
  1753. <var>prefix</var> is <code>/alpha/beta/gamma/omega/</code>, and <var>progname</var> is
  1754. <code>/red/green/blue/gcc</code>, then this function will return
  1755. <code>/red/green/blue/../../omega/</code>.
  1756. </p>
  1757. <p>The return value is normally allocated via <code>malloc</code>. If no
  1758. relative prefix can be found, return <code>NULL</code>.
  1759. </p>
  1760. </dd></dl>
  1761. <dl>
  1762. <dt><a name="index-make_005ftemp_005ffile"></a>Replacement: <em>char*</em> <strong>make_temp_file</strong> <em>(const char *<var>suffix</var>)</em></dt>
  1763. <dd>
  1764. <p>Return a temporary file name (as a string) or <code>NULL</code> if unable to
  1765. create one. <var>suffix</var> is a suffix to append to the file name. The
  1766. string is <code>malloc</code>ed, and the temporary file has been created.
  1767. </p>
  1768. </dd></dl>
  1769. <dl>
  1770. <dt><a name="index-memchr"></a>Supplemental: <em>void*</em> <strong>memchr</strong> <em>(const void *<var>s</var>, int <var>c</var>, size_t <var>n</var>)</em></dt>
  1771. <dd>
  1772. <p>This function searches memory starting at <code>*<var>s</var></code> for the
  1773. character <var>c</var>. The search only ends with the first occurrence of
  1774. <var>c</var>, or after <var>length</var> characters; in particular, a null
  1775. character does not terminate the search. If the character <var>c</var> is
  1776. found within <var>length</var> characters of <code>*<var>s</var></code>, a pointer
  1777. to the character is returned. If <var>c</var> is not found, then <code>NULL</code> is
  1778. returned.
  1779. </p>
  1780. </dd></dl>
  1781. <dl>
  1782. <dt><a name="index-memcmp"></a>Supplemental: <em>int</em> <strong>memcmp</strong> <em>(const void *<var>x</var>, const void *<var>y</var>, size_t <var>count</var>)</em></dt>
  1783. <dd>
  1784. <p>Compares the first <var>count</var> bytes of two areas of memory. Returns
  1785. zero if they are the same, a value less than zero if <var>x</var> is
  1786. lexically less than <var>y</var>, or a value greater than zero if <var>x</var>
  1787. is lexically greater than <var>y</var>. Note that lexical order is determined
  1788. as if comparing unsigned char arrays.
  1789. </p>
  1790. </dd></dl>
  1791. <dl>
  1792. <dt><a name="index-memcpy"></a>Supplemental: <em>void*</em> <strong>memcpy</strong> <em>(void *<var>out</var>, const void *<var>in</var>, size_t <var>length</var>)</em></dt>
  1793. <dd>
  1794. <p>Copies <var>length</var> bytes from memory region <var>in</var> to region
  1795. <var>out</var>. Returns a pointer to <var>out</var>.
  1796. </p>
  1797. </dd></dl>
  1798. <dl>
  1799. <dt><a name="index-memmem"></a>Supplemental: <em>void*</em> <strong>memmem</strong> <em>(const void *<var>haystack</var>, size_t <var>haystack_len</var> const void *<var>needle</var>, size_t <var>needle_len</var>)</em></dt>
  1800. <dd>
  1801. <p>Returns a pointer to the first occurrence of <var>needle</var> (length
  1802. <var>needle_len</var>) in <var>haystack</var> (length <var>haystack_len</var>).
  1803. Returns <code>NULL</code> if not found.
  1804. </p>
  1805. </dd></dl>
  1806. <dl>
  1807. <dt><a name="index-memmove"></a>Supplemental: <em>void*</em> <strong>memmove</strong> <em>(void *<var>from</var>, const void *<var>to</var>, size_t <var>count</var>)</em></dt>
  1808. <dd>
  1809. <p>Copies <var>count</var> bytes from memory area <var>from</var> to memory area
  1810. <var>to</var>, returning a pointer to <var>to</var>.
  1811. </p>
  1812. </dd></dl>
  1813. <dl>
  1814. <dt><a name="index-mempcpy"></a>Supplemental: <em>void*</em> <strong>mempcpy</strong> <em>(void *<var>out</var>, const void *<var>in</var>, size_t <var>length</var>)</em></dt>
  1815. <dd>
  1816. <p>Copies <var>length</var> bytes from memory region <var>in</var> to region
  1817. <var>out</var>. Returns a pointer to <var>out</var> + <var>length</var>.
  1818. </p>
  1819. </dd></dl>
  1820. <dl>
  1821. <dt><a name="index-memset"></a>Supplemental: <em>void*</em> <strong>memset</strong> <em>(void *<var>s</var>, int <var>c</var>, size_t <var>count</var>)</em></dt>
  1822. <dd>
  1823. <p>Sets the first <var>count</var> bytes of <var>s</var> to the constant byte
  1824. <var>c</var>, returning a pointer to <var>s</var>.
  1825. </p>
  1826. </dd></dl>
  1827. <dl>
  1828. <dt><a name="index-mkstemps"></a>Replacement: <em>int</em> <strong>mkstemps</strong> <em>(char *<var>pattern</var>, int <var>suffix_len</var>)</em></dt>
  1829. <dd>
  1830. <p>Generate a unique temporary file name from <var>pattern</var>.
  1831. <var>pattern</var> has the form:
  1832. </p>
  1833. <div class="example">
  1834. <pre class="example"> <var>path</var>/ccXXXXXX<var>suffix</var>
  1835. </pre></div>
  1836. <p><var>suffix_len</var> tells us how long <var>suffix</var> is (it can be zero
  1837. length). The last six characters of <var>pattern</var> before <var>suffix</var>
  1838. must be &lsquo;<samp>XXXXXX</samp>&rsquo;; they are replaced with a string that makes the
  1839. filename unique. Returns a file descriptor open on the file for
  1840. reading and writing.
  1841. </p>
  1842. </dd></dl>
  1843. <dl>
  1844. <dt><a name="index-pex_005ffree"></a>Extension: <em>void</em> <strong>pex_free</strong> <em>(struct pex_obj <var>obj</var>)</em></dt>
  1845. <dd>
  1846. <p>Clean up and free all data associated with <var>obj</var>. If you have not
  1847. yet called <code>pex_get_times</code> or <code>pex_get_status</code>, this will
  1848. try to kill the subprocesses.
  1849. </p>
  1850. </dd></dl>
  1851. <dl>
  1852. <dt><a name="index-pex_005fget_005fstatus"></a>Extension: <em>int</em> <strong>pex_get_status</strong> <em>(struct pex_obj *<var>obj</var>, int <var>count</var>, int *<var>vector</var>)</em></dt>
  1853. <dd>
  1854. <p>Returns the exit status of all programs run using <var>obj</var>.
  1855. <var>count</var> is the number of results expected. The results will be
  1856. placed into <var>vector</var>. The results are in the order of the calls
  1857. to <code>pex_run</code>. Returns 0 on error, 1 on success.
  1858. </p>
  1859. </dd></dl>
  1860. <dl>
  1861. <dt><a name="index-pex_005fget_005ftimes"></a>Extension: <em>int</em> <strong>pex_get_times</strong> <em>(struct pex_obj *<var>obj</var>, int <var>count</var>, struct pex_time *<var>vector</var>)</em></dt>
  1862. <dd>
  1863. <p>Returns the process execution times of all programs run using
  1864. <var>obj</var>. <var>count</var> is the number of results expected. The
  1865. results will be placed into <var>vector</var>. The results are in the
  1866. order of the calls to <code>pex_run</code>. Returns 0 on error, 1 on
  1867. success.
  1868. </p>
  1869. <p><code>struct pex_time</code> has the following fields of the type
  1870. <code>unsigned long</code>: <code>user_seconds</code>,
  1871. <code>user_microseconds</code>, <code>system_seconds</code>,
  1872. <code>system_microseconds</code>. On systems which do not support reporting
  1873. process times, all the fields will be set to <code>0</code>.
  1874. </p>
  1875. </dd></dl>
  1876. <dl>
  1877. <dt><a name="index-pex_005finit"></a>Extension: <em>struct pex_obj *</em> <strong>pex_init</strong> <em>(int <var>flags</var>, const char *<var>pname</var>, const char *<var>tempbase</var>)</em></dt>
  1878. <dd>
  1879. <p>Prepare to execute one or more programs, with standard output of each
  1880. program fed to standard input of the next. This is a system
  1881. independent interface to execute a pipeline.
  1882. </p>
  1883. <p><var>flags</var> is a bitwise combination of the following:
  1884. </p>
  1885. <dl compact="compact">
  1886. <dd>
  1887. <a name="index-PEX_005fRECORD_005fTIMES"></a>
  1888. </dd>
  1889. <dt><code>PEX_RECORD_TIMES</code></dt>
  1890. <dd><p>Record subprocess times if possible.
  1891. </p>
  1892. <a name="index-PEX_005fUSE_005fPIPES"></a>
  1893. </dd>
  1894. <dt><code>PEX_USE_PIPES</code></dt>
  1895. <dd><p>Use pipes for communication between processes, if possible.
  1896. </p>
  1897. <a name="index-PEX_005fSAVE_005fTEMPS"></a>
  1898. </dd>
  1899. <dt><code>PEX_SAVE_TEMPS</code></dt>
  1900. <dd><p>Don&rsquo;t delete temporary files used for communication between
  1901. processes.
  1902. </p>
  1903. </dd>
  1904. </dl>
  1905. <p><var>pname</var> is the name of program to be executed, used in error
  1906. messages. <var>tempbase</var> is a base name to use for any required
  1907. temporary files; it may be <code>NULL</code> to use a randomly chosen name.
  1908. </p>
  1909. </dd></dl>
  1910. <dl>
  1911. <dt><a name="index-pex_005finput_005ffile"></a>Extension: <em>FILE *</em> <strong>pex_input_file</strong> <em>(struct pex_obj *<var>obj</var>, int <var>flags</var>, const char *<var>in_name</var>)</em></dt>
  1912. <dd>
  1913. <p>Return a stream for a temporary file to pass to the first program in
  1914. the pipeline as input.
  1915. </p>
  1916. <p>The name of the input file is chosen according to the same rules
  1917. <code>pex_run</code> uses to choose output file names, based on
  1918. <var>in_name</var>, <var>obj</var> and the <code>PEX_SUFFIX</code> bit in <var>flags</var>.
  1919. </p>
  1920. <p>Don&rsquo;t call <code>fclose</code> on the returned stream; the first call to
  1921. <code>pex_run</code> closes it automatically.
  1922. </p>
  1923. <p>If <var>flags</var> includes <code>PEX_BINARY_OUTPUT</code>, open the stream in
  1924. binary mode; otherwise, open it in the default mode. Including
  1925. <code>PEX_BINARY_OUTPUT</code> in <var>flags</var> has no effect on Unix.
  1926. </p></dd></dl>
  1927. <dl>
  1928. <dt><a name="index-pex_005finput_005fpipe"></a>Extension: <em>FILE *</em> <strong>pex_input_pipe</strong> <em>(struct pex_obj *<var>obj</var>, int <var>binary</var>)</em></dt>
  1929. <dd>
  1930. <p>Return a stream <var>fp</var> for a pipe connected to the standard input of
  1931. the first program in the pipeline; <var>fp</var> is opened for writing.
  1932. You must have passed <code>PEX_USE_PIPES</code> to the <code>pex_init</code> call
  1933. that returned <var>obj</var>.
  1934. </p>
  1935. <p>You must close <var>fp</var> using <code>fclose</code> yourself when you have
  1936. finished writing data to the pipeline.
  1937. </p>
  1938. <p>The file descriptor underlying <var>fp</var> is marked not to be inherited
  1939. by child processes.
  1940. </p>
  1941. <p>On systems that do not support pipes, this function returns
  1942. <code>NULL</code>, and sets <code>errno</code> to <code>EINVAL</code>. If you would
  1943. like to write code that is portable to all systems the <code>pex</code>
  1944. functions support, consider using <code>pex_input_file</code> instead.
  1945. </p>
  1946. <p>There are two opportunities for deadlock using
  1947. <code>pex_input_pipe</code>:
  1948. </p>
  1949. <ul>
  1950. <li> Most systems&rsquo; pipes can buffer only a fixed amount of data; a process
  1951. that writes to a full pipe blocks. Thus, if you write to <samp>fp</samp>
  1952. before starting the first process, you run the risk of blocking when
  1953. there is no child process yet to read the data and allow you to
  1954. continue. <code>pex_input_pipe</code> makes no promises about the
  1955. size of the pipe&rsquo;s buffer, so if you need to write any data at all
  1956. before starting the first process in the pipeline, consider using
  1957. <code>pex_input_file</code> instead.
  1958. </li><li> Using <code>pex_input_pipe</code> and <code>pex_read_output</code> together
  1959. may also cause deadlock. If the output pipe fills up, so that each
  1960. program in the pipeline is waiting for the next to read more data, and
  1961. you fill the input pipe by writing more data to <var>fp</var>, then there
  1962. is no way to make progress: the only process that could read data from
  1963. the output pipe is you, but you are blocked on the input pipe.
  1964. </li></ul>
  1965. </dd></dl>
  1966. <dl>
  1967. <dt><a name="index-pex_005fone"></a>Extension: <em>const char *</em> <strong>pex_one</strong> <em>(int <var>flags</var>, const char *<var>executable</var>, char * const *<var>argv</var>, const char *<var>pname</var>, const char *<var>outname</var>, const char *<var>errname</var>, int *<var>status</var>, int *<var>err</var>)</em></dt>
  1968. <dd>
  1969. <p>An interface to permit the easy execution of a
  1970. single program. The return value and most of the parameters are as
  1971. for a call to <code>pex_run</code>. <var>flags</var> is restricted to a
  1972. combination of <code>PEX_SEARCH</code>, <code>PEX_STDERR_TO_STDOUT</code>, and
  1973. <code>PEX_BINARY_OUTPUT</code>. <var>outname</var> is interpreted as if
  1974. <code>PEX_LAST</code> were set. On a successful return, <code>*<var>status</var></code> will
  1975. be set to the exit status of the program.
  1976. </p>
  1977. </dd></dl>
  1978. <dl>
  1979. <dt><a name="index-pex_005fread_005ferr"></a>Extension: <em>FILE *</em> <strong>pex_read_err</strong> <em>(struct pex_obj *<var>obj</var>, int <var>binary</var>)</em></dt>
  1980. <dd>
  1981. <p>Returns a <code>FILE</code> pointer which may be used to read the standard
  1982. error of the last program in the pipeline. When this is used,
  1983. <code>PEX_LAST</code> should not be used in a call to <code>pex_run</code>. After
  1984. this is called, <code>pex_run</code> may no longer be called with the same
  1985. <var>obj</var>. <var>binary</var> should be non-zero if the file should be
  1986. opened in binary mode. Don&rsquo;t call <code>fclose</code> on the returned file;
  1987. it will be closed by <code>pex_free</code>.
  1988. </p>
  1989. </dd></dl>
  1990. <dl>
  1991. <dt><a name="index-pex_005fread_005foutput"></a>Extension: <em>FILE *</em> <strong>pex_read_output</strong> <em>(struct pex_obj *<var>obj</var>, int <var>binary</var>)</em></dt>
  1992. <dd>
  1993. <p>Returns a <code>FILE</code> pointer which may be used to read the standard
  1994. output of the last program in the pipeline. When this is used,
  1995. <code>PEX_LAST</code> should not be used in a call to <code>pex_run</code>. After
  1996. this is called, <code>pex_run</code> may no longer be called with the same
  1997. <var>obj</var>. <var>binary</var> should be non-zero if the file should be
  1998. opened in binary mode. Don&rsquo;t call <code>fclose</code> on the returned file;
  1999. it will be closed by <code>pex_free</code>.
  2000. </p>
  2001. </dd></dl>
  2002. <dl>
  2003. <dt><a name="index-pex_005frun"></a>Extension: <em>const char *</em> <strong>pex_run</strong> <em>(struct pex_obj *<var>obj</var>, int <var>flags</var>, const char *<var>executable</var>, char * const *<var>argv</var>, const char *<var>outname</var>, const char *<var>errname</var>, int *<var>err</var>)</em></dt>
  2004. <dd>
  2005. <p>Execute one program in a pipeline. On success this returns
  2006. <code>NULL</code>. On failure it returns an error message, a statically
  2007. allocated string.
  2008. </p>
  2009. <p><var>obj</var> is returned by a previous call to <code>pex_init</code>.
  2010. </p>
  2011. <p><var>flags</var> is a bitwise combination of the following:
  2012. </p>
  2013. <dl compact="compact">
  2014. <dd>
  2015. <a name="index-PEX_005fLAST"></a>
  2016. </dd>
  2017. <dt><code>PEX_LAST</code></dt>
  2018. <dd><p>This must be set on the last program in the pipeline. In particular,
  2019. it should be set when executing a single program. The standard output
  2020. of the program will be sent to <var>outname</var>, or, if <var>outname</var> is
  2021. <code>NULL</code>, to the standard output of the calling program. Do <em>not</em>
  2022. set this bit if you want to call <code>pex_read_output</code>
  2023. (described below). After a call to <code>pex_run</code> with this bit set,
  2024. <var>pex_run</var> may no longer be called with the same <var>obj</var>.
  2025. </p>
  2026. <a name="index-PEX_005fSEARCH"></a>
  2027. </dd>
  2028. <dt><code>PEX_SEARCH</code></dt>
  2029. <dd><p>Search for the program using the user&rsquo;s executable search path.
  2030. </p>
  2031. <a name="index-PEX_005fSUFFIX"></a>
  2032. </dd>
  2033. <dt><code>PEX_SUFFIX</code></dt>
  2034. <dd><p><var>outname</var> is a suffix. See the description of <var>outname</var>,
  2035. below.
  2036. </p>
  2037. <a name="index-PEX_005fSTDERR_005fTO_005fSTDOUT"></a>
  2038. </dd>
  2039. <dt><code>PEX_STDERR_TO_STDOUT</code></dt>
  2040. <dd><p>Send the program&rsquo;s standard error to standard output, if possible.
  2041. </p>
  2042. <a name="index-PEX_005fBINARY_005fINPUT"></a>
  2043. <a name="index-PEX_005fBINARY_005fOUTPUT"></a>
  2044. <a name="index-PEX_005fBINARY_005fERROR"></a>
  2045. </dd>
  2046. <dt><code>PEX_BINARY_INPUT</code></dt>
  2047. <dt><code>PEX_BINARY_OUTPUT</code></dt>
  2048. <dt><code>PEX_BINARY_ERROR</code></dt>
  2049. <dd><p>The standard input (output or error) of the program should be read (written) in
  2050. binary mode rather than text mode. These flags are ignored on systems
  2051. which do not distinguish binary mode and text mode, such as Unix. For
  2052. proper behavior these flags should match appropriately&mdash;a call to
  2053. <code>pex_run</code> using <code>PEX_BINARY_OUTPUT</code> should be followed by a
  2054. call using <code>PEX_BINARY_INPUT</code>.
  2055. </p>
  2056. <a name="index-PEX_005fSTDERR_005fTO_005fPIPE"></a>
  2057. </dd>
  2058. <dt><code>PEX_STDERR_TO_PIPE</code></dt>
  2059. <dd><p>Send the program&rsquo;s standard error to a pipe, if possible. This flag
  2060. cannot be specified together with <code>PEX_STDERR_TO_STDOUT</code>. This
  2061. flag can be specified only on the last program in pipeline.
  2062. </p>
  2063. </dd>
  2064. </dl>
  2065. <p><var>executable</var> is the program to execute. <var>argv</var> is the set of
  2066. arguments to pass to the program; normally <code><var>argv</var>[0]</code> will
  2067. be a copy of <var>executable</var>.
  2068. </p>
  2069. <p><var>outname</var> is used to set the name of the file to use for standard
  2070. output. There are two cases in which no output file will be used:
  2071. </p>
  2072. <ol>
  2073. <li> if <code>PEX_LAST</code> is not set in <var>flags</var>, and <code>PEX_USE_PIPES</code>
  2074. was set in the call to <code>pex_init</code>, and the system supports pipes
  2075. </li><li> if <code>PEX_LAST</code> is set in <var>flags</var>, and <var>outname</var> is
  2076. <code>NULL</code>
  2077. </li></ol>
  2078. <p>Otherwise the code will use a file to hold standard
  2079. output. If <code>PEX_LAST</code> is not set, this file is considered to be
  2080. a temporary file, and it will be removed when no longer needed, unless
  2081. <code>PEX_SAVE_TEMPS</code> was set in the call to <code>pex_init</code>.
  2082. </p>
  2083. <p>There are two cases to consider when setting the name of the file to
  2084. hold standard output.
  2085. </p>
  2086. <ol>
  2087. <li> <code>PEX_SUFFIX</code> is set in <var>flags</var>. In this case
  2088. <var>outname</var> may not be <code>NULL</code>. If the <var>tempbase</var> parameter
  2089. to <code>pex_init</code> was not <code>NULL</code>, then the output file name is
  2090. the concatenation of <var>tempbase</var> and <var>outname</var>. If
  2091. <var>tempbase</var> was <code>NULL</code>, then the output file name is a random
  2092. file name ending in <var>outname</var>.
  2093. </li><li> <code>PEX_SUFFIX</code> was not set in <var>flags</var>. In this
  2094. case, if <var>outname</var> is not <code>NULL</code>, it is used as the output
  2095. file name. If <var>outname</var> is <code>NULL</code>, and <var>tempbase</var> was
  2096. not NULL, the output file name is randomly chosen using
  2097. <var>tempbase</var>. Otherwise the output file name is chosen completely
  2098. at random.
  2099. </li></ol>
  2100. <p><var>errname</var> is the file name to use for standard error output. If
  2101. it is <code>NULL</code>, standard error is the same as the caller&rsquo;s.
  2102. Otherwise, standard error is written to the named file.
  2103. </p>
  2104. <p>On an error return, the code sets <code>*<var>err</var></code> to an <code>errno</code>
  2105. value, or to 0 if there is no relevant <code>errno</code>.
  2106. </p>
  2107. </dd></dl>
  2108. <dl>
  2109. <dt><a name="index-pex_005frun_005fin_005fenvironment"></a>Extension: <em>const char *</em> <strong>pex_run_in_environment</strong> <em>(struct pex_obj *<var>obj</var>, int <var>flags</var>, const char *<var>executable</var>, char * const *<var>argv</var>, char * const *<var>env</var>, int <var>env_size</var>, const char *<var>outname</var>, const char *<var>errname</var>, int *<var>err</var>)</em></dt>
  2110. <dd>
  2111. <p>Execute one program in a pipeline, permitting the environment for the
  2112. program to be specified. Behaviour and parameters not listed below are
  2113. as for <code>pex_run</code>.
  2114. </p>
  2115. <p><var>env</var> is the environment for the child process, specified as an array of
  2116. character pointers. Each element of the array should point to a string of the
  2117. form <code>VAR=VALUE</code>, with the exception of the last element that must be
  2118. <code>NULL</code>.
  2119. </p>
  2120. </dd></dl>
  2121. <dl>
  2122. <dt><a name="index-pexecute"></a>Extension: <em>int</em> <strong>pexecute</strong> <em>(const char *<var>program</var>, char * const *<var>argv</var>, const char *<var>this_pname</var>, const char *<var>temp_base</var>, char **<var>errmsg_fmt</var>, char **<var>errmsg_arg</var>, int <var>flags</var>)</em></dt>
  2123. <dd>
  2124. <p>This is the old interface to execute one or more programs. It is
  2125. still supported for compatibility purposes, but is no longer
  2126. documented.
  2127. </p>
  2128. </dd></dl>
  2129. <dl>
  2130. <dt><a name="index-psignal"></a>Supplemental: <em>void</em> <strong>psignal</strong> <em>(int <var>signo</var>, char *<var>message</var>)</em></dt>
  2131. <dd>
  2132. <p>Print <var>message</var> to the standard error, followed by a colon,
  2133. followed by the description of the signal specified by <var>signo</var>,
  2134. followed by a newline.
  2135. </p>
  2136. </dd></dl>
  2137. <dl>
  2138. <dt><a name="index-putenv"></a>Supplemental: <em>int</em> <strong>putenv</strong> <em>(const char *<var>string</var>)</em></dt>
  2139. <dd>
  2140. <p>Uses <code>setenv</code> or <code>unsetenv</code> to put <var>string</var> into
  2141. the environment or remove it. If <var>string</var> is of the form
  2142. &lsquo;<samp>name=value</samp>&rsquo; the string is added; if no &lsquo;<samp>=</samp>&rsquo; is present the
  2143. name is unset/removed.
  2144. </p>
  2145. </dd></dl>
  2146. <dl>
  2147. <dt><a name="index-pwait"></a>Extension: <em>int</em> <strong>pwait</strong> <em>(int <var>pid</var>, int *<var>status</var>, int <var>flags</var>)</em></dt>
  2148. <dd>
  2149. <p>Another part of the old execution interface.
  2150. </p>
  2151. </dd></dl>
  2152. <dl>
  2153. <dt><a name="index-random"></a>Supplement: <em>long int</em> <strong>random</strong> <em>(void)</em></dt>
  2154. <dt><a name="index-srandom"></a>Supplement: <em>void</em> <strong>srandom</strong> <em>(unsigned int <var>seed</var>)</em></dt>
  2155. <dt><a name="index-initstate"></a>Supplement: <em>void*</em> <strong>initstate</strong> <em>(unsigned int <var>seed</var>, void *<var>arg_state</var>, unsigned long <var>n</var>)</em></dt>
  2156. <dt><a name="index-setstate"></a>Supplement: <em>void*</em> <strong>setstate</strong> <em>(void *<var>arg_state</var>)</em></dt>
  2157. <dd>
  2158. <p>Random number functions. <code>random</code> returns a random number in the
  2159. range 0 to <code>LONG_MAX</code>. <code>srandom</code> initializes the random
  2160. number generator to some starting point determined by <var>seed</var>
  2161. (else, the values returned by <code>random</code> are always the same for each
  2162. run of the program). <code>initstate</code> and <code>setstate</code> allow fine-grained
  2163. control over the state of the random number generator.
  2164. </p>
  2165. </dd></dl>
  2166. <dl>
  2167. <dt><a name="index-reconcat"></a>Extension: <em>char*</em> <strong>reconcat</strong> <em>(char *<var>optr</var>, const char *<var>s1</var>, &hellip;, <code>NULL</code>)</em></dt>
  2168. <dd>
  2169. <p>Same as <code>concat</code>, except that if <var>optr</var> is not <code>NULL</code> it
  2170. is freed after the string is created. This is intended to be useful
  2171. when you&rsquo;re extending an existing string or building up a string in a
  2172. loop:
  2173. </p>
  2174. <div class="example">
  2175. <pre class="example"> str = reconcat (str, &quot;pre-&quot;, str, NULL);
  2176. </pre></div>
  2177. </dd></dl>
  2178. <dl>
  2179. <dt><a name="index-rename"></a>Supplemental: <em>int</em> <strong>rename</strong> <em>(const char *<var>old</var>, const char *<var>new</var>)</em></dt>
  2180. <dd>
  2181. <p>Renames a file from <var>old</var> to <var>new</var>. If <var>new</var> already
  2182. exists, it is removed.
  2183. </p>
  2184. </dd></dl>
  2185. <dl>
  2186. <dt><a name="index-rindex"></a>Supplemental: <em>char*</em> <strong>rindex</strong> <em>(const char *<var>s</var>, int <var>c</var>)</em></dt>
  2187. <dd>
  2188. <p>Returns a pointer to the last occurrence of the character <var>c</var> in
  2189. the string <var>s</var>, or <code>NULL</code> if not found. The use of <code>rindex</code> is
  2190. deprecated in new programs in favor of <code>strrchr</code>.
  2191. </p>
  2192. </dd></dl>
  2193. <dl>
  2194. <dt><a name="index-setenv"></a>Supplemental: <em>int</em> <strong>setenv</strong> <em>(const char *<var>name</var>, const char *<var>value</var>, int <var>overwrite</var>)</em></dt>
  2195. <dt><a name="index-unsetenv"></a>Supplemental: <em>void</em> <strong>unsetenv</strong> <em>(const char *<var>name</var>)</em></dt>
  2196. <dd>
  2197. <p><code>setenv</code> adds <var>name</var> to the environment with value
  2198. <var>value</var>. If the name was already present in the environment,
  2199. the new value will be stored only if <var>overwrite</var> is nonzero.
  2200. The companion <code>unsetenv</code> function removes <var>name</var> from the
  2201. environment. This implementation is not safe for multithreaded code.
  2202. </p>
  2203. </dd></dl>
  2204. <dl>
  2205. <dt><a name="index-setproctitle"></a>Supplemental: <em>void</em> <strong>setproctitle</strong> <em>(const char *<var>fmt</var>, ...)</em></dt>
  2206. <dd>
  2207. <p>Set the title of a process to <var>fmt</var>. va args not supported for now,
  2208. but defined for compatibility with BSD.
  2209. </p>
  2210. </dd></dl>
  2211. <dl>
  2212. <dt><a name="index-signo_005fmax"></a>Extension: <em>int</em> <strong>signo_max</strong> <em>(void)</em></dt>
  2213. <dd>
  2214. <p>Returns the maximum signal value for which a corresponding symbolic
  2215. name or message is available. Note that in the case where we use the
  2216. <code>sys_siglist</code> supplied by the system, it is possible for there to
  2217. be more symbolic names than messages, or vice versa. In fact, the
  2218. manual page for <code>psignal(3b)</code> explicitly warns that one should
  2219. check the size of the table (<code>NSIG</code>) before indexing it, since
  2220. new signal codes may be added to the system before they are added to
  2221. the table. Thus <code>NSIG</code> might be smaller than value implied by
  2222. the largest signo value defined in <code>&lt;signal.h&gt;</code>.
  2223. </p>
  2224. <p>We return the maximum value that can be used to obtain a meaningful
  2225. symbolic name or message.
  2226. </p>
  2227. </dd></dl>
  2228. <dl>
  2229. <dt><a name="index-sigsetmask"></a>Supplemental: <em>int</em> <strong>sigsetmask</strong> <em>(int <var>set</var>)</em></dt>
  2230. <dd>
  2231. <p>Sets the signal mask to the one provided in <var>set</var> and returns
  2232. the old mask (which, for libiberty&rsquo;s implementation, will always
  2233. be the value <code>1</code>).
  2234. </p>
  2235. </dd></dl>
  2236. <dl>
  2237. <dt><a name="index-simple_005fobject_005fattributes_005fcompare"></a>Extension: <em>const char *</em> <strong>simple_object_attributes_compare</strong> <em>(simple_object_attributes *<var>attrs1</var>, simple_object_attributes *<var>attrs2</var>, int *<var>err</var>)</em></dt>
  2238. <dd>
  2239. <p>Compare <var>attrs1</var> and <var>attrs2</var>. If they could be linked
  2240. together without error, return <code>NULL</code>. Otherwise, return an
  2241. error message and set <code>*<var>err</var></code> to an errno value or <code>0</code>
  2242. if there is no relevant errno.
  2243. </p>
  2244. </dd></dl>
  2245. <dl>
  2246. <dt><a name="index-simple_005fobject_005ffetch_005fattributes"></a>Extension: <em>simple_object_attributes *</em> <strong>simple_object_fetch_attributes</strong> <em>(simple_object_read *<var>simple_object</var>, const char **<var>errmsg</var>, int *<var>err</var>)</em></dt>
  2247. <dd>
  2248. <p>Fetch the attributes of <var>simple_object</var>. The attributes are
  2249. internal information such as the format of the object file, or the
  2250. architecture it was compiled for. This information will persist until
  2251. <code>simple_object_attributes_release</code> is called, even if
  2252. <var>simple_object</var> itself is released.
  2253. </p>
  2254. <p>On error this returns <code>NULL</code>, sets <code>*<var>errmsg</var></code> to an
  2255. error message, and sets <code>*<var>err</var></code> to an errno value or
  2256. <code>0</code> if there is no relevant errno.
  2257. </p>
  2258. </dd></dl>
  2259. <dl>
  2260. <dt><a name="index-simple_005fobject_005ffind_005fsection"></a>Extension: <em>int</em> <strong>simple_object_find_section</strong> <em>(simple_object_read *<var>simple_object</var> off_t *<var>offset</var>, off_t *<var>length</var>, const char **<var>errmsg</var>, int *<var>err</var>)</em></dt>
  2261. <dd>
  2262. <p>Look for the section <var>name</var> in <var>simple_object</var>. This returns
  2263. information for the first section with that name.
  2264. </p>
  2265. <p>If found, return 1 and set <code>*<var>offset</var></code> to the offset in the
  2266. file of the section contents and set <code>*<var>length</var></code> to the
  2267. length of the section contents. The value in <code>*<var>offset</var></code>
  2268. will be relative to the offset passed to
  2269. <code>simple_object_open_read</code>.
  2270. </p>
  2271. <p>If the section is not found, and no error occurs,
  2272. <code>simple_object_find_section</code> returns <code>0</code> and set
  2273. <code>*<var>errmsg</var></code> to <code>NULL</code>.
  2274. </p>
  2275. <p>If an error occurs, <code>simple_object_find_section</code> returns
  2276. <code>0</code>, sets <code>*<var>errmsg</var></code> to an error message, and sets
  2277. <code>*<var>err</var></code> to an errno value or <code>0</code> if there is no
  2278. relevant errno.
  2279. </p>
  2280. </dd></dl>
  2281. <dl>
  2282. <dt><a name="index-simple_005fobject_005ffind_005fsections"></a>Extension: <em>const char *</em> <strong>simple_object_find_sections</strong> <em>(simple_object_read *<var>simple_object</var>, int (*<var>pfn</var>) (void *<var>data</var>, const char *<var>name</var>, off_t <var>offset</var>, off_t <var>length</var>), void *<var>data</var>, int *<var>err</var>)</em></dt>
  2283. <dd>
  2284. <p>This function calls <var>pfn</var> for each section in <var>simple_object</var>.
  2285. It calls <var>pfn</var> with the section name, the offset within the file
  2286. of the section contents, and the length of the section contents. The
  2287. offset within the file is relative to the offset passed to
  2288. <code>simple_object_open_read</code>. The <var>data</var> argument to this
  2289. function is passed along to <var>pfn</var>.
  2290. </p>
  2291. <p>If <var>pfn</var> returns <code>0</code>, the loop over the sections stops and
  2292. <code>simple_object_find_sections</code> returns. If <var>pfn</var> returns some
  2293. other value, the loop continues.
  2294. </p>
  2295. <p>On success <code>simple_object_find_sections</code> returns. On error it
  2296. returns an error string, and sets <code>*<var>err</var></code> to an errno value
  2297. or <code>0</code> if there is no relevant errno.
  2298. </p>
  2299. </dd></dl>
  2300. <dl>
  2301. <dt><a name="index-simple_005fobject_005fopen_005fread"></a>Extension: <em>simple_object_read *</em> <strong>simple_object_open_read</strong> <em>(int <var>descriptor</var>, off_t <var>offset</var>, const char *segment_name, const char **<var>errmsg</var>, int *<var>err</var>)</em></dt>
  2302. <dd>
  2303. <p>Opens an object file for reading. Creates and returns an
  2304. <code>simple_object_read</code> pointer which may be passed to other
  2305. functions to extract data from the object file.
  2306. </p>
  2307. <p><var>descriptor</var> holds a file descriptor which permits reading.
  2308. </p>
  2309. <p><var>offset</var> is the offset into the file; this will be <code>0</code> in the
  2310. normal case, but may be a different value when reading an object file
  2311. in an archive file.
  2312. </p>
  2313. <p><var>segment_name</var> is only used with the Mach-O file format used on
  2314. Darwin aka Mac OS X. It is required on that platform, and means to
  2315. only look at sections within the segment with that name. The
  2316. parameter is ignored on other systems.
  2317. </p>
  2318. <p>If an error occurs, this functions returns <code>NULL</code> and sets
  2319. <code>*<var>errmsg</var></code> to an error string and sets <code>*<var>err</var></code> to
  2320. an errno value or <code>0</code> if there is no relevant errno.
  2321. </p>
  2322. </dd></dl>
  2323. <dl>
  2324. <dt><a name="index-simple_005fobject_005frelease_005fattributes"></a>Extension: <em>void</em> <strong>simple_object_release_attributes</strong> <em>(simple_object_attributes *<var>attrs</var>)</em></dt>
  2325. <dd>
  2326. <p>Release all resources associated with <var>attrs</var>.
  2327. </p>
  2328. </dd></dl>
  2329. <dl>
  2330. <dt><a name="index-simple_005fobject_005frelease_005fread"></a>Extension: <em>void</em> <strong>simple_object_release_read</strong> <em>(simple_object_read *<var>simple_object</var>)</em></dt>
  2331. <dd>
  2332. <p>Release all resources associated with <var>simple_object</var>. This does
  2333. not close the file descriptor.
  2334. </p>
  2335. </dd></dl>
  2336. <dl>
  2337. <dt><a name="index-simple_005fobject_005frelease_005fwrite"></a>Extension: <em>void</em> <strong>simple_object_release_write</strong> <em>(simple_object_write *<var>simple_object</var>)</em></dt>
  2338. <dd>
  2339. <p>Release all resources associated with <var>simple_object</var>.
  2340. </p>
  2341. </dd></dl>
  2342. <dl>
  2343. <dt><a name="index-simple_005fobject_005fstart_005fwrite"></a>Extension: <em>simple_object_write *</em> <strong>simple_object_start_write</strong> <em>(simple_object_attributes <var>attrs</var>, const char *<var>segment_name</var>, const char **<var>errmsg</var>, int *<var>err</var>)</em></dt>
  2344. <dd>
  2345. <p>Start creating a new object file using the object file format
  2346. described in <var>attrs</var>. You must fetch attribute information from
  2347. an existing object file before you can create a new one. There is
  2348. currently no support for creating an object file de novo.
  2349. </p>
  2350. <p><var>segment_name</var> is only used with Mach-O as found on Darwin aka Mac
  2351. OS X. The parameter is required on that target. It means that all
  2352. sections are created within the named segment. It is ignored for
  2353. other object file formats.
  2354. </p>
  2355. <p>On error <code>simple_object_start_write</code> returns <code>NULL</code>, sets
  2356. <code>*<var>ERRMSG</var></code> to an error message, and sets <code>*<var>err</var></code>
  2357. to an errno value or <code>0</code> if there is no relevant errno.
  2358. </p>
  2359. </dd></dl>
  2360. <dl>
  2361. <dt><a name="index-simple_005fobject_005fwrite_005fadd_005fdata"></a>Extension: <em>const char *</em> <strong>simple_object_write_add_data</strong> <em>(simple_object_write *<var>simple_object</var>, simple_object_write_section *<var>section</var>, const void *<var>buffer</var>, size_t <var>size</var>, int <var>copy</var>, int *<var>err</var>)</em></dt>
  2362. <dd>
  2363. <p>Add data <var>buffer</var>/<var>size</var> to <var>section</var> in
  2364. <var>simple_object</var>. If <var>copy</var> is non-zero, the data will be
  2365. copied into memory if necessary. If <var>copy</var> is zero, <var>buffer</var>
  2366. must persist until <code>simple_object_write_to_file</code> is called. is
  2367. released.
  2368. </p>
  2369. <p>On success this returns <code>NULL</code>. On error this returns an error
  2370. message, and sets <code>*<var>err</var></code> to an errno value or 0 if there is
  2371. no relevant erro.
  2372. </p>
  2373. </dd></dl>
  2374. <dl>
  2375. <dt><a name="index-simple_005fobject_005fwrite_005fcreate_005fsection"></a>Extension: <em>simple_object_write_section *</em> <strong>simple_object_write_create_section</strong> <em>(simple_object_write *<var>simple_object</var>, const char *<var>name</var>, unsigned int <var>align</var>, const char **<var>errmsg</var>, int *<var>err</var>)</em></dt>
  2376. <dd>
  2377. <p>Add a section to <var>simple_object</var>. <var>name</var> is the name of the
  2378. new section. <var>align</var> is the required alignment expressed as the
  2379. number of required low-order 0 bits (e.g., 2 for alignment to a 32-bit
  2380. boundary).
  2381. </p>
  2382. <p>The section is created as containing data, readable, not writable, not
  2383. executable, not loaded at runtime. The section is not written to the
  2384. file until <code>simple_object_write_to_file</code> is called.
  2385. </p>
  2386. <p>On error this returns <code>NULL</code>, sets <code>*<var>errmsg</var></code> to an
  2387. error message, and sets <code>*<var>err</var></code> to an errno value or
  2388. <code>0</code> if there is no relevant errno.
  2389. </p>
  2390. </dd></dl>
  2391. <dl>
  2392. <dt><a name="index-simple_005fobject_005fwrite_005fto_005ffile"></a>Extension: <em>const char *</em> <strong>simple_object_write_to_file</strong> <em>(simple_object_write *<var>simple_object</var>, int <var>descriptor</var>, int *<var>err</var>)</em></dt>
  2393. <dd>
  2394. <p>Write the complete object file to <var>descriptor</var>, an open file
  2395. descriptor. This writes out all the data accumulated by calls to
  2396. <code>simple_object_write_create_section</code> and
  2397. <var>simple_object_write_add_data</var>.
  2398. </p>
  2399. <p>This returns <code>NULL</code> on success. On error this returns an error
  2400. message and sets <code>*<var>err</var></code> to an errno value or <code>0</code> if
  2401. there is no relevant errno.
  2402. </p>
  2403. </dd></dl>
  2404. <dl>
  2405. <dt><a name="index-snprintf"></a>Supplemental: <em>int</em> <strong>snprintf</strong> <em>(char *<var>buf</var>, size_t <var>n</var>, const char *<var>format</var>, ...)</em></dt>
  2406. <dd>
  2407. <p>This function is similar to <code>sprintf</code>, but it will write to
  2408. <var>buf</var> at most <code><var>n</var>-1</code> bytes of text, followed by a
  2409. terminating null byte, for a total of <var>n</var> bytes.
  2410. On error the return value is -1, otherwise it returns the number of
  2411. bytes, not including the terminating null byte, that would have been
  2412. written had <var>n</var> been sufficiently large, regardless of the actual
  2413. value of <var>n</var>. Note some pre-C99 system libraries do not implement
  2414. this correctly so users cannot generally rely on the return value if
  2415. the system version of this function is used.
  2416. </p>
  2417. </dd></dl>
  2418. <dl>
  2419. <dt><a name="index-spaces"></a>Extension: <em>char*</em> <strong>spaces</strong> <em>(int <var>count</var>)</em></dt>
  2420. <dd>
  2421. <p>Returns a pointer to a memory region filled with the specified
  2422. number of spaces and null terminated. The returned pointer is
  2423. valid until at least the next call.
  2424. </p>
  2425. </dd></dl>
  2426. <dl>
  2427. <dt><a name="index-splay_005ftree_005fnew_005fwith_005ftyped_005falloc"></a>Supplemental: <em>splay_tree</em> <strong>splay_tree_new_with_typed_alloc</strong> <em>(splay_tree_compare_fn <var>compare_fn</var>, splay_tree_delete_key_fn <var>delete_key_fn</var>, splay_tree_delete_value_fn <var>delete_value_fn</var>, splay_tree_allocate_fn <var>tree_allocate_fn</var>, splay_tree_allocate_fn <var>node_allocate_fn</var>, splay_tree_deallocate_fn <var>deallocate_fn</var>, void * <var>allocate_data</var>)</em></dt>
  2428. <dd>
  2429. <p>This function creates a splay tree that uses two different allocators
  2430. <var>tree_allocate_fn</var> and <var>node_allocate_fn</var> to use for allocating the
  2431. tree itself and its nodes respectively. This is useful when variables of
  2432. different types need to be allocated with different allocators.
  2433. </p>
  2434. <p>The splay tree will use <var>compare_fn</var> to compare nodes,
  2435. <var>delete_key_fn</var> to deallocate keys, and <var>delete_value_fn</var> to
  2436. deallocate values. Keys and values will be deallocated when the
  2437. tree is deleted using splay_tree_delete or when a node is removed
  2438. using splay_tree_remove. splay_tree_insert will release the previously
  2439. inserted key and value using <var>delete_key_fn</var> and <var>delete_value_fn</var>
  2440. if the inserted key is already found in the tree.
  2441. </p>
  2442. </dd></dl>
  2443. <dl>
  2444. <dt><a name="index-stack_005flimit_005fincrease"></a>Extension: <em>void</em> <strong>stack_limit_increase</strong> <em>(unsigned long <var>pref</var>)</em></dt>
  2445. <dd>
  2446. <p>Attempt to increase stack size limit to <var>pref</var> bytes if possible.
  2447. </p>
  2448. </dd></dl>
  2449. <dl>
  2450. <dt><a name="index-stpcpy"></a>Supplemental: <em>char*</em> <strong>stpcpy</strong> <em>(char *<var>dst</var>, const char *<var>src</var>)</em></dt>
  2451. <dd>
  2452. <p>Copies the string <var>src</var> into <var>dst</var>. Returns a pointer to
  2453. <var>dst</var> + strlen(<var>src</var>).
  2454. </p>
  2455. </dd></dl>
  2456. <dl>
  2457. <dt><a name="index-stpncpy"></a>Supplemental: <em>char*</em> <strong>stpncpy</strong> <em>(char *<var>dst</var>, const char *<var>src</var>, size_t <var>len</var>)</em></dt>
  2458. <dd>
  2459. <p>Copies the string <var>src</var> into <var>dst</var>, copying exactly <var>len</var>
  2460. and padding with zeros if necessary. If <var>len</var> &lt; strlen(<var>src</var>)
  2461. then return <var>dst</var> + <var>len</var>, otherwise returns <var>dst</var> +
  2462. strlen(<var>src</var>).
  2463. </p>
  2464. </dd></dl>
  2465. <dl>
  2466. <dt><a name="index-strcasecmp"></a>Supplemental: <em>int</em> <strong>strcasecmp</strong> <em>(const char *<var>s1</var>, const char *<var>s2</var>)</em></dt>
  2467. <dd>
  2468. <p>A case-insensitive <code>strcmp</code>.
  2469. </p>
  2470. </dd></dl>
  2471. <dl>
  2472. <dt><a name="index-strchr"></a>Supplemental: <em>char*</em> <strong>strchr</strong> <em>(const char *<var>s</var>, int <var>c</var>)</em></dt>
  2473. <dd>
  2474. <p>Returns a pointer to the first occurrence of the character <var>c</var> in
  2475. the string <var>s</var>, or <code>NULL</code> if not found. If <var>c</var> is itself the
  2476. null character, the results are undefined.
  2477. </p>
  2478. </dd></dl>
  2479. <dl>
  2480. <dt><a name="index-strdup"></a>Supplemental: <em>char*</em> <strong>strdup</strong> <em>(const char *<var>s</var>)</em></dt>
  2481. <dd>
  2482. <p>Returns a pointer to a copy of <var>s</var> in memory obtained from
  2483. <code>malloc</code>, or <code>NULL</code> if insufficient memory was available.
  2484. </p>
  2485. </dd></dl>
  2486. <dl>
  2487. <dt><a name="index-strerrno"></a>Replacement: <em>const char*</em> <strong>strerrno</strong> <em>(int <var>errnum</var>)</em></dt>
  2488. <dd>
  2489. <p>Given an error number returned from a system call (typically returned
  2490. in <code>errno</code>), returns a pointer to a string containing the
  2491. symbolic name of that error number, as found in <code>&lt;errno.h&gt;</code>.
  2492. </p>
  2493. <p>If the supplied error number is within the valid range of indices for
  2494. symbolic names, but no name is available for the particular error
  2495. number, then returns the string &lsquo;<samp>Error <var>num</var></samp>&rsquo;, where <var>num</var>
  2496. is the error number.
  2497. </p>
  2498. <p>If the supplied error number is not within the range of valid
  2499. indices, then returns <code>NULL</code>.
  2500. </p>
  2501. <p>The contents of the location pointed to are only guaranteed to be
  2502. valid until the next call to <code>strerrno</code>.
  2503. </p>
  2504. </dd></dl>
  2505. <dl>
  2506. <dt><a name="index-strerror"></a>Supplemental: <em>char*</em> <strong>strerror</strong> <em>(int <var>errnoval</var>)</em></dt>
  2507. <dd>
  2508. <p>Maps an <code>errno</code> number to an error message string, the contents
  2509. of which are implementation defined. On systems which have the
  2510. external variables <code>sys_nerr</code> and <code>sys_errlist</code>, these
  2511. strings will be the same as the ones used by <code>perror</code>.
  2512. </p>
  2513. <p>If the supplied error number is within the valid range of indices for
  2514. the <code>sys_errlist</code>, but no message is available for the particular
  2515. error number, then returns the string &lsquo;<samp>Error <var>num</var></samp>&rsquo;, where
  2516. <var>num</var> is the error number.
  2517. </p>
  2518. <p>If the supplied error number is not a valid index into
  2519. <code>sys_errlist</code>, returns <code>NULL</code>.
  2520. </p>
  2521. <p>The returned string is only guaranteed to be valid only until the
  2522. next call to <code>strerror</code>.
  2523. </p>
  2524. </dd></dl>
  2525. <dl>
  2526. <dt><a name="index-strncasecmp"></a>Supplemental: <em>int</em> <strong>strncasecmp</strong> <em>(const char *<var>s1</var>, const char *<var>s2</var>)</em></dt>
  2527. <dd>
  2528. <p>A case-insensitive <code>strncmp</code>.
  2529. </p>
  2530. </dd></dl>
  2531. <dl>
  2532. <dt><a name="index-strncmp"></a>Supplemental: <em>int</em> <strong>strncmp</strong> <em>(const char *<var>s1</var>, const char *<var>s2</var>, size_t <var>n</var>)</em></dt>
  2533. <dd>
  2534. <p>Compares the first <var>n</var> bytes of two strings, returning a value as
  2535. <code>strcmp</code>.
  2536. </p>
  2537. </dd></dl>
  2538. <dl>
  2539. <dt><a name="index-strndup"></a>Extension: <em>char*</em> <strong>strndup</strong> <em>(const char *<var>s</var>, size_t <var>n</var>)</em></dt>
  2540. <dd>
  2541. <p>Returns a pointer to a copy of <var>s</var> with at most <var>n</var> characters
  2542. in memory obtained from <code>malloc</code>, or <code>NULL</code> if insufficient
  2543. memory was available. The result is always NUL terminated.
  2544. </p>
  2545. </dd></dl>
  2546. <dl>
  2547. <dt><a name="index-strnlen"></a>Supplemental: <em>size_t</em> <strong>strnlen</strong> <em>(const char *<var>s</var>, size_t <var>maxlen</var>)</em></dt>
  2548. <dd>
  2549. <p>Returns the length of <var>s</var>, as with <code>strlen</code>, but never looks
  2550. past the first <var>maxlen</var> characters in the string. If there is no
  2551. &rsquo;\0&rsquo; character in the first <var>maxlen</var> characters, returns
  2552. <var>maxlen</var>.
  2553. </p>
  2554. </dd></dl>
  2555. <dl>
  2556. <dt><a name="index-strrchr"></a>Supplemental: <em>char*</em> <strong>strrchr</strong> <em>(const char *<var>s</var>, int <var>c</var>)</em></dt>
  2557. <dd>
  2558. <p>Returns a pointer to the last occurrence of the character <var>c</var> in
  2559. the string <var>s</var>, or <code>NULL</code> if not found. If <var>c</var> is itself the
  2560. null character, the results are undefined.
  2561. </p>
  2562. </dd></dl>
  2563. <dl>
  2564. <dt><a name="index-strsignal"></a>Supplemental: <em>const char *</em> <strong>strsignal</strong> <em>(int <var>signo</var>)</em></dt>
  2565. <dd>
  2566. <p>Maps an signal number to an signal message string, the contents of
  2567. which are implementation defined. On systems which have the external
  2568. variable <code>sys_siglist</code>, these strings will be the same as the
  2569. ones used by <code>psignal()</code>.
  2570. </p>
  2571. <p>If the supplied signal number is within the valid range of indices for
  2572. the <code>sys_siglist</code>, but no message is available for the particular
  2573. signal number, then returns the string &lsquo;<samp>Signal <var>num</var></samp>&rsquo;, where
  2574. <var>num</var> is the signal number.
  2575. </p>
  2576. <p>If the supplied signal number is not a valid index into
  2577. <code>sys_siglist</code>, returns <code>NULL</code>.
  2578. </p>
  2579. <p>The returned string is only guaranteed to be valid only until the next
  2580. call to <code>strsignal</code>.
  2581. </p>
  2582. </dd></dl>
  2583. <dl>
  2584. <dt><a name="index-strsigno"></a>Extension: <em>const char*</em> <strong>strsigno</strong> <em>(int <var>signo</var>)</em></dt>
  2585. <dd>
  2586. <p>Given an signal number, returns a pointer to a string containing the
  2587. symbolic name of that signal number, as found in <code>&lt;signal.h&gt;</code>.
  2588. </p>
  2589. <p>If the supplied signal number is within the valid range of indices for
  2590. symbolic names, but no name is available for the particular signal
  2591. number, then returns the string &lsquo;<samp>Signal <var>num</var></samp>&rsquo;, where
  2592. <var>num</var> is the signal number.
  2593. </p>
  2594. <p>If the supplied signal number is not within the range of valid
  2595. indices, then returns <code>NULL</code>.
  2596. </p>
  2597. <p>The contents of the location pointed to are only guaranteed to be
  2598. valid until the next call to <code>strsigno</code>.
  2599. </p>
  2600. </dd></dl>
  2601. <dl>
  2602. <dt><a name="index-strstr"></a>Supplemental: <em>char*</em> <strong>strstr</strong> <em>(const char *<var>string</var>, const char *<var>sub</var>)</em></dt>
  2603. <dd>
  2604. <p>This function searches for the substring <var>sub</var> in the string
  2605. <var>string</var>, not including the terminating null characters. A pointer
  2606. to the first occurrence of <var>sub</var> is returned, or <code>NULL</code> if the
  2607. substring is absent. If <var>sub</var> points to a string with zero
  2608. length, the function returns <var>string</var>.
  2609. </p>
  2610. </dd></dl>
  2611. <dl>
  2612. <dt><a name="index-strtod"></a>Supplemental: <em>double</em> <strong>strtod</strong> <em>(const char *<var>string</var>, char **<var>endptr</var>)</em></dt>
  2613. <dd>
  2614. <p>This ISO C function converts the initial portion of <var>string</var> to a
  2615. <code>double</code>. If <var>endptr</var> is not <code>NULL</code>, a pointer to the
  2616. character after the last character used in the conversion is stored in
  2617. the location referenced by <var>endptr</var>. If no conversion is
  2618. performed, zero is returned and the value of <var>string</var> is stored in
  2619. the location referenced by <var>endptr</var>.
  2620. </p>
  2621. </dd></dl>
  2622. <dl>
  2623. <dt><a name="index-strtoerrno"></a>Extension: <em>int</em> <strong>strtoerrno</strong> <em>(const char *<var>name</var>)</em></dt>
  2624. <dd>
  2625. <p>Given the symbolic name of a error number (e.g., <code>EACCES</code>), map it
  2626. to an errno value. If no translation is found, returns 0.
  2627. </p>
  2628. </dd></dl>
  2629. <dl>
  2630. <dt><a name="index-strtol"></a>Supplemental: <em>long int</em> <strong>strtol</strong> <em>(const char *<var>string</var>, char **<var>endptr</var>, int <var>base</var>)</em></dt>
  2631. <dt><a name="index-strtoul"></a>Supplemental: <em>unsigned long int</em> <strong>strtoul</strong> <em>(const char *<var>string</var>, char **<var>endptr</var>, int <var>base</var>)</em></dt>
  2632. <dd>
  2633. <p>The <code>strtol</code> function converts the string in <var>string</var> to a
  2634. long integer value according to the given <var>base</var>, which must be
  2635. between 2 and 36 inclusive, or be the special value 0. If <var>base</var>
  2636. is 0, <code>strtol</code> will look for the prefixes <code>0</code> and <code>0x</code>
  2637. to indicate bases 8 and 16, respectively, else default to base 10.
  2638. When the base is 16 (either explicitly or implicitly), a prefix of
  2639. <code>0x</code> is allowed. The handling of <var>endptr</var> is as that of
  2640. <code>strtod</code> above. The <code>strtoul</code> function is the same, except
  2641. that the converted value is unsigned.
  2642. </p>
  2643. </dd></dl>
  2644. <dl>
  2645. <dt><a name="index-strtoll"></a>Supplemental: <em>long long int</em> <strong>strtoll</strong> <em>(const char *<var>string</var>, char **<var>endptr</var>, int <var>base</var>)</em></dt>
  2646. <dt><a name="index-strtoul-1"></a>Supplemental: <em>unsigned long long int</em> <strong>strtoul</strong> <em>( const char *<var>string</var>, char **<var>endptr</var>, int <var>base</var>)</em></dt>
  2647. <dd>
  2648. <p>The <code>strtoll</code> function converts the string in <var>string</var> to a
  2649. long long integer value according to the given <var>base</var>, which must be
  2650. between 2 and 36 inclusive, or be the special value 0. If <var>base</var>
  2651. is 0, <code>strtoll</code> will look for the prefixes <code>0</code> and <code>0x</code>
  2652. to indicate bases 8 and 16, respectively, else default to base 10.
  2653. When the base is 16 (either explicitly or implicitly), a prefix of
  2654. <code>0x</code> is allowed. The handling of <var>endptr</var> is as that of
  2655. <code>strtod</code> above. The <code>strtoull</code> function is the same, except
  2656. that the converted value is unsigned.
  2657. </p>
  2658. </dd></dl>
  2659. <dl>
  2660. <dt><a name="index-strtosigno"></a>Extension: <em>int</em> <strong>strtosigno</strong> <em>(const char *<var>name</var>)</em></dt>
  2661. <dd>
  2662. <p>Given the symbolic name of a signal, map it to a signal number. If no
  2663. translation is found, returns 0.
  2664. </p>
  2665. </dd></dl>
  2666. <dl>
  2667. <dt><a name="index-strverscmp"></a>Function: <em>int</em> <strong>strverscmp</strong> <em>(const char *<var>s1</var>, const char *<var>s2</var>)</em></dt>
  2668. <dd><p>The <code>strverscmp</code> function compares the string <var>s1</var> against
  2669. <var>s2</var>, considering them as holding indices/version numbers. Return
  2670. value follows the same conventions as found in the <code>strverscmp</code>
  2671. function. In fact, if <var>s1</var> and <var>s2</var> contain no digits,
  2672. <code>strverscmp</code> behaves like <code>strcmp</code>.
  2673. </p>
  2674. <p>Basically, we compare strings normally (character by character), until
  2675. we find a digit in each string - then we enter a special comparison
  2676. mode, where each sequence of digits is taken as a whole. If we reach the
  2677. end of these two parts without noticing a difference, we return to the
  2678. standard comparison mode. There are two types of numeric parts:
  2679. &quot;integral&quot; and &quot;fractional&quot; (those begin with a &rsquo;0&rsquo;). The types
  2680. of the numeric parts affect the way we sort them:
  2681. </p>
  2682. <ul>
  2683. <li> integral/integral: we compare values as you would expect.
  2684. </li><li> fractional/integral: the fractional part is less than the integral one.
  2685. Again, no surprise.
  2686. </li><li> fractional/fractional: the things become a bit more complex.
  2687. If the common prefix contains only leading zeroes, the longest part is less
  2688. than the other one; else the comparison behaves normally.
  2689. </li></ul>
  2690. <div class="smallexample">
  2691. <pre class="smallexample">strverscmp (&quot;no digit&quot;, &quot;no digit&quot;)
  2692. &rArr; 0 // <span class="roman">same behavior as strcmp.</span>
  2693. strverscmp (&quot;item#99&quot;, &quot;item#100&quot;)
  2694. &rArr; &lt;0 // <span class="roman">same prefix, but 99 &lt; 100.</span>
  2695. strverscmp (&quot;alpha1&quot;, &quot;alpha001&quot;)
  2696. &rArr; &gt;0 // <span class="roman">fractional part inferior to integral one.</span>
  2697. strverscmp (&quot;part1_f012&quot;, &quot;part1_f01&quot;)
  2698. &rArr; &gt;0 // <span class="roman">two fractional parts.</span>
  2699. strverscmp (&quot;foo.009&quot;, &quot;foo.0&quot;)
  2700. &rArr; &lt;0 // <span class="roman">idem, but with leading zeroes only.</span>
  2701. </pre></div>
  2702. <p>This function is especially useful when dealing with filename sorting,
  2703. because filenames frequently hold indices/version numbers.
  2704. </p></dd></dl>
  2705. <dl>
  2706. <dt><a name="index-timeval_005fadd"></a>Extension: <em>void</em> <strong>timeval_add</strong> <em>(struct timeval *<var>a</var>, struct timeval *<var>b</var>, struct timeval *<var>result</var>)</em></dt>
  2707. <dd>
  2708. <p>Adds <var>a</var> to <var>b</var> and stores the result in <var>result</var>.
  2709. </p>
  2710. </dd></dl>
  2711. <dl>
  2712. <dt><a name="index-timeval_005fsub"></a>Extension: <em>void</em> <strong>timeval_sub</strong> <em>(struct timeval *<var>a</var>, struct timeval *<var>b</var>, struct timeval *<var>result</var>)</em></dt>
  2713. <dd>
  2714. <p>Subtracts <var>b</var> from <var>a</var> and stores the result in <var>result</var>.
  2715. </p>
  2716. </dd></dl>
  2717. <dl>
  2718. <dt><a name="index-tmpnam"></a>Supplemental: <em>char*</em> <strong>tmpnam</strong> <em>(char *<var>s</var>)</em></dt>
  2719. <dd>
  2720. <p>This function attempts to create a name for a temporary file, which
  2721. will be a valid file name yet not exist when <code>tmpnam</code> checks for
  2722. it. <var>s</var> must point to a buffer of at least <code>L_tmpnam</code> bytes,
  2723. or be <code>NULL</code>. Use of this function creates a security risk, and it must
  2724. not be used in new projects. Use <code>mkstemp</code> instead.
  2725. </p>
  2726. </dd></dl>
  2727. <dl>
  2728. <dt><a name="index-unlink_005fif_005fordinary"></a>Supplemental: <em>int</em> <strong>unlink_if_ordinary</strong> <em>(const char*)</em></dt>
  2729. <dd>
  2730. <p>Unlinks the named file, unless it is special (e.g. a device file).
  2731. Returns 0 when the file was unlinked, a negative value (and errno set) when
  2732. there was an error deleting the file, and a positive value if no attempt
  2733. was made to unlink the file because it is special.
  2734. </p>
  2735. </dd></dl>
  2736. <dl>
  2737. <dt><a name="index-unlock_005fstd_005fstreams"></a>Extension: <em>void</em> <strong>unlock_std_streams</strong> <em>(void)</em></dt>
  2738. <dd>
  2739. <p>If the OS supports it, ensure that the standard I/O streams,
  2740. <code>stdin</code>, <code>stdout</code> and <code>stderr</code> are setup to avoid any
  2741. multi-threaded locking. Otherwise do nothing.
  2742. </p>
  2743. </dd></dl>
  2744. <dl>
  2745. <dt><a name="index-unlock_005fstream"></a>Extension: <em>void</em> <strong>unlock_stream</strong> <em>(FILE * <var>stream</var>)</em></dt>
  2746. <dd>
  2747. <p>If the OS supports it, ensure that the supplied stream is setup to
  2748. avoid any multi-threaded locking. Otherwise leave the <code>FILE</code>
  2749. pointer unchanged. If the <var>stream</var> is <code>NULL</code> do nothing.
  2750. </p>
  2751. </dd></dl>
  2752. <dl>
  2753. <dt><a name="index-vasprintf"></a>Extension: <em>int</em> <strong>vasprintf</strong> <em>(char **<var>resptr</var>, const char *<var>format</var>, va_list <var>args</var>)</em></dt>
  2754. <dd>
  2755. <p>Like <code>vsprintf</code>, but instead of passing a pointer to a buffer,
  2756. you pass a pointer to a pointer. This function will compute the size
  2757. of the buffer needed, allocate memory with <code>malloc</code>, and store a
  2758. pointer to the allocated memory in <code>*<var>resptr</var></code>. The value
  2759. returned is the same as <code>vsprintf</code> would return. If memory could
  2760. not be allocated, minus one is returned and <code>NULL</code> is stored in
  2761. <code>*<var>resptr</var></code>.
  2762. </p>
  2763. </dd></dl>
  2764. <dl>
  2765. <dt><a name="index-vfork"></a>Supplemental: <em>int</em> <strong>vfork</strong> <em>(void)</em></dt>
  2766. <dd>
  2767. <p>Emulates <code>vfork</code> by calling <code>fork</code> and returning its value.
  2768. </p>
  2769. </dd></dl>
  2770. <dl>
  2771. <dt><a name="index-vprintf"></a>Supplemental: <em>int</em> <strong>vprintf</strong> <em>(const char *<var>format</var>, va_list <var>ap</var>)</em></dt>
  2772. <dt><a name="index-vfprintf"></a>Supplemental: <em>int</em> <strong>vfprintf</strong> <em>(FILE *<var>stream</var>, const char *<var>format</var>, va_list <var>ap</var>)</em></dt>
  2773. <dt><a name="index-vsprintf"></a>Supplemental: <em>int</em> <strong>vsprintf</strong> <em>(char *<var>str</var>, const char *<var>format</var>, va_list <var>ap</var>)</em></dt>
  2774. <dd>
  2775. <p>These functions are the same as <code>printf</code>, <code>fprintf</code>, and
  2776. <code>sprintf</code>, respectively, except that they are called with a
  2777. <code>va_list</code> instead of a variable number of arguments. Note that
  2778. they do not call <code>va_end</code>; this is the application&rsquo;s
  2779. responsibility. In <code>libiberty</code> they are implemented in terms of the
  2780. nonstandard but common function <code>_doprnt</code>.
  2781. </p>
  2782. </dd></dl>
  2783. <dl>
  2784. <dt><a name="index-vsnprintf"></a>Supplemental: <em>int</em> <strong>vsnprintf</strong> <em>(char *<var>buf</var>, size_t <var>n</var>, const char *<var>format</var>, va_list <var>ap</var>)</em></dt>
  2785. <dd>
  2786. <p>This function is similar to <code>vsprintf</code>, but it will write to
  2787. <var>buf</var> at most <code><var>n</var>-1</code> bytes of text, followed by a
  2788. terminating null byte, for a total of <var>n</var> bytes. On error the
  2789. return value is -1, otherwise it returns the number of characters that
  2790. would have been printed had <var>n</var> been sufficiently large,
  2791. regardless of the actual value of <var>n</var>. Note some pre-C99 system
  2792. libraries do not implement this correctly so users cannot generally
  2793. rely on the return value if the system version of this function is
  2794. used.
  2795. </p>
  2796. </dd></dl>
  2797. <dl>
  2798. <dt><a name="index-waitpid"></a>Supplemental: <em>int</em> <strong>waitpid</strong> <em>(int <var>pid</var>, int *<var>status</var>, int)</em></dt>
  2799. <dd>
  2800. <p>This is a wrapper around the <code>wait</code> function. Any &ldquo;special&rdquo;
  2801. values of <var>pid</var> depend on your implementation of <code>wait</code>, as
  2802. does the return value. The third argument is unused in <code>libiberty</code>.
  2803. </p>
  2804. </dd></dl>
  2805. <dl>
  2806. <dt><a name="index-writeargv"></a>Extension: <em>int</em> <strong>writeargv</strong> <em>(char * const *<var>argv</var>, FILE *<var>file</var>)</em></dt>
  2807. <dd>
  2808. <p>Write each member of ARGV, handling all necessary quoting, to the file
  2809. named by FILE, separated by whitespace. Return 0 on success, non-zero
  2810. if an error occurred while writing to FILE.
  2811. </p>
  2812. </dd></dl>
  2813. <dl>
  2814. <dt><a name="index-xasprintf"></a>Replacement: <em>char*</em> <strong>xasprintf</strong> <em>(const char *<var>format</var>, ...)</em></dt>
  2815. <dd>
  2816. <p>Print to allocated string without fail. If <code>xasprintf</code> fails,
  2817. this will print a message to <code>stderr</code> (using the name set by
  2818. <code>xmalloc_set_program_name</code>, if any) and then call <code>xexit</code>.
  2819. </p>
  2820. </dd></dl>
  2821. <dl>
  2822. <dt><a name="index-xatexit"></a>Function: <em>int</em> <strong>xatexit</strong> <em>(void (*<var>fn</var>) (void))</em></dt>
  2823. <dd>
  2824. <p>Behaves as the standard <code>atexit</code> function, but with no limit on
  2825. the number of registered functions. Returns 0 on success, or -1 on
  2826. failure. If you use <code>xatexit</code> to register functions, you must use
  2827. <code>xexit</code> to terminate your program.
  2828. </p>
  2829. </dd></dl>
  2830. <dl>
  2831. <dt><a name="index-xcalloc"></a>Replacement: <em>void*</em> <strong>xcalloc</strong> <em>(size_t <var>nelem</var>, size_t <var>elsize</var>)</em></dt>
  2832. <dd>
  2833. <p>Allocate memory without fail, and set it to zero. This routine functions
  2834. like <code>calloc</code>, but will behave the same as <code>xmalloc</code> if memory
  2835. cannot be found.
  2836. </p>
  2837. </dd></dl>
  2838. <dl>
  2839. <dt><a name="index-xexit"></a>Replacement: <em>void</em> <strong>xexit</strong> <em>(int <var>code</var>)</em></dt>
  2840. <dd>
  2841. <p>Terminates the program. If any functions have been registered with
  2842. the <code>xatexit</code> replacement function, they will be called first.
  2843. Termination is handled via the system&rsquo;s normal <code>exit</code> call.
  2844. </p>
  2845. </dd></dl>
  2846. <dl>
  2847. <dt><a name="index-xmalloc"></a>Replacement: <em>void*</em> <strong>xmalloc</strong> <em>(size_t)</em></dt>
  2848. <dd>
  2849. <p>Allocate memory without fail. If <code>malloc</code> fails, this will print
  2850. a message to <code>stderr</code> (using the name set by
  2851. <code>xmalloc_set_program_name</code>,
  2852. if any) and then call <code>xexit</code>. Note that it is therefore safe for
  2853. a program to contain <code>#define malloc xmalloc</code> in its source.
  2854. </p>
  2855. </dd></dl>
  2856. <dl>
  2857. <dt><a name="index-xmalloc_005ffailed"></a>Replacement: <em>void</em> <strong>xmalloc_failed</strong> <em>(size_t)</em></dt>
  2858. <dd>
  2859. <p>This function is not meant to be called by client code, and is listed
  2860. here for completeness only. If any of the allocation routines fail, this
  2861. function will be called to print an error message and terminate execution.
  2862. </p>
  2863. </dd></dl>
  2864. <dl>
  2865. <dt><a name="index-xmalloc_005fset_005fprogram_005fname"></a>Replacement: <em>void</em> <strong>xmalloc_set_program_name</strong> <em>(const char *<var>name</var>)</em></dt>
  2866. <dd>
  2867. <p>You can use this to set the name of the program used by
  2868. <code>xmalloc_failed</code> when printing a failure message.
  2869. </p>
  2870. </dd></dl>
  2871. <dl>
  2872. <dt><a name="index-xmemdup"></a>Replacement: <em>void*</em> <strong>xmemdup</strong> <em>(void *<var>input</var>, size_t <var>copy_size</var>, size_t <var>alloc_size</var>)</em></dt>
  2873. <dd>
  2874. <p>Duplicates a region of memory without fail. First, <var>alloc_size</var> bytes
  2875. are allocated, then <var>copy_size</var> bytes from <var>input</var> are copied into
  2876. it, and the new memory is returned. If fewer bytes are copied than were
  2877. allocated, the remaining memory is zeroed.
  2878. </p>
  2879. </dd></dl>
  2880. <dl>
  2881. <dt><a name="index-xrealloc"></a>Replacement: <em>void*</em> <strong>xrealloc</strong> <em>(void *<var>ptr</var>, size_t <var>size</var>)</em></dt>
  2882. <dd><p>Reallocate memory without fail. This routine functions like <code>realloc</code>,
  2883. but will behave the same as <code>xmalloc</code> if memory cannot be found.
  2884. </p>
  2885. </dd></dl>
  2886. <dl>
  2887. <dt><a name="index-xstrdup"></a>Replacement: <em>char*</em> <strong>xstrdup</strong> <em>(const char *<var>s</var>)</em></dt>
  2888. <dd>
  2889. <p>Duplicates a character string without fail, using <code>xmalloc</code> to
  2890. obtain memory.
  2891. </p>
  2892. </dd></dl>
  2893. <dl>
  2894. <dt><a name="index-xstrerror"></a>Replacement: <em>char*</em> <strong>xstrerror</strong> <em>(int <var>errnum</var>)</em></dt>
  2895. <dd>
  2896. <p>Behaves exactly like the standard <code>strerror</code> function, but
  2897. will never return a <code>NULL</code> pointer.
  2898. </p>
  2899. </dd></dl>
  2900. <dl>
  2901. <dt><a name="index-xstrndup"></a>Replacement: <em>char*</em> <strong>xstrndup</strong> <em>(const char *<var>s</var>, size_t <var>n</var>)</em></dt>
  2902. <dd>
  2903. <p>Returns a pointer to a copy of <var>s</var> with at most <var>n</var> characters
  2904. without fail, using <code>xmalloc</code> to obtain memory. The result is
  2905. always NUL terminated.
  2906. </p>
  2907. </dd></dl>
  2908. <dl>
  2909. <dt><a name="index-xvasprintf"></a>Replacement: <em>char*</em> <strong>xvasprintf</strong> <em>(const char *<var>format</var>, va_list <var>args</var>)</em></dt>
  2910. <dd>
  2911. <p>Print to allocated string without fail. If <code>xvasprintf</code> fails,
  2912. this will print a message to <code>stderr</code> (using the name set by
  2913. <code>xmalloc_set_program_name</code>, if any) and then call <code>xexit</code>.
  2914. </p>
  2915. </dd></dl>
  2916. <hr>
  2917. <a name="Licenses"></a>
  2918. <div class="header">
  2919. <p>
  2920. Next: <a href="#Index" accesskey="n" rel="next">Index</a>, Previous: <a href="#Functions" accesskey="p" rel="prev">Functions</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  2921. </div>
  2922. <a name="Licenses-1"></a>
  2923. <h2 class="appendix">Appendix A Licenses</h2>
  2924. <table class="menu" border="0" cellspacing="0">
  2925. <tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
  2926. </pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Library-Copying" accesskey="1">Library Copying</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">The GNU Library General Public License
  2927. </td></tr>
  2928. <tr><td align="left" valign="top">&bull; <a href="#BSD" accesskey="2">BSD</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Regents of the University of California
  2929. </td></tr>
  2930. <tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
  2931. </pre></th></tr></table>
  2932. <hr>
  2933. <a name="Library-Copying"></a>
  2934. <div class="header">
  2935. <p>
  2936. Next: <a href="#BSD" accesskey="n" rel="next">BSD</a>, Up: <a href="#Licenses" accesskey="u" rel="up">Licenses</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  2937. </div>
  2938. <a name="GNU-LESSER-GENERAL-PUBLIC-LICENSE"></a>
  2939. <h3 class="appendixsec">A.1 GNU LESSER GENERAL PUBLIC LICENSE</h3>
  2940. <a name="index-LGPL_002c-Lesser-General-Public-License"></a>
  2941. <div align="center">Version 2.1, February 1999
  2942. </div>
  2943. <div class="display">
  2944. <pre class="display">Copyright &copy; 1991-2020 Free Software Foundation, Inc.
  2945. 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA
  2946. Everyone is permitted to copy and distribute verbatim copies
  2947. of this license document, but changing it is not allowed.
  2948. [This is the first released version of the Lesser GPL. It also counts
  2949. as the successor of the GNU Library Public License, version 2, hence the
  2950. version number 2.1.]
  2951. </pre></div>
  2952. <a name="Preamble"></a>
  2953. <h4 class="appendixsubsec">A.1.1 Preamble</h4>
  2954. <p>The licenses for most software are designed to take away your
  2955. freedom to share and change it. By contrast, the GNU General Public
  2956. Licenses are intended to guarantee your freedom to share and change
  2957. free software&mdash;to make sure the software is free for all its users.
  2958. </p>
  2959. <p>This license, the Lesser General Public License, applies to some
  2960. specially designated software&mdash;typically libraries&mdash;of the Free
  2961. Software Foundation and other authors who decide to use it. You can use
  2962. it too, but we suggest you first think carefully about whether this
  2963. license or the ordinary General Public License is the better strategy to
  2964. use in any particular case, based on the explanations below.
  2965. </p>
  2966. <p>When we speak of free software, we are referring to freedom of use,
  2967. not price. Our General Public Licenses are designed to make sure that
  2968. you have the freedom to distribute copies of free software (and charge
  2969. for this service if you wish); that you receive source code or can get
  2970. it if you want it; that you can change the software and use pieces of it
  2971. in new free programs; and that you are informed that you can do these
  2972. things.
  2973. </p>
  2974. <p>To protect your rights, we need to make restrictions that forbid
  2975. distributors to deny you these rights or to ask you to surrender these
  2976. rights. These restrictions translate to certain responsibilities for
  2977. you if you distribute copies of the library or if you modify it.
  2978. </p>
  2979. <p>For example, if you distribute copies of the library, whether gratis
  2980. or for a fee, you must give the recipients all the rights that we gave
  2981. you. You must make sure that they, too, receive or can get the source
  2982. code. If you link other code with the library, you must provide
  2983. complete object files to the recipients, so that they can relink them
  2984. with the library after making changes to the library and recompiling
  2985. it. And you must show them these terms so they know their rights.
  2986. </p>
  2987. <p>We protect your rights with a two-step method: (1) we copyright the
  2988. library, and (2) we offer you this license, which gives you legal
  2989. permission to copy, distribute and/or modify the library.
  2990. </p>
  2991. <p>To protect each distributor, we want to make it very clear that
  2992. there is no warranty for the free library. Also, if the library is
  2993. modified by someone else and passed on, the recipients should know
  2994. that what they have is not the original version, so that the original
  2995. author&rsquo;s reputation will not be affected by problems that might be
  2996. introduced by others.
  2997. </p>
  2998. <p>Finally, software patents pose a constant threat to the existence of
  2999. any free program. We wish to make sure that a company cannot
  3000. effectively restrict the users of a free program by obtaining a
  3001. restrictive license from a patent holder. Therefore, we insist that
  3002. any patent license obtained for a version of the library must be
  3003. consistent with the full freedom of use specified in this license.
  3004. </p>
  3005. <p>Most GNU software, including some libraries, is covered by the
  3006. ordinary GNU General Public License. This license, the GNU Lesser
  3007. General Public License, applies to certain designated libraries, and
  3008. is quite different from the ordinary General Public License. We use
  3009. this license for certain libraries in order to permit linking those
  3010. libraries into non-free programs.
  3011. </p>
  3012. <p>When a program is linked with a library, whether statically or using
  3013. a shared library, the combination of the two is legally speaking a
  3014. combined work, a derivative of the original library. The ordinary
  3015. General Public License therefore permits such linking only if the
  3016. entire combination fits its criteria of freedom. The Lesser General
  3017. Public License permits more lax criteria for linking other code with
  3018. the library.
  3019. </p>
  3020. <p>We call this license the <em>Lesser</em> General Public License because it
  3021. does <em>Less</em> to protect the user&rsquo;s freedom than the ordinary General
  3022. Public License. It also provides other free software developers Less
  3023. of an advantage over competing non-free programs. These disadvantages
  3024. are the reason we use the ordinary General Public License for many
  3025. libraries. However, the Lesser license provides advantages in certain
  3026. special circumstances.
  3027. </p>
  3028. <p>For example, on rare occasions, there may be a special need to
  3029. encourage the widest possible use of a certain library, so that it becomes
  3030. a de-facto standard. To achieve this, non-free programs must be
  3031. allowed to use the library. A more frequent case is that a free
  3032. library does the same job as widely used non-free libraries. In this
  3033. case, there is little to gain by limiting the free library to free
  3034. software only, so we use the Lesser General Public License.
  3035. </p>
  3036. <p>In other cases, permission to use a particular library in non-free
  3037. programs enables a greater number of people to use a large body of
  3038. free software. For example, permission to use the GNU C Library in
  3039. non-free programs enables many more people to use the whole GNU
  3040. operating system, as well as its variant, the GNU/Linux operating
  3041. system.
  3042. </p>
  3043. <p>Although the Lesser General Public License is Less protective of the
  3044. users&rsquo; freedom, it does ensure that the user of a program that is
  3045. linked with the Library has the freedom and the wherewithal to run
  3046. that program using a modified version of the Library.
  3047. </p>
  3048. <p>The precise terms and conditions for copying, distribution and
  3049. modification follow. Pay close attention to the difference between a
  3050. &ldquo;work based on the library&rdquo; and a &ldquo;work that uses the library&rdquo;. The
  3051. former contains code derived from the library, whereas the latter must
  3052. be combined with the library in order to run.
  3053. </p>
  3054. <ol start="0">
  3055. <li> This License Agreement applies to any software library or other program
  3056. which contains a notice placed by the copyright holder or other
  3057. authorized party saying it may be distributed under the terms of this
  3058. Lesser General Public License (also called &ldquo;this License&rdquo;). Each
  3059. licensee is addressed as &ldquo;you&rdquo;.
  3060. <p>A &ldquo;library&rdquo; means a collection of software functions and/or data
  3061. prepared so as to be conveniently linked with application programs
  3062. (which use some of those functions and data) to form executables.
  3063. </p>
  3064. <p>The &ldquo;Library&rdquo;, below, refers to any such software library or work
  3065. which has been distributed under these terms. A &ldquo;work based on the
  3066. Library&rdquo; means either the Library or any derivative work under
  3067. copyright law: that is to say, a work containing the Library or a
  3068. portion of it, either verbatim or with modifications and/or translated
  3069. straightforwardly into another language. (Hereinafter, translation is
  3070. included without limitation in the term &ldquo;modification&rdquo;.)
  3071. </p>
  3072. <p>&ldquo;Source code&rdquo; for a work means the preferred form of the work for
  3073. making modifications to it. For a library, complete source code means
  3074. all the source code for all modules it contains, plus any associated
  3075. interface definition files, plus the scripts used to control compilation
  3076. and installation of the library.
  3077. </p>
  3078. <p>Activities other than copying, distribution and modification are not
  3079. covered by this License; they are outside its scope. The act of
  3080. running a program using the Library is not restricted, and output from
  3081. such a program is covered only if its contents constitute a work based
  3082. on the Library (independent of the use of the Library in a tool for
  3083. writing it). Whether that is true depends on what the Library does
  3084. and what the program that uses the Library does.
  3085. </p>
  3086. </li><li> You may copy and distribute verbatim copies of the Library&rsquo;s
  3087. complete source code as you receive it, in any medium, provided that
  3088. you conspicuously and appropriately publish on each copy an
  3089. appropriate copyright notice and disclaimer of warranty; keep intact
  3090. all the notices that refer to this License and to the absence of any
  3091. warranty; and distribute a copy of this License along with the
  3092. Library.
  3093. <p>You may charge a fee for the physical act of transferring a copy,
  3094. and you may at your option offer warranty protection in exchange for a
  3095. fee.
  3096. </p>
  3097. </li><li> You may modify your copy or copies of the Library or any portion
  3098. of it, thus forming a work based on the Library, and copy and
  3099. distribute such modifications or work under the terms of Section 1
  3100. above, provided that you also meet all of these conditions:
  3101. <ol type="a" start="1">
  3102. <li> The modified work must itself be a software library.
  3103. </li><li> You must cause the files modified to carry prominent notices
  3104. stating that you changed the files and the date of any change.
  3105. </li><li> You must cause the whole of the work to be licensed at no
  3106. charge to all third parties under the terms of this License.
  3107. </li><li> If a facility in the modified Library refers to a function or a
  3108. table of data to be supplied by an application program that uses
  3109. the facility, other than as an argument passed when the facility
  3110. is invoked, then you must make a good faith effort to ensure that,
  3111. in the event an application does not supply such function or
  3112. table, the facility still operates, and performs whatever part of
  3113. its purpose remains meaningful.
  3114. <p>(For example, a function in a library to compute square roots has
  3115. a purpose that is entirely well-defined independent of the
  3116. application. Therefore, Subsection 2d requires that any
  3117. application-supplied function or table used by this function must
  3118. be optional: if the application does not supply it, the square
  3119. root function must still compute square roots.)
  3120. </p></li></ol>
  3121. <p>These requirements apply to the modified work as a whole. If
  3122. identifiable sections of that work are not derived from the Library,
  3123. and can be reasonably considered independent and separate works in
  3124. themselves, then this License, and its terms, do not apply to those
  3125. sections when you distribute them as separate works. But when you
  3126. distribute the same sections as part of a whole which is a work based
  3127. on the Library, the distribution of the whole must be on the terms of
  3128. this License, whose permissions for other licensees extend to the
  3129. entire whole, and thus to each and every part regardless of who wrote
  3130. it.
  3131. </p>
  3132. <p>Thus, it is not the intent of this section to claim rights or contest
  3133. your rights to work written entirely by you; rather, the intent is to
  3134. exercise the right to control the distribution of derivative or
  3135. collective works based on the Library.
  3136. </p>
  3137. <p>In addition, mere aggregation of another work not based on the Library
  3138. with the Library (or with a work based on the Library) on a volume of
  3139. a storage or distribution medium does not bring the other work under
  3140. the scope of this License.
  3141. </p>
  3142. </li><li> You may opt to apply the terms of the ordinary GNU General Public
  3143. License instead of this License to a given copy of the Library. To do
  3144. this, you must alter all the notices that refer to this License, so
  3145. that they refer to the ordinary GNU General Public License, version 2,
  3146. instead of to this License. (If a newer version than version 2 of the
  3147. ordinary GNU General Public License has appeared, then you can specify
  3148. that version instead if you wish.) Do not make any other change in
  3149. these notices.
  3150. <p>Once this change is made in a given copy, it is irreversible for
  3151. that copy, so the ordinary GNU General Public License applies to all
  3152. subsequent copies and derivative works made from that copy.
  3153. </p>
  3154. <p>This option is useful when you wish to copy part of the code of
  3155. the Library into a program that is not a library.
  3156. </p>
  3157. </li><li> You may copy and distribute the Library (or a portion or
  3158. derivative of it, under Section 2) in object code or executable form
  3159. under the terms of Sections 1 and 2 above provided that you accompany
  3160. it with the complete corresponding machine-readable source code, which
  3161. must be distributed under the terms of Sections 1 and 2 above on a
  3162. medium customarily used for software interchange.
  3163. <p>If distribution of object code is made by offering access to copy
  3164. from a designated place, then offering equivalent access to copy the
  3165. source code from the same place satisfies the requirement to
  3166. distribute the source code, even though third parties are not
  3167. compelled to copy the source along with the object code.
  3168. </p>
  3169. </li><li> A program that contains no derivative of any portion of the
  3170. Library, but is designed to work with the Library by being compiled or
  3171. linked with it, is called a &ldquo;work that uses the Library&rdquo;. Such a
  3172. work, in isolation, is not a derivative work of the Library, and
  3173. therefore falls outside the scope of this License.
  3174. <p>However, linking a &ldquo;work that uses the Library&rdquo; with the Library
  3175. creates an executable that is a derivative of the Library (because it
  3176. contains portions of the Library), rather than a &ldquo;work that uses the
  3177. library&rdquo;. The executable is therefore covered by this License.
  3178. Section 6 states terms for distribution of such executables.
  3179. </p>
  3180. <p>When a &ldquo;work that uses the Library&rdquo; uses material from a header file
  3181. that is part of the Library, the object code for the work may be a
  3182. derivative work of the Library even though the source code is not.
  3183. Whether this is true is especially significant if the work can be
  3184. linked without the Library, or if the work is itself a library. The
  3185. threshold for this to be true is not precisely defined by law.
  3186. </p>
  3187. <p>If such an object file uses only numerical parameters, data
  3188. structure layouts and accessors, and small macros and small inline
  3189. functions (ten lines or less in length), then the use of the object
  3190. file is unrestricted, regardless of whether it is legally a derivative
  3191. work. (Executables containing this object code plus portions of the
  3192. Library will still fall under Section 6.)
  3193. </p>
  3194. <p>Otherwise, if the work is a derivative of the Library, you may
  3195. distribute the object code for the work under the terms of Section 6.
  3196. Any executables containing that work also fall under Section 6,
  3197. whether or not they are linked directly with the Library itself.
  3198. </p>
  3199. </li><li> As an exception to the Sections above, you may also combine or
  3200. link a &ldquo;work that uses the Library&rdquo; with the Library to produce a
  3201. work containing portions of the Library, and distribute that work
  3202. under terms of your choice, provided that the terms permit
  3203. modification of the work for the customer&rsquo;s own use and reverse
  3204. engineering for debugging such modifications.
  3205. <p>You must give prominent notice with each copy of the work that the
  3206. Library is used in it and that the Library and its use are covered by
  3207. this License. You must supply a copy of this License. If the work
  3208. during execution displays copyright notices, you must include the
  3209. copyright notice for the Library among them, as well as a reference
  3210. directing the user to the copy of this License. Also, you must do one
  3211. of these things:
  3212. </p>
  3213. <ol type="a" start="1">
  3214. <li> Accompany the work with the complete corresponding
  3215. machine-readable source code for the Library including whatever
  3216. changes were used in the work (which must be distributed under
  3217. Sections 1 and 2 above); and, if the work is an executable linked
  3218. with the Library, with the complete machine-readable &ldquo;work that
  3219. uses the Library&rdquo;, as object code and/or source code, so that the
  3220. user can modify the Library and then relink to produce a modified
  3221. executable containing the modified Library. (It is understood
  3222. that the user who changes the contents of definitions files in the
  3223. Library will not necessarily be able to recompile the application
  3224. to use the modified definitions.)
  3225. </li><li> Use a suitable shared library mechanism for linking with the Library. A
  3226. suitable mechanism is one that (1) uses at run time a copy of the
  3227. library already present on the user&rsquo;s computer system, rather than
  3228. copying library functions into the executable, and (2) will operate
  3229. properly with a modified version of the library, if the user installs
  3230. one, as long as the modified version is interface-compatible with the
  3231. version that the work was made with.
  3232. </li><li> Accompany the work with a written offer, valid for at
  3233. least three years, to give the same user the materials
  3234. specified in Subsection 6a, above, for a charge no more
  3235. than the cost of performing this distribution.
  3236. </li><li> If distribution of the work is made by offering access to copy
  3237. from a designated place, offer equivalent access to copy the above
  3238. specified materials from the same place.
  3239. </li><li> Verify that the user has already received a copy of these
  3240. materials or that you have already sent this user a copy.
  3241. </li></ol>
  3242. <p>For an executable, the required form of the &ldquo;work that uses the
  3243. Library&rdquo; must include any data and utility programs needed for
  3244. reproducing the executable from it. However, as a special exception,
  3245. the materials to be distributed need not include anything that is
  3246. normally distributed (in either source or binary form) with the major
  3247. components (compiler, kernel, and so on) of the operating system on
  3248. which the executable runs, unless that component itself accompanies the
  3249. executable.
  3250. </p>
  3251. <p>It may happen that this requirement contradicts the license
  3252. restrictions of other proprietary libraries that do not normally
  3253. accompany the operating system. Such a contradiction means you cannot
  3254. use both them and the Library together in an executable that you
  3255. distribute.
  3256. </p>
  3257. </li><li> You may place library facilities that are a work based on the
  3258. Library side-by-side in a single library together with other library
  3259. facilities not covered by this License, and distribute such a combined
  3260. library, provided that the separate distribution of the work based on
  3261. the Library and of the other library facilities is otherwise
  3262. permitted, and provided that you do these two things:
  3263. <ol type="a" start="1">
  3264. <li> Accompany the combined library with a copy of the same work
  3265. based on the Library, uncombined with any other library
  3266. facilities. This must be distributed under the terms of the
  3267. Sections above.
  3268. </li><li> Give prominent notice with the combined library of the fact
  3269. that part of it is a work based on the Library, and explaining
  3270. where to find the accompanying uncombined form of the same work.
  3271. </li></ol>
  3272. </li><li> You may not copy, modify, sublicense, link with, or distribute
  3273. the Library except as expressly provided under this License. Any
  3274. attempt otherwise to copy, modify, sublicense, link with, or
  3275. distribute the Library is void, and will automatically terminate your
  3276. rights under this License. However, parties who have received copies,
  3277. or rights, from you under this License will not have their licenses
  3278. terminated so long as such parties remain in full compliance.
  3279. </li><li> You are not required to accept this License, since you have not
  3280. signed it. However, nothing else grants you permission to modify or
  3281. distribute the Library or its derivative works. These actions are
  3282. prohibited by law if you do not accept this License. Therefore, by
  3283. modifying or distributing the Library (or any work based on the
  3284. Library), you indicate your acceptance of this License to do so, and
  3285. all its terms and conditions for copying, distributing or modifying
  3286. the Library or works based on it.
  3287. </li><li> Each time you redistribute the Library (or any work based on the
  3288. Library), the recipient automatically receives a license from the
  3289. original licensor to copy, distribute, link with or modify the Library
  3290. subject to these terms and conditions. You may not impose any further
  3291. restrictions on the recipients&rsquo; exercise of the rights granted herein.
  3292. You are not responsible for enforcing compliance by third parties with
  3293. this License.
  3294. </li><li> If, as a consequence of a court judgment or allegation of patent
  3295. infringement or for any other reason (not limited to patent issues),
  3296. conditions are imposed on you (whether by court order, agreement or
  3297. otherwise) that contradict the conditions of this License, they do not
  3298. excuse you from the conditions of this License. If you cannot
  3299. distribute so as to satisfy simultaneously your obligations under this
  3300. License and any other pertinent obligations, then as a consequence you
  3301. may not distribute the Library at all. For example, if a patent
  3302. license would not permit royalty-free redistribution of the Library by
  3303. all those who receive copies directly or indirectly through you, then
  3304. the only way you could satisfy both it and this License would be to
  3305. refrain entirely from distribution of the Library.
  3306. <p>If any portion of this section is held invalid or unenforceable under any
  3307. particular circumstance, the balance of the section is intended to apply,
  3308. and the section as a whole is intended to apply in other circumstances.
  3309. </p>
  3310. <p>It is not the purpose of this section to induce you to infringe any
  3311. patents or other property right claims or to contest validity of any
  3312. such claims; this section has the sole purpose of protecting the
  3313. integrity of the free software distribution system which is
  3314. implemented by public license practices. Many people have made
  3315. generous contributions to the wide range of software distributed
  3316. through that system in reliance on consistent application of that
  3317. system; it is up to the author/donor to decide if he or she is willing
  3318. to distribute software through any other system and a licensee cannot
  3319. impose that choice.
  3320. </p>
  3321. <p>This section is intended to make thoroughly clear what is believed to
  3322. be a consequence of the rest of this License.
  3323. </p>
  3324. </li><li> If the distribution and/or use of the Library is restricted in
  3325. certain countries either by patents or by copyrighted interfaces, the
  3326. original copyright holder who places the Library under this License may add
  3327. an explicit geographical distribution limitation excluding those countries,
  3328. so that distribution is permitted only in or among countries not thus
  3329. excluded. In such case, this License incorporates the limitation as if
  3330. written in the body of this License.
  3331. </li><li> The Free Software Foundation may publish revised and/or new
  3332. versions of the Lesser General Public License from time to time.
  3333. Such new versions will be similar in spirit to the present version,
  3334. but may differ in detail to address new problems or concerns.
  3335. <p>Each version is given a distinguishing version number. If the Library
  3336. specifies a version number of this License which applies to it and
  3337. &ldquo;any later version&rdquo;, you have the option of following the terms and
  3338. conditions either of that version or of any later version published by
  3339. the Free Software Foundation. If the Library does not specify a
  3340. license version number, you may choose any version ever published by
  3341. the Free Software Foundation.
  3342. </p>
  3343. </li><li> If you wish to incorporate parts of the Library into other free
  3344. programs whose distribution conditions are incompatible with these,
  3345. write to the author to ask for permission. For software which is
  3346. copyrighted by the Free Software Foundation, write to the Free
  3347. Software Foundation; we sometimes make exceptions for this. Our
  3348. decision will be guided by the two goals of preserving the free status
  3349. of all derivatives of our free software and of promoting the sharing
  3350. and reuse of software generally.
  3351. <div align="center">NO WARRANTY
  3352. </div>
  3353. </li><li> BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
  3354. WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
  3355. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
  3356. OTHER PARTIES PROVIDE THE LIBRARY &ldquo;AS IS&rdquo; WITHOUT WARRANTY OF ANY
  3357. KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
  3358. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  3359. PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
  3360. LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
  3361. THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
  3362. </li><li> IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
  3363. WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
  3364. AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
  3365. FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
  3366. CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
  3367. LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
  3368. RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
  3369. FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
  3370. SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
  3371. DAMAGES.
  3372. </li></ol>
  3373. <a name="How-to-Apply-These-Terms-to-Your-New-Libraries"></a>
  3374. <h4 class="appendixsubsec">A.1.2 How to Apply These Terms to Your New Libraries</h4>
  3375. <p>If you develop a new library, and you want it to be of the greatest
  3376. possible use to the public, we recommend making it free software that
  3377. everyone can redistribute and change. You can do so by permitting
  3378. redistribution under these terms (or, alternatively, under the terms of the
  3379. ordinary General Public License).
  3380. </p>
  3381. <p>To apply these terms, attach the following notices to the library. It is
  3382. safest to attach them to the start of each source file to most effectively
  3383. convey the exclusion of warranty; and each file should have at least the
  3384. &ldquo;copyright&rdquo; line and a pointer to where the full notice is found.
  3385. </p>
  3386. <div class="smallexample">
  3387. <pre class="smallexample"><var>one line to give the library's name and an idea of what it does.</var>
  3388. Copyright (C) <var>year</var> <var>name of author</var>
  3389. This library is free software; you can redistribute it and/or modify it
  3390. under the terms of the GNU Lesser General Public License as published by
  3391. the Free Software Foundation; either version 2.1 of the License, or (at
  3392. your option) any later version.
  3393. This library is distributed in the hope that it will be useful, but
  3394. WITHOUT ANY WARRANTY; without even the implied warranty of
  3395. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  3396. Lesser General Public License for more details.
  3397. You should have received a copy of the GNU Lesser General Public
  3398. License along with this library; if not, write to the Free Software
  3399. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
  3400. USA.
  3401. </pre></div>
  3402. <p>Also add information on how to contact you by electronic and paper mail.
  3403. </p>
  3404. <p>You should also get your employer (if you work as a programmer) or your
  3405. school, if any, to sign a &ldquo;copyright disclaimer&rdquo; for the library, if
  3406. necessary. Here is a sample; alter the names:
  3407. </p>
  3408. <div class="smallexample">
  3409. <pre class="smallexample">Yoyodyne, Inc., hereby disclaims all copyright interest in the library
  3410. `Frob' (a library for tweaking knobs) written by James Random Hacker.
  3411. <var>signature of Ty Coon</var>, 1 April 1990
  3412. Ty Coon, President of Vice
  3413. </pre></div>
  3414. <p>That&rsquo;s all there is to it!
  3415. </p>
  3416. <hr>
  3417. <a name="BSD"></a>
  3418. <div class="header">
  3419. <p>
  3420. Previous: <a href="#Library-Copying" accesskey="p" rel="prev">Library Copying</a>, Up: <a href="#Licenses" accesskey="u" rel="up">Licenses</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  3421. </div>
  3422. <a name="BSD-1"></a>
  3423. <h3 class="appendixsec">A.2 BSD</h3>
  3424. <p>Copyright &copy; 1990 Regents of the University of California.
  3425. All rights reserved.
  3426. </p>
  3427. <p>Redistribution and use in source and binary forms, with or without
  3428. modification, are permitted provided that the following conditions
  3429. are met:
  3430. </p>
  3431. <ol>
  3432. <li> Redistributions of source code must retain the above copyright
  3433. notice, this list of conditions and the following disclaimer.
  3434. </li><li> Redistributions in binary form must reproduce the above copyright
  3435. notice, this list of conditions and the following disclaimer in the
  3436. documentation and/or other materials provided with the distribution.
  3437. </li><li> [rescinded 22 July 1999]
  3438. </li><li> Neither the name of the University nor the names of its contributors
  3439. may be used to endorse or promote products derived from this software
  3440. without specific prior written permission.
  3441. </li></ol>
  3442. <p>THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS &ldquo;AS IS&rdquo; AND
  3443. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  3444. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  3445. ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  3446. FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  3447. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  3448. OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  3449. HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  3450. LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  3451. OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  3452. SUCH DAMAGE.
  3453. </p>
  3454. <hr>
  3455. <a name="Index"></a>
  3456. <div class="header">
  3457. <p>
  3458. Previous: <a href="#Licenses" accesskey="p" rel="prev">Licenses</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  3459. </div>
  3460. <a name="Index-1"></a>
  3461. <h2 class="unnumbered">Index</h2>
  3462. <table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Index_cp_letter-A"><b>A</b></a>
  3463. &nbsp;
  3464. <a class="summary-letter" href="#Index_cp_letter-B"><b>B</b></a>
  3465. &nbsp;
  3466. <a class="summary-letter" href="#Index_cp_letter-C"><b>C</b></a>
  3467. &nbsp;
  3468. <a class="summary-letter" href="#Index_cp_letter-D"><b>D</b></a>
  3469. &nbsp;
  3470. <a class="summary-letter" href="#Index_cp_letter-E"><b>E</b></a>
  3471. &nbsp;
  3472. <a class="summary-letter" href="#Index_cp_letter-F"><b>F</b></a>
  3473. &nbsp;
  3474. <a class="summary-letter" href="#Index_cp_letter-G"><b>G</b></a>
  3475. &nbsp;
  3476. <a class="summary-letter" href="#Index_cp_letter-H"><b>H</b></a>
  3477. &nbsp;
  3478. <a class="summary-letter" href="#Index_cp_letter-I"><b>I</b></a>
  3479. &nbsp;
  3480. <a class="summary-letter" href="#Index_cp_letter-L"><b>L</b></a>
  3481. &nbsp;
  3482. <a class="summary-letter" href="#Index_cp_letter-M"><b>M</b></a>
  3483. &nbsp;
  3484. <a class="summary-letter" href="#Index_cp_letter-O"><b>O</b></a>
  3485. &nbsp;
  3486. <a class="summary-letter" href="#Index_cp_letter-P"><b>P</b></a>
  3487. &nbsp;
  3488. <a class="summary-letter" href="#Index_cp_letter-R"><b>R</b></a>
  3489. &nbsp;
  3490. <a class="summary-letter" href="#Index_cp_letter-S"><b>S</b></a>
  3491. &nbsp;
  3492. <a class="summary-letter" href="#Index_cp_letter-T"><b>T</b></a>
  3493. &nbsp;
  3494. <a class="summary-letter" href="#Index_cp_letter-U"><b>U</b></a>
  3495. &nbsp;
  3496. <a class="summary-letter" href="#Index_cp_letter-V"><b>V</b></a>
  3497. &nbsp;
  3498. <a class="summary-letter" href="#Index_cp_letter-W"><b>W</b></a>
  3499. &nbsp;
  3500. <a class="summary-letter" href="#Index_cp_letter-X"><b>X</b></a>
  3501. &nbsp;
  3502. </td></tr></table>
  3503. <table class="index-cp" border="0">
  3504. <tr><td></td><th align="left">Index Entry</th><td>&nbsp;</td><th align="left"> Section</th></tr>
  3505. <tr><td colspan="4"> <hr></td></tr>
  3506. <tr><th><a name="Index_cp_letter-A">A</a></th><td></td><td></td></tr>
  3507. <tr><td></td><td valign="top"><a href="#index-alignment-_0028in-obstacks_0029">alignment (in obstacks)</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Obstacks-Data-Alignment">Obstacks Data Alignment</a></td></tr>
  3508. <tr><td></td><td valign="top"><a href="#index-alloca"><code>alloca</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3509. <tr><td></td><td valign="top"><a href="#index-allocation-_0028obstacks_0029">allocation (obstacks)</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Allocation-in-an-Obstack">Allocation in an Obstack</a></td></tr>
  3510. <tr><td></td><td valign="top"><a href="#index-asprintf"><code>asprintf</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3511. <tr><td></td><td valign="top"><a href="#index-atexit"><code>atexit</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3512. <tr><td colspan="4"> <hr></td></tr>
  3513. <tr><th><a name="Index_cp_letter-B">B</a></th><td></td><td></td></tr>
  3514. <tr><td></td><td valign="top"><a href="#index-basename"><code>basename</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3515. <tr><td></td><td valign="top"><a href="#index-bcmp"><code>bcmp</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3516. <tr><td></td><td valign="top"><a href="#index-bcopy"><code>bcopy</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3517. <tr><td></td><td valign="top"><a href="#index-bsearch"><code>bsearch</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3518. <tr><td></td><td valign="top"><a href="#index-bsearch_005fr"><code>bsearch_r</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3519. <tr><td></td><td valign="top"><a href="#index-buildargv"><code>buildargv</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3520. <tr><td></td><td valign="top"><a href="#index-bzero"><code>bzero</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3521. <tr><td colspan="4"> <hr></td></tr>
  3522. <tr><th><a name="Index_cp_letter-C">C</a></th><td></td><td></td></tr>
  3523. <tr><td></td><td valign="top"><a href="#index-calloc"><code>calloc</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3524. <tr><td></td><td valign="top"><a href="#index-canonical_005ffilename_005feq"><code>canonical_filename_eq</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3525. <tr><td></td><td valign="top"><a href="#index-changing-the-size-of-a-block-_0028obstacks_0029">changing the size of a block (obstacks)</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Growing-Objects">Growing Objects</a></td></tr>
  3526. <tr><td></td><td valign="top"><a href="#index-char_002a"><code>char*</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3527. <tr><td></td><td valign="top"><a href="#index-choose_005ftemp_005fbase"><code>choose_temp_base</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3528. <tr><td></td><td valign="top"><a href="#index-chunks">chunks</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Obstack-Chunks">Obstack Chunks</a></td></tr>
  3529. <tr><td></td><td valign="top"><a href="#index-clock"><code>clock</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3530. <tr><td></td><td valign="top"><a href="#index-concat"><code>concat</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3531. <tr><td></td><td valign="top"><a href="#index-countargv"><code>countargv</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3532. <tr><td></td><td valign="top"><a href="#index-crc32"><code>crc32</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3533. <tr><td colspan="4"> <hr></td></tr>
  3534. <tr><th><a name="Index_cp_letter-D">D</a></th><td></td><td></td></tr>
  3535. <tr><td></td><td valign="top"><a href="#index-dupargv"><code>dupargv</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3536. <tr><td colspan="4"> <hr></td></tr>
  3537. <tr><th><a name="Index_cp_letter-E">E</a></th><td></td><td></td></tr>
  3538. <tr><td></td><td valign="top"><a href="#index-efficiency-and-obstacks">efficiency and obstacks</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Extra-Fast-Growing">Extra Fast Growing</a></td></tr>
  3539. <tr><td></td><td valign="top"><a href="#index-efficiency-of-chunks">efficiency of chunks</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Obstack-Chunks">Obstack Chunks</a></td></tr>
  3540. <tr><td></td><td valign="top"><a href="#index-errno_005fmax"><code>errno_max</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3541. <tr><td></td><td valign="top"><a href="#index-error-reporting">error reporting</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Error-Reporting">Error Reporting</a></td></tr>
  3542. <tr><td></td><td valign="top"><a href="#index-exit-handlers">exit handlers</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Exit-Handlers">Exit Handlers</a></td></tr>
  3543. <tr><td></td><td valign="top"><a href="#index-expandargv"><code>expandargv</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3544. <tr><td></td><td valign="top"><a href="#index-extensions">extensions</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Extensions">Extensions</a></td></tr>
  3545. <tr><td colspan="4"> <hr></td></tr>
  3546. <tr><th><a name="Index_cp_letter-F">F</a></th><td></td><td></td></tr>
  3547. <tr><td></td><td valign="top"><a href="#index-fdmatch"><code>fdmatch</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3548. <tr><td></td><td valign="top"><a href="#index-fdopen_005funlocked"><code>fdopen_unlocked</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3549. <tr><td></td><td valign="top"><a href="#index-ffs"><code>ffs</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3550. <tr><td></td><td valign="top"><a href="#index-filename_005fcmp"><code>filename_cmp</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3551. <tr><td></td><td valign="top"><a href="#index-filename_005feq"><code>filename_eq</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3552. <tr><td></td><td valign="top"><a href="#index-filename_005fhash"><code>filename_hash</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3553. <tr><td></td><td valign="top"><a href="#index-filename_005fncmp"><code>filename_ncmp</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3554. <tr><td></td><td valign="top"><a href="#index-fnmatch"><code>fnmatch</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3555. <tr><td></td><td valign="top"><a href="#index-fopen_005funlocked"><code>fopen_unlocked</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3556. <tr><td></td><td valign="top"><a href="#index-freeargv"><code>freeargv</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3557. <tr><td></td><td valign="top"><a href="#index-freeing-_0028obstacks_0029">freeing (obstacks)</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Freeing-Obstack-Objects">Freeing Obstack Objects</a></td></tr>
  3558. <tr><td></td><td valign="top"><a href="#index-freopen_005funlocked"><code>freopen_unlocked</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3559. <tr><td></td><td valign="top"><a href="#index-functions_002c-extension">functions, extension</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Extensions">Extensions</a></td></tr>
  3560. <tr><td></td><td valign="top"><a href="#index-functions_002c-missing">functions, missing</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Supplemental-Functions">Supplemental Functions</a></td></tr>
  3561. <tr><td></td><td valign="top"><a href="#index-functions_002c-replacement">functions, replacement</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Replacement-Functions">Replacement Functions</a></td></tr>
  3562. <tr><td></td><td valign="top"><a href="#index-functions_002c-supplemental">functions, supplemental</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Supplemental-Functions">Supplemental Functions</a></td></tr>
  3563. <tr><td colspan="4"> <hr></td></tr>
  3564. <tr><th><a name="Index_cp_letter-G">G</a></th><td></td><td></td></tr>
  3565. <tr><td></td><td valign="top"><a href="#index-getcwd"><code>getcwd</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3566. <tr><td></td><td valign="top"><a href="#index-getpagesize"><code>getpagesize</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3567. <tr><td></td><td valign="top"><a href="#index-getpwd"><code>getpwd</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3568. <tr><td></td><td valign="top"><a href="#index-gettimeofday"><code>gettimeofday</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3569. <tr><td></td><td valign="top"><a href="#index-get_005frun_005ftime"><code>get_run_time</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3570. <tr><td></td><td valign="top"><a href="#index-growing-objects-_0028in-obstacks_0029">growing objects (in obstacks)</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Growing-Objects">Growing Objects</a></td></tr>
  3571. <tr><td colspan="4"> <hr></td></tr>
  3572. <tr><th><a name="Index_cp_letter-H">H</a></th><td></td><td></td></tr>
  3573. <tr><td></td><td valign="top"><a href="#index-hex_005finit"><code>hex_init</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3574. <tr><td></td><td valign="top"><a href="#index-hex_005fp"><code>hex_p</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3575. <tr><td></td><td valign="top"><a href="#index-hex_005fvalue"><code>hex_value</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3576. <tr><td></td><td valign="top"><a href="#index-HOST_005fCHARSET"><code>HOST_CHARSET</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3577. <tr><td></td><td valign="top"><a href="#index-HOST_005fCHARSET_005fASCII"><code>HOST_CHARSET_ASCII</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3578. <tr><td></td><td valign="top"><a href="#index-HOST_005fCHARSET_005fEBCDIC"><code>HOST_CHARSET_EBCDIC</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3579. <tr><td></td><td valign="top"><a href="#index-HOST_005fCHARSET_005fUNKNOWN"><code>HOST_CHARSET_UNKNOWN</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3580. <tr><td></td><td valign="top"><a href="#index-how-to-use">how to use</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Using">Using</a></td></tr>
  3581. <tr><td></td><td valign="top"><a href="#index-htab_005fcreate_005ftyped_005falloc"><code>htab_create_typed_alloc</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3582. <tr><td colspan="4"> <hr></td></tr>
  3583. <tr><th><a name="Index_cp_letter-I">I</a></th><td></td><td></td></tr>
  3584. <tr><td></td><td valign="top"><a href="#index-index"><code>index</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3585. <tr><td></td><td valign="top"><a href="#index-initstate"><code>initstate</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3586. <tr><td></td><td valign="top"><a href="#index-insque"><code>insque</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3587. <tr><td></td><td valign="top"><a href="#index-ISALNUM"><code>ISALNUM</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3588. <tr><td></td><td valign="top"><a href="#index-ISALPHA"><code>ISALPHA</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3589. <tr><td></td><td valign="top"><a href="#index-ISBLANK"><code>ISBLANK</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3590. <tr><td></td><td valign="top"><a href="#index-ISCNTRL"><code>ISCNTRL</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3591. <tr><td></td><td valign="top"><a href="#index-ISDIGIT"><code>ISDIGIT</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3592. <tr><td></td><td valign="top"><a href="#index-ISGRAPH"><code>ISGRAPH</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3593. <tr><td></td><td valign="top"><a href="#index-ISIDNUM"><code>ISIDNUM</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3594. <tr><td></td><td valign="top"><a href="#index-ISIDST"><code>ISIDST</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3595. <tr><td></td><td valign="top"><a href="#index-ISLOWER"><code>ISLOWER</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3596. <tr><td></td><td valign="top"><a href="#index-ISPRINT"><code>ISPRINT</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3597. <tr><td></td><td valign="top"><a href="#index-ISPUNCT"><code>ISPUNCT</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3598. <tr><td></td><td valign="top"><a href="#index-ISSPACE"><code>ISSPACE</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3599. <tr><td></td><td valign="top"><a href="#index-ISUPPER"><code>ISUPPER</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3600. <tr><td></td><td valign="top"><a href="#index-ISXDIGIT"><code>ISXDIGIT</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3601. <tr><td></td><td valign="top"><a href="#index-IS_005fISOBASIC"><code>IS_ISOBASIC</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3602. <tr><td></td><td valign="top"><a href="#index-IS_005fNVSPACE"><code>IS_NVSPACE</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3603. <tr><td></td><td valign="top"><a href="#index-IS_005fSPACE_005fOR_005fNUL"><code>IS_SPACE_OR_NUL</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3604. <tr><td></td><td valign="top"><a href="#index-IS_005fVSPACE"><code>IS_VSPACE</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3605. <tr><td colspan="4"> <hr></td></tr>
  3606. <tr><th><a name="Index_cp_letter-L">L</a></th><td></td><td></td></tr>
  3607. <tr><td></td><td valign="top"><a href="#index-lbasename"><code>lbasename</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3608. <tr><td></td><td valign="top"><a href="#index-LGPL_002c-Lesser-General-Public-License">LGPL, Lesser General Public License</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Library-Copying">Library Copying</a></td></tr>
  3609. <tr><td></td><td valign="top"><a href="#index-libiberty-usage">libiberty usage</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Using">Using</a></td></tr>
  3610. <tr><td></td><td valign="top"><a href="#index-lrealpath"><code>lrealpath</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3611. <tr><td colspan="4"> <hr></td></tr>
  3612. <tr><th><a name="Index_cp_letter-M">M</a></th><td></td><td></td></tr>
  3613. <tr><td></td><td valign="top"><a href="#index-macros">macros</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Obstack-Functions">Obstack Functions</a></td></tr>
  3614. <tr><td></td><td valign="top"><a href="#index-make_005frelative_005fprefix"><code>make_relative_prefix</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3615. <tr><td></td><td valign="top"><a href="#index-make_005ftemp_005ffile"><code>make_temp_file</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3616. <tr><td></td><td valign="top"><a href="#index-memchr"><code>memchr</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3617. <tr><td></td><td valign="top"><a href="#index-memcmp"><code>memcmp</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3618. <tr><td></td><td valign="top"><a href="#index-memcpy"><code>memcpy</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3619. <tr><td></td><td valign="top"><a href="#index-memmem"><code>memmem</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3620. <tr><td></td><td valign="top"><a href="#index-memmove"><code>memmove</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3621. <tr><td></td><td valign="top"><a href="#index-memory-allocation">memory allocation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Memory-Allocation">Memory Allocation</a></td></tr>
  3622. <tr><td></td><td valign="top"><a href="#index-mempcpy"><code>mempcpy</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3623. <tr><td></td><td valign="top"><a href="#index-memset"><code>memset</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3624. <tr><td></td><td valign="top"><a href="#index-mkstemps"><code>mkstemps</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3625. <tr><td colspan="4"> <hr></td></tr>
  3626. <tr><th><a name="Index_cp_letter-O">O</a></th><td></td><td></td></tr>
  3627. <tr><td></td><td valign="top"><a href="#index-obstack-status">obstack status</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Status-of-an-Obstack">Status of an Obstack</a></td></tr>
  3628. <tr><td></td><td valign="top"><a href="#index-obstack_002eh"><code>obstack.h</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Creating-Obstacks">Creating Obstacks</a></td></tr>
  3629. <tr><td></td><td valign="top"><a href="#index-obstacks">obstacks</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Obstacks">Obstacks</a></td></tr>
  3630. <tr><td></td><td valign="top"><a href="#index-obstack_005f1grow"><code>obstack_1grow</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Growing-Objects">Growing Objects</a></td></tr>
  3631. <tr><td></td><td valign="top"><a href="#index-obstack_005f1grow_005ffast"><code>obstack_1grow_fast</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Extra-Fast-Growing">Extra Fast Growing</a></td></tr>
  3632. <tr><td></td><td valign="top"><a href="#index-obstack_005falignment_005fmask"><code>obstack_alignment_mask</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Obstacks-Data-Alignment">Obstacks Data Alignment</a></td></tr>
  3633. <tr><td></td><td valign="top"><a href="#index-obstack_005falloc"><code>obstack_alloc</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Allocation-in-an-Obstack">Allocation in an Obstack</a></td></tr>
  3634. <tr><td></td><td valign="top"><a href="#index-obstack_005falloc_005ffailed_005fhandler"><code>obstack_alloc_failed_handler</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Preparing-for-Obstacks">Preparing for Obstacks</a></td></tr>
  3635. <tr><td></td><td valign="top"><a href="#index-obstack_005fbase"><code>obstack_base</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Status-of-an-Obstack">Status of an Obstack</a></td></tr>
  3636. <tr><td></td><td valign="top"><a href="#index-obstack_005fbegin"><code>obstack_begin</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Preparing-for-Obstacks">Preparing for Obstacks</a></td></tr>
  3637. <tr><td></td><td valign="top"><a href="#index-obstack_005fblank"><code>obstack_blank</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Growing-Objects">Growing Objects</a></td></tr>
  3638. <tr><td></td><td valign="top"><a href="#index-obstack_005fblank_005ffast"><code>obstack_blank_fast</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Extra-Fast-Growing">Extra Fast Growing</a></td></tr>
  3639. <tr><td></td><td valign="top"><a href="#index-obstack_005fchunk_005falloc"><code>obstack_chunk_alloc</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Preparing-for-Obstacks">Preparing for Obstacks</a></td></tr>
  3640. <tr><td></td><td valign="top"><a href="#index-obstack_005fchunk_005ffree"><code>obstack_chunk_free</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Preparing-for-Obstacks">Preparing for Obstacks</a></td></tr>
  3641. <tr><td></td><td valign="top"><a href="#index-obstack_005fchunk_005fsize"><code>obstack_chunk_size</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Obstack-Chunks">Obstack Chunks</a></td></tr>
  3642. <tr><td></td><td valign="top"><a href="#index-obstack_005fcopy"><code>obstack_copy</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Allocation-in-an-Obstack">Allocation in an Obstack</a></td></tr>
  3643. <tr><td></td><td valign="top"><a href="#index-obstack_005fcopy0"><code>obstack_copy0</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Allocation-in-an-Obstack">Allocation in an Obstack</a></td></tr>
  3644. <tr><td></td><td valign="top"><a href="#index-obstack_005ffinish"><code>obstack_finish</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Growing-Objects">Growing Objects</a></td></tr>
  3645. <tr><td></td><td valign="top"><a href="#index-obstack_005ffree"><code>obstack_free</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Freeing-Obstack-Objects">Freeing Obstack Objects</a></td></tr>
  3646. <tr><td></td><td valign="top"><a href="#index-obstack_005fgrow"><code>obstack_grow</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Growing-Objects">Growing Objects</a></td></tr>
  3647. <tr><td></td><td valign="top"><a href="#index-obstack_005fgrow0"><code>obstack_grow0</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Growing-Objects">Growing Objects</a></td></tr>
  3648. <tr><td></td><td valign="top"><a href="#index-obstack_005finit"><code>obstack_init</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Preparing-for-Obstacks">Preparing for Obstacks</a></td></tr>
  3649. <tr><td></td><td valign="top"><a href="#index-obstack_005fint_005fgrow"><code>obstack_int_grow</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Growing-Objects">Growing Objects</a></td></tr>
  3650. <tr><td></td><td valign="top"><a href="#index-obstack_005fint_005fgrow_005ffast"><code>obstack_int_grow_fast</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Extra-Fast-Growing">Extra Fast Growing</a></td></tr>
  3651. <tr><td></td><td valign="top"><a href="#index-obstack_005fnext_005ffree"><code>obstack_next_free</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Status-of-an-Obstack">Status of an Obstack</a></td></tr>
  3652. <tr><td></td><td valign="top"><a href="#index-obstack_005fobject_005fsize"><code>obstack_object_size</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Growing-Objects">Growing Objects</a></td></tr>
  3653. <tr><td></td><td valign="top"><a href="#index-obstack_005fobject_005fsize-1"><code>obstack_object_size</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Status-of-an-Obstack">Status of an Obstack</a></td></tr>
  3654. <tr><td></td><td valign="top"><a href="#index-obstack_005fptr_005fgrow"><code>obstack_ptr_grow</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Growing-Objects">Growing Objects</a></td></tr>
  3655. <tr><td></td><td valign="top"><a href="#index-obstack_005fptr_005fgrow_005ffast"><code>obstack_ptr_grow_fast</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Extra-Fast-Growing">Extra Fast Growing</a></td></tr>
  3656. <tr><td></td><td valign="top"><a href="#index-obstack_005froom"><code>obstack_room</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Extra-Fast-Growing">Extra Fast Growing</a></td></tr>
  3657. <tr><td></td><td valign="top"><a href="#index-obstack_005fspecify_005fallocation"><code>obstack_specify_allocation</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Preparing-for-Obstacks">Preparing for Obstacks</a></td></tr>
  3658. <tr><td></td><td valign="top"><a href="#index-obstack_005fspecify_005fallocation_005fwith_005farg"><code>obstack_specify_allocation_with_arg</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Preparing-for-Obstacks">Preparing for Obstacks</a></td></tr>
  3659. <tr><td colspan="4"> <hr></td></tr>
  3660. <tr><th><a name="Index_cp_letter-P">P</a></th><td></td><td></td></tr>
  3661. <tr><td></td><td valign="top"><a href="#index-pexecute"><code>pexecute</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3662. <tr><td></td><td valign="top"><a href="#index-PEX_005fBINARY_005fERROR"><code>PEX_BINARY_ERROR</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3663. <tr><td></td><td valign="top"><a href="#index-PEX_005fBINARY_005fINPUT"><code>PEX_BINARY_INPUT</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3664. <tr><td></td><td valign="top"><a href="#index-PEX_005fBINARY_005fOUTPUT"><code>PEX_BINARY_OUTPUT</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3665. <tr><td></td><td valign="top"><a href="#index-pex_005ffree"><code>pex_free</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3666. <tr><td></td><td valign="top"><a href="#index-pex_005fget_005fstatus"><code>pex_get_status</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3667. <tr><td></td><td valign="top"><a href="#index-pex_005fget_005ftimes"><code>pex_get_times</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3668. <tr><td></td><td valign="top"><a href="#index-pex_005finit"><code>pex_init</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3669. <tr><td></td><td valign="top"><a href="#index-pex_005finput_005ffile"><code>pex_input_file</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3670. <tr><td></td><td valign="top"><a href="#index-pex_005finput_005fpipe"><code>pex_input_pipe</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3671. <tr><td></td><td valign="top"><a href="#index-PEX_005fLAST"><code>PEX_LAST</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3672. <tr><td></td><td valign="top"><a href="#index-pex_005fone"><code>pex_one</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3673. <tr><td></td><td valign="top"><a href="#index-pex_005fread_005ferr"><code>pex_read_err</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3674. <tr><td></td><td valign="top"><a href="#index-pex_005fread_005foutput"><code>pex_read_output</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3675. <tr><td></td><td valign="top"><a href="#index-PEX_005fRECORD_005fTIMES"><code>PEX_RECORD_TIMES</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3676. <tr><td></td><td valign="top"><a href="#index-pex_005frun"><code>pex_run</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3677. <tr><td></td><td valign="top"><a href="#index-pex_005frun_005fin_005fenvironment"><code>pex_run_in_environment</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3678. <tr><td></td><td valign="top"><a href="#index-PEX_005fSAVE_005fTEMPS"><code>PEX_SAVE_TEMPS</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3679. <tr><td></td><td valign="top"><a href="#index-PEX_005fSEARCH"><code>PEX_SEARCH</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3680. <tr><td></td><td valign="top"><a href="#index-PEX_005fSTDERR_005fTO_005fPIPE"><code>PEX_STDERR_TO_PIPE</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3681. <tr><td></td><td valign="top"><a href="#index-PEX_005fSTDERR_005fTO_005fSTDOUT"><code>PEX_STDERR_TO_STDOUT</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3682. <tr><td></td><td valign="top"><a href="#index-PEX_005fSUFFIX"><code>PEX_SUFFIX</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3683. <tr><td></td><td valign="top"><a href="#index-PEX_005fUSE_005fPIPES"><code>PEX_USE_PIPES</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3684. <tr><td></td><td valign="top"><a href="#index-psignal"><code>psignal</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3685. <tr><td></td><td valign="top"><a href="#index-putenv"><code>putenv</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3686. <tr><td></td><td valign="top"><a href="#index-pwait"><code>pwait</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3687. <tr><td colspan="4"> <hr></td></tr>
  3688. <tr><th><a name="Index_cp_letter-R">R</a></th><td></td><td></td></tr>
  3689. <tr><td></td><td valign="top"><a href="#index-random"><code>random</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3690. <tr><td></td><td valign="top"><a href="#index-reconcat"><code>reconcat</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3691. <tr><td></td><td valign="top"><a href="#index-remque"><code>remque</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3692. <tr><td></td><td valign="top"><a href="#index-rename"><code>rename</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3693. <tr><td></td><td valign="top"><a href="#index-replacement-functions">replacement functions</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Replacement-Functions">Replacement Functions</a></td></tr>
  3694. <tr><td></td><td valign="top"><a href="#index-rindex"><code>rindex</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3695. <tr><td colspan="4"> <hr></td></tr>
  3696. <tr><th><a name="Index_cp_letter-S">S</a></th><td></td><td></td></tr>
  3697. <tr><td></td><td valign="top"><a href="#index-setenv"><code>setenv</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3698. <tr><td></td><td valign="top"><a href="#index-setproctitle"><code>setproctitle</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3699. <tr><td></td><td valign="top"><a href="#index-setstate"><code>setstate</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3700. <tr><td></td><td valign="top"><a href="#index-shrinking-objects">shrinking objects</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Extra-Fast-Growing">Extra Fast Growing</a></td></tr>
  3701. <tr><td></td><td valign="top"><a href="#index-signo_005fmax"><code>signo_max</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3702. <tr><td></td><td valign="top"><a href="#index-sigsetmask"><code>sigsetmask</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3703. <tr><td></td><td valign="top"><a href="#index-simple_005fobject_005fattributes_005fcompare"><code>simple_object_attributes_compare</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3704. <tr><td></td><td valign="top"><a href="#index-simple_005fobject_005ffetch_005fattributes"><code>simple_object_fetch_attributes</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3705. <tr><td></td><td valign="top"><a href="#index-simple_005fobject_005ffind_005fsection"><code>simple_object_find_section</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3706. <tr><td></td><td valign="top"><a href="#index-simple_005fobject_005ffind_005fsections"><code>simple_object_find_sections</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3707. <tr><td></td><td valign="top"><a href="#index-simple_005fobject_005fopen_005fread"><code>simple_object_open_read</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3708. <tr><td></td><td valign="top"><a href="#index-simple_005fobject_005frelease_005fattributes"><code>simple_object_release_attributes</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3709. <tr><td></td><td valign="top"><a href="#index-simple_005fobject_005frelease_005fread"><code>simple_object_release_read</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3710. <tr><td></td><td valign="top"><a href="#index-simple_005fobject_005frelease_005fwrite"><code>simple_object_release_write</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3711. <tr><td></td><td valign="top"><a href="#index-simple_005fobject_005fstart_005fwrite"><code>simple_object_start_write</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3712. <tr><td></td><td valign="top"><a href="#index-simple_005fobject_005fwrite_005fadd_005fdata"><code>simple_object_write_add_data</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3713. <tr><td></td><td valign="top"><a href="#index-simple_005fobject_005fwrite_005fcreate_005fsection"><code>simple_object_write_create_section</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3714. <tr><td></td><td valign="top"><a href="#index-simple_005fobject_005fwrite_005fto_005ffile"><code>simple_object_write_to_file</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3715. <tr><td></td><td valign="top"><a href="#index-snprintf"><code>snprintf</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3716. <tr><td></td><td valign="top"><a href="#index-spaces"><code>spaces</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3717. <tr><td></td><td valign="top"><a href="#index-splay_005ftree_005fnew_005fwith_005ftyped_005falloc"><code>splay_tree_new_with_typed_alloc</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3718. <tr><td></td><td valign="top"><a href="#index-srandom"><code>srandom</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3719. <tr><td></td><td valign="top"><a href="#index-stack_005flimit_005fincrease"><code>stack_limit_increase</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3720. <tr><td></td><td valign="top"><a href="#index-status-of-obstack">status of obstack</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Status-of-an-Obstack">Status of an Obstack</a></td></tr>
  3721. <tr><td></td><td valign="top"><a href="#index-stpcpy"><code>stpcpy</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3722. <tr><td></td><td valign="top"><a href="#index-stpncpy"><code>stpncpy</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3723. <tr><td></td><td valign="top"><a href="#index-strcasecmp"><code>strcasecmp</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3724. <tr><td></td><td valign="top"><a href="#index-strchr"><code>strchr</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3725. <tr><td></td><td valign="top"><a href="#index-strdup"><code>strdup</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3726. <tr><td></td><td valign="top"><a href="#index-strerrno"><code>strerrno</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3727. <tr><td></td><td valign="top"><a href="#index-strerror"><code>strerror</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3728. <tr><td></td><td valign="top"><a href="#index-strncasecmp"><code>strncasecmp</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3729. <tr><td></td><td valign="top"><a href="#index-strncmp"><code>strncmp</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3730. <tr><td></td><td valign="top"><a href="#index-strndup"><code>strndup</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3731. <tr><td></td><td valign="top"><a href="#index-strnlen"><code>strnlen</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3732. <tr><td></td><td valign="top"><a href="#index-strrchr"><code>strrchr</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3733. <tr><td></td><td valign="top"><a href="#index-strsignal"><code>strsignal</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3734. <tr><td></td><td valign="top"><a href="#index-strsigno"><code>strsigno</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3735. <tr><td></td><td valign="top"><a href="#index-strstr"><code>strstr</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3736. <tr><td></td><td valign="top"><a href="#index-strtod"><code>strtod</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3737. <tr><td></td><td valign="top"><a href="#index-strtoerrno"><code>strtoerrno</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3738. <tr><td></td><td valign="top"><a href="#index-strtol"><code>strtol</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3739. <tr><td></td><td valign="top"><a href="#index-strtoll"><code>strtoll</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3740. <tr><td></td><td valign="top"><a href="#index-strtosigno"><code>strtosigno</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3741. <tr><td></td><td valign="top"><a href="#index-strtoul"><code>strtoul</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3742. <tr><td></td><td valign="top"><a href="#index-strtoul-1"><code>strtoul</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3743. <tr><td></td><td valign="top"><a href="#index-strverscmp"><code>strverscmp</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3744. <tr><td></td><td valign="top"><a href="#index-supplemental-functions">supplemental functions</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Supplemental-Functions">Supplemental Functions</a></td></tr>
  3745. <tr><td colspan="4"> <hr></td></tr>
  3746. <tr><th><a name="Index_cp_letter-T">T</a></th><td></td><td></td></tr>
  3747. <tr><td></td><td valign="top"><a href="#index-timeval_005fadd"><code>timeval_add</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3748. <tr><td></td><td valign="top"><a href="#index-timeval_005fsub"><code>timeval_sub</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3749. <tr><td></td><td valign="top"><a href="#index-tmpnam"><code>tmpnam</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3750. <tr><td colspan="4"> <hr></td></tr>
  3751. <tr><th><a name="Index_cp_letter-U">U</a></th><td></td><td></td></tr>
  3752. <tr><td></td><td valign="top"><a href="#index-unlink_005fif_005fordinary"><code>unlink_if_ordinary</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3753. <tr><td></td><td valign="top"><a href="#index-unlock_005fstd_005fstreams"><code>unlock_std_streams</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3754. <tr><td></td><td valign="top"><a href="#index-unlock_005fstream"><code>unlock_stream</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3755. <tr><td></td><td valign="top"><a href="#index-unsetenv"><code>unsetenv</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3756. <tr><td></td><td valign="top"><a href="#index-using-libiberty">using libiberty</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Using">Using</a></td></tr>
  3757. <tr><td colspan="4"> <hr></td></tr>
  3758. <tr><th><a name="Index_cp_letter-V">V</a></th><td></td><td></td></tr>
  3759. <tr><td></td><td valign="top"><a href="#index-vasprintf"><code>vasprintf</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3760. <tr><td></td><td valign="top"><a href="#index-vfork"><code>vfork</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3761. <tr><td></td><td valign="top"><a href="#index-vfprintf"><code>vfprintf</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3762. <tr><td></td><td valign="top"><a href="#index-vprintf"><code>vprintf</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3763. <tr><td></td><td valign="top"><a href="#index-vsnprintf"><code>vsnprintf</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3764. <tr><td></td><td valign="top"><a href="#index-vsprintf"><code>vsprintf</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3765. <tr><td colspan="4"> <hr></td></tr>
  3766. <tr><th><a name="Index_cp_letter-W">W</a></th><td></td><td></td></tr>
  3767. <tr><td></td><td valign="top"><a href="#index-waitpid"><code>waitpid</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3768. <tr><td></td><td valign="top"><a href="#index-writeargv"><code>writeargv</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3769. <tr><td colspan="4"> <hr></td></tr>
  3770. <tr><th><a name="Index_cp_letter-X">X</a></th><td></td><td></td></tr>
  3771. <tr><td></td><td valign="top"><a href="#index-xasprintf"><code>xasprintf</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3772. <tr><td></td><td valign="top"><a href="#index-xatexit"><code>xatexit</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3773. <tr><td></td><td valign="top"><a href="#index-xcalloc"><code>xcalloc</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3774. <tr><td></td><td valign="top"><a href="#index-xexit"><code>xexit</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3775. <tr><td></td><td valign="top"><a href="#index-xmalloc"><code>xmalloc</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3776. <tr><td></td><td valign="top"><a href="#index-xmalloc_005ffailed"><code>xmalloc_failed</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3777. <tr><td></td><td valign="top"><a href="#index-xmalloc_005fset_005fprogram_005fname"><code>xmalloc_set_program_name</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3778. <tr><td></td><td valign="top"><a href="#index-xmemdup"><code>xmemdup</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3779. <tr><td></td><td valign="top"><a href="#index-xrealloc"><code>xrealloc</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3780. <tr><td></td><td valign="top"><a href="#index-xstrdup"><code>xstrdup</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3781. <tr><td></td><td valign="top"><a href="#index-xstrerror"><code>xstrerror</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3782. <tr><td></td><td valign="top"><a href="#index-xstrndup"><code>xstrndup</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3783. <tr><td></td><td valign="top"><a href="#index-xvasprintf"><code>xvasprintf</code></a>:</td><td>&nbsp;</td><td valign="top"><a href="#Functions">Functions</a></td></tr>
  3784. <tr><td colspan="4"> <hr></td></tr>
  3785. </table>
  3786. <table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Index_cp_letter-A"><b>A</b></a>
  3787. &nbsp;
  3788. <a class="summary-letter" href="#Index_cp_letter-B"><b>B</b></a>
  3789. &nbsp;
  3790. <a class="summary-letter" href="#Index_cp_letter-C"><b>C</b></a>
  3791. &nbsp;
  3792. <a class="summary-letter" href="#Index_cp_letter-D"><b>D</b></a>
  3793. &nbsp;
  3794. <a class="summary-letter" href="#Index_cp_letter-E"><b>E</b></a>
  3795. &nbsp;
  3796. <a class="summary-letter" href="#Index_cp_letter-F"><b>F</b></a>
  3797. &nbsp;
  3798. <a class="summary-letter" href="#Index_cp_letter-G"><b>G</b></a>
  3799. &nbsp;
  3800. <a class="summary-letter" href="#Index_cp_letter-H"><b>H</b></a>
  3801. &nbsp;
  3802. <a class="summary-letter" href="#Index_cp_letter-I"><b>I</b></a>
  3803. &nbsp;
  3804. <a class="summary-letter" href="#Index_cp_letter-L"><b>L</b></a>
  3805. &nbsp;
  3806. <a class="summary-letter" href="#Index_cp_letter-M"><b>M</b></a>
  3807. &nbsp;
  3808. <a class="summary-letter" href="#Index_cp_letter-O"><b>O</b></a>
  3809. &nbsp;
  3810. <a class="summary-letter" href="#Index_cp_letter-P"><b>P</b></a>
  3811. &nbsp;
  3812. <a class="summary-letter" href="#Index_cp_letter-R"><b>R</b></a>
  3813. &nbsp;
  3814. <a class="summary-letter" href="#Index_cp_letter-S"><b>S</b></a>
  3815. &nbsp;
  3816. <a class="summary-letter" href="#Index_cp_letter-T"><b>T</b></a>
  3817. &nbsp;
  3818. <a class="summary-letter" href="#Index_cp_letter-U"><b>U</b></a>
  3819. &nbsp;
  3820. <a class="summary-letter" href="#Index_cp_letter-V"><b>V</b></a>
  3821. &nbsp;
  3822. <a class="summary-letter" href="#Index_cp_letter-W"><b>W</b></a>
  3823. &nbsp;
  3824. <a class="summary-letter" href="#Index_cp_letter-X"><b>X</b></a>
  3825. &nbsp;
  3826. </td></tr></table>
  3827. <hr>
  3828. </body>
  3829. </html>